Next: 6 Second make invocation Up: GNUstep Makefile Package Internals Previous: 4 The %.variables rule

5 The %.variables rule - second make invocation

The rule body parses the %.variables string - for example when the rule is applied to
then (remember that $* is the stem of the rule, decrypt.all.tool in this case) it extracts
and then it runs a make subprocess, specific to that target, type and operation. In our case, the %.variables rules is executed twice, once to build
and once to build
so the result is to run two separate make processes:
make internal-tool-all INTERNAL_tool_NAME=decrypt TARGET=decrypt \
  OBJC_FILES="$(decrypt_OBJC_FILES)" \
make internal-library-all INTERNAL_library_NAME=libDvd TARGET=libDvd \
where ... stands for a lot of other variables, including all variables needed to perform the final stage: OBJC_FILES, C_FILES, JAVA_FILES, ADDITIONAL_INCLUDE_DIRS etc. Note that each make subprocess will get passed different, specific, variables. If gnustep-make wants to modify these variables in some way, it does it at this stage, before passing them to the submake process. For example, some library flags are filtered through the WHICH_LIB_SCRIPT.

What this means is that for each target/type/operation, a separate make process is run. For example, if you have two tools, decrypt and crypt, and you want to both compile and install them, it will run four make subprocesses:

make internal-tool-all INTERNAL_tool_NAME=decrypt ...
make internal-tool-all INTERNAL_tool_NAME=crypt ...
make internal-tool-install INTERNAL_tool_NAME=decrypt ...
make internal-tool-install INTERNAL_tool_NAME=crypt ...
This is the `second make invocation'. The make package knows that it is being invoked for the second time, because of the INTERNAL_tool_NAME being non-empty.

Next: 6 Second make invocation Up: GNUstep Makefile Package Internals Previous: 4 The %.variables rule
Richard Frith-Macdonald 2013-07-26