ipq40xx: only include ath10k-board-qca4019 for the generic subtarget
[openwrt/staging/chunkeey.git] / toolchain / kernel-headers / Makefile
1 #
2 # Copyright (C) 2006-2009 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 include $(TOPDIR)/rules.mk
8
9 KERNEL_BUILD_DIR := $(BUILD_DIR_TOOLCHAIN)
10 BUILD_DIR := $(KERNEL_BUILD_DIR)
11
12 override QUILT:=
13 override HOST_QUILT:=
14
15 include $(INCLUDE_DIR)/kernel.mk
16
17 PKG_NAME:=linux
18 PKG_VERSION:=$(LINUX_VERSION)
19 PKG_SOURCE:=$(LINUX_SOURCE)
20 ifneq ($(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI)),)
21 PKG_SOURCE_PROTO:=git
22 PKG_SOURCE_URL:=$(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI))
23 PKG_SOURCE_VERSION:=$(call qstrip,$(CONFIG_KERNEL_GIT_REF))
24 PKG_MIRROR_HASH:=$(call qstrip,$(CONFIG_KERNEL_GIT_MIRROR_HASH))
25 ifdef CHECK
26 include $(INCLUDE_DIR)/kernel-version.mk
27 PKG_VERSION:=$(LINUX_VERSION)
28 else
29 PKG_SOURCE:=$(LINUX_SOURCE)
30 endif
31 else
32 PKG_SOURCE:=$(LINUX_SOURCE)
33 PKG_SOURCE_URL:=$(LINUX_SITE)
34 endif
35 HOST_BUILD_DIR:=$(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)
36 PKG_HASH:=$(LINUX_KERNEL_HASH)
37 LINUX_DIR := $(HOST_BUILD_DIR)
38 FILES_DIR :=
39 PATCH_DIR := ./patches$(if $(wildcard ./patches-$(LINUX_VERSION)),-$(LINUX_VERSION))
40
41 include $(INCLUDE_DIR)/toolchain-build.mk
42 include $(INCLUDE_DIR)/kernel-defaults.mk
43
44 ifeq ($(strip $(BOARD)),uml)
45 LINUX_KARCH:=$(subst x86_64,x86,$(subst i386,x86,$(ARCH)))
46 endif
47
48 HOST_EXTRACFLAGS=
49
50 LINUX_HAS_HEADERS_INSTALL:=y
51
52 HOST_KMAKE := $(MAKE) -C $(HOST_BUILD_DIR) \
53 $(KERNEL_MAKE_FLAGS) \
54 CC="$(KERNEL_CC)" \
55 HOSTCFLAGS="$(HOST_CFLAGS)"
56
57 define Host/Configure/all
58 mkdir -p $(BUILD_DIR_TOOLCHAIN)/linux-dev
59 $(HOST_KMAKE) \
60 INSTALL_HDR_PATH="$(BUILD_DIR_TOOLCHAIN)/linux-dev/" \
61 headers_install
62 endef
63
64 # XXX: the following is needed to build lzma-loader
65 ifneq ($(CONFIG_mips)$(CONFIG_mipsel),)
66 define Host/Configure/lzma
67 $(CP) \
68 $(HOST_BUILD_DIR)/arch/mips/include/asm/asm.h \
69 $(HOST_BUILD_DIR)/arch/mips/include/asm/regdef.h \
70 $(HOST_BUILD_DIR)/arch/mips/include/asm/asm-eva.h \
71 $(BUILD_DIR_TOOLCHAIN)/linux-dev/include/asm/
72 endef
73 endif
74
75 define Host/Configure/post/mips
76 $(call Host/Configure/lzma)
77 endef
78
79 define Host/Configure/post/mipsel
80 $(call Host/Configure/lzma)
81 endef
82
83 define Host/Prepare
84 rm -rf $(BUILD_DIR_TOOLCHAIN)/linux-*
85 $(call Kernel/Prepare/Default)
86 rm -f $(BUILD_DIR_TOOLCHAIN)/linux
87 ln -s linux-$(LINUX_VERSION) $(BUILD_DIR_TOOLCHAIN)/linux
88 $(SED) 's/@expr length/@-expr length/' $(HOST_BUILD_DIR)/Makefile
89 endef
90
91 define Host/Configure
92 env
93 yes '' | $(HOST_KMAKE) oldconfig
94 $(call Host/Configure/all)
95 $(call Host/Configure/post/$(ARCH))
96 endef
97
98 define Host/Compile
99 endef
100
101 define Host/Install
102 $(CP) $(BUILD_DIR_TOOLCHAIN)/linux-dev/* $(TOOLCHAIN_DIR)/
103 endef
104
105 define Host/Clean
106 rm -rf \
107 $(HOST_BUILD_DIR) \
108 $(BUILD_DIR_TOOLCHAIN)/linux \
109 $(BUILD_DIR_TOOLCHAIN)/linux-dev
110 endef
111
112 $(eval $(call HostBuild))