summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2014-11-17 01:32:54 -0500
committerLuke Shumaker <lukeshu@sbcglobal.net>2014-11-17 01:32:54 -0500
commited5df6c8361dcb80066afc9688e799d96cb394b3 (patch)
tree3bc03499e33a8316a7d890b5e60a4f55dfc8dcbb /Makefile
parentf57d328369def0dc728f01918e2b99e2dc2968cb (diff)
Makefile: only shell out in rules/ once
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile9
1 files changed, 5 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 119d07f..fa38ec4 100644
--- a/Makefile
+++ b/Makefile
@@ -61,9 +61,6 @@ file2 = $(foreach file,$2,$(call _file2_memo,$1,$(file)))
specs_for = $(strip $(foreach t,$1,$(filter $t|%,$(if $2,$2,$(specs)))))
-dep_dir = $1 $(shell $(FIND) $1 2>/dev/null)
-dep_optdir = $(shell $(FIND) $1 2>/dev/null)
-
# configuration ################################################################
# Load conf/sources.mk
@@ -203,8 +200,12 @@ build/workdir/%:
$(foreach package,$(packages),$(eval \
build/workdir/$(package): \
build/extract/$(call name2,file,$(package)) \
- $(call dep_optdir,rules/$(package)) \
))
+# Set up the dependencies between `build/workdir/` and `rules/`
+# This was formerly in the above loop, but this is more efficient.
+$(foreach line,\
+ $(shell $(FIND) rules/ -mindepth 1|$(SED) 's,rules/\([^/]*\),build/workdir/\1:&,'),\
+ $(eval $(line)))
# package ######################################################################