build: more fine-grained dependencies for documentation build tools
[libav.git] / doc / Makefile
CommitLineData
f87b03b5
MR
1MANPAGES = $(PROGS-yes:%=doc/%.1)
2PODPAGES = $(PROGS-yes:%=doc/%.pod)
47b20a1d
DB
3HTMLPAGES = $(PROGS-yes:%=doc/%.html) \
4 doc/developer.html \
5 doc/faq.html \
1ebbdda1 6 doc/fate.html \
47b20a1d 7 doc/general.html \
2f017d97 8 doc/git-howto.html \
47b20a1d 9 doc/libavfilter.html \
175d0d94 10 doc/nut.html \
1de6e14e 11 doc/platform.html \
f87b03b5 12
f187557a
DB
13DOCS-$(CONFIG_PERL) += $(MANPAGES) $(PODPAGES)
14DOCS-$(CONFIG_TEXI2HTML) += $(HTMLPAGES)
15DOCS = $(DOCS-yes)
f87b03b5 16
f187557a 17all: $(DOCS)
f87b03b5 18
b3fab1f2 19apidoc: doc/doxy/html
f87b03b5
MR
20documentation: $(DOCS)
21
22TEXIDEP = awk '/^@include/ { printf "$@: $(@D)/%s\n", $$2 }' <$< >$(@:%=%.d)
23
0d0b81f9
AK
24GENTEXI = format codec
25GENTEXI := $(GENTEXI:%=doc/avoptions_%.texi)
26
27$(GENTEXI): TAG = GENTEXI
28$(GENTEXI): doc/avoptions_%.texi: doc/print_options
29 $(M)doc/print_options $* > $@
30
f87b03b5 31doc/%.html: TAG = HTML
0d0b81f9 32doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI)
f87b03b5 33 $(Q)$(TEXIDEP)
2ac3df85 34 $(M)texi2html -I doc -monolithic --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
f87b03b5
MR
35
36doc/%.pod: TAG = POD
7a95afe4 37doc/%.pod: doc/%.texi $(SRC_PATH)/doc/texi2pod.pl $(GENTEXI)
f87b03b5 38 $(Q)$(TEXIDEP)
2ac3df85 39 $(M)$(SRC_PATH)/doc/texi2pod.pl -Idoc $< $@
f87b03b5
MR
40
41doc/%.1: TAG = MAN
0d0b81f9 42doc/%.1: doc/%.pod $(GENTEXI)
f87b03b5
MR
43 $(M)pod2man --section=1 --center=" " --release=" " $< > $@
44
b3fab1f2
JG
45$(DOCS) doc/doxy/html: | doc/
46
47doc/doxy/html: $(SRC_PATH)/doc/Doxyfile $(INSTHEADERS)
48 $(M)$(SRC_PATH)/doc/doxy-wrapper.sh $(SRC_PATH) $^
5e27ec28 49
f187557a
DB
50install-progs-$(CONFIG_PERL): install-man
51install-progs-$(CONFIG_TEXI2HTML): install-doc
f4ca970d
VG
52
53install-doc: $(HTMLPAGES)
54 $(Q)mkdir -p "$(DOCDIR)"
55 $(INSTALL) -m 644 $(HTMLPAGES) "$(DOCDIR)"
f87b03b5
MR
56
57install-man: $(MANPAGES)
58 $(Q)mkdir -p "$(MANDIR)/man1"
59 $(INSTALL) -m 644 $(MANPAGES) "$(MANDIR)/man1"
60
f4ca970d
VG
61uninstall: uninstall-doc uninstall-man
62
63uninstall-doc:
64 $(RM) -r "$(DOCDIR)"
f87b03b5
MR
65
66uninstall-man:
67 $(RM) $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
68
69clean::
0d0b81f9 70 $(RM) doc/*.html doc/*.pod doc/*.1 $(CLEANSUFFIXES:%=doc/%) doc/avoptions_*.texi
b3fab1f2 71 $(RM) -r doc/doxy/html
f87b03b5
MR
72
73-include $(wildcard $(DOCS:%=%.d))
74
b3fab1f2 75.PHONY: apidoc documentation