KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q66644: NMAKE /N Doesn’t Work Across Multiple Dependency Blocks

Article: Q66644
Product(s): See article
Version(s): 1.11 1.12 | 1.11 1.12
Operating System(s): MS-DOS | OS/2
Keyword(s): ENDUSER | buglist1.11 buglist1.12 | mspl13_basic
Last Modified: 7-NOV-1990

Given the sample makefile below and the fact that mod2.c has been
changed, invoking NMAKE /N displays the following commands:

   cl /c -c mod2.c
   lib sub.lib -+ mod2.obj;

However, if NMAKE is run without the /N parameter, the following
commands will be executed:

   cl /c -c mod2.c
   lib sub.lib -+ mod2.obj;
   link boss.obj,,,sub.lib;

The /N switch is used to debug the logic of makefiles without actually
processing them. In this case, the commands that /N indicates will be
executed are not the same as those that actually are executed. This is
caused by the multiple dependencies for sub.lib. If the makefile is
changed to eliminate the multiple dependency blocks, the /N switch
will function correctly.

Microsoft has confirmed this to be a problem in NMAKE versions 1.11
and 1.12. We are researching this problem and will post new
information here as it becomes available.

Sample Code
-----------

CFLAGS=/c

.obj.exe:
        link $<,,,sub.lib;

all:boss.exe

boss.exe:boss.obj  sub.lib

boss.obj:

sub.lib:: mod1.obj
        lib $@ -+ mod1.obj;

sub.lib:: mod2.obj
        lib $@ -+ mod2.obj;

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.