Skip to content

Commit da2b58f

Browse files
Port to Rust (#17) by @nabijaczleweli
1 parent cbc8374 commit da2b58f

File tree

3 files changed

+664
-8
lines changed

3 files changed

+664
-8
lines changed

ports/.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
#ignore binary
2-
gilbert
2+
gilbert-cpp
3+
gilbert-rs

ports/Makefile

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11

22
CC := gcc
3+
RUSTC := rustc
34
CFLAGS :=
45
OPT := -O3
6+
RUSTOPT := -O
57

6-
SRCFILES := gilbert.c
8+
all: gilbert-c gilbert-rs
79

8-
all: gilbert
10+
gilbert-c: gilbert.c
11+
$(CC) gilbert.c -o gilbert-c $(CFLAGS) $(OPT)
912

10-
gilbert: gilbert.c
11-
$(CC) gilbert.c -o gilbert $(CFLAGS) $(OPT)
13+
gilbert-rs: gilbert.rs
14+
$(RUSTC) --cfg 'feature="gilbert_main"' -o gilbert-rs gilbert.rs $(RUSTOPT)
1215

13-
.PHONY: clean
16+
.PHONY: clean all
1417

1518
clean:
16-
rm -f gilbert
17-
19+
rm -f gilbert-c gilbert-rs

0 commit comments

Comments
 (0)