diff --git a/CMakeLists.txt b/CMakeLists.txt index 7f41035c8..53c854067 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,6 +33,7 @@ include(tools/internal.cmake) # Define tools used by the kernel set(PYTHON "python" CACHE INTERNAL "") +set(PYTHON3 "python3" CACHE INTERNAL "") RequireTool(CPP_GEN_PATH cpp_gen.sh) RequireTool(CIRCULAR_INCLUDES circular_includes.py) RequireTool(BF_GEN_PATH bitfield_gen.py) @@ -319,7 +320,7 @@ add_custom_command( COMMAND ${CMAKE_COMMAND} -E remove -f "${syscall_dest}" COMMAND - ${PYTHON} "${SYSCALL_ID_GEN_PATH}" + ${PYTHON3} "${SYSCALL_ID_GEN_PATH}" --xml "${syscall_xml_base}/syscall.xml" --kernel_header "${syscall_dest}" DEPENDS diff --git a/config.cmake b/config.cmake index b6535fd5b..7494c9269 100644 --- a/config.cmake +++ b/config.cmake @@ -160,7 +160,7 @@ if(DEFINED KernelDTSList AND (NOT "${KernelDTSList}" STREQUAL "")) file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/gen_headers/plat/machine/") execute_process( COMMAND - ${PYTHON} "${HARDWARE_GEN_PATH}" --dtb "${KernelDTBPath}" --compatibility-strings + ${PYTHON3} "${HARDWARE_GEN_PATH}" --dtb "${KernelDTBPath}" --compatibility-strings "${compatibility_outfile}" --output "${device_dest}" --config "${config_file}" --schema "${config_schema}" --yaml "${platform_yaml}" --arch "${KernelArch}" INPUT_FILE /dev/stdin diff --git a/libsel4/CMakeLists.txt b/libsel4/CMakeLists.txt index ae1927f05..5b3812049 100644 --- a/libsel4/CMakeLists.txt +++ b/libsel4/CMakeLists.txt @@ -126,7 +126,7 @@ add_custom_command( "${CMAKE_CURRENT_SOURCE_DIR}/include/api/syscall.xsd" "${CMAKE_CURRENT_SOURCE_DIR}/include/api/syscall.xml" COMMAND - ${PYTHON} "${SYSCALL_ID_GEN_PATH}" + ${PYTHON3} "${SYSCALL_ID_GEN_PATH}" --xml "${CMAKE_CURRENT_SOURCE_DIR}/include/api/syscall.xml" --libsel4_header include/sel4/syscall.h DEPENDS @@ -148,7 +148,7 @@ add_custom_command( COMMAND echo "CONFIG_WORD_SIZE=${KernelWordSize}" > config COMMAND - "${PYTHON}" "${SYSCALL_STUB_GEN_PATH}" ${buffer} -a "${KernelSel4Arch}" -c config -o + "${PYTHON3}" "${SYSCALL_STUB_GEN_PATH}" ${buffer} -a "${KernelSel4Arch}" -c config -o include/interfaces/sel4_client.h ${interface_xmls} DEPENDS "${SYSCALL_STUB_GEN_PATH}" diff --git a/libsel4/tools/__init__.py b/libsel4/tools/__init__.py index 9bfe41e1b..b402cb3a4 100644 --- a/libsel4/tools/__init__.py +++ b/libsel4/tools/__init__.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright 2017, Data61 # Commonwealth Scientific and Industrial Research Organisation (CSIRO) diff --git a/libsel4/tools/syscall_stub_gen.py b/libsel4/tools/syscall_stub_gen.py index aa9ac3441..460582d97 100644 --- a/libsel4/tools/syscall_stub_gen.py +++ b/libsel4/tools/syscall_stub_gen.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright 2017, Data61 # Commonwealth Scientific and Industrial Research Organisation (CSIRO) diff --git a/manual/Makefile b/manual/Makefile index eea6f339d..0e6c95f4c 100644 --- a/manual/Makefile +++ b/manual/Makefile @@ -40,7 +40,7 @@ mv = mv awk = awk R = R doxygen = doxygen -PYTHON ?= python +PYTHON ?= python3 # To add a second target, simply append the basename of the .tex file here Targets = manual diff --git a/manual/tools/gen_env.py b/manual/tools/gen_env.py index d638a76bf..e76f2c2e5 100755 --- a/manual/tools/gen_env.py +++ b/manual/tools/gen_env.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright 2017, Data61 # Commonwealth Scientific and Industrial Research Organisation (CSIRO) diff --git a/manual/tools/gen_invocations.py b/manual/tools/gen_invocations.py index 97f422ed4..9a7ee648d 100755 --- a/manual/tools/gen_invocations.py +++ b/manual/tools/gen_invocations.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright 2017, Data61 # Commonwealth Scientific and Industrial Research Organisation (CSIRO) diff --git a/manual/tools/parse_doxygen_xml.py b/manual/tools/parse_doxygen_xml.py index c0bdc3b5a..8335752f1 100755 --- a/manual/tools/parse_doxygen_xml.py +++ b/manual/tools/parse_doxygen_xml.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright 2017, Data61 # Commonwealth Scientific and Industrial Research Organisation (CSIRO) @@ -417,7 +417,7 @@ class MarkdownGenerator(Generator): def generate_enumerate_list(self, para, ref_dict, output): """ Returns a Markdown number list """ - for num, item in zip(xrange(sys.maxint), para.contents): + for num, item in zip(range(sys.maxsize), para.contents): parsed_item = self.parse_para(item, ref_dict) output += "%d. %s" % (num, parsed_item) if parsed_item.rstrip() else "" return output diff --git a/tools/bitfield_gen.py b/tools/bitfield_gen.py index bf023ca49..68fadcfc5 100755 --- a/tools/bitfield_gen.py +++ b/tools/bitfield_gen.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright 2017, Data61 diff --git a/tools/circular_includes.py b/tools/circular_includes.py index be1341d9b..8f19f1404 100755 --- a/tools/circular_includes.py +++ b/tools/circular_includes.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright 2017, Data61 # Commonwealth Scientific and Industrial Research Organisation (CSIRO) diff --git a/tools/hardware_gen.py b/tools/hardware_gen.py index de2bbc85c..534a4267d 100644 --- a/tools/hardware_gen.py +++ b/tools/hardware_gen.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright 2018, Data61 # Commonwealth Scientific and Industrial Research Organisation (CSIRO) diff --git a/tools/helpers.cmake b/tools/helpers.cmake index acca30998..a74631ef7 100644 --- a/tools/helpers.cmake +++ b/tools/helpers.cmake @@ -117,7 +117,7 @@ function(GenBFCommand args target_name pbf_path pbf_target deps) add_custom_command( OUTPUT "${target_name_absolute}" COMMAND - "${PYTHON}" "${BF_GEN_PATH}" "${args}" "${pbf_path_absolute}" "${target_name_absolute}" + "${PYTHON3}" "${BF_GEN_PATH}" "${args}" "${pbf_path_absolute}" "${target_name_absolute}" DEPENDS "${BF_GEN_PATH}" "${pbf_path_absolute}" diff --git a/tools/internal.cmake b/tools/internal.cmake index b919ae805..9797dc4e4 100644 --- a/tools/internal.cmake +++ b/tools/internal.cmake @@ -44,7 +44,7 @@ function(gen_invocation_header) OUTPUT "${GEN_OUTPUT}" COMMAND rm -f "${GEN_OUTPUT}" COMMAND - "${PYTHON}" "${INVOCATION_ID_GEN_PATH}" + "${PYTHON3}" "${INVOCATION_ID_GEN_PATH}" --xml "${xml_absolute}" ${libsel4_setting} ${arch_setting} --dest "${GEN_OUTPUT}" DEPENDS "${xml_absolute}" "${INVOCATION_ID_GEN_PATH}" diff --git a/tools/invocation_header_gen.py b/tools/invocation_header_gen.py index a246c6621..d8d120c79 100755 --- a/tools/invocation_header_gen.py +++ b/tools/invocation_header_gen.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright 2017, Data61 # Commonwealth Scientific and Industrial Research Organisation (CSIRO) diff --git a/tools/python-deps/setup.py b/tools/python-deps/setup.py index 30d34b53f..4fb117738 100644 --- a/tools/python-deps/setup.py +++ b/tools/python-deps/setup.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright 2017, Data61 # Commonwealth Scientific and Industrial Research Organisation (CSIRO) diff --git a/tools/syscall_header_gen.py b/tools/syscall_header_gen.py index 9ac499307..105fd48bc 100755 --- a/tools/syscall_header_gen.py +++ b/tools/syscall_header_gen.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright 2017, Data61 # Commonwealth Scientific and Industrial Research Organisation (CSIRO) diff --git a/tools/umm.py b/tools/umm.py index 9d1e48c2c..e8ae8a1e3 100755 --- a/tools/umm.py +++ b/tools/umm.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright 2017, Data61