#############################################################################
#
#  Makefile for lf
#
#############################################################################
#  If you move this makefile, update the variable below
#  or else depend won't work.
#############################################################################
MAKEFILE	= Makefile
CC		    = g++
CFILES		= lf.cc entry-handler.cc screen-handler.cc option-handler.cc \
              directory-handler.cc sort.cc Dirent.cc
HFILES		= entry-handler.h screen-handler.h option-handler.h \
              directory-handler.h Dirent.h
OFILES		= lf.o entry-handler.o screen-handler.o option-handler.o \
              directory-handler.o sort.o Dirent.o
PROGRAM		= lf
#############################################################################
LIBS		   = -ltermcap
DFLAGS		 = -g -Wall
OPTFLAGS   = -O -finline-functions -fstrength-reduce
CFLAGS		 = $(OPTFLAGS) $(DFLAGS)
#############################################################################
# G++ directives
#############################################################################
.SUFFIXES: .cc
.cc.o:
	$(CC) $(CFLAGS) -c $<
#############################################################################

$(PROGRAM):	$(OFILES)
	$(CC) $(LDFLAGS) $(OPTFLAGS) $(DFLAGS) $(OFILES) -o $(PROGRAM) $(LIBS)

clean:
	rm -f *.o *.out *~ #*# core

realclean: clean
	rm -f $(PROGRAM)

depend:
	g++dep -f $(MAKEFILE) $(CFILES)

# DO NOT DELETE THIS LINE -- g++dep uses it.
# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.

Dirent.o : Dirent.cc Dirent.h 
directory-handler.o : directory-handler.cc Dirent.h option-handler.h \
  entry-handler.h screen-handler.h directory-handler.h 
entry-handler.o : entry-handler.cc entry-handler.h screen-handler.h 
lf.o : lf.cc option-handler.h screen-handler.h directory-handler.h \
  entry-handler.h 
option-handler.o : option-handler.cc option-handler.h 
screen-handler.o : screen-handler.cc screen-handler.h 
sort.o : sort.cc 

# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
