on baddb8d help sign in
searx/Makefile
133 lines 3.3 kB history raw
1# -*- coding: utf-8; mode: makefile-gmake -*-
2.DEFAULT_GOAL=help
3include ./.config.mk
4include utils/makefile.include
6PYOBJECTS = searx
7DOC = docs
8PY_SETUP_EXTRAS ?= \[test\]
10include utils/makefile.python
11include utils/makefile.sphinx
13all: clean install
15PHONY += help-min help-all help
17help: help-min
18 @echo ''
19 @echo 'to get more help: make help-all'
21help-min:
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 ''
32 @echo 'environment'
33 @echo ' SEARX_URL = $(SEARX_URL)'
34 @echo ' GIT_URL = $(GIT_URL)'
35 @echo ' DOCS_URL = $(DOCS_URL)'
36 @echo ''
37 @$(MAKE) -e -s make-help
39help-all: help-min
40 @echo ''
41 @$(MAKE) -e -s python-help
42 @echo ''
43 @$(MAKE) -e -s docs-help
45PHONY += install
46install: pyenvinstall
48PHONY += uninstall
49uninstall: pyenvuninstall
51PHONY += clean
52clean: pyclean docs-clean
53 $(call cmd,common_clean)
55PHONY += run
56run: pyenvinstall
57 $(Q) ( \
58 sed -i -e "s/debug : False/debug : True/g" ./searx/settings.yml ; \
59 sleep 2 ; \
60 xdg-open http://127.0.0.1:8888/ ; \
61 sleep 3 ; \
62 sed -i -e "s/debug : True/debug : False/g" ./searx/settings.yml ; \
63 ) &
64 $(PY_ENV)/bin/python ./searx/webapp.py
66# docs
67# ----
69PHONY += docs
71docs: pyenvinstall sphinx-doc prebuild-includes
72 $(call cmd,sphinx,html,docs,docs)
74PHONY += docs-live
75docs-live: pyenvinstall sphinx-live prebuild-includes
76 $(call cmd,sphinx_autobuild,html,docs,docs)
78prebuild-includes:
79 @mkdir -p $(DOCS_BUILD)/includes
80 @./utils/searx.sh doc | cat > $(DOCS_BUILD)/includes/searx.rst
81 @./utils/filtron.sh doc | cat > $(DOCS_BUILD)/includes/filtron.rst
82 @./utils/morty.sh doc | cat > $(DOCS_BUILD)/includes/morty.rst
85$(GH_PAGES)::
86 @echo "doc available at --> $(DOCS_URL)"
88# update project files
89# --------------------
91PHONY += project engines-languages
93project: searx/data/engines_languages.json
95searx/data/engines_languages.json: pyenvinstall
96 $(PY_ENV_ACT); python utils/fetch_languages.py
97 mv engines_languages.json searx/data/engines_languages.json
98 mv languages.py searx/languages.py
100# test
101# ----
103PHONY += test test.sh test.pylint test.pep8 test.unit test.robot
105test: test.pylint test.pep8 test.unit test.robot
107# TODO: balance linting with pylint
109test.pylint: pyenvinstall
110 $(call cmd,pylint,searx/preferences.py)
111 $(call cmd,pylint,searx/testing.py)
113# ubu1604: uses shellcheck v0.3.7 (from 04/2015), no longer supported!
114test.sh:
115 shellcheck -x utils/lib.sh
116 shellcheck -x utils/filtron.sh
117 shellcheck -x utils/searx.sh
118 shellcheck -x utils/morty.sh
119 shellcheck -x utils/lxc.sh
120 shellcheck -x utils/lxc-searx.env
121 shellcheck -x .config.sh
123test.pep8: pyenvinstall
124 $(PY_ENV_ACT); ./manage.sh pep8_check
126test.unit: pyenvinstall
127 $(PY_ENV_ACT); ./manage.sh unit_tests
129test.robot: pyenvinstall
130 $(PY_ENV_ACT); ./manage.sh install_geckodriver
131 $(PY_ENV_ACT); ./manage.sh robot_tests
133.PHONY: $(PHONY)