summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarIT.de>2019-12-24 13:33:07 +0100
committerGitHub <noreply@github.com>2019-12-24 13:33:07 +0100
commitfb668e2075484084a1f7a9b205ecbe7957ea5e8e (patch)
treec6f2e83d9d222d69d79348faac342c07c32dbbf3 /Makefile
parentf407dd8ef4e3f6c82bef31f678139d6db2a4d810 (diff)
parent6d232e9b695c2553b7594efe00c4f63aa96fc62d (diff)
Merge branch 'master' into libgen
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile85
1 files changed, 85 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 000000000..b69202ba2
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,85 @@
+# -*- coding: utf-8; mode: makefile-gmake -*-
+
+export GIT_URL=https://github.com/asciimoo/searx
+export SEARX_URL=https://searx.me
+export DOCS_URL=https://asciimoo.github.io/searx
+
+PYOBJECTS = searx
+DOC = docs
+PY_SETUP_EXTRAS ?= \[test\]
+
+include utils/makefile.include
+include utils/makefile.python
+include utils/makefile.sphinx
+
+all: clean install
+
+PHONY += help
+help:
+ @echo ' test - run developer tests'
+ @echo ' docs - build documentation'
+ @echo ' docs-live - autobuild HTML documentation while editing'
+ @echo ' run - run developer instance'
+ @echo ' install - developer install (./local)'
+ @echo ' uninstall - uninstall (./local)'
+ @echo ' gh-pages - build docs & deploy on gh-pages branch'
+ @echo ''
+ @$(MAKE) -s -f utils/makefile.include make-help
+ @echo ''
+ @$(MAKE) -s -f utils/makefile.python python-help
+
+PHONY += install
+install: pyenvinstall
+
+PHONY += uninstall
+uninstall: pyenvuninstall
+
+PHONY += clean
+clean: pyclean
+ $(call cmd,common_clean)
+
+PHONY += run
+run: pyenvinstall
+ $(Q) ( \
+ sed -i -e "s/debug : False/debug : True/g" ./searx/settings.yml ; \
+ sleep 2 ; \
+ xdg-open http://127.0.0.1:8888/ ; \
+ sleep 3 ; \
+ sed -i -e "s/debug : True/debug : False/g" ./searx/settings.yml ; \
+ ) &
+ $(PY_ENV)/bin/python ./searx/webapp.py
+
+# docs
+# ----
+
+PHONY += docs
+docs: pyenvinstall sphinx-doc
+ $(call cmd,sphinx,html,docs,docs)
+
+PHONY += docs-live
+docs-live: pyenvinstall sphinx-live
+ $(call cmd,sphinx_autobuild,html,docs,docs)
+
+$(GH_PAGES)::
+ @echo "doc available at --> $(DOCS_URL)"
+
+# test
+# ----
+
+PHONY += test test.pylint test.pep8 test.unit test.robot
+
+# TODO: balance linting with pylint
+test: test.pep8 test.unit test.robot
+ - make pylint
+
+test.pep8: pyenvinstall
+ $(PY_ENV_ACT); ./manage.sh pep8_check
+
+test.unit: pyenvinstall
+ $(PY_ENV_ACT); ./manage.sh unit_tests
+
+test.robot: pyenvinstall
+ $(PY_ENV_ACT); ./manage.sh install_geckodriver
+ $(PY_ENV_ACT); ./manage.sh robot_tests
+
+.PHONY: $(PHONY)