Makefile 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. # This file is part of the OpenADK project. OpenADK is copyrighted
  2. # material, please see the LICENCE file in the top-level directory.
  3. include $(ADK_TOPDIR)/rules.mk
  4. include ../rules.mk
  5. include $(ADK_TOPDIR)/mk/kernel-ver.mk
  6. include $(ADK_TOPDIR)/mk/linux.mk
  7. include $(ADK_TOPDIR)/mk/buildhlp.mk
  8. # override linux dir here, as build_bla_bla/linux does not exist yet
  9. LINUX_DIR=${WRKBUILD}
  10. include $(ADK_TOPDIR)/mk/kernel-vars.mk
  11. $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_VERSION)/.patched:
  12. ifeq ($(ADK_TARGET_SYSTEM_PCENGINES_APU),y)
  13. ifeq ($(ADK_KERNEL_ROOT_NFS),y)
  14. cd $(DL_DIR) && wget http://openadk.org/distfiles/realtek-firmware-1.1.tar.xz
  15. tar xf $(DL_DIR)/realtek-firmware-1.1.tar.xz \
  16. --strip-components=2 -C $(WRKSRC)/firmware realtek-firmware-1.1
  17. endif
  18. endif
  19. ifeq ($(ADK_TARGET_ARCH_XTENSA),y)
  20. tar xf $(ADK_TOPDIR)/target/xtensa/overlay/xtensa_dc232b.tar \
  21. --strip-components=1 -C $(WRKSRC) linux
  22. endif
  23. ifneq ($(ADK_DISABLE_KERNEL_PATCHES),y)
  24. $(TRACE) kernel-patch
  25. $(PATCH) $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_VERSION) \
  26. $(ADK_TOPDIR)/target/linux/patches/$(KERNEL_VERSION) *.patch $(MAKE_TRACE)
  27. endif
  28. ifneq ($(ADK_DISABLE_TARGET_KERNEL_PATCHES),y)
  29. $(TRACE) kernel-target-patch
  30. $(PATCH) $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_VERSION) \
  31. $(ADK_TOPDIR)/target/$(ADK_TARGET_ARCH)/$(ADK_TARGET_BOARD)/patches/$(KERNEL_VERSION) *.patch $(MAKE_TRACE)
  32. $(PATCH) $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_VERSION) \
  33. $(ADK_TOPDIR)/target/$(ADK_TARGET_ARCH)/$(ADK_TARGET_SYSTEM)/patches/$(KERNEL_VERSION) *.patch $(MAKE_TRACE)
  34. endif
  35. ifeq ($(ADK_KERNEL_ADDON_FBLOGO),y)
  36. $(TRACE) fblogo-kernel-patch
  37. $(PATCH) $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_VERSION) \
  38. $(ADK_TOPDIR)/target/linux/patches/$(KERNEL_VERSION) patch-fblogo $(MAKE_TRACE)
  39. endif
  40. ifeq ($(ADK_KERNEL_ADDON_YAFFS2),y)
  41. $(TRACE) yaffs2-kernel-patch
  42. $(PATCH) $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_VERSION) \
  43. $(ADK_TOPDIR)/target/linux/patches/$(KERNEL_VERSION) patch-yaffs2 $(MAKE_TRACE)
  44. endif
  45. ifeq ($(ADK_KERNEL_ADDON_GRSEC),y)
  46. $(TRACE) grsec-kernel-patch
  47. $(PATCH) $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_VERSION) \
  48. $(ADK_TOPDIR)/target/linux/patches/$(KERNEL_VERSION) patch-grsec $(MAKE_TRACE)
  49. endif
  50. ifeq ($(ADK_KERNEL_ADDON_MPTCP),y)
  51. $(TRACE) mptcp-kernel-patch
  52. $(PATCH) $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_VERSION) \
  53. $(ADK_TOPDIR)/target/linux/patches/$(KERNEL_VERSION) patch-mptcp $(MAKE_TRACE)
  54. endif
  55. ifeq ($(ADK_KERNEL_ADDON_DIETNET),y)
  56. $(TRACE) dietnet-kernel-patch
  57. $(PATCH) $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_VERSION) \
  58. $(ADK_TOPDIR)/target/linux/patches/$(KERNEL_VERSION) patch-dietnet $(MAKE_TRACE)
  59. endif
  60. touch $@
  61. $(WRKBUILD)/.headers: $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_VERSION)/.patched
  62. $(KERNEL_MAKE_ENV) $(MAKE) $(KERNEL_MAKE_OPTS) headers_check
  63. $(KERNEL_MAKE_ENV) $(MAKE) $(KERNEL_MAKE_OPTS) \
  64. INSTALL_HDR_PATH=$(STAGING_TARGET_DIR)/usr \
  65. headers_install
  66. ifeq ($(ADK_TARGET_ARCH_CRIS),y)
  67. ifeq ($(ADK_TARGET_CPU_ARCH),crisv32)
  68. cd $(STAGING_TARGET_DIR)/usr/include && ln -sf arch-v32/arch arch
  69. else
  70. cd $(STAGING_TARGET_DIR)/usr/include && ln -sf arch-v10/arch arch
  71. endif
  72. endif
  73. @-find $(STAGING_TARGET_DIR)/usr/include -name .install -delete
  74. @-find $(STAGING_TARGET_DIR)/usr/include -name ..install.cmd -delete
  75. touch $@
  76. include ${ADK_TOPDIR}/mk/toolchain.mk