diff -r acf6ffc57fcf .hgignore --- a/.hgignore Sat Mar 09 22:21:32 2013 +0200 +++ b/.hgignore Sun Mar 10 00:29:10 2013 -0600 @@ -17,6 +17,7 @@ platform$ pyconfig.h$ python$ +python.bat$ python.exe$ python-config$ python-config.py$ diff -r acf6ffc57fcf make.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/make.bat Sun Mar 10 00:29:10 2013 -0600 @@ -0,0 +1,148 @@ +@@echo off +rem This is a simple emulation of a very limited subset of the functionality of +rem the UNIX make utility, specific to the CPython project. + +rem Written by Zachary Ware + + +setlocal +pushd %~dp0 +set this=%~n0 + +rem Parse command line arguments + +set TARGET=%1 + +if [%TARGET%] EQU [] ( + set TARGET=build + goto after-parse-loop +) else if [%TARGET%] EQU [-C] ( + goto -C +) else if [%TARGET%] EQU [-64] ( + set TARGET=build + set AMD64=-amd64 +) + +:parse-arg-loop +shift +if [%1] EQU [] goto after-parse-loop +if [%1] EQU [-64] ( + set AMD64=-amd64 + goto parse-arg-loop +) + +echo %1 | findstr /C:"=" 1>nul + +if %ERRORLEVEL% EQU 1 ( + set ARGS=%ARGS% %1 +) else ( + set %1 +) +goto parse-arg-loop +:after-parse-loop + +rem Find an interpreter to use, if one isn't provided + +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=py -3 + ) else ( + set PYTHON=python + ) +) + +rem Go to the proper target, or fall through to a help message + +for %%x in ( + build, clean, patchcheck, ready, test +) do if "%TARGET%" EQU "%%x" goto %%x + +echo The Python Make Script for Windows +echo ---------------------------------- +echo Please note that this script is only intended to emulate a very small +echo portion of the UNIX make utility, and only for the CPython project. +echo. +echo Usage: +echo %this% [build] [-64] -- Build CPython, Debug configuration +echo %this% clean [-64] -- Clean out build artifacts +echo %this% patchcheck -- Run Tools\scripts\patchcheck.py +echo %this% ready [-64] -- Fetch external libraries in preparation for building +echo %this% test -- Test Python (currently %PYTHON%) +echo. +echo %this% -C DIR [args] -- Change dir to DIR and call make.bat with args +echo. +echo You can also set environment variables for the duration of the script by +echo including them in the command line, e.g.: +echo. +echo make test "PYTHON=C:\Python33\python.exe" +echo. +echo You must include the double quotes! +goto end + + + +:build +call Tools\buildbot\build%AMD64%.bat + +rem Create a convenience batch file which calls the newly built interpreter +echo @echo off > python.bat +if DEFINED AMD64 ( + echo %~dp0PCbuild\amd64\python_d.exe %%* >> python.bat +) else ( + echo %~dp0PCbuild\python_d.exe %%* >> python.bat +) +goto end + + + +:clean +call Tools\buildbot\clean%AMD64%.bat +del python.bat +goto end + + + +:-C +shift +cd %1 + +:concat-args-loop +shift +if [%1] EQU [] goto after-concat-loop +set ARGS=%ARGS% %1 +goto concat-args-loop +:after-concat-loop + +call make.bat %ARGS% +goto end + + + +:patchcheck +cmd /c %PYTHON% Tools\scripts\patchcheck.py +goto end + + + +:ready +call Tools\buildbot\external%AMD64%.bat +goto end + + + +:test +cmd /c %PYTHON% -m test %ARGS% +goto end + + + +:end +popd