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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. From: Matthias Schiffer <mschiffer@universe-factory.net>
  2. Date: Wed, 7 May 2014 22:57:10 +0200
  3. Subject: tools/Makefile: fix host tools build dependencies
  4. diff --git a/tools/Makefile b/tools/Makefile
  5. index 6658f8c..26a3fb1 100644
  6. --- a/tools/Makefile
  7. +++ b/tools/Makefile
  8. @@ -75,6 +75,7 @@ endif
  9. $(curdir)/builddirs := $(tools-y) $(tools-dep) $(tools-)
  10. $(curdir)/builddirs-default := $(tools-y)
  11. +
  12. ifndef DUMP_TARGET_DB
  13. define PrepareStaging
  14. @for dir in $(1); do ( \
  15. @@ -86,10 +87,16 @@ define PrepareStaging
  16. endef
  17. # preparatory work
  18. +ifneq ($(ARCH),)
  19. +staging_prepared = $(STAGING_DIR)/.prepared
  20. +
  21. $(STAGING_DIR)/.prepared: $(TMP_DIR)/.build
  22. $(call PrepareStaging,$(STAGING_DIR))
  23. mkdir -p $(BUILD_DIR)/stamp
  24. touch $@
  25. +else
  26. +staging_prepared :=
  27. +endif
  28. $(STAGING_DIR_HOST)/.prepared: $(TMP_DIR)/.build
  29. $(call PrepareStaging,$(STAGING_DIR_HOST))
  30. @@ -101,7 +108,7 @@ $(STAGING_DIR_HOST)/.prepared: $(TMP_DIR)/.build
  31. define PrepareCommand
  32. -$(STAGING_DIR_HOST)/bin/$(1): $(STAGING_DIR)/.prepared
  33. +$(STAGING_DIR_HOST)/bin/$(1): $(STAGING_DIR_HOST)/.prepared
  34. @mkdir -p "$$(dir $$@)"; rm -f "$$@"
  35. @export FILE="$$$$(which $(2) 2>/dev/null | grep -v 'not found' | head -n1)"; [ -n "$$$$FILE" ] || { \
  36. echo "Command $(1) not found."; false; \
  37. @@ -110,7 +117,7 @@ $(STAGING_DIR_HOST)/bin/$(1): $(STAGING_DIR)/.prepared
  38. endef
  39. endif
  40. -$(STAGING_DIR_HOST)/bin/stat: $(STAGING_DIR)/.prepared
  41. +$(STAGING_DIR_HOST)/bin/stat: $(STAGING_DIR_HOST)/.prepared
  42. @rm -f $@
  43. @if stat --version > /dev/null 2>&1; then \
  44. ln -s `which stat` $@; \
  45. @@ -128,8 +135,8 @@ $(eval $(call PrepareCommand,seq,gseq seq))
  46. $(eval $(call PrepareCommand,python,python2 python))
  47. $(curdir)/cmddeps = $(patsubst %,$(STAGING_DIR_HOST)/bin/%,find md5sum cp stat seq python)
  48. -$(curdir)//prepare = $(STAGING_DIR)/.prepared $(STAGING_DIR_HOST)/.prepared $($(curdir)/cmddeps)
  49. -$(curdir)//compile = $(STAGING_DIR)/.prepared $(STAGING_DIR_HOST)/.prepared $($(curdir)/cmddeps)
  50. +$(curdir)//prepare = $(staging_prepared) $(STAGING_DIR_HOST)/.prepared $($(curdir)/cmddeps)
  51. +$(curdir)//compile = $(staging_prepared) $(STAGING_DIR_HOST)/.prepared $($(curdir)/cmddeps)
  52. # prerequisites for the individual targets
  53. $(curdir)/ := .config prereq