From a9d683ca912b2c4837b2e65909c09ca01babe3df Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 8 Sep 2007 19:55:42 +0000 Subject: [PATCH] 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 SVN-Revision: 8694 --- Makefile | 2 +- include/image.mk | 1 + include/kernel-build.mk | 144 +++-------------- include/kernel-defaults.mk | 7 +- include/kernel-version.mk | 14 +- include/kernel.mk | 23 ++- include/scan.mk | 4 +- include/subdir.mk | 4 +- include/target.mk | 148 ++++++++++++++++-- include/toplevel.mk | 3 +- package/acx/Makefile | 2 +- package/admswconfig/Makefile | 2 +- package/ar7-atm/Makefile | 2 +- package/base-files/Makefile | 7 +- package/bcm43xx-mac80211/Makefile | 2 +- package/broadcom-diag/Makefile | 4 +- package/broadcom-mmc/Makefile | 2 +- package/broadcom-wl/Makefile | 4 +- package/fonera-mp3-drv/Makefile | 2 +- package/fonera-mp3/Makefile | 2 +- package/foxboard-utils/Makefile | 2 +- package/hostapd/Makefile | 2 +- package/ipset/Makefile | 2 +- package/nvram/Makefile | 2 +- package/switch/Makefile | 2 +- package/util-linux/Makefile | 2 +- package/wlcompat/Makefile | 4 +- package/yamonenv/Makefile | 2 +- rules.mk | 10 +- scripts/{config.pl => kconfig.pl} | 0 scripts/metadata.pl | 58 ++----- target/linux/Makefile | 2 +- target/linux/adm5120/Makefile | 21 +-- .../router_be/config-2.6.22} | 0 .../router_be}/image/Makefile | 0 .../router_be}/image/lzma-loader | 0 .../router_be}/profiles/090-Zyxel.mk | 0 .../router_be}/profiles/100-Texas.mk | 0 .../router_be}/profiles/110-Atheros.mk | 0 .../router_be}/profiles/110-None.mk | 0 target/linux/adm5120/router_be/target.mk | 9 ++ .../base-files/default/sbin/wget2nand | 0 .../default => router_le/config-2.6.22} | 0 .../{ => router_le}/profiles/100-Atheros.mk | 0 .../{ => router_le}/profiles/105-Texas.mk | 0 .../{ => router_le}/profiles/110-Ralink.mk | 0 .../{ => router_le}/profiles/200-None.mk | 0 .../{ => router_le}/profiles/Cellvision.mk | 0 .../adm5120/{ => router_le}/profiles/RB1xx.mk | 0 target/linux/adm5120/router_le/target.mk | 9 ++ target/linux/adm5120eb/Makefile | 27 ---- target/linux/adm5120eb/files | 1 - target/linux/adm5120eb/patches-2.6.22 | 1 - target/linux/amazon/Makefile | 7 +- .../amazon/{config/default => config-2.6.21} | 0 target/linux/amcc/Makefile | 6 +- .../amcc/{config/default => config-2.6.21} | 0 target/linux/ar7/Makefile | 6 +- .../ar7/{config/default => config-2.6.22} | 0 target/linux/at91/Makefile | 9 +- .../at91/{config/default => config-2.6.22} | 0 target/linux/atheros/Makefile | 9 +- .../atheros/{config/default => config-2.6.22} | 0 target/linux/au1000/Makefile | 8 +- .../au1000/{config/default => config-2.6.22} | 0 target/linux/avr32/Makefile | 9 +- target/linux/brcm-2.4/Makefile | 13 +- .../{config/default => config-2.4.34} | 0 target/linux/brcm47xx/Makefile | 8 +- .../{config/default => config-2.6.22} | 0 target/linux/brcm63xx/Makefile | 7 +- .../{config/default => config-2.6.22} | 0 target/linux/etrax/Makefile | 17 +- .../{config-template => config-default} | 0 .../{config-template => config-default} | 0 target/linux/iop32x/Makefile | 7 +- .../iop32x/{config/default => config-2.6.21} | 0 target/linux/ixp4xx/Makefile | 7 +- .../ixp4xx/{config/default => config-2.6.21} | 0 target/linux/magicbox/Makefile | 4 +- .../{config/default => config-2.6.22} | 0 target/linux/pxa/Makefile | 6 +- .../pxa/{config/default => config-2.6.21} | 0 target/linux/rb532/Makefile | 4 +- .../rb532/{config/default => config-2.6.22} | 0 target/linux/rdc/Makefile | 10 +- .../rdc/{config/default => config-2.6.22} | 0 target/linux/rdc/config/profile-wl153 | 2 - target/linux/sibyte/Makefile | 4 +- .../sibyte/{config/default => config-2.6.21} | 0 target/linux/uml/Makefile | 4 +- target/linux/x86/Makefile | 4 +- toolchain/Makefile | 4 +- toolchain/gcc/Makefile | 2 +- toolchain/uClibc/Makefile | 4 +- 95 files changed, 345 insertions(+), 351 deletions(-) rename scripts/{config.pl => kconfig.pl} (100%) rename target/linux/{adm5120eb/config/default => adm5120/router_be/config-2.6.22} (100%) rename target/linux/{adm5120eb => adm5120/router_be}/image/Makefile (100%) rename target/linux/{adm5120eb => adm5120/router_be}/image/lzma-loader (100%) rename target/linux/{adm5120eb => adm5120/router_be}/profiles/090-Zyxel.mk (100%) rename target/linux/{adm5120eb => adm5120/router_be}/profiles/100-Texas.mk (100%) rename target/linux/{adm5120eb => adm5120/router_be}/profiles/110-Atheros.mk (100%) rename target/linux/{adm5120eb => adm5120/router_be}/profiles/110-None.mk (100%) create mode 100644 target/linux/adm5120/router_be/target.mk rename target/linux/adm5120/{ => router_le}/base-files/default/sbin/wget2nand (100%) rename target/linux/adm5120/{config/default => router_le/config-2.6.22} (100%) rename target/linux/adm5120/{ => router_le}/profiles/100-Atheros.mk (100%) rename target/linux/adm5120/{ => router_le}/profiles/105-Texas.mk (100%) rename target/linux/adm5120/{ => router_le}/profiles/110-Ralink.mk (100%) rename target/linux/adm5120/{ => router_le}/profiles/200-None.mk (100%) rename target/linux/adm5120/{ => router_le}/profiles/Cellvision.mk (100%) rename target/linux/adm5120/{ => router_le}/profiles/RB1xx.mk (100%) create mode 100644 target/linux/adm5120/router_le/target.mk delete mode 100644 target/linux/adm5120eb/Makefile delete mode 120000 target/linux/adm5120eb/files delete mode 120000 target/linux/adm5120eb/patches-2.6.22 rename target/linux/amazon/{config/default => config-2.6.21} (100%) rename target/linux/amcc/{config/default => config-2.6.21} (100%) rename target/linux/ar7/{config/default => config-2.6.22} (100%) rename target/linux/at91/{config/default => config-2.6.22} (100%) rename target/linux/atheros/{config/default => config-2.6.22} (100%) rename target/linux/au1000/{config/default => config-2.6.22} (100%) rename target/linux/brcm-2.4/{config/default => config-2.4.34} (100%) rename target/linux/brcm47xx/{config/default => config-2.6.22} (100%) rename target/linux/brcm63xx/{config/default => config-2.6.22} (100%) rename target/linux/generic-2.4/{config-template => config-default} (100%) rename target/linux/generic-2.6/{config-template => config-default} (100%) rename target/linux/iop32x/{config/default => config-2.6.21} (100%) rename target/linux/ixp4xx/{config/default => config-2.6.21} (100%) rename target/linux/magicbox/{config/default => config-2.6.22} (100%) rename target/linux/pxa/{config/default => config-2.6.21} (100%) rename target/linux/rb532/{config/default => config-2.6.22} (100%) rename target/linux/rdc/{config/default => config-2.6.22} (100%) delete mode 100644 target/linux/rdc/config/profile-wl153 rename target/linux/sibyte/{config/default => config-2.6.21} (100%) 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 + download: $(DL_DIR)/$(LINUX_SOURCE) + prepare: $(STAMP_CONFIGURED) + compile: $(LINUX_DIR)/.modules + $(MAKE) -C image compile TARGET_BUILD= -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 - -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?= BOARD?= 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: +# Parameters: 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 --include $(TMP_DIR)/.target.mk - -ifeq ($(IB),1) -$(TMP_DIR)/.target.mk: $(TOPDIR)/.target.mk - $(CP) $< $@ +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 + +$(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 + +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 similarity index 100% rename from scripts/config.pl rename to 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 <{board}."\" if TARGET_".$target->{conf}."\n"; + } + print < $(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 similarity index 100% rename from target/linux/rdc/config/default rename to 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 similarity index 100% rename from target/linux/sibyte/config/default rename to 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/' \