Fix invocation to PRE_BUILD_HOOK to accept absolute, relative and expanded paths
This commit is contained in:
parent
9da68030b0
commit
287d382704
2 changed files with 6 additions and 5 deletions
|
@ -1113,7 +1113,7 @@ $(OBJDIR): pre-build
|
||||||
$(MKDIR) $(OBJDIR)
|
$(MKDIR) $(OBJDIR)
|
||||||
|
|
||||||
pre-build:
|
pre-build:
|
||||||
$(call runscript_if_exists,$(CURDIR)/$(PRE_BUILD_HOOK))
|
$(call runscript_if_exists,$(PRE_BUILD_HOOK))
|
||||||
|
|
||||||
$(TARGET_ELF): $(LOCAL_OBJS) $(CORE_LIB) $(OTHER_OBJS)
|
$(TARGET_ELF): $(LOCAL_OBJS) $(CORE_LIB) $(OTHER_OBJS)
|
||||||
$(CC) $(LDFLAGS) -o $@ $(LOCAL_OBJS) $(CORE_LIB) $(OTHER_OBJS) -lc -lm
|
$(CC) $(LDFLAGS) -o $@ $(LOCAL_OBJS) $(CORE_LIB) $(OTHER_OBJS) -lc -lm
|
||||||
|
|
|
@ -7,7 +7,8 @@ dir_if_exists = $(if $(wildcard $(1)$(2)),$(1))
|
||||||
# Run a shell script if it exists. Stops make on error.
|
# Run a shell script if it exists. Stops make on error.
|
||||||
runscript_if_exists = \
|
runscript_if_exists = \
|
||||||
$(if $(wildcard $(1)), \
|
$(if $(wildcard $(1)), \
|
||||||
$(if $(findstring 0, $(lastword $(shell $(1); echo $$?))), \
|
$(if $(findstring 0, \
|
||||||
|
$(lastword $(shell $(abspath $(wildcard $(1))); echo $$?))), \
|
||||||
$(info Info: $(1) success), \
|
$(info Info: $(1) success), \
|
||||||
$(error ERROR: $(1) failed)))
|
$(error ERROR: $(1) failed)))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue