[package] mac80211: update compat-wireless to 2009-01-19
[openwrt.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 STAGING_DIR_HOST:=$(TOOLCHAIN_DIR)
13 BUILD_DIR_HOST:=$(BUILD_DIR_TOOLCHAIN)
14
15 override QUILT:=
16 override CONFIG_AUTOREBUILD=
17
18 include $(INCLUDE_DIR)/kernel.mk
19
20 PKG_NAME:=linux
21 PKG_VERSION:=$(LINUX_VERSION)
22 PKG_SOURCE:=$(LINUX_SOURCE)
23 PKG_SOURCE_URL:=$(LINUX_SITE)
24 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)
25 PKG_MD5SUM:=$(LINUX_KERNEL_MD5SUM)
26 LINUX_DIR := $(PKG_BUILD_DIR)
27
28 include $(INCLUDE_DIR)/host-build.mk
29 include $(INCLUDE_DIR)/kernel-defaults.mk
30
31 ifeq ($(strip $(BOARD)),uml)
32 LINUX_KARCH:=$(ARCH)
33 endif
34
35 KMAKE := $(MAKE) -C $(PKG_BUILD_DIR) \
36 ARCH=$(LINUX_KARCH) \
37 KBUILD_HAVE_NLS=no \
38 CONFIG_SHELL=$(BASH)
39
40 define Build/Prepare/pre/cris
41 ln -sf $(PKG_BUILD_DIR)/include/asm-cris/arch-v10 $(PKG_BUILD_DIR)/include/asm-cris/arch
42 ln -sf $(PKG_BUILD_DIR)/include/asm-cris/arch-v10 $(PKG_BUILD_DIR)/arch/cris/arch
43 endef
44
45 define Build/Prepare/pre/powerpc
46 if [ -d $(PKG_BUILD_DIR)/include/asm-ppc ]; then \
47 $(CP) $(PKG_BUILD_DIR)/include/asm-ppc/* $(PKG_BUILD_DIR)/include/asm-powerpc/; \
48 rm -rf $(PKG_BUILD_DIR)/include/asm-ppc; \
49 ln -s $(PKG_BUILD_DIR)/include/asm-powerpc $(PKG_BUILD_DIR)/include/asm-ppc; \
50 fi
51 endef
52
53 ifeq ($(strip $(call CompareKernelPatchVer,$(KERNEL_PATCHVER),ge,2.6.18)),1)
54 define Build/Prepare/all
55 mkdir -p $(BUILD_DIR_TOOLCHAIN)/linux-dev/usr
56 $(KMAKE) \
57 CROSS_COMPILE=$(TARGET_CROSS) \
58 INSTALL_HDR_PATH="$(BUILD_DIR_TOOLCHAIN)/linux-dev/usr/" \
59 headers_install
60 endef
61 else
62 define Build/Prepare/all
63 mkdir -p $(BUILD_DIR_TOOLCHAIN)/linux-dev/usr/include
64 cp -pLR \
65 $(PKG_BUILD_DIR)/include/asm \
66 $(PKG_BUILD_DIR)/include/asm-generic \
67 $(PKG_BUILD_DIR)/include/asm-$(LINUX_KARCH) \
68 $(PKG_BUILD_DIR)/include/linux \
69 $(BUILD_DIR_TOOLCHAIN)/linux-dev/usr/include/
70 endef
71 endif
72
73 # XXX: the following is needed to build lzma-loader
74 define Build/Prepare/lzma
75 $(CP) \
76 $(PKG_BUILD_DIR)/include/asm-mips/asm.h \
77 $(PKG_BUILD_DIR)/include/asm-mips/regdef.h \
78 $(BUILD_DIR_TOOLCHAIN)/linux-dev/usr/include/asm/
79 endef
80
81 # XXX: the following are needed to build a cris toolchain
82 define Build/Prepare/post/cris
83 $(CP) \
84 $(PKG_BUILD_DIR)/include/linux/user.h \
85 $(BUILD_DIR_TOOLCHAIN)/linux-dev/usr/include/linux/
86 $(CP) \
87 $(PKG_BUILD_DIR)/include/asm-cris/elf.h \
88 $(PKG_BUILD_DIR)/include/asm-cris/page.h \
89 $(PKG_BUILD_DIR)/include/asm-cris/user.h \
90 $(BUILD_DIR_TOOLCHAIN)/linux-dev/usr/include/asm/
91 mkdir -p $(BUILD_DIR_TOOLCHAIN)/linux-dev/usr/include/asm/arch
92 $(CP) \
93 $(PKG_BUILD_DIR)/include/asm-cris/arch/elf.h \
94 $(PKG_BUILD_DIR)/include/asm-cris/arch/page.h \
95 $(PKG_BUILD_DIR)/include/asm-cris/arch/ptrace.h \
96 $(PKG_BUILD_DIR)/include/asm-cris/arch/user.h \
97 $(BUILD_DIR_TOOLCHAIN)/linux-dev/usr/include/asm/arch/
98 $(CP) \
99 $(PKG_BUILD_DIR)/include/asm-generic/memory_model.h \
100 $(PKG_BUILD_DIR)/include/asm-generic/page.h \
101 $(BUILD_DIR_TOOLCHAIN)/linux-dev/usr/include/asm-generic/
102 endef
103
104 define Build/Prepare/post/mips
105 $(call Build/Prepare/lzma)
106 endef
107
108 define Build/Prepare/post/mipsel
109 $(call Build/Prepare/lzma)
110 endef
111
112 define Build/Prepare
113 $(call Kernel/Prepare/Default)
114 ln -sf linux-$(LINUX_VERSION) $(BUILD_DIR_TOOLCHAIN)/linux
115 $(SED) 's/@expr length/@-expr length/' $(PKG_BUILD_DIR)/Makefile
116 yes '' | $(KMAKE) oldconfig
117 $(KMAKE) include/linux/version.h include/asm
118 if [ -d $(PKG_BUILD_DIR)/arch/$(LINUX_KARCH)/include/asm ]; then \
119 $(CP) \
120 $(PKG_BUILD_DIR)/arch/$(LINUX_KARCH)/include/asm/. \
121 $(PKG_BUILD_DIR)/include/asm-$(LINUX_KARCH)/; \
122 fi
123 $(call Build/Prepare/pre/$(ARCH))
124 $(call Build/Prepare/all)
125 $(call Build/Prepare/post/$(ARCH))
126 endef
127
128 define Build/Configure
129 endef
130
131 define Build/Compile
132 endef
133
134 define Build/Install
135 $(CP) $(BUILD_DIR_TOOLCHAIN)/linux-dev/* $(TOOLCHAIN_DIR)/
136 endef
137
138 define Build/Clean
139 rm -rf \
140 $(PKG_BUILD_DIR) \
141 $(BUILD_DIR_TOOLCHAIN)/linux \
142 $(BUILD_DIR_TOOLCHAIN)/linux-dev
143 endef
144
145 $(eval $(call HostBuild))
This page took 0.053419 seconds and 5 git commands to generate.