Merge commit 'f4ca970dba13a60a1334cce1b574036e6f624b9c'
[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   = $(PROGS-yes:%=doc/%.1)    $(PROGS-yes:%=doc/%-all.1)    $(COMPONENTS-yes:%=doc/%.1)
18 MANPAGES3   = $(LIBRARIES-yes:%=doc/%.3)
19 MANPAGES    = $(MANPAGES1) $(MANPAGES3)
20 PODPAGES    = $(PROGS-yes:%=doc/%.pod)  $(PROGS-yes:%=doc/%-all.pod)  $(COMPONENTS-yes:%=doc/%.pod)  $(LIBRARIES-yes:%=doc/%.pod)
21 HTMLPAGES   = $(PROGS-yes:%=doc/%.html) $(PROGS-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 = awk '/^@(verbatim)?include/ { printf "$@: $(@D)/%s\n", $$2 }' <$< >$(@:%=%.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/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI)
62         $(Q)$(TEXIDEP)
63         $(M)texi2html -I doc -monolithic --D=config-not-all --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
64
65 doc/%-all.html: TAG = HTML
66 doc/%-all.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI)
67         $(Q)$(TEXIDEP)
68         $(M)texi2html -I doc -monolithic --D=config-all --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
69
70 doc/%.pod: TAG = POD
71 doc/%.pod: doc/%.texi $(SRC_PATH)/doc/texi2pod.pl $(GENTEXI)
72         $(Q)$(TEXIDEP)
73         $(M)perl $(SRC_PATH)/doc/texi2pod.pl -Dconfig-not-all=yes -Idoc $< $@
74
75 doc/%-all.pod: TAG = POD
76 doc/%-all.pod: doc/%.texi $(SRC_PATH)/doc/texi2pod.pl $(GENTEXI)
77         $(Q)$(TEXIDEP)
78         $(M)perl $(SRC_PATH)/doc/texi2pod.pl -Dconfig-all=yes -Idoc $< $@
79
80 doc/%.1 doc/%.3: TAG = MAN
81 doc/%.1: doc/%.pod $(GENTEXI)
82         $(M)pod2man --section=1 --center=" " --release=" " $< > $@
83 doc/%.3: doc/%.pod $(GENTEXI)
84         $(M)pod2man --section=3 --center=" " --release=" " $< > $@
85
86 $(DOCS) doc/doxy/html: | doc/
87
88 doc/doxy/html: $(SRC_PATH)/doc/Doxyfile $(INSTHEADERS)
89         $(M)$(SRC_PATH)/doc/doxy-wrapper.sh $(SRC_PATH) $^
90
91 install-man:
92
93 ifdef CONFIG_MANPAGES
94 install-progs-$(CONFIG_DOC): install-doc install-man
95
96 install-doc: $(HTMLPAGES)
97         $(Q)mkdir -p "$(DOCDIR)"
98         $(INSTALL) -m 644 $(HTMLPAGES) "$(DOCDIR)"
99
100 install-man: $(MANPAGES)
101         $(Q)mkdir -p "$(MANDIR)/man1"
102         $(INSTALL) -m 644 $(MANPAGES1) "$(MANDIR)/man1"
103         $(Q)mkdir -p "$(MANDIR)/man3"
104         $(INSTALL) -m 644 $(MANPAGES3) "$(MANDIR)/man3"
105 endif
106
107 uninstall: uninstall-doc uninstall-man
108
109 uninstall-doc:
110         $(RM) -r "$(DOCDIR)"
111
112 uninstall-man:
113         $(RM) $(addprefix "$(MANDIR)/man1/",$(MANPAGES1))
114         $(RM) $(addprefix "$(MANDIR)/man3/",$(MANPAGES3))
115
116 clean:: docclean
117
118 distclean:: docclean
119         $(RM) doc/config.texi
120
121 docclean:
122         $(RM) $(TXTPAGES) doc/*.html doc/*.pod doc/*.1 doc/*.3 $(CLEANSUFFIXES:%=doc/%) doc/avoptions_*.texi
123         $(RM) -r doc/doxy/html
124
125 -include $(wildcard $(DOCS:%=%.d))
126
127 .PHONY: apidoc doc documentation