Makefile 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. # -*- coding: utf-8; mode: makefile-gmake -*-
  2. # SPDX-License-Identifier: AGPL-3.0-or-later
  3. .DEFAULT_GOAL=help
  4. export MTOOLS=./manage
  5. include utils/makefile.include
  6. all: clean install
  7. PHONY += help
  8. help:
  9. @./manage --help
  10. @echo '----'
  11. @echo 'run - run developer instance'
  12. @echo 'install - developer install of searx into virtualenv'
  13. @echo 'uninstall - uninstall developer installation'
  14. @echo 'clean - clean up working tree'
  15. @echo 'search.checker - check search engines'
  16. @echo 'test - run shell & CI tests'
  17. @echo 'test.sh - test shell scripts'
  18. @echo 'ci.test - run CI tests'
  19. PHONY += run
  20. run: install
  21. $(Q) ( \
  22. sleep 2 ; \
  23. xdg-open http://127.0.0.1:8888/ ; \
  24. ) &
  25. SEARX_DEBUG=1 ./manage pyenv.cmd python ./searx/webapp.py
  26. PHONY += install uninstall
  27. install uninstall:
  28. $(Q)./manage pyenv.$@
  29. PHONY += clean
  30. clean: py.clean docs.clean node.clean test.clean
  31. $(Q)./manage build_msg CLEAN "common files"
  32. $(Q)find . -name '*.orig' -exec rm -f {} +
  33. $(Q)find . -name '*.rej' -exec rm -f {} +
  34. $(Q)find . -name '*~' -exec rm -f {} +
  35. $(Q)find . -name '*.bak' -exec rm -f {} +
  36. PHONY += search.checker search.checker.%
  37. search.checker: install
  38. $(Q)./manage pyenv.cmd searx-checker -v
  39. search.checker.%: install
  40. $(Q)./manage pyenv.cmd searx-checker -v "$(subst _, ,$(patsubst search.checker.%,%,$@))"
  41. PHONY += ci.test test test.sh
  42. ci.test: test.pep8 test.pylint test.unit test.robot
  43. test: ci.test
  44. test.sh:
  45. $(Q)shellcheck -x -s bash \
  46. utils/brand.env \
  47. ./manage \
  48. utils/lib.sh \
  49. utils/filtron.sh \
  50. utils/searx.sh \
  51. utils/morty.sh \
  52. utils/lxc.sh \
  53. utils/lxc-searx.env \
  54. .config.sh
  55. $(Q)./manage build_msg TEST "$@ OK"
  56. # wrap ./manage script
  57. MANAGE += buildenv
  58. MANAGE += babel.compile
  59. MANAGE += data.all data.languages data.useragents
  60. MANAGE += docs.html docs.live docs.gh-pages docs.prebuild docs.clean
  61. MANAGE += docker.build docker.push
  62. MANAGE += gecko.driver
  63. MANAGE += node.env node.clean
  64. MANAGE += py.build py.clean
  65. MANAGE += pyenv pyenv.install pyenv.uninstall
  66. MANAGE += pypi.upload pypi.upload.test
  67. MANAGE += test.pylint test.pep8 test.unit test.coverage test.robot test.clean
  68. MANAGE += themes.all themes.oscar themes.simple themes.bootstrap
  69. PHONY += $(MANAGE)
  70. $(MANAGE):
  71. $(Q)$(MTOOLS) $@
  72. # deprecated
  73. PHONY += docs docs-clean docs-live docker themes
  74. docs: docs.html
  75. $(Q)./manage build_msg WARN $@ is deprecated use docs.html
  76. docs-clean: docs.clean
  77. $(Q)./manage build_msg WARN $@ is deprecated use docs.clean
  78. docs-live: docs.live
  79. $(Q)./manage build_msg WARN $@ is deprecated use docs.live
  80. docker: docker.build
  81. $(Q)./manage build_msg WARN $@ is deprecated use docker.build
  82. themes: themes.all
  83. $(Q)./manage build_msg WARN $@ is deprecated use themes.all