From 0504785f9882714b4d94789e71aebd09fa6dc61f Mon Sep 17 00:00:00 2001 From: Stephen Sherratt Date: Thu, 25 May 2017 14:21:25 +1000 Subject: [PATCH] manual: Variable for python interpreter This allows the manual to be built with `PYTHON=mypython make`, to invoke the python scripts involved in generating documentation with a particular version of python. The scripts are compatible with both python2 and python3, but this should simplify debugging if this ever stops being the case. If no value of PYTHON is specified, the default value of "python" is used. --- manual/Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/manual/Makefile b/manual/Makefile index aee9acef4..05b3b4e1e 100644 --- a/manual/Makefile +++ b/manual/Makefile @@ -40,6 +40,7 @@ mv = mv awk = awk R = R doxygen = doxygen +PYTHON ?= python # To add a second target, simply append the basename of the .tex file here Targets = manual @@ -117,12 +118,12 @@ ${DoxygenXml}/%.xml: doxygen # General object invocations are listed as subsections ${GeneratedLatexDir}/ObjectApi.tex: ${DoxygenXml}/group__ObjectApi.xml @echo "====> Generating $@" - ${Q}python ${GenerateLatexTool} --level subsection --input $< --output $@ + ${Q}${PYTHON} ${GenerateLatexTool} --level subsection --input $< --output $@ # Everything else is listed as subsubsections ${GeneratedLatexDir}/%.tex: ${DoxygenXml}/group__%.xml @echo "====> Generating $@" - ${Q}python ${GenerateLatexTool} --level subsubsection --input $< --output $@ + ${Q}${PYTHON} ${GenerateLatexTool} --level subsubsection --input $< --output $@ # Collect generated latex files into single rule generated-latex: ${GeneratedLatexDir}/GeneralSystemCalls.tex \ @@ -145,7 +146,7 @@ ${Stage}/object_invocations.h: ${Libsel4Dir}/include/interfaces/sel4.xml \ ${Libsel4Dir}/sel4_arch_include/ia32/interfaces/sel4arch.xml \ ${Libsel4Dir}/sel4_arch_include/x86_64/interfaces/sel4arch.xml @echo "====> Generating documented object invocation header" - ${Q}python ${GenerateObjectInvocationTool} --dtd ${InterfaceDtd} --output $@ $^ + ${Q}${PYTHON} ${GenerateObjectInvocationTool} --dtd ${InterfaceDtd} --output $@ $^ # Collect generated headers into single rule generated-headers: ${Stage}/object_invocations.h @@ -153,7 +154,7 @@ generated-headers: ${Stage}/object_invocations.h # Fetch information from the environment that needs to go into the document. env.tex: FORCE @echo 'ENV ->' $@ - ${Q}python tools/gen_env.py $@ + ${Q}${PYTHON} tools/gen_env.py $@ manual.pdf: VERSION env.tex manual.tex parts/*.tex parts/api/*.tex