# Version 1.0 DATADIR=../data LIB=./liblexer.a CC=gcc $(MOREFLAGS) -Wall TARGETS=hw5 dllistdriver btdriver lexerdriver EXECUTABLES=lexerdriver dllistdriver btdriver hw5 lexerdriver.exe dllistdriver.exe btdriver.exe hw5.exe a.out a.exe .PHONY: clean all hw5: hw5.o dllist/dllist.o bt/bt.o $(LIB) $(CC) -o hw5 $^ -lfl -L. -llexer -ldmem dllistdriver: dllist/dllist.o dllistdriver.o $(CC) -o dllistdriver dllistdriver.o dllist/dllist.o -L. -ldmem btdriver: bt/bt.o dllist/dllist.o btdriver.o $(CC) -o btdriver btdriver.o bt/bt.o dllist/dllist.o -L. -ldmem lexerdriver: lexerdriver.o $(LIB) $(CC) -o lexerdriver $^ -lfl -L. -llexer -ldmem all: $(TARGETS) $(LIB): lexer/lexer.c lexer/html.flex lexer.h cd lexer; make lib dllist/dllist.o: dllist/dllist.c dllist/dllist.h cd dllist; make dllist.o bt/bt.o: bt/bt.c bt/bt.h dllist/dllist.h cd bt; make bt.o runlexer: lexerdriver ./lexerdriver $(DATADIR) www.nytimes.com/index.html # this is a hack, but using it for simplicity. It will # force everything to be recompiled if any key .h file is # changed. %.o: %.c lexer.h dllist/dllist.h bt/bt.h $(CC) -c $< clean: rm -f *.o $(EXECUTABLES) *stackdump *~ cd bt; make clean cd dllist; make clean # cd lexer; make clean