Stop make if external script fails.
This commit is contained in:
parent
02ea5659c3
commit
9da68030b0
1 changed files with 6 additions and 2 deletions
|
@ -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.
|
||||||
|
|
Loading…
Reference in a new issue