# Makefile OBJS = term_control.o Lexer.o error_handling.o Postfix_Evaluator.o pe_driver.o CC = g++ DEBUG = -g CFLAGS = -Wall -pedantic -ansi $(DEBUG) LFLAGS = -Wall $(DEBUG) programs: pe_driver wfseq lexdriver pe_driver: $(OBJS) $(CC) $(LFLAGS) $(OBJS) -o pe_driver # a driver to Postfix_Evaluator pe_driver.o : term_control.o Lexer.o Postfix_Evaluator.o error_handling.o pe_driver.cpp $(CC) -c $(CFLAGS) pe_driver.cpp # uses Lexer to check whether a sequence of tokens is well-formed wfseq: Lexer.o wfseq.cpp $(CC) $(LFLAGS) Lexer.o wfseq.cpp -o wfseq # only uses Lexer to test the Lexer class lexdriver : Lexer.o lexdriver.cpp $(CC) $(CFLAGS) Lexer.o lexdriver.cpp -o lexdriver # uses Lexer, error_handling Postfix_Evaluator.o : Lexer.o error_handling.o term_control.o Postfix_Evaluator.h Postfix_Evaluator.cpp $(CC) -c $(CFLAGS) Postfix_Evaluator.cpp # error handling routines make use of terminal control routines error_handling.o : term_control.o error_handling.h error_handling.cpp $(CC) -c $(CFLAGS) error_handling.cpp # the Lexer is fairly independent Lexer.o : Lexer.h Lexer.cpp $(CC) -c $(CFLAGS) Lexer.cpp # this object file is at the "lowest level" term_control.o : term_control.h term_control.cpp $(CC) -c $(CFLAGS) term_control.cpp clean: rm -f *.o a.out pe_driver wfseq lexdriver