Makefile 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. # Copyright (C) 2017-2018 Alpha Griffin
  2. # @%@~LICENSE~@%@
  3. #
  4. # A simple make file for any Python project.
  5. # Adapted from the file auto-generated by sphinx-quickstart.
  6. # You can set these variables from the command line.
  7. SPHINXOPTS = -c etc/sphinx
  8. SPHINXBUILD = python3 -m sphinx
  9. PAPER =
  10. DOCDIR = doc
  11. # Internal variables.
  12. PAPEROPT_a4 = -D latex_paper_size=a4
  13. PAPEROPT_letter = -D latex_paper_size=letter
  14. ALLSPHINXOPTS = -d $(DOCDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
  15. # the i18n builder cannot share the environment and doctrees with the others
  16. I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
  17. .PHONY: default
  18. default: help
  19. @echo
  20. @echo "Please choose a make target and try again."
  21. help:
  22. @echo "Please use \`make <target>' where <target> is one of"
  23. @echo " help display this help screen"
  24. @echo ""
  25. @echo " all to make all common tasks: python, docs"
  26. @echo " clean to clean all common tasks: python_clean, docs_clean"
  27. @echo ""
  28. @echo " run run the application in-place"
  29. @echo " install to install what has been built to the system (first try make all)"
  30. @echo ""
  31. @echo " python to build Python code"
  32. @echo " python_clean to clean up after Python build"
  33. @echo ""
  34. @echo " apidoc to generate new API template files for Sphinx"
  35. @echo " apidoc_clean to remove the API template files for Sphinx (USE CAUTION: these may have been manually edited)"
  36. @echo ""
  37. @echo " docs to make all documentation: html, text, man, coverage"
  38. @echo " docs_clean to clean up all generated documentation"
  39. @echo " html to make standalone HTML files"
  40. @echo " text to make text files"
  41. @echo " man to make manual pages"
  42. all: python docs
  43. clean: docs_clean python_clean
  44. python:
  45. ./setup.py build_py
  46. python_clean:
  47. ./setup.py clean
  48. rm -rf build
  49. rm -rf *.egg-info
  50. find . -type d -name __pycache__ | xargs -r rm -r
  51. find . -type f -name "*.pyc" | xargs -r rm
  52. run:
  53. ./orbit-cli
  54. install:
  55. ./setup.py install
  56. if [ -d "doc/man" ]; then \
  57. install -d /usr/local/share/man/man1; \
  58. cp -r doc/man/*.1 /usr/local/share/man/man1/; \
  59. install -d /usr/local/share/man/man3; \
  60. cp -r doc/man/*.3 /usr/local/share/man/man3/; \
  61. fi
  62. apidoc:
  63. sphinx-apidoc --module-first ag -o api
  64. apidoc_clean:
  65. rm -rf api
  66. docs: html text man coverage
  67. @echo "Documentation finished."
  68. docs_clean:
  69. rm -rf $(DOCDIR)/doctrees
  70. rm -rf $(DOCDIR)/html
  71. rm -rf $(DOCDIR)/text
  72. rm -rf $(DOCDIR)/man
  73. rm -rf $(DOCDIR)/coverage
  74. html:
  75. $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(DOCDIR)/html
  76. cp CHANGELOG $(DOCDIR)/html
  77. cp LICENSE $(DOCDIR)/html
  78. cp TODO $(DOCDIR)/html
  79. @echo
  80. @echo "Build finished. The HTML pages are in $(DOCDIR)/html."
  81. text:
  82. $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(DOCDIR)/text
  83. @echo
  84. @echo "Build finished. The text files are in $(DOCDIR)/text."
  85. man:
  86. $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(DOCDIR)/man
  87. @echo
  88. @echo "Build finished. The manual pages are in $(DOCDIR)/man."
  89. coverage:
  90. $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(DOCDIR)/coverage
  91. @echo "Testing of coverage in the sources finished, look at the " \
  92. "results in $(DOCDIR)/coverage/python.txt."