It looks like the value of .SHELLSTATUS is not always set correctly when the 
$(shell ...) command is terminated by a signal.

Here's a Makefile which demonstrates this behavior:

STDOUT := $(shell kill -s SEGV $$$$)
$(info status=$(.SHELLSTATUS) stdout="$(STDOUT)")
$(error Stop)

I ran this Makefile on Debian 8 Linux using gmake 4.2.1 and got the following 
output:

$ gmake
status=0 stdout=" "
Makefile:3: *** Stop.  Stop.

I would have expected behavior similar to what happens when a recipe is 
interrupted by a signal, where gmake receives a non-zero exit value from the 
recipe.

Is this the expected behavior of .SHELLSTATUS in this use case?

Thanks!

Troy Runkel

_______________________________________________
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make

Reply via email to