8f9067417c30bd66af06270233a4aa4e3969d443
[ffmpeg.git] / 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/libavfilter.html                                      \
10               doc/platform.html                                         \
11
12 DOCS = $(HTMLPAGES) $(MANPAGES) $(PODPAGES)
13
14 all-$(CONFIG_DOC): documentation
15
16 documentation: $(DOCS)
17
18 TEXIDEP = awk '/^@include/ { printf "$@: $(@D)/%s\n", $$2 }' <$< >$(@:%=%.d)
19
20 GENTEXI  = format codec
21 GENTEXI := $(GENTEXI:%=doc/avoptions_%.texi)
22
23 $(GENTEXI): TAG = GENTEXI
24 $(GENTEXI): doc/avoptions_%.texi: doc/print_options
25         $(M)doc/print_options $* > $@
26
27 doc/%.html: TAG = HTML
28 doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI)
29         $(Q)$(TEXIDEP)
30         $(M)texi2html -I doc -monolithic --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
31
32 doc/%.pod: TAG = POD
33 doc/%.pod: doc/%.texi $(GENTEXI)
34         $(Q)$(TEXIDEP)
35         $(M)$(SRC_PATH)/doc/texi2pod.pl -Idoc $< $@
36
37 doc/%.1: TAG = MAN
38 doc/%.1: doc/%.pod $(GENTEXI)
39         $(M)pod2man --section=1 --center=" " --release=" " $< > $@
40
41 $(DOCS): | doc/
42
43 install-progs-$(CONFIG_DOC): install-man
44
45 install-man: $(MANPAGES)
46         $(Q)mkdir -p "$(MANDIR)/man1"
47         $(INSTALL) -m 644 $(MANPAGES) "$(MANDIR)/man1"
48
49 uninstall: uninstall-man
50
51 uninstall-man:
52         $(RM) $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
53
54 clean::
55         $(RM) doc/*.html doc/*.pod doc/*.1 $(CLEANSUFFIXES:%=doc/%) doc/avoptions_*.texi
56
57 -include $(wildcard $(DOCS:%=%.d))
58
59 .PHONY: documentation