]> git.lizzy.rs Git - rust.git/blob - tests/run-make-fulldeps/obtain-borrowck/Makefile
Rollup merge of #105784 - yanns:update_stdarch, r=Amanieu
[rust.git] / tests / run-make-fulldeps / obtain-borrowck / Makefile
1 include ../tools.mk
2
3 # This example shows how to implement a rustc driver that retrieves MIR bodies
4 # together with the borrow checker information.
5
6 # How to run this
7 # $ ./x.py test tests/run-make-fulldeps/obtain-borrowck
8
9 DRIVER_BINARY := "$(TMPDIR)"/driver
10 SYSROOT := $(shell $(RUSTC) --print sysroot)
11
12 ifdef IS_WINDOWS
13 LIBSTD := -L "$(SYSROOT)\\lib\\rustlib\\$(TARGET)\\lib"
14 else
15 LIBSTD :=
16 endif
17
18 all:
19         $(RUSTC) driver.rs -o "$(DRIVER_BINARY)"
20         $(TARGET_RPATH_ENV) "$(DRIVER_BINARY)" --sysroot $(SYSROOT) $(LIBSTD) test.rs -o "$(TMPDIR)/driver_test" > "$(TMPDIR)"/output.stdout
21
22 ifdef RUSTC_BLESS_TEST
23         cp "$(TMPDIR)"/output.stdout output.stdout
24 else
25         $(DIFF) output.stdout "$(TMPDIR)"/output.stdout
26 endif