1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-11-27 17:55:55 +02:00

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
This commit is contained in:
nbd 2007-09-08 19:55:42 +00:00
parent ac8f943466
commit 6db7ad74f6
95 changed files with 345 additions and 351 deletions

View File

@ -45,7 +45,7 @@ clean: FORCE
rm -rf $(TMP_DIR) rm -rf $(TMP_DIR)
dirclean: clean 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 # check prerequisites before starting to build
prereq: $(package/stamp-prereq) $(target/stamp-prereq) ; prereq: $(package/stamp-prereq) $(target/stamp-prereq) ;

View File

@ -5,6 +5,7 @@
# See /LICENSE for more information. # See /LICENSE for more information.
# #
override TARGET_BUILD=
include $(INCLUDE_DIR)/prereq.mk include $(INCLUDE_DIR)/prereq.mk
include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/host.mk include $(INCLUDE_DIR)/host.mk

View File

@ -4,57 +4,17 @@
# This is free software, licensed under the GNU General Public License v2. # This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information. # See /LICENSE for more information.
# #
KERNEL_BUILD:=1
include $(INCLUDE_DIR)/host.mk include $(INCLUDE_DIR)/host.mk
include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/prereq.mk include $(INCLUDE_DIR)/prereq.mk
ifneq ($(DUMP),1)
override MAKEFLAGS= 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)
endif endif
ifneq ($(CONFIG_PCI),) ifneq ($(DUMP),1)
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
all: compile all: compile
endif 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_PREPARED:=$(LINUX_DIR)/.prepared
STAMP_CONFIGURED:=$(LINUX_DIR)/.configured STAMP_CONFIGURED:=$(LINUX_DIR)/.configured
include $(INCLUDE_DIR)/quilt.mk include $(INCLUDE_DIR)/quilt.mk
@ -90,96 +50,42 @@ define BuildKernel
$(STAMP_PREPARED): $(DL_DIR)/$(LINUX_SOURCE) $(STAMP_PREPARED): $(DL_DIR)/$(LINUX_SOURCE)
-rm -rf $(KERNEL_BUILD_DIR) -rm -rf $(KERNEL_BUILD_DIR)
-mkdir -p $(KERNEL_BUILD_DIR) -mkdir -p $(KERNEL_BUILD_DIR)
$(call Kernel/Prepare) $(Kernel/Prepare)
touch $$@ touch $$@
$(STAMP_CONFIGURED): $(STAMP_PREPARED) $(LINUX_CONFIG) $(GENERIC_LINUX_CONFIG) $(TOPDIR)/.config $(STAMP_CONFIGURED): $(STAMP_PREPARED) $(LINUX_CONFIG) $(GENERIC_LINUX_CONFIG) $(TOPDIR)/.config
$(call Kernel/Configure) $(Kernel/Configure)
touch $$@ touch $$@
$(LINUX_DIR)/.modules: $(STAMP_CONFIGURED) $(LINUX_DIR)/.config FORCE $(LINUX_DIR)/.modules: $(STAMP_CONFIGURED) $(LINUX_DIR)/.config FORCE
$(call Kernel/CompileModules) $(Kernel/CompileModules)
touch $$@ touch $$@
$(LINUX_DIR)/.image: $(STAMP_CONFIGURED) FORCE $(LINUX_DIR)/.image: $(STAMP_CONFIGURED) FORCE
$(call Kernel/CompileImage) $(Kernel/CompileImage)
touch $$@ touch $$@
mostlyclean: FORCE mostlyclean: FORCE
$(call Kernel/Clean) $(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
define BuildKernel define BuildKernel
endef 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) download: $(DL_DIR)/$(LINUX_SOURCE)
prepare: $(STAMP_CONFIGURED) prepare: $(STAMP_CONFIGURED)
compile: $(LINUX_DIR)/.modules compile: $(LINUX_DIR)/.modules
$(MAKE) -C image compile $(MAKE) -C image compile TARGET_BUILD=
oldconfig menuconfig: $(STAMP_PREPARED) FORCE oldconfig menuconfig: $(STAMP_PREPARED) FORCE
$(call Kernel/Configure) $(Kernel/Configure)
$(SCRIPT_DIR)/config.pl '+' $(GENERIC_LINUX_CONFIG) $(LINUX_CONFIG) > $(LINUX_DIR)/.config $(LINUX_CONFCMD) > $(LINUX_DIR)/.config
$(MAKE) -C $(LINUX_DIR) $(KERNEL_MAKEOPTS) $@ $(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 install: $(LINUX_DIR)/.image
$(MAKE) -C image compile install TARGET_BUILD="" $(MAKE) -C image compile install
clean: FORCE clean: FORCE
rm -f $(STAMP_DIR)/.linux-compile
rm -rf $(KERNEL_BUILD_DIR) rm -rf $(KERNEL_BUILD_DIR)
rebuild: FORCE rebuild: FORCE
@ -190,6 +96,8 @@ rebuild: FORCE
@$(MAKE) compile @$(MAKE) compile
image-prereq: image-prereq:
$(SUBMAKE) -s -C image prereq $(SUBMAKE) -s -C image prereq TARGET_BUILD=
prereq: image-prereq prereq: image-prereq
endef

View File

@ -46,11 +46,9 @@ define Kernel/Configure/2.6
-$(MAKE) $(KERNEL_MAKEOPTS) CC="$(KERNEL_CC)" oldconfig prepare scripts -$(MAKE) $(KERNEL_MAKEOPTS) CC="$(KERNEL_CC)" oldconfig prepare scripts
endef endef
define Kernel/Configure/Default define Kernel/Configure/Default
$(SCRIPT_DIR)/config.pl '+' $(GENERIC_LINUX_CONFIG) \ $(LINUX_CONFCMD) > $(LINUX_DIR)/.config.target
$(if $(wildcard ./config/profile-$(PROFILE)),'+' $(LINUX_CONFIG) ./config/profile-$(PROFILE), $(LINUX_CONFIG)) \
> $(LINUX_DIR)/.config.target
$(SCRIPT_DIR)/metadata.pl kconfig $(TMP_DIR)/.packageinfo $(TOPDIR)/.config > $(LINUX_DIR)/.config.override $(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)) $(call Kernel/Configure/$(KERNEL))
rm -rf $(KERNEL_BUILD_DIR)/modules rm -rf $(KERNEL_BUILD_DIR)/modules
@rm -f $(BUILD_DIR)/linux @rm -f $(BUILD_DIR)/linux
@ -88,7 +86,6 @@ define Kernel/CompileImage/Default
endef endef
define Kernel/Clean/Default define Kernel/Clean/Default
rm -f $(LINUX_DIR)/.linux-compile
rm -f $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)/.configured rm -f $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)/.configured
rm -f $(LINUX_KERNEL) rm -f $(LINUX_KERNEL)
$(MAKE) -C $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION) clean $(MAKE) -C $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION) clean

View File

@ -1,11 +1,9 @@
# Use the default kernel version if the Makefile doesn't override it # Use the default kernel version if the Makefile doesn't override it
ifeq ($(LINUX_VERSION),)
ifeq ($(KERNEL),2.4) ifeq ($(KERNEL),2.4)
LINUX_VERSION:=2.4.34 LINUX_VERSION?=2.4.34
else else
LINUX_VERSION:=2.6.21.5 LINUX_VERSION?=2.6.21.5
endif
endif endif
LINUX_RELEASE?=1 LINUX_RELEASE?=1
@ -22,6 +20,6 @@ endif
# disable the md5sum check for unknown kernel versions # disable the md5sum check for unknown kernel versions
LINUX_KERNEL_MD5SUM?=x LINUX_KERNEL_MD5SUM?=x
KERNEL:=2.$(word 2,$(subst ., ,$(strip $(LINUX_VERSION)))) KERNEL?=2.$(word 2,$(subst ., ,$(strip $(LINUX_VERSION))))
KERNEL_PATCHVER:=$(shell echo $(LINUX_VERSION) | cut -d. -f1,2,3 | cut -d- -f1) KERNEL_PATCHVER=$(shell echo $(LINUX_VERSION) | cut -d. -f1,2,3 | cut -d- -f1)

View File

@ -5,15 +5,15 @@
# See /LICENSE for more information. # See /LICENSE for more information.
# #
include $(INCLUDE_DIR)/kernel-version.mk ifeq ($(__target_inc),)
include $(INCLUDE_DIR)/target.mk
endif
ifeq ($(DUMP),1) ifeq ($(DUMP),1)
KERNEL?=<KERNEL> KERNEL?=<KERNEL>
BOARD?=<BOARD> BOARD?=<BOARD>
LINUX_VERSION?=<LINUX_VERSION> LINUX_VERSION?=<LINUX_VERSION>
else else
include $(INCLUDE_DIR)/target.mk
export GCC_HONOUR_COPTS=s export GCC_HONOUR_COPTS=s
ifeq ($(KERNEL),2.6) ifeq ($(KERNEL),2.6)
@ -30,9 +30,8 @@ else
KERNEL_CROSS:=$(TARGET_CROSS) KERNEL_CROSS:=$(TARGET_CROSS)
endif endif
PLATFORM_DIR := $(TOPDIR)/target/linux/$(BOARD)
PATCH_DIR ?= ./patches$(shell [ -d "./patches-$(KERNEL_PATCHVER)" ] && printf -- "-$(KERNEL_PATCHVER)" || true ) 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) LINUX_DIR ?= $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)
MODULES_SUBDIR:=lib/modules/$(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)) PKG_BUILD_DIR ?= $(KERNEL_BUILD_DIR)/$(PKG_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION))
endif 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 define KernelPackage/Defaults

View File

@ -27,14 +27,14 @@ define PackageDir
{ \ { \
$$(call progress,Collecting $(SCAN_NAME) info: $(SCAN_DIR)/$(2)) \ $$(call progress,Collecting $(SCAN_NAME) info: $(SCAN_DIR)/$(2)) \
echo Source-Makefile: $(SCAN_DIR)/$(2)/Makefile; \ 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; \ echo; \
} > $$@ || true } > $$@ || true
endef endef
$(FILELIST): $(FILELIST):
rm -f tmp/info/.files-$(SCAN_TARGET)-* 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) tmp/info/.files-$(SCAN_TARGET).mk: $(FILELIST)
( \ ( \

View File

@ -34,10 +34,10 @@ define subdir
$(foreach target,$(SUBTARGETS),$(call subtarget,$(1),$(target))) $(foreach target,$(SUBTARGETS),$(call subtarget,$(1),$(target)))
endef endef
# Parameters: <subdir> <name> <target> # Parameters: <subdir> <name> <target> <depends>
define stampfile define stampfile
$(1)/stamp-$(3):=$(STAGING_DIR)/stamp/.$(2)_$(3) $(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) || \ @+$(SCRIPT_DIR)/timestamp.pl -n $$($(1)/stamp-$(3)) $(1) $(4) || \
$(MAKE) $$($(1)/flags-$(3)) $(1)/$(3) $(MAKE) $$($(1)/flags-$(3)) $(1)/$(3)
@mkdir -p $$$$(dirname $$($(1)/stamp-$(3))) @mkdir -p $$$$(dirname $$($(1)/stamp-$(3)))

View File

@ -5,17 +5,147 @@
# See /LICENSE for more information. # See /LICENSE for more information.
# #
define AddProfile ifneq ($(DUMP),)
ifeq ($(CONFIG_LINUX_$(1)),y) all: dumpinfo
$(call Profile/$(1)) endif
PROFILE=$$(ID)
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 endif
endef endef
-include $(TMP_DIR)/.target.mk ifneq ($(TARGET_BUILD),1)
include $(PLATFORM_DIR)/Makefile
ifeq ($(IB),1) ifneq ($(PLATFORM_DIR),$(PLATFORM_SUBDIR))
$(TMP_DIR)/.target.mk: $(TOPDIR)/.target.mk include $(PLATFORM_SUBDIR)/target.mk
$(CP) $< $@ endif
else
ifneq ($(SUBTARGET),)
-include ./$(SUBTARGET)/target.mk
endif
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

View File

@ -33,13 +33,12 @@ export SCAN_COOKIE
prepare-tmpinfo: FORCE prepare-tmpinfo: FORCE
mkdir -p tmp/info 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="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 \ for type in package target; do \
f=tmp/.$${type}info; t=tmp/.config-$${type}.in; \ 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; }; \ [ "$$t" -nt "$$f" ] || ./scripts/metadata.pl $${type}_config < "$$f" > "$$t" || { rm -f "$$t"; echo "Failed to build $$t"; false; break; }; \
done done
./scripts/metadata.pl package_mk < tmp/.packageinfo > tmp/.packagedeps || { rm -f tmp/.packagedeps; false; } ./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 touch $(TOPDIR)/tmp/.build
.config: ./scripts/config/conf prepare-tmpinfo .config: ./scripts/config/conf prepare-tmpinfo

View File

@ -26,7 +26,7 @@ include $(INCLUDE_DIR)/package.mk
define KernelPackage/acx define KernelPackage/acx
TITLE:=Driver for TI ACX1xx chipset 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/ URL:=http://acx100.sourceforge.net/
SUBMENU:=Wireless Drivers SUBMENU:=Wireless Drivers
FILES:= $(PKG_BUILD_DIR)/acx.$(LINUX_KMOD_SUFFIX) FILES:= $(PKG_BUILD_DIR)/acx.$(LINUX_KMOD_SUFFIX)

View File

@ -22,7 +22,7 @@ define Package/admswconfig
SECTION:=utils SECTION:=utils
CATEGORY:=Utilities CATEGORY:=Utilities
TITLE:=ADM5120 Switch configuration tool 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/ URL:=http://sharon.esrac.ele.tue.nl/users/pe1rxq/linux-adm/admswconfig/
endef endef

View File

@ -21,7 +21,7 @@ include $(INCLUDE_DIR)/package.mk
define KernelPackage/sangam-atm/Default define KernelPackage/sangam-atm/Default
SUBMENU:=Network Devices SUBMENU:=Network Devices
DEPENDS:=@TARGET_AR7 +kmod-atm DEPENDS:=@TARGET_ar7 +kmod-atm
TITLE:=AR7 ADSL driver TITLE:=AR7 ADSL driver
FILES:=$(PKG_BUILD_DIR)/tiatm.$(LINUX_KMOD_SUFFIX) FILES:=$(PKG_BUILD_DIR)/tiatm.$(LINUX_KMOD_SUFFIX)
AUTOLOAD:=$(call AutoLoad,50,tiatm) AUTOLOAD:=$(call AutoLoad,50,tiatm)

View File

@ -71,7 +71,7 @@ endef
define Package/libgcc define Package/libgcc
$(call Package/gcc/Default) $(call Package/gcc/Default)
TITLE:=GCC support library TITLE:=GCC support library
DEPENDS:=@!TARGET_AVR32 @!NATIVE_TOOLCHAIN DEPENDS:=@!TARGET_avr32 @!NATIVE_TOOLCHAIN
endef endef
define Package/libssp define Package/libssp
@ -123,6 +123,11 @@ define Package/base-files$(TARGET)/install
if [ -d $(PLATFORM_DIR)/base-files/default/. ]; then \ if [ -d $(PLATFORM_DIR)/base-files/default/. ]; then \
$(CP) $(PLATFORM_DIR)/base-files/default/* $(1)/; \ $(CP) $(PLATFORM_DIR)/base-files/default/* $(1)/; \
fi 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 [ "$(PROFILE)" != "Default" ]; then \
if [ -d $(PLATFORM_DIR)/base-files/profile-$(PROFILE)/. ]; then \ if [ -d $(PLATFORM_DIR)/base-files/profile-$(PROFILE)/. ]; then \
$(CP) $(PLATFORM_DIR)/base-files/profile-$(PROFILE)/* $(1)/; \ $(CP) $(PLATFORM_DIR)/base-files/profile-$(PROFILE)/* $(1)/; \

View File

@ -20,7 +20,7 @@ endif
define KernelPackage/bcm43xx-mac80211 define KernelPackage/bcm43xx-mac80211
SUBMENU:=Wireless Drivers SUBMENU:=Wireless Drivers
TITLE:=Broadcom 43xx wireless support TITLE:=Broadcom 43xx wireless support
DEPENDS:=@TARGET_BRCM47XX +kmod-mac80211 DEPENDS:=@TARGET_brcm47xx +kmod-mac80211
KCONFIG:=CONFIG_MAC80211 KCONFIG:=CONFIG_MAC80211
FILES:=$(PKG_BUILD_DIR)/bcm43xx-mac80211.$(LINUX_KMOD_SUFFIX) FILES:=$(PKG_BUILD_DIR)/bcm43xx-mac80211.$(LINUX_KMOD_SUFFIX)
# AUTOLOAD:=$(call AutoLoad,30,bcm43xx-mac80211) # AUTOLOAD:=$(call AutoLoad,30,bcm43xx-mac80211)

View File

@ -16,7 +16,7 @@ include $(INCLUDE_DIR)/package.mk
define KernelPackage/diag define KernelPackage/diag
SUBMENU:=Other modules SUBMENU:=Other modules
DEPENDS:=@TARGET_BRCM_2_4||TARGET_BRCM47XX DEPENDS:=@TARGET_brcm_2_4||TARGET_brcm47xx
TITLE:=Driver for router LEDs and Buttons TITLE:=Driver for router LEDs and Buttons
FILES:=$(PKG_BUILD_DIR)/diag.$(LINUX_KMOD_SUFFIX) FILES:=$(PKG_BUILD_DIR)/diag.$(LINUX_KMOD_SUFFIX)
endef endef
@ -27,7 +27,7 @@ define Build/Prepare
endef endef
ifeq ($(BOARD),brcm-2.4) 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 endif
define Build/Compile define Build/Compile

View File

@ -23,7 +23,7 @@ MAKEFLAGS_KMOD:= -C "$(LINUX_DIR)" \
define KernelPackage/broadcom-mmc define KernelPackage/broadcom-mmc
SUBMENU:=Other modules SUBMENU:=Other modules
DEPENDS:=@TARGET_BRCM_2_4 DEPENDS:=@TARGET_brcm_2_4
TITLE:=Kernel driver for the Linksys WRT54G MM/SD-Card Mod TITLE:=Kernel driver for the Linksys WRT54G MM/SD-Card Mod
DESCRIPTION:=\ DESCRIPTION:=\
Kernel driver for the Linksys WRT54G MM/SD-Card Mod Kernel driver for the Linksys WRT54G MM/SD-Card Mod

View File

@ -25,13 +25,13 @@ define Package/broadcom-wl/Default
CATEGORY:=Kernel modules CATEGORY:=Kernel modules
DEPENDS:=@PACKAGE_kmod-brcm-wl||PACKAGE_kmod-brcm-wl-mimo DEPENDS:=@PACKAGE_kmod-brcm-wl||PACKAGE_kmod-brcm-wl-mimo
SUBMENU:=Proprietary BCM43xx WiFi driver SUBMENU:=Proprietary BCM43xx WiFi driver
SUBMENUDEP:=@TARGET_BRCM_2_4 SUBMENUDEP:=@TARGET_brcm_2_4
endef endef
define KernelPackage/brcm-wl/Default define KernelPackage/brcm-wl/Default
$(call Package/broadcom-wl/Default) $(call Package/broadcom-wl/Default)
SECTION:=kernel SECTION:=kernel
DEPENDS:=@TARGET_BRCM_2_4 DEPENDS:=@TARGET_brcm_2_4
TITLE:=Kernel driver for BCM43xx chipsets TITLE:=Kernel driver for BCM43xx chipsets
FILES:=$(PKG_BUILD_DIR)/kmod/wl$(1).o FILES:=$(PKG_BUILD_DIR)/kmod/wl$(1).o
AUTOLOAD:=$(call AutoLoad,30,wl$(1)) AUTOLOAD:=$(call AutoLoad,30,wl$(1))

View File

@ -18,7 +18,7 @@ include $(INCLUDE_DIR)/package.mk
define KernelPackage/fonera-mp3-driver define KernelPackage/fonera-mp3-driver
SUBMENU:=Other modules SUBMENU:=Other modules
DEPENDS:=@TARGET_ATHEROS DEPENDS:=@TARGET_atheros
TITLE:=Fonera-MP3 driver (VS1011X) TITLE:=Fonera-MP3 driver (VS1011X)
FILES:=$(PKG_BUILD_DIR)/mp3_drv.$(LINUX_KMOD_SUFFIX) FILES:=$(PKG_BUILD_DIR)/mp3_drv.$(LINUX_KMOD_SUFFIX)
AUTOLOAD:=$(call AutoLoad,25,mp3-drv) AUTOLOAD:=$(call AutoLoad,25,mp3-drv)

View File

@ -19,7 +19,7 @@ include $(INCLUDE_DIR)/package.mk
define Package/fonera-mp3d define Package/fonera-mp3d
SECTION:=utils SECTION:=utils
CATEGORY:=Utilities CATEGORY:=Utilities
DEPENDS:=@TARGET_ATHEROS DEPENDS:=@TARGET_atheros
TITLE:=Daemon for fonera-mp3 TITLE:=Daemon for fonera-mp3
endef endef

View File

@ -25,7 +25,7 @@ define Package/foxboard-utils
CATEGORY:=Base system CATEGORY:=Base system
TITLE:=Foxboard base tools TITLE:=Foxboard base tools
URL:=http://www.acmesystems.it URL:=http://www.acmesystems.it
DEPENDS:=@TARGET_ETRAX DEPENDS:=@TARGET_etrax
endef endef
define Package/foxboard-utils/description define Package/foxboard-utils/description

View File

@ -36,7 +36,7 @@ endef
define Package/hostapd define Package/hostapd
$(call Package/hostapd/Default) $(call Package/hostapd/Default)
DEPENDS:=+libopenssl @!TARGET_AVR32 @!TARGET_ETRAX DEPENDS:=+libopenssl @!TARGET_avr32 @!TARGET_etrax
TITLE+= (full) TITLE+= (full)
endef endef

View File

@ -21,7 +21,7 @@ include $(INCLUDE_DIR)/package.mk
define Package/ipset define Package/ipset
SECTION:=net SECTION:=net
CATEGORY:=Network CATEGORY:=Network
DEPENDS:=@!TARGET_ETRAX DEPENDS:=@!TARGET_etrax
TITLE:=Netfilter ip sets administration utility TITLE:=Netfilter ip sets administration utility
URL:=http://ipset.netfilter.org/ URL:=http://ipset.netfilter.org/
endef endef

View File

@ -16,7 +16,7 @@ include $(INCLUDE_DIR)/package.mk
define Package/nvram define Package/nvram
SECTION:=utils SECTION:=utils
CATEGORY:=Utilities CATEGORY:=Utilities
DEPENDS:=@TARGET_BRCM_2_4 DEPENDS:=@TARGET_brcm_2_4
TITLE:=Broadcom config utility TITLE:=Broadcom config utility
endef endef

View File

@ -16,7 +16,7 @@ include $(INCLUDE_DIR)/package.mk
define KernelPackage/switch define KernelPackage/switch
SUBMENU:=Other modules SUBMENU:=Other modules
DEPENDS:=@TARGET_BRCM_2_4||TARGET_BRCM47XX DEPENDS:=@TARGET_brcm_2_4||TARGET_brcm47xx
TITLE:=Switch drivers TITLE:=Switch drivers
FILES:= \ FILES:= \
$(PKG_BUILD_DIR)/switch-core.$(LINUX_KMOD_SUFFIX) \ $(PKG_BUILD_DIR)/switch-core.$(LINUX_KMOD_SUFFIX) \

View File

@ -21,7 +21,7 @@ include $(INCLUDE_DIR)/package.mk
define Package/util-linux/Default define Package/util-linux/Default
SECTION:=utils SECTION:=utils
CATEGORY:=Utilities CATEGORY:=Utilities
DEPENDS:=@!TARGET_ETRAX DEPENDS:=@!TARGET_etrax
URL:=http://www.kernel.org/pub/linux/utils/util-linux/ URL:=http://www.kernel.org/pub/linux/utils/util-linux/
endef endef

View File

@ -16,8 +16,8 @@ include $(INCLUDE_DIR)/package.mk
define KernelPackage/wlcompat/Default define KernelPackage/wlcompat/Default
SUBMENU:=Proprietary BCM43xx WiFi driver SUBMENU:=Proprietary BCM43xx WiFi driver
SUBMENUDEP:=@TARGET_BRCM_2_4 SUBMENUDEP:=@TARGET_brcm_2_4
DEPENDS:=@TARGET_BRCM_2_4 @PACKAGE_kmod-brcm-wl||PACKAGE_kmod-brcm-wl-mimo +wireless-tools DEPENDS:=@TARGET_brcm_2_4 @PACKAGE_kmod-brcm-wl||PACKAGE_kmod-brcm-wl-mimo +wireless-tools
TITLE:=Broadcom wl wrapper module TITLE:=Broadcom wl wrapper module
endef endef

View File

@ -23,7 +23,7 @@ include $(INCLUDE_DIR)/package.mk
define Package/yamonenv define Package/yamonenv
SECTION:=utils SECTION:=utils
CATEGORY:=Utilities CATEGORY:=Utilities
DEPENDS:=@TARGET_AU1000 DEPENDS:=@TARGET_au1000
TITLE:=YAMON configuration utility TITLE:=YAMON configuration utility
URL:=http://meshcube.org/nylon/stable/sources/ URL:=http://meshcube.org/nylon/stable/sources/
endef endef

View File

@ -5,6 +5,9 @@
# See /LICENSE for more information. # See /LICENSE for more information.
# #
ifneq ($(__rules_inc),1)
__rules_inc=1
ifeq ($(DUMP),) ifeq ($(DUMP),)
-include $(TOPDIR)/.config -include $(TOPDIR)/.config
endif endif
@ -13,8 +16,6 @@ include $(TOPDIR)/include/verbose.mk
TMP_DIR:=$(TOPDIR)/tmp TMP_DIR:=$(TOPDIR)/tmp
include $(TOPDIR)/include/target.mk
export SHELL=/usr/bin/env bash -c '. $(TOPDIR)/include/shell.sh; eval "$$2"' -- export SHELL=/usr/bin/env bash -c '. $(TOPDIR)/include/shell.sh; eval "$$2"' --
define qstrip define qstrip
@ -23,6 +24,7 @@ endef
#")) #"))
ARCH:=$(call qstrip,$(CONFIG_ARCH)) ARCH:=$(call qstrip,$(CONFIG_ARCH))
BOARD:=$(call qstrip,$(CONFIG_TARGET_BOARD))
TARGET_OPTIMIZATION:=$(call qstrip,$(CONFIG_TARGET_OPTIMIZATION)) TARGET_OPTIMIZATION:=$(call qstrip,$(CONFIG_TARGET_OPTIMIZATION))
BUILD_SUFFIX:=$(call qstrip,$(CONFIG_BUILD_SUFFIX)) BUILD_SUFFIX:=$(call qstrip,$(CONFIG_BUILD_SUFFIX))
GCCV:=$(call qstrip,$(CONFIG_GCC_VERSION)) GCCV:=$(call qstrip,$(CONFIG_GCC_VERSION))
@ -37,7 +39,7 @@ SCRIPT_DIR:=$(TOPDIR)/scripts
BUILD_DIR_BASE:=$(TOPDIR)/build_dir BUILD_DIR_BASE:=$(TOPDIR)/build_dir
BUILD_DIR:=$(BUILD_DIR_BASE)/$(ARCH)$(if $(BUILD_SUFFIX),_$(BUILD_SUFFIX)) BUILD_DIR:=$(BUILD_DIR_BASE)/$(ARCH)$(if $(BUILD_SUFFIX),_$(BUILD_SUFFIX))
BUILD_DIR_HOST:=$(BUILD_DIR_BASE)/host 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:=$(TOPDIR)/staging_dir/$(ARCH)
STAGING_DIR_HOST:=$(TOPDIR)/staging_dir/host STAGING_DIR_HOST:=$(TOPDIR)/staging_dir/host
TOOLCHAIN_DIR:=$(TOPDIR)/staging_dir/toolchain-$(ARCH)_gcc$(GCCV) TOOLCHAIN_DIR:=$(TOPDIR)/staging_dir/toolchain-$(ARCH)_gcc$(GCCV)
@ -133,3 +135,5 @@ endef
all: all:
FORCE: ; FORCE: ;
.PHONY: FORCE .PHONY: FORCE
endif #__rules_inc

View File

@ -23,15 +23,16 @@ sub parse_target_metadata() {
while (<>) { while (<>) {
chomp; chomp;
/^Target:\s*(.+)\s*$/ and do { /^Target:\s*(.+)\s*$/ and do {
my $conf = uc $1; my $conf = $1;
$conf =~ tr/\.-/__/; $conf =~ tr#/\.\-/#___#;
$target = { $target = {
id => $1,
conf => $conf, conf => $conf,
board => $1,
profiles => [] profiles => []
}; };
push @target, $target; push @target, $target;
}; };
/^Target-Board:\s*(.+)\s*$/ and $target->{board} = $1;
/^Target-Kernel:\s*(\d+\.\d+)\s*$/ and $target->{kernel} = $1; /^Target-Kernel:\s*(\d+\.\d+)\s*$/ and $target->{kernel} = $1;
/^Target-Name:\s*(.+)\s*$/ and $target->{name} = $1; /^Target-Name:\s*(.+)\s*$/ and $target->{name} = $1;
/^Target-Path:\s*(.+)\s*$/ and $target->{path} = $1; /^Target-Path:\s*(.+)\s*$/ and $target->{path} = $1;
@ -198,45 +199,6 @@ sub merge_package_lists($$) {
return sort(@l); 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(@) { sub target_config_features(@) {
my $ret; my $ret;
@ -265,7 +227,7 @@ sub gen_target_config() {
print <<EOF; print <<EOF;
choice choice
prompt "Target System" prompt "Target System"
default TARGET_BRCM_2_4 default TARGET_brcm_2_4
reset if !DEVEL reset if !DEVEL
EOF EOF
@ -298,6 +260,14 @@ EOF
print <<EOF; print <<EOF;
endchoice endchoice
config TARGET_BOARD
string
EOF
foreach my $target (@target) {
print "\t\tdefault \"".$target->{board}."\" if TARGET_".$target->{conf}."\n";
}
print <<EOF;
choice choice
prompt "Target Profile" prompt "Target Profile"
@ -559,7 +529,6 @@ EOF
sub parse_command() { sub parse_command() {
my $cmd = shift @ARGV; my $cmd = shift @ARGV;
for ($cmd) { for ($cmd) {
/^target_mk$/ and return gen_target_mk();
/^target_config$/ and return gen_target_config(); /^target_config$/ and return gen_target_config();
/^package_mk$/ and return gen_package_mk(); /^package_mk$/ and return gen_package_mk();
/^package_config$/ and return gen_package_config(); /^package_config$/ and return gen_package_config();
@ -567,7 +536,6 @@ sub parse_command() {
} }
print <<EOF print <<EOF
Available Commands: Available Commands:
$0 target_mk [file] Target metadata in makefile format
$0 target_config [file] Target metadata in Kconfig format $0 target_config [file] Target metadata in Kconfig format
$0 package_mk [file] Package metadata in makefile format $0 package_mk [file] Package metadata in makefile format
$0 package_config [file] Package metadata in Kconfig format $0 package_config [file] Package metadata in Kconfig format

View File

@ -8,5 +8,5 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/target.mk include $(INCLUDE_DIR)/target.mk
prereq clean download prepare compile install menuconfig oldconfig update refresh: FORCE prereq clean download prepare compile install menuconfig oldconfig update refresh: FORCE
$(MAKE) -C $(BOARD) $@ TARGET_BUILD=1 $(MAKE) -C $(BOARD) $@

View File

@ -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. # This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information. # See /LICENSE for more information.
# #
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
ARCH:=mipsel
BOARD:=adm5120 BOARD:=adm5120
BOARDNAME:=ADM5120 (Little Endian) LINUX_VERSION:=2.6.22.4
FEATURES:=squashfs jffs2 tgz broken FEATURES:=squashfs jffs2 tgz broken
LINUX_VERSION:=2.6.22.4 include $(INCLUDE_DIR)/target.mk
define Target/Description
Build firmware images for Infineon/ADMtek ADM5120 based boards
(e.g : RouterBoard RB1xx, Compex WP54G-WRT ...)
endef
include $(INCLUDE_DIR)/kernel-build.mk
DEFAULT_PACKAGES += admswconfig DEFAULT_PACKAGES += admswconfig
# include the profiles $(eval $(call Target,router_be))
-include profiles/*.mk $(eval $(call Target,router_le))
$(eval $(call BuildTarget))
$(eval $(call BuildKernel))

View File

@ -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

View File

@ -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

View File

@ -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))

View File

@ -1 +0,0 @@
../adm5120/files

View File

@ -1 +0,0 @@
../adm5120/patches-2.6.22

View File

@ -10,6 +10,9 @@ ARCH:=mips
BOARD:=amazon BOARD:=amazon
BOARDNAME:=Infineon Amazon BOARDNAME:=Infineon Amazon
FEATURES:=squashfs jffs2 broken FEATURES:=squashfs jffs2 broken
LINUX_VERSION:=2.6.21.5
include $(INCLUDE_DIR)/target.mk
define Target/Description define Target/Description
Build firmware images for Infineon Amazon boards Build firmware images for Infineon Amazon boards
@ -17,9 +20,7 @@ endef
KERNELNAME:="uImage" KERNELNAME:="uImage"
include $(INCLUDE_DIR)/kernel-build.mk
# include the profiles # include the profiles
-include profiles/*.mk -include profiles/*.mk
$(eval $(call BuildKernel)) $(eval $(call BuildTarget))

View File

@ -13,13 +13,13 @@ FEATURES:=jffs2
LINUX_VERSION:=2.6.21.5 LINUX_VERSION:=2.6.21.5
include $(INCLUDE_DIR)/target.mk
define Target/Description define Target/Description
Build firmware images for the AMCC Taishan evaluation board Build firmware images for the AMCC Taishan evaluation board
endef endef
include $(INCLUDE_DIR)/kernel-build.mk
# include the profiles # include the profiles
-include profiles/*.mk -include profiles/*.mk
$(eval $(call BuildKernel)) $(eval $(call BuildTarget))

View File

@ -13,12 +13,12 @@ FEATURES:=squashfs jffs2 atm
LINUX_VERSION:=2.6.22.4 LINUX_VERSION:=2.6.22.4
include $(INCLUDE_DIR)/target.mk
define Target/Description define Target/Description
Build firmware images for TI AR7 based routers Build firmware images for TI AR7 based routers
endef endef
include $(INCLUDE_DIR)/kernel-build.mk
-include profiles/*.mk -include profiles/*.mk
$(eval $(call BuildKernel)) $(eval $(call BuildTarget))

View File

@ -14,14 +14,15 @@ FEATURES:=squashfs usb
#LINUX_VERSION:=2.6.21.5 #LINUX_VERSION:=2.6.21.5
LINUX_VERSION:=2.6.22.4 LINUX_VERSION:=2.6.22.4
include $(INCLUDE_DIR)/target.mk
KERNELNAME:="uImage"
define Target/Description define Target/Description
Build fimware images for Figment Design Labs VersaLink board. Build fimware images for Figment Design Labs VersaLink board.
endef endef
include $(INCLUDE_DIR)/kernel-build.mk
#include the profiles #include the profiles
-include profiles/*.mk -include profiles/*.mk
KERNELNAME:="uImage" $(eval $(call BuildTarget))
$(eval $(call BuildKernel))

View File

@ -13,14 +13,15 @@ FEATURES:=squashfs jffs2
LINUX_VERSION:=2.6.22.4 LINUX_VERSION:=2.6.22.4
include $(INCLUDE_DIR)/target.mk
DEFAULT_PACKAGES += kmod-madwifi
define Target/Description define Target/Description
Build firmware images for Atheros SoC boards Build firmware images for Atheros SoC boards
endef endef
include $(INCLUDE_DIR)/kernel-build.mk
DEFAULT_PACKAGES += kmod-madwifi
# include the profiles # include the profiles
-include profiles/*.mk -include profiles/*.mk
$(eval $(call BuildKernel)) $(eval $(call BuildTarget))

View File

@ -13,14 +13,14 @@ FEATURES:=jffs2 usb pci
LINUX_VERSION:=2.6.22.4 LINUX_VERSION:=2.6.22.4
include $(INCLUDE_DIR)/target.mk
DEFAULT_PACKAGES += yamonenv
define Target/Description define Target/Description
Build firmware for AMD Alchemy 1500 boards Build firmware for AMD Alchemy 1500 boards
(e.g. 4G-Systems Mesh/Access Cube ...) (e.g. 4G-Systems Mesh/Access Cube ...)
endef endef
include $(INCLUDE_DIR)/kernel-build.mk
DEFAULT_PACKAGES += yamonenv
define Kernel/BuildImage define Kernel/BuildImage
$(call Kernel/BuildImage/Default) $(call Kernel/BuildImage/Default)
$(CP) $(LINUX_DIR)/arch/mips/boot/compressed/images/zImage.flash.srec $(LINUX_DIR)/zImage.flash.srec $(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 the profiles
-include profiles/*.mk -include profiles/*.mk
$(eval $(call BuildKernel)) $(eval $(call BuildTarget))

View File

@ -10,18 +10,15 @@ ARCH:=avr32
BOARD:=avr32 BOARD:=avr32
BOARDNAME:=Atmel AVR32 BOARDNAME:=Atmel AVR32
FEATURES:=squashfs FEATURES:=squashfs
LINUX_VERSION:=2.6.22.4 LINUX_VERSION:=2.6.22.4
include $(INCLUDE_DIR)/target.mk
define Target/Description define Target/Description
Build firmware images for ATNGW100 board Build firmware images for ATNGW100 board
endef endef
KERNEL:=2.6
include $(INCLUDE_DIR)/kernel-build.mk
#include the profiles #include the profiles
-include profiles/*.mk -include profiles/*.mk
$(eval $(call BuildKernel)) $(eval $(call BuildTarget))

View File

@ -11,17 +11,18 @@ BOARD:=brcm-2.4
BOARDNAME:=Broadcom BCM947xx/953xx BOARDNAME:=Broadcom BCM947xx/953xx
FEATURES:=squashfs FEATURES:=squashfs
KERNEL:=2.4
include $(INCLUDE_DIR)/target.mk
DEFAULT_PACKAGES += kmod-switch kmod-diag nvram
define Target/Description define Target/Description
Build firmware images for Broadcom based routers Build firmware images for Broadcom based routers
(e.g. Linksys WRT54G(S), Asus WL-500g, Motorola WR850G) (e.g. Linksys WRT54G(S), Asus WL-500g, Motorola WR850G)
endef endef
KERNEL:=2.4
include $(INCLUDE_DIR)/kernel-build.mk
DEFAULT_PACKAGES += kmod-switch kmod-diag nvram
# include the profiles # include the profiles
-include profiles/*.mk -include profiles/*.mk
$(eval $(call BuildKernel)) $(eval $(call BuildTarget))

View File

@ -13,15 +13,15 @@ FEATURES:=squashfs usb
LINUX_VERSION:=2.6.22.4 LINUX_VERSION:=2.6.22.4
include $(INCLUDE_DIR)/target.mk
DEFAULT_PACKAGES += kmod-switch kmod-diag
define Target/Description define Target/Description
Build firmware images for Broadcom based routers Build firmware images for Broadcom based routers
(e.g. Netgear WGT634U) (e.g. Netgear WGT634U)
endef endef
include $(INCLUDE_DIR)/kernel-build.mk
DEFAULT_PACKAGES += kmod-switch kmod-diag
# include the profiles # include the profiles
-include profiles/*.mk -include profiles/*.mk
$(eval $(call BuildKernel)) $(eval $(call BuildTarget))

View File

@ -10,17 +10,16 @@ ARCH:=mips
BOARD:=brcm63xx BOARD:=brcm63xx
BOARDNAME:=Broadcom BCM963xx BOARDNAME:=Broadcom BCM963xx
FEATURES:=squashfs jffs2 broken usb atm FEATURES:=squashfs jffs2 broken usb atm
LINUX_VERSION:=2.6.22.4 LINUX_VERSION:=2.6.22.4
include $(INCLUDE_DIR)/target.mk
define Target/Description define Target/Description
Build firmware images for Broadcom based xDSL/routers Build firmware images for Broadcom based xDSL/routers
(e.g. Inventel Livebox, Siemens SE515) (e.g. Inventel Livebox, Siemens SE515)
endef endef
include $(INCLUDE_DIR)/kernel-build.mk
# include the profiles # include the profiles
-include profiles/*.mk -include profiles/*.mk
$(eval $(call BuildKernel)) $(eval $(call BuildTarget))

View File

@ -12,7 +12,10 @@ BOARDNAME:=Foxboard (ETRAX 100LX)
FEATURES:=squashfs jffs2 FEATURES:=squashfs jffs2
LINUX_VERSION:=2.6.19.2 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 define Target/Description
Build fimware images for the FOXBOARD made by acmesystems.it Build fimware images for the FOXBOARD made by acmesystems.it
@ -31,14 +34,10 @@ define Kernel/Prepare
$(call Kernel/Prepare/Fox) $(call Kernel/Prepare/Fox)
endef endef
DEFAULT_PACKAGES += foxboard-utils
$(eval $(call RequireCommand,/usr/local/cris/gcc-cris, \
Please install the binary cris toolchain. \
))
#include the profiles #include the profiles
-include profiles/*.mk -include profiles/*.mk
KERNELNAME:="zImage" $(eval $(call BuildTarget))
$(eval $(call BuildKernel)) $(eval $(call RequireCommand,/usr/local/cris/gcc-cris, \
Please install the binary cris toolchain. \
))

View File

@ -13,12 +13,9 @@ FEATURES:=squashfs jffs2
LINUX_VERSION:=2.6.21.5 LINUX_VERSION:=2.6.21.5
define Target/Description include $(INCLUDE_DIR)/target.mk
endef
include $(INCLUDE_DIR)/kernel-build.mk
# include the profiles # include the profiles
-include profiles/*.mk -include profiles/*.mk
$(eval $(call BuildKernel)) $(eval $(call BuildTarget))

View File

@ -13,12 +13,9 @@ FEATURES:=squashfs
LINUX_VERSION:=2.6.21.6 LINUX_VERSION:=2.6.21.6
define Target/Description include $(INCLUDE_DIR)/target.mk
endef
include $(INCLUDE_DIR)/kernel-build.mk
# include the profiles # include the profiles
-include profiles/*.mk -include profiles/*.mk
$(eval $(call BuildKernel)) $(eval $(call BuildTarget))

View File

@ -13,9 +13,9 @@ FEATURES:=squashfs jffs2
LINUX_VERSION:=2.6.22.4 LINUX_VERSION:=2.6.22.4
include $(INCLUDE_DIR)/kernel-build.mk include $(INCLUDE_DIR)/target.mk
# include the profiles # include the profiles
-include profiles/*.mk -include profiles/*.mk
$(eval $(call BuildKernel)) $(eval $(call BuildTarget))

View File

@ -13,13 +13,13 @@ FEATURES:=jffs2 broken
LINUX_VERSION:=2.6.21.5 LINUX_VERSION:=2.6.21.5
include $(INCLUDE_DIR)/target.mk
define Target/Description define Target/Description
Stub for boards based on intel PXA Stub for boards based on intel PXA
endef endef
include $(INCLUDE_DIR)/kernel-build.mk
# include the profiles # include the profiles
-include profiles/*.mk -include profiles/*.mk
$(eval $(call BuildKernel)) $(eval $(call BuildTarget))

View File

@ -13,9 +13,9 @@ FEATURES:=jffs2 pci tgz
LINUX_VERSION:=2.6.22.4 LINUX_VERSION:=2.6.22.4
include $(INCLUDE_DIR)/kernel-build.mk include $(INCLUDE_DIR)/target.mk
# include the profiles # include the profiles
-include profiles/*.mk -include profiles/*.mk
$(eval $(call BuildKernel)) $(eval $(call BuildTarget))

View File

@ -13,13 +13,13 @@ FEATURES:=squashfs jffs2 broken
LINUX_VERSION:=2.6.22.4 LINUX_VERSION:=2.6.22.4
include $(INCLUDE_DIR)/target.mk
define Target/Description define Target/Description
Build firmware images for RDC321x based routers Build firmware images for RDC321x based routers
(e.g. Airlink101 AR525W, Linksys WRT54R, Sitecom WL-153) (e.g. Airlink101 AR525W, Linksys WRT54R, Sitecom WL-153)
endef endef
include $(INCLUDE_DIR)/kernel-build.mk
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y) ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
define Kernel/SetInitramfs define Kernel/SetInitramfs
echo "r6040 parent=wlan0" > $(TARGET_DIR)/etc/modules.d/99-r6040 echo "r6040 parent=wlan0" > $(TARGET_DIR)/etc/modules.d/99-r6040
@ -35,4 +35,4 @@ endif
# include the profiles # include the profiles
-include profiles/*.mk -include profiles/*.mk
$(eval $(call BuildKernel)) $(eval $(call BuildTarget))

View File

@ -1,2 +0,0 @@
# CONFIG_MTD_RDC3210_ALLOW_JFFS2 is not set
CONFIG_MTD_RDC3210_SIZE=0x200000

View File

@ -13,9 +13,9 @@ FEATURES:=broken
LINUX_VERSION:=2.6.21.5 LINUX_VERSION:=2.6.21.5
include $(INCLUDE_DIR)/kernel-build.mk include $(INCLUDE_DIR)/target.mk
# include the profiles # include the profiles
-include profiles/*.mk -include profiles/*.mk
$(eval $(call BuildKernel)) $(eval $(call BuildTarget))

View File

@ -25,11 +25,11 @@ LINUX_CONFIG:=$(CURDIR)/config/$(ARCH)
LINUX_VERSION:=2.6.22.4 LINUX_VERSION:=2.6.22.4
include $(INCLUDE_DIR)/kernel-build.mk include $(INCLUDE_DIR)/target.mk
# include the profiles # include the profiles
-include profiles/*.mk -include profiles/*.mk
endif endif
$(eval $(call BuildKernel)) $(eval $(call BuildTarget))

View File

@ -13,11 +13,11 @@ FEATURES:=squashfs jffs2 ext2
LINUX_VERSION:=2.6.22.4 LINUX_VERSION:=2.6.22.4
include $(INCLUDE_DIR)/kernel-build.mk include $(INCLUDE_DIR)/target.mk
DEFAULT_PACKAGES += kmod-natsemi kmod-ne2k-pci DEFAULT_PACKAGES += kmod-natsemi kmod-ne2k-pci
# include the profiles # include the profiles
-include profiles/*.mk -include profiles/*.mk
$(eval $(call BuildKernel)) $(eval $(call BuildTarget))

View File

@ -39,6 +39,8 @@ $(curdir)//prepare = $(STAGING_DIR)/.prepared $(TOOLCHAIN_DIR)/info.mk
$(curdir)//compile = $(1)/prepare $(curdir)//compile = $(1)/prepare
$(curdir)//install = $(1)/compile $(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))) $(eval $(call subdir,$(curdir)))

View File

@ -33,7 +33,7 @@ BUILD_DIR_HOST:=$(BUILD_DIR_TOOLCHAIN)
include $(INCLUDE_DIR)/host-build.mk 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_DIR1:=$(BUILD_DIR_HOST)/gcc-$(PKG_VERSION)-initial
BUILD_DIR2:=$(BUILD_DIR_HOST)/gcc-$(PKG_VERSION)-final BUILD_DIR2:=$(BUILD_DIR_HOST)/gcc-$(PKG_VERSION)-final

View File

@ -22,8 +22,8 @@ PKG_BUILD_DIR:=$(BUILD_DIR_HOST)/uClibc-$(PKG_VERSION)$(PKG_EXTRAVERSION)
include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/host-build.mk
STAMP_BUILT:=$(TOOLCHAIN_DIR)/stamp/.uclibc_installed STAMP_BUILT:=$(STAGING_DIR)/stamp/.uclibc_installed
STAMP_INSTALLED:=$(TOOLCHAIN_DIR)/stamp/.uclibc-utils_installed STAMP_INSTALLED:=$(STAGING_DIR)/stamp/.uclibc-utils_installed
UCLIBC_TARGET_ARCH:=$(shell echo $(ARCH) | sed -e s'/-.*//' \ UCLIBC_TARGET_ARCH:=$(shell echo $(ARCH) | sed -e s'/-.*//' \
-e 's/i.86/i386/' \ -e 's/i.86/i386/' \