summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2007-04-18 17:35:46 +0000
committerFelix Fietkau <nbd@openwrt.org>2007-04-18 17:35:46 +0000
commit1099e2d679328043c2c317169054f16a86b5d45b (patch)
tree08f2beef40c9c1fb7483e72aa597949b73f355ad
parent532654e3c6237f9867c35ca38b3d4967d4e054ff (diff)
downloadmtk-20170518-1099e2d679328043c2c317169054f16a86b5d45b.zip
mtk-20170518-1099e2d679328043c2c317169054f16a86b5d45b.tar.gz
mtk-20170518-1099e2d679328043c2c317169054f16a86b5d45b.tar.bz2
the default_subtargets template was a bad idea, since different makefiles require different types of dependencies for subtargets. nuke it...
SVN-Revision: 7003
-rw-r--r--rules.mk21
-rw-r--r--target/Makefile3
-rw-r--r--toolchain/Makefile12
-rw-r--r--tools/Makefile12
4 files changed, 23 insertions, 25 deletions
diff --git a/rules.mk b/rules.mk
index 9ec9896..0ce75f5 100644
--- a/rules.mk
+++ b/rules.mk
@@ -131,27 +131,6 @@ $(call shvar,$(1))=$$(call $(1))
export $(call shvar,$(1))
endef
-# Default targets for subdirectory calls
-# Parameters:
-# 1: dependencies for the prepare step
-define default_subtargets
- %-download: FORCE
- $$(MAKE) -C $$(patsubst %-download,%,$$@) download
-
- %-prepare: $(1) FORCE
- $$(MAKE) -C $$(patsubst %-prepare,%,$$@) prepare
-
- %-compile: %-prepare
- $$(MAKE) -C $$(patsubst %-compile,%,$$@) compile
-
- %-install:
- $$(MAKE) -C $$(patsubst %-install,%,$$@) install
-
- %-clean: FORCE
- @$$(MAKE) -C $$(patsubst %-clean,%,$$@) clean
-endef
-
-
all:
FORCE: ;
.PHONY: FORCE
diff --git a/target/Makefile b/target/Makefile
index 1b6cbb5..9a7dff2 100644
--- a/target/Makefile
+++ b/target/Makefile
@@ -51,4 +51,5 @@ image_install: image_compile
imagebuilder_install: image_install
$(MAKE) -C imagebuilder install
-$(eval $(call default_subtargets,))
+%-prereq %-prepare %-download %-clean %-compile %-install: FORCE
+ $(MAKE) -C $* $(patsubst $*-%,%,$@)
diff --git a/toolchain/Makefile b/toolchain/Makefile
index a8bf7d6..673fec2 100644
--- a/toolchain/Makefile
+++ b/toolchain/Makefile
@@ -15,6 +15,7 @@ ifeq ($(CONFIG_NATIVE_TOOLCHAIN),)
endif
TARGETS_DOWNLOAD:=$(patsubst %,%-download,$(TARGETS-y))
+TARGETS_PREPARE:=$(patsubst %,%-prepare,$(TARGETS-y))
TARGETS_COMPILE:=$(patsubst %,%-compile,$(TARGETS-y))
TARGETS_INSTALL:=$(patsubst %,%-install,$(TARGETS-y))
TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS-y))
@@ -49,5 +50,14 @@ $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME):
$(TOOLCHAIN_BUILD_DIR):
@mkdir -p $@
-$(eval $(call default_subtargets,$(STAGING_DIR)/$(REAL_GNU_TARGET_NAME) $(TOOLCHAIN_BUILD_DIR)))
+%-prereq %-download %-clean: FORCE
+ $(MAKE) -C $* $(patsubst $*-%,%,$@)
+%-prepare: $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME) $(TOOLCHAIN_BUILD_DIR)
+ $(MAKE) -C $* $(patsubst $*-%,%,$@)
+
+%-compile: %-prepare FORCE
+ $(MAKE) -C $* $(patsubst $*-%,%,$@)
+
+%-install: %-compile FORCE
+ $(MAKE) -C $* $(patsubst $*-%,%,$@)
diff --git a/tools/Makefile b/tools/Makefile
index 9c31554..31b0bec 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -40,9 +40,17 @@ $(STAGING_DIR)/include-host:
$(TOOL_BUILD_DIR):
@mkdir -p $@
-$(TARGETS_COMPILE) $(TARGETS_INSTALL): $(STAGING_DIR)/include-host $(TOOL_BUILD_DIR)
+%-prereq %-download %-clean: FORCE
+ $(MAKE) -C $* $(patsubst $*-%,%,$@)
-$(eval $(call default_subtargets,))
+%-prepare: $(STAGING_DIR)/include-host $(TOOL_BUILD_DIR) FORCE
+ $(MAKE) -C $* $(patsubst $*-%,%,$@)
+
+%-compile: %-prepare FORCE
+ $(MAKE) -C $* $(patsubst $*-%,%,$@)
+
+%-install: %-compile FORCE
+ $(MAKE) -C $* $(patsubst $*-%,%,$@)
ifeq ($(MAKECMDGOALS),install-targets)
MAKEFLAGS:=$(MAKEFLAGS) -j$(CONFIG_JLEVEL)