Makefile 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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 $(TOPDIR)/rules.mk
  4. include $(TOPDIR)/mk/kernel-ver.mk
  5. include $(TOPDIR)/mk/kernel-vars.mk
  6. include $(TOPDIR)/toolchain/musl/Makefile.inc
  7. PKG_NAME:= musl
  8. PKG_DESCR:= embedded C library
  9. PKG_SECTION:= base/libs
  10. PKG_OPTS:= noremove nostaging noscripts
  11. PKG_SUBPKGS:= MUSL MUSL_DEV
  12. PKGSD_MUSL_DEV:= development files for musl
  13. PKGSC_MUSL_DEV:= dev/header
  14. NO_DISTFILES:= 1
  15. include $(TOPDIR)/mk/package.mk
  16. $(eval $(call PKG_template,MUSL,musl,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION},${PKG_OPTS}))
  17. $(eval $(call PKG_template,MUSL_DEV,musl-dev,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_MUSL_DEV},${PKGSC_MUSL_DEV},${PKG_OPTS}))
  18. CONFIG_STYLE:= manual
  19. BUILD_STYLE:= manual
  20. INSTALL_STYLE:= manual
  21. MARCH:= $(ADK_TARGET_CPU_ARCH)
  22. ifeq ($(ADK_TARGET_CPU_ARCH),i686)
  23. MARCH:= i386
  24. endif
  25. ifeq ($(ADK_TARGET_CPU_ARCH),i586)
  26. MARCH:= i386
  27. endif
  28. ifeq ($(ADK_TARGET_CPU_ARCH),i486)
  29. MARCH:= i386
  30. endif
  31. ifeq ($(ADK_TARGET_CPU_ARCH),ppc)
  32. MARCH:= powerpc
  33. endif
  34. ifeq ($(ADK_TARGET_CPU_ARCH),sh4)
  35. MARCH:= sh
  36. endif
  37. ifeq ($(ADK_TARGET_CPU_ARCH),sh4eb)
  38. MARCH:= sheb
  39. endif
  40. ifeq ($(ADK_LINUX_ARM),y)
  41. ifeq ($(ADK_TARGET_ABI),eabihf)
  42. MARCH:= armhf
  43. endif
  44. endif
  45. ifeq ($(ADK_TARGET_ABI_X32),y)
  46. MARCH:= x32
  47. endif
  48. # do nothing, musl is already build in toolchain directory
  49. do-install:
  50. ifneq ($(ADK_TARGET_USE_STATIC_LIBS),y)
  51. ${INSTALL_DIR} $(IDIR_MUSL)/bin
  52. ${INSTALL_DIR} $(IDIR_MUSL)/$(ADK_TARGET_LIBC_PATH)
  53. $(CP) $(STAGING_TARGET_DIR)/usr/lib/libc.so $(IDIR_MUSL)/$(ADK_TARGET_LIBC_PATH)
  54. (cd $(IDIR_MUSL)/$(ADK_TARGET_LIBC_PATH) && \
  55. ln -sf libc.so ld-musl-$(MARCH).so.1)
  56. (cd $(IDIR_MUSL)/bin && \
  57. ln -sf ../lib/ld-musl-$(MARCH).so.1 ldd)
  58. endif
  59. musl-dev-install:
  60. ${INSTALL_DIR} ${IDIR_MUSL_DEV}/usr/lib
  61. ${CP} ${STAGING_TARGET_DIR}/usr/lib/crt*.o ${IDIR_MUSL_DEV}/usr/lib
  62. ${KERNEL_MAKE_ENV} \
  63. $(MAKE) -C $(TOOLCHAIN_BUILD_DIR)/w-linux-$(KERNEL_VERSION)-$(KERNEL_RELEASE)/linux-$(KERNEL_VERSION) \
  64. $(KERNEL_MAKE_OPTS) \
  65. INSTALL_HDR_PATH=$(IDIR_MUSL_DEV)/usr \
  66. headers_install
  67. $(MAKE) -C $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/${PKG_NAME}-${PKG_VERSION} \
  68. DESTDIR=$(IDIR_MUSL_DEV) \
  69. install-headers
  70. @find $(IDIR_MUSL_DEV) -name .install -exec rm {} \;
  71. @find $(IDIR_MUSL_DEV) -name ..install.cmd -exec rm {} \;
  72. include ${TOPDIR}/mk/pkg-bottom.mk