make-w32
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: make3.81-beta4 mingw not failing on error?


From: Greg Chicares
Subject: Re: make3.81-beta4 mingw not failing on error?
Date: Wed, 08 Mar 2006 14:40:58 +0000
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

On 2006-3-8 3:31 UTC, Matt England wrote:
> 
> Thanks for helping helping out with this, this was just the sort of
> testing I'm seeking.
> 
> At 3/7/2006 09:14 PM, Greg Chicares wrote:
> 
[...]
>> /c/tmp/me_make-test[2]$../make-3.81beta4/make
>> g++ -c  main.cpp -o main.o
>> main.cpp:1:21: sys/msg.h: No such file or directory
>> make: *** [main.o] Error 1
[...]
>>
>> That's the desired stop-on-error behavior, right?
> 
> Actually, know.  I want it to stop on the "g++ -M" (or "g++ -MM", almost
> the same thing) lines, which say something like "--generating makefile...".
> 
> To do this, run:
> 
> make main.exe
> make alt1.exe
> 
> ...I think.  (I had to mod my Makefile and usage instructions to make it
> simple).
> 
> and/or run:
> 
> make all

OK, I see now: you're treating 'make all' as a special case
by testing for 'all' in $(MAKECMDGOALS), and likewise for
the two '.exe' targets.

First, let's try MSYS's own 'make' in its own 'bash':

/c/tmp/me_make-test[0]$ls
Makefile  alt1.cpp  main.cpp
/c/tmp/me_make-test[0]$/c/msys/1.0/bin/make main.exe
-- generating makefile: main.d
set -e; rm -f main.d;                                          \
echo "# DO NOT CHANGE THIS FILE; it was auto-generated by a make process." > 
main.d;                                   \
g++ -M  main.cpp > main.d.2608;                      \
sed 's,^.*\.o[ :]*,main.o main.d: ,g' < main.d.2608 >> main.d;  \
rm -f main.d.2608
main.cpp:1:21: sys/msg.h: No such file or directory
make: *** [main.d] Error 1
/c/tmp/me_make-test[2]$ls
Makefile  alt1.cpp  main.cpp  main.d  main.d.2608
/c/tmp/me_make-test[0]$cat main.d
# DO NOT CHANGE THIS FILE; it was auto-generated by a make process.

Neither the 'sed' nor the last 'rm' command was executed,
and 'make' stopped right there, which is what you want.

Now let's try the release candidate:

/c/tmp/me_make-test[0]$ls
Makefile  alt1.cpp  main.cpp
/c/tmp/me_make-test[0]$../make-3.81beta4/make main.exe
-- generating makefile: main.d
set -e; rm -f main.d;                                          \
        echo "# DO NOT CHANGE THIS FILE; it was auto-generated by a make 
process." > main.d;                                   \
        g++ -M  main.cpp > main.d.3760;                      \
        sed 's,^.*\.o[ :]*,main.o main.d: ,g' < main.d.3760 >> main.d;  \
        rm -f main.d.3760
main.cpp:1:21: sys/msg.h: No such file or directory
g++ -c  main.cpp -o main.o
main.cpp:1:21: sys/msg.h: No such file or directory
make: *** [main.o] Error 1
/c/tmp/me_make-test[2]$ls
Makefile  alt1.cpp  main.cpp  main.d  main.d.3760

This time, 'make' didn't stop where expected: it proceeded
to attempt 'g++ -c  main.cpp -o main.o'. I think that's the
problem you're reporting.

Now let's try the same thing in a native msw port of zsh:

C:/tmp/me_make-test[0]$path=(/MinGW-20050120/bin/ /usr/bin/ /usr/local/bin/)

First, the old make I've been using for so many years that
I don't remember where it came from. This zsh port doesn't
seem to understand $(PID), so I'll force it to 9999.

C:/tmp/me_make-test[0]$ls
Makefile          alt1.cpp          main.cpp          make-test.tar.gz
C:/tmp/me_make-test[0]$make main.exe PID=9999
-- generating makefile: main.d
set -e; rm -f main.d;                                          \
echo "# DO NOT CHANGE THIS FILE; it was auto-generated by a make process." > mai
n.d;                                   \
g++ -M  main.cpp > main.d.9999;                      \
sed 's,^.*\.o[ :]*,main.o main.d: ,g' < main.d.9999 >> main.d;  \
rm -f main.d.9999
main.cpp:1:21: sys/msg.h: No such file or directory
\usr\bin\\make.EXE: *** [main.d] Error 1

'make' stopped on the failing command. FWIW:

C:/tmp/me_make-test[2]$make --version
GNU Make version 3.79.1, by Richard Stallman and Roland McGrath.
Built for mingw32
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
        Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

Report bugs to <address@hidden>.

Now the release candidate:

C:/tmp/me_make-test[0]$ls
Makefile          alt1.cpp          main.cpp          make-test.tar.gz
C:/tmp/me_make-test[0]$../make-3.81beta4/make main.exe PID=9999
-- generating makefile: main.d
set -e; rm -f main.d;                                          \
        echo "# DO NOT CHANGE THIS FILE; it was auto-generated by a make process
." > main.d;                                   \
        g++ -M  main.cpp > main.d.9999;                      \
        sed 's,^.*\.o[ :]*,main.o main.d: ,g' < main.d.9999 >> main.d;  \
        rm -f main.d.9999
main.cpp:1:21: sys/msg.h: No such file or directory
g++ -c  main.cpp -o main.o
main.cpp:1:21: sys/msg.h: No such file or directory
make.EXE: *** [main.o] Error 1
C:/tmp/me_make-test[2]$

Here, 'make' proceeded past the first failing command.
So it looks like the problem can be reproduced without
using MSYS's bash--instead using a non-MSYS zsh and
an MSYS-built 'make' beta.

Here's some debug output with the release candidate:

CreateProcess(C:\usr\bin\sh.exe,/usr/bin/sh.exe -c "set -e; rm -f main.d;
                                   \
echo \"# DO NOT CHANGE THIS FILE; it was auto-generated by a make process.\" > m
ain.d;                                   \
g++ -M  main.cpp > main.d.9999;                      \
sed 's,^.*\.o[ :]*,main.o main.d: ,g' < main.d.9999 >> main.d;  \
rm -f main.d.9999",...)
Live child 0x00c22100 (main.d) PID 12722752
main.cpp:1:21: sys/msg.h: No such file or directory
Reaping losing child 0x00c22100 PID 12722752
Removing child 0x00c22100 PID 12722752 from chain.
 Failed to remake target file `main.d'.
 Considering target file `Makefile'.
[...]
 No need to remake target `Makefile'.
Updating goal targets....
Considering target file `main.exe'.
 File `main.exe' does not exist.
  Considering target file `main.o'.
   File `main.o' does not exist.
    Pruning file `main.cpp'.
   Finished prerequisites of target file `main.o'.
  Must remake target `main.o'.
g++ -c  main.cpp -o main.o
CreateProcess(C:\MinGW-20050120\bin\g++.exe,g++ -c main.cpp -o main.o,...)
Putting child 0x00c23530 (main.o) PID 12722752 on the chain.
Live child 0x00c23530 (main.o) PID 12722752
main.cpp:1:21: sys/msg.h: No such file or directory
Reaping losing child 0x00c23530 PID 12722752
make.EXE: *** [main.o] Error 1

and from the old 'make' that seems to work as desired:

CreateProcess(C:\usr\bin\sh.exe,/usr/bin/sh.exe -c "set -e; rm -f main.d;
                                    echo \"# DO NOT CHANGE THIS FILE; it was aut
o-generated by a make process.\" > main.d;                                    g+
+ -M  main.cpp > main.d.9999;                       sed 's,^.*\.o[ :]*,main.o ma
in.d: ,g' < main.d.9999 >> main.d;   rm -f main.d.9999",...)
Live child 0x003de110 (main.d) PID 4057464
main.cpp:1:21: sys/msg.h: No such file or directory
Reaping losing child 0x003de110 PID 4057464
\usr\bin\\make.EXE: *** [main.d] Error 1
Removing child 0x003de110 PID 4057464  from chain.

So where the release candidate says

Reaping losing child 0x00c22100 PID 12722752
Removing child 0x00c22100 PID 12722752 from chain.

the old version of 'make' says

Reaping losing child 0x003de110 PID 4057464
\usr\bin\\make.EXE: *** [main.d] Error 1
Removing child 0x003de110 PID 4057464  from chain.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]