summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2018-10-08 07:16:16 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2018-10-08 20:27:11 +0200
commitf4d2979ad7b356454233a5c80b9ee6c369f43839 (patch)
tree16e726973746e0fd099d23a3f77336edf5d0a0ad
parenteded2e34a0c31d4b8a4bb9f6f633b7152b80d657 (diff)
downloadptxdist-f4d2979ad7b356454233a5c80b9ee6c369f43839.tar.gz
ptxdist-f4d2979ad7b356454233a5c80b9ee6c369f43839.tar.xz
ptxd_make_image_genimage: speed up config dependencies
Calling ptxd_get_alternative during make startup is slow. Create the full list of possible paths when generating the dependency and let make find the first existing one. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r--rules/pre/genimage.make14
-rw-r--r--scripts/lib/ptxd_make_image_genimage.sh3
2 files changed, 2 insertions, 15 deletions
diff --git a/rules/pre/genimage.make b/rules/pre/genimage.make
deleted file mode 100644
index fd890cbd3..000000000
--- a/rules/pre/genimage.make
+++ /dev/null
@@ -1,14 +0,0 @@
-# -*-makefile-*-
-#
-# Copyright (C) 2012 by Michael Olbrich <m.olbrich@pengutronix.de>
-#
-# See CREDITS for details about who has contributed to this project.
-#
-# For further information about the PTXdist project and license conditions
-# see the README file.
-#
-
-genimage/config = \
- $(shell ptxd_get_alternative config/images "$(strip $(1))" && echo "$${ptxd_reply}" || echo $(1))
-
-# vim: syntax=make
diff --git a/scripts/lib/ptxd_make_image_genimage.sh b/scripts/lib/ptxd_make_image_genimage.sh
index b4a8e9de2..18e7fc307 100644
--- a/scripts/lib/ptxd_make_image_genimage.sh
+++ b/scripts/lib/ptxd_make_image_genimage.sh
@@ -31,7 +31,8 @@ ptxd_make_image_genimage_config() {
ptxd_replace_magic "${cfg}" > "${tmp}" &&
genimage_configs[${#genimage_configs[@]}]="${tmp}" &&
- echo "${image_image}: \$(call genimage/config, ${1})" >> "${pkg_genimage_deps}"
+ ptxd_get_alternative_list config/images "${1}"
+ echo "${image_image}: \$(firstword \$(wildcard ${ptxd_reply[*]}))" >> "${pkg_genimage_deps}"
includes=( $(sed -n "s/.*\<include(['\"]\(.*\)['\"]).*/\1/p" "${tmp}") ) &&
sed -i "s:\(.*\<include(['\"]\)\(.*\)\(['\"]).*\):\1${configdir}/\2\3:" "${tmp}" &&