Makefile 2.14 KB
Newer Older
1 2
MANPAGES    = $(PROGS-yes:%=doc/%.1)
PODPAGES    = $(PROGS-yes:%=doc/%.pod)
3 4 5
HTMLPAGES   = $(PROGS-yes:%=doc/%.html)                                 \
              doc/developer.html                                        \
              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 13 14
TXTPAGES    = doc/fate.txt                                              \


15
DOCS = $(HTMLPAGES) $(MANPAGES) $(PODPAGES)
16 17 18
ifdef HAVE_MAKEINFO
DOCS += $(TXTPAGES)
endif
19 20 21 22 23

all-$(CONFIG_DOC): documentation

documentation: $(DOCS)

24
TEXIDEP = awk '/^@(verbatim)?include/ { printf "$@: $(@D)/%s\n", $$2 }' <$< >$(@:%=%.d)
25

26 27 28 29 30
doc/%.txt: TAG = TXT
doc/%.txt: doc/%.texi
	$(Q)$(TEXIDEP)
	$(M)makeinfo --force --no-headers -o $@ $< 2>/dev/null

31 32 33 34 35 36 37 38 39
doc/print_options.o: libavformat/options_table.h libavcodec/options_table.h

GENTEXI  = format codec
GENTEXI := $(GENTEXI:%=doc/avoptions_%.texi)

$(GENTEXI): TAG = GENTEXI
$(GENTEXI): doc/avoptions_%.texi: doc/print_options
	$(M)doc/print_options $* > $@

40
doc/%.html: TAG = HTML
41
doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI)
42
	$(Q)$(TEXIDEP)
43
	$(M)texi2html -I doc -monolithic --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
44 45

doc/%.pod: TAG = POD
46
doc/%.pod: doc/%.texi $(GENTEXI)
47
	$(Q)$(TEXIDEP)
48
	$(M)$(SRC_PATH)/doc/texi2pod.pl -Idoc $< $@
49 50

doc/%.1: TAG = MAN
51
doc/%.1: doc/%.pod $(GENTEXI)
52 53
	$(M)pod2man --section=1 --center=" " --release=" " $< > $@

54
$(DOCS): | doc/
55

56 57 58 59 60 61 62 63 64 65 66 67
install-progs-$(CONFIG_DOC): install-man

install-man: $(MANPAGES)
	$(Q)mkdir -p "$(MANDIR)/man1"
	$(INSTALL) -m 644 $(MANPAGES) "$(MANDIR)/man1"

uninstall: uninstall-man

uninstall-man:
	$(RM) $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))

clean::
68
	$(RM) $(TXTPAGES) doc/*.html doc/*.pod doc/*.1 $(CLEANSUFFIXES:%=doc/%) doc/avoptions_*.texi
69 70 71 72

-include $(wildcard $(DOCS:%=%.d))

.PHONY: documentation