Makefile 1.6 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 firmware-utils
  11. TARGETS-$(CONFIG_CCACHE) += ccache
  12. TARGETS_DOWNLOAD:=$(patsubst %,%-download,$(TARGETS-y))
  13. TARGETS_PREPARE:=$(patsubst %,%-prepare,$(TARGETS-y))
  14. TARGETS_COMPILE:=$(patsubst %,%-compile,$(TARGETS-y))
  15. TARGETS_INSTALL:=$(patsubst %,%-install,$(TARGETS-y))
  16. TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS-y))
  17. STAMP:=$(STAGING_DIR)/stampfiles/.tools_installed
  18. all: install
  19. download: $(TARGETS_DOWNLOAD)
  20. compile: $(TARGETS_COMPILE)
  21. install: $(STAMP)
  22. clean: $(TARGETS_CLEAN)
  23. squashfs-compile: lzma-install
  24. ifneq ($(shell $(SCRIPT_DIR)/timestamp.pl -p . $(STAMP)),$(STAMP))
  25. $(STAMP): $(TARGETS_INSTALL)
  26. endif
  27. $(STAMP): $(TOPDIR)/.config
  28. mkdir -p $(shell dirname $@)
  29. touch $@
  30. TOOL_HOST_INCLUDES:=$(patsubst ./include/%.h,$(STAGING_DIR)/include-host/%.h,$(wildcard ./include/*.h))
  31. $(TOOL_HOST_INCLUDES): $(STAGING_DIR)/include-host/%.h: ./include/%.h
  32. @mkdir -p $(STAGING_DIR)/include-host
  33. $(CP) $< $@
  34. $(TOOL_BUILD_DIR):
  35. @mkdir -p $@
  36. %-prereq %-download %-clean %-refresh: FORCE
  37. $(MAKE) -C $* $(patsubst $*-%,%,$@)
  38. %-prepare: $(TOOL_HOST_INCLUDES) $(TOOL_BUILD_DIR) FORCE
  39. $(MAKE) -C $* $(patsubst $*-%,%,$@)
  40. %-compile: %-prepare FORCE
  41. $(MAKE) -C $* $(patsubst $*-%,%,$@)
  42. %-install: %-compile FORCE
  43. $(MAKE) -C $* $(patsubst $*-%,%,$@)
  44. ifeq ($(MAKECMDGOALS),install-targets)
  45. MAKEFLAGS:=$(MAKEFLAGS) -j$(CONFIG_JLEVEL)
  46. else
  47. .NOTPARALLEL:
  48. endif