-
Notifications
You must be signed in to change notification settings - Fork 30
/
Makefile
36 lines (28 loc) · 1.08 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# ignore-cross-compile
include ../tools.mk
# Test mixing pathless --extern with paths.
# Test for static linking by checking that the binary runs if the dylib
# is removed and test for dynamic linking by checking that the binary
# fails to run if the dylib is removed.
all:
$(RUSTC) bar.rs --crate-type=rlib --crate-type=dylib -Cprefer-dynamic
# rlib preferred over dylib
$(RUSTC) foo.rs --extern bar
mv $(call DYLIB,bar) $(TMPDIR)/bar.tmp
$(call RUN,foo)
mv $(TMPDIR)/bar.tmp $(call DYLIB,bar)
$(RUSTC) foo.rs --extern bar=$(TMPDIR)/libbar.rlib --extern bar
mv $(call DYLIB,bar) $(TMPDIR)/bar.tmp
$(call RUN,foo)
mv $(TMPDIR)/bar.tmp $(call DYLIB,bar)
# explicit --extern overrides pathless
$(RUSTC) foo.rs --extern bar=$(call DYLIB,bar) --extern bar
mv $(call DYLIB,bar) $(TMPDIR)/bar.tmp
$(call FAIL,foo)
mv $(TMPDIR)/bar.tmp $(call DYLIB,bar)
# prefer-dynamic does what it says
$(RUSTC) foo.rs --extern bar -C prefer-dynamic
mv $(call DYLIB,bar) $(TMPDIR)/bar.tmp
$(call FAIL,foo)
mv $(TMPDIR)/bar.tmp $(call DYLIB,bar)
# ferrocene-annotations: um_rustc_C_prefer_dynamic