File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -385,7 +385,17 @@ validateXML: createXMLExamples
385385 xmllint --noout --relaxng cppcheck-errors.rng /tmp/example.xml
386386
387387checkCWEEntries : /tmp/errorlist.xml
388- ./tools/listErrorsWithoutCWE.py -F /tmp/errorlist.xml
388+ # Find available Python interpreter
389+ ifndef PYTHON_INTERPRETER
390+ PYTHON_INTERPRETER := $(shell which python3)
391+ endif
392+ ifndef PYTHON_INTERPRETER
393+ PYTHON_INTERPRETER := $(shell which python)
394+ endif
395+ ifndef PYTHON_INTERPRETER
396+ $(error Did not find a Python interpreter)
397+ endif
398+ $(PYTHON_INTERPRETER ) tools/listErrorsWithoutCWE.py -F /tmp/errorlist.xml
389399.PHONY : validateRules
390400validateRules :
391401 xmllint --noout rules/* .xml
Original file line number Diff line number Diff line change @@ -496,7 +496,17 @@ int main(int argc, char **argv)
496496 fout << " \t xmllint --noout --relaxng cppcheck-errors.rng /tmp/errorlist.xml\n " ;
497497 fout << " \t xmllint --noout --relaxng cppcheck-errors.rng /tmp/example.xml\n " ;
498498 fout << " \n checkCWEEntries: /tmp/errorlist.xml\n " ;
499- fout << " \t ./tools/listErrorsWithoutCWE.py -F /tmp/errorlist.xml\n " ;
499+ fout << " \t # Find available Python interpreter\n " ;
500+ fout << " \t ifndef PYTHON_INTERPRETER\n " ;
501+ fout << " \t\t PYTHON_INTERPRETER := $(shell which python3)\n " ;
502+ fout << " \t endif\n " ;
503+ fout << " \t ifndef PYTHON_INTERPRETER\n " ;
504+ fout << " \t\t PYTHON_INTERPRETER := $(shell which python)\n " ;
505+ fout << " \t endif\n " ;
506+ fout << " \t ifndef PYTHON_INTERPRETER\n " ;
507+ fout << " \t\t $(error Did not find a Python interpreter)\n " ;
508+ fout << " \t endif\n " ;
509+ fout << " \t $(PYTHON_INTERPRETER) tools/listErrorsWithoutCWE.py -F /tmp/errorlist.xml\n " ;
500510 fout << " .PHONY: validateRules\n " ;
501511 fout << " validateRules:\n " ;
502512 fout << " \t xmllint --noout rules/*.xml\n " ;
You can’t perform that action at this time.
0 commit comments