Jelajahi Sumber

avoid installing stage0 gcc

previously the stage0 gcc was installed to the output location during
the build, then replaced later by the final gcc. this violates the
principles of make and simply wastes time. the stage0 gcc is usable
in-place without installing it, so we can simply do that instead.
Rich Felker 9 tahun lalu
induk
melakukan
532e13f3f7
1 mengubah file dengan 5 tambahan dan 6 penghapusan
  1. 5 6
      Makefile

+ 5 - 6
Makefile

@@ -22,7 +22,10 @@ GCC0_CONFIG = $(GCC_CONFIG) \
 	--enable-languages=c \
 	CFLAGS="-O0 -g0" CXXFLAGS="-O0 -g0"
 
-MUSL_CONFIG = CC=$(OUTPUT)/bin/$(TARGET)-gcc --prefix=
+GCC0_BDIR = $(PWD)/gcc-$(GCC_VER)/build0/gcc
+GCC0_CC = $(GCC0_BDIR)/xgcc -B $(GCC0_BDIR)
+
+MUSL_CONFIG = CC="$(GCC0_CC)" --prefix=
 
 -include config.mak
 
@@ -90,10 +93,6 @@ steps/build_gcc0: steps/configure_gcc0
 	cd gcc-$(GCC_VER)/build0 && $(MAKE)
 	touch $@
 
-steps/install_gcc0: steps/build_gcc0
-	cd gcc-$(GCC_VER)/build0 && $(MAKE) install
-	touch $@
-
 steps/configure_gcc: steps/extract_gcc
 	mkdir -p gcc-$(GCC_VER)/build
 	test -e gcc-$(GCC_VER)/build/config.status || ( cd gcc-$(GCC_VER)/build && ../configure $(GCC_CONFIG) )
@@ -115,7 +114,7 @@ steps/clone_musl:
 	test -d musl || git clone -b $(MUSL_TAG) git://git.musl-libc.org/musl musl
 	touch $@
 
-steps/configure_musl: steps/clone_musl steps/install_gcc0
+steps/configure_musl: steps/clone_musl steps/build_gcc0
 	cd musl && ./configure $(MUSL_CONFIG)
 	cat patches/musl-complex-hack >> musl/config.mak
 	touch $@