From a59ca71bc20213fa62337120820968fde3e9b772 Mon Sep 17 00:00:00 2001 From: "David A. Wheeler" Date: Wed, 23 Aug 2017 21:02:08 -0400 Subject: [PATCH] Add PYTHON macro to the makefile Signed-off-by: David A. Wheeler --- makefile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/makefile b/makefile index 239b34e..b104f50 100644 --- a/makefile +++ b/makefile @@ -16,6 +16,7 @@ VERSIONEDNAME=$(NAME)-$(VERSION) ARCH=noarch SAMPLE_DIR=/usr/src/linux-2.2.16 +PYTHON=python # Flawfinder has traditionally used INSTALL_DIR, INSTALL_DIR_BIN, and # INSTALL_DIR_MAN. Here we add support for GNU variables like prefix, etc.; @@ -126,13 +127,14 @@ time: test: flawfinder test.c test2.c # Omit time report so that results are always the same textually. - ./flawfinder --omittime test.c test2.c > test-results.txt - ./flawfinder --csv test.c test2.c > test-results.csv + # Set PYTHON as needed, including to "" + $(PYTHON) ./flawfinder --omittime test.c test2.c > test-results.txt + $(PYTHON) ./flawfinder --csv test.c test2.c > test-results.csv echo >> test-results.txt echo "Testing for no ending newline:" >> test-results.txt - ./flawfinder --omittime no-ending-newline.c | \ + $(PYTHON) ./flawfinder --omittime no-ending-newline.c | \ grep 'Lines analyzed' >> test-results.txt - ./flawfinder --omittime --html --context test.c test2.c > test-results.html + $(PYTHON) ./flawfinder --omittime --html --context test.c test2.c > test-results.html @echo "Differences from expected results:" @diff -u correct-results.txt test-results.txt @diff -u correct-results.html test-results.html