learn-rust-the-dangerous-way/Makefile

31 lines
555 B
Makefile
Raw Permalink Normal View History

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