doc: move codec options and descriptions to a dedicated manual page
[ffmpeg.git] / doc / Makefile
1 DOCLIBS-$(CONFIG_AVUTIL)  += libavutil
2 DOCLIBS-$(CONFIG_AVCODEC) += libavcodec
3 DOCLIBS-$(CONFIG_AVFILTER) += libavfilter
4
5 COMPONENTS=$(PROGS-yes) ffmpeg-codecs
6
7 MANPAGES    = $(COMPONENTS:%=doc/%.1)    $(DOCLIBS-yes:%=doc/%.3)
8 PODPAGES    = $(COMPONENTS:%=doc/%.pod)  $(DOCLIBS-yes:%=doc/%.pod)
9 HTMLPAGES   = $(COMPONENTS:%=doc/%.html) $(DOCLIBS-yes:%=doc/%.html)     \
10               doc/developer.html                                        \
11               doc/faq.html                                              \
12               doc/fate.html                                             \
13               doc/general.html                                          \
14               doc/git-howto.html                                        \
15               doc/nut.html                                              \
16               doc/platform.html                                         \
17               doc/syntax.html                                           \
18
19 TXTPAGES    = doc/fate.txt                                              \
20
21
22 DOCS-$(CONFIG_HTMLPAGES) += $(HTMLPAGES)
23 DOCS-$(CONFIG_PODPAGES)  += $(PODPAGES)
24 DOCS-$(CONFIG_MANPAGES)  += $(MANPAGES)
25 DOCS-$(CONFIG_TXTPAGES)  += $(TXTPAGES)
26 DOCS = $(DOCS-yes)
27
28 all-$(CONFIG_DOC): doc
29
30 doc: documentation
31
32 apidoc: doc/doxy/html
33 documentation: $(DOCS)
34
35 TEXIDEP = awk '/^@(verbatim)?include/ { printf "$@: $(@D)/%s\n", $$2 }' <$< >$(@:%=%.d)
36
37 doc/%.txt: TAG = TXT
38 doc/%.txt: doc/%.texi
39         $(Q)$(TEXIDEP)
40         $(M)makeinfo --force --no-headers -o $@ $< 2>/dev/null
41
42 GENTEXI  = format codec
43 GENTEXI := $(GENTEXI:%=doc/avoptions_%.texi)
44
45 $(GENTEXI): TAG = GENTEXI
46 $(GENTEXI): doc/avoptions_%.texi: doc/print_options$(HOSTEXESUF)
47         $(M)doc/print_options $* > $@
48
49 doc/%.html: TAG = HTML
50 doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI)
51         $(Q)$(TEXIDEP)
52         $(M)texi2html -I doc -monolithic --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
53
54 doc/%.pod: TAG = POD
55 doc/%.pod: doc/%.texi $(GENTEXI)
56         $(Q)$(TEXIDEP)
57         $(M)perl $(SRC_PATH)/doc/texi2pod.pl -Idoc $< $@
58
59 doc/%.1 doc/%.3: TAG = MAN
60 doc/%.1: doc/%.pod $(GENTEXI)
61         $(M)pod2man --section=1 --center=" " --release=" " $< > $@
62 doc/%.3: doc/%.pod $(GENTEXI)
63         $(M)pod2man --section=3 --center=" " --release=" " $< > $@
64
65 $(DOCS) doc/doxy/html: | doc/
66
67 doc/doxy/html: $(SRC_PATH)/doc/Doxyfile $(INSTHEADERS)
68         $(M)$(SRC_PATH)/doc/doxy-wrapper.sh $(SRC_PATH) $^
69
70 install-man:
71
72 ifdef CONFIG_MANPAGES
73 install-progs-$(CONFIG_DOC): install-man
74
75 install-man: $(MANPAGES)
76         $(Q)mkdir -p "$(MANDIR)/man1"
77         $(INSTALL) -m 644 $(MANPAGES) "$(MANDIR)/man1"
78 endif
79
80 uninstall: uninstall-man
81
82 uninstall-man:
83         $(RM) $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
84
85 clean::
86         $(RM) $(TXTPAGES) doc/*.html doc/*.pod doc/*.1 doc/*.3 $(CLEANSUFFIXES:%=doc/%) doc/avoptions_*.texi
87         $(RM) -r doc/doxy/html
88
89 -include $(wildcard $(DOCS:%=%.d))
90
91 .PHONY: apidoc doc documentation