Share via


NTTARGETFILES

If you have unique rules in your subdirectory that build custom targets, you can use the NTTARGETFILES macro to signal to the Build utility that you have a Makefile.inc file in addition to the Sources file in the subdirectory. When you use the NTTARGETFILES macro, the Makefile.inc is automatically included in the build process.

The Makefile.inc file provides additional information about the build process (such as dependencies, command-line rules, and other build rules) that is required to build your custom targets. Make sure that your rules specify the correct paths for targets so that incremental builds work correctly.

Do not use the NTTARGETFILES macro. Instead, use the NTTARGETFILE0, NTTARGETFILE1 or NTTARGETFILE2 macros. If you use the NTTARGETFILES macro, you have to test for the build pass for targets that can only be built on a particular pass of the build process. This causes the build process to start the NMAKE utility in the current build directory for all passes, and can lead to complicated and confusing rules within the Sources file:

// sources
...
NTTARGETFILES=Custom_target
 
// Makefile.inc
Custom_target:
!if "$(BUILD_PASS)" == "PASS2" || "$(BUILD_PASS)" == "ALL" 
   <do action>
!endif

If you use the NTTARGETFILE0, NTTARGETFILE1, or NTTARGETFILE2 macros, you avoid rebuilding your targets in multiple passes and can specify the correct pass to build your targets in.

See Also

Makefile.inc File,

NTTARGETFILE0,

NTTARGETFILE1,

NTTARGETFILE2,

Sources File

 

 

Send comments about this topic to Microsoft

Build date: 5/3/2011