Makefile 2.3 KB

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