premiere-libtorrent/docs/makefile

137 lines
3.4 KiB
Makefile
Raw Normal View History

# this makefile assumes that you have docutils and rst2pdf installed
# (python-docutils) as well as aafigure (python-aafigure)
ifneq ($(STAGE),)
WEB_PATH = ~/Documents/rasterbar/web/products/libtorrent
endif
ifndef RST2HTML
RST2HTML:=rst2html
endif
2017-06-14 09:53:09 +02:00
ifndef AAFIGURE
AAFIGURE=aafigure
endif
REFERENCE_TARGETS = \
manual-ref \
upgrade_to_1.2-ref \
reference \
reference-Core \
reference-Plugins \
reference-Create_Torrents \
reference-Error_Codes \
reference-Storage \
reference-Custom_Storage \
reference-Utility \
reference-Bencoding \
reference-Alerts \
reference-Filter \
reference-Settings \
reference-Bdecoding \
reference-ed25519
MANUAL_TARGETS = index \
udp_tracker_protocol \
2011-01-02 04:53:28 +01:00
dht_rss \
dht_store \
client_test \
building \
features \
troubleshooting \
contributing\
examples \
extension_protocol \
dht_extensions \
dht_sec \
python_binding \
2009-02-09 04:48:27 +01:00
projects \
2010-11-29 02:33:05 +01:00
utp \
tuning \
hacking \
streaming \
tutorial
TARGETS = single-page-ref \
$(MANUAL_TARGETS) \
$(REFERENCE_TARGETS)
2014-09-01 09:16:31 +02:00
FIGURES = \
read_disk_buffers \
write_disk_buffers \
hacking \
utp_stack \
storage \
disk_cache \
troubleshooting
html: $(TARGETS:=.html) $(FIGURES:=.png) todo.html
2009-02-09 04:48:27 +01:00
rst: $(TARGETS:=.rst) todo.html
pdf: $(TARGETS:=.pdf) $(FIGURES:=.png)
epub: $(TARGETS:=.epub) $(FIGURES:=.png)
all: html pdf
single-page-ref.rst: $(REFERENCE_TARGETS:=.rst)
python join_rst.py $(filter-out reference.rst, $(REFERENCE_TARGETS:=.rst)) >single-page-ref.rst
2014-07-06 21:18:00 +02:00
settings.rst: ../include/libtorrent/settings_pack.hpp
2018-10-08 10:07:36 +02:00
python gen_settings_doc.py || { rm $@; exit 1; }
2014-07-06 21:18:00 +02:00
2014-07-30 04:00:14 +02:00
stats_counters.rst: ../src/session_stats.cpp ../include/libtorrent/performance_counters.hpp
2018-10-08 10:07:36 +02:00
python gen_stats_doc.py || { rm $@; exit 1; }
2014-07-06 21:18:00 +02:00
2014-07-09 01:44:34 +02:00
manual.rst: stats_counters.rst
2014-07-06 21:18:00 +02:00
touch manual.rst
#troubleshooting_thumb.png: troubleshooting.png
# convert troubleshooting.png -resize 800x800 troubleshooting_thumb.png
#ifneq ($(STAGE),)
# cp $@ $(WEB_PATH)/$@
#endif
2014-02-02 11:02:51 +01:00
todo.html:gen_todo.py ../src/*.cpp ../include/libtorrent/*.hpp
python gen_todo.py
ifneq ($(STAGE),)
2014-07-10 18:23:47 +02:00
cp $@ $(WEB_PATH)/$@
endif
$(REFERENCE_TARGETS:=.rst) plain_text_out.txt:gen_reference_doc.py ../include/libtorrent/*.hpp ../include/libtorrent/kademlia/*.hpp manual.rst settings.rst stats_counters.rst
python gen_reference_doc.py --plain-output
spell-check:plain_text_out.txt $(MANUAL_TARGETS:=.html)
2017-06-18 20:39:10 +02:00
hunspell -d hunspell/en_US -p hunspell/libtorrent.dic -l plain_text_out.txt >hunspell-report.txt
hunspell -d hunspell/en_US -p hunspell/libtorrent.dic -H -l $(MANUAL_TARGETS:=.html) >>hunspell-report.txt
2017-06-18 20:39:10 +02:00
@if [ -s hunspell-report.txt ]; then echo 'spellcheck failed, fix words or add to dictionary:'; cat hunspell-report.txt; false; fi;
%.epub:%.rst
rst2epub --exit-status=2 $? $@
%.pdf:%.rst
rst2pdf $? -o $@ --stylesheets stylesheet
%.html:%.rst
2018-10-08 10:07:36 +02:00
$(RST2HTML) --exit-status=2 --template=template.txt --stylesheet-path=style.css --link-stylesheet --no-toc-backlinks $? > $@ || { rm $@; exit 1; }
ifneq ($(STAGE),)
2018-10-08 10:07:36 +02:00
$(RST2HTML) --exit-status=2 --template=template2.txt --stylesheet-path=style.css --link-stylesheet --no-toc-backlinks $? > $(WEB_PATH)/$@ || { rm $@; exit 1; }
endif
%.png:%.dot
2018-10-08 10:07:36 +02:00
dot -Tpng $? >$@ || { rm $@; exit 1; }
ifneq ($(STAGE),)
cp $@ $(WEB_PATH)/$@
endif
2014-09-01 09:16:31 +02:00
%.png:%.diagram
2018-10-08 10:07:36 +02:00
$(AAFIGURE) --scale 0.6 -o $@ $? || { rm $@; exit 1; }
ifneq ($(STAGE),)
2014-09-01 09:16:31 +02:00
cp $@ $(WEB_PATH)/$@
endif
2014-09-01 09:16:31 +02:00
clean:
2016-02-19 01:18:10 +01:00
rm -f $(TARGETS:=.html) $(TARGETS:=.pdf) $(FIGURES:=.png) $(FIGURES:=.eps) $(REFERENCE_TARGETS:=.rst) settings.rst todo.html reference*.html stats_counters.rst