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