summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile61
1 files changed, 44 insertions, 17 deletions
diff --git a/Makefile b/Makefile
index d09e92828..acff120f3 100644
--- a/Makefile
+++ b/Makefile
@@ -1,24 +1,24 @@
# -*- 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
+.DEFAULT_GOAL=help
+include ./.config.mk
+include utils/makefile.include
PYOBJECTS = searx
DOC = docs
PY_SETUP_EXTRAS ?= \[test\]
-PYDIST=./dist/py
-PYBUILD=./build/py
-
-include utils/makefile.include
include utils/makefile.python
include utils/makefile.sphinx
all: clean install
-PHONY += help
-help:
+PHONY += help-min help-all help
+
+help: help-min
+ @echo ''
+ @echo 'to get more help: make help-all'
+
+help-min:
@echo ' test - run developer tests'
@echo ' docs - build documentation'
@echo ' docs-live - autobuild HTML documentation while editing'
@@ -32,9 +32,18 @@ help:
@echo ' docker - build Docker image'
@echo ' node.env - download & install npm dependencies locally'
@echo ''
- @$(MAKE) -s -f utils/makefile.include make-help
+ @echo 'environment'
+ @echo ' SEARX_URL = $(SEARX_URL)'
+ @echo ' GIT_URL = $(GIT_URL)'
+ @echo ' DOCS_URL = $(DOCS_URL)'
+ @echo ''
+ @$(MAKE) -e -s make-help
+
+help-all: help-min
+ @echo ''
+ @$(MAKE) -e -s python-help
@echo ''
- @$(MAKE) -s -f utils/makefile.python python-help
+ @$(MAKE) -e -s docs-help
PHONY += install
install: pyenvinstall
@@ -43,7 +52,7 @@ PHONY += uninstall
uninstall: pyenvuninstall
PHONY += clean
-clean: pyclean node.clean test.clean
+clean: pyclean docs-clean node.clean test.clean
$(call cmd,common_clean)
PHONY += run
@@ -61,13 +70,21 @@ run: pyenvinstall
# ----
PHONY += docs
-docs: pyenvinstall sphinx-doc
+
+docs: pyenvinstall sphinx-doc prebuild-includes
$(call cmd,sphinx,html,docs,docs)
PHONY += docs-live
-docs-live: pyenvinstall sphinx-live
+docs-live: pyenvinstall sphinx-live prebuild-includes
$(call cmd,sphinx_autobuild,html,docs,docs)
+prebuild-includes:
+ @mkdir -p $(DOCS_BUILD)/includes
+ @./utils/searx.sh doc | cat > $(DOCS_BUILD)/includes/searx.rst
+ @./utils/filtron.sh doc | cat > $(DOCS_BUILD)/includes/filtron.rst
+ @./utils/morty.sh doc | cat > $(DOCS_BUILD)/includes/morty.rst
+
+
$(GH_PAGES)::
@echo "doc available at --> $(DOCS_URL)"
@@ -178,11 +195,11 @@ gecko.driver:
# test
# ----
-PHONY += test test.pylint test.pep8 test.unit test.coverage test.robot
-
+PHONY += test test.sh test.pylint test.pep8 test.unit test.coverage test.robot
test: test.pylint test.pep8 test.unit gecko.driver test.robot
# TODO: balance linting with pylint
+
test.pylint: pyenvinstall
$(call cmd,pylint,\
searx/preferences.py \
@@ -193,6 +210,16 @@ test.pylint: pyenvinstall
# E402 module level import not at top of file
# W503 line break before binary operator
+# ubu1604: uses shellcheck v0.3.7 (from 04/2015), no longer supported!
+test.sh:
+ shellcheck -x utils/lib.sh
+ shellcheck -x utils/filtron.sh
+ shellcheck -x utils/searx.sh
+ shellcheck -x utils/morty.sh
+ shellcheck -x utils/lxc.sh
+ shellcheck -x utils/lxc-searx.env
+ shellcheck -x .config.sh
+
test.pep8: pyenvinstall
@echo "TEST pep8"
$(Q)$(PY_ENV_ACT); pep8 --exclude=searx/static --max-line-length=120 --ignore "E402,W503" searx tests