Stop make if external script fails.

This commit is contained in:
Julien Ridoux 2014-03-17 10:53:06 +11:00
parent 02ea5659c3
commit 9da68030b0

View file

@ -4,8 +4,12 @@
# (directory and optional filename) exists # (directory and optional filename) exists
dir_if_exists = $(if $(wildcard $(1)$(2)),$(1)) dir_if_exists = $(if $(wildcard $(1)$(2)),$(1))
# Run a shell script if it exists. # Run a shell script if it exists. Stops make on error.
runscript_if_exists = $(if $(wildcard $(1)), $(shell $(1))) 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 # For message printing: pad the right side of the first argument with spaces to
# the number of bytes indicated by the second argument. # the number of bytes indicated by the second argument.