Makefile 1.7 KB

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