KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q68234: Recursively Calling NMAKE Using the MAKEFLAGS Macro

Article: Q68234
Product(s): See article
Version(s): 1.11   | 1.11
Operating System(s): MS-DOS | OS/2
Keyword(s): ENDUSER | docerr | mspl13_basic
Last Modified: 17-JAN-1991

According to page 113 of the "Microsoft C Advanced Programming
Techniques" manual, if you want to invoke NMAKE recursively, the macro
$(MAKEFLAGS) can be used to pass the command-line switches to the
recursively invoked NMAKE. However, the $(MAKEFLAGS) macro will
contain only the letters of the switches and will not contain the
actual command-line syntax.

For example, if the original command line contained "/D /N", the
$(MAKEFLAGS) macro will contain "DN". This results in NMAKE trying to
use the $(MAKEFLAGS) macro as the name of the makefile, rather than as
command-line switches. To use the $(MAKEFLAGS) macro to invoke NMAKE
recursively, it is necessary to precede it with a hyphen (-) or
forward slash (/) so that NMAKE uses the macro as a set of
command-line switches. The documentation should read:

   $(MAKE) -$(MAKEFLAGS)

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.

Copyright Microsoft Corporation 1986-2002.