learn-rust-the-dangerous-way/Makefile

31 lines
550 B
Makefile
Raw Normal View History

2020-01-10 16:16:41 -05:00
target:
mkdir -p target
target/nbody.c: target
2020-01-10 16:17:42 -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
target/nbody-1:
rustc -C opt-level=3 -C target-cpu=native -C codegen-units=1 \
src/main.rs -o target/nbody-1
build: target/nbody.c target/nbody-1
time-build:
time make build
clean:
cargo clean
run-c: target/nbody.c
./target/nbody.c 50000000
run-rust: target/nbody-1
./target/nbody-1 50000000
run:
make run-c
@echo "----------------------"
make run-rust
.PHONY: run-c run