]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
Makefile: add correct generated build/lib.linux-i686-2.4 directory to PYTHONPATH...
authorBrian Warner <warner@lothar.com>
Thu, 14 Dec 2006 10:59:51 +0000 (03:59 -0700)
committerBrian Warner <warner@lothar.com>
Thu, 14 Dec 2006 10:59:51 +0000 (03:59 -0700)
Makefile
builddir.py [new file with mode: 0644]

index 8df28c0fffd2ad0a6ee77a787907e6d918ca17c1..6e635f6c30c309b6cf2e972ab32d45cdad040592 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -12,17 +12,32 @@ run-client2:
 run-client3:
        cd client-basedir3 && PYTHONPATH=.. twistd -noy ../client.tac
 
-test:
-       trial allmydata
+.PHONY: build
+build:
+       python setup.py build
+# where does this go? in a platform-specific directory under build/ . Use
+# builddir.py to locate it.
+
+ifneq ($(PYTHONPATH),)
+PP=PYTHONPATH=${PYTHONPATH}:$(shell python ./builddir.py)
+else
+PP=PYTHONPATH=$(shell python ./builddir.py)
+endif
+
+test: build
+       $(PP) trial allmydata
 
 test-figleaf:
-       trial --reporter=bwverbose-figleaf allmydata
+       $(PP) trial --reporter=bwverbose-figleaf allmydata
        figleaf2html -d coverage-html -x allmydata/test/figleaf.excludes
 # after doing test-figleaf, point your browser at coverage-html/index.html
 
 figleaf-output:
        figleaf2html -d coverage-html -x allmydata/test/figleaf.excludes
 
+clean:
+       rm -rf build
+
 create_dirs:
        mkdir -p queen-basedir
        mkdir -p client-basedir
diff --git a/builddir.py b/builddir.py
new file mode 100644 (file)
index 0000000..dc77778
--- /dev/null
@@ -0,0 +1,10 @@
+#! /usr/bin/python
+
+import sys, os.path
+from distutils.util import get_platform
+
+# because we use extension modules, we need a platform+version-specific
+# libdir. If we were using a pure-python module, this would just be "lib".
+plat_specifier = ".%s-%s" % (get_platform(), sys.version[0:3])
+libdir = os.path.join("build", "lib" + plat_specifier)
+print libdir