2 # Copyright (C) 2006 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
7 # Main makefile for the host tools
9 include $(TOPDIR)/rules.mk
10 TARGETS-y:=sed sstrip ipkg-utils ext2fs squashfs mtd-utils lzma mkimage
12 TARGETS_DOWNLOAD:=$(patsubst %,%-download,$(TARGETS-y))
13 TARGETS_INSTALL:=$(patsubst %,%-install,$(TARGETS-y))
14 TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS-y))
17 download: $(TARGETS_DOWNLOAD)
18 install: $(TARGETS_INSTALL)
19 clean: $(TARGETS_CLEAN)
21 squashfs-compile: lzma-install
23 TOOL_STAMP_DIR:=$(STAGING_DIR)/stampfiles
31 @mkdir -p $@/include-host
32 $(CP) ./include/*.h $@/include-host/
33 @ln -sf ../lib $@/$(REAL_GNU_TARGET_NAME)/lib
34 @mkdir -p $@/$(REAL_GNU_TARGET_NAME)
40 $(MAKE) -C $(patsubst %-download,%,$@) download
42 %-prepare: $(TOOL_STAMP_DIR) $(STAGING_DIR) $(TOOL_BUILD_DIR) FORCE
43 @[ -f $(TOOL_STAMP_DIR)/.tool_$@ ] || { \
44 $(MAKE) -C $(patsubst %-prepare,%,$@) prepare; \
46 @touch $(TOOL_STAMP_DIR)/.tool_$@
49 @[ -f $(TOOL_STAMP_DIR)/.tool_$@ ] || { \
50 $(MAKE) -C $(patsubst %-compile,%,$@) compile; \
52 @touch $(TOOL_STAMP_DIR)/.tool_$@
55 @[ -f $(TOOL_STAMP_DIR)/.tool_$@ ] || { \
56 $(MAKE) -C $(patsubst %-install,%,$@) install; \
58 @touch $(TOOL_STAMP_DIR)/.tool_$@
61 @$(MAKE) -C $(patsubst %-clean,%,$@) clean
62 @rm -f $(TOOL_STAMP_DIR)/.tool_$(patsubst %-clean,%,$@)-*