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