Makefile 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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/lxc.sh
  61. shellcheck -x utils/lib.sh
  62. shellcheck -x utils/filtron.sh
  63. shellcheck -x utils/searx.sh
  64. shellcheck -x utils/morty.sh
  65. shellcheck -x .config.sh
  66. test.pep8: pyenvinstall
  67. $(PY_ENV_ACT); ./manage.sh pep8_check
  68. test.unit: pyenvinstall
  69. $(PY_ENV_ACT); ./manage.sh unit_tests
  70. test.robot: pyenvinstall
  71. $(PY_ENV_ACT); ./manage.sh install_geckodriver
  72. $(PY_ENV_ACT); ./manage.sh robot_tests
  73. .PHONY: $(PHONY)