diff options
| author | Julien Ridoux <julien@synclab.org> | 2014-03-14 10:42:35 +1100 |
|---|---|---|
| committer | Sudar <sudar@sudarmuthu.com> | 2014-03-20 11:17:14 -0700 |
| commit | ffde764adaa56cf00296857c8fd4a821b6b2e506 (patch) | |
| tree | 0913ea822e05d9ac92c91195073edd1c3bdeefae /Common.mk | |
| parent | 64e90740424226418b2a16a4a241f64c05827664 (diff) | |
Add phony target to run pre-build hook script
Fix #176
Diffstat (limited to 'Common.mk')
| -rw-r--r-- | Common.mk | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -4,6 +4,14 @@ # (directory and optional filename) exists dir_if_exists = $(if $(wildcard $(1)$(2)),$(1)) +# Run a shell script if it exists. Stops make on error. +runscript_if_exists = \ + $(if $(wildcard $(1)), \ + $(if $(findstring 0, \ + $(lastword $(shell $(abspath $(wildcard $(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. space_pad_to = $(shell echo $(1) " " | head -c$(2)) |
