diff --git a/c-to-rust/Makefile b/c-to-rust/Makefile index d39910e..ea7df1d 100644 --- a/c-to-rust/Makefile +++ b/c-to-rust/Makefile @@ -1,3 +1,9 @@ +ifeq ($(shell uname),Darwin) + LDFLAGS := -Wl,-dead_strip +else + LDFLAGS := -Wl,--gc-sections -lpthread +endif + all: target/double target/double @@ -5,7 +11,7 @@ target: mkdir -p $@ target/double: target/main.o target/libdouble_input.a - $(CC) -o $@ -Wl,--gc-sections $^ -lpthread + $(CC) -o $@ $(LDFLAGS) $^ target/libdouble_input.a: src/lib.rs Cargo.toml cargo build