From c3015b895254e059b163479849dfb1353929206f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20=C3=81vila=20de=20Esp=C3=ADndola?= Date: Tue, 14 Jun 2011 17:51:31 -0400 Subject: [PATCH] Apply the makefile changes again, this time fixin the driver to not produce a rustc.exe.exe. --- mk/tests.mk | 23 ++++++----------------- src/comp/driver/rustc.rs | 8 +++----- 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/mk/tests.mk b/mk/tests.mk index 79ab8d3774b..bdf175f2bda 100644 --- a/mk/tests.mk +++ b/mk/tests.mk @@ -200,15 +200,13 @@ compile-check: tidy \ @# programs, I\'ll live with the noise. -$(Q)$(CFG_DSYMUTIL) $@ -%.stage2$(X): %.stage2.o $(SREQ2) - @$(call E, link [gcc]: $@) - $(Q)gcc $(CFG_GCCISH_CFLAGS) stage3/glue.o -o $@ $< \ - -Lstage3 -Lrt rt/main.o -lrustrt -lstd -lm - @# dsymutil sometimes fails or prints a warning, but the - @# program still runs. Since it simplifies debugging other - @# programs, I\'ll live with the noise. - -$(Q)$(CFG_DSYMUTIL) $@ +%.stage2$(X): %.rs $(SREQ2) + @$(call E, compile_and_link: $@) + $(STAGE2) -o $@ $< +%.stage2$(X): %.rc $(SREQ2) + @$(call E, compile_and_link: $@) + $(STAGE2) -o $@ $< %.stage0.o: %.rc $(SREQ0) @$(call E, compile [stage0]: $@) @@ -227,15 +225,6 @@ compile-check: tidy \ @$(call E, compile [stage1]: $@) $(STAGE1) -c -o $@ $< - -%.stage2.o: %.rc $(SREQ2) - @$(call E, compile [stage2]: $@) - $(STAGE2) -c -o $@ $< - -%.stage2.o: %.rs $(SREQ2) - @$(call E, compile [stage2]: $@) - $(STAGE2) -c -o $@ $< - # Cancel the implicit .out rule in GNU make. %.out: % diff --git a/src/comp/driver/rustc.rs b/src/comp/driver/rustc.rs index 6b1a8d395ee..939c547d84d 100644 --- a/src/comp/driver/rustc.rs +++ b/src/comp/driver/rustc.rs @@ -449,7 +449,6 @@ fn main(vec[str] args) { let str stage = "-L" + binary_dir; let vec[str] gcc_args; let str prog = "gcc"; - let str exe_suffix = ""; // The invocations of gcc share some flags across platforms let vec[str] common_cflags = ["-fno-strict-aliasing", "-fPIC", @@ -459,25 +458,24 @@ fn main(vec[str] args) { alt (sess.get_targ_cfg().os) { case (session::os_win32) { - exe_suffix = ".exe"; gcc_args = common_cflags + [ "-march=i686", "-O2", glu, main, "-o", - saved_out_filename + exe_suffix, + saved_out_filename, saved_out_filename + ".o"] + common_libs; } case (session::os_macos) { gcc_args = common_cflags + [ "-arch i386", "-O0", "-m32", glu, main, "-o", - saved_out_filename + exe_suffix, + saved_out_filename, saved_out_filename + ".o"] + common_libs; } case (session::os_linux) { gcc_args = common_cflags + [ "-march=i686", "-O2", "-m32", glu, main, "-o", - saved_out_filename + exe_suffix, + saved_out_filename, saved_out_filename + ".o"] + common_libs; } }