More Makefiles

#Ex. 4

#Suffix rules

#Clears the list of suffixes

.SUFFIXES:

#"Significant suffixes" -- .cpp and .o

#Any suffix rules use .cpp or .o files only

.SUFFIXES: .cpp .o

#Here is the suffix rule...

#It says, to make a .o from a .cpp,

#execute g++ -c -o target target.cpp

#so, make line.o executes:

#g++ -c -o line.o line.cpp

.cpp.o:; g++ -c -o $@ $*.cpp

#could also be written

#.cpp.o:; g++ -c -o $@ $<