Makefile 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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/kernel-vars.mk
  8. include $(ADK_TOPDIR)/mk/buildhlp.mk
  9. $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_VERSION)/.patched:
  10. ifeq ($(ADK_TARGET_SYSTEM_PCENGINES_APU),y)
  11. ifeq ($(ADK_KERNEL_ROOT_NFS),y)
  12. cd $(DL_DIR) && wget http://openadk.org/distfiles/realtek-firmware-1.1.tar.xz
  13. tar xf $(DL_DIR)/realtek-firmware-1.1.tar.xz \
  14. --strip-components=2 -C $(WRKSRC)/firmware realtek-firmware-1.1
  15. endif
  16. endif
  17. ifeq ($(ADK_TARGET_ARCH_XTENSA),y)
  18. tar xf $(ADK_TOPDIR)/target/xtensa/overlay/xtensa_dc232b.tar \
  19. --strip-components=1 -C $(WRKSRC) linux
  20. endif
  21. ifneq ($(ADK_DISABLE_KERNEL_PATCHES),y)
  22. $(TRACE) kernel-patch
  23. $(PATCH) $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_VERSION) \
  24. $(ADK_TOPDIR)/target/linux/patches/$(KERNEL_VERSION) *.patch $(MAKE_TRACE)
  25. endif
  26. ifneq ($(ADK_DISABLE_TARGET_KERNEL_PATCHES),y)
  27. $(TRACE) kernel-target-patch
  28. $(PATCH) $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_VERSION) \
  29. $(ADK_TOPDIR)/target/$(ADK_TARGET_ARCH)/$(ADK_TARGET_BOARD)/patches/$(KERNEL_VERSION) *.patch $(MAKE_TRACE)
  30. $(PATCH) $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_VERSION) \
  31. $(ADK_TOPDIR)/target/$(ADK_TARGET_ARCH)/$(ADK_TARGET_SYSTEM)/patches/$(KERNEL_VERSION) *.patch $(MAKE_TRACE)
  32. endif
  33. ifeq ($(ADK_KERNEL_ADDON_FBLOGO),y)
  34. $(TRACE) fblogo-kernel-patch
  35. $(PATCH) $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_VERSION) \
  36. $(ADK_TOPDIR)/target/linux/patches/$(KERNEL_VERSION) patch-fblogo $(MAKE_TRACE)
  37. endif
  38. ifeq ($(ADK_KERNEL_ADDON_YAFFS2),y)
  39. $(TRACE) yaffs2-kernel-patch
  40. $(PATCH) $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_VERSION) \
  41. $(ADK_TOPDIR)/target/linux/patches/$(KERNEL_VERSION) patch-yaffs2 $(MAKE_TRACE)
  42. endif
  43. ifeq ($(ADK_KERNEL_ADDON_GRSEC),y)
  44. $(TRACE) grsec-kernel-patch
  45. $(PATCH) $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_VERSION) \
  46. $(ADK_TOPDIR)/target/linux/patches/$(KERNEL_VERSION) patch-grsec $(MAKE_TRACE)
  47. endif
  48. ifeq ($(ADK_KERNEL_ADDON_MPTCP),y)
  49. $(TRACE) mptcp-kernel-patch
  50. $(PATCH) $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_VERSION) \
  51. $(ADK_TOPDIR)/target/linux/patches/$(KERNEL_VERSION) patch-mptcp $(MAKE_TRACE)
  52. endif
  53. ifeq ($(ADK_KERNEL_ADDON_DIETNET),y)
  54. $(TRACE) dietnet-kernel-patch
  55. $(PATCH) $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_VERSION) \
  56. $(ADK_TOPDIR)/target/linux/patches/$(KERNEL_VERSION) patch-dietnet $(MAKE_TRACE)
  57. endif
  58. touch $@
  59. $(WRKBUILD)/.headers: $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_VERSION)/.patched
  60. $(KERNEL_MAKE_ENV) $(MAKE) -C $(WRKBUILD) $(KERNEL_MAKE_OPTS) headers_check
  61. $(KERNEL_MAKE_ENV) $(MAKE) -C $(WRKBUILD) $(KERNEL_MAKE_OPTS) \
  62. INSTALL_HDR_PATH=$(STAGING_TARGET_DIR)/usr \
  63. headers_install
  64. ifeq ($(ADK_TARGET_ARCH_CRIS),y)
  65. ifeq ($(ADK_TARGET_CPU_ARCH),crisv32)
  66. cd $(STAGING_TARGET_DIR)/usr/include && ln -sf arch-v32/arch arch
  67. else
  68. cd $(STAGING_TARGET_DIR)/usr/include && ln -sf arch-v10/arch arch
  69. endif
  70. endif
  71. @-find $(STAGING_TARGET_DIR)/usr/include -name .install -delete
  72. @-find $(STAGING_TARGET_DIR)/usr/include -name ..install.cmd -delete
  73. touch $@
  74. include ${ADK_TOPDIR}/mk/toolchain.mk