Makefile 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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/$(ADK_TARGET_OS)-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
  12. PKGSD_UCLIBC_NG_DEV:= development files for uclibc-ng
  13. PKGSC_UCLIBC_NG_DEV:= devel
  14. NO_DISTFILES:= 1
  15. include $(ADK_TOPDIR)/mk/package.mk
  16. $(eval $(call PKG_template,UCLIBC_NG,uclibc-ng,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION},${PKG_OPTS}))
  17. $(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}))
  18. CONFIG_STYLE:= manual
  19. BUILD_STYLE:= manual
  20. INSTALL_STYLE:= manual
  21. uclibc-ng-install:
  22. $(INSTALL_DIR) $(IDIR_UCLIBC_NG)/$(ADK_TARGET_LIBC_PATH) $(IDIR_UCLIBC_NG)/etc
  23. -$(CP) $(STAGING_TARGET_DIR)/lib/ld*-uClibc*.so* $(IDIR_UCLIBC_NG)/$(ADK_TARGET_LIBC_PATH)
  24. -$(CP) $(STAGING_TARGET_DIR)/lib/libc.so.* $(IDIR_UCLIBC_NG)/$(ADK_TARGET_LIBC_PATH)
  25. -$(CP) $(STAGING_TARGET_DIR)/lib/libuClibc-*.so $(IDIR_UCLIBC_NG)/$(ADK_TARGET_LIBC_PATH)
  26. ifeq ($(ADK_TARGET_BINFMT_ELF)$(ADK_TARGET_WITH_MMU),y)
  27. $(CP) $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/${PKG_NAME}-${PKG_VERSION}/lib/ld*-uClibc*.so* \
  28. $(IDIR_UCLIBC_NG)/$(ADK_TARGET_LIBC_PATH)
  29. endif
  30. ifeq ($(ADK_TARGET_ARCH_CSKY),y)
  31. cd $(IDIR_UCLIBC_NG)/$(ADK_TARGET_LIBC_PATH) && \
  32. ln -sf ld-uClibc.so.0 ld.so.1
  33. endif
  34. test -z $(ADK_RUNTIME_TIMEZONE) || \
  35. grep $(ADK_RUNTIME_TIMEZONE) ./files/tz.lst | \
  36. cut -f 2 > $(IDIR_UCLIBC_NG)/etc/TZ
  37. ifeq ($(ADK_TARGET_LIBC_WITH_LOCALE),y)
  38. ${INSTALL_DIR} $(IDIR_UCLIBC_NG)/usr/bin
  39. $(INSTALL_BIN) $(STAGING_TARGET_DIR)/usr/bin/locale \
  40. $(IDIR_UCLIBC_NG)/usr/bin
  41. endif
  42. uclibc-ng-dev-install:
  43. ${INSTALL_DIR} ${IDIR_UCLIBC_NG_DEV}/usr/lib ${IDIR_UCLIBC_NG_DEV}/$(ADK_TARGET_LIBC_PATH)
  44. -${CP} ${STAGING_TARGET_DIR}/usr/lib/libc.so ${IDIR_UCLIBC_NG_DEV}/usr/lib
  45. -${CP} ${STAGING_TARGET_DIR}/usr/lib/uclibc_nonshared.a ${IDIR_UCLIBC_NG_DEV}/usr/lib
  46. ${CP} ${STAGING_TARGET_DIR}/usr/lib/crt*.o ${IDIR_UCLIBC_NG_DEV}/usr/lib
  47. ${KERNEL_MAKE} INSTALL_HDR_PATH=$(IDIR_UCLIBC_NG_DEV)/usr headers_install
  48. $(MAKE) -C $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/${PKG_NAME}-${PKG_VERSION} \
  49. PREFIX=$(IDIR_UCLIBC_NG_DEV)/ \
  50. DEVEL_PREFIX=/usr \
  51. RUNTIME_PREFIX=$(IDIR_UCLIBC_NG_DEV)/ \
  52. HOSTCC="$(CC_FOR_BUILD)" \
  53. CPU_CFLAGS="$(TARGET_CFLAGS)" \
  54. install_headers
  55. @find $(IDIR_UCLIBC_NG_DEV) -name .install -exec rm {} \;
  56. @find $(IDIR_UCLIBC_NG_DEV) -name ..install.cmd -exec rm {} \;
  57. include ${ADK_TOPDIR}/mk/pkg-bottom.mk