summaryrefslogtreecommitdiff
path: root/src/Makefile.am
blob: a56c45321d841cbf40f508265e2165800d78df34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
CC=gcc

CFLAGS=-g -O0

REPLIB=../target/debug/librep.dylib

all: rep.so

rs:
	cargo build

rep.so: binding.c rs $(REPLIB) helper.o big_endian.o
	$(CC) $(CFLAGS) binding.c $(REPLIB) helper.o big_endian.o -shared -export-dynamic -o $@

big_endian.o: big_endian.c big_endian.h
	$(CC) $(CFLAGS) -c $< -o $@

helper.o: helper.c helper.h big_endian.o
	$(CC) $(CFLAGS) -c helper.c -o $@

test: test.c rs ../target/debug/librep.dylib helper.o big_endian.o
	$(CC) $(CFLAGS) test.c ../target/debug/librep.dylib helper.o big_endian.o -o $@

print_forest: print_forest.c rs helper.o big_endian.o ../target/debug/librep.dylib
	$(CC) $(CFLAGS) print_forest.c ../target/debug/librep.dylib helper.o big_endian.o -o $@

.PHONY: clean rs windows

clean:
	-rm -f *.o
	-rm -f rep.so
	-rm -f test
	-rm -f print_forest
	-rm -rf *.dSYM
	cargo clean

windows:
	cargo build --target=x86_64-pc-windows-gnu