summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2023-09-02 12:39:26 -0400
committerAndrew Cady <d@jerkface.net>2023-11-12 09:31:58 -0500
commit2716a8b95ab1b68932bcaa816bae2cf12b56bb17 (patch)
treefa590b6a056736b16cb61e1124fa00ebdb6aa77f
parentf88cbb76415413db81575fb382a1768819e8a8fd (diff)
make deploy target
-rw-r--r--.gitignore1
-rw-r--r--Makefile26
2 files changed, 23 insertions, 4 deletions
diff --git a/.gitignore b/.gitignore
index ce686fd..6eb9d4d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,4 @@
2stack.yaml.lock 2stack.yaml.lock
3cosmic-countdown.cabal 3cosmic-countdown.cabal
4bin 4bin
5deploy-target.url
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 $@ $^