2006-09-27 14:06:46 +00:00
|
|
|
#
|
|
|
|
# Copyright (C) 2006 OpenWrt.org
|
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
# Main makefile for the host tools
|
|
|
|
#
|
|
|
|
include $(TOPDIR)/rules.mk
|
2007-07-01 09:45:27 +00:00
|
|
|
TARGETS-y:=sed sstrip ipkg-utils ext2fs squashfs mtd-utils lzma mkimage firmware-utils patch-cmdline
|
2007-02-27 23:46:34 +00:00
|
|
|
TARGETS-$(CONFIG_CCACHE) += ccache
|
2006-09-27 14:06:46 +00:00
|
|
|
|
|
|
|
TARGETS_DOWNLOAD:=$(patsubst %,%-download,$(TARGETS-y))
|
2006-10-10 16:36:47 +00:00
|
|
|
TARGETS_PREPARE:=$(patsubst %,%-prepare,$(TARGETS-y))
|
2007-02-25 17:49:25 +00:00
|
|
|
TARGETS_COMPILE:=$(patsubst %,%-compile,$(TARGETS-y))
|
2006-09-27 14:06:46 +00:00
|
|
|
TARGETS_INSTALL:=$(patsubst %,%-install,$(TARGETS-y))
|
|
|
|
TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS-y))
|
2007-02-25 17:49:25 +00:00
|
|
|
STAMP:=$(STAGING_DIR)/stampfiles/.tools_installed
|
2006-09-27 14:06:46 +00:00
|
|
|
|
|
|
|
all: install
|
|
|
|
download: $(TARGETS_DOWNLOAD)
|
2007-02-25 17:49:25 +00:00
|
|
|
compile: $(TARGETS_COMPILE)
|
|
|
|
install: $(STAMP)
|
2006-09-27 14:06:46 +00:00
|
|
|
clean: $(TARGETS_CLEAN)
|
|
|
|
|
|
|
|
squashfs-compile: lzma-install
|
|
|
|
|
2007-02-25 17:49:25 +00:00
|
|
|
ifneq ($(shell $(SCRIPT_DIR)/timestamp.pl -p . $(STAMP)),$(STAMP))
|
|
|
|
$(STAMP): $(TARGETS_INSTALL)
|
|
|
|
endif
|
2006-09-27 14:06:46 +00:00
|
|
|
|
2007-02-27 23:46:34 +00:00
|
|
|
$(STAMP): $(TOPDIR)/.config
|
2007-02-25 17:49:25 +00:00
|
|
|
mkdir -p $(shell dirname $@)
|
|
|
|
touch $@
|
2007-04-21 22:23:33 +00:00
|
|
|
|
|
|
|
TOOL_HOST_INCLUDES:=$(patsubst ./include/%.h,$(STAGING_DIR)/include-host/%.h,$(wildcard ./include/*.h))
|
|
|
|
$(TOOL_HOST_INCLUDES): $(STAGING_DIR)/include-host/%.h: ./include/%.h
|
|
|
|
@mkdir -p $(STAGING_DIR)/include-host
|
|
|
|
$(CP) $< $@
|
2006-09-27 14:06:46 +00:00
|
|
|
|
|
|
|
$(TOOL_BUILD_DIR):
|
|
|
|
@mkdir -p $@
|
|
|
|
|
2007-06-30 12:21:09 +00:00
|
|
|
%-prereq %-download %-clean %-refresh %-update: FORCE
|
2007-04-18 17:35:46 +00:00
|
|
|
$(MAKE) -C $* $(patsubst $*-%,%,$@)
|
2007-04-18 17:09:34 +00:00
|
|
|
|
2007-04-21 22:23:33 +00:00
|
|
|
%-prepare: $(TOOL_HOST_INCLUDES) $(TOOL_BUILD_DIR) FORCE
|
2007-04-18 17:35:46 +00:00
|
|
|
$(MAKE) -C $* $(patsubst $*-%,%,$@)
|
|
|
|
|
|
|
|
%-compile: %-prepare FORCE
|
|
|
|
$(MAKE) -C $* $(patsubst $*-%,%,$@)
|
|
|
|
|
|
|
|
%-install: %-compile FORCE
|
|
|
|
$(MAKE) -C $* $(patsubst $*-%,%,$@)
|
2006-09-27 14:06:46 +00:00
|
|
|
|
2006-10-18 19:00:05 +00:00
|
|
|
ifeq ($(MAKECMDGOALS),install-targets)
|
|
|
|
MAKEFLAGS:=$(MAKEFLAGS) -j$(CONFIG_JLEVEL)
|
|
|
|
else
|
|
|
|
.NOTPARALLEL:
|
|
|
|
endif
|