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