doc: fate: Support building a plain text version
[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 TXTPAGES    = doc/fate.txt                                              \
13
14
15 DOCS = $(HTMLPAGES) $(MANPAGES) $(PODPAGES)
16 ifdef HAVE_MAKEINFO
17 DOCS += $(TXTPAGES)
18 endif
19
20 all-$(CONFIG_DOC): documentation
21
22 documentation: $(DOCS)
23
24 TEXIDEP = awk '/^@(verbatim)?include/ { printf "$@: $(@D)/%s\n", $$2 }' <$< >$(@:%=%.d)
25
26 doc/%.txt: TAG = TXT
27 doc/%.txt: doc/%.texi
28         $(Q)$(TEXIDEP)
29         $(M)makeinfo --force --no-headers -o $@ $< 2>/dev/null
30
31 doc/%.html: TAG = HTML
32 doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.init
33         $(Q)$(TEXIDEP)
34         $(M)texi2html -monolithic --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
35
36 doc/%.pod: TAG = POD
37 doc/%.pod: doc/%.texi
38         $(Q)$(TEXIDEP)
39         $(M)$(SRC_PATH)/doc/texi2pod.pl $< $@
40
41 doc/%.1: TAG = MAN
42 doc/%.1: doc/%.pod
43         $(M)pod2man --section=1 --center=" " --release=" " $< > $@
44
45 $(DOCS): | doc
46 OBJDIRS += doc
47
48 install-progs-$(CONFIG_DOC): install-man
49
50 install-man: $(MANPAGES)
51         $(Q)mkdir -p "$(MANDIR)/man1"
52         $(INSTALL) -m 644 $(MANPAGES) "$(MANDIR)/man1"
53
54 uninstall: uninstall-man
55
56 uninstall-man:
57         $(RM) $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
58
59 clean::
60         $(RM) $(TXTPAGES) doc/*.html doc/*.pod doc/*.1 $(CLEANSUFFIXES:%=doc/%)
61
62 -include $(wildcard $(DOCS:%=%.d))
63
64 .PHONY: documentation