ID Number: Q81304
1.13 | 1.13
MS-DOS | OS/2
buglist1.13 fixlist1.20
Summary:
PROBLEM ID: NMK9202002
SYMPTOMS
When multiple dependency blocks are defined by using the '::'
operator with NMAKE version 1.13, the commands that will be
executed may be different then the commands that will be displayed
with the /N command-line switch.
STATUS
Microsoft has confirmed this to be a problem in NMAKE version 1.13.
This problem has been fixed in NMAKE version 1.20.
More Information:
The /N command-line option is used to display commands that NMAKE
would execute, but does not actually execute. When there are multiple
dependency blocks for the same target, the commands that should be
executed are displayed correctly when /N is used. However, when the
makefile is actually executed, only the commands from the first
dependency block may be executed.
For example, with the following makefile, invoking NMAKE with the
the /N results in the following commands:
cl /c file1.c
lib mylib.lib +file1.obj
cl /c file2.c
lib mylib.lib +file2.obj
When NMAKE is invoked without the /N option, only these commands are
executed:
cl /c file1.c
lib mylib.lib +file1.obj
This primarily occurs when the target does not exist. In the sample
below, if MYLIB.LIB already exists then all commands are executed
correctly. You may need to invoke NMAKE with a /A if both dependent
files are up to date.
Sample Code
-----------
/* Command line options needed: /N
*/
ALL : mylib.lib
mylib.lib :: file1.c
cl /c file1.c
lib mylib.lib +file1.obj;
mylib.lib :: file2.c
cl /c file2.c
lib mylib.lib +file2.obj;