Makefile 2.2 KB

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