examples: add avio_reading.c example
[ffmpeg.git] / doc / Makefile
1 LIBRARIES-$(CONFIG_AVUTIL)     += libavutil
2 LIBRARIES-$(CONFIG_SWSCALE)    += libswscale
3 LIBRARIES-$(CONFIG_SWRESAMPLE) += libswresample
4 LIBRARIES-$(CONFIG_AVCODEC)    += libavcodec
5 LIBRARIES-$(CONFIG_AVFORMAT)   += libavformat
6 LIBRARIES-$(CONFIG_AVDEVICE)   += libavdevice
7 LIBRARIES-$(CONFIG_AVFILTER)   += libavfilter
8
9 COMPONENTS-$(CONFIG_AVUTIL)     += ffmpeg-utils
10 COMPONENTS-$(CONFIG_SWSCALE)    += ffmpeg-scaler
11 COMPONENTS-$(CONFIG_SWRESAMPLE) += ffmpeg-resampler
12 COMPONENTS-$(CONFIG_AVCODEC)    += ffmpeg-codecs ffmpeg-bitstream-filters
13 COMPONENTS-$(CONFIG_AVFORMAT)   += ffmpeg-formats ffmpeg-protocols
14 COMPONENTS-$(CONFIG_AVDEVICE)   += ffmpeg-devices
15 COMPONENTS-$(CONFIG_AVFILTER)   += ffmpeg-filters
16
17 MANPAGES1   = $(AVPROGS-yes:%=doc/%.1)    $(AVPROGS-yes:%=doc/%-all.1)    $(COMPONENTS-yes:%=doc/%.1)
18 MANPAGES3   = $(LIBRARIES-yes:%=doc/%.3)
19 MANPAGES    = $(MANPAGES1) $(MANPAGES3)
20 PODPAGES    = $(AVPROGS-yes:%=doc/%.pod)  $(AVPROGS-yes:%=doc/%-all.pod)  $(COMPONENTS-yes:%=doc/%.pod)  $(LIBRARIES-yes:%=doc/%.pod)
21 HTMLPAGES   = $(AVPROGS-yes:%=doc/%.html) $(AVPROGS-yes:%=doc/%-all.html) $(COMPONENTS-yes:%=doc/%.html) $(LIBRARIES-yes:%=doc/%.html) \
22               doc/developer.html                                        \
23               doc/faq.html                                              \
24               doc/fate.html                                             \
25               doc/general.html                                          \
26               doc/git-howto.html                                        \
27               doc/nut.html                                              \
28               doc/platform.html                                         \
29
30 TXTPAGES    = doc/fate.txt                                              \
31
32
33 DOCS-$(CONFIG_HTMLPAGES) += $(HTMLPAGES)
34 DOCS-$(CONFIG_PODPAGES)  += $(PODPAGES)
35 DOCS-$(CONFIG_MANPAGES)  += $(MANPAGES)
36 DOCS-$(CONFIG_TXTPAGES)  += $(TXTPAGES)
37 DOCS = $(DOCS-yes)
38
39 DOC_EXAMPLES-$(CONFIG_AVIO_READING_EXAMPLE)      += avio_reading
40 DOC_EXAMPLES-$(CONFIG_DECODING_ENCODING_EXAMPLE) += decoding_encoding
41 DOC_EXAMPLES-$(CONFIG_DEMUXING_DECODING_EXAMPLE) += demuxing_decoding
42 DOC_EXAMPLES-$(CONFIG_FILTERING_AUDIO_EXAMPLE)   += filtering_audio
43 DOC_EXAMPLES-$(CONFIG_FILTERING_VIDEO_EXAMPLE)   += filtering_video
44 DOC_EXAMPLES-$(CONFIG_METADATA_EXAMPLE)          += metadata
45 DOC_EXAMPLES-$(CONFIG_MUXING_EXAMPLE)            += muxing
46 DOC_EXAMPLES-$(CONFIG_REMUXING_EXAMPLE)          += remuxing
47 DOC_EXAMPLES-$(CONFIG_RESAMPLING_AUDIO_EXAMPLE)  += resampling_audio
48 DOC_EXAMPLES-$(CONFIG_SCALING_VIDEO_EXAMPLE)     += scaling_video
49 DOC_EXAMPLES-$(CONFIG_TRANSCODE_AAC_EXAMPLE)     += transcode_aac
50 ALL_DOC_EXAMPLES_LIST = $(DOC_EXAMPLES-) $(DOC_EXAMPLES-yes)
51
52 DOC_EXAMPLES       := $(DOC_EXAMPLES-yes:%=doc/examples/%$(PROGSSUF)$(EXESUF))
53 ALL_DOC_EXAMPLES   := $(ALL_DOC_EXAMPLES_LIST:%=doc/examples/%$(PROGSSUF)$(EXESUF))
54 ALL_DOC_EXAMPLES_G := $(ALL_DOC_EXAMPLES_LIST:%=doc/examples/%$(PROGSSUF)_g$(EXESUF))
55 PROGS              += $(DOC_EXAMPLES)
56
57 all-$(CONFIG_DOC): doc
58
59 doc: documentation
60
61 apidoc: doc/doxy/html
62 documentation: $(DOCS)
63
64 examples: $(DOC_EXAMPLES)
65
66 TEXIDEP = perl $(SRC_PATH)/doc/texidep.pl $(SRC_PATH) $< $@ >$(@:%=%.d)
67
68 doc/%.txt: TAG = TXT
69 doc/%.txt: doc/%.texi
70         $(Q)$(TEXIDEP)
71         $(M)makeinfo --force --no-headers -o $@ $< 2>/dev/null
72
73 GENTEXI  = format codec
74 GENTEXI := $(GENTEXI:%=doc/avoptions_%.texi)
75
76 $(GENTEXI): TAG = GENTEXI
77 $(GENTEXI): doc/avoptions_%.texi: doc/print_options$(HOSTEXESUF)
78         $(M)doc/print_options $* > $@
79
80 doc/%.html: TAG = HTML
81 doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI)
82         $(Q)$(TEXIDEP)
83         $(M)texi2html -I doc -monolithic --D=config-not-all --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
84
85 doc/%-all.html: TAG = HTML
86 doc/%-all.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI)
87         $(Q)$(TEXIDEP)
88         $(M)texi2html -I doc -monolithic --D=config-all --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
89
90 doc/%.pod: TAG = POD
91 doc/%.pod: doc/%.texi $(SRC_PATH)/doc/texi2pod.pl $(GENTEXI)
92         $(Q)$(TEXIDEP)
93         $(M)perl $(SRC_PATH)/doc/texi2pod.pl -Dconfig-not-all=yes -Idoc $< $@
94
95 doc/%-all.pod: TAG = POD
96 doc/%-all.pod: doc/%.texi $(SRC_PATH)/doc/texi2pod.pl $(GENTEXI)
97         $(Q)$(TEXIDEP)
98         $(M)perl $(SRC_PATH)/doc/texi2pod.pl -Dconfig-all=yes -Idoc $< $@
99
100 doc/%.1 doc/%.3: TAG = MAN
101 doc/%.1: doc/%.pod $(GENTEXI)
102         $(M)pod2man --section=1 --center=" " --release=" " $< > $@
103 doc/%.3: doc/%.pod $(GENTEXI)
104         $(M)pod2man --section=3 --center=" " --release=" " $< > $@
105
106 $(DOCS) doc/doxy/html: | doc/
107 $(DOC_EXAMPLES:%=%.o): | doc/examples
108 OBJDIRS += doc/examples
109
110 doc/doxy/html: $(SRC_PATH)/doc/Doxyfile $(INSTHEADERS)
111         $(M)$(SRC_PATH)/doc/doxy-wrapper.sh $(SRC_PATH) $^
112
113 install-doc: install-html install-man
114
115 install-html:
116
117 install-man:
118
119 ifdef CONFIG_HTMLPAGES
120 install-progs-$(CONFIG_DOC): install-html
121
122 install-html: $(HTMLPAGES)
123         $(Q)mkdir -p "$(DOCDIR)"
124         $(INSTALL) -m 644 $(HTMLPAGES) "$(DOCDIR)"
125 endif
126
127 ifdef CONFIG_MANPAGES
128 install-progs-$(CONFIG_DOC): install-man
129
130 install-man: $(MANPAGES)
131         $(Q)mkdir -p "$(MANDIR)/man1"
132         $(INSTALL) -m 644 $(MANPAGES1) "$(MANDIR)/man1"
133         $(Q)mkdir -p "$(MANDIR)/man3"
134         $(INSTALL) -m 644 $(MANPAGES3) "$(MANDIR)/man3"
135 endif
136
137 uninstall: uninstall-doc
138
139 uninstall-doc: uninstall-html uninstall-man
140
141 uninstall-html:
142         $(RM) -r "$(DOCDIR)"
143
144 uninstall-man:
145         $(RM) $(addprefix "$(MANDIR)/man1/",$(AVPROGS-yes:%=%.1) $(AVPROGS-yes:%=%-all.1) $(COMPONENTS-yes:%=%.1))
146         $(RM) $(addprefix "$(MANDIR)/man3/",$(LIBRARIES-yes:%=%.3))
147
148 clean:: docclean
149
150 distclean:: docclean
151         $(RM) doc/config.texi
152
153 examplesclean:
154         $(RM) $(ALL_DOC_EXAMPLES) $(ALL_DOC_EXAMPLES_G)
155         $(RM) $(CLEANSUFFIXES:%=doc/examples/%)
156
157 docclean: examplesclean
158         $(RM) $(CLEANSUFFIXES:%=doc/%)
159         $(RM) $(TXTPAGES) doc/*.html doc/*.pod doc/*.1 doc/*.3 doc/avoptions_*.texi
160         $(RM) -r doc/doxy/html
161
162 -include $(wildcard $(DOCS:%=%.d))
163
164 .PHONY: apidoc doc documentation