summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2010-11-14 18:23:09 +0000
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2010-11-14 18:23:09 +0000
commit0a2856477c101023f262e740ab3c8c90465fe947 (patch)
treea95788162fc5a0add6f8560a3a2d165fd6a3bcfc /Makefile
parentb25af6311c355c261593f84710d15779507308ac (diff)
downloadpsycopg2-0a2856477c101023f262e740ab3c8c90465fe947.tar.gz
The Makefile can receive the pg_config location.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile14
1 files changed, 11 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 496b6e0..f0893c2 100644
--- a/Makefile
+++ b/Makefile
@@ -39,6 +39,14 @@ PACKAGE := $(BUILD_DIR)/psycopg2
PLATLIB := $(PACKAGE)/_psycopg.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 PSYCOPG_VERSION setup.py | head -1 | sed -e "s/.*'\(.*\)'/\1/")
SDIST := dist/psycopg2-$(VERSION).tar.gz
@@ -100,14 +108,14 @@ testdb:
$(PLATLIB): $(SOURCE_C)
- $(PYTHON) setup.py build --build-lib $(BUILD_DIR)
+ $(PYTHON) setup.py build_ext $(BUILD_EXT_OPT)
$(PACKAGE)/%.py: lib/%.py
- $(PYTHON) setup.py build --build-lib $(BUILD_DIR)
+ $(PYTHON) setup.py build $(BUILD_OPT)
$(SDIST): docs MANIFEST
- $(PYTHON) setup.py sdist --formats=gztar
+ $(PYTHON) setup.py sdist $(SDIST_OPT)
MANIFEST: MANIFEST.in
# Run twice as MANIFEST.in includes MANIFEST