Makefile 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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.shell - 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 -m searx.webapp
  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. lxc.clean:
  37. $(Q)rm -rf lxc-env
  38. PHONY += search.checker search.checker.%
  39. search.checker: install
  40. $(Q)./manage pyenv.cmd searx-checker -v
  41. search.checker.%: install
  42. $(Q)./manage pyenv.cmd searx-checker -v "$(subst _, ,$(patsubst search.checker.%,%,$@))"
  43. PHONY += test ci.test test.shell
  44. ci.test: test.yamllint test.pep8 test.pylint test.unit test.robot
  45. test: test.yamllint test.pep8 test.pylint test.unit test.robot test.shell
  46. test.shell:
  47. $(Q)shellcheck -x -s dash \
  48. dockerfiles/docker-entrypoint.sh
  49. $(Q)shellcheck -x -s bash \
  50. utils/brand.env \
  51. $(MTOOLS) \
  52. utils/lib.sh \
  53. utils/lib_install.sh \
  54. utils/lib_static.sh \
  55. utils/filtron.sh \
  56. utils/searx.sh \
  57. utils/morty.sh \
  58. utils/lxc.sh \
  59. utils/lxc-searx.env \
  60. .config.sh
  61. $(Q)$(MTOOLS) build_msg TEST "$@ OK"
  62. # wrap ./manage script
  63. MANAGE += buildenv
  64. MANAGE += weblate.translations.commit weblate.push.translations
  65. MANAGE += data.all data.languages data.useragents data.osm_keys_tags
  66. MANAGE += docs.html docs.live docs.gh-pages docs.prebuild docs.clean
  67. MANAGE += docker.build docker.push docker.buildx
  68. MANAGE += gecko.driver
  69. MANAGE += node.env node.clean
  70. MANAGE += py.build py.clean
  71. MANAGE += pyenv pyenv.install pyenv.uninstall
  72. MANAGE += pypi.upload pypi.upload.test
  73. MANAGE += test.yamllint test.pylint test.pep8 test.unit test.coverage test.robot test.clean
  74. MANAGE += themes.all themes.oscar themes.simple pygments.less
  75. MANAGE += static.build.commit static.build.drop static.build.restore
  76. PHONY += $(MANAGE)
  77. $(MANAGE):
  78. $(Q)$(MTOOLS) $@
  79. # deprecated
  80. PHONY += docs docs-clean docs-live docker themes
  81. docs: docs.html
  82. $(Q)./manage build_msg WARN $@ is deprecated use docs.html
  83. docs-clean: docs.clean
  84. $(Q)./manage build_msg WARN $@ is deprecated use docs.clean
  85. docs-live: docs.live
  86. $(Q)./manage build_msg WARN $@ is deprecated use docs.live
  87. docker: docker.build
  88. $(Q)./manage build_msg WARN $@ is deprecated use docker.build
  89. themes: themes.all
  90. $(Q)./manage build_msg WARN $@ is deprecated use themes.all