From 1f8610cebe2c99223db4082a834fb814afd2b697 Mon Sep 17 00:00:00 2001 From: Martin von Gagern Date: Thu, 9 Jul 2015 14:44:01 +0200 Subject: [PATCH] Auto-detect python binary MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We now try whether there is an executable called python2, and if so, use that in preference to python when executing the metric computation. Furthermore, we allow the user to specify the path of the python binary using the PYTHON variable of make, i.e. “make PYTHON=/foo/python2 metrics”. --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 497365bb5..95bbcf470 100644 --- a/Makefile +++ b/Makefile @@ -79,8 +79,11 @@ test: ./node_modules/.bin/jasmine-node test/katex-spec.js ./node_modules/.bin/jasmine-node contrib/auto-render/auto-render-spec.js +PERL=perl +PYTHON=$(shell python2 --version >/dev/null 2>&1 && echo python2 || echo python) + metrics: - cd metrics && ./mapping.pl | ./extract_tfms.py | ./extract_ttfs.py | ./replace_line.py + cd metrics && $(PERL) ./mapping.pl | $(PYTHON) ./extract_tfms.py | $(PYTHON) ./extract_ttfs.py | $(PYTHON) ./replace_line.py clean: rm -rf build/*