source: trunk/tools/Makefile @ 5702

Last change on this file since 5702 was 5702, checked in by nbd, 9 years ago

move target/utils to tools/firmware-utils

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.6 KB
Line 
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#
9include $(TOPDIR)/rules.mk
10TARGETS-y:=sed sstrip ipkg-utils ext2fs squashfs mtd-utils lzma mkimage firmware-utils
11
12TARGETS_DOWNLOAD:=$(patsubst %,%-download,$(TARGETS-y))
13TARGETS_PREPARE:=$(patsubst %,%-prepare,$(TARGETS-y))
14TARGETS_INSTALL:=$(patsubst %,%-install,$(TARGETS-y))
15TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS-y))
16
17all: install
18download: $(TARGETS_DOWNLOAD)
19install:
20        $(MAKE) install-targets
21install-targets: $(TARGETS_INSTALL)
22clean: $(TARGETS_CLEAN)
23
24squashfs-compile: lzma-install
25
26TOOL_STAMP_DIR:=$(STAGING_DIR)/stampfiles
27
28$(TOOL_STAMP_DIR):
29        mkdir -p $@
30
31$(STAGING_DIR)/include-host:
32        @mkdir -p $@
33        @$(CP) ./include/*.h $@/
34
35$(TOOL_BUILD_DIR):
36        @mkdir -p $@
37
38%-download: FORCE
39        $(MAKE) -C $(patsubst %-download,%,$@) download
40
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; \
44        }
45        @touch $(TOOL_STAMP_DIR)/.tool_$@
46
47%-compile: %-prepare
48        @[ -f $(TOOL_STAMP_DIR)/.tool_$@ ] || { \
49                $(MAKE) -C $(patsubst %-compile,%,$@) compile; \
50        }
51        @touch $(TOOL_STAMP_DIR)/.tool_$@
52
53%-install: %-compile
54        @[ -f $(TOOL_STAMP_DIR)/.tool_$@ ] || { \
55                $(MAKE) -C $(patsubst %-install,%,$@) install; \
56        }
57        @touch $(TOOL_STAMP_DIR)/.tool_$@
58
59%-clean: FORCE
60        @$(MAKE) -C $(patsubst %-clean,%,$@) clean
61        @rm -f $(TOOL_STAMP_DIR)/.tool_$(patsubst %-clean,%,$@)-*
62
63ifeq ($(MAKECMDGOALS),install-targets)
64MAKEFLAGS:=$(MAKEFLAGS) -j$(CONFIG_JLEVEL)
65else
66.NOTPARALLEL:
67endif
Note: See TracBrowser for help on using the repository browser.