2019-08-06 05:58:27 -07:00
|
|
|
# Dependencies:
|
|
|
|
# sudo apt-get install python-pip
|
|
|
|
# sudo pip install rst2html5
|
2019-08-05 16:46:18 -07:00
|
|
|
|
2020-01-05 12:54:51 -08:00
|
|
|
.PHONY: all all-zips protocol
|
2020-03-10 09:38:14 -07:00
|
|
|
all-zips: Makefile.uptodate
|
2019-08-24 06:36:41 -07:00
|
|
|
$(MAKE) README.rst
|
2019-09-03 05:29:18 -07:00
|
|
|
$(MAKE) index.html $(addsuffix .html,$(filter-out README,$(basename $(wildcard *.rst))))
|
2019-08-24 05:56:44 -07:00
|
|
|
|
2020-01-05 12:54:51 -08:00
|
|
|
all: all-zips protocol
|
|
|
|
|
2020-03-10 09:38:14 -07:00
|
|
|
protocol: Makefile.uptodate
|
2020-01-05 12:54:51 -08:00
|
|
|
$(MAKE) -C protocol
|
|
|
|
|
2020-03-10 09:38:14 -07:00
|
|
|
Makefile.uptodate: Makefile
|
|
|
|
$(MAKE) clean
|
|
|
|
touch Makefile.uptodate
|
|
|
|
|
2020-03-10 06:05:31 -07:00
|
|
|
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
|
|
|
|
|
2019-08-24 06:36:41 -07:00
|
|
|
index.html: README.rst
|
2020-03-10 06:05:31 -07:00
|
|
|
$(PROCESSRST)
|
2019-08-24 06:36:41 -07:00
|
|
|
|
2019-08-05 17:05:27 -07:00
|
|
|
%.html: %.rst
|
2020-03-10 06:05:31 -07:00
|
|
|
$(PROCESSRST)
|
2019-08-05 17:21:10 -07:00
|
|
|
|
2020-03-10 06:05:31 -07:00
|
|
|
README.rst: makeindex.sh README.template $(wildcard zip-*.rst)
|
2019-08-24 06:36:41 -07:00
|
|
|
./makeindex.sh | cat README.template - >README.rst
|
2019-08-05 17:21:10 -07:00
|
|
|
|
2019-08-24 05:56:44 -07:00
|
|
|
.PHONY: clean
|
2019-08-05 17:21:10 -07:00
|
|
|
clean:
|
2019-08-24 06:36:41 -07:00
|
|
|
rm -f README.rst index.html $(addsuffix .html,$(basename $(wildcard *.rst)))
|