1# -*- coding: utf-8; mode: makefile-gmake -*-
5export GIT_URL=https://github.com/asciimoo/searx
6export GIT_BRANCH=master
7export SEARX_URL=https://searx.me
8export DOCS_URL=https://asciimoo.github.io/searx
11include utils/makefile.include
15PY_SETUP_EXTRAS ?= \[test\]
17include utils/makefile.python
18include utils/makefile.sphinx
22PHONY += help-min help-all help
26 @echo 'to get more help: make help-all'
29 @echo ' test - run developer tests'
30 @echo ' docs - build documentation'
31 @echo ' docs-live - autobuild HTML documentation while editing'
32 @echo ' run - run developer instance'
33 @echo ' install - developer install (./local)'
34 @echo ' uninstall - uninstall (./local)'
35 @echo ' gh-pages - build docs & deploy on gh-pages branch'
36 @echo ' clean - drop builds and environments'
37 @echo ' project - re-build generic files of the searx project'
38 @echo ' buildenv - re-build environment files (aka brand)'
39 @echo ' themes - re-build build the source of the themes'
40 @echo ' docker - build Docker image'
41 @echo ' node.env - download & install npm dependencies locally'
44 @echo ' SEARX_URL = $(SEARX_URL)'
45 @echo ' GIT_URL = $(GIT_URL)'
46 @echo ' DOCS_URL = $(DOCS_URL)'
48 @$(MAKE) -e -s make-help
52 @$(MAKE) -e -s python-help
54 @$(MAKE) -e -s docs-help
57install: buildenv pyenvinstall
60uninstall: pyenvuninstall
63clean: pyclean docs-clean node.clean test.clean
64 $(call cmd,common_clean)
67run: buildenv pyenvinstall
69 sed -i -e "s/debug : False/debug : True/g" ./searx/settings.yml ; \
71 xdg-open http://127.0.0.1:8888/ ; \
73 sed -i -e "s/debug : True/debug : False/g" ./searx/settings.yml ; \
75 $(PY_ENV)/bin/python ./searx/webapp.py
80sphinx-doc-prebuilds:: buildenv pyenvinstall prebuild-includes
83docs: sphinx-doc-prebuilds sphinx-doc
84 $(call cmd,sphinx,html,docs,docs)
87docs-live: sphinx-doc-prebuilds sphinx-live
88 $(call cmd,sphinx_autobuild,html,docs,docs)
90PHONY += prebuild-includes
92 $(Q)mkdir -p $(DOCS_BUILD)/includes
93 $(Q)./utils/searx.sh doc | cat > $(DOCS_BUILD)/includes/searx.rst
94 $(Q)./utils/filtron.sh doc | cat > $(DOCS_BUILD)/includes/filtron.rst
95 $(Q)./utils/morty.sh doc | cat > $(DOCS_BUILD)/includes/morty.rst
99 @echo "doc available at --> $(DOCS_URL)"
101# update project files
102# --------------------
104PHONY += project engines.languages useragents.update buildenv
106project: buildenv useragents.update engines.languages
108engines.languages: pyenvinstall
109 $(Q)echo "fetch languages .."
110 $(Q)$(PY_ENV_ACT); python utils/fetch_languages.py
111 $(Q)echo "update searx/data/engines_languages.json"
112 $(Q)mv engines_languages.json searx/data/engines_languages.json
113 $(Q)echo "update searx/languages.py"
114 $(Q)mv languages.py searx/languages.py
116useragents.update: pyenvinstall
117 $(Q)echo "Update searx/data/useragents.json with the most recent versions of Firefox."
118 $(Q)$(PY_ENV_ACT); python utils/fetch_firefox_version.py
121 $(Q)echo "build searx/brand.py"
122 $(Q)echo "GIT_URL = '$(GIT_URL)'" > searx/brand.py
123 $(Q)echo "GIT_BRANCH = '$(GIT_BRANCH)'" >> searx/brand.py
124 $(Q)echo "ISSUE_URL = 'https://github.com/asciimoo/searx/issues'" >> searx/brand.py
125 $(Q)echo "SEARX_URL = '$(SEARX_URL)'" >> searx/brand.py
126 $(Q)echo "DOCS_URL = '$(DOCS_URL)'" >> searx/brand.py
127 $(Q)echo "PUBLIC_INSTANCES = 'https://searx.space'" >> searx/brand.py
128 $(Q)echo "build utils/brand.env"
129 $(Q)echo "export GIT_URL='$(GIT_URL)'" > utils/brand.env
130 $(Q)echo "export GIT_BRANCH='$(GIT_BRANCH)'" >> utils/brand.env
131 $(Q)echo "export ISSUE_URL='https://github.com/asciimoo/searx/issues'" >> utils/brand.env
132 $(Q)echo "export SEARX_URL='$(SEARX_URL)'" >> utils/brand.env
133 $(Q)echo "export DOCS_URL='$(DOCS_URL)'" >> utils/brand.env
134 $(Q)echo "export PUBLIC_INSTANCES='https://searx.space'" >> utils/brand.env
141 $(Q)./manage.sh npm_packages
144 $(Q)echo "CLEAN locally installed npm dependencies"
147 ./package-lock.json \
148 ./searx/static/themes/oscar/package-lock.json \
149 ./searx/static/themes/oscar/node_modules \
150 ./searx/static/themes/simple/package-lock.json \
151 ./searx/static/themes/simple/node_modules
156PHONY += themes.bootstrap themes themes.oscar themes.simple themes.legacy themes.courgette themes.pixart
157themes: buildenv themes.bootstrap themes.oscar themes.simple themes.legacy themes.courgette themes.pixart
159quiet_cmd_lessc = LESSC $3
160 cmd_lessc = PATH="$$(npm bin):$$PATH" \
161 lessc --clean-css="--s1 --advanced --compatibility=ie9" "searx/static/$2" "searx/static/$3"
163quiet_cmd_grunt = GRUNT $2
164 cmd_grunt = PATH="$$(npm bin):$$PATH" \
165 grunt --gruntfile "$2"
167themes.oscar: node.env
168 $(Q)echo '[!] build oscar theme'
169 $(call cmd,grunt,searx/static/themes/oscar/gruntfile.js)
171themes.simple: node.env
172 $(Q)echo '[!] build simple theme'
173 $(call cmd,grunt,searx/static/themes/simple/gruntfile.js)
175themes.legacy: node.env
176 $(Q)echo '[!] build legacy theme'
177 $(call cmd,lessc,themes/legacy/less/style-rtl.less,themes/legacy/css/style-rtl.css)
178 $(call cmd,lessc,themes/legacy/less/style.less,themes/legacy/css/style.css)
180themes.courgette: node.env
181 $(Q)echo '[!] build courgette theme'
182 $(call cmd,lessc,themes/courgette/less/style.less,themes/courgette/css/style.css)
183 $(call cmd,lessc,themes/courgette/less/style-rtl.less,themes/courgette/css/style-rtl.css)
185themes.pixart: node.env
186 $(Q)echo '[!] build pixart theme'
187 $(call cmd,lessc,themes/pix-art/less/style.less,themes/pix-art/css/style.css)
189themes.bootstrap: node.env
190 $(call cmd,lessc,less/bootstrap/bootstrap.less,css/bootstrap.min.css)
198 $(Q)./manage.sh docker_build
201 $(Q)./manage.sh docker_build push
208 $(PY_ENV_ACT); ./manage.sh install_geckodriver
213PHONY += test test.sh test.pylint test.pep8 test.unit test.coverage test.robot
214test: buildenv test.pylint test.pep8 test.unit gecko.driver test.robot
218 @echo "LINT skip liniting py2"
220# TODO: balance linting with pylint
222test.pylint: pyenvinstall
224 searx/preferences.py \
226 searx/engines/gigablast.py \
231# E402 module level import not at top of file
232# W503 line break before binary operator
234# ubu1604: uses shellcheck v0.3.7 (from 04/2015), no longer supported!
236 shellcheck -x -s bash utils/brand.env
237 shellcheck -x utils/lib.sh
238 shellcheck -x utils/filtron.sh
239 shellcheck -x utils/searx.sh
240 shellcheck -x utils/morty.sh
241 shellcheck -x utils/lxc.sh
242 shellcheck -x utils/lxc-searx.env
243 shellcheck -x .config.sh
245test.pep8: pyenvinstall
247 $(Q)$(PY_ENV_ACT); pep8 --exclude='searx/static, searx/engines/gigablast.py' --max-line-length=120 --ignore "E402,W503" searx tests
249test.unit: pyenvinstall
250 @echo "TEST tests/unit"
251 $(Q)$(PY_ENV_ACT); python -m nose2 -s tests/unit
253test.coverage: pyenvinstall
254 @echo "TEST unit test coverage"
256 python -m nose2 -C --log-capture --with-coverage --coverage searx -s tests/unit \
260test.robot: pyenvinstall gecko.driver
262 $(Q)$(PY_ENV_ACT); PYTHONPATH=. python searx/testing.py robot
265 @echo "CLEAN intermediate test stuff"
266 $(Q)rm -rf geckodriver.log .coverage coverage/
273 $(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