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.

79 lines
2.3KB

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