代码拉取完成,页面将自动刷新
# Makefile for pydbc. Do you want to...
#
# Build the library::
#
# make
#
# Build the documentation::
#
# make env (once)
# make docs
#
# Create a source package::
#
# make sdist
#
# Run the test::
#
# make check # this requires setting up a test database with the correct user
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)
SOURCE_C := $(wildcard pydbc/*.c pydbc/*.h)
SOURCE_PY := $(wildcard lib/*.py)
SOURCE_TESTS := $(wildcard tests/*.py)
SOURCE_DOC := $(wildcard doc/src/*.rst)
SOURCE := $(SOURCE_C) $(SOURCE_PY) $(SOURCE_TESTS) $(SOURCE_DOC)
PACKAGE := $(BUILD_DIR)/pydbc
PLATLIB := $(PACKAGE)/_pydbc.so
PURELIB := $(patsubst lib/%,$(PACKAGE)/%,$(SOURCE_PY))
BUILD_OPT := --build-lib=$(BUILD_DIR)
BUILD_EXT_OPT := --build-lib=$(BUILD_DIR)
SDIST_OPT := --formats=gztar
ifdef PG_CONFIG
BUILD_EXT_OPT += --pg-config=$(PG_CONFIG)
endif
VERSION := $(shell grep PYDBC_VERSION setup.py | head -1 | sed -e "s/.*'\(.*\)'/\1/")
SDIST := dist/pydbc-$(VERSION).tar.gz
.PHONY: check clean
default: package
all: package sdist
package: $(PLATLIB) $(PURELIB)
docs: docs-html
docs-html: doc/html/genindex.html
# for PyPI documentation
docs-zip: doc/docs.zip
sdist: $(SDIST)
env:
$(MAKE) -C doc $@
check:
PYTHONPATH=$(BUILD_DIR) $(PYTHON) -c "import tests; tests.unittest.main(defaultTest='tests.test_suite')" --verbose
testdb:
@echo "* Creating $(TESTDB)"
@if psql -l | grep -q " $(TESTDB) "; then \
dropdb $(TESTDB) >/dev/null; \
fi
createdb $(TESTDB)
# Note to packagers: this requires the postgres user running the test
# to be a superuser. You may change this line to use the superuser only
# to install the contrib. Feel free to suggest a better way to set up the
# testing environment (as the current is enough for development).
psql -f `pg_config --sharedir`/contrib/hstore.sql $(TESTDB)
$(PLATLIB): $(SOURCE_C)
$(PYTHON) setup.py build_ext $(BUILD_EXT_OPT)
$(PACKAGE)/%.py: lib/%.py
$(PYTHON) setup.py build_py $(BUILD_OPT)
touch $@
$(PACKAGE)/tests/%.py: tests/%.py
$(PYTHON) setup.py build_py $(BUILD_OPT)
touch $@
$(SDIST): $(SOURCE)
$(PYTHON) setup.py sdist $(SDIST_OPT)
# docs depend on the build as it partly use introspection.
doc/html/genindex.html: $(PLATLIB) $(PURELIB) $(SOURCE_DOC)
$(MAKE) -C doc html
doc/docs.zip: doc/html/genindex.html
(cd doc/html && zip -r ../docs.zip *)
clean:
rm -rf build
$(MAKE) -C doc clean
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。