aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2007-09-08 19:55:42 +0000
committerFelix Fietkau <nbd@openwrt.org>2007-09-08 19:55:42 +0000
commit6bcd07afdd1ffcba5fe94f1291b4e4f0c764263e (patch)
tree30cacdb892969714d2a079f391ba6786b7c36489
parent9647361f814667b536160d416666bd25ab4b82fa (diff)
downloadupstream-6bcd07afdd1ffcba5fe94f1291b4e4f0c764263e.tar.gz
upstream-6bcd07afdd1ffcba5fe94f1291b4e4f0c764263e.tar.bz2
upstream-6bcd07afdd1ffcba5fe94f1291b4e4f0c764263e.zip
major target cleanup. it is now possible to have subtargets that can override many target settings, including arch - merge adm5120, adm5120eb. target profiles still need to be adapted for subtargets
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@8694 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--Makefile2
-rw-r--r--include/image.mk1
-rw-r--r--include/kernel-build.mk144
-rw-r--r--include/kernel-defaults.mk7
-rw-r--r--include/kernel-version.mk14
-rw-r--r--include/kernel.mk23
-rw-r--r--include/scan.mk4
-rw-r--r--include/subdir.mk4
-rw-r--r--include/target.mk146
-rw-r--r--include/toplevel.mk3
-rw-r--r--package/acx/Makefile2
-rw-r--r--package/admswconfig/Makefile2
-rw-r--r--package/ar7-atm/Makefile2
-rw-r--r--package/base-files/Makefile7
-rw-r--r--package/bcm43xx-mac80211/Makefile2
-rw-r--r--package/broadcom-diag/Makefile4
-rw-r--r--package/broadcom-mmc/Makefile2
-rw-r--r--package/broadcom-wl/Makefile4
-rw-r--r--package/fonera-mp3-drv/Makefile2
-rw-r--r--package/fonera-mp3/Makefile2
-rw-r--r--package/foxboard-utils/Makefile2
-rw-r--r--package/hostapd/Makefile2
-rw-r--r--package/ipset/Makefile2
-rw-r--r--package/nvram/Makefile2
-rw-r--r--package/switch/Makefile2
-rw-r--r--package/util-linux/Makefile2
-rw-r--r--package/wlcompat/Makefile4
-rw-r--r--package/yamonenv/Makefile2
-rw-r--r--rules.mk10
-rwxr-xr-xscripts/kconfig.pl (renamed from scripts/config.pl)0
-rwxr-xr-xscripts/metadata.pl58
-rw-r--r--target/linux/Makefile2
-rw-r--r--target/linux/adm5120/Makefile21
-rw-r--r--target/linux/adm5120/router_be/config-2.6.22 (renamed from target/linux/adm5120eb/config/default)0
-rw-r--r--target/linux/adm5120/router_be/image/Makefile (renamed from target/linux/adm5120eb/image/Makefile)0
l---------target/linux/adm5120/router_be/image/lzma-loader (renamed from target/linux/adm5120eb/image/lzma-loader)0
-rw-r--r--target/linux/adm5120/router_be/profiles/090-Zyxel.mk (renamed from target/linux/adm5120eb/profiles/090-Zyxel.mk)0
-rw-r--r--target/linux/adm5120/router_be/profiles/100-Texas.mk (renamed from target/linux/adm5120eb/profiles/100-Texas.mk)0
-rw-r--r--target/linux/adm5120/router_be/profiles/110-Atheros.mk (renamed from target/linux/adm5120eb/profiles/110-Atheros.mk)0
-rw-r--r--target/linux/adm5120/router_be/profiles/110-None.mk (renamed from target/linux/adm5120eb/profiles/110-None.mk)0
-rw-r--r--target/linux/adm5120/router_be/target.mk9
-rwxr-xr-xtarget/linux/adm5120/router_le/base-files/default/sbin/wget2nand (renamed from target/linux/adm5120/base-files/default/sbin/wget2nand)0
-rw-r--r--target/linux/adm5120/router_le/config-2.6.22 (renamed from target/linux/adm5120/config/default)0
-rw-r--r--target/linux/adm5120/router_le/profiles/100-Atheros.mk (renamed from target/linux/adm5120/profiles/100-Atheros.mk)0
-rw-r--r--target/linux/adm5120/router_le/profiles/105-Texas.mk (renamed from target/linux/adm5120/profiles/105-Texas.mk)0
-rw-r--r--target/linux/adm5120/router_le/profiles/110-Ralink.mk (renamed from target/linux/adm5120/profiles/110-Ralink.mk)0
-rw-r--r--target/linux/adm5120/router_le/profiles/200-None.mk (renamed from target/linux/adm5120/profiles/200-None.mk)0
-rw-r--r--target/linux/adm5120/router_le/profiles/Cellvision.mk (renamed from target/linux/adm5120/profiles/Cellvision.mk)0
-rw-r--r--target/linux/adm5120/router_le/profiles/RB1xx.mk (renamed from target/linux/adm5120/profiles/RB1xx.mk)0
-rw-r--r--target/linux/adm5120/router_le/target.mk9
-rw-r--r--target/linux/adm5120eb/Makefile27
l---------target/linux/adm5120eb/files1
l---------target/linux/adm5120eb/patches-2.6.221
-rw-r--r--target/linux/amazon/Makefile7
-rw-r--r--target/linux/amazon/config-2.6.21 (renamed from target/linux/amazon/config/default)0
-rw-r--r--target/linux/amcc/Makefile6
-rw-r--r--target/linux/amcc/config-2.6.21 (renamed from target/linux/amcc/config/default)0
-rw-r--r--target/linux/ar7/Makefile6
-rw-r--r--target/linux/ar7/config-2.6.22 (renamed from target/linux/ar7/config/default)0
-rw-r--r--target/linux/at91/Makefile9
-rw-r--r--target/linux/at91/config-2.6.22 (renamed from target/linux/at91/config/default)0
-rw-r--r--target/linux/atheros/Makefile9
-rw-r--r--target/linux/atheros/config-2.6.22 (renamed from target/linux/atheros/config/default)0
-rw-r--r--target/linux/au1000/Makefile8
-rw-r--r--target/linux/au1000/config-2.6.22 (renamed from target/linux/au1000/config/default)0
-rw-r--r--target/linux/avr32/Makefile9
-rw-r--r--target/linux/brcm-2.4/Makefile13
-rw-r--r--target/linux/brcm-2.4/config-2.4.34 (renamed from target/linux/brcm-2.4/config/default)0
-rw-r--r--target/linux/brcm47xx/Makefile8
-rw-r--r--target/linux/brcm47xx/config-2.6.22 (renamed from target/linux/brcm47xx/config/default)0
-rw-r--r--target/linux/brcm63xx/Makefile7
-rw-r--r--target/linux/brcm63xx/config-2.6.22 (renamed from target/linux/brcm63xx/config/default)0
-rw-r--r--target/linux/etrax/Makefile15
-rw-r--r--target/linux/generic-2.4/config-default (renamed from target/linux/generic-2.4/config-template)0
-rw-r--r--target/linux/generic-2.6/config-default (renamed from target/linux/generic-2.6/config-template)0
-rw-r--r--target/linux/iop32x/Makefile7
-rw-r--r--target/linux/iop32x/config-2.6.21 (renamed from target/linux/iop32x/config/default)0
-rw-r--r--target/linux/ixp4xx/Makefile7
-rw-r--r--target/linux/ixp4xx/config-2.6.21 (renamed from target/linux/ixp4xx/config/default)0
-rw-r--r--target/linux/magicbox/Makefile4
-rw-r--r--target/linux/magicbox/config-2.6.22 (renamed from target/linux/magicbox/config/default)0
-rw-r--r--target/linux/pxa/Makefile6
-rw-r--r--target/linux/pxa/config-2.6.21 (renamed from target/linux/pxa/config/default)0
-rw-r--r--target/linux/rb532/Makefile4
-rw-r--r--target/linux/rb532/config-2.6.22 (renamed from target/linux/rb532/config/default)0
-rw-r--r--target/linux/rdc/Makefile10
-rw-r--r--target/linux/rdc/config-2.6.22 (renamed from target/linux/rdc/config/default)0
-rw-r--r--target/linux/rdc/config/profile-wl1532
-rw-r--r--target/linux/sibyte/Makefile4
-rw-r--r--target/linux/sibyte/config-2.6.21 (renamed from target/linux/sibyte/config/default)0
-rw-r--r--target/linux/uml/Makefile4
-rw-r--r--target/linux/x86/Makefile4
-rw-r--r--toolchain/Makefile4
-rw-r--r--toolchain/gcc/Makefile2
-rw-r--r--toolchain/uClibc/Makefile4
95 files changed, 343 insertions, 349 deletions
diff --git a/Makefile b/Makefile
index a5e03d1cb3..48a138db15 100644
--- a/Makefile
+++ b/Makefile
@@ -45,7 +45,7 @@ clean: FORCE
rm -rf $(TMP_DIR)
dirclean: clean
- rm -rf $(STAGING_DIR) $(STAGING_DIR_HOST) $(STAGING_DIR_TOOLCHAIN) $(BUILD_DIR_TOOLCHAIN) $(BUILD_DIR_HOST)
+ rm -rf $(STAGING_DIR) $(STAGING_DIR_HOST) $(STAGING_DIR_TOOLCHAIN) $(TOOLCHAIN_DIR) $(BUILD_DIR_HOST)
# check prerequisites before starting to build
prereq: $(package/stamp-prereq) $(target/stamp-prereq) ;
diff --git a/include/image.mk b/include/image.mk
index fa08372007..68ce0480d1 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -5,6 +5,7 @@
# See /LICENSE for more information.
#
+override TARGET_BUILD=
include $(INCLUDE_DIR)/prereq.mk
include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/host.mk
diff --git a/include/kernel-build.mk b/include/kernel-build.mk
index 69e602aded..65907600c9 100644
--- a/include/kernel-build.mk
+++ b/include/kernel-build.mk
@@ -1,60 +1,20 @@
-#
+#
# Copyright (C) 2006-2007 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
-KERNEL_BUILD:=1
-
include $(INCLUDE_DIR)/host.mk
-include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/prereq.mk
-override MAKEFLAGS=
-
-GENERIC_LINUX_CONFIG:=$(GENERIC_PLATFORM_DIR)/config-$(shell [ -f "$(GENERIC_PLATFORM_DIR)/config-$(KERNEL_PATCHVER)" ] && echo "$(KERNEL_PATCHVER)" || echo template )
-LINUX_CONFIG_DIR ?= ./config$(shell [ -d "./config-$(KERNEL_PATCHVER)" ] && printf -- "-$(KERNEL_PATCHVER)" || true )
-LINUX_CONFIG ?= $(LINUX_CONFIG_DIR)/default
-
-ifneq ($(DUMP),)
- TMP_CONFIG:=$(TMP_DIR)/.kconfig-$(BOARD)-$(KERNEL)
- $(TMP_CONFIG): $(GENERIC_LINUX_CONFIG) $(LINUX_CONFIG)
- $(SCRIPT_DIR)/config.pl + $^ > $@
- -include $(TMP_CONFIG)
- .SILENT: $(TMP_CONFIG)
+ifneq ($(DUMP),1)
+ override MAKEFLAGS=
endif
-ifneq ($(CONFIG_PCI),)
- FEATURES += pci
-endif
-ifneq ($(CONFIG_USB),)
- FEATURES += usb
-endif
-ifneq ($(CONFIG_PCMCIA)$(CONFIG_PCCARD),)
- FEATURES += pcmcia
-endif
-
-# remove duplicates
-FEATURES:=$(sort $(FEATURES))
-
-ifeq ($(DUMP),1)
- all: dumpinfo
-else
+ifneq ($(DUMP),1)
all: compile
endif
-ifneq (,$(findstring uml,$(BOARD)))
- LINUX_KARCH:=um
-else
- LINUX_KARCH:=$(shell echo $(ARCH) | sed -e 's/i[3-9]86/i386/' \
- -e 's/mipsel/mips/' \
- -e 's/mipseb/mips/' \
- -e 's/powerpc/ppc/' \
- -e 's/sh[234]/sh/' \
- -e 's/armeb/arm/' \
- )
-endif
-
STAMP_PREPARED:=$(LINUX_DIR)/.prepared
STAMP_CONFIGURED:=$(LINUX_DIR)/.configured
include $(INCLUDE_DIR)/quilt.mk
@@ -90,106 +50,54 @@ define BuildKernel
$(STAMP_PREPARED): $(DL_DIR)/$(LINUX_SOURCE)
-rm -rf $(KERNEL_BUILD_DIR)
-mkdir -p $(KERNEL_BUILD_DIR)
- $(call Kernel/Prepare)
+ $(Kernel/Prepare)
touch $$@
$(STAMP_CONFIGURED): $(STAMP_PREPARED) $(LINUX_CONFIG) $(GENERIC_LINUX_CONFIG) $(TOPDIR)/.config
- $(call Kernel/Configure)
+ $(Kernel/Configure)
touch $$@
$(LINUX_DIR)/.modules: $(STAMP_CONFIGURED) $(LINUX_DIR)/.config FORCE
- $(call Kernel/CompileModules)
+ $(Kernel/CompileModules)
touch $$@
$(LINUX_DIR)/.image: $(STAMP_CONFIGURED) FORCE
- $(call Kernel/CompileImage)
+ $(Kernel/CompileImage)
touch $$@
mostlyclean: FORCE
- $(call Kernel/Clean)
-
- ifeq ($(DUMP),1)
- dumpinfo:
- @echo 'Target: $(BOARD)'
- @echo 'Target-Kernel: $(KERNEL)'
- @echo 'Target-Name: $(BOARDNAME) [$(KERNEL)]'
- @echo 'Target-Path: $(subst $(TOPDIR)/,,$(PWD))'
- @echo 'Target-Arch: $(ARCH)'
- @echo 'Target-Features: $(FEATURES)'
- @echo 'Linux-Version: $(LINUX_VERSION)'
- @echo 'Linux-Release: $(LINUX_RELEASE)'
- @echo 'Linux-Kernel-Arch: $(LINUX_KARCH)'
- @echo 'Target-Description:'
- @getvar $(call shvar,Target/Description)
- @echo '@@'
- @echo 'Default-Packages: $(DEFAULT_PACKAGES)'
- ifneq ($(DUMPINFO),)
- @$(DUMPINFO)
- endif
- endif
+ $(Kernel/Clean)
define BuildKernel
endef
-endef
-
-define Profile/Default
- NAME:=
- PACKAGES:=
-endef
-
-confname=$(subst .,_,$(subst -,_,$(1)))
-define Profile
- $(eval $(call Profile/Default))
- $(eval $(call Profile/$(1)))
- $(eval $(call shexport,Profile/$(1)/Config))
- $(eval $(call shexport,Profile/$(1)/Description))
- DUMPINFO += \
- echo "Target-Profile: $(1)"; \
- echo "Target-Profile-Name: $(NAME)"; \
- echo "Target-Profile-Packages: $(PACKAGES)"; \
- if [ -f ./config/profile-$(1) ]; then \
- echo "Target-Profile-Kconfig: yes"; \
- fi; \
- echo "Target-Profile-Config: "; \
- getvar "$(call shvar,Profile/$(1)/Config)"; \
- echo "@@"; \
- echo "Target-Profile-Description:"; \
- getvar "$(call shvar,Profile/$(1)/Description)"; \
- echo "@@"; \
- echo;
- ifeq ($(CONFIG_LINUX_$(call confname,$(KERNEL)_$(1))),y)
- PROFILE=$(1)
- endif
-endef
-
-$(eval $(call shexport,Target/Description))
-download: $(DL_DIR)/$(LINUX_SOURCE)
-prepare: $(STAMP_CONFIGURED)
-compile: $(LINUX_DIR)/.modules
- $(MAKE) -C image compile
+ download: $(DL_DIR)/$(LINUX_SOURCE)
+ prepare: $(STAMP_CONFIGURED)
+ compile: $(LINUX_DIR)/.modules
+ $(MAKE) -C image compile TARGET_BUILD=
-oldconfig menuconfig: $(STAMP_PREPARED) FORCE
- $(call Kernel/Configure)
- $(SCRIPT_DIR)/config.pl '+' $(GENERIC_LINUX_CONFIG) $(LINUX_CONFIG) > $(LINUX_DIR)/.config
+ oldconfig menuconfig: $(STAMP_PREPARED) FORCE
+ $(Kernel/Configure)
+ $(LINUX_CONFCMD) > $(LINUX_DIR)/.config
$(MAKE) -C $(LINUX_DIR) $(KERNEL_MAKEOPTS) $@
- $(SCRIPT_DIR)/config.pl '>' $(GENERIC_LINUX_CONFIG) $(LINUX_DIR)/.config > $(LINUX_CONFIG)
+ $(SCRIPT_DIR)/kconfig.pl '>' $(GENERIC_LINUX_CONFIG) $(LINUX_DIR)/.config > $(LINUX_CONFIG)
-install: $(LINUX_DIR)/.image
- $(MAKE) -C image compile install
+ install: $(LINUX_DIR)/.image
+ TARGET_BUILD="" $(MAKE) -C image compile install
-clean: FORCE
- rm -f $(STAMP_DIR)/.linux-compile
+ clean: FORCE
rm -rf $(KERNEL_BUILD_DIR)
-rebuild: FORCE
+ rebuild: FORCE
@$(MAKE) mostlyclean
@if [ -f $(LINUX_KERNEL) ]; then \
$(MAKE) clean; \
fi
@$(MAKE) compile
-image-prereq:
- $(SUBMAKE) -s -C image prereq
+ image-prereq:
+ $(SUBMAKE) -s -C image prereq TARGET_BUILD=
-prereq: image-prereq
+ prereq: image-prereq
+
+endef
diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk
index 3916483adf..88f1c36758 100644
--- a/include/kernel-defaults.mk
+++ b/include/kernel-defaults.mk
@@ -46,11 +46,9 @@ define Kernel/Configure/2.6
-$(MAKE) $(KERNEL_MAKEOPTS) CC="$(KERNEL_CC)" oldconfig prepare scripts
endef
define Kernel/Configure/Default
- $(SCRIPT_DIR)/config.pl '+' $(GENERIC_LINUX_CONFIG) \
- $(if $(wildcard ./config/profile-$(PROFILE)),'+' $(LINUX_CONFIG) ./config/profile-$(PROFILE), $(LINUX_CONFIG)) \
- > $(LINUX_DIR)/.config.target
+ $(LINUX_CONFCMD) > $(LINUX_DIR)/.config.target
$(SCRIPT_DIR)/metadata.pl kconfig $(TMP_DIR)/.packageinfo $(TOPDIR)/.config > $(LINUX_DIR)/.config.override
- $(SCRIPT_DIR)/config.pl 'm+' $(LINUX_DIR)/.config.target $(LINUX_DIR)/.config.override >$(LINUX_DIR)/.config
+ $(SCRIPT_DIR)/kconfig.pl 'm+' $(LINUX_DIR)/.config.target $(LINUX_DIR)/.config.override > $(LINUX_DIR)/.config
$(call Kernel/Configure/$(KERNEL))
rm -rf $(KERNEL_BUILD_DIR)/modules
@rm -f $(BUILD_DIR)/linux
@@ -88,7 +86,6 @@ define Kernel/CompileImage/Default
endef
define Kernel/Clean/Default
- rm -f $(LINUX_DIR)/.linux-compile
rm -f $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)/.configured
rm -f $(LINUX_KERNEL)
$(MAKE) -C $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION) clean
diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index ee3486fdb1..508cf9934a 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -1,11 +1,9 @@
# Use the default kernel version if the Makefile doesn't override it
-ifeq ($(LINUX_VERSION),)
- ifeq ($(KERNEL),2.4)
- LINUX_VERSION:=2.4.34
- else
- LINUX_VERSION:=2.6.21.5
- endif
+ifeq ($(KERNEL),2.4)
+ LINUX_VERSION?=2.4.34
+else
+ LINUX_VERSION?=2.6.21.5
endif
LINUX_RELEASE?=1
@@ -22,6 +20,6 @@ endif
# disable the md5sum check for unknown kernel versions
LINUX_KERNEL_MD5SUM?=x
-KERNEL:=2.$(word 2,$(subst ., ,$(strip $(LINUX_VERSION))))
-KERNEL_PATCHVER:=$(shell echo $(LINUX_VERSION) | cut -d. -f1,2,3 | cut -d- -f1)
+KERNEL?=2.$(word 2,$(subst ., ,$(strip $(LINUX_VERSION))))
+KERNEL_PATCHVER=$(shell echo $(LINUX_VERSION) | cut -d. -f1,2,3 | cut -d- -f1)
diff --git a/include/kernel.mk b/include/kernel.mk
index 559b37e4a3..b82668ea48 100644
--- a/include/kernel.mk
+++ b/include/kernel.mk
@@ -5,15 +5,15 @@
# See /LICENSE for more information.
#
-include $(INCLUDE_DIR)/kernel-version.mk
+ifeq ($(__target_inc),)
+ include $(INCLUDE_DIR)/target.mk
+endif
ifeq ($(DUMP),1)
KERNEL?=<KERNEL>
BOARD?=<BOARD>
LINUX_VERSION?=<LINUX_VERSION>
else
- include $(INCLUDE_DIR)/target.mk
-
export GCC_HONOUR_COPTS=s
ifeq ($(KERNEL),2.6)
@@ -30,9 +30,8 @@ else
KERNEL_CROSS:=$(TARGET_CROSS)
endif
- PLATFORM_DIR := $(TOPDIR)/target/linux/$(BOARD)
PATCH_DIR ?= ./patches$(shell [ -d "./patches-$(KERNEL_PATCHVER)" ] && printf -- "-$(KERNEL_PATCHVER)" || true )
- KERNEL_BUILD_DIR ?= $(BUILD_DIR_BASE)/linux-$(BOARD)$(if $(BUILD_SUFFIX),_$(BUILD_SUFFIX))
+ KERNEL_BUILD_DIR ?= $(BUILD_DIR_BASE)/linux-$(BOARD)$(if $(SUBTARGET),_$(SUBTARGET))$(if $(BUILD_SUFFIX),_$(BUILD_SUFFIX))
LINUX_DIR ?= $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)
MODULES_SUBDIR:=lib/modules/$(LINUX_VERSION)
@@ -46,8 +45,18 @@ else
PKG_BUILD_DIR ?= $(KERNEL_BUILD_DIR)/$(PKG_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION))
endif
-GENERIC_PLATFORM_DIR := $(TOPDIR)/target/linux/generic-$(KERNEL)
-GENERIC_PATCH_DIR := $(GENERIC_PLATFORM_DIR)/patches$(shell [ -d "$(GENERIC_PLATFORM_DIR)/patches-$(KERNEL_PATCHVER)" ] && printf -- "-$(KERNEL_PATCHVER)" || true )
+
+ifneq (,$(findstring uml,$(BOARD)))
+ LINUX_KARCH:=um
+else
+ LINUX_KARCH:=$(shell echo $(ARCH) | sed -e 's/i[3-9]86/i386/' \
+ -e 's/mipsel/mips/' \
+ -e 's/mipseb/mips/' \
+ -e 's/powerpc/ppc/' \
+ -e 's/sh[234]/sh/' \
+ -e 's/armeb/arm/' \
+ )
+endif
define KernelPackage/Defaults
diff --git a/include/scan.mk b/include/scan.mk
index 819c8ca595..dfe80fabaa 100644
--- a/include/scan.mk
+++ b/include/scan.mk
@@ -27,14 +27,14 @@ define PackageDir
{ \
$$(call progress,Collecting $(SCAN_NAME) info: $(SCAN_DIR)/$(2)) \
echo Source-Makefile: $(SCAN_DIR)/$(2)/Makefile; \
- $(NO_TRACE_MAKE) --no-print-dir DUMP=1 -C $(SCAN_DIR)/$(2) 2>/dev/null || echo "ERROR: please fix $(SCAN_DIR)/$(2)/Makefile" >&2; \
+ $(NO_TRACE_MAKE) --no-print-dir DUMP=1 -C $(SCAN_DIR)/$(2) $(SCAN_MAKEOPTS) 2>/dev/null || echo "ERROR: please fix $(SCAN_DIR)/$(2)/Makefile" >&2; \
echo; \
} > $$@ || true
endef
$(FILELIST):
rm -f tmp/info/.files-$(SCAN_TARGET)-*
- $(call FIND_L, $(SCAN_DIR)) $(SCAN_EXTRA) -mindepth 1 $(if $(SCAN_DEPTH),-maxdepth $(SCAN_DEPTH)) -name Makefile | xargs grep -HE 'call (Build/DefaultTargets|Build(Package|Kernel)|.+Package)' | sed -e 's#^$(SCAN_DIR)/##' -e 's#/Makefile:.*##' | uniq > $@
+ $(call FIND_L, $(SCAN_DIR)) $(SCAN_EXTRA) -mindepth 1 $(if $(SCAN_DEPTH),-maxdepth $(SCAN_DEPTH)) -name Makefile | xargs grep -HE 'call (Build/DefaultTargets|Build(Package|Target)|.+Package)' | sed -e 's#^$(SCAN_DIR)/##' -e 's#/Makefile:.*##' | uniq > $@
tmp/info/.files-$(SCAN_TARGET).mk: $(FILELIST)
( \
diff --git a/include/subdir.mk b/include/subdir.mk
index 40a06ed9e1..68afcc48a2 100644
--- a/include/subdir.mk
+++ b/include/subdir.mk
@@ -34,10 +34,10 @@ define subdir
$(foreach target,$(SUBTARGETS),$(call subtarget,$(1),$(target)))
endef
-# Parameters: <subdir> <name> <target>
+# Parameters: <subdir> <name> <target> <depends>
define stampfile
$(1)/stamp-$(3):=$(STAGING_DIR)/stamp/.$(2)_$(3)
- $$($(1)/stamp-$(3)): $(TMP_DIR)/.build
+ $$($(1)/stamp-$(3)): $(TMP_DIR)/.build $(4)
@+$(SCRIPT_DIR)/timestamp.pl -n $$($(1)/stamp-$(3)) $(1) $(4) || \
$(MAKE) $$($(1)/flags-$(3)) $(1)/$(3)
@mkdir -p $$$$(dirname $$($(1)/stamp-$(3)))
diff --git a/include/target.mk b/include/target.mk
index b0a178e306..42f484af9d 100644
--- a/include/target.mk
+++ b/include/target.mk
@@ -5,17 +5,147 @@
# See /LICENSE for more information.
#
-define AddProfile
- ifeq ($(CONFIG_LINUX_$(1)),y)
- $(call Profile/$(1))
- PROFILE=$$(ID)
+ifneq ($(DUMP),)
+ all: dumpinfo
+endif
+
+ifneq ($(__target_inc),1)
+__target_inc=1
+
+TARGET_BUILD?=0
+
+
+target_conf=$(subst .,_,$(subst -,_,$(subst /,_,$(1))))
+ifeq ($(DUMP),)
+ PLATFORM_DIR:=$(TOPDIR)/target/linux/$(BOARD)
+ SUBTARGET:=$(strip $(foreach subdir,$(patsubst $(PLATFORM_DIR)/%/target.mk,%,$(wildcard $(PLATFORM_DIR)/*/target.mk)),$(if $(CONFIG_TARGET_$(call target_conf,$(BOARD)_$(subdir))),$(subdir))))
+else
+ PLATFORM_DIR:=${CURDIR}
+endif
+
+TARGETID:=$(BOARD)$(if $(SUBTARGET),/$(SUBTARGET))
+PLATFORM_SUBDIR:=$(PLATFORM_DIR)$(if $(SUBTARGET),/$(SUBTARGET))
+
+define Target
+ KERNEL_TARGETS+=$(1)
+ ifeq ($(DUMP),1)
+ ifeq ($(SUBTARGET),)
+ BuildTarget=$$(BuildTargets/DumpAll)
+ endif
+ endif
+endef
+
+ifneq ($(TARGET_BUILD),1)
+ include $(PLATFORM_DIR)/Makefile
+ ifneq ($(PLATFORM_DIR),$(PLATFORM_SUBDIR))
+ include $(PLATFORM_SUBDIR)/target.mk
+ endif
+else
+ ifneq ($(SUBTARGET),)
+ -include ./$(SUBTARGET)/target.mk
+ endif
+endif
+
+define Profile/Default
+ NAME:=
+ PACKAGES:=
+endef
+
+define Profile
+ $(eval $(call Profile/Default))
+ $(eval $(call Profile/$(1)))
+ $(eval $(call shexport,Profile/$(1)/Config))
+ $(eval $(call shexport,Profile/$(1)/Description))
+ DUMPINFO += \
+ echo "Target-Profile: $(1)"; \
+ echo "Target-Profile-Name: $(NAME)"; \
+ echo "Target-Profile-Packages: $(PACKAGES)"; \
+ if [ -f ./config/profile-$(1) ]; then \
+ echo "Target-Profile-Kconfig: yes"; \
+ fi; \
+ echo "Target-Profile-Config: "; \
+ getvar "$(call shvar,Profile/$(1)/Config)"; \
+ echo "@@"; \
+ echo "Target-Profile-Description:"; \
+ getvar "$(call shvar,Profile/$(1)/Description)"; \
+ echo "@@"; \
+ echo;
+ ifeq ($(CONFIG_TARGET_$(call target_conf,$(BOARD)_$(if $(2),$(2)_)$(1))),y)
+ PROFILE=$(1)
endif
endef
--include $(TMP_DIR)/.target.mk
+$(eval $(call shexport,Target/Description))
+
+
+include $(INCLUDE_DIR)/kernel-version.mk
+
+GENERIC_PLATFORM_DIR := $(TOPDIR)/target/linux/generic-$(KERNEL)
+GENERIC_PATCH_DIR := $(GENERIC_PLATFORM_DIR)/patches$(shell [ -d "$(GENERIC_PLATFORM_DIR)/patches-$(KERNEL_PATCHVER)" ] && printf -- "-$(KERNEL_PATCHVER)" || true )
+
+GENERIC_LINUX_CONFIG:=$(firstword $(wildcard $(GENERIC_PLATFORM_DIR)/config-$(KERNEL_PATCHVER) $(GENERIC_PLATFORM_DIR)/config-default))
+LINUX_CONFIG?=$(firstword $(wildcard $(foreach subdir,$(PLATFORM_DIR) $(PLATFORM_SUBDIR),$(subdir)/config-$(KERNEL_PATCHVER) $(subdir)/config-default)))
+LINUX_SUBCONFIG?=$(firstword $(wildcard $(PLATFORM_SUBDIR)/config-$(KERNEL_PATCHVER) $(PLATFORM_SUBDIR)/config-default))
+ifeq ($(LINUX_CONFIG),$(LINUX_SUBCONFIG))
+ LINUX_SUBCONFIG:=
+endif
+LINUX_CONFCMD=$(if $(LINUX_CONFIG),$(SCRIPT_DIR)/kconfig.pl + $(GENERIC_LINUX_CONFIG) $(if $(LINUX_SUBCONFIG),+ $(LINUX_CONFIG) $(LINUX_SUBCONFIG),$(LINUX_CONFIG)),true)
+
+ifeq ($(DUMP),1)
+ BuildTarget=$(BuildTargets/DumpCurrent)
+
+ ifneq ($(BOARD),)
+ TMP_CONFIG:=$(TMP_DIR)/.kconfig-$(call target_conf,$(TARGETID))
+ $(TMP_CONFIG): $(GENERIC_LINUX_CONFIG) $(LINUX_CONFIG) $(LINUX_SUBCONFIG)
+ $(LINUX_CONFCMD) > $@ || rm -f $@
+ -include $(TMP_CONFIG)
+ .SILENT: $(TMP_CONFIG)
+ .PRECIOUS: $(TMP_CONFIG)
+
+ ifneq ($(CONFIG_PCI),)
+ FEATURES += pci
+ endif
+ ifneq ($(CONFIG_USB),)
+ FEATURES += usb
+ endif
+ ifneq ($(CONFIG_PCMCIA)$(CONFIG_PCCARD),)
+ FEATURES += pcmcia
+ endif
+
+ # remove duplicates
+ FEATURES:=$(sort $(FEATURES))
+ endif
+endif
+
+define BuildTargets/DumpAll
+ dumpinfo:
+ @$(foreach SUBTARGET,$(KERNEL_TARGETS),$(SUBMAKE) -s DUMP=1 SUBTARGET=$(SUBTARGET); )
+endef
+
+define BuildTargets/DumpCurrent
+
+ dumpinfo:
+ @echo 'Target: $(TARGETID)'; \
+ echo 'Target-Board: $(BOARD)'; \
+ echo 'Target-Kernel: $(KERNEL)'; \
+ echo 'Target-Name: $(BOARDNAME) [$(KERNEL)]'; \
+ echo 'Target-Path: $(subst $(TOPDIR)/,,$(PWD))'; \
+ echo 'Target-Arch: $(ARCH)'; \
+ echo 'Target-Features: $(FEATURES)'; \
+ echo 'Linux-Version: $(LINUX_VERSION)'; \
+ echo 'Linux-Release: $(LINUX_RELEASE)'; \
+ echo 'Linux-Kernel-Arch: $(LINUX_KARCH)'; \
+ echo 'Target-Description:'; \
+ getvar $(call shvar,Target/Description); \
+ echo '@@'; \
+ echo 'Default-Packages: $(DEFAULT_PACKAGES)'; \
+ $(DUMPINFO)
+endef
-ifeq ($(IB),1)
-$(TMP_DIR)/.target.mk: $(TOPDIR)/.target.mk
- $(CP) $< $@
+include $(INCLUDE_DIR)/kernel.mk
+ifeq ($(TARGET_BUILD),1)
+ include $(INCLUDE_DIR)/kernel-build.mk
+ BuildTarget?=$(BuildKernel)
endif
+endif #__target_inc
diff --git a/include/toplevel.mk b/include/toplevel.mk
index 8faf8e1437..0a8bdedc3e 100644
--- a/include/toplevel.mk
+++ b/include/toplevel.mk
@@ -33,13 +33,12 @@ export SCAN_COOKIE
prepare-tmpinfo: FORCE
mkdir -p tmp/info
+$(NO_TRACE_MAKE) -s -f include/scan.mk SCAN_TARGET="packageinfo" SCAN_DIR="package" SCAN_NAME="package" SCAN_DEPS="$(TOPDIR)/include/package*.mk" SCAN_DEPTH=4 SCAN_EXTRA=""
- +$(NO_TRACE_MAKE) -s -f include/scan.mk SCAN_TARGET="targetinfo" SCAN_DIR="target/linux" SCAN_NAME="target" SCAN_DEPS="profiles/*.mk $(TOPDIR)/include/kernel*.mk" SCAN_DEPTH=2 SCAN_EXTRA=""
+ +$(NO_TRACE_MAKE) -s -f include/scan.mk SCAN_TARGET="targetinfo" SCAN_DIR="target/linux" SCAN_NAME="target" SCAN_DEPS="profiles/*.mk $(TOPDIR)/include/kernel*.mk" SCAN_DEPTH=2 SCAN_EXTRA="" SCAN_MAKEOPTS="TARGET_BUILD=1"
for type in package target; do \
f=tmp/.$${type}info; t=tmp/.config-$${type}.in; \
[ "$$t" -nt "$$f" ] || ./scripts/metadata.pl $${type}_config < "$$f" > "$$t" || { rm -f "$$t"; echo "Failed to build $$t"; false; break; }; \
done
./scripts/metadata.pl package_mk < tmp/.packageinfo > tmp/.packagedeps || { rm -f tmp/.packagedeps; false; }
- ./scripts/metadata.pl target_mk < $(TMP_DIR)/.targetinfo > tmp/.target.mk
touch $(TOPDIR)/tmp/.build
.config: ./scripts/config/conf prepare-tmpinfo
diff --git a/package/acx/Makefile b/package/acx/Makefile
index e65e14e3c2..77ec91b121 100644
--- a/package/acx/Makefile
+++ b/package/acx/Makefile
@@ -26,7 +26,7 @@ include $(INCLUDE_DIR)/package.mk
define KernelPackage/acx
TITLE:=Driver for TI ACX1xx chipset
- DEPENDS:=@LINUX_2_6 @!TARGET_AVR32 +wireless-tools
+ DEPENDS:=@LINUX_2_6 @!TARGET_avr32 +wireless-tools
URL:=http://acx100.sourceforge.net/
SUBMENU:=Wireless Drivers
FILES:= $(PKG_BUILD_DIR)/acx.$(LINUX_KMOD_SUFFIX)
diff --git a/package/admswconfig/Makefile b/package/admswconfig/Makefile
index a6b0708704..0faec37e70 100644
--- a/package/admswconfig/Makefile
+++ b/package/admswconfig/Makefile
@@ -22,7 +22,7 @@ define Package/admswconfig
SECTION:=utils
CATEGORY:=Utilities
TITLE:=ADM5120 Switch configuration tool
- DEPENDS:=@TARGET_ADM5120||TARGET_ADM5120EB
+ DEPENDS:=@TARGET_adm5120
URL:=http://sharon.esrac.ele.tue.nl/users/pe1rxq/linux-adm/admswconfig/
endef
diff --git a/package/ar7-atm/Makefile b/package/ar7-atm/Makefile
index 8286f3e4eb..b9cba9ee7f 100644
--- a/package/ar7-atm/Makefile
+++ b/package/ar7-atm/Makefile
@@ -21,7 +21,7 @@ include $(INCLUDE_DIR)/package.mk
define KernelPackage/sangam-atm/Default
SUBMENU:=Network Devices
- DEPENDS:=@TARGET_AR7 +kmod-atm
+ DEPENDS:=@TARGET_ar7 +kmod-atm
TITLE:=AR7 ADSL driver
FILES:=$(PKG_BUILD_DIR)/tiatm.$(LINUX_KMOD_SUFFIX)
AUTOLOAD:=$(call AutoLoad,50,tiatm)
diff --git a/package/base-files/Makefile b/package/base-files/Makefile
index dcf0835ecc..9b8478dfc8 100644
--- a/package/base-files/Makefile
+++ b/package/base-files/Makefile
@@ -71,7 +71,7 @@ endef
define Package/libgcc
$(call Package/gcc/Default)
TITLE:=GCC support library
- DEPENDS:=@!TARGET_AVR32 @!NATIVE_TOOLCHAIN
+ DEPENDS:=@!TARGET_avr32 @!NATIVE_TOOLCHAIN
endef
define Package/libssp
@@ -123,6 +123,11 @@ define Package/base-files$(TARGET)/install
if [ -d $(PLATFORM_DIR)/base-files/default/. ]; then \
$(CP) $(PLATFORM_DIR)/base-files/default/* $(1)/; \
fi
+ $(if $(filter-out $(PLATFORM_DIR),$(PLATFORM_SUBDIR)), \
+ if [ -d $(PLATFORM_SUBDIR)/base-files/default/. ]; then \
+ $(CP) $(PLATFORM_SUBDIR)/base-files/default/* $(1)/; \
+ fi \
+ )
if [ "$(PROFILE)" != "Default" ]; then \
if [ -d $(PLATFORM_DIR)/base-files/profile-$(PROFILE)/. ]; then \
$(CP) $(PLATFORM_DIR)/base-files/profile-$(PROFILE)/* $(1)/; \
diff --git a/package/bcm43xx-mac80211/Makefile b/package/bcm43xx-mac80211/Makefile
index 34a1d767f9..12520a1f76 100644
--- a/package/bcm43xx-mac80211/Makefile
+++ b/package/bcm43xx-mac80211/Makefile
@@ -20,7 +20,7 @@ endif
define KernelPackage/bcm43xx-mac80211
SUBMENU:=Wireless Drivers
TITLE:=Broadcom 43xx wireless support
- DEPENDS:=@TARGET_BRCM47XX +kmod-mac80211
+ DEPENDS:=@TARGET_brcm47xx +kmod-mac80211
KCONFIG:=CONFIG_MAC80211
FILES:=$(PKG_BUILD_DIR)/bcm43xx-mac80211.$(LINUX_KMOD_SUFFIX)
# AUTOLOAD:=$(call AutoLoad,30,bcm43xx-mac80211)
diff --git a/package/broadcom-diag/Makefile b/package/broadcom-diag/Makefile
index 1ba4abf973..73401fc220 100644
--- a/package/broadcom-diag/Makefile
+++ b/package/broadcom-diag/Makefile
@@ -16,7 +16,7 @@ include $(INCLUDE_DIR)/package.mk
define KernelPackage/diag
SUBMENU:=Other modules
- DEPENDS:=@TARGET_BRCM_2_4||TARGET_BRCM47XX
+ DEPENDS:=@TARGET_brcm_2_4||TARGET_brcm47xx
TITLE:=Driver for router LEDs and Buttons
FILES:=$(PKG_BUILD_DIR)/diag.$(LINUX_KMOD_SUFFIX)
endef
@@ -27,7 +27,7 @@ define Build/Prepare
endef
ifeq ($(BOARD),brcm-2.4)
- BUILDFLAGS=-DBCMDRIVER -I$(LINUX_DIR)/arch/mips/bcm947xx/include $(if $(CONFIG_LINUX_2_4),-DLINUX_2_4)
+ BUILDFLAGS=-DBCMDRIVER -I$(LINUX_DIR)/arch/mips/bcm947xx/include -DLINUX_2_4
endif
define Build/Compile
diff --git a/package/broadcom-mmc/Makefile b/package/broadcom-mmc/Makefile
index 889bcfa011..5bfc8a2896 100644
--- a/package/broadcom-mmc/Makefile
+++ b/package/broadcom-mmc/Makefile
@@ -23,7 +23,7 @@ MAKEFLAGS_KMOD:= -C "$(LINUX_DIR)" \
define KernelPackage/broadcom-mmc
SUBMENU:=Other modules
- DEPENDS:=@TARGET_BRCM_2_4
+ DEPENDS:=@TARGET_brcm_2_4
TITLE:=Kernel driver for the Linksys WRT54G MM/SD-Card Mod
DESCRIPTION:=\
Kernel driver for the Linksys WRT54G MM/SD-Card Mod
diff --git a/package/broadcom-wl/Makefile b/package/broadcom-wl/Makefile
index 1a7da2d519..f468646cec 100644
--- a/package/broadcom-wl/Makefile
+++ b/package/broadcom-wl/Makefile
@@ -25,13 +25,13 @@ define Package/broadcom-wl/Default
CATEGORY:=Kernel modules
DEPENDS:=@PACKAGE_kmod-brcm-wl||PACKAGE_kmod-brcm-wl-mimo
SUBMENU:=Proprietary BCM43xx WiFi driver
- SUBMENUDEP:=@TARGET_BRCM_2_4
+ SUBMENUDEP:=@TARGET_brcm_2_4
endef
define KernelPackage/brcm-wl/Default
$(call Package/broadcom-wl/Default)
SECTION:=kernel
- DEPENDS:=@TARGET_BRCM_2_4
+ DEPENDS:=@TARGET_brcm_2_4
TITLE:=Kernel driver for BCM43xx chipsets
FILES:=$(PKG_BUILD_DIR)/kmod/wl$(1).o
AUTOLOAD:=$(call AutoLoad,30,wl$(1))
diff --git a/package/fonera-mp3-drv/Makefile b/package/fonera-mp3-drv/Makefile
index 60a45a707b..1ce29e35fa 100644
--- a/package/fonera-mp3-drv/Makefile
+++ b/package/fonera-mp3-drv/Makefile
@@ -18,7 +18,7 @@ include $(INCLUDE_DIR)/package.mk
define KernelPackage/fonera-mp3-driver
SUBMENU:=Other modules
- DEPENDS:=@TARGET_ATHEROS
+ DEPENDS:=@TARGET_atheros
TITLE:=Fonera-MP3 driver (VS1011X)
FILES:=$(PKG_BUILD_DIR)/mp3_drv.$(LINUX_KMOD_SUFFIX)
AUTOLOAD:=$(call AutoLoad,25,mp3-drv)
diff --git a/package/fonera-mp3/Makefile b/package/fonera-mp3/Makefile
index db8146f2ea..d7431ff4d0 100644
--- a/package/fonera-mp3/Makefile
+++ b/package/fonera-mp3/Makefile
@@ -19,7 +19,7 @@ include $(INCLUDE_DIR)/package.mk
define Package/fonera-mp3d
SECTION:=utils
CATEGORY:=Utilities
- DEPENDS:=@TARGET_ATHEROS
+ DEPENDS:=@TARGET_atheros
TITLE:=Daemon for fonera-mp3
endef
diff --git a/package/foxboard-utils/Makefile b/package/foxboard-utils/Makefile
index 465e5c6834..11fea9dc18 100644
--- a/package/foxboard-utils/Makefile
+++ b/package/foxboard-utils/Makefile
@@ -25,7 +25,7 @@ define Package/foxboard-utils
CATEGORY:=Base system
TITLE:=Foxboard base tools
URL:=http://www.acmesystems.it
- DEPENDS:=@TARGET_ETRAX
+ DEPENDS:=@TARGET_etrax
endef
define Package/foxboard-utils/description
diff --git a/package/hostapd/Makefile b/package/hostapd/Makefile
index 76376f5285..2e506201d1 100644
--- a/package/hostapd/Makefile
+++ b/package/hostapd/Makefile
@@ -36,7 +36,7 @@ endef
define Package/hostapd
$(call Package/hostapd/Default)
- DEPENDS:=+libopenssl @!TARGET_AVR32 @!TARGET_ETRAX
+ DEPENDS:=+libopenssl @!TARGET_avr32 @!TARGET_etrax
TITLE+= (full)
endef
diff --git a/package/ipset/Makefile b/package/ipset/Makefile
index 700b805ee0..9f6326b8cb 100644
--- a/package/ipset/Makefile
+++ b/package/ipset/Makefile
@@ -21,7 +21,7 @@ include $(INCLUDE_DIR)/package.mk
define Package/ipset
SECTION:=net
CATEGORY:=Network
- DEPENDS:=@!TARGET_ETRAX
+ DEPENDS:=@!TARGET_etrax
TITLE:=Netfilter ip sets administration utility
URL:=http://ipset.netfilter.org/
endef
diff --git a/package/nvram/Makefile b/package/nvram/Makefile
index e053a43b20..cc1371ec64 100644
--- a/package/nvram/Makefile
+++ b/package/nvram/Makefile
@@ -16,7 +16,7 @@ include $(INCLUDE_DIR)/package.mk
define Package/nvram
SECTION:=utils
CATEGORY:=Utilities
- DEPENDS:=@TARGET_BRCM_2_4
+ DEPENDS:=@TARGET_brcm_2_4
TITLE:=Broadcom config utility
endef
diff --git a/package/switch/Makefile b/package/switch/Makefile
index cdf1f51293..74e5778e23 100644
--- a/package/switch/Makefile
+++ b/package/switch/Makefile
@@ -16,7 +16,7 @@ include $(INCLUDE_DIR)/package.mk
define KernelPackage/switch
SUBMENU:=Other modules
- DEPENDS:=@TARGET_BRCM_2_4||TARGET_BRCM47XX
+ DEPENDS:=@TARGET_brcm_2_4||TARGET_brcm47xx
TITLE:=Switch drivers
FILES:= \
$(PKG_BUILD_DIR)/switch-core.$(LINUX_KMOD_SUFFIX) \
diff --git a/package/util-linux/Makefile b/package/util-linux/Makefile
index a4cfb90436..2ea4c7e564 100644
--- a/package/util-linux/Makefile
+++ b/package/util-linux/Makefile
@@ -21,7 +21,7 @@ include $(INCLUDE_DIR)/package.mk
define Package/util-linux/Default
SECTION:=utils
CATEGORY:=Utilities
- DEPENDS:=@!TARGET_ETRAX
+ DEPENDS:=@!TARGET_etrax
URL:=http://www.kernel.org/pub/linux/utils/util-linux/
endef
diff --git a/package/wlcompat/Makefile b/package/wlcompat/Makefile
index 482ec4a2d2..308a696f06 100644
--- a/package/wlcompat/Makefile
+++ b/package/wlcompat/Makefile
@@ -16,8 +16,8 @@ include $(INCLUDE_DIR)/package.mk
define KernelPackage/wlcompat/Default
SUBMENU:=Proprietary BCM43xx WiFi driver
- SUBMENUDEP:=@TARGET_BRCM_2_4
- DEPENDS:=@TARGET_BRCM_2_4 @PACKAGE_kmod-brcm-wl||PACKAGE_kmod-brcm-wl-mimo +wireless-tools
+ SUBMENUDEP:=@TARGET_brcm_2_4
+ DEPENDS:=@TARGET_brcm_2_4 @PACKAGE_kmod-brcm-wl||PACKAGE_kmod-brcm-wl-mimo +wireless-tools
TITLE:=Broadcom wl wrapper module
endef
diff --git a/package/yamonenv/Makefile b/package/yamonenv/Makefile
index 0cf6493e2d..9a323c28d8 100644
--- a/package/yamonenv/Makefile
+++ b/package/yamonenv/Makefile
@@ -23,7 +23,7 @@ include $(INCLUDE_DIR)/package.mk
define Package/yamonenv
SECTION:=utils
CATEGORY:=Utilities
- DEPENDS:=@TARGET_AU1000
+ DEPENDS:=@TARGET_au1000
TITLE:=YAMON configuration utility
URL:=http://meshcube.org/nylon/stable/sources/
endef
diff --git a/rules.mk b/rules.mk
index eb62112a82..9d5fcd72b4 100644
--- a/rules.mk
+++ b/rules.mk
@@ -5,6 +5,9 @@
# See /LICENSE for more information.
#
+ifneq ($(__rules_inc),1)
+__rules_inc=1
+
ifeq ($(DUMP),)
-include $(TOPDIR)/.config
endif
@@ -13,8 +16,6 @@ include $(TOPDIR)/include/verbose.mk
TMP_DIR:=$(TOPDIR)/tmp
-include $(TOPDIR)/include/target.mk
-
export SHELL=/usr/bin/env bash -c '. $(TOPDIR)/include/shell.sh; eval "$$2"' --
define qstrip
@@ -23,6 +24,7 @@ endef
#"))
ARCH:=$(call qstrip,$(CONFIG_ARCH))
+BOARD:=$(call qstrip,$(CONFIG_TARGET_BOARD))
TARGET_OPTIMIZATION:=$(call qstrip,$(CONFIG_TARGET_OPTIMIZATION))
BUILD_SUFFIX:=$(call qstrip,$(CONFIG_BUILD_SUFFIX))
GCCV:=$(call qstrip,$(CONFIG_GCC_VERSION))
@@ -37,7 +39,7 @@ SCRIPT_DIR:=$(TOPDIR)/scripts
BUILD_DIR_BASE:=$(TOPDIR)/build_dir
BUILD_DIR:=$(BUILD_DIR_BASE)/$(ARCH)$(if $(BUILD_SUFFIX),_$(BUILD_SUFFIX))
BUILD_DIR_HOST:=$(BUILD_DIR_BASE)/host
-BUILD_DIR_TOOLCHAIN:=$(BUILD_DIR_BASE)/toolchain-$(ARCH)
+BUILD_DIR_TOOLCHAIN:=$(BUILD_DIR_BASE)/toolchain-$(ARCH)_gcc$(GCCV)
STAGING_DIR:=$(TOPDIR)/staging_dir/$(ARCH)
STAGING_DIR_HOST:=$(TOPDIR)/staging_dir/host
TOOLCHAIN_DIR:=$(TOPDIR)/staging_dir/toolchain-$(ARCH)_gcc$(GCCV)
@@ -133,3 +135,5 @@ endef
all:
FORCE: ;
.PHONY: FORCE
+
+endif #__rules_inc
diff --git a/scripts/config.pl b/scripts/kconfig.pl
index 53b8f11025..53b8f11025 100755
--- a/scripts/config.pl
+++ b/scripts/kconfig.pl
diff --git a/scripts/metadata.pl b/scripts/metadata.pl
index fe135418ca..2fcbf82dfa 100755
--- a/scripts/metadata.pl
+++ b/scripts/metadata.pl
@@ -23,15 +23,16 @@ sub parse_target_metadata() {
while (<>) {
chomp;
/^Target:\s*(.+)\s*$/ and do {
- my $conf = uc $1;
- $conf =~ tr/\.-/__/;
+ my $conf = $1;
+ $conf =~ tr#/\.\-/#___#;
$target = {
+ id => $1,
conf => $conf,
- board => $1,
profiles => []
};
push @target, $target;
};
+ /^Target-Board:\s*(.+)\s*$/ and $target->{board} = $1;
/^Target-Kernel:\s*(\d+\.\d+)\s*$/ and $target->{kernel} = $1;
/^Target-Name:\s*(.+)\s*$/ and $target->{name} = $1;
/^Target-Path:\s*(.+)\s*$/ and $target->{path} = $1;
@@ -198,45 +199,6 @@ sub merge_package_lists($$) {
return sort(@l);
}
-sub gen_target_mk() {
- my @target = parse_target_metadata();
-
- @target = sort {
- $a->{board} cmp $b->{board}
- } @target;
-
- foreach my $target (@target) {
- my ($profiles_def, $profiles_eval);
-
- foreach my $profile (@{$target->{profiles}}) {
- $profiles_def .= "
- define Profile/$target->{conf}\_$profile->{id}
- ID:=$profile->{id}
- NAME:=$profile->{name}
- PACKAGES:=".join(" ", merge_package_lists($target->{packages}, $profile->{packages}))."\n";
- $profile->{kconfig} and $profiles_def .= " KCONFIG:=1\n";
- $profiles_def .= " endef";
- $profiles_eval .= "
-\$(eval \$(call AddProfile,$target->{conf}\_$profile->{id}))"
- }
- print "
-ifeq (\$(CONFIG_TARGET_$target->{conf}),y)
- define Target
- KERNEL:=$target->{kernel}
- BOARD:=$target->{board}
- BOARDNAME:=$target->{name}
- LINUX_VERSION:=$target->{version}
- LINUX_RELEASE:=$target->{release}
- LINUX_KARCH:=$target->{karch}
- DEFAULT_PACKAGES:=".join(" ", @{$target->{packages}})."
- endef$profiles_def
-endif$profiles_eval
-
-"
- }
- print "\$(eval \$(call Target))\n";
-}
-
sub target_config_features(@) {
my $ret;
@@ -265,7 +227,7 @@ sub gen_target_config() {
print <<EOF;
choice
prompt "Target System"
- default TARGET_BRCM_2_4
+ default TARGET_brcm_2_4
reset if !DEVEL
EOF
@@ -298,6 +260,14 @@ EOF
print <<EOF;
endchoice
+config TARGET_BOARD
+ string
+EOF
+ foreach my $target (@target) {
+ print "\t\tdefault \"".$target->{board}."\" if TARGET_".$target->{conf}."\n";
+ }
+ print <<EOF;
+
choice
prompt "Target Profile"
@@ -559,7 +529,6 @@ EOF
sub parse_command() {
my $cmd = shift @ARGV;
for ($cmd) {
- /^target_mk$/ and return gen_target_mk();
/^target_config$/ and return gen_target_config();
/^package_mk$/ and return gen_package_mk();
/^package_config$/ and return gen_package_config();
@@ -567,7 +536,6 @@ sub parse_command() {
}
print <<EOF
Available Commands:
- $0 target_mk [file] Target metadata in makefile format
$0 target_config [file] Target metadata in Kconfig format
$0 package_mk [file] Package metadata in makefile format
$0 package_config [file] Package metadata in Kconfig format
diff --git a/target/linux/Makefile b/target/linux/Makefile
index 1eb579e82e..8288250111 100644
--- a/target/linux/Makefile
+++ b/target/linux/Makefile
@@ -8,5 +8,5 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/target.mk
prereq clean download prepare compile install menuconfig oldconfig update refresh: FORCE
- $(MAKE) -C $(BOARD) $@
+ TARGET_BUILD=1 $(MAKE) -C $(BOARD) $@
diff --git a/target/linux/adm5120/Makefile b/target/linux/adm5120/Makefile
index f8436c04ed..34c3b804a7 100644
--- a/target/linux/adm5120/Makefile
+++ b/target/linux/adm5120/Makefile
@@ -1,27 +1,20 @@
#
-# Copyright (C) 2006 OpenWrt.org
+# Copyright (C) 2007 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
+
include $(TOPDIR)/rules.mk
-ARCH:=mipsel
BOARD:=adm5120
-BOARDNAME:=ADM5120 (Little Endian)
-FEATURES:=squashfs jffs2 tgz broken
-
LINUX_VERSION:=2.6.22.4
+FEATURES:=squashfs jffs2 tgz broken
-define Target/Description
- Build firmware images for Infineon/ADMtek ADM5120 based boards
- (e.g : RouterBoard RB1xx, Compex WP54G-WRT ...)
-endef
+include $(INCLUDE_DIR)/target.mk
-include $(INCLUDE_DIR)/kernel-build.mk
DEFAULT_PACKAGES += admswconfig
-# include the profiles
--include profiles/*.mk
-
-$(eval $(call BuildKernel))
+$(eval $(call Target,router_be))
+$(eval $(call Target,router_le))
+$(eval $(call BuildTarget))
diff --git a/target/linux/adm5120eb/config/default b/target/linux/adm5120/router_be/config-2.6.22
index 96c2974e0b..96c2974e0b 100644
--- a/target/linux/adm5120eb/config/default
+++ b/target/linux/adm5120/router_be/config-2.6.22
diff --git a/target/linux/adm5120eb/image/Makefile b/target/linux/adm5120/router_be/image/Makefile
index f47b3ab0b8..f47b3ab0b8 100644
--- a/target/linux/adm5120eb/image/Makefile
+++ b/target/linux/adm5120/router_be/image/Makefile
diff --git a/target/linux/adm5120eb/image/lzma-loader b/target/linux/adm5120/router_be/image/lzma-loader
index f472e6b255..f472e6b255 120000
--- a/target/linux/adm5120eb/image/lzma-loader
+++ b/target/linux/adm5120/router_be/image/lzma-loader
diff --git a/target/linux/adm5120eb/profiles/090-Zyxel.mk b/target/linux/adm5120/router_be/profiles/090-Zyxel.mk
index b0741e84be..b0741e84be 100644
--- a/target/linux/adm5120eb/profiles/090-Zyxel.mk
+++ b/target/linux/adm5120/router_be/profiles/090-Zyxel.mk
diff --git a/target/linux/adm5120eb/profiles/100-Texas.mk b/target/linux/adm5120/router_be/profiles/100-Texas.mk
index 727a0c0648..727a0c0648 100644
--- a/target/linux/adm5120eb/profiles/100-Texas.mk
+++ b/target/linux/adm5120/router_be/profiles/100-Texas.mk
diff --git a/target/linux/adm5120eb/profiles/110-Atheros.mk b/target/linux/adm5120/router_be/profiles/110-Atheros.mk
index cc4a704495..cc4a704495 100644
--- a/target/linux/adm5120eb/profiles/110-Atheros.mk
+++ b/target/linux/adm5120/router_be/profiles/110-Atheros.mk
diff --git a/target/linux/adm5120eb/profiles/110-None.mk b/target/linux/adm5120/router_be/profiles/110-None.mk
index 2fcfacde9f..2fcfacde9f 100644
--- a/target/linux/adm5120eb/profiles/110-None.mk
+++ b/target/linux/adm5120/router_be/profiles/110-None.mk
diff --git a/target/linux/adm5120/router_be/target.mk b/target/linux/adm5120/router_be/target.mk
new file mode 100644
index 0000000000..0d9154cffd
--- /dev/null
+++ b/target/linux/adm5120/router_be/target.mk
@@ -0,0 +1,9 @@
+ARCH:=mips
+SUBTARGET:=router_be
+BOARDNAME:=ADM5120 Boards (Big Endian)
+
+define Target/Description
+ Build firmware images for Infineon/ADMTek ADM5120 based boards running in big-endian mode
+ (e.g : ZyXEL Prestige 335WT ...)
+endef
+
diff --git a/target/linux/adm5120/base-files/default/sbin/wget2nand b/target/linux/adm5120/router_le/base-files/default/sbin/wget2nand
index adb56b946f..adb56b946f 100755
--- a/target/linux/adm5120/base-files/default/sbin/wget2nand
+++ b/target/linux/adm5120/router_le/base-files/default/sbin/wget2nand
diff --git a/target/linux/adm5120/config/default b/target/linux/adm5120/router_le/config-2.6.22
index 593d98ce4f..593d98ce4f 100644
--- a/target/linux/adm5120/config/default
+++ b/target/linux/adm5120/router_le/config-2.6.22
diff --git a/target/linux/adm5120/profiles/100-Atheros.mk b/target/linux/adm5120/router_le/profiles/100-Atheros.mk
index 029586848f..029586848f 100644
--- a/target/linux/adm5120/profiles/100-Atheros.mk
+++ b/target/linux/adm5120/router_le/profiles/100-Atheros.mk
diff --git a/target/linux/adm5120/profiles/105-Texas.mk b/target/linux/adm5120/router_le/profiles/105-Texas.mk
index 727a0c0648..727a0c0648 100644
--- a/target/linux/adm5120/profiles/105-Texas.mk
+++ b/target/linux/adm5120/router_le/profiles/105-Texas.mk
diff --git a/target/linux/adm5120/profiles/110-Ralink.mk b/target/linux/adm5120/router_le/profiles/110-Ralink.mk
index d30ee73944..d30ee73944 100644
--- a/target/linux/adm5120/profiles/110-Ralink.mk
+++ b/target/linux/adm5120/router_le/profiles/110-Ralink.mk
diff --git a/target/linux/adm5120/profiles/200-None.mk b/target/linux/adm5120/router_le/profiles/200-None.mk
index 2fcfacde9f..2fcfacde9f 100644
--- a/target/linux/adm5120/profiles/200-None.mk
+++ b/target/linux/adm5120/router_le/profiles/200-None.mk
diff --git a/target/linux/adm5120/profiles/Cellvision.mk b/target/linux/adm5120/router_le/profiles/Cellvision.mk
index 6912f13e3e..6912f13e3e 100644
--- a/target/linux/adm5120/profiles/Cellvision.mk
+++ b/target/linux/adm5120/router_le/profiles/Cellvision.mk
diff --git a/target/linux/adm5120/profiles/RB1xx.mk b/target/linux/adm5120/router_le/profiles/RB1xx.mk
index 9dd3de0973..9dd3de0973 100644
--- a/target/linux/adm5120/profiles/RB1xx.mk
+++ b/target/linux/adm5120/router_le/profiles/RB1xx.mk
diff --git a/target/linux/adm5120/router_le/target.mk b/target/linux/adm5120/router_le/target.mk
new file mode 100644
index 0000000000..61da3336f9
--- /dev/null
+++ b/target/linux/adm5120/router_le/target.mk
@@ -0,0 +1,9 @@
+ARCH:=mipsel
+SUBTARGET:=router_le
+BOARDNAME:=ADM5120 Boards (Little Endian)
+
+define Target/Description
+ Build firmware images for Infineon/ADMtek ADM5120 based boards
+ (e.g : RouterBoard RB1xx, Compex WP54G-WRT ...)
+endef
+
diff --git a/target/linux/adm5120eb/Makefile b/target/linux/adm5120eb/Makefile
deleted file mode 100644
index 9205c8bf96..0000000000
--- a/target/linux/adm5120eb/Makefile
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-# Copyright (C) 2006 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-include $(TOPDIR)/rules.mk
-
-ARCH:=mips
-BOARD:=adm5120eb
-BOARDNAME:=ADM5120 (Big Endian)
-FEATURES:=squashfs pci usb broken
-
-LINUX_VERSION:=2.6.22.4
-
-define Target/Description
- Build firmware images for Infineon/ADMTek ADM5120 based boards running in big-endian mode
- (e.g : ZyXEL Prestige 335WT ...)
-endef
-
-include $(INCLUDE_DIR)/kernel-build.mk
-DEFAULT_PACKAGES += admswconfig
-
-# include the profiles
--include profiles/*.mk
-
-$(eval $(call BuildKernel))
diff --git a/target/linux/adm5120eb/files b/target/linux/adm5120eb/files
deleted file mode 120000
index aadc1cd380..0000000000
--- a/target/linux/adm5120eb/files
+++ /dev/null
@@ -1 +0,0 @@
-../adm5120/files \ No newline at end of file
diff --git a/target/linux/adm5120eb/patches-2.6.22 b/target/linux/adm5120eb/patches-2.6.22
deleted file mode 120000
index 09e734222b..0000000000
--- a/target/linux/adm5120eb/patches-2.6.22
+++ /dev/null
@@ -1 +0,0 @@
-../adm5120/patches-2.6.22 \ No newline at end of file
diff --git a/target/linux/amazon/Makefile b/target/linux/amazon/Makefile
index 1967d52f42..17f9d96494 100644
--- a/target/linux/amazon/Makefile
+++ b/target/linux/amazon/Makefile
@@ -10,6 +10,9 @@ ARCH:=mips
BOARD:=amazon
BOARDNAME:=Infineon Amazon
FEATURES:=squashfs jffs2 broken
+LINUX_VERSION:=2.6.21.5
+
+include $(INCLUDE_DIR)/target.mk
define Target/Description
Build firmware images for Infineon Amazon boards
@@ -17,9 +20,7 @@ endef
KERNELNAME:="uImage"
-include $(INCLUDE_DIR)/kernel-build.mk
-
# include the profiles
-include profiles/*.mk
-$(eval $(call BuildKernel))
+$(eval $(call BuildTarget))
diff --git a/target/linux/amazon/config/default b/target/linux/amazon/config-2.6.21
index 2229e6317b..2229e6317b 100644
--- a/target/linux/amazon/config/default
+++ b/target/linux/amazon/config-2.6.21
diff --git a/target/linux/amcc/Makefile b/target/linux/amcc/Makefile
index 4dd366caa9..a35783be41 100644
--- a/target/linux/amcc/Makefile
+++ b/target/linux/amcc/Makefile
@@ -13,13 +13,13 @@ FEATURES:=jffs2
LINUX_VERSION:=2.6.21.5
+include $(INCLUDE_DIR)/target.mk
+
define Target/Description
Build firmware images for the AMCC Taishan evaluation board
endef
-include $(INCLUDE_DIR)/kernel-build.mk
-
# include the profiles
-include profiles/*.mk
-$(eval $(call BuildKernel))
+$(eval $(call BuildTarget))
diff --git a/target/linux/amcc/config/default b/target/linux/amcc/config-2.6.21
index d0fccac52d..d0fccac52d 100644
--- a/target/linux/amcc/config/default
+++ b/target/linux/amcc/config-2.6.21
diff --git a/target/linux/ar7/Makefile b/target/linux/ar7/Makefile
index 0beb8ae75d..772222ac75 100644
--- a/target/linux/ar7/Makefile
+++ b/target/linux/ar7/Makefile
@@ -13,12 +13,12 @@ FEATURES:=squashfs jffs2 atm
LINUX_VERSION:=2.6.22.4
+include $(INCLUDE_DIR)/target.mk
+
define Target/Description
Build firmware images for TI AR7 based routers
endef
-include $(INCLUDE_DIR)/kernel-build.mk
-
-include profiles/*.mk
-$(eval $(call BuildKernel))
+$(eval $(call BuildTarget))
diff --git a/target/linux/ar7/config/default b/target/linux/ar7/config-2.6.22
index 605140a99a..605140a99a 100644
--- a/target/linux/ar7/config/default
+++ b/target/linux/ar7/config-2.6.22
diff --git a/target/linux/at91/Makefile b/target/linux/at91/Makefile
index f8ca6f6be3..7a9a1adcc3 100644
--- a/target/linux/at91/Makefile
+++ b/target/linux/at91/Makefile
@@ -14,14 +14,15 @@ FEATURES:=squashfs usb
#LINUX_VERSION:=2.6.21.5
LINUX_VERSION:=2.6.22.4
+include $(INCLUDE_DIR)/target.mk
+
+KERNELNAME:="uImage"
+
define Target/Description
Build fimware images for Figment Design Labs VersaLink board.
endef
-include $(INCLUDE_DIR)/kernel-build.mk
-
#include the profiles
-include profiles/*.mk
-KERNELNAME:="uImage"
-$(eval $(call BuildKernel))
+$(eval $(call BuildTarget))
diff --git a/target/linux/at91/config/default b/target/linux/at91/config-2.6.22
index 5e74bd616e..5e74bd616e 100644
--- a/target/linux/at91/config/default
+++ b/target/linux/at91/config-2.6.22
diff --git a/target/linux/atheros/Makefile b/target/linux/atheros/Makefile
index 611345f4bb..fc48efd5de 100644
--- a/target/linux/atheros/Makefile
+++ b/target/linux/atheros/Makefile
@@ -13,14 +13,15 @@ FEATURES:=squashfs jffs2
LINUX_VERSION:=2.6.22.4
+include $(INCLUDE_DIR)/target.mk
+
+DEFAULT_PACKAGES += kmod-madwifi
+
define Target/Description
Build firmware images for Atheros SoC boards
endef
-include $(INCLUDE_DIR)/kernel-build.mk
-DEFAULT_PACKAGES += kmod-madwifi
-
# include the profiles
-include profiles/*.mk
-$(eval $(call BuildKernel))
+$(eval $(call BuildTarget))
diff --git a/target/linux/atheros/config/default b/target/linux/atheros/config-2.6.22
index 497f149c48..497f149c48 100644
--- a/target/linux/atheros/config/default
+++ b/target/linux/atheros/config-2.6.22
diff --git a/target/linux/au1000/Makefile b/target/linux/au1000/Makefile
index d7b9f739ab..f7dcb03ed6 100644
--- a/target/linux/au1000/Makefile
+++ b/target/linux/au1000/Makefile
@@ -13,14 +13,14 @@ FEATURES:=jffs2 usb pci
LINUX_VERSION:=2.6.22.4
+include $(INCLUDE_DIR)/target.mk
+DEFAULT_PACKAGES += yamonenv
+
define Target/Description
Build firmware for AMD Alchemy 1500 boards
(e.g. 4G-Systems Mesh/Access Cube ...)
endef
-include $(INCLUDE_DIR)/kernel-build.mk
-DEFAULT_PACKAGES += yamonenv
-
define Kernel/BuildImage
$(call Kernel/BuildImage/Default)
$(CP) $(LINUX_DIR)/arch/mips/boot/compressed/images/zImage.flash.srec $(LINUX_DIR)/zImage.flash.srec
@@ -30,5 +30,5 @@ endef
# include the profiles
-include profiles/*.mk
-$(eval $(call BuildKernel))
+$(eval $(call BuildTarget))
diff --git a/target/linux/au1000/config/default b/target/linux/au1000/config-2.6.22
index e19792809f..e19792809f 100644
--- a/target/linux/au1000/config/default
+++ b/target/linux/au1000/config-2.6.22
diff --git a/target/linux/avr32/Makefile b/target/linux/avr32/Makefile
index 4ab8534760..01d5838fe4 100644
--- a/target/linux/avr32/Makefile
+++ b/target/linux/avr32/Makefile
@@ -10,18 +10,15 @@ ARCH:=avr32
BOARD:=avr32
BOARDNAME:=Atmel AVR32
FEATURES:=squashfs
-
LINUX_VERSION:=2.6.22.4
+include $(INCLUDE_DIR)/target.mk
+
define Target/Description
Build firmware images for ATNGW100 board
endef
-KERNEL:=2.6
-
-include $(INCLUDE_DIR)/kernel-build.mk
-
#include the profiles
-include profiles/*.mk
-$(eval $(call BuildKernel))
+$(eval $(call BuildTarget))
diff --git a/target/linux/brcm-2.4/Makefile b/target/linux/brcm-2.4/Makefile
index ed7336daea..da5cf6404f 100644
--- a/target/linux/brcm-2.4/Makefile
+++ b/target/linux/brcm-2.4/Makefile
@@ -11,17 +11,18 @@ BOARD:=brcm-2.4
BOARDNAME:=Broadcom BCM947xx/953xx
FEATURES:=squashfs
+KERNEL:=2.4
+
+include $(INCLUDE_DIR)/target.mk
+
+DEFAULT_PACKAGES += kmod-switch kmod-diag nvram
+
define Target/Description
Build firmware images for Broadcom based routers
(e.g. Linksys WRT54G(S), Asus WL-500g, Motorola WR850G)
endef
-KERNEL:=2.4
-
-include $(INCLUDE_DIR)/kernel-build.mk
-DEFAULT_PACKAGES += kmod-switch kmod-diag nvram
-
# include the profiles
-include profiles/*.mk
-$(eval $(call BuildKernel))
+$(eval $(call BuildTarget))
diff --git a/target/linux/brcm-2.4/config/default b/target/linux/brcm-2.4/config-2.4.34
index 72f6f8698a..72f6f8698a 100644
--- a/target/linux/brcm-2.4/config/default
+++ b/target/linux/brcm-2.4/config-2.4.34
diff --git a/target/linux/brcm47xx/Makefile b/target/linux/brcm47xx/Makefile
index 11485fe056..5804ee9768 100644
--- a/target/linux/brcm47xx/Makefile
+++ b/target/linux/brcm47xx/Makefile
@@ -13,15 +13,15 @@ FEATURES:=squashfs usb
LINUX_VERSION:=2.6.22.4
+include $(INCLUDE_DIR)/target.mk
+DEFAULT_PACKAGES += kmod-switch kmod-diag
+
define Target/Description
Build firmware images for Broadcom based routers
(e.g. Netgear WGT634U)
endef
-include $(INCLUDE_DIR)/kernel-build.mk
-DEFAULT_PACKAGES += kmod-switch kmod-diag
-
# include the profiles
-include profiles/*.mk
-$(eval $(call BuildKernel))
+$(eval $(call BuildTarget))
diff --git a/target/linux/brcm47xx/config/default b/target/linux/brcm47xx/config-2.6.22
index 8e88aab920..8e88aab920 100644
--- a/target/linux/brcm47xx/config/default
+++ b/target/linux/brcm47xx/config-2.6.22
diff --git a/target/linux/brcm63xx/Makefile b/target/linux/brcm63xx/Makefile
index 32bfd06fea..93670c6eed 100644
--- a/target/linux/brcm63xx/Makefile
+++ b/target/linux/brcm63xx/Makefile
@@ -10,17 +10,16 @@ ARCH:=mips
BOARD:=brcm63xx
BOARDNAME:=Broadcom BCM963xx
FEATURES:=squashfs jffs2 broken usb atm
-
LINUX_VERSION:=2.6.22.4
+include $(INCLUDE_DIR)/target.mk
+
define Target/Description
Build firmware images for Broadcom based xDSL/routers
(e.g. Inventel Livebox, Siemens SE515)
endef
-include $(INCLUDE_DIR)/kernel-build.mk
-
# include the profiles
-include profiles/*.mk
-$(eval $(call BuildKernel))
+$(eval $(call BuildTarget))
diff --git a/target/linux/brcm63xx/config/default b/target/linux/brcm63xx/config-2.6.22
index abef335ed5..abef335ed5 100644
--- a/target/linux/brcm63xx/config/default
+++ b/target/linux/brcm63xx/config-2.6.22
diff --git a/target/linux/etrax/Makefile b/target/linux/etrax/Makefile
index 7c9b76fa65..c837550062 100644
--- a/target/linux/etrax/Makefile
+++ b/target/linux/etrax/Makefile
@@ -12,7 +12,10 @@ BOARDNAME:=Foxboard (ETRAX 100LX)
FEATURES:=squashfs jffs2
LINUX_VERSION:=2.6.19.2
-include $(INCLUDE_DIR)/kernel-build.mk
+include $(INCLUDE_DIR)/target.mk
+
+KERNELNAME:="zImage"
+DEFAULT_PACKAGES += foxboard-utils
define Target/Description
Build fimware images for the FOXBOARD made by acmesystems.it
@@ -31,14 +34,10 @@ define Kernel/Prepare
$(call Kernel/Prepare/Fox)
endef
-DEFAULT_PACKAGES += foxboard-utils
+#include the profiles
+-include profiles/*.mk
+$(eval $(call BuildTarget))
$(eval $(call RequireCommand,/usr/local/cris/gcc-cris, \
Please install the binary cris toolchain. \
))
-
-#include the profiles
--include profiles/*.mk
-
-KERNELNAME:="zImage"
-$(eval $(call BuildKernel))
diff --git a/target/linux/generic-2.4/config-template b/target/linux/generic-2.4/config-default
index 9f33ef427e..9f33ef427e 100644
--- a/target/linux/generic-2.4/config-template
+++ b/target/linux/generic-2.4/config-default
diff --git a/target/linux/generic-2.6/config-template b/target/linux/generic-2.6/config-default
index 28ff32b43e..28ff32b43e 100644
--- a/target/linux/generic-2.6/config-template
+++ b/target/linux/generic-2.6/config-default
diff --git a/target/linux/iop32x/Makefile b/target/linux/iop32x/Makefile
index 529a7e048a..c097955f34 100644
--- a/target/linux/iop32x/Makefile
+++ b/target/linux/iop32x/Makefile
@@ -13,12 +13,9 @@ FEATURES:=squashfs jffs2
LINUX_VERSION:=2.6.21.5
-define Target/Description
-endef
-
-include $(INCLUDE_DIR)/kernel-build.mk
+include $(INCLUDE_DIR)/target.mk
# include the profiles
-include profiles/*.mk
-$(eval $(call BuildKernel))
+$(eval $(call BuildTarget))
diff --git a/target/linux/iop32x/config/default b/target/linux/iop32x/config-2.6.21
index c13255920f..c13255920f 100644
--- a/target/linux/iop32x/config/default
+++ b/target/linux/iop32x/config-2.6.21
diff --git a/target/linux/ixp4xx/Makefile b/target/linux/ixp4xx/Makefile
index 25b60a47b7..f68f62bc7d 100644
--- a/target/linux/ixp4xx/Makefile
+++ b/target/linux/ixp4xx/Makefile
@@ -13,12 +13,9 @@ FEATURES:=squashfs
LINUX_VERSION:=2.6.21.6
-define Target/Description
-endef
-
-include $(INCLUDE_DIR)/kernel-build.mk
+include $(INCLUDE_DIR)/target.mk
# include the profiles
-include profiles/*.mk
-$(eval $(call BuildKernel))
+$(eval $(call BuildTarget))
diff --git a/target/linux/ixp4xx/config/default b/target/linux/ixp4xx/config-2.6.21
index 81c1383678..81c1383678 100644
--- a/target/linux/ixp4xx/config/default
+++ b/target/linux/ixp4xx/config-2.6.21
diff --git a/target/linux/magicbox/Makefile b/target/linux/magicbox/Makefile
index e003330f05..a20158b522 100644
--- a/target/linux/magicbox/Makefile
+++ b/target/linux/magicbox/Makefile
@@ -13,9 +13,9 @@ FEATURES:=squashfs jffs2
LINUX_VERSION:=2.6.22.4
-include $(INCLUDE_DIR)/kernel-build.mk
+include $(INCLUDE_DIR)/target.mk
# include the profiles
-include profiles/*.mk
-$(eval $(call BuildKernel))
+$(eval $(call BuildTarget))
diff --git a/target/linux/magicbox/config/default b/target/linux/magicbox/config-2.6.22
index 3e36514e94..3e36514e94 100644
--- a/target/linux/magicbox/config/default
+++ b/target/linux/magicbox/config-2.6.22
diff --git a/target/linux/pxa/Makefile b/target/linux/pxa/Makefile
index 3e0e6cd3b3..ad44af27e4 100644
--- a/target/linux/pxa/Makefile
+++ b/target/linux/pxa/Makefile
@@ -13,13 +13,13 @@ FEATURES:=jffs2 broken
LINUX_VERSION:=2.6.21.5
+include $(INCLUDE_DIR)/target.mk
+
define Target/Description
Stub for boards based on intel PXA
endef
-include $(INCLUDE_DIR)/kernel-build.mk
-
# include the profiles
-include profiles/*.mk
-$(eval $(call BuildKernel))
+$(eval $(call BuildTarget))
diff --git a/target/linux/pxa/config/default b/target/linux/pxa/config-2.6.21
index e288e4273b..e288e4273b 100644
--- a/target/linux/pxa/config/default
+++ b/target/linux/pxa/config-2.6.21
diff --git a/target/linux/rb532/Makefile b/target/linux/rb532/Makefile
index ee2360187c..608f0aca14 100644
--- a/target/linux/rb532/Makefile
+++ b/target/linux/rb532/Makefile
@@ -13,9 +13,9 @@ FEATURES:=jffs2 pci tgz
LINUX_VERSION:=2.6.22.4
-include $(INCLUDE_DIR)/kernel-build.mk
+include $(INCLUDE_DIR)/target.mk
# include the profiles
-include profiles/*.mk
-$(eval $(call BuildKernel))
+$(eval $(call BuildTarget))
diff --git a/target/linux/rb532/config/default b/target/linux/rb532/config-2.6.22
index 24678f1e9c..24678f1e9c 100644
--- a/target/linux/rb532/config/default
+++ b/target/linux/rb532/config-2.6.22
diff --git a/target/linux/rdc/Makefile b/target/linux/rdc/Makefile
index 5af5e85c6e..ac49adeb97 100644
--- a/target/linux/rdc/Makefile
+++ b/target/linux/rdc/Makefile
@@ -13,15 +13,15 @@ FEATURES:=squashfs jffs2 broken
LINUX_VERSION:=2.6.22.4
+include $(INCLUDE_DIR)/target.mk
+
define Target/Description
Build firmware images for RDC321x based routers
(e.g. Airlink101 AR525W, Linksys WRT54R, Sitecom WL-153)
endef
-include $(INCLUDE_DIR)/kernel-build.mk
-
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
- define Kernel/SetInitramfs
+ define Kernel/SetInitramfs
echo "r6040 parent=wlan0" > $(TARGET_DIR)/etc/modules.d/99-r6040
$(RM) $(TARGET_DIR)/sbin/init
ln -s /etc/preinit $(TARGET_DIR)/sbin/init
@@ -29,10 +29,10 @@ ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
sed -i 's,/sbin/init,/bin/busybox init,g' $(TARGET_DIR)/init
mv $(TARGET_DIR)/init $(TARGET_DIR)/linuxrc
sed -i 's,eth0,eth1,g' $(TARGET_DIR)/etc/config/network
- endef
+ endef
endif
# include the profiles
-include profiles/*.mk
-$(eval $(call BuildKernel))
+$(eval $(call BuildTarget))
diff --git a/target/linux/rdc/config/default b/target/linux/rdc/config-2.6.22
index 381a961e98..381a961e98 100644
--- a/target/linux/rdc/config/default
+++ b/target/linux/rdc/config-2.6.22
diff --git a/target/linux/rdc/config/profile-wl153 b/target/linux/rdc/config/profile-wl153
deleted file mode 100644
index 3ab59a881f..0000000000
--- a/target/linux/rdc/config/profile-wl153
+++ /dev/null
@@ -1,2 +0,0 @@
-# CONFIG_MTD_RDC3210_ALLOW_JFFS2 is not set
-CONFIG_MTD_RDC3210_SIZE=0x200000
diff --git a/target/linux/sibyte/Makefile b/target/linux/sibyte/Makefile
index 35cdb37f2e..aa8acea1ce 100644
--- a/target/linux/sibyte/Makefile
+++ b/target/linux/sibyte/Makefile
@@ -13,9 +13,9 @@ FEATURES:=broken
LINUX_VERSION:=2.6.21.5
-include $(INCLUDE_DIR)/kernel-build.mk
+include $(INCLUDE_DIR)/target.mk
# include the profiles
-include profiles/*.mk
-$(eval $(call BuildKernel))
+$(eval $(call BuildTarget))
diff --git a/target/linux/sibyte/config/default b/target/linux/sibyte/config-2.6.21
index bf33d13ac6..bf33d13ac6 100644
--- a/target/linux/sibyte/config/default
+++ b/target/linux/sibyte/config-2.6.21
diff --git a/target/linux/uml/Makefile b/target/linux/uml/Makefile
index a6be082d0b..e31ef02bb7 100644
--- a/target/linux/uml/Makefile
+++ b/target/linux/uml/Makefile
@@ -25,11 +25,11 @@ LINUX_CONFIG:=$(CURDIR)/config/$(ARCH)
LINUX_VERSION:=2.6.22.4
-include $(INCLUDE_DIR)/kernel-build.mk
+include $(INCLUDE_DIR)/target.mk
# include the profiles
-include profiles/*.mk
endif
-$(eval $(call BuildKernel))
+$(eval $(call BuildTarget))
diff --git a/target/linux/x86/Makefile b/target/linux/x86/Makefile
index 705cc84ad1..771fd191f9 100644
--- a/target/linux/x86/Makefile
+++ b/target/linux/x86/Makefile
@@ -13,11 +13,11 @@ FEATURES:=squashfs jffs2 ext2
LINUX_VERSION:=2.6.22.4
-include $(INCLUDE_DIR)/kernel-build.mk
+include $(INCLUDE_DIR)/target.mk
DEFAULT_PACKAGES += kmod-natsemi kmod-ne2k-pci
# include the profiles
-include profiles/*.mk
-$(eval $(call BuildKernel))
+$(eval $(call BuildTarget))
diff --git a/toolchain/Makefile b/toolchain/Makefile
index 80bdf485df..cbc726ef01 100644
--- a/toolchain/Makefile
+++ b/toolchain/Makefile
@@ -39,6 +39,8 @@ $(curdir)//prepare = $(STAGING_DIR)/.prepared $(TOOLCHAIN_DIR)/info.mk
$(curdir)//compile = $(1)/prepare
$(curdir)//install = $(1)/compile
-$(eval $(call stampfile,$(curdir),toolchain,install))
+$(TOOLCHAIN_DIR)/stamp/.gcc-initial_installed:
+
+$(eval $(call stampfile,$(curdir),toolchain,install,$(TOOLCHAIN_DIR)/stamp/.gcc-initial_installed))
$(eval $(call subdir,$(curdir)))
diff --git a/toolchain/gcc/Makefile b/toolchain/gcc/Makefile
index 2c86524664..a326bb716f 100644
--- a/toolchain/gcc/Makefile
+++ b/toolchain/gcc/Makefile
@@ -33,7 +33,7 @@ BUILD_DIR_HOST:=$(BUILD_DIR_TOOLCHAIN)
include $(INCLUDE_DIR)/host-build.mk
-STAMP_BUILT:=$(TOOLCHAIN_DIR)/stamp/.gcc-initial_installed
+STAMP_BUILT:=$(STAGING_DIR)/stamp/.gcc-initial_installed
BUILD_DIR1:=$(BUILD_DIR_HOST)/gcc-$(PKG_VERSION)-initial
BUILD_DIR2:=$(BUILD_DIR_HOST)/gcc-$(PKG_VERSION)-final
diff --git a/toolchain/uClibc/Makefile b/toolchain/uClibc/Makefile
index d117cbd890..af2af48e06 100644
--- a/toolchain/uClibc/Makefile
+++ b/toolchain/uClibc/Makefile
@@ -22,8 +22,8 @@ PKG_BUILD_DIR:=$(BUILD_DIR_HOST)/uClibc-$(PKG_VERSION)$(PKG_EXTRAVERSION)
include $(INCLUDE_DIR)/host-build.mk
-STAMP_BUILT:=$(TOOLCHAIN_DIR)/stamp/.uclibc_installed
-STAMP_INSTALLED:=$(TOOLCHAIN_DIR)/stamp/.uclibc-utils_installed
+STAMP_BUILT:=$(STAGING_DIR)/stamp/.uclibc_installed
+STAMP_INSTALLED:=$(STAGING_DIR)/stamp/.uclibc-utils_installed
UCLIBC_TARGET_ARCH:=$(shell echo $(ARCH) | sed -e s'/-.*//' \
-e 's/i.86/i386/' \