summary refs log tree commit diff
path: root/src/test/run-make/c-link-to-rust-staticlib/Makefile
blob: a81f19d6eb36bdf550b208c463b790cb2a0dcfc7 (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 -Z gen-crate-map
	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)