You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

84 lines
2.5KB

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