DebugFlag=-g TemplateFlag= test: testArray.o Array.o # Create executable g++ -o test testArray.o Array.o $(DebugFlag) $(TemplateFlag) testArray.o: testArray.cpp Array.h # Create object code g++ -c testArray.cpp $(TemplateFlag) $(DebugFlag) Array.o: Array.cpp Array.h # Make a temporary copy cp Array.cpp temp.cpp # append the explicit instantiations to the temporary cat types.tpp >> temp.cpp # compile the compendium g++ -c temp.cpp $(TemplateFlag) $(DebugFlag) # Make this the object code for the array; now has all instantiations mv temp.o Array.o # Remove the temporary \rm -f temp.cpp clean: \rm -f *.o test