DebugFlag=-g TemplateFlag= test: testArray.o Array.o # Create executable named test via -o option g++ -o test testArray.o Array.o $(DebugFlag) $(TemplateFlag) testArray.o: testArray.cpp Array.h # Make object code for the application g++ -c testArray.cpp $(TemplateFlag) $(DebugFlag) Array.o: Array.cpp Array.h # Make object code for the class; explicit instantiations in Array.cpp required g++ -c Array.cpp $(TemplateFlag) $(DebugFlag) clean: # Remove all but source code & makefile \rm -f *.o