Update of bug #40431 (project make): Status: None => Duplicate Open/Closed: Open => Closed
_______________________________________________________ Follow-up Comment #3: First, having -e enabled by default for recipes is a requirement of the latest POSIX spec. GNU make by default adheres to the previous POSIX spec in this respect, where -e was required to NOT be present. I'm not willing to break backward-compatibility in this way, even if POSIX doesn't care. If you use the .POSIX: pseudo-target to request POSIX-compatibility mode, then -e will be enabled by default and you don't need to change .SHELLFLAGS. Second, the behavior of .SHELLFLAGS with multiple options is correct in the currently released version of GNU make (4.0): $ cat Makefile .SHELLFLAGS = -e -c .ONESHELL : all : false echo "OK" $ make false echo "OK" Makefile:4: recipe for target 'all' failed make: *** [all] Error 1 Third, make's standard shell is /bin/sh, not bash. The POSIX shell does not support flags such as -o pipefail and when bash is invoked as /bin/sh, it does not either: $ /bin/sh -e -o pipefail -c "echo hi" /bin/sh: 0: Illegal option -o pipefail So, if you want to use bash features in your makefiles then you must specifically request bash as the shell: $ cat Makefile SHELL = /bin/bash .SHELLFLAGS = -o pipefail -e -c .ONESHELL : all : false | true echo "OK" $ make false | true echo "OK" Makefile:5: recipe for target 'all' failed make: *** [all] Error 1 _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?40431> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/ _______________________________________________ Bug-make mailing list Bug-make@gnu.org https://lists.gnu.org/mailman/listinfo/bug-make