projects
/
learn-rust.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Call Rust function from C: Skeleton
[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