forked from ZcashFoundation/zips
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
39 lines (30 loc) · 1.1 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
# Dependencies:
# sudo apt-get install python-pip
# sudo pip install rst2html5
.PHONY: all all-zips protocol
all-zips: .Makefile.uptodate
find . -name 'zip-*.rst' |sort >.zipfilelist.new
diff .zipfilelist.current .zipfilelist.new || cp -f .zipfilelist.new .zipfilelist.current
rm -f .zipfilelist.new
$(MAKE) README.rst
$(MAKE) index.html $(addsuffix .html,$(filter-out README,$(basename $(wildcard *.rst))))
all: all-zips protocol
protocol: .Makefile.uptodate
$(MAKE) -C protocol
.Makefile.uptodate: Makefile
$(MAKE) clean
touch .Makefile.uptodate
define PROCESSRST
$(eval TITLE := $(shell echo '$(basename $<)' | sed -E 's|zip-0{0,3}|ZIP |'): $(shell grep -E '^(\.\.)?\s*Title:' $< |sed -E 's|.*Title:\s*||'))
rst2html5 -v --title="$(TITLE)" $< >$@
./edithtml.sh $@
endef
index.html: README.rst edithtml.sh
$(PROCESSRST)
%.html: %.rst edithtml.sh
$(PROCESSRST)
README.rst: .zipfilelist.current makeindex.sh README.template $(wildcard zip-*.rst)
./makeindex.sh | cat README.template - >README.rst
.PHONY: clean
clean:
rm -f .zipfilelist.* README.rst index.html $(addsuffix .html,$(basename $(wildcard *.rst)))