make: MAKE Variable
1
1 5.7.1 How the 'MAKE' Variable Works
1 -----------------------------------
1
1 Recursive 'make' commands should always use the variable 'MAKE', not the
1 explicit command name 'make', as shown here:
1
1 subsystem:
1 cd subdir && $(MAKE)
1
1 The value of this variable is the file name with which 'make' was
1 invoked. If this file name was '/bin/make', then the recipe executed is
1 'cd subdir && /bin/make'. If you use a special version of 'make' to run
1 the top-level makefile, the same special version will be executed for
1 recursive invocations.
1
1 As a special feature, using the variable 'MAKE' in the recipe of a
1 rule alters the effects of the '-t' ('--touch'), '-n' ('--just-print'),
1 or '-q' ('--question') option. Using the 'MAKE' variable has the same
1 effect as using a '+' character at the beginning of the recipe line.
1 ⇒Instead of Executing the Recipes Instead of Execution. This
1 special feature is only enabled if the 'MAKE' variable appears directly
1 in the recipe: it does not apply if the 'MAKE' variable is referenced
1 through expansion of another variable. In the latter case you must use
1 the '+' token to get these special effects.
1
1 Consider the command 'make -t' in the above example. (The '-t'
1 option marks targets as up to date without actually running any recipes;
1 see ⇒Instead of Execution.) Following the usual definition of
1 '-t', a 'make -t' command in the example would create a file named
1 'subsystem' and do nothing else. What you really want it to do is run
1 'cd subdir && make -t'; but that would require executing the recipe, and
1 '-t' says not to execute recipes.
1
1 The special feature makes this do what you want: whenever a recipe
1 line of a rule contains the variable 'MAKE', the flags '-t', '-n' and
1 '-q' do not apply to that line. Recipe lines containing 'MAKE' are
1 executed normally despite the presence of a flag that causes most
1 recipes not to be run. The usual 'MAKEFLAGS' mechanism passes the flags
11 to the sub-'make' (⇒Communicating Options to a Sub-'make'
Options/Recursion.), so your request to touch the files, or print the
1 recipes, is propagated to the subsystem.
1