X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=include%2Fkernel-build.mk;h=3a17182a27a2b8d9b04def3985ddbf56b7fecc73;hb=a2466897451fdd9d5aa6d8621c7e1d4071f2a383;hp=1ac847e93c4a4fc14df7c6669781b56bd4b9fbe0;hpb=a319cbc1d40e018f89c82ba8e41b8c699e47a72f;p=openwrt%2Fsvn-archive%2Farchive.git diff --git a/include/kernel-build.mk b/include/kernel-build.mk index 1ac847e93c..3a17182a27 100644 --- a/include/kernel-build.mk +++ b/include/kernel-build.mk @@ -6,9 +6,16 @@ # KERNEL_BUILD:=1 +include $(INCLUDE_DIR)/kernel-version.mk +include $(INCLUDE_DIR)/host.mk +include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/prereq.mk --include ./config +LINUX_CONFIG ?= ./config/default + +-include $(TOPDIR)/target/linux/generic-$(KERNEL)/config-template +-include $(LINUX_CONFIG) + ifneq ($(CONFIG_ATM),) FEATURES += atm endif @@ -37,12 +44,6 @@ else all: compile endif -include $(INCLUDE_DIR)/kernel-version.mk -include $(INCLUDE_DIR)/host.mk -include $(INCLUDE_DIR)/kernel.mk - -LINUX_CONFIG:=./config - ifneq (,$(findstring uml,$(BOARD))) LINUX_KARCH:=um else @@ -91,8 +92,11 @@ define Kernel/Configure/2.6 $(MAKE) $(KERNEL_MAKEOPTS) CC="$(KERNEL_CC)" oldconfig prepare scripts endef define Kernel/Configure/Default - @$(CP) $(LINUX_CONFIG) $(LINUX_DIR)/.config - $(call Kernel/Configure/$(KERNEL)) + @if [ -f "./config/profile-$(PROFILE)" ]; then \ + $(SCRIPT_DIR)/config.pl '+' $(GENERIC_PLATFORM_DIR)/config-template '+' $(LINUX_CONFIG) ./config/profile-$(PROFILE) > $(LINUX_DIR)/.config; \ + else \ + $(SCRIPT_DIR)/config.pl '+' $(GENERIC_PLATFORM_DIR)/config-template $(LINUX_CONFIG) > $(LINUX_DIR)/.config; \ + fi endef define Kernel/Configure $(call Kernel/Configure/Default) @@ -132,6 +136,7 @@ define Kernel/CompileImage/Default $(call Kernel/SetInitramfs) $(MAKE) -j$(CONFIG_JLEVEL) $(KERNEL_MAKEOPTS) CC="$(KERNEL_CC)" $(KERNELNAME) $(KERNEL_CROSS)objcopy -O binary -R .reginfo -R .note -R .comment -R .mdebug -S $(LINUX_DIR)/vmlinux $(LINUX_KERNEL) + $(KERNEL_CROSS)objcopy -R .reginfo -R .note -R .comment -R .mdebug -S $(LINUX_DIR)/vmlinux $(KDIR)/vmlinux.elf endef define Kernel/CompileImage $(call Kernel/CompileImage/Default) @@ -163,6 +168,7 @@ define BuildKernel $(LINUX_DIR)/.configured: $(LINUX_DIR)/.prepared $(LINUX_CONFIG) $(call Kernel/Configure) + $(call Kernel/Configure/$(KERNEL)) touch $$@ $(LINUX_DIR)/.modules: $(LINUX_DIR)/.configured @@ -207,6 +213,7 @@ define Profile/Default PACKAGES:= endef +confname=$(subst .,_,$(subst -,_,$(1))) define Profile $(eval $(call Profile/Default)) $(eval $(call Profile/$(1))) @@ -215,10 +222,16 @@ define Profile 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-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)) @@ -226,6 +239,12 @@ $(eval $(call shexport,Target/Description)) download: $(DL_DIR)/$(LINUX_SOURCE) prepare: $(LINUX_DIR)/.configured $(TMP_DIR)/.kernel.mk compile: $(LINUX_DIR)/.modules +menuconfig: $(LINUX_DIR)/.prepared FORCE + $(call Kernel/Configure) + $(SCRIPT_DIR)/config.pl '+' $(GENERIC_PLATFORM_DIR)/config-template $(LINUX_CONFIG) > $(LINUX_DIR)/.config + $(MAKE) -C $(LINUX_DIR) $(KERNEL_MAKEOPTS) menuconfig + $(SCRIPT_DIR)/config.pl '>' $(GENERIC_PLATFORM_DIR)/config-template $(LINUX_DIR)/.config > $(LINUX_CONFIG) + install: $(LINUX_DIR)/.image clean: FORCE