summary refs log tree commit diff
path: root/src/test/run-make/c-link-to-rust-staticlib/Makefile
blob: 134d15f37aa7e3007dbce62827880aa86bdd6c3b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
-include ../tools.mk

ifneq ($(shell uname),Darwin)
	EXTRAFLAGS := -lm -lrt -ldl -lpthread
endif

all:
	$(RUSTC) foo.rs
	ln -s $(call STATICLIB,foo-*) $(call STATICLIB,foo)
	$(CC) bar.c -lfoo -o $(call RUN,bar) $(EXTRAFLAGS) -lstdc++
	$(call RUN,bar)
	rm $(call STATICLIB,foo*)
	$(call RUN,bar)