This markdown is a sketched summary of the Managing Projects with GNU Make.1
clean
.make
strives ultimately to update.target1 target2: prerequisite1 prerequisite2 ...
recipe1
recipe2
...
\t
character.#
.\
(Unix escape
character).Makefile can be executed by make
command. make
cli has an optional
target argument. Default behavior is to use the first target from the makefile called
default goal.
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.
Simply, 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.
-lfl
flag for flex library.
When -l<NAME>
is seen make
searches for
lib<NAME>.so
and lib<NAME>.a
files.--just-print
or -n
displays commands that would be executed for a given
target.