]> git.proxmox.com Git - rustc.git/blob - tests/run-make-fulldeps/obtain-borrowck/Makefile
212d0f67d0063919f122095f889d2ddc22ea5693
[rustc.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