-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
58 lines (45 loc) · 1.31 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Patterned after Rust-Empty <https://github.com/bvssvni/rust-empty>, MIT License.
SHELL := /bin/bash
DEFAULT = make help
PROTOCOL_FILES = protocol/protocol.html
all:
$(DEFAULT)
help:
clear \
&& echo "make help - This help" \
&& echo "make protocol - Protocol HTML files" \
&& echo "make deploy - Deploy to GitHub" \
&& echo "make clean - Deletes builds and documentation"
.PHONY: clean
.SUFFIXES: .html .markdown
.markdown.html:
echo $<
cd $$(dirname $<) && pandoc -s $$(basename $<) --toc --self-contained -t html5 -o $$(basename $@) -c buttondown.min.css
protocol: $(PROTOCOL_FILES)
build:
mkdir -p build
build/protocol:
mkdir -p build/protocol
stage: protocol | build/ build/protocol
cp -R css js fonts img index.html *.json build
cp "$(PROTOCOL_FILES)" protocol/fish_example.jpg build/protocol
deploy: stage | build/
( \
test -e build/.git \
&& echo "--- There is already a .git directory in build/" \
) \
|| \
( \
cd build/ \
&& git init . \
&& git add . \
&& touch .nojekyll \
&& git commit -m 'Deploy' \
&& git push 'git@github.com:jonchang/eol-mturk-landmark.git' master:gh-pages --force \
&& rm -rf .git \
&& echo "Pushed to:" \
&& echo " http://jonchang.github.io/eol-mturk-landmark/" \
)
clean:
rm -f protocol/protocol.html
rm -rf build