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
)/host.mk
10 include $(INCLUDE_DIR
)/kernel.mk
11 include $(INCLUDE_DIR
)/prereq.mk
15 GENERIC_LINUX_CONFIG
:=$(GENERIC_PLATFORM_DIR
)/config-
$(shell [ -f
"$(GENERIC_PLATFORM_DIR)/config-$(KERNEL_PATCHVER)" ] && echo
"$(KERNEL_PATCHVER)" || echo template
)
16 LINUX_CONFIG_DIR ?
= .
/config
$(shell [ -d
"./config-$(KERNEL_PATCHVER)" ] && printf
-- "-$(KERNEL_PATCHVER)" || true
)
17 LINUX_CONFIG ?
= $(LINUX_CONFIG_DIR
)/default
20 TMP_CONFIG
:=$(TMP_DIR
)/.kconfig-
$(BOARD
)-$(KERNEL
)
21 $(TMP_CONFIG
): $(GENERIC_LINUX_CONFIG
) $(LINUX_CONFIG
)
22 $(SCRIPT_DIR
)/config.pl
+ $^
> $@
23 -include $(TMP_CONFIG
)
24 .SILENT
: $(TMP_CONFIG
)
27 ifneq ($(CONFIG_PCI
),)
30 ifneq ($(CONFIG_USB
),)
33 ifneq ($(CONFIG_PCMCIA
)$(CONFIG_PCCARD
),)
38 FEATURES
:=$(sort $(FEATURES
))
46 ifneq (,$(findstring uml
,$(BOARD
)))
49 LINUX_KARCH
:=$(shell echo
$(ARCH
) | sed
-e
's/i[3-9]86/i386/' \
58 STAMP_PREPARED
:=$(LINUX_DIR
)/.prepared
59 STAMP_CONFIGURED
:=$(LINUX_DIR
)/.configured
60 include $(INCLUDE_DIR
)/quilt.mk
61 include $(INCLUDE_DIR
)/kernel-defaults.mk
64 $(call Kernel
/Prepare
/Default
)
67 define Kernel
/Configure
68 $(call Kernel
/Configure
/Default
)
71 define Kernel
/CompileModules
72 $(call Kernel
/CompileModules
/Default
)
75 define Kernel
/CompileImage
76 $(call Kernel
/CompileImage
/Default
)
80 $(call Kernel
/Clean
/Default
)
84 ifneq ($(LINUX_SITE
),)
85 $(DL_DIR
)/$(LINUX_SOURCE
):
87 $(SCRIPT_DIR
)/download.pl
$(DL_DIR
) $(LINUX_SOURCE
) $(LINUX_KERNEL_MD5SUM
) $(LINUX_SITE
)
90 $(STAMP_PREPARED
): $(DL_DIR
)/$(LINUX_SOURCE
)
91 -rm -rf
$(KERNEL_BUILD_DIR
)
92 -mkdir
-p
$(KERNEL_BUILD_DIR
)
93 $(call Kernel
/Prepare
)
96 $(STAMP_CONFIGURED
): $(STAMP_PREPARED
) $(LINUX_CONFIG
) $(GENERIC_LINUX_CONFIG
) $(TOPDIR
)/.config
97 $(call Kernel
/Configure
)
100 $(LINUX_DIR
)/.modules
: $(STAMP_CONFIGURED
) $(LINUX_DIR
)/.config FORCE
101 $(call Kernel
/CompileModules
)
104 $(LINUX_DIR
)/.image
: $(STAMP_CONFIGURED
) FORCE
105 $(call Kernel
/CompileImage
)
113 @echo
'Target: $(BOARD)-$(KERNEL)'
114 @echo
'Target-Name: $(BOARDNAME) [$(KERNEL)]'
115 @echo
'Target-Path: $(subst $(TOPDIR)/,,$(PWD))'
116 @echo
'Target-Arch: $(ARCH)'
117 @echo
'Target-Features: $(FEATURES)'
118 @echo
'Linux-Version: $(LINUX_VERSION)'
119 @echo
'Linux-Release: $(LINUX_RELEASE)'
120 @echo
'Linux-Kernel-Arch: $(LINUX_KARCH)'
121 @echo
'Target-Description:'
122 @getvar
$(call shvar
,Target
/Description
)
124 @echo
'Default-Packages: $(DEFAULT_PACKAGES)'
134 define Profile
/Default
139 confname
=$(subst .
,_
,$(subst -,_
,$(1)))
141 $(eval
$(call Profile
/Default
))
142 $(eval
$(call Profile
/$(1)))
143 $(eval
$(call shexport
,Profile
/$(1)/Config
))
144 $(eval
$(call shexport
,Profile
/$(1)/Description
))
146 echo
"Target-Profile: $(1)"; \
147 echo
"Target-Profile-Name: $(NAME)"; \
148 echo
"Target-Profile-Packages: $(PACKAGES)"; \
149 if
[ -f .
/config
/profile-
$(1) ]; then \
150 echo
"Target-Profile-Kconfig: yes"; \
152 echo
"Target-Profile-Config: "; \
153 getvar
"$(call shvar,Profile/$(1)/Config)"; \
155 echo
"Target-Profile-Description:"; \
156 getvar
"$(call shvar,Profile/$(1)/Description)"; \
159 ifeq ($(CONFIG_LINUX_
$(call confname
,$(KERNEL
)_
$(1))),y
)
164 $(eval
$(call shexport
,Target
/Description
))
166 download
: $(DL_DIR
)/$(LINUX_SOURCE
)
167 prepare
: $(STAMP_CONFIGURED
)
168 compile
: $(LINUX_DIR
)/.modules
169 $(MAKE
) -C image compile
171 oldconfig menuconfig
: $(STAMP_PREPARED
) FORCE
172 $(call Kernel
/Configure
)
173 $(SCRIPT_DIR
)/config.pl
'+' $(GENERIC_LINUX_CONFIG
) $(LINUX_CONFIG
) > $(LINUX_DIR
)/.config
174 $(MAKE
) -C
$(LINUX_DIR
) $(KERNEL_MAKEOPTS
) $@
175 $(SCRIPT_DIR
)/config.pl
'>' $(GENERIC_LINUX_CONFIG
) $(LINUX_DIR
)/.config
> $(LINUX_CONFIG
)
177 install: $(LINUX_DIR
)/.image
178 $(MAKE
) -C image compile
install
181 rm -f
$(STAMP_DIR
)/.linux-compile
182 rm -rf
$(KERNEL_BUILD_DIR
)
186 @if
[ -f
$(LINUX_KERNEL
) ]; then \
192 $(SUBMAKE
) -s
-C image prereq
This page took 0.062429 seconds and 5 git commands to generate.