clean up stampfile mess for tools/ and toolchain/
[openwrt-10.03/.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
12 TARGETS_DOWNLOAD:=$(patsubst %,%-download,$(TARGETS-y))
13 TARGETS_PREPARE:=$(patsubst %,%-prepare,$(TARGETS-y))
14 TARGETS_COMPILE:=$(patsubst %,%-compile,$(TARGETS-y))
15 TARGETS_INSTALL:=$(patsubst %,%-install,$(TARGETS-y))
16 TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS-y))
17 STAMP:=$(STAGING_DIR)/stampfiles/.tools_installed
18
19 all: install
20 download: $(TARGETS_DOWNLOAD)
21 compile: $(TARGETS_COMPILE)
22 install: $(STAMP)
23 clean: $(TARGETS_CLEAN)
24
25 squashfs-compile: lzma-install
26
27 ifneq ($(shell $(SCRIPT_DIR)/timestamp.pl -p . $(STAMP)),$(STAMP))
28   $(STAMP): $(TARGETS_INSTALL)
29 endif
30
31 $(STAMP):
32         mkdir -p $(shell dirname $@)
33         touch $@
34         
35 $(STAGING_DIR)/include-host:
36         @mkdir -p $@
37         @$(CP) ./include/*.h $@/
38
39 $(TOOL_BUILD_DIR):
40         @mkdir -p $@
41
42 $(eval $(call default_subtargets,$(STAGING_DIR)/include-host $(TOOL_BUILD_DIR)))
43
44 ifeq ($(MAKECMDGOALS),install-targets)
45 MAKEFLAGS:=$(MAKEFLAGS) -j$(CONFIG_JLEVEL)
46 else
47 .NOTPARALLEL:
48 endif