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