build: move documentation rules to doc/Makefile
[libav.git] / doc / Makefile
CommitLineData
f87b03b5
MR
1MANPAGES = $(PROGS-yes:%=doc/%.1)
2PODPAGES = $(PROGS-yes:%=doc/%.pod)
3HTMLPAGES = $(PROGS-yes:%=doc/%.html)
4
5DOCS = $(addprefix doc/, developer.html faq.html general.html libavfilter.html) $(HTMLPAGES) $(MANPAGES) $(PODPAGES)
6
7all-$(CONFIG_DOC): documentation
8
9documentation: $(DOCS)
10
11TEXIDEP = awk '/^@include/ { printf "$@: $(@D)/%s\n", $$2 }' <$< >$(@:%=%.d)
12
13doc/%.html: TAG = HTML
14doc/%.html: doc/%.texi $(SRC_PATH_BARE)/doc/t2h.init
15 $(Q)$(TEXIDEP)
16 $(M)texi2html -monolithic --init-file $(SRC_PATH_BARE)/doc/t2h.init --output $@ $<
17
18doc/%.pod: TAG = POD
19doc/%.pod: doc/%.texi
20 $(Q)$(TEXIDEP)
21 $(M)doc/texi2pod.pl $< $@
22
23doc/%.1: TAG = MAN
24doc/%.1: doc/%.pod
25 $(M)pod2man --section=1 --center=" " --release=" " $< > $@
26
27install-progs-$(CONFIG_DOC): install-man
28
29install-man: $(MANPAGES)
30 $(Q)mkdir -p "$(MANDIR)/man1"
31 $(INSTALL) -m 644 $(MANPAGES) "$(MANDIR)/man1"
32
33uninstall: uninstall-man
34
35uninstall-man:
36 $(RM) $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
37
38clean::
39 $(RM) doc/*.html doc/*.pod doc/*.1 $(CLEANSUFFIXES:%=doc/%)
40
41-include $(wildcard $(DOCS:%=%.d))
42
43.PHONY: documentation