Makefile 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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/Makefile.inc
  7. PKG_NAME:= uClibc
  8. PKG_DESCR:= embedded c library
  9. PKG_SECTION:= base/libs
  10. PKG_OPTS:= noremove nostaging noscripts
  11. PKG_SUBPKGS:= UCLIBC UCLIBC_DEV UCLIBC_TEST
  12. PKGSD_UCLIBC_DEV:= development files for uclibc
  13. PKGSC_UCLIBC_DEV:= devel
  14. PKGSD_UCLIBC_TEST:= test suite for uclibc
  15. PKGSS_UCLIBC_TEST:= make
  16. NO_DISTFILES:= 1
  17. include $(ADK_TOPDIR)/mk/package.mk
  18. $(eval $(call PKG_template,UCLIBC,uclibc,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION},${PKG_OPTS}))
  19. $(eval $(call PKG_template,UCLIBC_DEV,uclibc-dev,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_UCLIBC_DEV},${PKGSC_UCLIBC_DEV},${PKG_OPTS}))
  20. $(eval $(call PKG_template,UCLIBC_TEST,uclibc-test,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_UCLIBC_TEST},${PKGSC_UCLIBC_TEST},${PKG_OPTS}))
  21. CONFIG_STYLE:= manual
  22. BUILD_STYLE:= manual
  23. INSTALL_STYLE:= manual
  24. do-install:
  25. ${INSTALL_DIR} $(IDIR_UCLIBC)/$(ADK_TARGET_LIBC_PATH) $(IDIR_UCLIBC)/etc
  26. test -z $(ADK_RUNTIME_TIMEZONE) || \
  27. grep $(ADK_RUNTIME_TIMEZONE) ./files/tz.lst | \
  28. cut -f 2 > $(IDIR_UCLIBC)/etc/TZ
  29. ifneq ($(ADK_TARGET_USE_STATIC_LIBS)$(ADK_TARGET_UCLINUX),y)
  30. $(CP) $(STAGING_TARGET_DIR)/lib/libc.so.* $(IDIR_UCLIBC)/$(ADK_TARGET_LIBC_PATH)
  31. $(CP) $(STAGING_TARGET_DIR)/lib/libuClibc-$(PKG_VERSION).so \
  32. $(IDIR_UCLIBC)/$(ADK_TARGET_LIBC_PATH)
  33. $(CP) $(STAGING_TARGET_DIR)/lib/ld*-uClibc-$(PKG_VERSION).so \
  34. $(IDIR_UCLIBC)/$(ADK_TARGET_LIBC_PATH)
  35. $(CP) $(STAGING_TARGET_DIR)/lib/ld*-uClibc.so.* $(IDIR_UCLIBC)/$(ADK_TARGET_LIBC_PATH)
  36. -for file in libcrypt libdl libm libresolv libutil; do \
  37. $(CP) $(STAGING_TARGET_DIR)/lib/$$file.so* $(IDIR_UCLIBC)/$(ADK_TARGET_LIBC_PATH); \
  38. $(CP) $(STAGING_TARGET_DIR)/lib/$$file-$(PKG_VERSION).so \
  39. $(IDIR_UCLIBC)/$(ADK_TARGET_LIBC_PATH); \
  40. done
  41. endif
  42. uclibc-dev-install:
  43. ${INSTALL_DIR} ${IDIR_UCLIBC_DEV}/usr/lib ${IDIR_UCLIBC_DEV}/$(ADK_TARGET_LIBC_PATH)
  44. ${CP} ${STAGING_TARGET_DIR}/usr/lib/libc.so ${IDIR_UCLIBC_DEV}/usr/lib
  45. ${CP} ${STAGING_TARGET_DIR}/usr/lib/uclibc_nonshared.a ${IDIR_UCLIBC_DEV}/usr/lib
  46. ${CP} ${STAGING_TARGET_DIR}/usr/lib/crt*.o ${IDIR_UCLIBC_DEV}/usr/lib
  47. for file in libcrypt libdl libm libresolv libutil; do \
  48. cd $(IDIR_UCLIBC_DEV)/$(ADK_TARGET_LIBC_PATH); ln -sf $$file-$(PKG_VERSION).so $$file.so; \
  49. done
  50. ${KERNEL_MAKE_ENV} \
  51. $(MAKE) -C $(TOOLCHAIN_BUILD_DIR)/w-linux-$(KERNEL_VERSION)-$(KERNEL_RELEASE)/linux-$(KERNEL_VERSION) \
  52. $(KERNEL_MAKE_OPTS) \
  53. INSTALL_HDR_PATH=$(IDIR_UCLIBC_DEV)/usr \
  54. headers_install
  55. $(MAKE) -C $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/${PKG_NAME}-${PKG_VERSION} \
  56. PREFIX=$(IDIR_UCLIBC_DEV)/ \
  57. DEVEL_PREFIX=/usr/ \
  58. RUNTIME_PREFIX=$(IDIR_UCLIBC_DEV)/ \
  59. HOSTCC="$(CC_FOR_BUILD)" \
  60. CPU_CFLAGS="$(TARGET_CFLAGS)" \
  61. install_headers
  62. @find $(IDIR_UCLIBC_DEV) -name .install -exec rm {} \;
  63. @find $(IDIR_UCLIBC_DEV) -name ..install.cmd -exec rm {} \;
  64. uclibc-test-install:
  65. ${INSTALL_DIR} ${IDIR_UCLIBC_TEST}/etc
  66. echo '00:11:22:33:44:55 teeth' > ${IDIR_UCLIBC_TEST}/etc/ethers
  67. ${INSTALL_DIR} ${IDIR_UCLIBC_TEST}/opt/uclibc
  68. ${CP} $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/${PKG_NAME}-${PKG_VERSION}/test \
  69. ${IDIR_UCLIBC_TEST}/opt/uclibc
  70. ${CP} $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/${PKG_NAME}-${PKG_VERSION}/{Rules.mak,.config} \
  71. ${IDIR_UCLIBC_TEST}/opt/uclibc
  72. @find ${IDIR_UCLIBC_TEST}/opt/uclibc -name \*.o -exec rm {} \;
  73. # there is a problem with initramfs generation with the API dir. tests are disabled anyway.
  74. rm -rf ${IDIR_UCLIBC_TEST}/opt/uclibc/API
  75. include ${ADK_TOPDIR}/mk/pkg-bottom.mk