easy_rust/Makefile

42 lines
1.2 KiB
Makefile
Raw Normal View History

2020-07-27 13:24:10 +00:00
###############################################################################
# Make file for the Easy Rust project.
#
# Author: Alexander Willner
# License : MIT
###############################################################################
# Config
SNIPPETS = snippets
2020-07-28 20:42:00 +00:00
.PHONY: help snippets snippets-test book
2020-07-27 13:24:10 +00:00
help: ## Print help for each target
$(info Rust Makefile)
$(info =============)
$(info )
$(info Consider to use 'cargo' for other targets.)
$(info )
$(info Available commands:)
$(info )
@grep '^[[:alnum:]_-]*:.* ##' $(MAKEFILE_LIST) \
| sort | awk 'BEGIN {FS=":.* ## "}; {printf "%-25s %s\n", $$1, $$2};'
book: ## Generate an mdBook version
@./createBookFromReadme.sh
snippets: clean ## Create snippets
2020-07-27 13:24:10 +00:00
@type md2src >/dev/null 2>&1 || (echo "Run 'cargo install md2src' first." >&2 ; exit 1)
@mkdir -p $(SNIPPETS)
@md2src "README.md" "$(SNIPPETS)" -i "// ⚠️" -i "// 🚧" ## ignore snippets that contain these strings
2020-07-27 13:24:10 +00:00
snippets-test: snippets ## Test snippets
@for snippet in $$(ls $(SNIPPETS)/*.rs); do \
echo "File $$snippet:" ; \
rustc --out-dir "$(SNIPPETS)" $$snippet; \
2020-07-27 13:24:10 +00:00
done
feedback: ## Give feedback
@open https://github.com/Dhghomon/easy_rust/issues
clean: ## Cleanup
2020-07-28 20:42:00 +00:00
@rm -rf "$(SNIPPETS)"