Makefile 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #
  2. # Copyright (C) 2006 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. # Main makefile for the host tools
  8. #
  9. include $(TOPDIR)/rules.mk
  10. TARGETS-y:=sed sstrip ipkg-utils ext2fs squashfs mtd-utils lzma mkimage
  11. TARGETS_DOWNLOAD:=$(patsubst %,%-download,$(TARGETS-y))
  12. TARGETS_PREPARE:=$(patsubst %,%-prepare,$(TARGETS-y))
  13. TARGETS_INSTALL:=$(patsubst %,%-install,$(TARGETS-y))
  14. TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS-y))
  15. all: install
  16. download: $(TARGETS_DOWNLOAD)
  17. install:
  18. $(MAKE) install-targets
  19. install-targets: $(TARGETS_INSTALL)
  20. clean: $(TARGETS_CLEAN)
  21. squashfs-compile: lzma-install
  22. TOOL_STAMP_DIR:=$(STAGING_DIR)/stampfiles
  23. $(TOOL_STAMP_DIR):
  24. mkdir -p $@
  25. $(STAGING_DIR)/include-host:
  26. @mkdir -p $@
  27. @$(CP) ./include/*.h $@/
  28. $(TOOL_BUILD_DIR):
  29. @mkdir -p $@
  30. %-download: FORCE
  31. $(MAKE) -C $(patsubst %-download,%,$@) download
  32. %-prepare: $(TOOL_STAMP_DIR) $(STAGING_DIR)/include-host $(TOOL_BUILD_DIR) FORCE
  33. @[ -f $(TOOL_STAMP_DIR)/.tool_$@ ] || { \
  34. $(MAKE) -C $(patsubst %-prepare,%,$@) prepare; \
  35. }
  36. @touch $(TOOL_STAMP_DIR)/.tool_$@
  37. %-compile: %-prepare
  38. @[ -f $(TOOL_STAMP_DIR)/.tool_$@ ] || { \
  39. $(MAKE) -C $(patsubst %-compile,%,$@) compile; \
  40. }
  41. @touch $(TOOL_STAMP_DIR)/.tool_$@
  42. %-install: %-compile
  43. @[ -f $(TOOL_STAMP_DIR)/.tool_$@ ] || { \
  44. $(MAKE) -C $(patsubst %-install,%,$@) install; \
  45. }
  46. @touch $(TOOL_STAMP_DIR)/.tool_$@
  47. %-clean: FORCE
  48. @$(MAKE) -C $(patsubst %-clean,%,$@) clean
  49. @rm -f $(TOOL_STAMP_DIR)/.tool_$(patsubst %-clean,%,$@)-*
  50. ifeq ($(MAKECMDGOALS),install-targets)
  51. MAKEFLAGS:=$(MAKEFLAGS) -j$(CONFIG_JLEVEL)
  52. else
  53. .NOTPARALLEL:
  54. endif