Makefile 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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
  12. PKGSD_UCLIBC_DEV:= development files for uclibc
  13. PKGSC_UCLIBC_DEV:= devel
  14. NO_DISTFILES:= 1
  15. include $(ADK_TOPDIR)/mk/package.mk
  16. $(eval $(call PKG_template,UCLIBC,uclibc,$(GIT_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION},${PKG_OPTS}))
  17. $(eval $(call PKG_template,UCLIBC_DEV,uclibc-dev,$(GIT_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_UCLIBC_DEV},${PKGSC_UCLIBC_DEV},${PKG_OPTS}))
  18. CONFIG_STYLE:= manual
  19. BUILD_STYLE:= manual
  20. INSTALL_STYLE:= manual
  21. do-install:
  22. ${INSTALL_DIR} $(IDIR_UCLIBC)/$(ADK_TARGET_LIBC_PATH) $(IDIR_UCLIBC)/etc
  23. test -z $(ADK_RUNTIME_TIMEZONE) || \
  24. grep $(ADK_RUNTIME_TIMEZONE) ./files/tz.lst | \
  25. cut -f 2 > $(IDIR_UCLIBC)/etc/TZ
  26. ifneq ($(ADK_TARGET_USE_STATIC_LIBS),y)
  27. $(CP) $(STAGING_TARGET_DIR)/lib/libc.so.* $(IDIR_UCLIBC)/$(ADK_TARGET_LIBC_PATH)
  28. $(CP) $(STAGING_TARGET_DIR)/lib/libuClibc-$(GIT_VERSION).so \
  29. $(IDIR_UCLIBC)/$(ADK_TARGET_LIBC_PATH)
  30. $(CP) $(STAGING_TARGET_DIR)/lib/ld*-uClibc-$(GIT_VERSION).so \
  31. $(IDIR_UCLIBC)/$(ADK_TARGET_LIBC_PATH)
  32. $(CP) $(STAGING_TARGET_DIR)/lib/ld*-uClibc.so.* $(IDIR_UCLIBC)/$(ADK_TARGET_LIBC_PATH)
  33. -for file in libcrypt libdl libm libresolv libutil; do \
  34. $(CP) $(STAGING_TARGET_DIR)/lib/$$file.so* $(IDIR_UCLIBC)/$(ADK_TARGET_LIBC_PATH); \
  35. $(CP) $(STAGING_TARGET_DIR)/lib/$$file-$(GIT_VERSION).so \
  36. $(IDIR_UCLIBC)/$(ADK_TARGET_LIBC_PATH); \
  37. done
  38. endif
  39. uclibc-dev-install:
  40. ${INSTALL_DIR} ${IDIR_UCLIBC_DEV}/usr/lib ${IDIR_UCLIBC_DEV}/$(ADK_TARGET_LIBC_PATH)
  41. ${CP} ${STAGING_TARGET_DIR}/usr/lib/libc.so ${IDIR_UCLIBC_DEV}/usr/lib
  42. ${CP} ${STAGING_TARGET_DIR}/usr/lib/uclibc_nonshared.a ${IDIR_UCLIBC_DEV}/usr/lib
  43. ${CP} ${STAGING_TARGET_DIR}/usr/lib/crt*.o ${IDIR_UCLIBC_DEV}/usr/lib
  44. for file in libcrypt libdl libm libresolv libutil; do \
  45. cd $(IDIR_UCLIBC_DEV)/$(ADK_TARGET_LIBC_PATH); ln -sf $$file-$(GIT_VERSION).so $$file.so; \
  46. done
  47. ${KERNEL_MAKE_ENV} \
  48. $(MAKE) -C $(TOOLCHAIN_BUILD_DIR)/w-linux-$(KERNEL_VERSION)-$(KERNEL_RELEASE)/linux-$(KERNEL_VERSION) \
  49. $(KERNEL_MAKE_OPTS) \
  50. INSTALL_HDR_PATH=$(IDIR_UCLIBC_DEV)/usr \
  51. headers_install
  52. $(MAKE) -C $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/${PKG_NAME}-${PKG_VERSION} \
  53. PREFIX=$(IDIR_UCLIBC_DEV)/ \
  54. DEVEL_PREFIX=/usr/ \
  55. RUNTIME_PREFIX=$(IDIR_UCLIBC_DEV)/ \
  56. HOSTCC="$(CC_FOR_BUILD)" \
  57. CPU_CFLAGS="$(TARGET_CFLAGS)" \
  58. install_headers
  59. @find $(IDIR_UCLIBC_DEV) -name .install -exec rm {} \;
  60. @find $(IDIR_UCLIBC_DEV) -name ..install.cmd -exec rm {} \;
  61. include ${ADK_TOPDIR}/mk/pkg-bottom.mk