diff --git a/Common.mk b/Common.mk index 8131dba..d7aee9a 100644 --- a/Common.mk +++ b/Common.mk @@ -4,8 +4,12 @@ # (directory and optional filename) exists dir_if_exists = $(if $(wildcard $(1)$(2)),$(1)) -# Run a shell script if it exists. -runscript_if_exists = $(if $(wildcard $(1)), $(shell $(1))) +# Run a shell script if it exists. Stops make on error. +runscript_if_exists = \ + $(if $(wildcard $(1)), \ + $(if $(findstring 0, $(lastword $(shell $(1); echo $$?))), \ + $(info Info: $(1) success), \ + $(error ERROR: $(1) failed))) # For message printing: pad the right side of the first argument with spaces to # the number of bytes indicated by the second argument.