source: trunk/include/kernel-build.mk @ 9063

Last change on this file since 9063 was 9063, checked in by nbd, 9 years ago

fixes for refresh/update handling

  • Property svn:eol-style set to native
File size: 2.2 KB
Line 
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#
7include $(INCLUDE_DIR)/host.mk
8include $(INCLUDE_DIR)/prereq.mk
9
10ifneq ($(DUMP),1)
11  override MAKEFLAGS=
12endif
13
14ifneq ($(DUMP),1)
15  all: compile
16endif
17
18STAMP_PREPARED:=$(LINUX_DIR)/.prepared
19STAMP_CONFIGURED:=$(LINUX_DIR)/.configured
20include $(INCLUDE_DIR)/download.mk
21include $(INCLUDE_DIR)/quilt.mk
22include $(INCLUDE_DIR)/kernel-defaults.mk
23
24define Kernel/Prepare
25        $(call Kernel/Prepare/Default)
26endef
27
28define Kernel/Configure
29        $(call Kernel/Configure/Default)
30endef
31
32define Kernel/CompileModules
33        $(call Kernel/CompileModules/Default)
34endef
35
36define Kernel/CompileImage
37        $(call Kernel/CompileImage/Default)
38endef
39
40define Kernel/Clean
41        $(call Kernel/Clean/Default)
42endef
43
44define Download/kernel
45  URL:=$(LINUX_SITE)
46  FILE:=$(LINUX_SOURCE)
47  MD5SUM:=$(LINUX_KERNEL_MD5SUM)
48endef
49
50define BuildKernel
51  $(if $(QUILT),$(Build/Quilt))
52  $(if $(LINUX_SITE),$(call Download,kernel))
53
54  $(STAMP_PREPARED): $(DL_DIR)/$(LINUX_SOURCE)
55        -rm -rf $(KERNEL_BUILD_DIR)
56        -mkdir -p $(KERNEL_BUILD_DIR)
57        $(Kernel/Prepare)
58        touch $$@
59
60  $(STAMP_CONFIGURED): $(STAMP_PREPARED) $(LINUX_CONFIG) $(GENERIC_LINUX_CONFIG) $(TOPDIR)/.config
61        $(Kernel/Configure)
62        touch $$@
63
64  $(LINUX_DIR)/.modules: $(STAMP_CONFIGURED) $(LINUX_DIR)/.config FORCE
65        $(Kernel/CompileModules)
66        touch $$@
67
68  $(LINUX_DIR)/.image: $(STAMP_CONFIGURED) FORCE
69        $(Kernel/CompileImage)
70        touch $$@
71       
72  mostlyclean: FORCE
73        $(Kernel/Clean)
74
75  define BuildKernel
76  endef
77
78  download: $(DL_DIR)/$(LINUX_SOURCE)
79  prepare: $(STAMP_CONFIGURED)
80  compile: $(LINUX_DIR)/.modules
81        $(MAKE) -C image compile TARGET_BUILD=
82
83  oldconfig menuconfig: $(STAMP_PREPARED) FORCE
84        $(LINUX_CONFCMD) > $(LINUX_DIR)/.config
85        $(MAKE) -C $(LINUX_DIR) $(KERNEL_MAKEOPTS) $$@
86        $(SCRIPT_DIR)/kconfig.pl '>' $(GENERIC_LINUX_CONFIG) $(LINUX_DIR)/.config > $(LINUX_CONFIG)
87        $(Kernel/Configure)
88
89  install: $(LINUX_DIR)/.image
90        TARGET_BUILD="" $(MAKE) -C image compile install
91
92  clean: FORCE
93        rm -rf $(KERNEL_BUILD_DIR)
94
95  rebuild: FORCE
96        @$(MAKE) mostlyclean
97        @if [ -f $(LINUX_KERNEL) ]; then \
98                $(MAKE) clean; \
99        fi
100        @$(MAKE) compile
101
102  image-prereq:
103        $(SUBMAKE) -s -C image prereq TARGET_BUILD=
104
105  prereq: image-prereq
106
107endef
Note: See TracBrowser for help on using the repository browser.