Inference Rule Search Paths

The inference-rule syntax described previously tells NMAKE to look for the specified files in the current directory. You can also specify directories to be searched by NMAKE when it looks for files. An inference rule that specifies paths has the following syntax:

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

No spaces are allowed. The frompath directory must match the directory specified for the dependent file; similarly, topath must match the target's directory specification. For NMAKE to apply an inference rule to a dependency, the paths in the dependency line must match the paths specified in the inference rule exactly. For example, if the current directory is called PROJ, the inference rule

{..\proj}.exe{..\proj}.obj:

does not apply to the dependency

project1.exe : project1.obj

If you use a path on one extension in the inference rule, you must use paths on both. You can specify the current directory by either a period (.) or an empty pair of braces ({}).

You can specify only one path for each extension in an inference rule. To specify more than one path, you must create a separate inference rule for each path.

Macros can be invoked to represent frompath and topath; the macros are expanded during preprocessing.