the default_subtargets template was a bad idea, since different makefiles require...
[openwrt.git] / tools / Makefile
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
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
19
20 all: install
21 download: $(TARGETS_DOWNLOAD)
22 compile: $(TARGETS_COMPILE)
23 install: $(STAMP)
24 clean: $(TARGETS_CLEAN)
25
26 squashfs-compile: lzma-install
27
28 ifneq ($(shell $(SCRIPT_DIR)/timestamp.pl -p . $(STAMP)),$(STAMP))
29 $(STAMP): $(TARGETS_INSTALL)
30 endif
31
32 $(STAMP): $(TOPDIR)/.config
33 mkdir -p $(shell dirname $@)
34 touch $@
35
36 $(STAGING_DIR)/include-host:
37 @mkdir -p $@
38 @$(CP) ./include/*.h $@/
39
40 $(TOOL_BUILD_DIR):
41 @mkdir -p $@
42
43 %-prereq %-download %-clean: FORCE
44 $(MAKE) -C $* $(patsubst $*-%,%,$@)
45
46 %-prepare: $(STAGING_DIR)/include-host $(TOOL_BUILD_DIR) FORCE
47 $(MAKE) -C $* $(patsubst $*-%,%,$@)
48
49 %-compile: %-prepare FORCE
50 $(MAKE) -C $* $(patsubst $*-%,%,$@)
51
52 %-install: %-compile FORCE
53 $(MAKE) -C $* $(patsubst $*-%,%,$@)
54
55 ifeq ($(MAKECMDGOALS),install-targets)
56 MAKEFLAGS:=$(MAKEFLAGS) -j$(CONFIG_JLEVEL)
57 else
58 .NOTPARALLEL:
59 endif
This page took 0.048302 seconds and 5 git commands to generate.