make: Last Resort

1 
1 10.6 Defining Last-Resort Default Rules
1 =======================================
1 
1 You can define a last-resort implicit rule by writing a terminal
11 match-anything pattern rule with no prerequisites (⇒Match-Anything
 Rules).  This is just like any other pattern rule; the only thing
1 special about it is that it will match any target.  So such a rule's
1 recipe is used for all targets and prerequisites that have no recipe of
1 their own and for which no other implicit rule applies.
1 
1    For example, when testing a makefile, you might not care if the
1 source files contain real data, only that they exist.  Then you might do
1 this:
1 
1      %::
1              touch $@
1 
1 to cause all the source files needed (as prerequisites) to be created
1 automatically.
1 
1    You can instead define a recipe to be used for targets for which
1 there are no rules at all, even ones which don't specify recipes.  You
1 do this by writing a rule for the target '.DEFAULT'.  Such a rule's
1 recipe is used for all prerequisites which do not appear as targets in
1 any explicit rule, and for which no implicit rule applies.  Naturally,
1 there is no '.DEFAULT' rule unless you write one.
1 
1    If you use '.DEFAULT' with no recipe or prerequisites:
1 
1      .DEFAULT:
1 
1 the recipe previously stored for '.DEFAULT' is cleared.  Then 'make'
1 acts as if you had never defined '.DEFAULT' at all.
1 
1    If you do not want a target to get the recipe from a match-anything
1 pattern rule or '.DEFAULT', but you also do not want any recipe to be
11 run for the target, you can give it an empty recipe (⇒Defining
 Empty Recipes Empty Recipes.).
1 
1    You can use a last-resort rule to override part of another makefile.
1 ⇒Overriding Part of Another Makefile Overriding Makefiles.
1