make: Rules

1 
1 4 Writing Rules
1 ***************
1 
1 A "rule" appears in the makefile and says when and how to remake certain
1 files, called the rule's "targets" (most often only one per rule).  It
1 lists the other files that are the "prerequisites" of the target, and
1 the "recipe" to use to create or update the target.
1 
1    The order of rules is not significant, except for determining the
1 "default goal": the target for 'make' to consider, if you do not
1 otherwise specify one.  The default goal is the target of the first rule
1 in the first makefile.  If the first rule has multiple targets, only the
1 first target is taken as the default.  There are two exceptions: a
1 target starting with a period is not a default unless it contains one or
1 more slashes, '/', as well; and, a target that defines a pattern rule
11 has no effect on the default goal.  (⇒Defining and Redefining
 Pattern Rules Pattern Rules.)
1 
1    Therefore, we usually write the makefile so that the first rule is
1 the one for compiling the entire program or all the programs described
11 by the makefile (often with a target called 'all').  ⇒Arguments to
 Specify the Goals Goals.
1 

Menu