add some fixes for compiling on mac os x
[openwrt/svn-archive/archive.git] / openwrt / toolchain / kernel-headers / kernel-headers.mk
1 # linux kernel headers for toolchain
2
3 LINUX_HEADERS_VERSION=2.4.29
4 LINUX_KERNEL_MD5SUM:=fcf8b6bb620467f27b657c1c4a60bbff
5 LINUX_HEADERS_SITE=http://www.fi.kernel.org/pub/linux/kernel/v2.4 \
6 http://www.fr.kernel.org/pub/linux/kernel/v2.4 \
7 http://www.kernel.org/pub/linux/kernel/v2.4 \
8 http://www.de.kernel.org/pub/linux/kernel/v2.4
9 LINUX_HEADERS_SOURCE=linux-$(LINUX_HEADERS_VERSION).tar.bz2
10 LINUX_HEADERS_CONFIG=./linux.config
11 LINUX_HEADERS_ARCH:=$(shell echo $(ARCH) | sed -e 's/i[3-9]86/i386/' \
12 -e 's/mipsel/mips/' \
13 -e 's/powerpc/ppc/' \
14 -e 's/sh[234]/sh/' \
15 )
16
17 $(DL_DIR)/$(LINUX_HEADERS_SOURCE):
18 -mkdir -p $(DL_DIR)
19 $(SCRIPT_DIR)/download.pl $(DL_DIR) $(LINUX_HEADERS_SOURCE) $(LINUX_KERNEL_MD5SUM) $(LINUX_HEADERS_SITE)
20
21 $(LINUX_HEADERS_DIR)/.unpacked: $(DL_DIR)/$(LINUX_HEADERS_SOURCE)
22 mkdir -p $(TOOL_BUILD_DIR)
23 bzcat $(DL_DIR)/$(LINUX_HEADERS_SOURCE) | tar -C $(TOOL_BUILD_DIR) $(TAR_OPTIONS) - \
24 linux-$(LINUX_HEADERS_VERSION)/include \
25 linux-$(LINUX_HEADERS_VERSION)/Makefile \
26 linux-$(LINUX_HEADERS_VERSION)/Rules.make \
27 linux-$(LINUX_HEADERS_VERSION)/arch/$(LINUX_HEADERS_ARCH)/Makefile \
28 linux-$(LINUX_HEADERS_VERSION)/scripts \
29 linux-$(LINUX_HEADERS_VERSION)/arch/$(LINUX_HEADERS_ARCH)/config*.in \
30 linux-$(LINUX_HEADERS_VERSION)/*/*/Config.in \
31 linux-$(LINUX_HEADERS_VERSION)/*/Config.in
32 ln -sf $(LINUX_HEADERS_DIR)-$(LINUX_HEADERS_VERSION) $(LINUX_HEADERS_DIR)
33 $(SED) 's/@expr length/@-expr length/' $(LINUX_HEADERS_DIR)/Makefile
34 touch $(LINUX_HEADERS_DIR)/.unpacked
35
36 $(LINUX_HEADERS_DIR)/.configured: $(LINUX_HEADERS_DIR)/.unpacked
37 -cp -af $(LINUX_HEADERS_CONFIG) $(LINUX_HEADERS_DIR)/.config
38 $(MAKE) -C $(LINUX_HEADERS_DIR) ARCH=$(LINUX_HEADERS_ARCH) oldconfig include/linux/version.h
39 touch $(LINUX_HEADERS_DIR)/.configured
40
41 kernel-headers: $(LINUX_HEADERS_DIR)/.configured
42
43 kernel-headers-source: $(DL_DIR)/$(LINUX_HEADERS_SOURCE)
44
45 kernel-headers-clean: clean
46 rm -rf $(LINUX_HEADERS_DIR)
47
48 kernel-headers-toolclean:
49 rm -rf $(LINUX_HEADERS_DIR)