Makefile 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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 ${ADK_TOPDIR}/toolchain/gcc/Makefile.inc
  5. PKG_NAME:= gcc
  6. PKG_DESCR:= c compiler
  7. PKG_SECTION:= dev/lang
  8. PKG_OPTS:= noremove
  9. PKG_DEPENDS:= libmpc libgmp mpfr
  10. PKG_BUILDDEP:= libmpc gmp mpfr
  11. PKG_NEEDS:= c++
  12. PKG_SUBPKGS:= GCC GXX
  13. PKGSD_GXX:= c++ compiler
  14. WRKBUILD= ${WRKDIR}/${PKG_NAME}-obj
  15. include ${ADK_TOPDIR}/mk/package.mk
  16. $(eval $(call PKG_template,GCC,gcc,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  17. $(eval $(call PKG_template,GXX,g++,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  18. CPPFLAGS_FOR_BUILD:= -I$(STAGING_HOST_DIR)/usr/include
  19. CFLAGS_FOR_BUILD:=
  20. LDFLAGS_FOR_BUILD:=
  21. TARGET_CPPFLAGS:=
  22. TARGET_CFLAGS:=
  23. TARGET_LDFLAGS:=
  24. TARGET_CXXFLAGS:=
  25. ifeq ($(ADK_TARGET_SYSTEM_LEMOTE_YEELONG),y)
  26. CONFIGURE_ARGS+= --with-abi=$(ADK_TARGET_MIPS_ABI)
  27. endif
  28. ifeq ($(ADK_TARGET_SYSTEM_QEMU_MIPS64),y)
  29. CONFIGURE_ARGS+= --with-abi=$(ADK_TARGET_MIPS_ABI)
  30. endif
  31. ifeq ($(ADK_TARGET_SYSTEM_QEMU_MIPS64EL),y)
  32. CONFIGURE_ARGS+= --with-abi=$(ADK_TARGET_MIPS_ABI)
  33. endif
  34. ifneq ($(ADK_PACKAGE_GXX),)
  35. CONFIGURE_ARGS+= --enable-languages=c,c++
  36. else
  37. CONFIGURE_ARGS+= --enable-languages=c
  38. endif
  39. ifeq ($(ADK_TARGET_CPU_ARCH),ppc)
  40. CONFIGURE_ARGS+= --disable-target-optspace --with-long-double-64 --enable-secureplt
  41. TARGET_CFLAGS+= '-Wl,--secure-plt'
  42. else
  43. CONFIGURE_ARGS+= --enable-target-optspace
  44. endif
  45. CONFIGURE_ENV+= have_sys_sdt_h=no
  46. CONFIGURE_ARGS+= --host=$(GNU_TARGET_NAME) \
  47. --target=$(GNU_TARGET_NAME) \
  48. --build=$(GNU_HOST_NAME) \
  49. --disable-__cxa_atexit \
  50. --without-headers \
  51. --libexecdir=/usr/lib \
  52. --disable-libssp \
  53. --disable-biarch \
  54. --disable-libmudflap \
  55. --disable-libgomp \
  56. --disable-libquadmath \
  57. --disable-libquadmath-support \
  58. --disable-multilib \
  59. --disable-libstdcxx-pch \
  60. --disable-libsanitizer \
  61. --disable-libitm \
  62. --disable-install-libiberty \
  63. --enable-dependency-tracking \
  64. --enable-cxx-flags="${TARGET_LDFLAGS}"
  65. # disable honour cflags stuff
  66. XAKE_FLAGS+= GCC_HONOUR_COPTS=s
  67. pre-configure:
  68. $(SED) 's@\./fixinc\.sh@-c true@' $(WRKSRC)/gcc/Makefile.in
  69. $(SED) 's/install_to_$$(INSTALL_DEST) //' ${WRKSRC}/libiberty/Makefile.in
  70. gcc-install:
  71. ${INSTALL_DIR} ${IDIR_GCC}/usr/lib/gcc ${IDIR_GCC}/usr/bin
  72. ${INSTALL_DIR} ${IDIR_GCC}/lib
  73. ${INSTALL_BIN} ${WRKINST}/usr/bin/gcc ${IDIR_GCC}/usr/bin/
  74. cd ${IDIR_GCC}/usr/bin/ && ln -sf gcc cc
  75. ${INSTALL_BIN} ${WRKINST}/usr/bin/cpp ${IDIR_GCC}/usr/bin/
  76. cd ${IDIR_GCC}/lib && ln -sf ../usr/bin/cpp .
  77. ${CP} ${WRKINST}/usr/lib/gcc/* ${IDIR_GCC}/usr/lib/gcc/
  78. rm -rf ${IDIR_GCC}/usr/lib/gcc/*/*/install-tools
  79. g++-install:
  80. ${INSTALL_DIR} ${IDIR_GXX}/usr/bin
  81. ${INSTALL_DIR} ${IDIR_GXX}/usr/include/c++
  82. ${INSTALL_BIN} ${WRKINST}/usr/bin/g++ ${IDIR_GXX}/usr/bin/
  83. cd ${IDIR_GXX}/usr/bin/ && ln -sf g++ c++
  84. ${CP} ${WRKINST}/usr/include/c++/* ${IDIR_GXX}/usr/include/c++/
  85. include ${ADK_TOPDIR}/mk/pkg-bottom.mk