Fixed dependencies in docs build

Building without having built the library failed
This commit is contained in:
Daniele Varrazzo 2020-01-19 00:43:11 +00:00
parent 94a660aa6f
commit dbd6577d91
2 changed files with 8 additions and 5 deletions

View File

@ -42,7 +42,7 @@ endif
VERSION := $(shell grep PSYCOPG_VERSION setup.py | head -1 | sed -e "s/.*'\(.*\)'/\1/")
SDIST := dist/psycopg2-$(VERSION).tar.gz
.PHONY: env check clean
.PHONY: check clean
default: package

View File

@ -1,4 +1,4 @@
.PHONY: env help clean html doctest
.PHONY: env help clean html package doctest
docs: html
@ -9,18 +9,21 @@ check: doctest
PYTHON := python$(PYTHON_VERSION)
PYTHON_VERSION ?= $(shell $(PYTHON) -c 'import sys; print ("%d.%d" % sys.version_info[:2])')
BUILD_DIR = $(shell pwd)/../build/lib.$(PYTHON_VERSION)
SPHINXBUILD ?= $$(pwd)/env/bin/sphinx-build
SPHOPTS = SPHINXBUILD=$(SPHINXBUILD)
html: src/sqlstate_errors.rst
$(MAKE) PYTHON=$(PYTHON) -C .. package
html: package src/sqlstate_errors.rst
$(MAKE) $(SPHOPTS) -C src $@
cp -r src/_build/html .
src/sqlstate_errors.rst: ../psycopg/sqlstate_errors.h
src/sqlstate_errors.rst: ../psycopg/sqlstate_errors.h $(BUILD_DIR)
env/bin/python src/tools/make_sqlstate_docs.py $< > $@
$(BUILD_DIR):
$(MAKE) PYTHON=$(PYTHON) -C .. package
doctest:
$(MAKE) PYTHON=$(PYTHON) -C .. package
$(MAKE) $(SPHOPTS) -C src $@