File tree Expand file tree Collapse file tree 3 files changed +11
-5
lines changed Expand file tree Collapse file tree 3 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 55ifneq ($(shell uname) ,FreeBSD)
66ifndef IS_WINDOWS
77all :
8- $(RUSTC ) --emit link,dep-info --crate-type=lib lib.rs
8+ cp lib.rs $(TMPDIR ) /
9+ cp ' foo foo.rs' $(TMPDIR ) /
10+ cp bar.rs $(TMPDIR ) /
11+ $(RUSTC ) --emit link,dep-info --crate-type=lib $(TMPDIR ) /lib.rs
912 sleep 1
10- touch ' foo foo.rs'
13+ touch $( TMPDIR ) / ' foo foo.rs'
1114 -rm -f $(TMPDIR ) /done
1215 $(MAKE ) -drf Makefile.foo
1316 rm $(TMPDIR ) /done
Original file line number Diff line number Diff line change 1- LIB := $(shell $(RUSTC) --print file-names --crate-type=lib lib.rs)
1+ LIB := $(shell $(RUSTC) --print file-names --crate-type=lib $(TMPDIR)/ lib.rs)
22
33$(TMPDIR)/$(LIB):
4- $(RUSTC) --emit link,dep-info --crate-type=lib lib.rs
4+ $(RUSTC) --emit link,dep-info --crate-type=lib $(TMPDIR)/ lib.rs
55 touch $(TMPDIR)/done
66
77-include $(TMPDIR)/lib.d
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ use rustc_driver::driver::CompileController;
2222use rustc_trans:: ModuleSource ;
2323use rustc:: session:: Session ;
2424use syntax:: codemap:: FileLoader ;
25+ use std:: env;
2526use std:: io;
2627use std:: path:: { PathBuf , Path } ;
2728
@@ -75,9 +76,11 @@ fn main() {
7576 path. pop ( ) ;
7677 path. pop ( ) ;
7778
78- let args: Vec < String > =
79+ let mut args: Vec < String > =
7980 format ! ( "_ _ --sysroot {} --crate-type dylib" , path. to_str( ) . unwrap( ) )
8081 . split ( ' ' ) . map ( |s| s. to_string ( ) ) . collect ( ) ;
82+ args. push ( "--out-dir" . to_string ( ) ) ;
83+ args. push ( env:: var ( "TMPDIR" ) . unwrap ( ) ) ;
8184
8285 let ( result, _) = rustc_driver:: run_compiler (
8386 & args, & mut JitCalls , Some ( box JitLoader ) , None ) ;
You can’t perform that action at this time.
0 commit comments