Files
rust-ffi-examples/c-to-rust/Makefile
Ehsan M.Kermani d94db2b7e2 add -ldl flag
2018-04-16 08:31:52 -07:00

24 lines
410 B
Makefile

ifeq ($(shell uname),Darwin)
LDFLAGS := -Wl,-dead_strip
else
LDFLAGS := -Wl,--gc-sections -lpthread -ldl
endif
all: target/double
target/double
target:
mkdir -p $@
target/double: target/main.o target/debug/libdouble_input.a
$(CC) -o $@ $^ $(LDFLAGS)
target/debug/libdouble_input.a: src/lib.rs Cargo.toml
cargo build
target/main.o: src/main.c | target
$(CC) -o $@ -c $<
clean:
rm -rf target