2 # Copyright (C) 2006 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
7 include $(TOPDIR)/rules.mk
9 KERNEL_BUILD_DIR := $(BUILD_DIR_TOOLCHAIN)
10 BUILD_DIR := $(KERNEL_BUILD_DIR)
12 STAGING_DIR_HOST:=$(TOOLCHAIN_DIR)
13 BUILD_DIR_HOST:=$(BUILD_DIR_TOOLCHAIN)
15 override CONFIG_AUTOREBUILD=
17 include $(INCLUDE_DIR)/kernel.mk
20 PKG_VERSION:=$(LINUX_VERSION)
21 PKG_SOURCE:=$(LINUX_SOURCE)
22 PKG_SOURCE_URL:=$(LINUX_SITE)
23 PKG_BUILD_DIR := $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)
24 PKG_MD5SUM:=$(LINUX_KERNEL_MD5SUM)
25 LINUX_DIR := $(PKG_BUILD_DIR)
27 include $(INCLUDE_DIR)/host-build.mk
28 include $(INCLUDE_DIR)/kernel-defaults.mk
30 define Build/Configure/cris
31 ln -sf $(PKG_BUILD_DIR)/include/asm-cris/arch-v10 $(PKG_BUILD_DIR)/include/asm-cris/arch
32 ln -sf $(PKG_BUILD_DIR)/include/asm-cris/arch-v10 $(PKG_BUILD_DIR)/arch/cris/arch
35 define Build/Configure/powerpc
36 $(CP) $(PKG_BUILD_DIR)/include/asm-ppc/* $(PKG_BUILD_DIR)/include/asm-powerpc/
37 rm -rf $(PKG_BUILD_DIR)/include/asm-ppc
38 ln -s $(PKG_BUILD_DIR)/include/asm-powerpc $(PKG_BUILD_DIR)/include/asm-ppc
41 ifneq (,$(findstring uml,$(BOARD)))
45 KMAKE := $(MAKE) -C $(PKG_BUILD_DIR) \
51 $(call Kernel/Prepare/Default)
52 $(SED) 's/@expr length/@-expr length/' $(PKG_BUILD_DIR)/Makefile
53 ln -sf linux-$(LINUX_VERSION) $(LINUX_HEADERS_DIR)
54 yes '' | $(KMAKE) oldconfig
55 $(KMAKE) include/linux/version.h include/asm
56 $(call Build/Configure/$(ARCH))
59 define Build/Configure
68 $(eval $(call HostBuild))