1# -*- coding: utf-8; mode: makefile-gmake -*-
3export GIT_URL=https://github.com/asciimoo/searx
4export SEARX_URL=https://searx.me
5export DOCS_URL=https://asciimoo.github.io/searx
9PY_SETUP_EXTRAS ?= \[test\]
14include utils/makefile.include
15include utils/makefile.python
16include utils/makefile.sphinx
22 @echo ' test - run developer tests'
23 @echo ' docs - build documentation'
24 @echo ' docs-live - autobuild HTML documentation while editing'
25 @echo ' run - run developer instance'
26 @echo ' install - developer install (./local)'
27 @echo ' uninstall - uninstall (./local)'
28 @echo ' gh-pages - build docs & deploy on gh-pages branch'
29 @echo ' clean - drop builds and environments'
30 @echo ' project - re-build generic files of the searx project'
31 @echo ' buildenv - re-build environment files (aka brand)'
32 @echo ' themes - re-build build the source of the themes'
33 @echo ' docker - build Docker image'
34 @echo ' node.env - download & install npm dependencies locally'
36 @$(MAKE) -s -f utils/makefile.include make-help
38 @$(MAKE) -s -f utils/makefile.python python-help
41install: buildenv pyenvinstall
44uninstall: pyenvuninstall
47clean: pyclean node.clean test.clean
48 $(call cmd,common_clean)
51run: buildenv pyenvinstall
53 sed -i -e "s/debug : False/debug : True/g" ./searx/settings.yml ; \
55 xdg-open http://127.0.0.1:8888/ ; \
57 sed -i -e "s/debug : True/debug : False/g" ./searx/settings.yml ; \
59 $(PY_ENV)/bin/python ./searx/webapp.py
65docs: buildenv pyenvinstall sphinx-doc
66 $(call cmd,sphinx,html,docs,docs)
69docs-live: buildenv pyenvinstall sphinx-live
70 $(call cmd,sphinx_autobuild,html,docs,docs)
73 @echo "doc available at --> $(DOCS_URL)"
78PHONY += project engines.languages useragents.update buildenv
80project: buildenv useragents.update engines.languages
82engines.languages: pyenvinstall
83 $(Q)echo "fetch languages .."
84 $(Q)$(PY_ENV_ACT); python utils/fetch_languages.py
85 $(Q)echo "update searx/data/engines_languages.json"
86 $(Q)mv engines_languages.json searx/data/engines_languages.json
87 $(Q)echo "update searx/languages.py"
88 $(Q)mv languages.py searx/languages.py
90useragents.update: pyenvinstall
91 $(Q)echo "Update searx/data/useragents.json with the most recent versions of Firefox."
92 $(Q)$(PY_ENV_ACT); python utils/fetch_firefox_version.py
95 $(Q)echo "build searx/brand.py"
96 $(Q)echo "GIT_URL = '$(GIT_URL)'" > searx/brand.py
97 $(Q)echo "ISSUE_URL = 'https://github.com/asciimoo/searx/issues'" >> searx/brand.py
98 $(Q)echo "SEARX_URL = '$(SEARX_URL)'" >> searx/brand.py
99 $(Q)echo "DOCS_URL = '$(DOCS_URL)'" >> searx/brand.py
100 $(Q)echo "PUBLIC_INSTANCES = 'https://searx.space'" >> searx/brand.py
101 $(Q)echo "build utils/brand.env"
102 $(Q)echo "export GIT_URL='$(GIT_URL)'" > utils/brand.env
103 $(Q)echo "export ISSUE_URL='https://github.com/asciimoo/searx/issues'" >> utils/brand.env
104 $(Q)echo "export SEARX_URL='$(SEARX_URL)'" >> utils/brand.env
105 $(Q)echo "export DOCS_URL='$(DOCS_URL)'" >> utils/brand.env
106 $(Q)echo "export PUBLIC_INSTANCES='https://searx.space'" >> utils/brand.env
113 $(Q)./manage.sh npm_packages
116 $(Q)echo "CLEAN locally installed npm dependencies"
119 ./package-lock.json \
120 ./searx/static/themes/oscar/package-lock.json \
121 ./searx/static/themes/oscar/node_modules \
122 ./searx/static/themes/simple/package-lock.json \
123 ./searx/static/themes/simple/node_modules
128PHONY += themes.bootstrap themes themes.oscar themes.simple themes.legacy themes.courgette themes.pixart
129themes: buildenv themes.bootstrap themes.oscar themes.simple themes.legacy themes.courgette themes.pixart
131quiet_cmd_lessc = LESSC $3
132 cmd_lessc = PATH="$$(npm bin):$$PATH" \
133 lessc --clean-css="--s1 --advanced --compatibility=ie9" "searx/static/$2" "searx/static/$3"
135quiet_cmd_grunt = GRUNT $2
136 cmd_grunt = PATH="$$(npm bin):$$PATH" \
137 grunt --gruntfile "$2"
140 $(Q)echo '[!] build oscar theme'
141 $(call cmd,grunt,searx/static/themes/oscar/gruntfile.js)
144 $(Q)echo '[!] build simple theme'
145 $(call cmd,grunt,searx/static/themes/simple/gruntfile.js)
148 $(Q)echo '[!] build legacy theme'
149 $(call cmd,lessc,themes/legacy/less/style-rtl.less,themes/legacy/css/style-rtl.css)
150 $(call cmd,lessc,themes/legacy/less/style.less,themes/legacy/css/style.css)
153 $(Q)echo '[!] build courgette theme'
154 $(call cmd,lessc,themes/courgette/less/style.less,themes/courgette/css/style.css)
155 $(call cmd,lessc,themes/courgette/less/style-rtl.less,themes/courgette/css/style-rtl.css)
158 $(Q)echo '[!] build pixart theme'
159 $(call cmd,lessc,themes/pix-art/less/style.less,themes/pix-art/css/style.css)
162 $(call cmd,lessc,less/bootstrap/bootstrap.less,css/bootstrap.min.css)
170 $(Q)./manage.sh docker_build
173 $(Q)./manage.sh docker_build push
180 $(PY_ENV_ACT); ./manage.sh install_geckodriver
185PHONY += test test.pylint test.pep8 test.unit test.coverage test.robot
187test: buildenv test.pylint test.pep8 test.unit gecko.driver test.robot
191 @echo "LINT skip liniting py2"
193# TODO: balance linting with pylint
194test.pylint: pyenvinstall
196 searx/preferences.py \
198 searx/engines/gigablast.py \
203# E402 module level import not at top of file
204# W503 line break before binary operator
206test.pep8: pyenvinstall
208 $(Q)$(PY_ENV_ACT); pep8 --exclude='searx/static, searx/engines/gigablast.py' --max-line-length=120 --ignore "E402,W503" searx tests
210test.unit: pyenvinstall
211 @echo "TEST tests/unit"
212 $(Q)$(PY_ENV_ACT); python -m nose2 -s tests/unit
214test.coverage: pyenvinstall
215 @echo "TEST unit test coverage"
217 python -m nose2 -C --log-capture --with-coverage --coverage searx -s tests/unit \
221test.robot: pyenvinstall gecko.driver
223 $(Q)$(PY_ENV_ACT); PYTHONPATH=. python searx/testing.py robot
226 @echo "CLEAN intermediate test stuff"
227 $(Q)rm -rf geckodriver.log .coverage coverage/
234 $(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