Makefile 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. GCC_VARIANT:=minimal
  2. include ../common.mk
  3. GCC_CONFIGURE += \
  4. --with-newlib \
  5. --without-headers \
  6. --enable-languages=c \
  7. --disable-libsanitizer \
  8. --disable-libssp \
  9. --disable-shared \
  10. --disable-threads
  11. define Host/SetToolchainInfo
  12. $(SED) 's,TARGET_CROSS=.*,TARGET_CROSS=$(REAL_GNU_TARGET_NAME)-,' $(TOOLCHAIN_DIR)/info.mk
  13. $(SED) 's,GCC_VERSION=.*,GCC_VERSION=$(GCC_VERSION),' $(TOOLCHAIN_DIR)/info.mk
  14. endef
  15. define Host/Prepare
  16. $(call Host/SetToolchainInfo)
  17. $(call Host/Prepare/Default)
  18. ln -snf $(GCC_DIR) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
  19. $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(HOST_BUILD_DIR)/
  20. $(SED) 's,^MULTILIB_OSDIRNAMES,# MULTILIB_OSDIRNAMES,' $(HOST_BUILD_DIR)/gcc/config/*/t-*
  21. $(SED) 'd' $(HOST_BUILD_DIR)/gcc/DEV-PHASE
  22. $(SED) 's, DATESTAMP,,' $(HOST_BUILD_DIR)/gcc/version.c
  23. #(cd $(HOST_BUILD_DIR)/libstdc++-v3; autoconf;);
  24. $(SED) 's,gcc_no_link=yes,gcc_no_link=no,' $(HOST_BUILD_DIR)/libstdc++-v3/configure
  25. mkdir -p $(GCC_BUILD_DIR)
  26. endef
  27. define Host/Compile
  28. +$(GCC_MAKE) $(HOST_JOBS) -C $(GCC_BUILD_DIR) all-gcc all-target-libgcc
  29. endef
  30. define Host/Install
  31. $(GCC_MAKE) -C $(GCC_BUILD_DIR) install-gcc install-target-libgcc
  32. endef
  33. define Host/Clean
  34. rm -rf \
  35. $(HOST_BUILD_DIR) \
  36. $(GCC_BUILD_DIR)
  37. endef
  38. $(eval $(call HostBuild))