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.
9 include $(INCLUDE_DIR
)/kernel-version.mk
10 include $(INCLUDE_DIR
)/host.mk
11 include $(INCLUDE_DIR
)/kernel.mk
12 include $(INCLUDE_DIR
)/prereq.mk
14 GENERIC_LINUX_CONFIG
:=$(GENERIC_PLATFORM_DIR
)/config-
$(shell [ -f
"$(GENERIC_PLATFORM_DIR)/config-$(KERNEL_PATCHVER)" ] && echo
"$(KERNEL_PATCHVER)" || echo template
)
15 LINUX_CONFIG_DIR ?
= .
/config
$(shell [ -d
"./config-$(KERNEL_PATCHVER)" ] && printf
-- "-$(KERNEL_PATCHVER)" || true
)
16 LINUX_CONFIG ?
= $(LINUX_CONFIG_DIR
)/default
19 TMP_CONFIG
:=$(TMP_DIR
)/.kconfig-
$(BOARD
)-$(KERNEL
)
20 $(TMP_CONFIG
): $(GENERIC_LINUX_CONFIG
) $(LINUX_CONFIG
)
21 $(SCRIPT_DIR
)/config.pl
+ $^
> $@
22 -include $(TMP_CONFIG
)
23 .SILENT
: $(TMP_CONFIG
)
26 ifneq ($(CONFIG_PCI
),)
29 ifneq ($(CONFIG_USB
),)
32 ifneq ($(CONFIG_PCMCIA
)$(CONFIG_PCCARD
),)
37 FEATURES
:=$(sort $(FEATURES
))
45 ifneq (,$(findstring uml
,$(BOARD
)))
48 LINUX_KARCH
:=$(shell echo
$(ARCH
) | sed
-e
's/i[3-9]86/i386/' \
57 STAMP_PREPARED
:=$(LINUX_DIR
)/.prepared
58 STAMP_CONFIGURED
:=$(LINUX_DIR
)/.configured
59 include $(INCLUDE_DIR
)/quilt.mk
60 include $(INCLUDE_DIR
)/kernel-defaults.mk
63 $(call Kernel
/Prepare
/Default
)
66 define Kernel
/Configure
67 $(call Kernel
/Configure
/Default
)
70 define Kernel
/CompileModules
71 $(call Kernel
/CompileModules
/Default
)
74 define Kernel
/CompileImage
75 $(call Kernel
/CompileImage
/Default
)
79 $(call Kernel
/Clean
/Default
)
83 ifneq ($(LINUX_SITE
),)
84 $(DL_DIR
)/$(LINUX_SOURCE
):
86 $(SCRIPT_DIR
)/download.pl
$(DL_DIR
) $(LINUX_SOURCE
) $(LINUX_KERNEL_MD5SUM
) $(LINUX_SITE
)
89 $(STAMP_PREPARED
): $(DL_DIR
)/$(LINUX_SOURCE
)
90 -rm -rf
$(KERNEL_BUILD_DIR
)
91 -mkdir
-p
$(KERNEL_BUILD_DIR
)
92 $(call Kernel
/Prepare
)
95 $(STAMP_CONFIGURED
): $(STAMP_PREPARED
) $(LINUX_CONFIG
) $(GENERIC_LINUX_CONFIG
) $(TOPDIR
)/.config
96 $(call Kernel
/Configure
)
99 $(LINUX_DIR
)/.modules
: $(STAMP_CONFIGURED
) $(LINUX_DIR
)/.config FORCE
100 $(call Kernel
/CompileModules
)
103 $(LINUX_DIR
)/.image
: $(STAMP_CONFIGURED
) FORCE
104 $(call Kernel
/CompileImage
)
112 @echo
'Target: $(BOARD)-$(KERNEL)'
113 @echo
'Target-Name: $(BOARDNAME) [$(KERNEL)]'
114 @echo
'Target-Path: $(subst $(TOPDIR)/,,$(PWD))'
115 @echo
'Target-Arch: $(ARCH)'
116 @echo
'Target-Features: $(FEATURES)'
117 @echo
'Linux-Version: $(LINUX_VERSION)'
118 @echo
'Linux-Release: $(LINUX_RELEASE)'
119 @echo
'Linux-Kernel-Arch: $(LINUX_KARCH)'
120 @echo
'Target-Description:'
121 @getvar
$(call shvar
,Target
/Description
)
123 @echo
'Default-Packages: $(DEFAULT_PACKAGES)'
133 define Profile
/Default
138 confname
=$(subst .
,_
,$(subst -,_
,$(1)))
140 $(eval
$(call Profile
/Default
))
141 $(eval
$(call Profile
/$(1)))
142 $(eval
$(call shexport
,Profile
/$(1)/Config
))
143 $(eval
$(call shexport
,Profile
/$(1)/Description
))
145 echo
"Target-Profile: $(1)"; \
146 echo
"Target-Profile-Name: $(NAME)"; \
147 echo
"Target-Profile-Packages: $(PACKAGES)"; \
148 if
[ -f .
/config
/profile-
$(1) ]; then \
149 echo
"Target-Profile-Kconfig: yes"; \
151 echo
"Target-Profile-Config: "; \
152 getvar
"$(call shvar,Profile/$(1)/Config)"; \
154 echo
"Target-Profile-Description:"; \
155 getvar
"$(call shvar,Profile/$(1)/Description)"; \
158 ifeq ($(CONFIG_LINUX_
$(call confname
,$(KERNEL
)_
$(1))),y
)
163 $(eval
$(call shexport
,Target
/Description
))
165 download
: $(DL_DIR
)/$(LINUX_SOURCE
)
166 prepare
: $(STAMP_CONFIGURED
)
167 compile
: $(LINUX_DIR
)/.modules
168 oldconfig menuconfig
: $(STAMP_PREPARED
) FORCE
169 $(call Kernel
/Configure
)
170 $(SCRIPT_DIR
)/config.pl
'+' $(GENERIC_LINUX_CONFIG
) $(LINUX_CONFIG
) > $(LINUX_DIR
)/.config
171 $(MAKE
) -C
$(LINUX_DIR
) $(KERNEL_MAKEOPTS
) $@
172 $(SCRIPT_DIR
)/config.pl
'>' $(GENERIC_LINUX_CONFIG
) $(LINUX_DIR
)/.config
> $(LINUX_CONFIG
)
174 install: $(LINUX_DIR
)/.image
177 rm -f
$(STAMP_DIR
)/.linux-compile
178 rm -rf
$(KERNEL_BUILD_DIR
)
182 @if
[ -f
$(LINUX_KERNEL
) ]; then \
This page took 0.045449 seconds and 5 git commands to generate.