Makefile 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. PYDIST=./dist/py
  9. PYBUILD=./build/py
  10. include utils/makefile.include
  11. include utils/makefile.python
  12. include utils/makefile.sphinx
  13. all: clean install
  14. PHONY += help
  15. help:
  16. @echo ' test - run developer tests'
  17. @echo ' docs - build documentation'
  18. @echo ' docs-live - autobuild HTML documentation while editing'
  19. @echo ' run - run developer instance'
  20. @echo ' install - developer install (./local)'
  21. @echo ' uninstall - uninstall (./local)'
  22. @echo ' gh-pages - build docs & deploy on gh-pages branch'
  23. @echo ' clean - drop builds and environments'
  24. @echo ''
  25. @$(MAKE) -s -f utils/makefile.include make-help
  26. @echo ''
  27. @$(MAKE) -s -f utils/makefile.python python-help
  28. PHONY += install
  29. install: pyenvinstall
  30. PHONY += uninstall
  31. uninstall: pyenvuninstall
  32. PHONY += clean
  33. clean: pyclean
  34. $(call cmd,common_clean)
  35. PHONY += run
  36. run: pyenvinstall
  37. $(Q) ( \
  38. sed -i -e "s/debug : False/debug : True/g" ./searx/settings.yml ; \
  39. sleep 2 ; \
  40. xdg-open http://127.0.0.1:8888/ ; \
  41. sleep 3 ; \
  42. sed -i -e "s/debug : True/debug : False/g" ./searx/settings.yml ; \
  43. ) &
  44. $(PY_ENV)/bin/python ./searx/webapp.py
  45. # docs
  46. # ----
  47. PHONY += docs
  48. docs: pyenvinstall sphinx-doc
  49. $(call cmd,sphinx,html,docs,docs)
  50. PHONY += docs-live
  51. docs-live: pyenvinstall sphinx-live
  52. $(call cmd,sphinx_autobuild,html,docs,docs)
  53. $(GH_PAGES)::
  54. @echo "doc available at --> $(DOCS_URL)"
  55. # test
  56. # ----
  57. PHONY += test test.pylint test.pep8 test.unit test.robot
  58. # TODO: balance linting with pylint
  59. test: test.pep8 test.unit test.robot
  60. - make pylint
  61. test.pep8: pyenvinstall
  62. $(PY_ENV_ACT); ./manage.sh pep8_check
  63. test.unit: pyenvinstall
  64. $(PY_ENV_ACT); ./manage.sh unit_tests
  65. test.robot: pyenvinstall
  66. $(PY_ENV_ACT); ./manage.sh install_geckodriver
  67. $(PY_ENV_ACT); ./manage.sh robot_tests
  68. .PHONY: $(PHONY)