0001-tools-Makefile-fix-host-tools-build-dependencies.patch 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. From: Matthias Schiffer <mschiffer@universe-factory.net>
  2. Date: Sat, 26 Jul 2014 06:10:23 +0200
  3. Subject: tools/Makefile: fix host tools build dependencies
  4. diff --git a/tools/Makefile b/tools/Makefile
  5. index 9595d62..b8eef3f 100644
  6. --- a/tools/Makefile
  7. +++ b/tools/Makefile
  8. @@ -96,10 +96,16 @@ define PrepareStaging
  9. endef
  10. # preparatory work
  11. +ifneq ($(ARCH),)
  12. +staging_prepared = $(STAGING_DIR)/.prepared
  13. +
  14. $(STAGING_DIR)/.prepared: $(TMP_DIR)/.build
  15. $(call PrepareStaging,$(STAGING_DIR))
  16. mkdir -p $(BUILD_DIR)/stamp
  17. touch $@
  18. +else
  19. +staging_prepared :=
  20. +endif
  21. $(STAGING_DIR_HOST)/.prepared: $(TMP_DIR)/.build
  22. $(call PrepareStaging,$(STAGING_DIR_HOST))
  23. @@ -111,7 +117,7 @@ $(STAGING_DIR_HOST)/.prepared: $(TMP_DIR)/.build
  24. define PrepareCommand
  25. -$(STAGING_DIR_HOST)/bin/$(1): $(STAGING_DIR)/.prepared
  26. +$(STAGING_DIR_HOST)/bin/$(1): $(STAGING_DIR_HOST)/.prepared
  27. @mkdir -p "$$(dir $$@)"; rm -f "$$@"
  28. @export FILE="$$$$(which $(2) 2>/dev/null | grep -v 'not found' | head -n1)"; [ -n "$$$$FILE" ] || { \
  29. echo "Command $(1) not found."; false; \
  30. @@ -120,7 +126,7 @@ $(STAGING_DIR_HOST)/bin/$(1): $(STAGING_DIR)/.prepared
  31. endef
  32. endif
  33. -$(STAGING_DIR_HOST)/bin/stat: $(STAGING_DIR)/.prepared
  34. +$(STAGING_DIR_HOST)/bin/stat: $(STAGING_DIR_HOST)/.prepared
  35. @rm -f $@
  36. @if stat --version > /dev/null 2>&1; then \
  37. ln -s `which stat` $@; \
  38. @@ -144,8 +150,8 @@ $(eval $(call PrepareCommand,tar,gtar tar))
  39. $(eval $(call PrepareCommand,diff,gdiff diff))
  40. $(curdir)/cmddeps = $(patsubst %,$(STAGING_DIR_HOST)/bin/%,md5sum cp stat seq python awk getopt grep tar diff)
  41. -$(curdir)//prepare = $(STAGING_DIR)/.prepared $(STAGING_DIR_HOST)/.prepared $($(curdir)/cmddeps)
  42. -$(curdir)//compile = $(STAGING_DIR)/.prepared $(STAGING_DIR_HOST)/.prepared $($(curdir)/cmddeps)
  43. +$(curdir)//prepare = $(staging_prepared) $(STAGING_DIR_HOST)/.prepared $($(curdir)/cmddeps)
  44. +$(curdir)//compile = $(staging_prepared) $(STAGING_DIR_HOST)/.prepared $($(curdir)/cmddeps)
  45. # prerequisites for the individual targets
  46. $(curdir)/ := .config prereq