This markdown is a sketched summary of the Managing Projects with GNU Make.1
makestrives ultimately to update.
target1 target2: prerequisite1 prerequisite2 ... recipe1 recipe2 ...
\(Unix escape character).
Makefile can be executed by
make cli has an optional
target argument. Default behavior is to use the first target from the makefile called
foo: foo.c gcc foo.c -o foo
Typically real makefiles consist of more rules. Ordering of the rules in a makefile is generally from the most general rule to its detailed rules. Most general target at the top of the makefile is generally called all.
make decides what target to build by checking prerequisites. It prepares
the prerequisites of the rule before executing the recipe of the
target itself. If a target is newer than all of its prerequisites, meaning no
change has been done,
make won’t rebuild the target.
-lflflag for flex library. When
-ndisplays commands that would be executed for a given target.