]> git.lizzy.rs Git - rust.git/blob - src/test/run-make/issue-85019-moved-src-dir/Makefile
Auto merge of #100595 - matthiaskrgr:rollup-f1zur58, r=matthiaskrgr
[rust.git] / src / test / run-make / issue-85019-moved-src-dir / Makefile
1 include ../../run-make-fulldeps/tools.mk
2
3 INCR=$(TMPDIR)/incr
4 FIRST_SRC=$(TMPDIR)/first_src
5 SECOND_SRC=$(TMPDIR)/second_src
6
7 # ignore-none no-std is not supported
8 # ignore-nvptx64-nvidia-cuda FIXME: can't find crate for 'std'
9
10 # Tests that we don't get an ICE when the working directory
11 # (but not the build directory!) changes between compilation
12 # sessions
13
14 all:
15         mkdir $(INCR)
16         # Build from 'FIRST_SRC'
17         mkdir $(FIRST_SRC)
18         cp my_lib.rs $(FIRST_SRC)/my_lib.rs
19         cp main.rs $(FIRST_SRC)/main.rs
20         cd $(FIRST_SRC) && \
21                 $(RUSTC) -C incremental=$(INCR) --crate-type lib my_lib.rs --target $(TARGET) && \
22                 $(RUSTC) -C incremental=$(INCR) --extern my_lib=$(TMPDIR)/libmy_lib.rlib main.rs --target $(TARGET)
23         # Build from 'SECOND_SRC', keeping the output directory and incremental directory
24         # the same
25         mv $(FIRST_SRC) $(SECOND_SRC)
26         cd $(SECOND_SRC) && \
27                 $(RUSTC) -C incremental=$(INCR) --crate-type lib my_lib.rs --target $(TARGET) && \
28                 $(RUSTC) -C incremental=$(INCR) --extern my_lib=$(TMPDIR)/libmy_lib.rlib main.rs --target $(TARGET)