KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q44130: Modifications for an Existing Make File Used with MAKE

Article: Q44130
Product(s): See article
Version(s): 1.00   | 1.10
Operating System(s): MS-DOS | OS/2
Keyword(s): ENDUSER | s_quickc s_c h_FORTRAN | mspl13_basic
Last Modified: 16-JAN-1990

Question:

What modifications need to be made to an existing make file that was
used with MAKE, and why?

Response:

To use NMAKE on make files originally designed for MAKE, the first
descriptor block (target:dependent) must be a pseudotarget (see QuickC
Version 2.00 ToolKit, Sections 7.3.5 and 7.5) that lists all of the
original make targets in the file as the dependent files. The
following is an example:

   ALL : test.exe test1.exe test2.exe

The reason you must include a pseudotarget descriptor block as the
first descriptor block in a make file is that the previous MAKE
utility tested EACH descriptor block sequentially throughout the file.
NMAKE, however, tests only the FIRST descriptor block unless targets
are specifically listed on the NMAKE command line. By using a
pseudotarget, ALL in the above example, NMAKE must now assume
that each dependent is out of date and attempt to make it. NMAKE now
searches the make file for each dependent file listed (test.exe,
test1.exe, and test2.exe) to see if a descriptor block exists for it.
This causes NMAKE to behave just like MAKE.

Example:
-------

   ALL : test.exe test1.obj

   test1.obj : test1.c
           cl /c test1.c

   test.exe : test.obj test1.obj
           link test test1;

Without the pseudotarget, NMAKE tests only the first descriptor block
and ignores any following descriptor block.

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.