Inference Rule May Fail When Spaces on Blank Command Line

Last reviewed: July 17, 1997
Article ID: Q50383
1.01 1.10 1.11 1.12 1.13 1.20 1.30 1.40 | 1.11 1.12 1.21
MS-DOS                                  | OS/2
kbtool

The information in this article applies to:

  • Microsoft NMAKE Utility for MS-DOS, versions 1.01, 1.1, 1.11, 1.12, 1.13, 1.2, 1.3, 1.4
  • Microsoft NMAKE Utility for OS/2, versions 1.01, 1.11, 1.12, 1.21 ---------------------------------------------------------------------

SUMMARY

When using inference rules in an NMAKE description file, the target/dependency line must be followed by a blank line (no space characters); otherwise, the inference rule commands will not be executed. NMAKE checks this line for any ASCII characters; if ANY characters exist, NMAKE will ignore the inference rule and try to execute the line, even if it contains only a space or spaces.

The following is a simple example, which demonstrates this problem:

.c.exe:

  cl $**

ALL : main.exe

main.exe : main.c <space>

Nothing happens if this description file is passed to NMAKE because the space character causes NMAKE to assume there are explicit commands following the target/dependency line, causing it to ignore the inference rule. Note that this is expected behavior for NMAKE.

MORE INFORMATION

MAKE version 4.x inference rules/description blocks do not exhibit this behavior. This is something to keep in mind when converting description files from MAKE to NMAKE.


Additional reference words: kbinf kbinf 1.10 1.20 1.30 1.40
KBCategory: kbtool
KBSubcategory: NmakeIss
Keywords : kb16bitonly


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: July 17, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.