help-make
[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: Eli Zaretskii
Subject: Re: make3.81-beta4 mingw not failing on error?
Date: Tue, 07 Mar 2006 21:31:18 +0200

> Date: Mon, 06 Mar 2006 23:56:59 -0600
> From: Matt England <address@hidden>
> Cc: "Paul D. Smith" <address@hidden>,address@hidden,
>  address@hidden,address@hidden
> 
> Ok, so I built make-3.81rc1 and still experience make not stopping upon 
> errors.

I think this is expected behavior, at least on the Make side.  See
below.

> $ make main.exe
> -- generating makefile: main.d
> 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
> 
> Note that the first error should stop the make, but it doesn't.

No, it shouldn't stop Make, IMO.  This is because these two commands
are actually a single shell command, as far as Make is concerned:

> $(DDD_FILES):
>          @echo -- generating makefile: $@
>          @set -e; rm -f $@;                                          \
>          echo "$(DFILE_HDR)" > $@;                                   \
>          $(CXX) -M $(CXXFLAGS) $< > address@hidden(PID);                      
> \
>          sed 's,^.*\.o[ :]*,$(@:%.d=%.o) $@: ,g' < address@hidden(PID) >> $@; 
>  \
>          rm -f address@hidden(PID)

The command here is a single shell command, as evidenced by the
backslashes before each newline.  So Make doesn't regain control until
this whole multi-line command returns.

In other words, if the command needs to stop after the first error,
it's the shell that needs to stop and return to Make.

I don't know how this worked on Cygwin for you, perhaps you used a
different shell, or perhaps the Cygwin Make interacts differently with
the shell.




reply via email to

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