Makefile 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. # -*- coding: utf-8; mode: makefile-gmake -*-
  2. export GIT_URL=https://github.com/asciimoo/searx
  3. export SEARX_URL=https://searx.me
  4. export DOCS_URL=https://asciimoo.github.io/searx
  5. PYOBJECTS = searx
  6. DOC = docs
  7. PY_SETUP_EXTRAS ?= \[test\]
  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 ''
  22. @$(MAKE) -s -f utils/makefile.include make-help
  23. @echo ''
  24. @$(MAKE) -s -f utils/makefile.python python-help
  25. PHONY += install
  26. install: pyenvinstall
  27. PHONY += uninstall
  28. uninstall: pyenvuninstall
  29. PHONY += clean
  30. clean: pyclean
  31. $(call cmd,common_clean)
  32. PHONY += run
  33. run: pyenvinstall
  34. $(Q) ( \
  35. sed -i -e "s/debug : False/debug : True/g" ./searx/settings.yml ; \
  36. sleep 2 ; \
  37. xdg-open http://127.0.0.1:8888/ ; \
  38. sleep 3 ; \
  39. sed -i -e "s/debug : True/debug : False/g" ./searx/settings.yml ; \
  40. ) &
  41. $(PY_ENV)/bin/python ./searx/webapp.py
  42. # docs
  43. # ----
  44. PHONY += docs
  45. docs: pyenvinstall sphinx-doc
  46. $(call cmd,sphinx,html,docs,docs)
  47. PHONY += docs-live
  48. docs-live: pyenvinstall sphinx-live
  49. $(call cmd,sphinx_autobuild,html,docs,docs)
  50. $(GH_PAGES)::
  51. @echo "doc available at --> $(DOCS_URL)"
  52. # test
  53. # ----
  54. PHONY += test test.pylint test.pep8 test.unit test.robot
  55. # TODO: balance linting with pylint
  56. test: test.pep8 test.unit test.robot
  57. - make pylint
  58. test.pep8: pyenvinstall
  59. $(PY_ENV_ACT); ./manage.sh pep8_check
  60. test.unit: pyenvinstall
  61. $(PY_ENV_ACT); ./manage.sh unit_tests
  62. test.robot: pyenvinstall
  63. $(PY_ENV_ACT); ./manage.sh install_geckodriver
  64. $(PY_ENV_ACT); ./manage.sh robot_tests
  65. .PHONY: $(PHONY)