# # Makefile for CompositeVisitor # # author: Robert Keller # # $Id: Makefile,v 1.2 2002/03/13 21:11:13 keller Exp $ # EXE = CompositeVisitor SRC = CompositeVisitor.cpp TestResult = testResult.txt TestOutput = result.txt Expected = expected.txt Diffs = diffs.txt Compiler = g++ Flags = -Wall -pedantic DocTool = doxygen DocConfig = Doxyfile Remove = /bin/rm -rf main : $(EXE) $(Diffs) # Compile $(EXE) : $(SRC) @echo '*** Compiling $(SRC)' $(Compiler) $(Flags) -o $(EXE) $(SRC) # Generate documentation doc : $(SRC) $(DocConfig) @echo '*** Documenting $(SRC)' $(DocTool) # Execute $(TestResult): $(EXE) @echo '*** Executing $(EXE), results in $(TestResult) $(EXE) > $(TestResult) # Test # Run the executable, then diff the results against the expected. # Indicate whether there were differences. $(Diffs) : $(TestResult) $(Expected) @echo '*** test by diffing $(TestResult) with $(Expected)' @if( diff $(TestResult) $(Expected) > $(Diffs) ); \ then echo '*** test succeeded'; \ else echo '*** test failed'; \ fi # Clean clean : tidy $(Remove) $(EXE) # Tidy tidy : $(Remove) $(Diffs) $(Remove) $(TestResult) # # $Log: Makefile,v $ # Revision 1.2 2002/03/13 21:11:13 keller # added Log lines at end # #