-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
devel(makefile): helping development (#36)
* devel(makefile): helping development see `makefile` header for more information * fix(makefile): improve `stop` target compatibility now should work for `make>=4.2.1`
- Loading branch information
1 parent
03eb2e0
commit 7cc8f65
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# makefile | ||
# -------- | ||
# makefile for development, rules: | ||
# + `animation` - create simple gif animation, useful to create | ||
# rustracer usage examples (`ffmpeg` needed) | ||
# + `docs` - preview `rustracer` documentation locally | ||
# + `ccov` - preview `rustracer` code-coverage html report locally | ||
|
||
animation: examples/demo | ||
|
||
examples/demo: | ||
@printf "[info] create demo gif animation ... " | ||
@mkdir -p $@/frames | ||
@for a in `seq 0 359`; do \ | ||
rustracer demo --width 320 --height 240 --angle-deg $$a $@/frames/frame-`printf '%03d' $$a`.png; done; | ||
@ffmpeg -loglevel panic -f image2 -framerate 25 -i $@/frames/frame-%03d.png $@/demo.gif | ||
@printf "done\n" | ||
|
||
docs: docs.pid | ||
ccov: ccov.pid | ||
|
||
docs.pid: | ||
@for f in `ls -1 target/doc/rustracer`; do ln -sf rustracer/$$f target/doc/$$f; done; | ||
@printf "starting http.server ... " | ||
@{ python3 -m http.server -b 127.0.0.1 -d target/doc/ 8080 >/dev/null 2>&1 \ | ||
& echo $$! >$@; } | ||
@printf "done\n" | ||
@printf "docs url: http://localhost:8080/\n" | ||
|
||
ccov.pid: | ||
@printf "starting http.server ... " | ||
@{ python3 -m http.server -b 127.0.0.1 -d target/llvm-cov/html 8081 >/dev/null 2>&1 \ | ||
& echo $$! >$@; } | ||
@printf "done\n" | ||
@printf "ccov url: http://localhost:8081/\n" | ||
|
||
stop: *.pid | ||
@printf "stopping http.server ... " | ||
@pkill -F docs.pid 2>/dev/null || exit 0 | ||
@pkill -F ccov.pid 2>/dev/null || exit 0 | ||
@rm $^ | ||
@printf "done\n" |