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.

90 lines
1.8 KiB

  1. include Makefile.conf
  2. .PHONY: all compile compile-inplace dist dist-egg dist-whl install install-user venv envtest install-test test develop docs clean clean-all clean-docs
  3. all: dist
  4. # Build
  5. # =====
  6. compile:
  7. python3 setup.py build_ext $(DEBUG_OPT) $(PREFIX_OPT)
  8. compile-inplace:
  9. python3 setup.py build_ext $(DEBUG_OPT) $(PREFIX_OPT) --inplace
  10. # Packaging
  11. # =========
  12. # create wheel and egg package in dist/
  13. dist: dist-whl dist-egg
  14. # create wheel package in dist/
  15. dist-whl: compile
  16. python3 setup.py bdist_wheel
  17. # create egg package in dist/
  18. dist-egg: compile
  19. python3 setup.py bdist_egg
  20. # Installation
  21. # ============
  22. # installs the package system wide
  23. install: compile
  24. pip3 install .
  25. # installs the package into your user home
  26. install-user: compile
  27. pip3 install . --user
  28. # Envrionment
  29. # ===========
  30. # Creates and activates a new venv that has the LD_LIBRARY_PATH/DYLD_LIBRARY_PATH
  31. # already set for the prefix specified in local.conf
  32. # Only activates venv if already existing
  33. venv:
  34. python3 -m venv $(VENV_DIR)
  35. LD_LIBRARY_PATH=$(PREFIX)/lib \
  36. DYLD_LIBRARY_PATH=$(PREFIX)/lib \
  37. bash --rcfile $(VENV_DIR)/bin/activate
  38. # Tests if the current environment is able to load the pEp module
  39. envtest:
  40. python3 -c 'import pEp'
  41. # Test
  42. # ====
  43. # Use these targets only in venv created with 'make venv'
  44. install-test: compile
  45. pip3 install .[test]
  46. # TODO: maybe use setup.py test?
  47. # --forked, because every test needs a separate process, see PYADPT-100
  48. test:
  49. pytest
  50. # Development
  51. develop: compile
  52. pip install -e .
  53. # Documentation
  54. # =============
  55. docs: compile-inplace
  56. make html -C docs/
  57. # Housekeeping
  58. # ============
  59. clean-all: clean
  60. rm -rf $(VENV_DIR)
  61. clean: clean-docs
  62. rm -rf $(BUILD_DIR)
  63. rm -rf $(DIST_DIR)
  64. rm -rf $(PYTHON_ARTIFACTS)
  65. rm -rf $(VERSION_FILE)
  66. rm -rf $(BUILD_INPLACE)
  67. clean-docs:
  68. make clean -C docs/