1
0

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