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 $@/$(REAL_GNU_TARGET_NAME)
32 @ln -sf ../lib $@/$(REAL_GNU_TARGET_NAME)/lib
38 $(MAKE) -C $(patsubst %-download,%,$@) download
40 %-prepare: $(TOOL_STAMP_DIR) $(STAGING_DIR) $(TOOL_BUILD_DIR) FORCE
41 @[ -f $(TOOL_STAMP_DIR)/.tool_$@ ] || { \
42 $(MAKE) -C $(patsubst %-prepare,%,$@) prepare; \
44 @touch $(TOOL_STAMP_DIR)/.tool_$@
47 @[ -f $(TOOL_STAMP_DIR)/.tool_$@ ] || { \
48 $(MAKE) -C $(patsubst %-compile,%,$@) compile; \
50 @touch $(TOOL_STAMP_DIR)/.tool_$@
53 @[ -f $(TOOL_STAMP_DIR)/.tool_$@ ] || { \
54 $(MAKE) -C $(patsubst %-install,%,$@) install; \
56 @touch $(TOOL_STAMP_DIR)/.tool_$@
59 @$(MAKE) -C $(patsubst %-clean,%,$@) clean
60 @rm -f $(TOOL_STAMP_DIR)/.tool_$(patsubst %-clean,%,$@)-*