fix ANI and make use of it in all modes except for monitor
[openwrt.git] / include / kernel-build.mk
1 #
2 # Copyright (C) 2006-2007 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 include $(INCLUDE_DIR)/host.mk
8 include $(INCLUDE_DIR)/prereq.mk
9
10 ifneq ($(DUMP),1)
11 all: compile
12 endif
13
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
19
20 define Kernel/Prepare
21 $(call Kernel/Prepare/Default)
22 endef
23
24 define Kernel/Configure
25 $(call Kernel/Configure/Default)
26 endef
27
28 define Kernel/CompileModules
29 $(call Kernel/CompileModules/Default)
30 endef
31
32 define Kernel/CompileImage
33 $(call Kernel/CompileImage/Default)
34 endef
35
36 define Kernel/Clean
37 $(call Kernel/Clean/Default)
38 endef
39
40 define Download/kernel
41 URL:=$(LINUX_SITE)
42 FILE:=$(LINUX_SOURCE)
43 MD5SUM:=$(LINUX_KERNEL_MD5SUM)
44 endef
45
46 define BuildKernel
47 $(if $(QUILT),$(Build/Quilt))
48 $(if $(LINUX_SITE),$(call Download,kernel))
49
50 $(STAMP_PREPARED): $(DL_DIR)/$(LINUX_SOURCE)
51 -rm -rf $(KERNEL_BUILD_DIR)
52 -mkdir -p $(KERNEL_BUILD_DIR)
53 $(Kernel/Prepare)
54 touch $$@
55
56 $(STAMP_CONFIGURED): $(STAMP_PREPARED) $(LINUX_CONFIG) $(GENERIC_LINUX_CONFIG) $(TOPDIR)/.config
57 $(Kernel/Configure)
58 touch $$@
59
60 $(LINUX_DIR)/.modules: $(STAMP_CONFIGURED) $(LINUX_DIR)/.config FORCE
61 $(Kernel/CompileModules)
62 touch $$@
63
64 $(LINUX_DIR)/.image: $(STAMP_CONFIGURED) FORCE
65 $(Kernel/CompileImage)
66 touch $$@
67
68 mostlyclean: FORCE
69 $(Kernel/Clean)
70
71 define BuildKernel
72 endef
73
74 download: $(DL_DIR)/$(LINUX_SOURCE)
75 prepare: $(STAMP_CONFIGURED)
76 compile: $(LINUX_DIR)/.modules
77 $(MAKE) -C image compile TARGET_BUILD=
78
79 oldconfig menuconfig: $(STAMP_PREPARED) FORCE
80 $(LINUX_CONFCMD) > $(LINUX_DIR)/.config
81 touch $(LINUX_CONFIG)
82 $(MAKE) -C $(LINUX_DIR) $(KERNEL_MAKEOPTS) $$@
83 $(SCRIPT_DIR)/kconfig.pl '>' $(GENERIC_LINUX_CONFIG) $(LINUX_DIR)/.config > $(LINUX_CONFIG)
84 $(Kernel/Configure)
85
86 install: $(LINUX_DIR)/.image
87 TARGET_BUILD="" $(MAKE) -C image compile install
88
89 clean: FORCE
90 rm -rf $(KERNEL_BUILD_DIR)
91
92 rebuild: FORCE
93 @$(MAKE) mostlyclean
94 @if [ -f $(LINUX_KERNEL) ]; then \
95 $(MAKE) clean; \
96 fi
97 @$(MAKE) compile
98
99 image-prereq:
100 @$(NO_TRACE_MAKE) -s -C image prereq TARGET_BUILD=
101
102 prereq: image-prereq
103
104 endef
This page took 0.069588 seconds and 5 git commands to generate.