Makefile 1.8 KB

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