summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile26
1 files changed, 22 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 0ac7a36..ce87a53 100644
--- a/Makefile
+++ b/Makefile
@@ -1,17 +1,21 @@
1stack_path != which stack 1stack_path != which stack
2 2
3binout = ./bin/countdown
4
3all: $(if $(stack_path),,install-stack) 5all: $(if $(stack_path),,install-stack)
4 stack build 6 stack build
5 ln -sfT $$(stack path --local-install-root)/bin ./bin 7 ln -sfT $$(stack path --local-install-root)/bin ./bin
6 8
7.PHONY: all run install install-dev-tools 9.PHONY: all run install install-dev-tools deploy
8
9run: all
10 ./bin/countdown
11 10
12install: 11install:
13 stack install 12 stack install
14 13
14$(binout): install
15
16run: all
17 $(binout)
18
15install-dev-tools: 19install-dev-tools:
16 stack install apply-refact hlint stylish-haskell hasktags hoogle 20 stack install apply-refact hlint stylish-haskell hasktags hoogle
17 21
@@ -32,5 +36,19 @@ endif
32endif 36endif
33endif 37endif
34 38
39define prompt_user
40@bash -c \
41 'read -p $(1) && printf "%s\n" "$${REPLY}" > "$$1"' \
42 bash \
43 "$@"
44endef
45
46deploy-target.url:
47 $(call prompt_user, "Enter deploy target rsync URL: ")
48
49deploy: $(binout) deploy-target.url
50 @read target < deploy-target.url && set -x && \
51 rsync -i4zaP $(binout) "$$target"
52
35%.html: %.md 53%.html: %.md
36 pandoc -f markdown -t html -o $@ $^ 54 pandoc -f markdown -t html -o $@ $^