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