error_resilience: guess_dc: check malloc failure
[ffmpeg.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/fate.html                                             \
7               doc/general.html                                          \
8               doc/git-howto.html                                        \
9               doc/platform.html                                         \
10               doc/syntax.html                                           \
11
12 TXTPAGES    = doc/fate.txt                                              \
13
14
15 DOCS-$(CONFIG_HTMLPAGES) += $(HTMLPAGES)
16 DOCS-$(CONFIG_PODPAGES)  += $(PODPAGES)
17 DOCS-$(CONFIG_MANPAGES)  += $(MANPAGES)
18 DOCS-$(CONFIG_TXTPAGES)  += $(TXTPAGES)
19 DOCS = $(DOCS-yes)
20
21 all-$(CONFIG_DOC): doc
22
23 doc: documentation
24
25 documentation: $(DOCS)
26
27 TEXIDEP = awk '/^@(verbatim)?include/ { printf "$@: $(@D)/%s\n", $$2 }' <$< >$(@:%=%.d)
28
29 doc/%.txt: TAG = TXT
30 doc/%.txt: doc/%.texi
31         $(Q)$(TEXIDEP)
32         $(M)makeinfo --force --no-headers -o $@ $< 2>/dev/null
33
34 GENTEXI  = format codec
35 GENTEXI := $(GENTEXI:%=doc/avoptions_%.texi)
36
37 $(GENTEXI): TAG = GENTEXI
38 $(GENTEXI): doc/avoptions_%.texi: doc/print_options$(HOSTEXESUF)
39         $(M)doc/print_options $* > $@
40
41 doc/%.html: TAG = HTML
42 doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI)
43         $(Q)$(TEXIDEP)
44         $(M)texi2html -I doc -monolithic --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
45
46 doc/%.pod: TAG = POD
47 doc/%.pod: doc/%.texi $(GENTEXI)
48         $(Q)$(TEXIDEP)
49         $(M)perl $(SRC_PATH)/doc/texi2pod.pl -Idoc $< $@
50
51 doc/%.1: TAG = MAN
52 doc/%.1: doc/%.pod $(GENTEXI)
53         $(M)pod2man --section=1 --center=" " --release=" " $< > $@
54
55 $(DOCS): | doc/
56
57 install-man:
58
59 ifdef CONFIG_MANPAGES
60 install-progs-$(CONFIG_DOC): install-man
61
62 install-man: $(MANPAGES)
63         $(Q)mkdir -p "$(MANDIR)/man1"
64         $(INSTALL) -m 644 $(MANPAGES) "$(MANDIR)/man1"
65 endif
66
67 uninstall: uninstall-man
68
69 uninstall-man:
70         $(RM) $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
71
72 clean::
73         $(RM) $(TXTPAGES) doc/*.html doc/*.pod doc/*.1 $(CLEANSUFFIXES:%=doc/%) doc/avoptions_*.texi
74
75 -include $(wildcard $(DOCS:%=%.d))
76
77 .PHONY: doc documentation