Generate manpages for AV{Format,Codec}Context AVOptions.
[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 doc/print_options.o: libavformat/options_table.h libavcodec/options_table.h
21
22 GENTEXI  = format codec
23 GENTEXI := $(GENTEXI:%=doc/avoptions_%.texi)
24
25 $(GENTEXI): TAG = GENTEXI
26 $(GENTEXI): doc/avoptions_%.texi: doc/print_options
27         $(M)doc/print_options $* > $@
28
29 doc/%.html: TAG = HTML
30 doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI)
31         $(Q)$(TEXIDEP)
32         $(M)texi2html -monolithic --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
33
34 doc/%.pod: TAG = POD
35 doc/%.pod: doc/%.texi $(GENTEXI)
36         $(Q)$(TEXIDEP)
37         $(M)$(SRC_PATH)/doc/texi2pod.pl $< $@
38
39 doc/%.1: TAG = MAN
40 doc/%.1: doc/%.pod $(GENTEXI)
41         $(M)pod2man --section=1 --center=" " --release=" " $< > $@
42
43 $(DOCS): | doc
44 OBJDIRS += doc
45
46 install-progs-$(CONFIG_DOC): install-man
47
48 install-man: $(MANPAGES)
49         $(Q)mkdir -p "$(MANDIR)/man1"
50         $(INSTALL) -m 644 $(MANPAGES) "$(MANDIR)/man1"
51
52 uninstall: uninstall-man
53
54 uninstall-man:
55         $(RM) $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
56
57 clean::
58         $(RM) doc/*.html doc/*.pod doc/*.1 $(CLEANSUFFIXES:%=doc/%) doc/avoptions_*.texi
59
60 -include $(wildcard $(DOCS:%=%.d))
61
62 .PHONY: documentation