mirror of
https://github.com/Dhghomon/easy_rust
synced 2024-11-05 12:00:23 +00:00
41 lines
1.2 KiB
Makefile
41 lines
1.2 KiB
Makefile
###############################################################################
|
|
# Make file for the Easy Rust project.
|
|
#
|
|
# Author: Alexander Willner
|
|
# License : MIT
|
|
###############################################################################
|
|
|
|
# Config
|
|
SNIPPETS = snippets
|
|
.PHONY: help snippets snippets-test
|
|
|
|
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: ## Create snippets
|
|
@type md2src >/dev/null 2>&1 || (echo "Run 'cargo install md2src' first." >&2 ; exit 1)
|
|
@mkdir -p $(SNIPPETS)
|
|
@md2src "README.md" "$(SNIPPETS)" -i "// This will fail"
|
|
|
|
snippets-test: snippets ## Test snippets
|
|
@for snippet in $$(ls $(SNIPPETS)/*.rs); do \
|
|
echo "File $$snippet:" ; \
|
|
rustc --out-dir "$(SNIPPETS)" $$snippet || exit 1; \
|
|
done
|
|
|
|
feedback: ## Give feedback
|
|
@open https://github.com/Dhghomon/easy_rust/issues
|
|
|
|
clean: ## Cleanup
|
|
@rm -rf "$(SNIPPETS)"
|