2020-01-19 03:43:11 +03:00
|
|
|
.PHONY: env help clean html package doctest
|
2010-02-09 07:58:28 +03:00
|
|
|
|
2019-02-17 03:48:33 +03:00
|
|
|
docs: html
|
2010-02-09 07:58:28 +03:00
|
|
|
|
2010-02-14 08:01:00 +03:00
|
|
|
check: doctest
|
|
|
|
|
2014-08-25 02:08:01 +04:00
|
|
|
# The environment is currently required to build the documentation.
|
|
|
|
# It is not clean by 'make clean'
|
|
|
|
|
2015-04-28 11:30:59 +03:00
|
|
|
PYTHON := python$(PYTHON_VERSION)
|
|
|
|
PYTHON_VERSION ?= $(shell $(PYTHON) -c 'import sys; print ("%d.%d" % sys.version_info[:2])')
|
2020-01-19 03:43:11 +03:00
|
|
|
BUILD_DIR = $(shell pwd)/../build/lib.$(PYTHON_VERSION)
|
2015-04-28 11:30:59 +03:00
|
|
|
|
2018-10-07 14:55:11 +03:00
|
|
|
SPHINXBUILD ?= $$(pwd)/env/bin/sphinx-build
|
2019-02-17 04:12:39 +03:00
|
|
|
SPHOPTS = SPHINXBUILD=$(SPHINXBUILD)
|
2010-02-09 07:58:28 +03:00
|
|
|
|
2020-01-19 03:43:11 +03:00
|
|
|
html: package src/sqlstate_errors.rst
|
2015-04-28 11:30:59 +03:00
|
|
|
$(MAKE) $(SPHOPTS) -C src $@
|
2010-02-14 19:11:01 +03:00
|
|
|
cp -r src/_build/html .
|
2010-02-09 07:58:28 +03:00
|
|
|
|
2020-01-19 03:43:11 +03:00
|
|
|
src/sqlstate_errors.rst: ../psycopg/sqlstate_errors.h $(BUILD_DIR)
|
2021-06-17 05:53:19 +03:00
|
|
|
./env/bin/python src/tools/make_sqlstate_docs.py $< > $@
|
2019-02-17 03:41:29 +03:00
|
|
|
|
2020-01-19 03:43:11 +03:00
|
|
|
$(BUILD_DIR):
|
|
|
|
$(MAKE) PYTHON=$(PYTHON) -C .. package
|
|
|
|
|
2010-02-09 07:58:28 +03:00
|
|
|
doctest:
|
2015-04-28 11:30:59 +03:00
|
|
|
$(MAKE) PYTHON=$(PYTHON) -C .. package
|
|
|
|
$(MAKE) $(SPHOPTS) -C src $@
|
2010-02-14 19:11:01 +03:00
|
|
|
|
|
|
|
clean:
|
2015-04-28 11:30:59 +03:00
|
|
|
$(MAKE) $(SPHOPTS) -C src $@
|
2019-02-17 03:48:33 +03:00
|
|
|
rm -rf html src/sqlstate_errors.rst
|
2014-08-25 02:08:01 +04:00
|
|
|
|
|
|
|
env: requirements.txt
|
2021-06-17 03:42:42 +03:00
|
|
|
$(PYTHON) -m venv env
|
2014-08-25 02:08:01 +04:00
|
|
|
./env/bin/pip install -r requirements.txt
|
2019-02-17 04:12:39 +03:00
|
|
|
echo "$$(pwd)/../build/lib.$(PYTHON_VERSION)" \
|
|
|
|
> env/lib/python$(PYTHON_VERSION)/site-packages/psycopg.pth
|