2006-06-27 00:44:04 +00:00
|
|
|
#
|
2009-01-12 19:03:39 +00:00
|
|
|
# Copyright (C) 2006-2009 OpenWrt.org
|
2006-06-27 00:44:04 +00:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
2005-03-06 03:34:52 +00:00
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
2007-08-07 00:04:25 +00:00
|
|
|
KERNEL_BUILD_DIR := $(BUILD_DIR_TOOLCHAIN)
|
|
|
|
BUILD_DIR := $(KERNEL_BUILD_DIR)
|
2006-06-21 06:19:43 +00:00
|
|
|
|
2007-06-28 06:53:08 +00:00
|
|
|
override QUILT:=
|
2009-02-23 17:49:36 +00:00
|
|
|
override HOST_QUILT:=
|
2007-06-28 06:53:08 +00:00
|
|
|
|
2007-08-07 00:04:25 +00:00
|
|
|
include $(INCLUDE_DIR)/kernel.mk
|
2007-08-07 09:41:54 +00:00
|
|
|
|
|
|
|
PKG_NAME:=linux
|
|
|
|
PKG_VERSION:=$(LINUX_VERSION)
|
|
|
|
PKG_SOURCE:=$(LINUX_SOURCE)
|
2023-09-18 22:23:40 +00:00
|
|
|
PKG_CPE_ID:=cpe:/o:linux:linux_kernel
|
2020-11-21 15:05:08 +00:00
|
|
|
ifneq ($(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI)),)
|
2018-01-17 10:55:15 +00:00
|
|
|
PKG_SOURCE_PROTO:=git
|
|
|
|
PKG_SOURCE_URL:=$(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI))
|
2020-11-21 15:05:08 +00:00
|
|
|
PKG_SOURCE_VERSION:=$(call qstrip,$(CONFIG_KERNEL_GIT_REF))
|
2020-11-21 14:59:50 +00:00
|
|
|
PKG_MIRROR_HASH:=$(call qstrip,$(CONFIG_KERNEL_GIT_MIRROR_HASH))
|
2020-11-21 15:05:08 +00:00
|
|
|
ifdef CHECK
|
2023-07-20 13:48:39 +00:00
|
|
|
PLATFORM_DIR:=$(firstword $(wildcard $(TOPDIR)/target/linux/feeds/$(BOARD) $(TOPDIR)/target/linux/$(BOARD)))
|
|
|
|
include $(PLATFORM_DIR)/Makefile
|
2020-11-21 15:05:08 +00:00
|
|
|
include $(INCLUDE_DIR)/kernel-version.mk
|
2023-07-20 13:48:39 +00:00
|
|
|
include $(INCLUDE_DIR)/kernel-build.mk
|
2020-11-21 15:05:08 +00:00
|
|
|
PKG_VERSION:=$(LINUX_VERSION)
|
2018-01-17 10:55:15 +00:00
|
|
|
else
|
2020-11-21 15:05:08 +00:00
|
|
|
PKG_SOURCE:=$(LINUX_SOURCE)
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
PKG_SOURCE:=$(LINUX_SOURCE)
|
2018-01-17 10:55:15 +00:00
|
|
|
PKG_SOURCE_URL:=$(LINUX_SITE)
|
|
|
|
endif
|
2009-02-22 04:37:20 +00:00
|
|
|
HOST_BUILD_DIR:=$(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)
|
2016-12-16 16:32:10 +00:00
|
|
|
PKG_HASH:=$(LINUX_KERNEL_HASH)
|
2009-02-22 04:37:20 +00:00
|
|
|
LINUX_DIR := $(HOST_BUILD_DIR)
|
2010-03-29 15:16:17 +00:00
|
|
|
FILES_DIR :=
|
2012-05-13 05:02:27 +00:00
|
|
|
PATCH_DIR := ./patches$(if $(wildcard ./patches-$(LINUX_VERSION)),-$(LINUX_VERSION))
|
2007-08-07 09:41:54 +00:00
|
|
|
|
2009-02-23 23:52:27 +00:00
|
|
|
include $(INCLUDE_DIR)/toolchain-build.mk
|
2007-06-02 00:46:02 +00:00
|
|
|
include $(INCLUDE_DIR)/kernel-defaults.mk
|
|
|
|
|
2009-01-08 01:49:11 +00:00
|
|
|
ifeq ($(strip $(BOARD)),uml)
|
2010-03-14 16:21:18 +00:00
|
|
|
LINUX_KARCH:=$(subst x86_64,x86,$(subst i386,x86,$(ARCH)))
|
2009-01-08 01:49:11 +00:00
|
|
|
endif
|
|
|
|
|
2011-08-05 16:39:04 +00:00
|
|
|
HOST_EXTRACFLAGS=
|
|
|
|
|
2010-06-26 20:44:48 +00:00
|
|
|
LINUX_HAS_HEADERS_INSTALL:=y
|
2009-02-03 21:25:48 +00:00
|
|
|
|
2019-10-12 07:41:41 +00:00
|
|
|
HOST_KMAKE := $(MAKE) -C $(HOST_BUILD_DIR) \
|
2017-10-13 09:10:03 +00:00
|
|
|
$(KERNEL_MAKE_FLAGS) \
|
2010-05-24 20:38:36 +00:00
|
|
|
CC="$(KERNEL_CC)" \
|
2019-10-12 07:41:41 +00:00
|
|
|
HOSTCFLAGS="$(HOST_CFLAGS)"
|
2009-01-08 01:49:11 +00:00
|
|
|
|
2011-08-05 16:39:04 +00:00
|
|
|
define Host/Configure/all
|
2010-08-19 12:49:51 +00:00
|
|
|
mkdir -p $(BUILD_DIR_TOOLCHAIN)/linux-dev
|
2019-10-12 07:41:41 +00:00
|
|
|
$(HOST_KMAKE) \
|
2010-08-19 12:49:51 +00:00
|
|
|
INSTALL_HDR_PATH="$(BUILD_DIR_TOOLCHAIN)/linux-dev/" \
|
2009-01-08 01:49:11 +00:00
|
|
|
headers_install
|
2010-06-26 20:44:48 +00:00
|
|
|
endef
|
2006-12-14 04:57:55 +00:00
|
|
|
|
2009-01-20 17:05:14 +00:00
|
|
|
# XXX: the following is needed to build lzma-loader
|
2011-02-10 03:52:39 +00:00
|
|
|
ifneq ($(CONFIG_mips)$(CONFIG_mipsel),)
|
2011-08-05 16:39:04 +00:00
|
|
|
define Host/Configure/lzma
|
2009-01-20 17:05:14 +00:00
|
|
|
$(CP) \
|
2011-02-10 03:52:39 +00:00
|
|
|
$(HOST_BUILD_DIR)/arch/mips/include/asm/asm.h \
|
|
|
|
$(HOST_BUILD_DIR)/arch/mips/include/asm/regdef.h \
|
2015-11-07 16:22:18 +00:00
|
|
|
$(HOST_BUILD_DIR)/arch/mips/include/asm/asm-eva.h \
|
2010-08-19 12:49:51 +00:00
|
|
|
$(BUILD_DIR_TOOLCHAIN)/linux-dev/include/asm/
|
2011-02-10 03:52:39 +00:00
|
|
|
endef
|
|
|
|
endif
|
2009-01-20 17:05:14 +00:00
|
|
|
|
2011-08-05 16:39:04 +00:00
|
|
|
define Host/Configure/post/mips
|
|
|
|
$(call Host/Configure/lzma)
|
2009-01-20 17:05:14 +00:00
|
|
|
endef
|
|
|
|
|
2011-08-05 16:39:04 +00:00
|
|
|
define Host/Configure/post/mipsel
|
|
|
|
$(call Host/Configure/lzma)
|
2009-01-20 17:05:14 +00:00
|
|
|
endef
|
|
|
|
|
2009-02-22 04:37:20 +00:00
|
|
|
define Host/Prepare
|
2017-06-16 13:15:37 +00:00
|
|
|
rm -rf $(BUILD_DIR_TOOLCHAIN)/linux-*
|
2008-05-03 15:46:23 +00:00
|
|
|
$(call Kernel/Prepare/Default)
|
2009-08-03 08:54:04 +00:00
|
|
|
rm -f $(BUILD_DIR_TOOLCHAIN)/linux
|
|
|
|
ln -s linux-$(LINUX_VERSION) $(BUILD_DIR_TOOLCHAIN)/linux
|
2009-02-22 04:37:20 +00:00
|
|
|
$(SED) 's/@expr length/@-expr length/' $(HOST_BUILD_DIR)/Makefile
|
2006-06-21 06:19:43 +00:00
|
|
|
endef
|
|
|
|
|
2009-02-22 04:37:20 +00:00
|
|
|
define Host/Configure
|
2019-10-12 07:41:41 +00:00
|
|
|
yes '' | $(HOST_KMAKE) oldconfig
|
2011-08-05 16:39:04 +00:00
|
|
|
$(call Host/Configure/all)
|
|
|
|
$(call Host/Configure/post/$(ARCH))
|
2007-07-30 21:57:14 +00:00
|
|
|
endef
|
|
|
|
|
2009-02-22 04:37:20 +00:00
|
|
|
define Host/Compile
|
2006-06-21 06:19:43 +00:00
|
|
|
endef
|
|
|
|
|
2009-02-22 04:37:20 +00:00
|
|
|
define Host/Install
|
2009-01-20 17:05:14 +00:00
|
|
|
$(CP) $(BUILD_DIR_TOOLCHAIN)/linux-dev/* $(TOOLCHAIN_DIR)/
|
2009-01-08 01:49:11 +00:00
|
|
|
endef
|
|
|
|
|
2009-02-22 04:37:20 +00:00
|
|
|
define Host/Clean
|
2009-01-08 01:49:11 +00:00
|
|
|
rm -rf \
|
2009-02-22 04:37:20 +00:00
|
|
|
$(HOST_BUILD_DIR) \
|
2009-01-08 01:49:11 +00:00
|
|
|
$(BUILD_DIR_TOOLCHAIN)/linux \
|
|
|
|
$(BUILD_DIR_TOOLCHAIN)/linux-dev
|
2006-06-21 06:19:43 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call HostBuild))
|