forked from Dhghomon/easy_rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (36 loc) · 1.37 KB
/
Makefile
File metadata and controls
44 lines (36 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
###############################################################################
# Make file for the Easy Rust project.
#
# Author: Alexander Willner
# License : MIT
###############################################################################
# Config
SNIPPETS = snippets
.PHONY: help snippets snippets-test book
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 on your local and start serving in browser
@./createBookFromReadme.sh
github_pages: ## Generate an mdBook version for the Github Pages
@./createGithubPagesFromReadme.sh
snippets: clean ## 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 "// ⚠️" -i "// 🚧" ## ignore snippets that contain these strings
snippets-test: snippets ## Test snippets
@for snippet in $$(ls $(SNIPPETS)/*.rs); do \
echo "File $$snippet:" ; \
rustc --out-dir "$(SNIPPETS)" $$snippet; \
done
feedback: ## Give feedback
@open https://github.com/Dhghomon/easy_rust/issues
clean: ## Cleanup
@rm -rf "$(SNIPPETS)"