]> arthur.barton.de Git - bup.git/commitdiff
Makefile: allow PYTHON variable to override python version.
authorGabriel Filion <lelutin@gmail.net>
Fri, 25 Jun 2010 01:36:36 +0000 (21:36 -0400)
committerAvery Pennarun <apenwarr@gmail.com>
Fri, 25 Jun 2010 03:56:08 +0000 (23:56 -0400)
Currently, the Makefile assumes the python command that should be used
is the default python version -- the "python" executable that is found
in PATH. Compiling and testing with a different python version is not
possible without either having a system with another default version, or
by manually changing the link found in PATH.

Correct this situation by using a variable for the python command name,
that can be overridden on the command line like the following:

    make PYTHON=python2.6 test

Signed-off-by: Gabriel Filion <lelutin@gmail.net>
Makefile

index 617c3367e80ae29202e38978931654d950adb076..629eaa5607d991f99ff58624ff3f16bfa32f097e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -26,6 +26,7 @@ bup: lib/bup/_version.py lib/bup/_hashsplit$(SOEXT) cmds
 Documentation/all: bup
 
 INSTALL=install
+PYTHON=python
 MANDIR=$(DESTDIR)/usr/share/man
 DOCDIR=$(DESTDIR)/usr/share/doc/bup
 BINDIR=$(DESTDIR)/usr/bin
@@ -57,7 +58,7 @@ install: all
 
 lib/bup/_hashsplit$(SOEXT): lib/bup/_hashsplit.c lib/bup/csetup.py
        @rm -f $@
-       cd lib/bup && python csetup.py build
+       cd lib/bup && $(PYTHON) csetup.py build
        cp lib/bup/build/*/_hashsplit$(SOEXT) lib/bup/
 
 .PHONY: lib/bup/_version.py
@@ -69,7 +70,7 @@ lib/bup/_version.py:
 runtests: all runtests-python runtests-cmdline
 
 runtests-python:
-       ./wvtest.py $(wildcard t/t*.py)
+       $(PYTHON) wvtest.py $(wildcard t/t*.py)
        
 runtests-cmdline: all
        t/test.sh
@@ -78,7 +79,7 @@ stupid:
        PATH=/bin:/usr/bin $(MAKE) test
        
 test: all
-       ./wvtestrun $(MAKE) runtests
+       ./wvtestrun $(MAKE) PYTHON=$(PYTHON) runtests
 
 %: %.o
        $(CC) $(CFLAGS) (LDFLAGS) -o $@ $^ $(LIBS)