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