Merge commit 'acb0dea27efff4b35796015b96570b59fd517078'
[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 all-$(CONFIG_DOC): doc
40
41 doc: documentation
42
43 apidoc: doc/doxy/html
44 documentation: $(DOCS)
45
46 TEXIDEP = perl $(SRC_PATH)/doc/texidep.pl $(SRC_PATH) $< $@ >$(@:%=%.d)
47
48 doc/%.txt: TAG = TXT
49 doc/%.txt: doc/%.texi
50         $(Q)$(TEXIDEP)
51         $(M)makeinfo --force --no-headers -o $@ $< 2>/dev/null
52
53 GENTEXI  = format codec
54 GENTEXI := $(GENTEXI:%=doc/avoptions_%.texi)
55
56 $(GENTEXI): TAG = GENTEXI
57 $(GENTEXI): doc/avoptions_%.texi: doc/print_options$(HOSTEXESUF)
58         $(M)doc/print_options $* > $@
59
60 doc/%.html: TAG = HTML
61 doc/%-all.html: TAG = HTML
62
63 ifdef HAVE_MAKEINFO_HTML
64 doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.pm $(GENTEXI)
65         $(Q)$(TEXIDEP)
66         $(M)makeinfo --html -I doc --no-split -D config-not-all --init-file=$(SRC_PATH)/doc/t2h.pm --output $@ $<
67
68 doc/%-all.html: doc/%.texi $(SRC_PATH)/doc/t2h.pm $(GENTEXI)
69         $(Q)$(TEXIDEP)
70         $(M)makeinfo --html -I doc --no-split -D config-all --init-file=$(SRC_PATH)/doc/t2h.pm --output $@ $<
71 else
72 doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI)
73         $(Q)$(TEXIDEP)
74         $(M)texi2html -I doc -monolithic --D=config-not-all --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
75
76 doc/%-all.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI)
77         $(Q)$(TEXIDEP)
78         $(M)texi2html -I doc -monolithic --D=config-all --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
79 endif
80
81 doc/%.pod: TAG = POD
82 doc/%.pod: doc/%.texi $(SRC_PATH)/doc/texi2pod.pl $(GENTEXI)
83         $(Q)$(TEXIDEP)
84         $(M)perl $(SRC_PATH)/doc/texi2pod.pl -Dconfig-not-all=yes -Idoc $< $@
85
86 doc/%-all.pod: TAG = POD
87 doc/%-all.pod: doc/%.texi $(SRC_PATH)/doc/texi2pod.pl $(GENTEXI)
88         $(Q)$(TEXIDEP)
89         $(M)perl $(SRC_PATH)/doc/texi2pod.pl -Dconfig-all=yes -Idoc $< $@
90
91 doc/%.1 doc/%.3: TAG = MAN
92 doc/%.1: doc/%.pod $(GENTEXI)
93         $(M)pod2man --section=1 --center=" " --release=" " --date=" " $< > $@
94 doc/%.3: doc/%.pod $(GENTEXI)
95         $(M)pod2man --section=3 --center=" " --release=" " --date=" " $< > $@
96
97 $(DOCS) doc/doxy/html: | doc/
98
99 DOXY_INPUT      = $(INSTHEADERS)
100 DOXY_INPUT_DEPS = $(addprefix $(SRC_PATH)/, $(DOXY_INPUT)) ffbuild/config.mak
101
102 doc/doxy/html: TAG = DOXY
103 doc/doxy/html: $(SRC_PATH)/doc/Doxyfile $(SRC_PATH)/doc/doxy-wrapper.sh $(DOXY_INPUT_DEPS)
104         $(M)OUT_DIR=$$PWD/doc/doxy; cd $(SRC_PATH); ./doc/doxy-wrapper.sh $$OUT_DIR $< $(DOXYGEN) $(DOXY_INPUT);
105
106 install-doc: install-html install-man
107
108 install-html:
109
110 install-man:
111
112 ifdef CONFIG_HTMLPAGES
113 install-progs-$(CONFIG_DOC): install-html
114
115 install-html: $(HTMLPAGES)
116         $(Q)mkdir -p "$(DOCDIR)"
117         $(INSTALL) -m 644 $(HTMLPAGES) "$(DOCDIR)"
118 endif
119
120 ifdef CONFIG_MANPAGES
121 install-progs-$(CONFIG_DOC): install-man
122
123 install-man: $(MANPAGES)
124         $(Q)mkdir -p "$(MANDIR)/man1"
125         $(INSTALL) -m 644 $(MANPAGES1) "$(MANDIR)/man1"
126         $(Q)mkdir -p "$(MANDIR)/man3"
127         $(INSTALL) -m 644 $(MANPAGES3) "$(MANDIR)/man3"
128 endif
129
130 uninstall: uninstall-doc
131
132 uninstall-doc: uninstall-html uninstall-man
133
134 uninstall-html:
135         $(RM) -r "$(DOCDIR)"
136
137 uninstall-man:
138         $(RM) $(addprefix "$(MANDIR)/man1/",$(AVPROGS-yes:%=%.1) $(AVPROGS-yes:%=%-all.1) $(COMPONENTS-yes:%=%.1))
139         $(RM) $(addprefix "$(MANDIR)/man3/",$(LIBRARIES-yes:%=%.3))
140
141 clean:: docclean
142
143 distclean:: docclean
144         $(RM) doc/config.texi
145
146 docclean::
147         $(RM) $(CLEANSUFFIXES:%=doc/%)
148         $(RM) $(TXTPAGES) doc/*.html doc/*.pod doc/*.1 doc/*.3 doc/avoptions_*.texi
149         $(RM) -r doc/doxy/html
150
151 -include $(wildcard $(DOCS:%=%.d))
152
153 .PHONY: apidoc doc documentation