From: Brian Warner Date: Thu, 14 Dec 2006 10:59:51 +0000 (-0700) Subject: Makefile: add correct generated build/lib.linux-i686-2.4 directory to PYTHONPATH... X-Git-Tag: tahoe_v0.1.0-0-UNSTABLE~430 X-Git-Url: https://git.rkrishnan.org/%5B/frontends/...?a=commitdiff_plain;h=07fd8766d183713ffc36241ba31bcc82ac2308f4;p=tahoe-lafs%2Ftahoe-lafs.git Makefile: add correct generated build/lib.linux-i686-2.4 directory to PYTHONPATH for tests --- diff --git a/Makefile b/Makefile index 8df28c0f..6e635f6c 100644 --- 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 index 00000000..dc777786 --- /dev/null +++ b/builddir.py @@ -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