mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2025-04-21 12:27:27 +03:00
make target/linux/* directories self-contained, use the selected kernel version for the toolchain, autogenerate menuconfig and makefile code for target selection
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@5498 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
@@ -5,11 +5,11 @@
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/.host.mk
|
||||
include $(TMP_DIR)/.host.mk
|
||||
|
||||
export TAR
|
||||
|
||||
$(TOPDIR)/.host.mk: $(INCLUDE_DIR)/host.mk
|
||||
$(TMP_DIR)/.host.mk: $(INCLUDE_DIR)/host.mk
|
||||
@( \
|
||||
HOST_OS=`uname`; \
|
||||
case "$$HOST_OS" in \
|
||||
|
||||
@@ -6,15 +6,16 @@
|
||||
#
|
||||
KERNEL_BUILD:=1
|
||||
|
||||
ifeq ($(DUMP),1)
|
||||
all: dumpinfo
|
||||
else
|
||||
all: compile
|
||||
endif
|
||||
KERNEL:=2.$(word 2,$(subst ., ,$(strip $(LINUX_VERSION))))
|
||||
|
||||
include $(INCLUDE_DIR)/host.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
LINUX_SOURCE:=linux-$(LINUX_VERSION).tar.bz2
|
||||
LINUX_SITE:=http://www.us.kernel.org/pub/linux/kernel/v$(KERNEL) \
|
||||
http://www.us.kernel.org/pub/linux/kernel/v$(KERNEL) \
|
||||
http://www.kernel.org/pub/linux/kernel/v$(KERNEL) \
|
||||
http://www.de.kernel.org/pub/linux/kernel/v$(KERNEL)
|
||||
|
||||
LINUX_CONFIG:=./config
|
||||
|
||||
ifneq (,$(findstring uml,$(BOARD)))
|
||||
@@ -149,28 +150,37 @@ define BuildKernel
|
||||
endef
|
||||
endef
|
||||
|
||||
$(eval $(call shexport,Target/Description))
|
||||
|
||||
download: $(DL_DIR)/$(LINUX_SOURCE)
|
||||
prepare: $(LINUX_DIR)/.configured $(TOPDIR)/.kernel.mk
|
||||
compile: $(LINUX_DIR)/.modules
|
||||
install: $(LINUX_DIR)/.image
|
||||
ifeq ($(DUMP),1)
|
||||
dumpinfo:
|
||||
@echo 'Target: $(BOARD)-$(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:'
|
||||
@echo "$$$(call shvar,Target/Description)"
|
||||
@echo '@@'
|
||||
else
|
||||
download: $(DL_DIR)/$(LINUX_SOURCE)
|
||||
prepare: $(LINUX_DIR)/.configured $(TMP_DIR)/.kernel.mk
|
||||
compile: $(LINUX_DIR)/.modules
|
||||
install: $(LINUX_DIR)/.image
|
||||
|
||||
clean: FORCE
|
||||
clean: FORCE
|
||||
rm -f $(STAMP_DIR)/.linux-compile
|
||||
rm -rf $(KERNEL_BUILD_DIR)
|
||||
|
||||
rebuild: FORCE
|
||||
rebuild: FORCE
|
||||
@$(MAKE) mostlyclean
|
||||
@if [ -f $(LINUX_KERNEL) ]; then \
|
||||
$(MAKE) clean; \
|
||||
fi
|
||||
@$(MAKE) compile
|
||||
|
||||
$(TOPDIR)/.kernel.mk: Makefile
|
||||
echo "CONFIG_BOARD:=$(BOARD)" > $@
|
||||
echo "CONFIG_KERNEL:=$(KERNEL)" >> $@
|
||||
echo "CONFIG_LINUX_VERSION:=$(LINUX_VERSION)" >> $@
|
||||
echo "CONFIG_LINUX_RELEASE:=$(LINUX_RELEASE)" >> $@
|
||||
echo "CONFIG_LINUX_KARCH:=$(LINUX_KARCH)" >> $@
|
||||
endif
|
||||
|
||||
|
||||
|
||||
@@ -4,29 +4,14 @@
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
ifeq ($(DUMP),1)
|
||||
KERNEL:=<KERNEL>
|
||||
BOARD:=<BOARD>
|
||||
LINUX_VERSION:=<LINUX_VERSION>
|
||||
KERNEL?=<KERNEL>
|
||||
BOARD?=<BOARD>
|
||||
LINUX_VERSION?=<LINUX_VERSION>
|
||||
else
|
||||
|
||||
include $(TOPDIR)/.kernel.mk
|
||||
include $(INCLUDE_DIR)/target.mk
|
||||
|
||||
# check to see if .kernel.mk matches target.mk
|
||||
ifeq ($(CONFIG_BOARD)-$(CONFIG_KERNEL),$(BOARD)-$(KERNEL))
|
||||
LINUX_VERSION:=$(CONFIG_LINUX_VERSION)
|
||||
LINUX_RELEASE:=$(CONFIG_LINUX_RELEASE)
|
||||
LINUX_KARCH:=$(CONFIG_LINUX_KARCH)
|
||||
else
|
||||
ifneq ($(KERNEL_BUILD),1)
|
||||
# oops, old .kernel.config; rebuild it (hiding the misleading errors this produces)
|
||||
$(warning rebuilding .kernel.mk)
|
||||
$(TOPDIR)/.kernel.mk: FORCE
|
||||
@$(MAKE) -C $(TOPDIR)/target/linux/$(BOARD)-$(KERNEL) $@ &>/dev/null
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(KERNEL),2.6)
|
||||
LINUX_KMOD_SUFFIX=ko
|
||||
else
|
||||
@@ -49,6 +34,13 @@ else
|
||||
TARGET_MODULES_DIR := $(LINUX_TARGET_DIR)/$(MODULES_SUBDIR)
|
||||
|
||||
LINUX_KERNEL:=$(KERNEL_BUILD_DIR)/vmlinux
|
||||
|
||||
LINUX_SOURCE:=linux-$(LINUX_VERSION).tar.bz2
|
||||
LINUX_SITE:=http://www.us.kernel.org/pub/linux/kernel/v$(KERNEL) \
|
||||
http://www.us.kernel.org/pub/linux/kernel/v$(KERNEL) \
|
||||
http://www.kernel.org/pub/linux/kernel/v$(KERNEL) \
|
||||
http://www.de.kernel.org/pub/linux/kernel/v$(KERNEL)
|
||||
|
||||
endif
|
||||
|
||||
|
||||
|
||||
@@ -16,15 +16,6 @@ include $(INCLUDE_DIR)/unpack.mk
|
||||
|
||||
export CONFIG_SITE:=$(INCLUDE_DIR)/site/$(REAL_GNU_TARGET_NAME)
|
||||
|
||||
define shvar
|
||||
V_$(subst .,_,$(subst -,_,$(subst /,_,$(1))))
|
||||
endef
|
||||
|
||||
define shexport
|
||||
$(call shvar,$(1))=$$(call $(1))
|
||||
export $(call shvar,$(1))
|
||||
endef
|
||||
|
||||
define Build/DefaultTargets
|
||||
ifeq ($(DUMP),)
|
||||
ifeq ($(CONFIG_AUTOREBUILD),y)
|
||||
|
||||
@@ -5,28 +5,23 @@
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
$(TMP_DIR):
|
||||
mkdir -p $@
|
||||
|
||||
prereq:
|
||||
if [ -f $(TMP_DIR)/.prereq-error ]; then \
|
||||
echo; \
|
||||
cat $(TMP_DIR)/.prereq-error; \
|
||||
rm -f $(TMP_DIR)/.prereq-error; \
|
||||
echo; \
|
||||
rm -rf $(TMP_DIR); \
|
||||
false; \
|
||||
fi
|
||||
rm -rf $(TMP_DIR)
|
||||
mkdir -p $(TMP_DIR)
|
||||
|
||||
.SILENT: $(TMP_DIR) prereq
|
||||
.SILENT: prereq
|
||||
|
||||
define Require
|
||||
export PREREQ_CHECK=1
|
||||
ifeq ($$(CHECK_$(1)),)
|
||||
prereq: prereq-$(1)
|
||||
|
||||
prereq-$(1): $(TMP_DIR) FORCE
|
||||
prereq-$(1): FORCE
|
||||
echo -n "Checking '$(1)'... "
|
||||
if $(NO_TRACE_MAKE) -f $(firstword $(MAKEFILE_LIST)) check-$(1) >/dev/null 2>/dev/null; then \
|
||||
echo 'ok.'; \
|
||||
|
||||
@@ -4,29 +4,9 @@
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
define kernel_template
|
||||
ifeq ($(CONFIG_LINUX_$(3)),y)
|
||||
KERNEL:=$(1)
|
||||
BOARD:=$(2)
|
||||
endif
|
||||
endef
|
||||
|
||||
$(eval $(call kernel_template,2.4,brcm,2_4_BRCM))
|
||||
$(eval $(call kernel_template,2.4,ar7,2_4_AR7))
|
||||
$(eval $(call kernel_template,2.6,brcm,2_6_BRCM))
|
||||
$(eval $(call kernel_template,2.6,brcm63xx,2_6_BRCM63XX))
|
||||
$(eval $(call kernel_template,2.6,rb532,2_6_RB532))
|
||||
$(eval $(call kernel_template,2.6,rdc,2_6_RDC))
|
||||
$(eval $(call kernel_template,2.6,x86,2_6_X86))
|
||||
$(eval $(call kernel_template,2.6,uml,2_6_UML))
|
||||
$(eval $(call kernel_template,2.4,ar531x,2_4_AR531X))
|
||||
$(eval $(call kernel_template,2.6,aruba,2_6_ARUBA))
|
||||
$(eval $(call kernel_template,2.6,au1000,2_6_AU1000))
|
||||
$(eval $(call kernel_template,2.6,ixp4xx,2_6_IXP4XX))
|
||||
$(eval $(call kernel_template,2.6,magicbox,2_6_MAGICBOX))
|
||||
$(eval $(call kernel_template,2.6,sibyte,2_6_SIBYTE))
|
||||
|
||||
export BOARD
|
||||
export KERNEL
|
||||
include $(TMP_DIR)/.target.mk
|
||||
|
||||
$(TMP_DIR)/.target.mk:
|
||||
$(SCRIPT_DIR)/gen_target_mk.pl < $(TMP_DIR)/.targetinfo > $@
|
||||
|
||||
|
||||
Reference in New Issue
Block a user