1
0

Makefile 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 $(TOPDIR)/rules.mk
  4. include $(TOPDIR)/toolchain/uClibc/Makefile.inc
  5. PKG_DESCR:= embedded C library
  6. PKG_SECTION:= base
  7. PKG_OPTS:= noremove
  8. PKG_SUBPKGS:= UCLIBC UCLIBC_DEV
  9. PKGSD_UCLIBC_DEV:= development files for uclibc
  10. PKGSC_UCLIBC_DEV:= devel
  11. NO_DISTFILES:= 1
  12. include $(TOPDIR)/mk/package.mk
  13. $(eval $(call PKG_template,UCLIBC,uclibc,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION},${PKG_OPTS}))
  14. $(eval $(call PKG_template,UCLIBC_DEV,uclibc-dev,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_UCLIBC_DEV},${PKGSC_UCLIBC_DEV},${PKG_OPTS}))
  15. CONFIG_STYLE:= manual
  16. BUILD_STYLE:= manual
  17. INSTALL_STYLE:= manual
  18. # do nothing, uClibc is already build in toolchain directory
  19. do-install:
  20. ${INSTALL_DIR} $(IDIR_UCLIBC)/lib $(IDIR_UCLIBC)/etc
  21. # create timezone file
  22. test -z $(ADK_RUNTIME_TIMEZONE) || \
  23. grep $(ADK_RUNTIME_TIMEZONE) ./files/tz.lst | \
  24. cut -f 2 > $(IDIR_UCLIBC)/etc/TZ
  25. ifeq ($(ADK_TOOLCHAIN_GCC_USE_SSP),y)
  26. $(CP) $(STAGING_TARGET_DIR)/lib/libssp.so* $(IDIR_UCLIBC)/lib
  27. endif
  28. $(CP) $(STAGING_TARGET_DIR)/lib/libc.so.* $(IDIR_UCLIBC)/lib
  29. $(CP) $(STAGING_TARGET_DIR)/lib/libuClibc-$(PKG_VERSION).so \
  30. $(IDIR_UCLIBC)/lib
  31. $(CP) $(STAGING_TARGET_DIR)/lib/ld*-uClibc-$(PKG_VERSION).so \
  32. $(IDIR_UCLIBC)/lib
  33. $(CP) $(STAGING_TARGET_DIR)/lib/ld*-uClibc.so.* $(IDIR_UCLIBC)/lib
  34. -for file in libcrypt libdl libm libresolv librt libutil; do \
  35. $(CP) $(STAGING_TARGET_DIR)/lib/$$file.so* $(IDIR_UCLIBC)/lib; \
  36. $(CP) $(STAGING_TARGET_DIR)/lib/$$file-$(PKG_VERSION).so \
  37. $(IDIR_UCLIBC)/lib; \
  38. done
  39. uclibc-dev-install:
  40. ${INSTALL_DIR} ${IDIR_UCLIBC_DEV}/usr/lib
  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* ${IDIR_UCLIBC_DEV}/usr/lib
  44. -for file in libc libcrypt libdl libm libresolv librt libutil; do \
  45. cd $(IDIR_UCLIBC_DEV)/lib/; ln -sf $$file-$(PKG_VERSION).so $$file.so; \
  46. done
  47. $(MAKE) -C $(TOOLCHAIN_BUILD_DIR)/w-linux-$(KERNEL_VERSION)-$(KERNEL_RELEASE)/linux-$(KERNEL_VERSION) ARCH=$(ARCH) V=1 \
  48. INSTALL_HDR_PATH=$(IDIR_UCLIBC_DEV)/usr \
  49. headers_install
  50. $(MAKE) -C $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/${PKG_NAME}-${PKG_VERSION} \
  51. PREFIX=$(IDIR_UCLIBC_DEV)/ \
  52. DEVEL_PREFIX=/usr/ \
  53. RUNTIME_PREFIX=$(IDIR_UCLIBC_DEV)/ \
  54. HOSTCC="$(CC_FOR_BUILD)" \
  55. CPU_CFLAGS="$(TARGET_CFLAGS)" \
  56. install_headers
  57. @find $(IDIR_UCLIBC_DEV) -name .install -exec rm {} \;
  58. @find $(IDIR_UCLIBC_DEV) -name ..install.cmd -exec rm {} \;
  59. include ${TOPDIR}/mk/pkg-bottom.mk