afe361f24ef2bf0cd98319f97409af395eef5484
[ffmpeg.git] / doc / Makefile
1 DOCLIBS-$(CONFIG_AVUTIL)  += libavutil
2 DOCLIBS-$(CONFIG_SWRESAMPLE) += libswresample
3 DOCLIBS-$(CONFIG_AVCODEC) += libavcodec
4 DOCLIBS-$(CONFIG_AVFILTER) += libavfilter
5
6 COMPONENTS=$(PROGS-yes) ffmpeg-codecs ffmpeg-filters ffmpeg-resampler
7
8 MANPAGES    = $(COMPONENTS:%=doc/%.1)    $(DOCLIBS-yes:%=doc/%.3)
9 PODPAGES    = $(COMPONENTS:%=doc/%.pod)  $(DOCLIBS-yes:%=doc/%.pod)
10 HTMLPAGES   = $(COMPONENTS:%=doc/%.html) $(DOCLIBS-yes:%=doc/%.html)     \
11               doc/developer.html                                        \
12               doc/faq.html                                              \
13               doc/fate.html                                             \
14               doc/general.html                                          \
15               doc/git-howto.html                                        \
16               doc/nut.html                                              \
17               doc/platform.html                                         \
18               doc/syntax.html                                           \
19
20 TXTPAGES    = doc/fate.txt                                              \
21
22
23 DOCS-$(CONFIG_HTMLPAGES) += $(HTMLPAGES)
24 DOCS-$(CONFIG_PODPAGES)  += $(PODPAGES)
25 DOCS-$(CONFIG_MANPAGES)  += $(MANPAGES)
26 DOCS-$(CONFIG_TXTPAGES)  += $(TXTPAGES)
27 DOCS = $(DOCS-yes)
28
29 all-$(CONFIG_DOC): doc
30
31 doc: documentation
32
33 apidoc: doc/doxy/html
34 documentation: $(DOCS)
35
36 TEXIDEP = awk '/^@(verbatim)?include/ { printf "$@: $(@D)/%s\n", $$2 }' <$< >$(@:%=%.d)
37
38 doc/%.txt: TAG = TXT
39 doc/%.txt: doc/%.texi
40         $(Q)$(TEXIDEP)
41         $(M)makeinfo --force --no-headers -o $@ $< 2>/dev/null
42
43 GENTEXI  = format codec
44 GENTEXI := $(GENTEXI:%=doc/avoptions_%.texi)
45
46 $(GENTEXI): TAG = GENTEXI
47 $(GENTEXI): doc/avoptions_%.texi: doc/print_options$(HOSTEXESUF)
48         $(M)doc/print_options $* > $@
49
50 doc/%.html: TAG = HTML
51 doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI)
52         $(Q)$(TEXIDEP)
53         $(M)texi2html -I doc -monolithic --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
54
55 doc/%.pod: TAG = POD
56 doc/%.pod: doc/%.texi $(GENTEXI)
57         $(Q)$(TEXIDEP)
58         $(M)perl $(SRC_PATH)/doc/texi2pod.pl -Idoc $< $@
59
60 doc/%.1 doc/%.3: TAG = MAN
61 doc/%.1: doc/%.pod $(GENTEXI)
62         $(M)pod2man --section=1 --center=" " --release=" " $< > $@
63 doc/%.3: doc/%.pod $(GENTEXI)
64         $(M)pod2man --section=3 --center=" " --release=" " $< > $@
65
66 $(DOCS) doc/doxy/html: | doc/
67
68 doc/doxy/html: $(SRC_PATH)/doc/Doxyfile $(INSTHEADERS)
69         $(M)$(SRC_PATH)/doc/doxy-wrapper.sh $(SRC_PATH) $^
70
71 install-man:
72
73 ifdef CONFIG_MANPAGES
74 install-progs-$(CONFIG_DOC): install-man
75
76 install-man: $(MANPAGES)
77         $(Q)mkdir -p "$(MANDIR)/man1"
78         $(INSTALL) -m 644 $(MANPAGES) "$(MANDIR)/man1"
79 endif
80
81 uninstall: uninstall-man
82
83 uninstall-man:
84         $(RM) $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
85
86 clean::
87         $(RM) $(TXTPAGES) doc/*.html doc/*.pod doc/*.1 doc/*.3 $(CLEANSUFFIXES:%=doc/%) doc/avoptions_*.texi
88         $(RM) -r doc/doxy/html
89
90 -include $(wildcard $(DOCS:%=%.d))
91
92 .PHONY: apidoc doc documentation