Makefile 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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) ( \
  22. sleep 2 ; \
  23. xdg-open http://127.0.0.1:8888/ ; \
  24. ) &
  25. SEARXNG_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 nvm.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_nvm.sh \
  55. utils/lib_static.sh \
  56. utils/lib_go.sh \
  57. utils/filtron.sh \
  58. utils/searx.sh \
  59. utils/morty.sh \
  60. utils/lxc.sh \
  61. utils/lxc-searx.env \
  62. .config.sh
  63. $(Q)$(MTOOLS) build_msg TEST "$@ OK"
  64. # wrap ./manage script
  65. MANAGE += buildenv
  66. MANAGE += weblate.translations.commit weblate.push.translations
  67. MANAGE += data.all data.languages data.useragents data.osm_keys_tags
  68. MANAGE += docs.html docs.live docs.gh-pages docs.prebuild docs.clean
  69. MANAGE += docker.build docker.push docker.buildx
  70. MANAGE += gecko.driver
  71. MANAGE += node.env node.clean
  72. MANAGE += py.build py.clean
  73. MANAGE += pyenv pyenv.install pyenv.uninstall
  74. MANAGE += pypi.upload pypi.upload.test
  75. MANAGE += test.yamllint test.pylint test.pep8 test.unit test.coverage test.robot test.clean
  76. MANAGE += themes.all themes.oscar themes.simple pygments.less
  77. MANAGE += static.build.commit static.build.drop static.build.restore
  78. MANAGE += nvm.install nvm.clean nvm.status nvm.nodejs
  79. PHONY += $(MANAGE)
  80. $(MANAGE):
  81. $(Q)$(MTOOLS) $@
  82. # short hands of selected targets
  83. PHONY += docs docker themes
  84. docs: docs.html
  85. docker: docker.build
  86. themes: themes.all