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 ../target/debug/librep.dylib helper.o big_endian.o $(CC) $(CFLAGS) $+ -o $@ .PHONY: clean rs windows clean: -rm -f *.o -rm -f rep.so -rm -f test cargo clean windows: cargo build --target=x86_64-pc-windows-gnu