Makefile 2.2 KB

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