1# -*- coding: utf-8; mode: makefile-gmake -*-
4include utils/makefile.include
8PY_SETUP_EXTRAS ?= \[test\]
9PYLINT_SEARX_DISABLE_OPTION := I,C,R,W0105,W0212,W0511,W0603,W0613,W0621,W0702,W0703,W1401,E1136
10PYLINT_ADDITIONAL_BUILTINS_FOR_ENGINES := supported_languages,language_aliases
12include utils/makefile.python
13include utils/makefile.sphinx
17PHONY += help-min help-all help
21 @echo 'to get more help: make help-all'
24 @echo ' test - run developer tests'
25 @echo ' docs - build documentation'
26 @echo ' docs-live - autobuild HTML documentation while editing'
27 @echo ' run - run developer instance'
28 @echo ' install - developer install (./local)'
29 @echo ' uninstall - uninstall (./local)'
30 @echo ' gh-pages - build docs & deploy on gh-pages branch'
31 @echo ' clean - drop builds and environments'
32 @echo ' project - re-build generic files of the searx project'
33 @echo ' buildenv - re-build environment files (aka brand)'
34 @echo ' themes - re-build build the source of the themes'
35 @echo ' docker - build Docker image'
36 @echo ' node.env - download & install npm dependencies locally'
38 @$(MAKE) -e -s make-help
42 @$(MAKE) -e -s python-help
44 @$(MAKE) -e -s docs-help
47install: buildenv pyenvinstall
50uninstall: pyenvuninstall
53clean: pyclean docs-clean node.clean test.clean
54 $(call cmd,common_clean)
57run: buildenv pyenvinstall
60 xdg-open http://127.0.0.1:8888/ ; \
62 SEARX_DEBUG=1 $(PY_ENV)/bin/python ./searx/webapp.py
67sphinx-doc-prebuilds:: buildenv pyenvinstall prebuild-includes
70docs: sphinx-doc-prebuilds
71 $(call cmd,sphinx,html,docs,docs)
74docs-live: sphinx-doc-prebuilds
75 $(call cmd,sphinx_autobuild,html,docs,docs)
77PHONY += prebuild-includes
79 $(Q)mkdir -p $(DOCS_BUILD)/includes
80 $(Q)./utils/searx.sh doc | cat > $(DOCS_BUILD)/includes/searx.rst
81 $(Q)./utils/filtron.sh doc | cat > $(DOCS_BUILD)/includes/filtron.rst
82 $(Q)./utils/morty.sh doc | cat > $(DOCS_BUILD)/includes/morty.rst
86 @echo "doc available at --> $(DOCS_URL)"
91PHONY += project engines.languages useragents.update buildenv
93project: buildenv useragents.update engines.languages
95engines.languages: pyenvinstall
96 $(Q)echo "fetch languages .."
97 $(Q)$(PY_ENV_ACT); python utils/fetch_languages.py
98 $(Q)echo "update searx/data/engines_languages.json"
99 $(Q)mv engines_languages.json searx/data/engines_languages.json
100 $(Q)echo "update searx/languages.py"
101 $(Q)mv languages.py searx/languages.py
103useragents.update: pyenvinstall
104 $(Q)echo "Update searx/data/useragents.json with the most recent versions of Firefox."
105 $(Q)$(PY_ENV_ACT); python utils/fetch_firefox_version.py
108 $(Q)$(PY_ENV_ACT); SEARX_DEBUG=1 python utils/build_env.py
114 $(Q)./manage.sh npm_packages
117 $(Q)echo "CLEAN locally installed npm dependencies"
120 ./package-lock.json \
121 ./searx/static/themes/oscar/package-lock.json \
122 ./searx/static/themes/oscar/node_modules \
123 ./searx/static/themes/simple/package-lock.json \
124 ./searx/static/themes/simple/node_modules
129PHONY += themes.bootstrap themes themes.oscar themes.simple
130themes: buildenv themes.bootstrap themes.oscar themes.simple
132quiet_cmd_lessc = LESSC $3
133 cmd_lessc = PATH="$$(npm bin):$$PATH" \
134 lessc --clean-css="--s1 --advanced --compatibility=ie9" "searx/static/$2" "searx/static/$3"
136quiet_cmd_grunt = GRUNT $2
137 cmd_grunt = PATH="$$(npm bin):$$PATH" \
138 grunt --gruntfile "$2"
140themes.oscar: node.env
141 $(Q)echo '[!] build oscar theme'
142 $(call cmd,grunt,searx/static/themes/oscar/gruntfile.js)
144themes.simple: node.env
145 $(Q)echo '[!] build simple theme'
146 $(call cmd,grunt,searx/static/themes/simple/gruntfile.js)
148themes.bootstrap: node.env
149 $(call cmd,lessc,less/bootstrap/bootstrap.less,css/bootstrap.min.css)
157 $(Q)./manage.sh docker_build
160 $(Q)./manage.sh docker_build push
167 $(PY_ENV_ACT); ./manage.sh install_geckodriver
172search.checker: pyenvinstall
173 $(Q)$(PY_ENV_ACT); searx-checker -v
175ENGINE_TARGETS=$(patsubst searx/engines/%.py,search.checker.%,$(wildcard searx/engines/[!_]*.py))
177$(ENGINE_TARGETS): pyenvinstall
178 $(Q)$(PY_ENV_ACT); searx-checker -v "$(subst _, ,$(patsubst search.checker.%,%,$@))"
184PHONY += test test.sh test.pylint test.pep8 test.unit test.coverage test.robot
185test: buildenv test.pylint test.pep8 test.unit gecko.driver test.robot
188 searx/preferences.py \
190 searx/engines/gigablast.py \
191 searx/engines/deviantart.py \
192 searx/engines/digg.py \
193 searx/engines/google.py \
194 searx/engines/google_news.py \
195 searx/engines/google_videos.py \
196 searx/engines/google_images.py \
197 searx/engines/mediathekviewweb.py
199test.pylint: pyenvinstall
200 $(call cmd,pylint,$(PYLINT_FILES))
202 --disable=$(PYLINT_SEARX_DISABLE_OPTION) \
203 --additional-builtins=$(PYLINT_ADDITIONAL_BUILTINS_FOR_ENGINES) \
207 --disable=$(PYLINT_SEARX_DISABLE_OPTION) \
208 --ignore=searx/engines \
213# E402 module level import not at top of file
214# W503 line break before binary operator
216# ubu1604: uses shellcheck v0.3.7 (from 04/2015), no longer supported!
218 shellcheck -x -s bash utils/brand.env
219 shellcheck -x utils/lib.sh
220 shellcheck -x utils/filtron.sh
221 shellcheck -x utils/searx.sh
222 shellcheck -x utils/morty.sh
223 shellcheck -x utils/lxc.sh
224 shellcheck -x utils/lxc-searx.env
225 shellcheck -x .config.sh
227test.pep8: pyenvinstall
228 @echo "TEST pycodestyle (formerly pep8)"
229 $(Q)$(PY_ENV_ACT); pycodestyle --exclude='searx/static, searx/languages.py, $(foreach f,$(PYLINT_FILES),$(f),)' \
230 --max-line-length=120 --ignore "E117,E252,E402,E722,E741,W503,W504,W605" searx tests
232test.unit: pyenvinstall
233 @echo "TEST tests/unit"
234 $(Q)$(PY_ENV_ACT); python -m nose2 -s tests/unit
236test.coverage: pyenvinstall
237 @echo "TEST unit test coverage"
239 python -m nose2 -C --log-capture --with-coverage --coverage searx -s tests/unit \
243test.robot: pyenvinstall gecko.driver
245 $(Q)$(PY_ENV_ACT); PYTHONPATH=. python searx/testing.py robot
248 @echo "CLEAN intermediate test stuff"
249 $(Q)rm -rf geckodriver.log .coverage coverage/
257 $(PY_ENV_BIN)/python -c "import yaml" || make clean
261 $(Q)$(PY_ENV_BIN)/python -m pip install codecov
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list