examples/hw_decode: Add a HWAccel decoding 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_DIR_CMD_EXAMPLE)      += avio_dir_cmd
40 DOC_EXAMPLES-$(CONFIG_AVIO_READING_EXAMPLE)      += avio_reading
41 DOC_EXAMPLES-$(CONFIG_DECODE_AUDIO_EXAMPLE)      += decode_audio
42 DOC_EXAMPLES-$(CONFIG_DECODE_VIDEO_EXAMPLE)      += decode_video
43 DOC_EXAMPLES-$(CONFIG_DEMUXING_DECODING_EXAMPLE) += demuxing_decoding
44 DOC_EXAMPLES-$(CONFIG_ENCODE_AUDIO_EXAMPLE)      += encode_audio
45 DOC_EXAMPLES-$(CONFIG_ENCODE_VIDEO_EXAMPLE)      += encode_video
46 DOC_EXAMPLES-$(CONFIG_EXTRACT_MVS_EXAMPLE)       += extract_mvs
47 DOC_EXAMPLES-$(CONFIG_FILTER_AUDIO_EXAMPLE)      += filter_audio
48 DOC_EXAMPLES-$(CONFIG_FILTERING_AUDIO_EXAMPLE)   += filtering_audio
49 DOC_EXAMPLES-$(CONFIG_FILTERING_VIDEO_EXAMPLE)   += filtering_video
50 DOC_EXAMPLES-$(CONFIG_HTTP_MULTICLIENT_EXAMPLE)  += http_multiclient
51 DOC_EXAMPLES-$(CONFIG_HW_DECODE_EXAMPLE)         += hw_decode
52 DOC_EXAMPLES-$(CONFIG_METADATA_EXAMPLE)          += metadata
53 DOC_EXAMPLES-$(CONFIG_MUXING_EXAMPLE)            += muxing
54 DOC_EXAMPLES-$(CONFIG_QSVDEC_EXAMPLE)            += qsvdec
55 DOC_EXAMPLES-$(CONFIG_REMUXING_EXAMPLE)          += remuxing
56 DOC_EXAMPLES-$(CONFIG_RESAMPLING_AUDIO_EXAMPLE)  += resampling_audio
57 DOC_EXAMPLES-$(CONFIG_SCALING_VIDEO_EXAMPLE)     += scaling_video
58 DOC_EXAMPLES-$(CONFIG_TRANSCODE_AAC_EXAMPLE)     += transcode_aac
59 DOC_EXAMPLES-$(CONFIG_TRANSCODING_EXAMPLE)       += transcoding
60 ALL_DOC_EXAMPLES_LIST = $(DOC_EXAMPLES-) $(DOC_EXAMPLES-yes)
61
62 DOC_EXAMPLES       := $(DOC_EXAMPLES-yes:%=doc/examples/%$(PROGSSUF)$(EXESUF))
63 ALL_DOC_EXAMPLES   := $(ALL_DOC_EXAMPLES_LIST:%=doc/examples/%$(PROGSSUF)$(EXESUF))
64 ALL_DOC_EXAMPLES_G := $(ALL_DOC_EXAMPLES_LIST:%=doc/examples/%$(PROGSSUF)_g$(EXESUF))
65 PROGS              += $(DOC_EXAMPLES)
66
67 all-$(CONFIG_DOC): doc
68
69 doc: documentation
70
71 apidoc: doc/doxy/html
72 documentation: $(DOCS)
73
74 examples: $(DOC_EXAMPLES)
75
76 TEXIDEP = perl $(SRC_PATH)/doc/texidep.pl $(SRC_PATH) $< $@ >$(@:%=%.d)
77
78 doc/%.txt: TAG = TXT
79 doc/%.txt: doc/%.texi
80         $(Q)$(TEXIDEP)
81         $(M)makeinfo --force --no-headers -o $@ $< 2>/dev/null
82
83 GENTEXI  = format codec
84 GENTEXI := $(GENTEXI:%=doc/avoptions_%.texi)
85
86 $(GENTEXI): TAG = GENTEXI
87 $(GENTEXI): doc/avoptions_%.texi: doc/print_options$(HOSTEXESUF)
88         $(M)doc/print_options $* > $@
89
90 doc/%.html: TAG = HTML
91 doc/%-all.html: TAG = HTML
92
93 ifdef HAVE_MAKEINFO_HTML
94 doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.pm $(GENTEXI)
95         $(Q)$(TEXIDEP)
96         $(M)makeinfo --html -I doc --no-split -D config-not-all --init-file=$(SRC_PATH)/doc/t2h.pm --output $@ $<
97
98 doc/%-all.html: doc/%.texi $(SRC_PATH)/doc/t2h.pm $(GENTEXI)
99         $(Q)$(TEXIDEP)
100         $(M)makeinfo --html -I doc --no-split -D config-all --init-file=$(SRC_PATH)/doc/t2h.pm --output $@ $<
101 else
102 doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI)
103         $(Q)$(TEXIDEP)
104         $(M)texi2html -I doc -monolithic --D=config-not-all --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
105
106 doc/%-all.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI)
107         $(Q)$(TEXIDEP)
108         $(M)texi2html -I doc -monolithic --D=config-all --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
109 endif
110
111 doc/%.pod: TAG = POD
112 doc/%.pod: doc/%.texi $(SRC_PATH)/doc/texi2pod.pl $(GENTEXI)
113         $(Q)$(TEXIDEP)
114         $(M)perl $(SRC_PATH)/doc/texi2pod.pl -Dconfig-not-all=yes -Idoc $< $@
115
116 doc/%-all.pod: TAG = POD
117 doc/%-all.pod: doc/%.texi $(SRC_PATH)/doc/texi2pod.pl $(GENTEXI)
118         $(Q)$(TEXIDEP)
119         $(M)perl $(SRC_PATH)/doc/texi2pod.pl -Dconfig-all=yes -Idoc $< $@
120
121 doc/%.1 doc/%.3: TAG = MAN
122 doc/%.1: doc/%.pod $(GENTEXI)
123         $(M)pod2man --section=1 --center=" " --release=" " --date=" " $< > $@
124 doc/%.3: doc/%.pod $(GENTEXI)
125         $(M)pod2man --section=3 --center=" " --release=" " --date=" " $< > $@
126
127 $(DOCS) doc/doxy/html: | doc/
128 $(DOC_EXAMPLES:%$(EXESUF)=%.o): | doc/examples
129 OBJDIRS += doc/examples
130
131 DOXY_INPUT      = $(INSTHEADERS) $(DOC_EXAMPLES:%$(EXESUF)=%.c) $(LIB_EXAMPLES:%$(EXESUF)=%.c)
132 DOXY_INPUT_DEPS = $(addprefix $(SRC_PATH)/, $(DOXY_INPUT)) ffbuild/config.mak
133
134 doc/doxy/html: TAG = DOXY
135 doc/doxy/html: $(SRC_PATH)/doc/Doxyfile $(SRC_PATH)/doc/doxy-wrapper.sh $(DOXY_INPUT_DEPS)
136         $(M)OUT_DIR=$$PWD/doc/doxy; cd $(SRC_PATH); ./doc/doxy-wrapper.sh $$OUT_DIR $< $(DOXYGEN) $(DOXY_INPUT);
137
138 install-doc: install-html install-man
139
140 install-html:
141
142 install-man:
143
144 ifdef CONFIG_HTMLPAGES
145 install-progs-$(CONFIG_DOC): install-html
146
147 install-html: $(HTMLPAGES)
148         $(Q)mkdir -p "$(DOCDIR)"
149         $(INSTALL) -m 644 $(HTMLPAGES) "$(DOCDIR)"
150 endif
151
152 ifdef CONFIG_MANPAGES
153 install-progs-$(CONFIG_DOC): install-man
154
155 install-man: $(MANPAGES)
156         $(Q)mkdir -p "$(MANDIR)/man1"
157         $(INSTALL) -m 644 $(MANPAGES1) "$(MANDIR)/man1"
158         $(Q)mkdir -p "$(MANDIR)/man3"
159         $(INSTALL) -m 644 $(MANPAGES3) "$(MANDIR)/man3"
160 endif
161
162 uninstall: uninstall-doc
163
164 uninstall-doc: uninstall-html uninstall-man
165
166 uninstall-html:
167         $(RM) -r "$(DOCDIR)"
168
169 uninstall-man:
170         $(RM) $(addprefix "$(MANDIR)/man1/",$(AVPROGS-yes:%=%.1) $(AVPROGS-yes:%=%-all.1) $(COMPONENTS-yes:%=%.1))
171         $(RM) $(addprefix "$(MANDIR)/man3/",$(LIBRARIES-yes:%=%.3))
172
173 clean:: docclean
174
175 distclean:: docclean
176         $(RM) doc/config.texi
177
178 examplesclean:
179         $(RM) $(ALL_DOC_EXAMPLES) $(ALL_DOC_EXAMPLES_G)
180         $(RM) $(CLEANSUFFIXES:%=doc/examples/%)
181
182 docclean: examplesclean
183         $(RM) $(CLEANSUFFIXES:%=doc/%)
184         $(RM) $(TXTPAGES) doc/*.html doc/*.pod doc/*.1 doc/*.3 doc/avoptions_*.texi
185         $(RM) -r doc/doxy/html
186
187 -include $(wildcard $(DOCS:%=%.d))
188
189 .PHONY: apidoc doc documentation