Title: notes on GNU make Subject: As I start using make more, notes I've accomulated. do "info make" and search for "Pattern Rule Examples" # Rule to run m4 to create cpp files M4 := /usr/bin/m4 %.cpp: %.m4 \t$(M4) < $< > $@ Assignment: http://www.gnu.org/software/make/manual/make.html#Reading-Makefiles # Normal setting of a variable - values within it are recursively expanded when the variable is used, not when it's declared VARIABLE = value # Setting of a variable with simple expansion of the values inside - values within it are expanded at declaration time. VARIABLE := value # Setting of a variable only if it doesn't have a value VARIABLE ?= value # Appending the supplied value to the existing value VARIABLE += value Automatic Variables http://www.gnu.org/software/make/manual/html_node/Automatic-Variables.html # target $@ # All prerequisits, no repeats $^ # All prerequisits, repeates $+ # first prereqisit to be rebuilt $< # The target member name, when the target is an archive member. For foo.a(bar.o) ‘$%’ is bar.o. ‘$%’ empty when target is not archive member. $% # The names of all the order-only prerequisites, with spaces between them. $| # The stem with which an implicit rule matches $*