]> piware.de Git - learn-rust.git/blob - call-rust-from-c/Makefile
66a951a8efd5c754d7c266f2566ab478658360b6
[learn-rust.git] / call-rust-from-c / Makefile
1 RLIB = target/debug/libcall_rust_from_c.a
2
3 main: src/main.o $(RLIB)
4         $(CC) -Wall -o $@ $^
5
6 src/main.o: src/rustlib.h
7
8 src/rustlib.h: src/lib.rs
9         cbindgen --lang c --output $@
10
11 $(RLIB): src/lib.rs
12         cargo build
13
14 run: main
15         ./main
16
17 check:
18         cargo test
19
20 .PHONY: run test