diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..92becce --- /dev/null +++ b/Makefile | |||
@@ -0,0 +1,36 @@ | |||
1 | stack_path != which stack | ||
2 | |||
3 | all: $(if $(stack_path),,install-stack) | ||
4 | stack build | ||
5 | ln -sfT $$(stack path --local-install-root)/bin ./bin | ||
6 | |||
7 | .PHONY: all run install install-dev-tools | ||
8 | |||
9 | run: all | ||
10 | ./bin/repgoal | ||
11 | |||
12 | install: | ||
13 | stack install | ||
14 | |||
15 | install-dev-tools: | ||
16 | stack install apply-refact hlint stylish-haskell hasktags hoogle | ||
17 | |||
18 | become_root != [ "$$(id -u)" = 0 ] || echo sudo | ||
19 | install-stack: | ||
20 | ifneq (,$(shell which curl)) | ||
21 | curl -sSL https://get.haskellstack.org/ | sh | ||
22 | else | ||
23 | ifneq (,$(shell which wget)) | ||
24 | wget -qO- https://get.haskellstack.org/ | sh | ||
25 | else | ||
26 | ifneq (,$(shell which apt)) | ||
27 | $(become_root) apt install haskell-stack | ||
28 | else | ||
29 | $(error No stack binary found; and no known means of installing (no curl, wget, or apt).\ | ||
30 | Follow instructions at <https://haskellstack.org>) | ||
31 | endif | ||
32 | endif | ||
33 | endif | ||
34 | |||
35 | %.html: %.md | ||
36 | pandoc -f markdown -t html -o $@ $^ | ||