module.mk 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. # doc/module.mk
  2. # Part of ZeroTier One, a software-defined network layer.
  3. #
  4. # Copyright © 2016 Ben Finney <[email protected]>
  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.1
  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: manpages
  27. manpages: ${manpage_paths}
  28. %.1: %.1${RST_SUFFIX}
  29. $(RST2MAN) "$<" > "$@"${TEMPFILE_SUFFIX}
  30. cat ${manpage_encoding_stub} "$@"${TEMPFILE_SUFFIX} > "$@"
  31. %.8: %.8${RST_SUFFIX}
  32. $(RST2MAN) "$<" > "$@"${TEMPFILE_SUFFIX}
  33. cat ${manpage_encoding_stub} "$@"${TEMPFILE_SUFFIX} > "$@"
  34. # Local variables:
  35. # coding: utf-8
  36. # mode: makefile
  37. # End:
  38. # vim: fileencoding=utf-8 filetype=make :