Rust-Programming-Cookbook/Chapter08/c-to-rust/Makefile

24 wiersze
405 B
Makefile
Czysty Zwykły widok Historia

2017-07-31 06:59:18 +00:00
ifeq ($(shell uname),Darwin)
LDFLAGS := -Wl,-dead_strip
else
LDFLAGS := -Wl,--gc-sections -lpthread
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