Makefile 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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: $(TARGETS_INSTALL)
  18. clean: $(TARGETS_CLEAN)
  19. squashfs-compile: lzma-install
  20. TOOL_STAMP_DIR:=$(STAGING_DIR)/stampfiles
  21. $(TOOL_STAMP_DIR):
  22. mkdir -p $@
  23. $(STAGING_DIR)/include-host:
  24. @mkdir -p $@
  25. @$(CP) ./include/*.h $@/
  26. $(TOOL_BUILD_DIR):
  27. @mkdir -p $@
  28. %-download: FORCE
  29. $(MAKE) -C $(patsubst %-download,%,$@) download
  30. %-prepare: $(TOOL_STAMP_DIR) $(STAGING_DIR)/include-host $(TOOL_BUILD_DIR) FORCE
  31. @[ -f $(TOOL_STAMP_DIR)/.tool_$@ ] || { \
  32. $(MAKE) -C $(patsubst %-prepare,%,$@) prepare; \
  33. }
  34. @touch $(TOOL_STAMP_DIR)/.tool_$@
  35. %-compile: %-prepare
  36. @[ -f $(TOOL_STAMP_DIR)/.tool_$@ ] || { \
  37. $(MAKE) -C $(patsubst %-compile,%,$@) compile; \
  38. }
  39. @touch $(TOOL_STAMP_DIR)/.tool_$@
  40. %-install: %-compile
  41. @[ -f $(TOOL_STAMP_DIR)/.tool_$@ ] || { \
  42. $(MAKE) -C $(patsubst %-install,%,$@) install; \
  43. }
  44. @touch $(TOOL_STAMP_DIR)/.tool_$@
  45. %-clean: FORCE
  46. @$(MAKE) -C $(patsubst %-clean,%,$@) clean
  47. @rm -f $(TOOL_STAMP_DIR)/.tool_$(patsubst %-clean,%,$@)-*