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