Makefile 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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 ../rules.mk
  5. # glibc does not compile with Os
  6. TARGET_CFLAGS:= $(subst Os,O2,$(TARGET_CFLAGS))
  7. ifneq ($(ADK_DEBUG),)
  8. TARGET_CFLAGS+= -O2
  9. endif
  10. # ssp partially supported
  11. TARGET_CFLAGS:= $(filter-out -fstack-protector,$(TARGET_CFLAGS))
  12. include Makefile.inc
  13. include ${TOPDIR}/mk/buildhlp.mk
  14. ifeq ($(ADK_TARGET_NO_FPU),y)
  15. GLIBC_CONFOPTS+= --without-fp
  16. endif
  17. GLIBC_MAKEOPTS+= cross-compiling=yes
  18. ifeq (${ADK_MAKE_PARALLEL},y)
  19. GLIBC_MAKEOPTS+= PARALLELMFLAGS="-j${ADK_MAKE_JOBS}"
  20. endif
  21. GLIBC_BUILD_DIR_INITIAL:= ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION)-headers
  22. GLIBC_BUILD_DIR_FINAL:= ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION)-final
  23. $(WRKBUILD)/.headers_configure:
  24. mkdir -p $(GLIBC_BUILD_DIR_INITIAL)
  25. (cd ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION); \
  26. ln -sf ../../w-glibc-ports-$(PKG_VERSION)-1/glibc-ports-$(PKG_VERSION)/ ports);
  27. (cd $(GLIBC_BUILD_DIR_INITIAL); \
  28. ${GLIBC_ENV} \
  29. $(WRKBUILD)/configure \
  30. --prefix=$(STAGING_TARGET_DIR)/usr \
  31. --with-sysroot=$(STAGING_TARGET_DIR) \
  32. ${GLIBC_CONFOPTS} \
  33. );
  34. touch $@
  35. $(WRKBUILD)/.headers: $(WRKBUILD)/.headers_configure
  36. (cd $(GLIBC_BUILD_DIR_INITIAL); \
  37. ${GLIBC_ENV} \
  38. $(MAKE) ${GLIBC_MAKEOPTS} \
  39. install-headers \
  40. );
  41. touch $(STAGING_TARGET_DIR)/usr/include/gnu/stubs.h
  42. touch $@
  43. $(WRKBUILD)/.configured:
  44. mkdir -p $(GLIBC_BUILD_DIR_FINAL)
  45. (cd $(GLIBC_BUILD_DIR_FINAL); \
  46. ${GLIBC_ENV} \
  47. $(WRKBUILD)/configure \
  48. --prefix=/usr \
  49. --enable-shared \
  50. --enable-stackguard-randomization \
  51. ${GLIBC_CONFOPTS} \
  52. );
  53. touch $@
  54. $(WRKBUILD)/.compiled:
  55. ${GLIBC_ENV} $(MAKE) ${GLIBC_MAKEOPTS} -C $(GLIBC_BUILD_DIR_FINAL) all
  56. touch $@
  57. $(WRKBUILD)/.installed:
  58. ${GLIBC_ENV} $(MAKE) -C $(GLIBC_BUILD_DIR_FINAL) \
  59. install_root=$(STAGING_TARGET_DIR) install
  60. mkdir -p ${STAGING_TARGET_DIR}/etc
  61. ${INSTALL_DATA} ${WRKBUILD}/posix/gai.conf ${STAGING_TARGET_DIR}/etc
  62. ${INSTALL_DATA} ${WRKBUILD}/nscd/nscd.conf ${STAGING_TARGET_DIR}/etc
  63. ${INSTALL_DATA} ${WRKBUILD}/nss/nsswitch.conf ${STAGING_TARGET_DIR}/etc
  64. touch $(STAGING_TARGET_DIR)/usr/include/gnu/stubs.h
  65. touch $@
  66. include ${TOPDIR}/mk/toolchain.mk