# # A few rules for formulating makefiles: # # -- the best name for a makefile is "makefile", or alternatively, "Makefile" # -- form of a rule is # # target : dependencies # command-line-that-builds-target # # -- the link rule that executes last, comes first in the file # -- each .cpp gets a rule # -- the .h files that it includes, transitively, are all dependencies # djb: djb.o bookshelf.o g++ -o djb djb.o bookshelf.o djb.o: djb.cpp bookshelf.h book.h g++ -c djb.cpp bookshelf.o: bookshelf.cpp bookshelf.h book.h g++ -c bookshelf.cpp