2006-09-27 16:06:46 +02: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 11:45:27 +02:00
|
|
|
TARGETS-y:=sed sstrip ipkg-utils ext2fs squashfs mtd-utils lzma mkimage firmware-utils patch-cmdline
|
2007-02-28 00:46:34 +01:00
|
|
|
TARGETS-$(CONFIG_CCACHE) += ccache
|
2006-09-27 16:06:46 +02:00
|
|
|
|
|
|
|
TARGETS_DOWNLOAD:=$(patsubst %,%-download,$(TARGETS-y))
|
2006-10-10 18:36:47 +02:00
|
|
|
TARGETS_PREPARE:=$(patsubst %,%-prepare,$(TARGETS-y))
|
2007-02-25 18:49:25 +01:00
|
|
|
TARGETS_COMPILE:=$(patsubst %,%-compile,$(TARGETS-y))
|
2006-09-27 16:06:46 +02:00
|
|
|
TARGETS_INSTALL:=$(patsubst %,%-install,$(TARGETS-y))
|
|
|
|
TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS-y))
|
2007-02-25 18:49:25 +01:00
|
|
|
STAMP:=$(STAGING_DIR)/stampfiles/.tools_installed
|
2006-09-27 16:06:46 +02:00
|
|
|
|
|
|
|
all: install
|
|
|
|
download: $(TARGETS_DOWNLOAD)
|
2007-02-25 18:49:25 +01:00
|
|
|
compile: $(TARGETS_COMPILE)
|
|
|
|
install: $(STAMP)
|
2006-09-27 16:06:46 +02:00
|
|
|
clean: $(TARGETS_CLEAN)
|
|
|
|
|
|
|
|
squashfs-compile: lzma-install
|
|
|
|
|
2007-02-25 18:49:25 +01:00
|
|
|
ifneq ($(shell $(SCRIPT_DIR)/timestamp.pl -p . $(STAMP)),$(STAMP))
|
|
|
|
$(STAMP): $(TARGETS_INSTALL)
|
|
|
|
endif
|
2006-09-27 16:06:46 +02:00
|
|
|
|
2007-02-28 00:46:34 +01:00
|
|
|
$(STAMP): $(TOPDIR)/.config
|
2007-02-25 18:49:25 +01:00
|
|
|
mkdir -p $(shell dirname $@)
|
|
|
|
touch $@
|
2007-04-22 00:23:33 +02: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 16:06:46 +02:00
|
|
|
|
|
|
|
$(TOOL_BUILD_DIR):
|
|
|
|
@mkdir -p $@
|
|
|
|
|
2007-06-30 14:21:09 +02:00
|
|
|
%-prereq %-download %-clean %-refresh %-update: FORCE
|
2007-04-18 19:35:46 +02:00
|
|
|
$(MAKE) -C $* $(patsubst $*-%,%,$@)
|
2007-04-18 19:09:34 +02:00
|
|
|
|
2007-04-22 00:23:33 +02:00
|
|
|
%-prepare: $(TOOL_HOST_INCLUDES) $(TOOL_BUILD_DIR) FORCE
|
2007-04-18 19:35:46 +02:00
|
|
|
$(MAKE) -C $* $(patsubst $*-%,%,$@)
|
|
|
|
|
|
|
|
%-compile: %-prepare FORCE
|
|
|
|
$(MAKE) -C $* $(patsubst $*-%,%,$@)
|
|
|
|
|
|
|
|
%-install: %-compile FORCE
|
|
|
|
$(MAKE) -C $* $(patsubst $*-%,%,$@)
|
2006-09-27 16:06:46 +02:00
|
|
|
|
2006-10-18 21:00:05 +02:00
|
|
|
ifeq ($(MAKECMDGOALS),install-targets)
|
|
|
|
MAKEFLAGS:=$(MAKEFLAGS) -j$(CONFIG_JLEVEL)
|
|
|
|
else
|
|
|
|
.NOTPARALLEL:
|
|
|
|
endif
|