0acd9844afb8b312f87ddcdbf1b80b00ae78b659
[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/%.html: TAG = HTML
21 doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.init
22         $(Q)$(TEXIDEP)
23         $(M)texi2html -monolithic --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
24
25 doc/%.pod: TAG = POD
26 doc/%.pod: doc/%.texi
27         $(Q)$(TEXIDEP)
28         $(M)$(SRC_PATH)/doc/texi2pod.pl $< $@
29
30 doc/%.1: TAG = MAN
31 doc/%.1: doc/%.pod
32         $(M)pod2man --section=1 --center=" " --release=" " $< > $@
33
34 $(DOCS): | doc
35 OBJDIRS += doc
36
37 install-progs-$(CONFIG_DOC): install-man
38
39 install-man: $(MANPAGES)
40         $(Q)mkdir -p "$(MANDIR)/man1"
41         $(INSTALL) -m 644 $(MANPAGES) "$(MANDIR)/man1"
42
43 uninstall: uninstall-man
44
45 uninstall-man:
46         $(RM) $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
47
48 clean::
49         $(RM) doc/*.html doc/*.pod doc/*.1 $(CLEANSUFFIXES:%=doc/%)
50
51 -include $(wildcard $(DOCS:%=%.d))
52
53 .PHONY: documentation