Makefile 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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 SearxNG 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)./manage webapp.run
  22. PHONY += install uninstall
  23. install uninstall:
  24. $(Q)./manage pyenv.$@
  25. PHONY += clean
  26. clean: py.clean docs.clean node.clean nvm.clean test.clean
  27. $(Q)./manage build_msg CLEAN "common files"
  28. $(Q)find . -name '*.orig' -exec rm -f {} +
  29. $(Q)find . -name '*.rej' -exec rm -f {} +
  30. $(Q)find . -name '*~' -exec rm -f {} +
  31. $(Q)find . -name '*.bak' -exec rm -f {} +
  32. lxc.clean:
  33. $(Q)rm -rf lxc-env
  34. PHONY += search.checker search.checker.%
  35. search.checker: install
  36. $(Q)./manage pyenv.cmd searxng-checker -v
  37. search.checker.%: install
  38. $(Q)./manage pyenv.cmd searxng-checker -v "$(subst _, ,$(patsubst search.checker.%,%,$@))"
  39. PHONY += test ci.test test.shell
  40. ci.test: test.yamllint test.black test.pyright test.pylint test.unit test.robot test.rst test.pybabel
  41. test: test.yamllint test.black test.pyright test.pylint test.unit test.robot test.rst test.shell
  42. test.shell:
  43. $(Q)shellcheck -x -s dash \
  44. dockerfiles/docker-entrypoint.sh
  45. $(Q)shellcheck -x -s bash \
  46. utils/brand.sh \
  47. $(MTOOLS) \
  48. utils/lib.sh \
  49. utils/lib_sxng*.sh \
  50. utils/lib_go.sh \
  51. utils/lib_nvm.sh \
  52. utils/lib_redis.sh \
  53. utils/searxng.sh \
  54. utils/lxc.sh \
  55. utils/lxc-searxng.env \
  56. utils/searx.sh \
  57. utils/filtron.sh \
  58. utils/morty.sh
  59. $(Q)$(MTOOLS) build_msg TEST "$@ OK"
  60. # wrap ./manage script
  61. MANAGE += weblate.translations.commit weblate.push.translations
  62. MANAGE += data.all data.traits data.useragents data.locales
  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.env.dev node.clean
  67. MANAGE += py.build py.clean
  68. MANAGE += pyenv pyenv.install pyenv.uninstall
  69. MANAGE += format.python
  70. MANAGE += test.yamllint test.pylint test.pyright test.black test.pybabel test.unit test.coverage test.robot test.rst test.clean
  71. MANAGE += themes.all themes.simple themes.simple.test pygments.less
  72. MANAGE += static.build.commit static.build.drop static.build.restore
  73. MANAGE += nvm.install nvm.clean nvm.status nvm.nodejs
  74. PHONY += $(MANAGE)
  75. $(MANAGE):
  76. $(Q)$(MTOOLS) $@
  77. # short hands of selected targets
  78. PHONY += docs docker themes
  79. docs: docs.html
  80. docker: docker.build
  81. themes: themes.all