Revert changes with new dnscrypto-proxy.
[tomato.git] / toolchain / include / kernel-build.mk
blobe5c860ded05659aa6ca47df6e6215e413730f27d
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
10 ifneq ($(DUMP),1)
11 all: compile
12 endif
14 STAMP_PREPARED:=$(LINUX_DIR)/.prepared
15 STAMP_CONFIGURED:=$(LINUX_DIR)/.configured
16 include $(INCLUDE_DIR)/download.mk
17 include $(INCLUDE_DIR)/quilt.mk
18 include $(INCLUDE_DIR)/kernel-defaults.mk
20 define Kernel/Prepare
21 $(call Kernel/Prepare/Default)
22 endef
24 define Kernel/Configure
25 $(call Kernel/Configure/Default)
26 endef
28 define Kernel/CompileModules
29 $(call Kernel/CompileModules/Default)
30 endef
32 define Kernel/CompileImage
33 $(call Kernel/CompileImage/Default)
34 endef
36 define Kernel/Clean
37 $(call Kernel/Clean/Default)
38 endef
40 define Download/kernel
41 URL:=$(LINUX_SITE)
42 FILE:=$(LINUX_SOURCE)
43 MD5SUM:=$(LINUX_KERNEL_MD5SUM)
44 endef
46 define BuildKernel
47 $(if $(QUILT),$(Build/Quilt))
48 ifeq ($(strip $(CONFIG_EXTERNAL_KERNEL_TREE)),"")
49 $(if $(LINUX_SITE),$(call Download,kernel))
50 endif
52 $(STAMP_PREPARED): $(DL_DIR)/$(LINUX_SOURCE)
53 -rm -rf $(KERNEL_BUILD_DIR)
54 -mkdir -p $(KERNEL_BUILD_DIR)
55 $(Kernel/Prepare)
56 touch $$@
58 $(STAMP_CONFIGURED): $(STAMP_PREPARED) $(LINUX_CONFIG) $(GENERIC_LINUX_CONFIG) $(TOPDIR)/.config
59 $(Kernel/Configure)
60 touch $$@
62 $(LINUX_DIR)/.modules: $(STAMP_CONFIGURED) $(LINUX_DIR)/.config FORCE
63 $(Kernel/CompileModules)
64 touch $$@
66 $(LINUX_DIR)/.image: $(STAMP_CONFIGURED) FORCE
67 $(Kernel/CompileImage)
68 touch $$@
70 mostlyclean: FORCE
71 $(Kernel/Clean)
73 define BuildKernel
74 endef
76 download: $(DL_DIR)/$(LINUX_SOURCE)
77 prepare: $(STAMP_CONFIGURED)
78 compile: $(LINUX_DIR)/.modules
79 $(MAKE) -C image compile TARGET_BUILD=
81 oldconfig menuconfig: $(STAMP_PREPARED) FORCE
82 [ -e "$(LINUX_CONFIG)" ] || touch "$(LINUX_CONFIG)"
83 $(LINUX_CONFCMD) > $(LINUX_DIR)/.config
84 touch $(LINUX_CONFIG)
85 $(MAKE) -C $(LINUX_DIR) $(KERNEL_MAKEOPTS) $$@
86 $(SCRIPT_DIR)/kconfig.pl '>' $(GENERIC_LINUX_CONFIG) $(LINUX_DIR)/.config > $(LINUX_CONFIG)
87 $(Kernel/Configure)
89 install: $(LINUX_DIR)/.image
90 TARGET_BUILD="" $(MAKE) -C image compile install
92 clean: FORCE
93 rm -rf $(KERNEL_BUILD_DIR)
95 rebuild: FORCE
96 @$(MAKE) mostlyclean
97 @if [ -f $(LINUX_KERNEL) ]; then \
98 $(MAKE) clean; \
100 @$(MAKE) compile
102 image-prereq:
103 @$(NO_TRACE_MAKE) -s -C image prereq TARGET_BUILD=
105 prereq: image-prereq
107 endef