Makefile 4.2 KB

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