module.mk 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. # doc/module.mk
  2. # Part of ZeroTier One, a software-defined network layer.
  3. #
  4. # Copyright © 2016 Ben Finney <ben+zerotier@benfinney.id.au>
  5. # This is free software: you may copy, modify, and/or distribute this
  6. # work under the terms of the GNU General Public License, version 3 or
  7. # later as published by the Free Software Foundation.
  8. # No warranty expressed or implied.
  9. # See the file ‘LICENSE.txt’ for details.
  10. # Makefile module for ZeroTier One documentation.
  11. TEMPFILE_SUFFIX = .tmp
  12. .INTERMEDIATE: ${DOCUMENTATION_DIR}/*${TEMPFILE_SUFFIX}
  13. RST_SUFFIX = .txt
  14. manpage_sections = 1 2 3 4 5 6 7 8
  15. manpage_names += zerotier-one.8
  16. manpage_names += zerotier-idtool.1
  17. manpage_names += zerotier-cli.8
  18. manpage_source_paths = $(addprefix ${DOC_DIR}/, \
  19. $(addsuffix ${RST_SUFFIX},${manpage_names}))
  20. manpage_paths = $(addprefix ${DOC_DIR}/,${manpage_names})
  21. manpage_encoding_stub = ${DOC_DIR}/manpage_encoding_declaration.UTF-8
  22. GENERATED_FILES += $(addprefix ${DOC_DIR}/,\
  23. $(foreach section,${manpage_sections},*.${section}))
  24. RST2MAN = rst2man
  25. RST2MAN_OPTS =
  26. .PHONY: doc
  27. doc: manpages
  28. .PHONY: manpages
  29. manpages: ${manpage_paths}
  30. %.1: %.1${RST_SUFFIX}
  31. $(RST2MAN) "$<" > "$@"${TEMPFILE_SUFFIX}
  32. cat ${manpage_encoding_stub} "$@"${TEMPFILE_SUFFIX} > "$@"
  33. %.8: %.8${RST_SUFFIX}
  34. $(RST2MAN) "$<" > "$@"${TEMPFILE_SUFFIX}
  35. cat ${manpage_encoding_stub} "$@"${TEMPFILE_SUFFIX} > "$@"
  36. # Local variables:
  37. # coding: utf-8
  38. # mode: makefile
  39. # End:
  40. # vim: fileencoding=utf-8 filetype=make :