Merge commit 'db4903eb4875bed6c5b8a4259cdd7bc1768dfdf6'
[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
61 DOC_EXAMPLES       := $(DOC_EXAMPLES-yes:%=doc/examples/%$(PROGSSUF)$(EXESUF))
62 ALL_DOC_EXAMPLES   := $(DOC_EXAMPLES) $(DOC_EXAMPLES-:%=doc/examples/%$(PROGSSUF)$(EXESUF))
63 ALL_DOC_EXAMPLES_G := $(DOC_EXAMPLES) $(DOC_EXAMPLES-:%=doc/examples/%$(PROGSSUF)_g$(EXESUF))
64 PROGS              += $(DOC_EXAMPLES)
65
66 all-$(CONFIG_DOC): doc
67
68 doc: documentation
69
70 apidoc: doc/doxy/html
71 documentation: $(DOCS)
72
73 examples: $(DOC_EXAMPLES)
74
75 TEXIDEP = perl $(SRC_PATH)/doc/texidep.pl $(SRC_PATH) $< $@ >$(@:%=%.d)
76
77 doc/%.txt: TAG = TXT
78 doc/%.txt: doc/%.texi
79         $(Q)$(TEXIDEP)
80         $(M)makeinfo --force --no-headers -o $@ $< 2>/dev/null
81
82 GENTEXI  = format codec
83 GENTEXI := $(GENTEXI:%=doc/avoptions_%.texi)
84
85 $(GENTEXI): TAG = GENTEXI
86 $(GENTEXI): doc/avoptions_%.texi: doc/print_options$(HOSTEXESUF)
87         $(M)doc/print_options $* > $@
88
89 doc/%.html: TAG = HTML
90 doc/%-all.html: TAG = HTML
91
92 ifdef HAVE_MAKEINFO_HTML
93 doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.pm $(GENTEXI)
94         $(Q)$(TEXIDEP)
95         $(M)makeinfo --html -I doc --no-split -D config-not-all --init-file=$(SRC_PATH)/doc/t2h.pm --output $@ $<
96
97 doc/%-all.html: doc/%.texi $(SRC_PATH)/doc/t2h.pm $(GENTEXI)
98         $(Q)$(TEXIDEP)
99         $(M)makeinfo --html -I doc --no-split -D config-all --init-file=$(SRC_PATH)/doc/t2h.pm --output $@ $<
100 else
101 doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI)
102         $(Q)$(TEXIDEP)
103         $(M)texi2html -I doc -monolithic --D=config-not-all --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
104
105 doc/%-all.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI)
106         $(Q)$(TEXIDEP)
107         $(M)texi2html -I doc -monolithic --D=config-all --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
108 endif
109
110 doc/%.pod: TAG = POD
111 doc/%.pod: doc/%.texi $(SRC_PATH)/doc/texi2pod.pl $(GENTEXI)
112         $(Q)$(TEXIDEP)
113         $(M)perl $(SRC_PATH)/doc/texi2pod.pl -Dconfig-not-all=yes -Idoc $< $@
114
115 doc/%-all.pod: TAG = POD
116 doc/%-all.pod: doc/%.texi $(SRC_PATH)/doc/texi2pod.pl $(GENTEXI)
117         $(Q)$(TEXIDEP)
118         $(M)perl $(SRC_PATH)/doc/texi2pod.pl -Dconfig-all=yes -Idoc $< $@
119
120 doc/%.1 doc/%.3: TAG = MAN
121 doc/%.1: doc/%.pod $(GENTEXI)
122         $(M)pod2man --section=1 --center=" " --release=" " --date=" " $< > $@
123 doc/%.3: doc/%.pod $(GENTEXI)
124         $(M)pod2man --section=3 --center=" " --release=" " --date=" " $< > $@
125
126 $(DOCS) doc/doxy/html: | doc/
127 $(DOC_EXAMPLES:%$(EXESUF)=%.o): | doc/examples
128 OBJDIRS += doc/examples
129
130 DOXY_INPUT      = $(INSTHEADERS) $(DOC_EXAMPLES:%$(EXESUF)=%.c)
131 DOXY_INPUT_DEPS = $(addprefix $(SRC_PATH)/, $(DOXY_INPUT)) ffbuild/config.mak
132
133 doc/doxy/html: TAG = DOXY
134 doc/doxy/html: $(SRC_PATH)/doc/Doxyfile $(SRC_PATH)/doc/doxy-wrapper.sh $(DOXY_INPUT_DEPS)
135         $(M)OUT_DIR=$$PWD/doc/doxy; cd $(SRC_PATH); ./doc/doxy-wrapper.sh $$OUT_DIR $< $(DOXYGEN) $(DOXY_INPUT);
136
137 install-doc: install-html install-man
138
139 install-html:
140
141 install-man:
142
143 ifdef CONFIG_HTMLPAGES
144 install-progs-$(CONFIG_DOC): install-html
145
146 install-html: $(HTMLPAGES)
147         $(Q)mkdir -p "$(DOCDIR)"
148         $(INSTALL) -m 644 $(HTMLPAGES) "$(DOCDIR)"
149 endif
150
151 ifdef CONFIG_MANPAGES
152 install-progs-$(CONFIG_DOC): install-man
153
154 install-man: $(MANPAGES)
155         $(Q)mkdir -p "$(MANDIR)/man1"
156         $(INSTALL) -m 644 $(MANPAGES1) "$(MANDIR)/man1"
157         $(Q)mkdir -p "$(MANDIR)/man3"
158         $(INSTALL) -m 644 $(MANPAGES3) "$(MANDIR)/man3"
159 endif
160
161 uninstall: uninstall-doc
162
163 uninstall-doc: uninstall-html uninstall-man
164
165 uninstall-html:
166         $(RM) -r "$(DOCDIR)"
167
168 uninstall-man:
169         $(RM) $(addprefix "$(MANDIR)/man1/",$(AVPROGS-yes:%=%.1) $(AVPROGS-yes:%=%-all.1) $(COMPONENTS-yes:%=%.1))
170         $(RM) $(addprefix "$(MANDIR)/man3/",$(LIBRARIES-yes:%=%.3))
171
172 clean:: docclean
173
174 distclean:: docclean
175         $(RM) doc/config.texi
176
177 examplesclean:
178         $(RM) $(ALL_DOC_EXAMPLES) $(ALL_DOC_EXAMPLES_G)
179         $(RM) $(CLEANSUFFIXES:%=doc/examples/%)
180
181 docclean: examplesclean
182         $(RM) $(CLEANSUFFIXES:%=doc/%)
183         $(RM) $(TXTPAGES) doc/*.html doc/*.pod doc/*.1 doc/*.3 doc/avoptions_*.texi
184         $(RM) -r doc/doxy/html
185
186 -include $(wildcard $(DOCS:%=%.d))
187
188 .PHONY: apidoc doc documentation