remove support for ubicom32
[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 PKG_SOURCE_URL:=$(LINUX_SITE)
21 HOST_BUILD_DIR:=$(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)
22 PKG_MD5SUM:=$(LINUX_KERNEL_MD5SUM)
23 LINUX_DIR := $(HOST_BUILD_DIR)
24 FILES_DIR :=
25 PATCH_DIR := ./patches$(if $(wildcard ./patches-$(LINUX_VERSION)),-$(LINUX_VERSION))
26
27 include $(INCLUDE_DIR)/toolchain-build.mk
28 include $(INCLUDE_DIR)/kernel-defaults.mk
29
30 ifeq ($(strip $(BOARD)),uml)
31 LINUX_KARCH:=$(subst x86_64,x86,$(subst i386,x86,$(ARCH)))
32 endif
33
34 HOST_EXTRACFLAGS=
35
36 LINUX_HAS_HEADERS_INSTALL:=y
37
38 KMAKE := $(MAKE) -C $(HOST_BUILD_DIR) \
39 HOSTCFLAGS="$(HOST_CFLAGS) -Wall -Wmissing-prototypes -Wstrict-prototypes" \
40 ARCH=$(LINUX_KARCH) \
41 CC="$(KERNEL_CC)" \
42 CFLAGS="$(TARGET_CFLAGS)" \
43 CROSS_COMPILE=$(TARGET_CROSS) \
44 KBUILD_HAVE_NLS=no \
45 CONFIG_SHELL=$(BASH)
46
47 define Host/Configure/all
48 mkdir -p $(BUILD_DIR_TOOLCHAIN)/linux-dev
49 $(KMAKE) \
50 INSTALL_HDR_PATH="$(BUILD_DIR_TOOLCHAIN)/linux-dev/" \
51 headers_install
52 endef
53
54 # XXX: the following is needed to build lzma-loader
55 ifneq ($(CONFIG_mips)$(CONFIG_mipsel),)
56 define Host/Configure/lzma
57 $(CP) \
58 $(HOST_BUILD_DIR)/arch/mips/include/asm/asm.h \
59 $(HOST_BUILD_DIR)/arch/mips/include/asm/regdef.h \
60 $(BUILD_DIR_TOOLCHAIN)/linux-dev/include/asm/
61 endef
62 endif
63
64 define Host/Configure/post/cris
65 $(CP) \
66 $(HOST_BUILD_DIR)/include/linux/user.h \
67 $(BUILD_DIR_TOOLCHAIN)/linux-dev/include/linux/
68 ln -snf $(BUILD_DIR_TOOLCHAIN)/linux-dev/include/arch-v10/arch \
69 $(BUILD_DIR_TOOLCHAIN)/linux-dev/include/arch
70 $(SED) '/#include <asm\/page\.h>/d' $(BUILD_DIR_TOOLCHAIN)/linux-dev/include/asm/user.h
71 endef
72
73 define Host/Configure/post/mips
74 $(call Host/Configure/lzma)
75 endef
76
77 define Host/Configure/post/mipsel
78 $(call Host/Configure/lzma)
79 endef
80
81 define Host/Prepare
82 $(call Kernel/Prepare/Default)
83 ln -sf linux-$(LINUX_VERSION) $(BUILD_DIR_TOOLCHAIN)/linux
84 $(SED) 's/@expr length/@-expr length/' $(HOST_BUILD_DIR)/Makefile
85 endef
86
87 define Host/Configure
88 env
89 yes '' | $(KMAKE) oldconfig
90 $(call Host/Configure/all)
91 $(call Host/Configure/post/$(ARCH))
92 endef
93
94 define Host/Compile
95 endef
96
97 define Host/Install
98 $(CP) $(BUILD_DIR_TOOLCHAIN)/linux-dev/* $(TOOLCHAIN_DIR)/
99 endef
100
101 define Host/Clean
102 rm -rf \
103 $(HOST_BUILD_DIR) \
104 $(BUILD_DIR_TOOLCHAIN)/linux \
105 $(BUILD_DIR_TOOLCHAIN)/linux-dev
106 endef
107
108 $(eval $(call HostBuild))