summaryrefslogtreecommitdiffstats
path: root/tests/run-make/c-link-to-rust-dylib/Makefile
blob: 2763cb6ed1d73351cf7d9ec9343104d1b1dcb878 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# ignore-cross-compile
include ../tools.mk

all: $(TMPDIR)/$(call BIN,bar)
	$(call RUN,bar)
	$(call REMOVE_DYLIBS,foo)
	$(call FAIL,bar)

ifdef IS_MSVC
$(TMPDIR)/$(call BIN,bar): $(call DYLIB,foo)
	$(CC) bar.c $(TMPDIR)/foo.dll.lib $(call OUT_EXE,bar)
else
$(TMPDIR)/$(call BIN,bar): $(call DYLIB,foo)
	$(CC) bar.c -lfoo -o $(call RUN_BINFILE,bar) -L $(TMPDIR)
endif

$(call DYLIB,foo): foo.rs
	$(RUSTC) foo.rs