-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
41 lines (31 loc) · 1 KB
/
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
# metapong makefile
# install deps, build and run
run:
stack run metapong
# build repeatedly with ghcid when files change.
ghcid:
ghcid -c 'stack ghci metapong'
# run repeatedly. Works better than run-watch
rerun:
while true; do stack run; date; sleep 1; done
# run, restarting when the executable changes. Doesn't work well (shows error, ignores input)
run-watch watch:
stack exec -- which metapong | entr -rn stack run metapong
BROWSE=open
LIVERELOADPORT=9501
LIVERELOAD=livereloadx -p $(LIVERELOADPORT) -s
# --exclude '*.html'
# Exclude html files to avoid reloading browser as every page is generated.
# A reload happens at the end when the css/js files get copied.
# Auto-rebuild site, and watch changes in a new browser window.
doc-watch:
make doc-auto &
(sleep 1; $(BROWSE) http://localhost:$(LIVERELOADPORT)/README.html) &
$(LIVERELOAD)
# Auto-rebuild html docs on any doc source file change.
doc-auto:
fd -e .md | entr make doc
# Build html docs.
doc: README.html
%.html: %.md
pandoc -s $< -o $@