2014-05-18 19:04:48 +00:00
|
|
|
From: Matthias Schiffer <mschiffer@universe-factory.net>
|
2014-07-26 14:11:27 +00:00
|
|
|
Date: Sat, 26 Jul 2014 06:10:23 +0200
|
2014-05-18 19:04:48 +00:00
|
|
|
Subject: tools/Makefile: fix host tools build dependencies
|
|
|
|
|
|
|
|
diff --git a/tools/Makefile b/tools/Makefile
|
2014-08-30 17:49:13 +00:00
|
|
|
index 9595d62..b8eef3f 100644
|
2014-05-18 19:04:48 +00:00
|
|
|
--- a/tools/Makefile
|
|
|
|
+++ b/tools/Makefile
|
2014-08-30 17:49:13 +00:00
|
|
|
@@ -96,10 +96,16 @@ define PrepareStaging
|
2014-05-18 19:04:48 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
# preparatory work
|
|
|
|
+ifneq ($(ARCH),)
|
|
|
|
+staging_prepared = $(STAGING_DIR)/.prepared
|
|
|
|
+
|
|
|
|
$(STAGING_DIR)/.prepared: $(TMP_DIR)/.build
|
|
|
|
$(call PrepareStaging,$(STAGING_DIR))
|
|
|
|
mkdir -p $(BUILD_DIR)/stamp
|
|
|
|
touch $@
|
|
|
|
+else
|
|
|
|
+staging_prepared :=
|
|
|
|
+endif
|
|
|
|
|
|
|
|
$(STAGING_DIR_HOST)/.prepared: $(TMP_DIR)/.build
|
|
|
|
$(call PrepareStaging,$(STAGING_DIR_HOST))
|
2014-08-30 17:49:13 +00:00
|
|
|
@@ -111,7 +117,7 @@ $(STAGING_DIR_HOST)/.prepared: $(TMP_DIR)/.build
|
2014-05-18 19:04:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
define PrepareCommand
|
|
|
|
-$(STAGING_DIR_HOST)/bin/$(1): $(STAGING_DIR)/.prepared
|
|
|
|
+$(STAGING_DIR_HOST)/bin/$(1): $(STAGING_DIR_HOST)/.prepared
|
|
|
|
@mkdir -p "$$(dir $$@)"; rm -f "$$@"
|
|
|
|
@export FILE="$$$$(which $(2) 2>/dev/null | grep -v 'not found' | head -n1)"; [ -n "$$$$FILE" ] || { \
|
|
|
|
echo "Command $(1) not found."; false; \
|
2014-08-30 17:49:13 +00:00
|
|
|
@@ -120,7 +126,7 @@ $(STAGING_DIR_HOST)/bin/$(1): $(STAGING_DIR)/.prepared
|
2014-05-18 19:04:48 +00:00
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
|
|
|
-$(STAGING_DIR_HOST)/bin/stat: $(STAGING_DIR)/.prepared
|
|
|
|
+$(STAGING_DIR_HOST)/bin/stat: $(STAGING_DIR_HOST)/.prepared
|
|
|
|
@rm -f $@
|
|
|
|
@if stat --version > /dev/null 2>&1; then \
|
|
|
|
ln -s `which stat` $@; \
|
2014-08-30 17:49:13 +00:00
|
|
|
@@ -144,8 +150,8 @@ $(eval $(call PrepareCommand,tar,gtar tar))
|
2014-07-26 14:11:27 +00:00
|
|
|
$(eval $(call PrepareCommand,diff,gdiff diff))
|
2014-05-18 19:04:48 +00:00
|
|
|
|
2014-07-26 14:11:27 +00:00
|
|
|
$(curdir)/cmddeps = $(patsubst %,$(STAGING_DIR_HOST)/bin/%,md5sum cp stat seq python awk getopt grep tar diff)
|
2014-05-18 19:04:48 +00:00
|
|
|
-$(curdir)//prepare = $(STAGING_DIR)/.prepared $(STAGING_DIR_HOST)/.prepared $($(curdir)/cmddeps)
|
|
|
|
-$(curdir)//compile = $(STAGING_DIR)/.prepared $(STAGING_DIR_HOST)/.prepared $($(curdir)/cmddeps)
|
|
|
|
+$(curdir)//prepare = $(staging_prepared) $(STAGING_DIR_HOST)/.prepared $($(curdir)/cmddeps)
|
|
|
|
+$(curdir)//compile = $(staging_prepared) $(STAGING_DIR_HOST)/.prepared $($(curdir)/cmddeps)
|
|
|
|
|
|
|
|
# prerequisites for the individual targets
|
|
|
|
$(curdir)/ := .config prereq
|