Makefile 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. # -*- coding: utf-8; mode: makefile-gmake -*-
  2. include ./.config.mk
  3. PYOBJECTS = searx
  4. DOC = docs
  5. PY_SETUP_EXTRAS ?= \[test\]
  6. PYDIST=./dist/py
  7. PYBUILD=./build/py
  8. include utils/makefile.include
  9. include utils/makefile.python
  10. include utils/makefile.sphinx
  11. all: clean install
  12. PHONY += help
  13. help:
  14. @echo ' test - run developer tests'
  15. @echo ' docs - build documentation'
  16. @echo ' docs-live - autobuild HTML documentation while editing'
  17. @echo ' run - run developer instance'
  18. @echo ' install - developer install (./local)'
  19. @echo ' uninstall - uninstall (./local)'
  20. @echo ' gh-pages - build docs & deploy on gh-pages branch'
  21. @echo ' clean - drop builds and environments'
  22. @echo ''
  23. @$(MAKE) -s -f utils/makefile.include make-help
  24. @echo ''
  25. @$(MAKE) -s -f utils/makefile.python python-help
  26. PHONY += install
  27. install: pyenvinstall
  28. PHONY += uninstall
  29. uninstall: pyenvuninstall
  30. PHONY += clean
  31. clean: pyclean
  32. $(call cmd,common_clean)
  33. PHONY += run
  34. run: pyenvinstall
  35. $(Q) ( \
  36. sed -i -e "s/debug : False/debug : True/g" ./searx/settings.yml ; \
  37. sleep 2 ; \
  38. xdg-open http://127.0.0.1:8888/ ; \
  39. sleep 3 ; \
  40. sed -i -e "s/debug : True/debug : False/g" ./searx/settings.yml ; \
  41. ) &
  42. $(PY_ENV)/bin/python ./searx/webapp.py
  43. # docs
  44. # ----
  45. PHONY += docs
  46. docs: pyenvinstall sphinx-doc
  47. $(call cmd,sphinx,html,docs,docs)
  48. PHONY += docs-live
  49. docs-live: pyenvinstall sphinx-live
  50. $(call cmd,sphinx_autobuild,html,docs,docs)
  51. $(GH_PAGES)::
  52. @echo "doc available at --> $(DOCS_URL)"
  53. # test
  54. # ----
  55. PHONY += test test.sh test.pylint test.pep8 test.unit test.robot
  56. # TODO: balance linting with pylint
  57. test: test.pep8 test.unit test.sh test.robot
  58. - make pylint
  59. test.sh:
  60. shellcheck -x utils/lib.sh
  61. shellcheck -x utils/filtron.sh
  62. shellcheck -x utils/searx.sh
  63. shellcheck -x utils/morty.sh
  64. shellcheck -x .config.sh
  65. test.pep8: pyenvinstall
  66. $(PY_ENV_ACT); ./manage.sh pep8_check
  67. test.unit: pyenvinstall
  68. $(PY_ENV_ACT); ./manage.sh unit_tests
  69. test.robot: pyenvinstall
  70. $(PY_ENV_ACT); ./manage.sh install_geckodriver
  71. $(PY_ENV_ACT); ./manage.sh robot_tests
  72. .PHONY: $(PHONY)