Invoking NMAKE with /A Still Evaluates First Target Only

Last reviewed: February 17, 1995
Article ID: Q73690
The information in this article applies to:
  • Microsoft NMAKE Utility for MS-DOS, versions 1.01, 1.11, 1.12, 1.13, 1.2, 1.3, and 1.4
  • Microsoft NMAKE Utility for OS/2, versions 1.01, 1.11, 1.12, 1.13, and 1.21
  • Microsoft NMAKE Utility for Windows NT, versions 1.4 and 1.5

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 "ALL" 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

# ALL : hello1.exe hello2.exe # Remove the comment from this

                               # line to build all of the targets

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


Additional reference words: kbinf kbinf 1.20 1.30 1.40 1.50
KBCategory: kbtool
KBSubcategory: NmakeIss


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 17, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.