Batch-Mode Rules

Batch-mode inference rules provide only one invocation of the inference rule when N commands go through this inference rule. Without batch-mode inference rules, it would require N commands to be invoked. N is the number of dependents that trigger the inference rule.

Makefiles that contain batch-mode inference rules must use NMAKE version 1.62 or higher. To check the NMAKE version, run the _NMAKE_VER macro available with NMAKE version 1.62 or higher. This macro returns an integer representing the NMAKE version. For example, the macro returns 162 for NMAKE version 1.62.

A batch-mode inference rule has the following syntax:

{frompath}.fromext{topath}.toext::
commands

The only syntactical difference from the standard inference rule is that the batch-mode inference rule is terminated with a double colon (::).

Note: The tool being invoked must be able to handle multiple files. The batch-mode inference rule must use $< as the macro to access dependent files.

The batch-mode inference rules can speed up the build process. It is faster to supply files to the compiler in batch, because the compiler driver is invoked only once.