Makefile 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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 go.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. PHONY += search.checker search.checker.%
  33. search.checker: install
  34. $(Q)./manage pyenv.cmd searxng-checker -v
  35. search.checker.%: install
  36. $(Q)./manage pyenv.cmd searxng-checker -v "$(subst _, ,$(patsubst search.checker.%,%,$@))"
  37. PHONY += test ci.test test.shell
  38. ci.test: test.yamllint test.black test.types.ci test.pylint test.unit test.robot test.rst test.shell test.pybabel
  39. test: test.yamllint test.black test.types.dev test.pylint test.unit test.robot test.rst test.shell
  40. test.shell:
  41. $(Q)shellcheck -x -s dash \
  42. container/entrypoint.sh
  43. $(Q)shellcheck -x -s bash \
  44. utils/brand.sh \
  45. $(MTOOLS) \
  46. utils/lib.sh \
  47. utils/lib_sxng*.sh \
  48. utils/lib_govm.sh \
  49. utils/lib_nvm.sh \
  50. utils/lib_redis.sh \
  51. utils/lib_valkey.sh \
  52. utils/searxng.sh
  53. $(Q)$(MTOOLS) build_msg TEST "$@ OK"
  54. # wrap ./manage script
  55. MANAGE += weblate.translations.commit weblate.push.translations
  56. MANAGE += data.all data.traits data.useragents data.locales data.currencies
  57. MANAGE += docs.html docs.live docs.gh-pages docs.prebuild docs.clean
  58. MANAGE += podman.build
  59. MANAGE += docker.build docker.buildx
  60. MANAGE += container.build container.test container.push
  61. MANAGE += gecko.driver
  62. MANAGE += node.env node.env.dev node.clean
  63. MANAGE += py.build py.clean
  64. MANAGE += pyenv pyenv.install pyenv.uninstall
  65. MANAGE += format.python
  66. MANAGE += test.yamllint test.pylint test.black test.pybabel test.unit test.coverage test.robot test.rst test.clean test.themes test.types.dev test.types.ci
  67. MANAGE += themes.all themes.simple themes.fix themes.lint themes.test
  68. MANAGE += static.build.commit static.build.drop static.build.restore
  69. MANAGE += nvm.install nvm.clean nvm.status nvm.nodejs
  70. MANAGE += go.env.dev go.clean
  71. PHONY += $(MANAGE)
  72. $(MANAGE):
  73. $(Q)$(MTOOLS) $@
  74. # short hands of selected targets
  75. PHONY += docs container themes
  76. docs: docs.html
  77. container: container.build
  78. themes: themes.all