Makefile 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. include Makefile.inc
  6. include ${TOPDIR}/mk/buildhlp.mk
  7. EGLIBC_CONFOPTS:= \
  8. --build=$(GNU_HOST_NAME) \
  9. --host=$(REAL_GNU_TARGET_NAME) \
  10. --with-headers=$(TOOLCHAIN_SYSROOT)/usr/include \
  11. --disable-nls \
  12. --without-cvs \
  13. --disable-profile \
  14. --disable-debug \
  15. --enable-kernel=2.6.0 \
  16. --without-gd \
  17. --with-__thread \
  18. --with-tls \
  19. --enable-add-ons
  20. EGLIBC_ENV:= PATH='${TARGET_PATH}' \
  21. BUILD_CC=${HOSTCC} \
  22. CFLAGS="$(TARGET_CFLAGS)" \
  23. CC=${REAL_GNU_TARGET_NAME}-gcc \
  24. CXX=${REAL_GNU_TARGET_NAME}-g++ \
  25. AR=${REAL_GNU_TARGET_NAME}-ar \
  26. RANLIB=${REAL_GNU_TARGET_NAME}-ranlib \
  27. libc_cv_forced_unwind=yes \
  28. libc_cv_c_cleanup=yes \
  29. libc_cv_gnu99_inline=yes \
  30. libc_cv_slibdir="/lib"
  31. ifeq ($(ADK_TARGET_NO_FPU),y)
  32. EGLIBC_CONFOPTS+= --without-fp
  33. endif
  34. EGLIBC_BUILD_DIR_INITIAL:= ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION)-headers
  35. EGLIBC_BUILD_DIR_FINAL:= ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION)-final
  36. $(WRKBUILD)/.headers_configure:
  37. mkdir -p $(EGLIBC_BUILD_DIR_INITIAL)
  38. (cd ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION); \
  39. ln -sf ../ports ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION)/libc);
  40. #(cd ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION)/libc; autoconf --force);
  41. $(CP) ${TOPDIR}/toolchain/eglibc/eglibc.config \
  42. $(EGLIBC_BUILD_DIR_INITIAL)
  43. (cd $(EGLIBC_BUILD_DIR_INITIAL); \
  44. ${EGLIBC_ENV} \
  45. $(WRKBUILD)/libc/configure \
  46. --prefix=$(TOOLCHAIN_SYSROOT)/usr \
  47. --with-headers=$(TOOLCHAIN_SYSROOT)/usr/include \
  48. ${EGLIBC_CONFOPTS} \
  49. );
  50. touch $@
  51. $(WRKBUILD)/.headers: $(WRKBUILD)/.headers_configure
  52. mkdir -p $(TOOLCHAIN_SYSROOT)/usr/lib
  53. PATH='${TARGET_PATH}' \
  54. $(MAKE) -C $(EGLIBC_BUILD_DIR_INITIAL) \
  55. install-headers install-bootstrap-headers=yes
  56. PATH='${TARGET_PATH}' \
  57. $(MAKE) -C $(EGLIBC_BUILD_DIR_INITIAL) \
  58. csu/subdir_lib
  59. ( cd $(EGLIBC_BUILD_DIR_INITIAL); \
  60. $(CP) csu/crt1.o csu/crti.o csu/crtn.o \
  61. $(TOOLCHAIN_SYSROOT)/usr/lib \
  62. );
  63. PATH='${TARGET_PATH}' \
  64. $(TARGET_CC) -nostdlib -nostartfiles -shared -x c /dev/null \
  65. -o $(TOOLCHAIN_SYSROOT)/usr/lib/libc.so
  66. touch $@
  67. $(WRKBUILD)/.configured:
  68. mkdir -p $(EGLIBC_BUILD_DIR_FINAL)
  69. $(CP) ${TOPDIR}/toolchain/eglibc/eglibc.config \
  70. $(EGLIBC_BUILD_DIR_FINAL)
  71. (cd $(EGLIBC_BUILD_DIR_FINAL); \
  72. ${EGLIBC_ENV} \
  73. $(WRKBUILD)/libc/configure \
  74. --prefix=/usr \
  75. --enable-shared \
  76. --enable-stackguard-randomization \
  77. ${EGLIBC_CONFOPTS} \
  78. );
  79. touch $@
  80. $(WRKBUILD)/.compiled:
  81. ${EGLIBC_ENV} $(MAKE) -C $(EGLIBC_BUILD_DIR_FINAL) all
  82. touch $@
  83. $(WRKBUILD)/.installed:
  84. ${EGLIBC_ENV} $(MAKE) -C $(EGLIBC_BUILD_DIR_FINAL) install_root=$(STAGING_DIR) install
  85. touch $@
  86. include ${TOPDIR}/mk/toolchain.mk