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/glibc/Makefile.inc
  5. PKG_DESCR:= GNU C library
  6. PKG_SECTION:= base
  7. PKG_OPTS:= noremove
  8. PKG_SUBPKGS:= GLIBC GLIBC_DEV
  9. NO_DISTFILES:= 1
  10. include $(TOPDIR)/mk/package.mk
  11. $(eval $(call PKG_template,GLIBC,glibc,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION},${PKG_OPTS}))
  12. $(eval $(call PKG_template,GLIBC_DEV,glibc-dev,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION},${PKG_OPTS}))
  13. CONFIG_STYLE:= manual
  14. BUILD_STYLE:= manual
  15. INSTALL_STYLE:= manual
  16. SUB_INSTALLS-y:=
  17. SUB_INSTALLS-m:=
  18. SUB_INSTALLS-${ADK_PACKAGE_GLIBC_DEV}+= glibc-dev-install
  19. # compile nothing, glibc is already build in toolchain directory
  20. do-install: ${SUB_INSTALLS-m} ${SUB_INSTALLS-y}
  21. ${INSTALL_DIR} $(IDIR_GLIBC)/lib $(IDIR_GLIBC)/etc
  22. test -z $(ADK_RUNTIME_TIMEZONE) || \
  23. $(CP) /usr/share/zoneinfo/$(ADK_RUNTIME_TIMEZONE) \
  24. $(IDIR_GLIBC)/etc/localtime
  25. $(CP) $(STAGING_DIR)/lib/libgcc_s.so* $(IDIR_GLIBC)/lib/
  26. $(CP) $(STAGING_DIR)/lib/ld*.so* $(IDIR_GLIBC)/lib/
  27. -for file in libc libcrypt libdl libm libresolv librt libutil libnss_compat libnss_dns libnss_files; do \
  28. $(CP) $(STAGING_DIR)/lib/$$file.so* $(IDIR_GLIBC)/lib/; \
  29. $(CP) $(STAGING_DIR)/lib/$$file-$(PKG_VERSION).so $(IDIR_GLIBC)/lib/; \
  30. done
  31. glibc-dev-install:
  32. ${INSTALL_DIR} $(IDIR_GLIBC_DEV)/lib $(IDIR_GLIBC_DEV)/usr/lib
  33. # install linker script
  34. -cp ./files/libc.so.$(ARCH) $(IDIR_GLIBC_DEV)/usr/lib/libc.so
  35. ${CP} ${STAGING_DIR}/usr/lib/crt* ${IDIR_GLIBC_DEV}/usr/lib
  36. ${CP} ${STAGING_DIR}/usr/lib/libc_nonshared.a ${IDIR_GLIBC_DEV}/usr/lib
  37. -for file in libc libcrypt libdl libm libresolv librt libutil; do \
  38. cd $(IDIR_GLIBC_DEV)/lib/; ln -sf $$file-$(PKG_VERSION).so $$file.so; \
  39. done
  40. # header package
  41. $(MAKE) -C $(TOOLCHAIN_BUILD_DIR)/w-linux-$(KERNEL_VERSION)-$(KERNEL_RELEASE)/linux-$(KERNEL_VERSION) \
  42. HOSTCC=$(HOSTCC) ARCH=$(ARCH) V=1 \
  43. INSTALL_HDR_PATH=$(IDIR_GLIBC_DEV)/usr \
  44. headers_install
  45. (cd $(WRKBUILD); \
  46. $(GLIBC_ENV) \
  47. $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/$(PKG_NAME)-$(PKG_VERSION)/configure \
  48. --prefix=$(IDIR_GLIBC_DEV)/usr \
  49. --with-sysroot=$(IDIR_GLIBC_DEV) \
  50. ${GLIBC_CONFOPTS} \
  51. );
  52. $(GLIBC_ENV) $(MAKE) -C $(WRKBUILD) cross-compiling=yes install-headers
  53. touch $(IDIR_GLIBC_DEV)/usr/include/gnu/stubs.h
  54. touch $(IDIR_GLIBC_DEV)/usr/include/bits/stdio_lim.h
  55. # WORKAROUND: bits/syscall.h is only installed via install-others target
  56. $(CP) $(STAGING_DIR)/usr/include/bits/syscall.h \
  57. $(IDIR_GLIBC_DEV)/usr/include/bits
  58. @find $(IDIR_GLIBC_DEV) -name .install -exec rm {} \;
  59. include ${TOPDIR}/mk/pkg-bottom.mk