-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
43 lines (34 loc) · 950 Bytes
/
Makefile
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
.PHONY: build
build: target/release/hatter
.PHONY: test
test:
@cargo test --features repl
.PHONY: fast-test
fast-test:
@cargo test
.PHONY: repl
repl:
@cargo run -q --features repl -- repl
.PHONY: docs
docs: target/release/hatter docs/index.hat
@cargo run -q --release docs/index.hat > docs/index.html
.PHONY: check
check:
@(which -s pulldown-cmark) || (echo "Need pulldown-cmark installed\nRun: cargo install pulldown-cmark"; exit 1)
@(which -s serve) || (echo "Need serve installed"; exit 1)
@(which -s fswatch) || (echo "Need fswatch installed"; exit 1)
@(which -s fish) || (echo "Need fish shell installed"; exit 1)
.PHONY: serve
serve: docs check
@serve -r docs/
.PHONY: watch
watch: docs check
@make serve &
@open 'http://localhost:5000/'
@fish -c 'while true; fswatch -1 docs/*.hat || break && make docs; end'
.PHONY: clean
clean:
rm -rf target
target/release/hatter: src/*.rs src/**/*.rs
cargo build --release
strip $@