blob: ce87a534a5f9bd4c9cdd5ee0aff4dc368873552f (
plain)
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
45
46
47
48
49
50
51
52
53
54
|
stack_path != which stack
binout = ./bin/countdown
all: $(if $(stack_path),,install-stack)
stack build
ln -sfT $$(stack path --local-install-root)/bin ./bin
.PHONY: all run install install-dev-tools deploy
install:
stack install
$(binout): install
run: all
$(binout)
install-dev-tools:
stack install apply-refact hlint stylish-haskell hasktags hoogle
become_root != [ "$$(id -u)" = 0 ] || echo sudo
install-stack:
ifneq (,$(shell which curl))
curl -sSL https://get.haskellstack.org/ | sh
else
ifneq (,$(shell which wget))
wget -qO- https://get.haskellstack.org/ | sh
else
ifneq (,$(shell which apt))
$(become_root) apt install haskell-stack
else
$(error No stack binary found; and no known means of installing (no curl, wget, or apt).\
Follow instructions at <https://haskellstack.org>)
endif
endif
endif
define prompt_user
@bash -c \
'read -p $(1) && printf "%s\n" "$${REPLY}" > "$$1"' \
bash \
"$@"
endef
deploy-target.url:
$(call prompt_user, "Enter deploy target rsync URL: ")
deploy: $(binout) deploy-target.url
@read target < deploy-target.url && set -x && \
rsync -i4zaP $(binout) "$$target"
%.html: %.md
pandoc -f markdown -t html -o $@ $^
|