summaryrefslogtreecommitdiffstats
path: root/rules
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2019-02-20 10:16:05 +0100
committerMichael Olbrich <m.olbrich@pengutronix.de>2019-02-20 16:24:21 +0100
commit7cba285a7d51e3109618292220b7f2d4a2e264f7 (patch)
tree081a2d554f88ce2982dbf54017b8bcdfddbebe8e /rules
parentba3505051fc3f46347eca7c7da677cf0c0881774 (diff)
downloadptxdist-7cba285a7d51e3109618292220b7f2d4a2e264f7.tar.gz
ptxdist-7cba285a7d51e3109618292220b7f2d4a2e264f7.tar.xz
ptx/in-path: don't call the shell unless needed
The optimization didn't actually work: The second argument for ptx/in-path3 was always evaluated. Move the shell execution directly to the 'if' argument to really skip. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'rules')
-rw-r--r--rules/pre/get_alternative.make4
1 files changed, 2 insertions, 2 deletions
diff --git a/rules/pre/get_alternative.make b/rules/pre/get_alternative.make
index afccdd9f6..bbaf7b90d 100644
--- a/rules/pre/get_alternative.make
+++ b/rules/pre/get_alternative.make
@@ -17,13 +17,13 @@ ptx/get_alternative = $(error ptx/get_alternative has been renamed to ptx/get-al
#
# Strip whitespaces introduced by the multiline macros
define ptx/in-path3
-$(if $(strip $(1)),$(strip $(2)),$(strip $(3)))
+$(if $(strip $(1)),$(strip $(call ptx/force-shell,$(2))),$(strip $(3)))
endef
# fallback to shell if a relative path is found
define ptx/in-path2
$(call ptx/in-path3,
$(filter-out /%,$(3)),
-$(call ptx/force-shell, p='$($(strip $(1)))' ptxd_in_path p $(2) && echo $$ptxd_reply),
+p='$($(strip $(1)))' ptxd_in_path p $(2) && echo $$ptxd_reply,
$(firstword $(wildcard $(addsuffix /$(strip $(2)),$(3)))))
endef
# create a path ist from the variable with ':' separated paths