From 9c6d190190c774f8d38d6a4c370eb5040b0f04c1 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Tue, 16 Jan 2007 21:02:00 -0700 Subject: [PATCH] Makefile: use absolute paths when setting PYTHONPATH --- Makefile | 27 ++++++++++++++------------- builddir.py | 2 ++ 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 5f41e8ce..710d593b 100644 --- a/Makefile +++ b/Makefile @@ -1,30 +1,31 @@ default: build +.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 -a) +else +PP=PYTHONPATH=$(shell python ./builddir.py -a) +endif + .PHONY: run-queen run-client test run-queen: cd queen-basedir && PYTHONPATH=.. twistd -noy ../queen.tac -run-client: - cd client-basedir && PYTHONPATH=.. twistd -noy ../client.tac +run-client: build + cd client-basedir && $(PP) twistd -noy ../client.tac run-client2: cd client-basedir2 && PYTHONPATH=.. twistd -noy ../client.tac run-client3: cd client-basedir3 && PYTHONPATH=.. twistd -noy ../client.tac -.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=allmydata REPORTER= diff --git a/builddir.py b/builddir.py index dc777786..ce3d821a 100644 --- a/builddir.py +++ b/builddir.py @@ -7,4 +7,6 @@ from distutils.util import get_platform # 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) +if len(sys.argv) > 1 and sys.argv[1] == "-a": + libdir = os.path.abspath(libdir) print libdir -- 2.45.2