File tree Expand file tree Collapse file tree 7 files changed +76
-2
lines changed
test/run-make/dep-info-spaces Expand file tree Collapse file tree 7 files changed +76
-2
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
refs/heads/master: 74090504219e4e37c1a6d9fdd8600f44b51c7b04
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
- refs/heads/snap-stage3: 8dab56ea9d5f10924ef980f705bc864567d5b72a
4
+ refs/heads/snap-stage3: 2883b7682a06e19dcf8b669db1e34d0f4a83dc02
5
5
refs/heads/try: 14378ea357c06c23607ca61ade44f60a7a64a1c7
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
Original file line number Diff line number Diff line change @@ -615,6 +615,12 @@ pub fn stop_after_phase_5(sess: &Session) -> bool {
615
615
return false ;
616
616
}
617
617
618
+ fn escape_dep_filename ( filename : & str ) -> String {
619
+ // Apparently clang and gcc *only* escape spaces:
620
+ // http://llvm.org/klaus/clang/commit/9d50634cfc268ecc9a7250226dd5ca0e945240d4
621
+ filename. replace ( " " , "\\ " )
622
+ }
623
+
618
624
fn write_out_deps ( sess : & Session ,
619
625
input : & Input ,
620
626
outputs : & OutputFilenames ,
@@ -658,7 +664,7 @@ fn write_out_deps(sess: &Session,
658
664
// write Makefile-compatible dependency rules
659
665
let files: Vec < String > = sess. codemap ( ) . files . borrow ( )
660
666
. iter ( ) . filter ( |fmap| fmap. is_real_file ( ) )
661
- . map ( |fmap| fmap. name . to_string ( ) )
667
+ . map ( |fmap| escape_dep_filename ( fmap. name . as_slice ( ) ) )
662
668
. collect ( ) ;
663
669
let mut file = try!( io:: File :: create ( & deps_filename) ) ;
664
670
for path in out_filenames. iter ( ) {
Original file line number Diff line number Diff line change
1
+ -include ../tools.mk
2
+
3
+ # FIXME: ignore freebsd/windows
4
+ # (windows: see `../dep-info/Makefile`)
5
+ ifneq ($(shell uname) ,FreeBSD)
6
+ ifndef IS_WINDOWS
7
+ all :
8
+ $(RUSTC ) --dep-info $(TMPDIR ) /custom-deps-file.d --crate-type=lib lib.rs
9
+ sleep 1
10
+ touch ' foo foo.rs'
11
+ -rm -f $(TMPDIR ) /done
12
+ $(MAKE ) -drf Makefile.foo
13
+ rm $(TMPDIR ) /done
14
+ pwd
15
+ $(MAKE ) -drf Makefile.foo
16
+ rm $(TMPDIR ) /done && exit 1 || exit 0
17
+ else
18
+ all :
19
+
20
+ endif
21
+
22
+ else
23
+ all :
24
+
25
+ endif
Original file line number Diff line number Diff line change
1
+ LIB := $(shell $(RUSTC) --print-file-name --crate-type=lib lib.rs)
2
+
3
+ $(TMPDIR)/$(LIB):
4
+ $(RUSTC) --dep-info $(TMPDIR)/custom-deps-file.d --crate-type=lib lib.rs
5
+ touch $(TMPDIR)/done
6
+
7
+ -include $(TMPDIR)/custom-deps-file.d
Original file line number Diff line number Diff line change
1
+ // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2
+ // file at the top-level directory of this distribution and at
3
+ // http://rust-lang.org/COPYRIGHT.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6
+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8
+ // option. This file may not be copied, modified, or distributed
9
+ // except according to those terms.
10
+
11
+ pub fn bar ( ) { }
Original file line number Diff line number Diff line change
1
+ // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2
+ // file at the top-level directory of this distribution and at
3
+ // http://rust-lang.org/COPYRIGHT.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6
+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8
+ // option. This file may not be copied, modified, or distributed
9
+ // except according to those terms.
10
+
11
+ pub fn foo ( ) { }
Original file line number Diff line number Diff line change
1
+ // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2
+ // file at the top-level directory of this distribution and at
3
+ // http://rust-lang.org/COPYRIGHT.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6
+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8
+ // option. This file may not be copied, modified, or distributed
9
+ // except according to those terms.
10
+
11
+ #[ path="foo foo.rs" ]
12
+ pub mod foo;
13
+
14
+ pub mod bar;
You can’t perform that action at this time.
0 commit comments