Makefile 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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 $(ADK_TOPDIR)/mk/kernel-ver.mk
  5. include $(ADK_TOPDIR)/mk/kernel-vars.mk
  6. include $(ADK_TOPDIR)/toolchain/uclibc-ng/Makefile.inc
  7. PKG_NAME:= uClibc-ng
  8. PKG_DESCR:= embedded c library
  9. PKG_SECTION:= base/libs
  10. PKG_OPTS:= noremove nostaging noscripts
  11. PKG_VERSION:= 1.0.0
  12. BETA:= beta3
  13. PKG_SUBPKGS:= UCLIBC_NG UCLIBC_NG_DEV UCLIBC_NG_TEST
  14. PKGSD_UCLIBC_NG_DEV:= development files for uclibc-ng
  15. PKGSC_UCLIBC_NG_DEV:= devel
  16. PKGSD_UCLIBC_NG_TEST:= test suite for uclibc-ng
  17. PKGSS_UCLIBC_NG_TEST:= make
  18. NO_DISTFILES:= 1
  19. include $(ADK_TOPDIR)/mk/package.mk
  20. $(eval $(call PKG_template,UCLIBC_NG,uclibc-ng,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION},${PKG_OPTS}))
  21. $(eval $(call PKG_template,UCLIBC_NG_DEV,uclibc-ng-dev,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_UCLIBC_NG_DEV},${PKGSC_UCLIBC_NG_DEV},${PKG_OPTS}))
  22. $(eval $(call PKG_template,UCLIBC_NG_TEST,uclibc-ng-test,$(PKG_VERSION)-${PKG_RELEASE},${PKGSS_UCLIBC_NG_TEST},${PKGSD_UCLIBC_NG_TEST},${PKG_SECTION},${PKG_OPTS}))
  23. CONFIG_STYLE:= manual
  24. BUILD_STYLE:= manual
  25. INSTALL_STYLE:= manual
  26. do-install:
  27. ${INSTALL_DIR} $(IDIR_UCLIBC_NG)/$(ADK_TARGET_LIBC_PATH) $(IDIR_UCLIBC_NG)/etc
  28. test -z $(ADK_RUNTIME_TIMEZONE) || \
  29. grep $(ADK_RUNTIME_TIMEZONE) ./files/tz.lst | \
  30. cut -f 2 > $(IDIR_UCLIBC_NG)/etc/TZ
  31. ifneq ($(ADK_TARGET_USE_STATIC_LIBS),y)
  32. $(CP) $(STAGING_TARGET_DIR)/lib/libc.so.* $(IDIR_UCLIBC_NG)/$(ADK_TARGET_LIBC_PATH)
  33. $(CP) $(STAGING_TARGET_DIR)/lib/libuClibc-$(PKG_VERSION).so \
  34. $(IDIR_UCLIBC_NG)/$(ADK_TARGET_LIBC_PATH)
  35. $(CP) $(STAGING_TARGET_DIR)/lib/ld*-uClibc-$(PKG_VERSION).so \
  36. $(IDIR_UCLIBC_NG)/$(ADK_TARGET_LIBC_PATH)
  37. $(CP) $(STAGING_TARGET_DIR)/lib/ld*-uClibc.so.* $(IDIR_UCLIBC_NG)/$(ADK_TARGET_LIBC_PATH)
  38. # backward compatible symlink
  39. test ! -f $(IDIR_UCLIBC_NG)/$(ADK_TARGET_LIBC_PATH)/ld-uClibc.so.1 || \
  40. cd $(IDIR_UCLIBC_NG)/$(ADK_TARGET_LIBC_PATH) && ln -sf ld-uClibc.so.1 ld-uClibc.so.0
  41. test ! -f $(IDIR_UCLIBC_NG)/$(ADK_TARGET_LIBC_PATH)/ld64-uClibc.so.1 || \
  42. cd $(IDIR_UCLIBC_NG)/$(ADK_TARGET_LIBC_PATH) && ln -sf ld64-uClibc.so.1 ld64-uClibc.so.0
  43. -for file in libcrypt libdl libm libresolv libutil; do \
  44. $(CP) $(STAGING_TARGET_DIR)/lib/$$file.so* $(IDIR_UCLIBC_NG)/$(ADK_TARGET_LIBC_PATH); \
  45. $(CP) $(STAGING_TARGET_DIR)/lib/$$file-$(PKG_VERSION).so \
  46. $(IDIR_UCLIBC_NG)/$(ADK_TARGET_LIBC_PATH); \
  47. done
  48. endif
  49. uclibc-ng-dev-install:
  50. ${INSTALL_DIR} ${IDIR_UCLIBC_NG_DEV}/usr/lib ${IDIR_UCLIBC_NG_DEV}/$(ADK_TARGET_LIBC_PATH)
  51. ${CP} ${STAGING_TARGET_DIR}/usr/lib/libc.so ${IDIR_UCLIBC_NG_DEV}/usr/lib
  52. ${CP} ${STAGING_TARGET_DIR}/usr/lib/uclibc_nonshared.a ${IDIR_UCLIBC_NG_DEV}/usr/lib
  53. ${CP} ${STAGING_TARGET_DIR}/usr/lib/crt*.o ${IDIR_UCLIBC_NG_DEV}/usr/lib
  54. for file in libcrypt libdl libm libresolv libutil; do \
  55. cd $(IDIR_UCLIBC_NG_DEV)/$(ADK_TARGET_LIBC_PATH); ln -sf $$file-$(PKG_VERSION).so $$file.so; \
  56. done
  57. ${KERNEL_MAKE_ENV} \
  58. $(MAKE) -C $(TOOLCHAIN_BUILD_DIR)/w-linux-$(KERNEL_VERSION)-$(KERNEL_RELEASE)/linux-$(KERNEL_VERSION) \
  59. $(KERNEL_MAKE_OPTS) \
  60. INSTALL_HDR_PATH=$(IDIR_UCLIBC_NG_DEV)/usr \
  61. headers_install
  62. $(MAKE) -C $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)$(BETA)-$(PKG_RELEASE)/${PKG_NAME}-${PKG_VERSION}$(BETA) \
  63. PREFIX=$(IDIR_UCLIBC_NG_DEV)/ \
  64. DEVEL_PREFIX=/usr/ \
  65. RUNTIME_PREFIX=$(IDIR_UCLIBC_NG_DEV)/ \
  66. HOSTCC="$(CC_FOR_BUILD)" \
  67. CPU_CFLAGS="$(TARGET_CFLAGS)" \
  68. install_headers
  69. @find $(IDIR_UCLIBC_NG_DEV) -name .install -exec rm {} \;
  70. @find $(IDIR_UCLIBC_NG_DEV) -name ..install.cmd -exec rm {} \;
  71. uclibc-ng-test-install:
  72. ${INSTALL_DIR} ${IDIR_UCLIBC_NG_TEST}/opt/uclibc-ng
  73. ${CP} $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)$(BETA)-$(PKG_RELEASE)/${PKG_NAME}-${PKG_VERSION}$(BETA)/test \
  74. ${IDIR_UCLIBC_NG_TEST}/opt/uclibc-ng
  75. ${CP} $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)$(BETA)-$(PKG_RELEASE)/${PKG_NAME}-${PKG_VERSION}$(BETA)/{Rules.mak,.config} \
  76. ${IDIR_UCLIBC_NG_TEST}/opt/uclibc-ng
  77. find ${IDIR_UCLIBC_NG_TEST}/opt/uclibc-ng -name \*.c -delete
  78. find ${IDIR_UCLIBC_NG_TEST}/opt/uclibc-ng -name \*.o -delete
  79. include ${ADK_TOPDIR}/mk/pkg-bottom.mk