learn-rust-the-dangerous-way/Makefile
Timothy Warren 68e0f20e54 Start Part 2
2020-01-10 16:41:39 -05:00

31 lines
555 B
Makefile

target:
mkdir -p target
target/nbody.c: target
$(CC) -O3 -fomit-frame-pointer -march=native -funroll-loops \
nbody.c -o target/nbody.c -lm
target/nbody-rs:
rustc -C opt-level=3 -C target-cpu=native -C codegen-units=1 \
src/main.rs -o target/nbody-rs
build: target/nbody.c target/nbody-rs
time-build:
time make build
clean:
cargo clean
run-c: target/nbody.c
./target/nbody.c 50000000
run-rust: target/nbody-rs
./target/nbody-rs 50000000
run:
make run-c
@echo "----------------------"
make run-rust
.PHONY: run-c run