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