lm32: add patch for kernel and elf2flt
[openadk.git] / toolchain / kernel-headers / Makefile
blobee4c8079c83ba86612f222bda29eddb1c13cff8b
1 # This file is part of the OpenADK project. OpenADK is copyrighted
2 # material, please see the LICENCE file in the top-level directory.
4 include $(ADK_TOPDIR)/rules.mk
5 include ../rules.mk
6 include $(ADK_TOPDIR)/mk/kernel-ver.mk
7 include $(ADK_TOPDIR)/mk/linux.mk
8 include $(ADK_TOPDIR)/mk/buildhlp.mk
10 # override linux dir here, as build_bla_bla/linux does not exist yet
11 LINUX_DIR=${WRKBUILD}
13 include $(ADK_TOPDIR)/mk/kernel-vars.mk
15 $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_FILE_VER)/.patched:
16 ifeq ($(ADK_TARGET_SYSTEM_PCENGINES_APU),y)
17 ifeq ($(ADK_KERNEL_ROOT_NFS),y)
18 cd $(DL_DIR) && wget http://distfiles.openadk.org/realtek-firmware-1.1.tar.xz
19 tar xf $(DL_DIR)/realtek-firmware-1.1.tar.xz \
20 --strip-components=2 -C $(WRKSRC)/firmware realtek-firmware-1.1
21 endif
22 endif
23 ifeq ($(ADK_TARGET_ARCH_XTENSA),y)
24 tar xf $(ADK_TOPDIR)/target/xtensa/overlay/xtensa_$(ADK_TARGET_CPU_TYPE).tar \
25 --strip-components=1 -C $(WRKSRC) linux
26 endif
27 ifneq ($(ADK_DISABLE_KERNEL_PATCHES),y)
28 $(TRACE) kernel-patch
29 $(PATCH) $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_FILE_VER) \
30 $(ADK_TOPDIR)/target/linux/patches/$(KERNEL_FILE_VER) *.patch $(MAKE_TRACE)
31 ifeq ($(ADK_KERNEL_PATCH_REALTIME),y)
32 $(TRACE) linux-rt-kernel-patch
33 $(PATCH) $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_FILE_VER) \
34 $(ADK_TOPDIR)/target/linux/patches/$(KERNEL_FILE_VER) patch-realtime $(MAKE_TRACE)
35 endif
36 endif
37 ifneq ($(ADK_DISABLE_TARGET_KERNEL_PATCHES),y)
38 $(TRACE) kernel-target-patch
39 $(PATCH) $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_FILE_VER) \
40 $(ADK_TOPDIR)/target/$(ADK_TARGET_ARCH)/$(ADK_TARGET_BOARD)/patches/$(KERNEL_FILE_VER) *.patch $(MAKE_TRACE)
41 $(PATCH) $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_FILE_VER) \
42 $(ADK_TOPDIR)/target/$(ADK_TARGET_ARCH)/$(ADK_TARGET_SYSTEM)/patches/$(KERNEL_FILE_VER) *.patch $(MAKE_TRACE)
43 endif
44 touch $@
46 $(WRKBUILD)/.configured: $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_FILE_VER)/.patched
47 $(KERNEL_MAKE_ENV) $(MAKE) -C "${LINUX_DIR}" $(KERNEL_MAKE_OPTS) \
48 INSTALL_HDR_PATH=$(STAGING_TARGET_DIR)/usr \
49 headers_install
50 ifeq ($(ADK_TARGET_ARCH_CRIS),y)
51 ifeq ($(ADK_TARGET_CPU_ARCH),crisv32)
52 cd $(STAGING_TARGET_DIR)/usr/include && ln -sf arch-v32/arch arch
53 else
54 cd $(STAGING_TARGET_DIR)/usr/include && ln -sf arch-v10/arch arch
55 endif
56 endif
57 @-find $(STAGING_TARGET_DIR)/usr/include -name .install -delete
58 @-find $(STAGING_TARGET_DIR)/usr/include -name ..install.cmd -delete
59 touch $@
61 include ${ADK_TOPDIR}/mk/toolchain.mk