31 lines
550 B
Makefile
31 lines
550 B
Makefile
|
target:
|
||
|
mkdir -p target
|
||
|
|
||
|
target/nbody.c: target
|
||
|
clang -O3 -fomit-frame-pointer -march=native -funroll-loops \
|
||
|
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
|