Microsoft KB Archive/73690

= Invoking NMAKE with /A Still Evaluates First Target Only =

Article ID: 73690

Article Last Modified on 12/1/2003

-

APPLIES TO


 * Microsoft Program Maintenance Utility 1.2
 * Microsoft Program Maintenance Utility 1.2
 * Microsoft Program Maintenance Utility 1.2
 * Microsoft Program Maintenance Utility 1.2
 * Microsoft Program Maintenance Utility 1.2
 * Microsoft Program Maintenance Utility 1.3
 * Microsoft Program Maintenance Utility 1.4
 * Microsoft Program Maintenance Utility 1.4
 * Microsoft Program Maintenance Utility 1.4
 * Microsoft Program Maintenance Utility 1.4
 * Microsoft Program Maintenance Utility 1.4
 * Microsoft Program Maintenance Utility 1.4
 * Microsoft Program Maintenance Utility 1.4
 * Microsoft Program Maintenance Utility 1.4

-



This article was previously published under Q73690



SUMMARY
The Microsoft NMAKE File Maintenance Utility evaluates only the first target in a makefile, even if the command line includes the /A option switch. This may not be readily apparent from the documentation, which states that the /A switch causes NMAKE to rebuild all requested targets, even if they are not out of date with respect to their dependents.



MORE INFORMATION
In the sample makefile below, NMAKE invokes the compiler to produce HELLO1.OBJ and then stops. The /A switch instructs NMAKE to call the compiler for HELLO1.C even if HELLO1.OBJ is more recent. The /A switch does not build all targets in the makefile.

To force NMAKE to evaluate each target, specify a pseudotarget as the first target in the make file. Specify the actual targets as dependents of the pseudotarget. The sample makefile below uses &quot;ALL&quot; as the pseudotarget. Remove the comment from that line to build all targets. For more information, please refer to the NMAKE documentation provided with your compiler or query in the Microsoft Knowledge Base on the following words:

nmake and pseudotarget and default

Sample Makefile
# line to build all of the targets
 * 1) ALL : hello1.exe hello2.exe  # Remove the comment from this

hello1.obj : hello1.c hello2.obj : hello2.c hello1.exe : hello1.obj hello2.exe : hello2.obj

Additional query words: kbinf 1.20 1.30 1.40 1.50

Keywords: KB73690

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.