@@echo off setlocal if "%PYTHON%" EQU "" ( if EXIST PCbuild\amd64\python.exe ( set PYTHON=PCbuild\amd64\python.exe ) else if EXIST PCbuild\amd64\python_d.exe ( set PYTHON=PCbuild\amd64\python_d.exe ) else if EXIST PCbuild\python.exe ( set PYTHON=PCbuild\python.exe ) else if EXIST PCbuild\python_d.exe ( set PYTHON=PCbuild\python_d.exe ) else if EXIST %systemroot%\py.exe ( set PYTHON=%systemroot%\py.exe -3 ) else (echo Python not found in expected places, trying 'python' instead set PYTHON=python) ) if "%1" EQU "" goto build if "%1" EQU "-64" goto build if "%1" EQU "build" goto build if "%1" EQU "clean" goto clean if "%1" EQU "doc" goto doc if "%1" EQU "help" goto help if "%1" EQU "patchcheck" goto patchcheck if "%1" EQU "test" goto test goto help :help set this=%~n0 echo Help for the Python Windows Make script: echo ---------------------------------------- echo Please note that this script should be considered experimental and is not echo intended to serve as a replacement for the UNIX make utility. echo. echo Usage: echo %this% build [-64] -- Build CPython, Debug configuration echo %this% clean [-64] -- Clean out build artifacts echo %this% doc [args] -- Run Doc\make.bat [args] echo %this% help -- Show this help message echo %this% patchcheck -- Run Tools\scripts\patchcheck.py echo %this% test -- Test Python (%PYTHON%). Up to 8 arguments are echo passed through to the command goto end :build if "%2" EQU "-64" shift if "%1" EQU "-64" ( call Tools\buildbot\build-amd64.bat ) else ( call Tools\buildbot\build.bat ) goto end :clean if "%2" EQU "-64" ( call Tools\buildbot\clean-amd64.bat ) else ( call Tools\buildbot\clean.bat ) goto end :doc set PYTHON=%systemroot%\py.exe -2 cd Doc call make.bat %2 %3 %4 %5 %6 %7 %8 %9 cd .. goto end :patchcheck cmd /c %PYTHON% Tools\scripts\patchcheck.py goto end :test cmd /c %PYTHON% -m test %2 %3 %4 %5 %6 %7 %8 %9 goto end :end endlocal