doc: enable compilation of -all tool pages
[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 MANPAGES    = $(PROGS-yes:%=doc/%.1)    $(PROGS-yes:%=doc/%-all.1)    $(COMPONENTS-yes:%=doc/%.1)    $(LIBRARIES-yes:%=doc/%.3)
18 PODPAGES    = $(PROGS-yes:%=doc/%.pod)  $(PROGS-yes:%=doc/%-all.pod)  $(COMPONENTS-yes:%=doc/%.pod)  $(LIBRARIES-yes:%=doc/%.pod)
19 HTMLPAGES   = $(PROGS-yes:%=doc/%.html) $(PROGS-yes:%=doc/%-all.html) $(COMPONENTS-yes:%=doc/%.html) $(LIBRARIES-yes:%=doc/%.html) \
20               doc/developer.html                                        \
21               doc/faq.html                                              \
22               doc/fate.html                                             \
23               doc/general.html                                          \
24               doc/git-howto.html                                        \
25               doc/nut.html                                              \
26               doc/platform.html                                         \
27
28 TXTPAGES    = doc/fate.txt                                              \
29
30
31 DOCS-$(CONFIG_HTMLPAGES) += $(HTMLPAGES)
32 DOCS-$(CONFIG_PODPAGES)  += $(PODPAGES)
33 DOCS-$(CONFIG_MANPAGES)  += $(MANPAGES)
34 DOCS-$(CONFIG_TXTPAGES)  += $(TXTPAGES)
35 DOCS = $(DOCS-yes)
36
37 all-$(CONFIG_DOC): doc
38
39 doc: documentation
40
41 apidoc: doc/doxy/html
42 documentation: $(DOCS)
43
44 TEXIDEP = awk '/^@(verbatim)?include/ { printf "$@: $(@D)/%s\n", $$2 }' <$< >$(@:%=%.d)
45
46 doc/%.txt: TAG = TXT
47 doc/%.txt: doc/%.texi
48         $(Q)$(TEXIDEP)
49         $(M)makeinfo --force --no-headers -o $@ $< 2>/dev/null
50
51 GENTEXI  = format codec
52 GENTEXI := $(GENTEXI:%=doc/avoptions_%.texi)
53
54 $(GENTEXI): TAG = GENTEXI
55 $(GENTEXI): doc/avoptions_%.texi: doc/print_options$(HOSTEXESUF)
56         $(M)doc/print_options $* > $@
57
58 doc/%.html: TAG = HTML
59 doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI)
60         $(Q)$(TEXIDEP)
61         $(M)texi2html -I doc -monolithic --D=config-not-all --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
62
63 doc/%-all.html: TAG = HTML
64 doc/%-all.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI)
65         $(Q)$(TEXIDEP)
66         $(M)texi2html -I doc -monolithic --D=config-all --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
67
68 doc/%.pod: TAG = POD
69 doc/%.pod: doc/%.texi $(SRC_PATH)/doc/texi2pod.pl $(GENTEXI)
70         $(Q)$(TEXIDEP)
71         $(M)perl $(SRC_PATH)/doc/texi2pod.pl -Dconfig-not-all=yes -Idoc $< $@
72
73 doc/%-all.pod: TAG = POD
74 doc/%-all.pod: doc/%.texi $(SRC_PATH)/doc/texi2pod.pl $(GENTEXI)
75         $(Q)$(TEXIDEP)
76         $(M)perl $(SRC_PATH)/doc/texi2pod.pl -Dconfig-all=yes -Idoc $< $@
77
78 doc/%.1 doc/%.3: TAG = MAN
79 doc/%.1: doc/%.pod $(GENTEXI)
80         $(M)pod2man --section=1 --center=" " --release=" " $< > $@
81 doc/%.3: doc/%.pod $(GENTEXI)
82         $(M)pod2man --section=3 --center=" " --release=" " $< > $@
83
84 $(DOCS) doc/doxy/html: | doc/
85
86 doc/doxy/html: $(SRC_PATH)/doc/Doxyfile $(INSTHEADERS)
87         $(M)$(SRC_PATH)/doc/doxy-wrapper.sh $(SRC_PATH) $^
88
89 install-man:
90
91 ifdef CONFIG_MANPAGES
92 install-progs-$(CONFIG_DOC): install-man
93
94 install-man: $(MANPAGES)
95         $(Q)mkdir -p "$(MANDIR)/man1"
96         $(INSTALL) -m 644 $(MANPAGES) "$(MANDIR)/man1"
97 endif
98
99 uninstall: uninstall-man
100
101 uninstall-man:
102         $(RM) $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
103
104 clean:: docclean
105
106 distclean:: docclean
107         $(RM) doc/config.texi
108
109 docclean:
110         $(RM) $(TXTPAGES) doc/*.html doc/*.pod doc/*.1 doc/*.3 $(CLEANSUFFIXES:%=doc/%) doc/avoptions_*.texi
111         $(RM) -r doc/doxy/html
112
113 -include $(wildcard $(DOCS:%=%.d))
114
115 .PHONY: apidoc doc documentation