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
18 STAMP_PREPARED:=$(LINUX_DIR)/.prepared
19 STAMP_CONFIGURED:=$(LINUX_DIR)/.configured
20 include $(INCLUDE_DIR)/quilt.mk
21 include $(INCLUDE_DIR)/kernel-defaults.mk
24 $(call Kernel/Prepare/Default)
27 define Kernel/Configure
28 $(call Kernel/Configure/Default)
31 define Kernel/CompileModules
32 $(call Kernel/CompileModules/Default)
35 define Kernel/CompileImage
36 $(call Kernel/CompileImage/Default)
40 $(call Kernel/Clean/Default)
44 ifneq ($(LINUX_SITE),)
45 $(DL_DIR)/$(LINUX_SOURCE):
47 $(SCRIPT_DIR)/download.pl $(DL_DIR) $(LINUX_SOURCE) $(LINUX_KERNEL_MD5SUM) $(LINUX_SITE)
50 $(STAMP_PREPARED): $(DL_DIR)/$(LINUX_SOURCE)
51 -rm -rf $(KERNEL_BUILD_DIR)
52 -mkdir -p $(KERNEL_BUILD_DIR)
56 $(STAMP_CONFIGURED): $(STAMP_PREPARED) $(LINUX_CONFIG) $(GENERIC_LINUX_CONFIG) $(TOPDIR)/.config
60 $(LINUX_DIR)/.modules: $(STAMP_CONFIGURED) $(LINUX_DIR)/.config FORCE
61 $(Kernel/CompileModules)
64 $(LINUX_DIR)/.image: $(STAMP_CONFIGURED) FORCE
65 $(Kernel/CompileImage)
74 download: $(DL_DIR)/$(LINUX_SOURCE)
75 prepare: $(STAMP_CONFIGURED)
76 compile: $(LINUX_DIR)/.modules
77 $(MAKE) -C image compile TARGET_BUILD=
79 oldconfig menuconfig: $(STAMP_PREPARED) FORCE
81 $(LINUX_CONFCMD) > $(LINUX_DIR)/.config
82 $(MAKE) -C $(LINUX_DIR) $(KERNEL_MAKEOPTS) $@
83 $(SCRIPT_DIR)/kconfig.pl '>' $(GENERIC_LINUX_CONFIG) $(LINUX_DIR)/.config > $(LINUX_CONFIG)
85 install: $(LINUX_DIR)/.image
86 TARGET_BUILD="" $(MAKE) -C image compile install
89 rm -rf $(KERNEL_BUILD_DIR)
93 @if [ -f $(LINUX_KERNEL) ]; then \
99 $(SUBMAKE) -s -C image prereq TARGET_BUILD=