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 firmware-utils
12 TARGETS_DOWNLOAD
:=$(patsubst %,%-download
,$(TARGETS-y
))
13 TARGETS_PREPARE
:=$(patsubst %,%-prepare
,$(TARGETS-y
))
14 TARGETS_INSTALL
:=$(patsubst %,%-install,$(TARGETS-y
))
15 TARGETS_CLEAN
:=$(patsubst %,%-clean,$(TARGETS-y
))
18 download
: $(TARGETS_DOWNLOAD
)
20 $(MAKE
) install-targets
21 install-targets
: $(TARGETS_INSTALL
)
22 clean: $(TARGETS_CLEAN
)
24 squashfs-compile
: lzma-install
26 TOOL_STAMP_DIR
:=$(STAGING_DIR
)/stampfiles
31 $(STAGING_DIR
)/include-host
:
33 @
$(CP
) .
/include/*.h
$@
/
39 $(MAKE
) -C
$(patsubst %-download
,%,$@
) download
41 %-prepare
: $(TOOL_STAMP_DIR
) $(STAGING_DIR
)/include-host
$(TOOL_BUILD_DIR
) FORCE
42 @
[ -f
$(TOOL_STAMP_DIR
)/.tool_
$@
] ||
{ \
43 $(MAKE
) -C
$(patsubst %-prepare
,%,$@
) prepare
; \
45 @touch
$(TOOL_STAMP_DIR
)/.tool_
$@
48 @
[ -f
$(TOOL_STAMP_DIR
)/.tool_
$@
] ||
{ \
49 $(MAKE
) -C
$(patsubst %-compile
,%,$@
) compile
; \
51 @touch
$(TOOL_STAMP_DIR
)/.tool_
$@
54 @
[ -f
$(TOOL_STAMP_DIR
)/.tool_
$@
] ||
{ \
55 $(MAKE
) -C
$(patsubst %-install,%,$@
) install; \
57 @touch
$(TOOL_STAMP_DIR
)/.tool_
$@
60 @
$(MAKE
) -C
$(patsubst %-clean,%,$@
) clean
61 @
rm -f
$(TOOL_STAMP_DIR
)/.tool_
$(patsubst %-clean,%,$@
)-*
63 ifeq ($(MAKECMDGOALS
),install-targets
)
64 MAKEFLAGS
:=$(MAKEFLAGS
) -j
$(CONFIG_JLEVEL
)