Makefile 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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 ''
  20. @$(MAKE) -s -f utils/makefile.include make-help
  21. @echo ''
  22. @$(MAKE) -s -f utils/makefile.python python-help
  23. PHONY += install
  24. install: pyenvinstall
  25. PHONY += uninstall
  26. uninstall: pyenvuninstall
  27. PHONY += clean
  28. clean: pyclean
  29. $(call cmd,common_clean)
  30. PHONY += run
  31. run: pyenvinstall
  32. $(Q) ( \
  33. sed -i -e "s/debug : False/debug : True/g" ./searx/settings.yml ; \
  34. sleep 2 ; \
  35. xdg-open http://127.0.0.1:8888/ ; \
  36. sleep 3 ; \
  37. sed -i -e "s/debug : True/debug : False/g" ./searx/settings.yml ; \
  38. ) &
  39. $(PY_ENV)/bin/python ./searx/webapp.py
  40. # docs
  41. # ----
  42. PHONY += docs
  43. docs: pyenvinstall sphinx-doc
  44. $(call cmd,sphinx,html,docs,docs)
  45. PHONY += docs-live
  46. docs-live: pyenvinstall sphinx-live
  47. $(call cmd,sphinx_autobuild,html,docs,docs)
  48. # test
  49. # ----
  50. PHONY += test test.pylint test.pep8 test.unit test.robot
  51. # TODO: balance linting with pylint
  52. test: test.pep8 test.unit test.robot
  53. - make pylint
  54. test.pep8: pyenvinstall
  55. $(PY_ENV_ACT); ./manage.sh pep8_check
  56. test.unit: pyenvinstall
  57. $(PY_ENV_ACT); ./manage.sh unit_tests
  58. test.robot: pyenvinstall
  59. $(PY_ENV_ACT); ./manage.sh install_geckodriver
  60. $(PY_ENV_ACT); ./manage.sh robot_tests
  61. .PHONY: $(PHONY)