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
11 TARGETS-
$(CONFIG_CCACHE
) += ccache
13 TARGETS_DOWNLOAD
:=$(patsubst %,%-download
,$(TARGETS-y
))
14 TARGETS_PREPARE
:=$(patsubst %,%-prepare
,$(TARGETS-y
))
15 TARGETS_COMPILE
:=$(patsubst %,%-compile
,$(TARGETS-y
))
16 TARGETS_INSTALL
:=$(patsubst %,%-install,$(TARGETS-y
))
17 TARGETS_CLEAN
:=$(patsubst %,%-clean,$(TARGETS-y
))
18 STAMP
:=$(STAGING_DIR
)/stampfiles
/.tools_installed
21 download
: $(TARGETS_DOWNLOAD
)
22 compile
: $(TARGETS_COMPILE
)
24 clean: $(TARGETS_CLEAN
)
26 squashfs-compile
: lzma-install
28 ifneq ($(shell $(SCRIPT_DIR
)/timestamp.pl
-p .
$(STAMP
)),$(STAMP
))
29 $(STAMP
): $(TARGETS_INSTALL
)
32 $(STAMP
): $(TOPDIR
)/.config
33 mkdir
-p
$(shell dirname
$@
)
36 TOOL_HOST_INCLUDES
:=$(patsubst .
/include/%.h
,$(STAGING_DIR
)/include-host
/%.h
,$(wildcard .
/include/*.h
))
37 $(TOOL_HOST_INCLUDES
): $(STAGING_DIR
)/include-host
/%.h
: .
/include/%.h
38 @mkdir
-p
$(STAGING_DIR
)/include-host
44 %-prereq
%-download
%-clean %-refresh
: FORCE
45 $(MAKE
) -C
$* $(patsubst $*-%,%,$@
)
47 %-prepare
: $(TOOL_HOST_INCLUDES
) $(TOOL_BUILD_DIR
) FORCE
48 $(MAKE
) -C
$* $(patsubst $*-%,%,$@
)
50 %-compile
: %-prepare FORCE
51 $(MAKE
) -C
$* $(patsubst $*-%,%,$@
)
53 %-install: %-compile FORCE
54 $(MAKE
) -C
$* $(patsubst $*-%,%,$@
)
56 ifeq ($(MAKECMDGOALS
),install-targets
)
57 MAKEFLAGS
:=$(MAKEFLAGS
) -j
$(CONFIG_JLEVEL
)