@echo off\r
-rem A batch program to build or rebuild a particular configuration,\r
-rem just for convenience.\r
-\r
-rem Arguments:\r
-rem -c Set the configuration (default: Release)\r
-rem -p Set the platform (x64 or Win32, default: Win32)\r
-rem -r Target Rebuild instead of Build\r
-rem -t Set the target manually (Build, Rebuild, Clean, or CleanAll)\r
-rem -d Set the configuration to Debug\r
-rem -e Pull in external libraries using get_externals.bat\r
-rem -m Enable parallel build (enabled by default)\r
-rem -M Disable parallel build\r
-rem -v Increased output messages\r
-rem -k Attempt to kill any running Pythons before building (usually unnecessary)\r
+goto Run\r
+:Usage\r
+echo.%~nx0 [flags and arguments] [quoted MSBuild options]\r
+echo.\r
+echo.Build CPython from the command line. Requires the appropriate\r
+echo.version(s) of Microsoft Visual Studio to be installed (see readme.txt).\r
+echo.Also requires Subversion (svn.exe) to be on PATH if the '-e' flag is\r
+echo.given.\r
+echo.\r
+echo.After the flags recognized by this script, up to 9 arguments to be passed\r
+echo.directly to MSBuild may be passed. If the argument contains an '=', the\r
+echo.entire argument must be quoted (e.g. `%~nx0 "/p:PlatformToolset=v100"`)\r
+echo.\r
+echo.Available flags:\r
+echo. -h Display this help message\r
+echo. -V Display version information for the current build\r
+echo. -r Target Rebuild instead of Build\r
+echo. -d Set the configuration to Debug\r
+echo. -e Build external libraries fetched by get_externals.bat\r
+echo. -m Enable parallel build (enabled by default)\r
+echo. -M Disable parallel build\r
+echo. -v Increased output messages\r
+echo. -k Attempt to kill any running Pythons before building (usually done\r
+echo. automatically by the pythoncore project)\r
+echo.\r
+echo.Available arguments:\r
+echo. -c Release ^| Debug ^| PGInstrument ^| PGUpdate\r
+echo. Set the configuration (default: Release)\r
+echo. -p x64 ^| Win32\r
+echo. Set the platform (default: Win32)\r
+echo. -t Build ^| Rebuild ^| Clean ^| CleanAll\r
+echo. Set the target manually\r
+exit /b 127\r
\r
+:Run\r
setlocal\r
set platf=Win32\r
set vs_platf=x86\r
set kill=\r
\r
:CheckOpts\r
+if "%~1"=="-h" goto Usage\r
if "%~1"=="-c" (set conf=%2) & shift & shift & goto CheckOpts\r
if "%~1"=="-p" (set platf=%2) & shift & shift & goto CheckOpts\r
if "%~1"=="-r" (set target=Rebuild) & shift & goto CheckOpts\r
call "%dir%env.bat" %vs_platf% >nul\r
\r
if "%kill%"=="true" (\r
- msbuild /v:m /nologo /target:KillPython "%pcbuild%\pythoncore.vcxproj" /p:Configuration=%conf% /p:Platform=%platf% /p:KillPython=true\r
+ msbuild /v:m /nologo /target:KillPython "%dir%\pythoncore.vcxproj" /p:Configuration=%conf% /p:Platform=%platf% /p:KillPython=true\r
)\r
\r
rem Call on MSBuild to do the work, echo the command.\r