Makefile 2.2 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 ../rules.mk
  5. include Makefile.inc
  6. include ${ADK_TOPDIR}/mk/buildhlp.mk
  7. # glibc does not compile with Os and CPU specific FLAGS for m68k/x86_64
  8. ifeq ($(ADK_TARGET_ARCH_X86_64)$(ADK_TARGET_ARCH_M68K),y)
  9. TARGET_CFLAGS:= -O2
  10. TARGET_CXXFLAGS:= -O2
  11. endif
  12. GLIBC_CONFOPTS:= --build=$(GNU_HOST_NAME) \
  13. --host=$(GNU_TARGET_NAME) \
  14. --with-headers=$(STAGING_TARGET_DIR)/usr/include \
  15. --enable-stackguard-randomization \
  16. --disable-sanity-checks \
  17. --disable-nls \
  18. --disable-werror \
  19. --disable-nscd \
  20. --enable-shared
  21. ifeq ($(ADK_TARGET_USE_STATIC_LIBS_ONLY),y)
  22. GLIBC_CONFOPTS+= --enable-static-nss
  23. endif
  24. GLIBC_ENV:= PATH='${TARGET_PATH}' \
  25. BUILD_CC=${CC_FOR_BUILD} \
  26. CFLAGS="$(TARGET_CFLAGS)" \
  27. CXXFLAGS="$(TARGET_CXXFLAGS)" \
  28. CC="${TARGET_CC}" \
  29. CXX="${TARGET_CXX}" \
  30. AR="${TARGET_AR}" \
  31. RANLIB="${TARGET_RANLIB}" \
  32. libc_cv_gnu99_inline=yes \
  33. libc_cv_initfini_array=yes
  34. GLIBC_MAKEOPTS+= cross-compiling=yes
  35. ifeq (${ADK_MAKE_PARALLEL},y)
  36. GLIBC_MAKEOPTS+= PARALLELMFLAGS="-j$(ADK_MAKE_JOBS)"
  37. endif
  38. GLIBC_BUILD_DIR_FINAL:= ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION)-final
  39. $(WRKBUILD)/.configured:
  40. mkdir -p $(GLIBC_BUILD_DIR_FINAL)
  41. (cd $(GLIBC_BUILD_DIR_FINAL); \
  42. ${GLIBC_ENV} \
  43. $(WRKBUILD)/configure \
  44. --prefix=/usr \
  45. ${GLIBC_CONFOPTS} \
  46. );
  47. touch $@
  48. $(WRKBUILD)/.compiled:
  49. ${GLIBC_ENV} $(MAKE) ${GLIBC_MAKEOPTS} -C $(GLIBC_BUILD_DIR_FINAL) all
  50. touch $@
  51. $(WRKBUILD)/.installed:
  52. ${GLIBC_ENV} $(MAKE) -C $(GLIBC_BUILD_DIR_FINAL) install_root=$(STAGING_TARGET_DIR) install
  53. touch $(STAGING_TARGET_DIR)/usr/include/gnu/stubs.h
  54. touch $(STAGING_TARGET_DIR)/usr/include/gnu/stubs-{32,x32,64,soft,hard}.h
  55. mkdir -p ${STAGING_TARGET_DIR}/etc
  56. ${INSTALL_DATA} ${WRKBUILD}/posix/gai.conf ${STAGING_TARGET_DIR}/etc
  57. ${INSTALL_DATA} ${WRKBUILD}/nss/nsswitch.conf ${STAGING_TARGET_DIR}/etc
  58. touch $@
  59. include ${ADK_TOPDIR}/mk/toolchain.mk