Subj : NMAKE 1.40+ vs. Win95                                                 

Here's a bug I've just discovered which may be of interest to those of you
pondering doing development work under Win95.  It seems that Microsoft's NMAKE
version 1.40 and 1.50 (which shipped with Visual C++) do not work properly under
Windows 95.  I've reported this bug to Microsoft (and their results matched
mine), but it may take some time for them to address it.  NMAKE version 1.20
(which comes with MASM 6.11) does not seem to have this problem but has another
problem.

The Bug:  When a makefile is run, it should halt if it gets a non-zero return
code from any shell line.  Furthermore, if an error code is returned the target
just made should be deleted.

The Example:

-+--- makefile begins
beta.txt : alpha.txt
    copy alpha.txt beta.txt

alpha.txt : makefile
    test >alpha.txt

-+--- makefile ends

Test is a short assembly language file which returns a non-zero error code and
prints something to stdout:

-+--- test.asm begins
        .MODEL tiny
        .DATA
Message db      "TEST.COM: returning error code = 1",13,10,'$'
        .CODE
        ORG 100h
Start:
        mov     dx,offset Message       ; DS:DX ==> message
        mov     ah,9                    ; DOS TTY out function
        int     21h                     ; print the message
        mov     ax,4c01h                ; DOS terminate with errcode = 1
        int     21h                     ; do it

        END     Start
-+--- test.asm ends


Here are the results running under Win95:

-+--- results of NMAKE 1.40 under Win95
Microsoft (R) Program Maintenance Utility   Version 1.40
Copyright (c) Microsoft Corp 1988-93. All rights reserved.

        copy alpha.txt beta.txt
        1 file(s) copied
-+---

Both alpha.txt and beta.txt were created, no errors or warnings were reported,
and the make did not stop.  This is seriously broken.

-+--- deleted both TXT files and running NMAKE 1.20 under Win95
Loading NMAKE

Microsoft (R) Program Maintenance Utility   Version 1.20
Copyright (c) Microsoft Corp 1988-92. All rights reserved.

        test >alpha.txt
NMAKE : fatal error U1077: 'TEST' : return code '1'
Stop.
-+---

Close but no cigar.  ALPHA.TXT was created and still exists after the error.

-+--- My workaround is to change up to OpusMake:

OPUS MAKE Version 6.04
Copyright OPUS Software. All rights reserved.

test >alpha.txt

OPUS MAKE: Shell line exit status 1. Stop.
OPUS MAKE: makefile (line 5): Removing alpha.txt (warning).

-+--- 

This is what *should* happen.  When the make is complete, no bogus targets
remain on the drive and it has properly stopped the make process on getting the
error code.
