From: W. Trevor King Date: Fri, 22 Feb 2013 16:48:35 +0000 (-0500) Subject: Makefile: Make Python interpreter configurable X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0e700a114d7127c33c9480f40283fc4fb5c922da;p=assignment-template.git Makefile: Make Python interpreter configurable For example, my default Python is 3.2, but I only have Matplotlib installed for 2.7. However, the default version of Python on newton is 2.6. Now the user can override it at invocation: $ make PYTHON=python2.6 all --- diff --git a/Makefile b/Makefile index 142348e..7a535c8 100644 --- a/Makefile +++ b/Makefile @@ -54,6 +54,7 @@ $(foreach PROGRAM, $(PROGRAMS), $(eval $(PROGRAM)_LIBS = -lm)) CP = cp GREP = grep MKDIR = mkdir +PYTHON = python2.7 RM = rm TAR = tar @@ -188,10 +189,10 @@ trajectories.png: trajectories.gp trajectories.data gnuplot "$<" > "$@" time-vs-y0-E.png: plot_image.py final-vs-y0-E.data - cut -d ' ' -f 1,2,3 final-vs-y0-E.data | python2.7 ./plot_image.py --xyz -t 'Time vs impact parameter and energy' -o "$@" + cut -d ' ' -f 1,2,3 final-vs-y0-E.data | $(PYTHON) ./plot_image.py --xyz -t 'Time vs impact parameter and energy' -o "$@" angle-vs-y0-E.png: plot_image.py final-vs-y0-E.data - cut -d ' ' -f 1,2,4 final-vs-y0-E.data | python2.7 ./plot_image.py --xyz -t 'Angle vs impact parameter and energy' -o "$@" + cut -d ' ' -f 1,2,4 final-vs-y0-E.data | $(PYTHON) ./plot_image.py --xyz -t 'Angle vs impact parameter and energy' -o "$@" # Pattern rule for compiling object files from C++ source # There is an implicit rule for this in GNU make