Makefile 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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 ' project - re-build generic files of the searx project'
  25. @echo ''
  26. @$(MAKE) -s -f utils/makefile.include make-help
  27. @echo ''
  28. @$(MAKE) -s -f utils/makefile.python python-help
  29. PHONY += install
  30. install: pyenvinstall
  31. PHONY += uninstall
  32. uninstall: pyenvuninstall
  33. PHONY += clean
  34. clean: pyclean
  35. $(call cmd,common_clean)
  36. PHONY += run
  37. run: pyenvinstall
  38. $(Q) ( \
  39. sed -i -e "s/debug : False/debug : True/g" ./searx/settings.yml ; \
  40. sleep 2 ; \
  41. xdg-open http://127.0.0.1:8888/ ; \
  42. sleep 3 ; \
  43. sed -i -e "s/debug : True/debug : False/g" ./searx/settings.yml ; \
  44. ) &
  45. $(PY_ENV)/bin/python ./searx/webapp.py
  46. # docs
  47. # ----
  48. PHONY += docs
  49. docs: pyenvinstall sphinx-doc
  50. $(call cmd,sphinx,html,docs,docs)
  51. PHONY += docs-live
  52. docs-live: pyenvinstall sphinx-live
  53. $(call cmd,sphinx_autobuild,html,docs,docs)
  54. $(GH_PAGES)::
  55. @echo "doc available at --> $(DOCS_URL)"
  56. # update project files
  57. # --------------------
  58. PHONY += project engines-languages
  59. project: searx/data/engines_languages.json
  60. searx/data/engines_languages.json: pyenvinstall
  61. $(PY_ENV_ACT); python utils/fetch_languages.py
  62. mv engines_languages.json searx/data/engines_languages.json
  63. mv languages.py searx/languages.py
  64. # test
  65. # ----
  66. PHONY += test test.pylint test.pep8 test.unit test.robot
  67. test: test.pylint test.pep8 test.unit test.robot
  68. # TODO: balance linting with pylint
  69. test.pylint: pyenvinstall
  70. $(call cmd,pylint,searx/preferences.py)
  71. $(call cmd,pylint,searx/testing.py)
  72. test.pep8: pyenvinstall
  73. $(PY_ENV_ACT); ./manage.sh pep8_check
  74. test.unit: pyenvinstall
  75. $(PY_ENV_ACT); ./manage.sh unit_tests
  76. test.robot: pyenvinstall
  77. $(PY_ENV_ACT); ./manage.sh install_geckodriver
  78. $(PY_ENV_ACT); ./manage.sh robot_tests
  79. .PHONY: $(PHONY)