Makefile 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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. $(MTOOLS) \
  51. $(MSTATIC) \
  52. utils/lib.sh \
  53. utils/filtron.sh \
  54. utils/searx.sh \
  55. utils/morty.sh \
  56. utils/lxc.sh \
  57. utils/lxc-searx.env \
  58. .config.sh
  59. $(Q)$(MTOOLS) build_msg TEST "$@ OK"
  60. # wrap ./manage script
  61. MANAGE += buildenv
  62. MANAGE += babel.compile
  63. MANAGE += data.all data.languages data.useragents data.osm_keys_tags
  64. MANAGE += docs.html docs.live docs.gh-pages docs.prebuild docs.clean
  65. MANAGE += docker.build docker.push docker.buildx
  66. MANAGE += gecko.driver
  67. MANAGE += node.env node.clean
  68. MANAGE += py.build py.clean
  69. MANAGE += pyenv pyenv.install pyenv.uninstall
  70. MANAGE += pypi.upload pypi.upload.test
  71. MANAGE += test.yamllint test.pylint test.pep8 test.unit test.coverage test.robot test.clean
  72. MANAGE += themes.all themes.oscar themes.simple pygments.less
  73. PHONY += $(MANAGE)
  74. $(MANAGE):
  75. $(Q)$(MTOOLS) $@
  76. MANAGE_STATIC += static.build.commit.drop static.build.commit static.git.restore.staged static.git.restore
  77. $(MANAGE_STATIC):
  78. $(Q)$(MSTATIC) $@
  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