2 # Copyright (C) 2006-2007 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
7 include $(INCLUDE_DIR)/host.mk
8 include $(INCLUDE_DIR)/prereq.mk
15 STAMP_PREPARED:=$(LINUX_DIR)/.prepared
16 STAMP_CONFIGURED:=$(LINUX_DIR)/.configured
17 include $(INCLUDE_DIR)/download.mk
18 include $(INCLUDE_DIR)/quilt.mk
19 include $(INCLUDE_DIR)/kernel-defaults.mk
22 $(call Kernel/Prepare/Default)
25 define Kernel/Configure
26 $(call Kernel/Configure/Default)
29 define Kernel/CompileModules
30 $(call Kernel/CompileModules/Default)
33 define Kernel/CompileImage
34 $(call Kernel/CompileImage/Default)
38 $(call Kernel/Clean/Default)
41 define Download/kernel
44 MD5SUM:=$(LINUX_KERNEL_MD5SUM)
48 $(if $(QUILT),$(Build/Quilt))
49 $(if $(LINUX_SITE),$(call Download,kernel))
51 $(STAMP_PREPARED): $(DL_DIR)/$(LINUX_SOURCE)
52 -rm -rf $(KERNEL_BUILD_DIR)
53 -mkdir -p $(KERNEL_BUILD_DIR)
57 $(STAMP_CONFIGURED): $(STAMP_PREPARED) $(LINUX_CONFIG) $(GENERIC_LINUX_CONFIG) $(TOPDIR)/.config
61 $(LINUX_DIR)/.modules: $(STAMP_CONFIGURED) $(LINUX_DIR)/.config FORCE
62 $(Kernel/CompileModules)
65 $(LINUX_DIR)/.image: $(STAMP_CONFIGURED) FORCE
66 $(Kernel/CompileImage)
75 download: $(DL_DIR)/$(LINUX_SOURCE)
76 prepare: $(STAMP_CONFIGURED)
77 compile: $(LINUX_DIR)/.modules
78 $(MAKE) -C image compile TARGET_BUILD=
80 oldconfig menuconfig: $(STAMP_PREPARED) FORCE
81 [ -e "$(LINUX_CONFIG)" ] || touch "$(LINUX_CONFIG)"
82 $(LINUX_CONFCMD) > $(LINUX_DIR)/.config
84 $(_SINGLE)$(MAKE) -C $(LINUX_DIR) $(KERNEL_MAKEOPTS) $$@
85 $(SCRIPT_DIR)/kconfig.pl '>' $(GENERIC_LINUX_CONFIG) $(LINUX_DIR)/.config > $(if $(LINUX_SUBCONFIG),$(LINUX_SUBCONFIG),$(LINUX_CONFIG))
88 install: $(LINUX_DIR)/.image
89 +$(MAKE) -C image compile install TARGET_BUILD=
92 rm -rf $(KERNEL_BUILD_DIR)
95 @+$(NO_TRACE_MAKE) -s -C image prereq TARGET_BUILD=