]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Turn 'rem' comments into a real usage message in PCbuild/build.bat
authorZachary Ware <zachary.ware@gmail.com>
Wed, 2 Sep 2015 18:21:19 +0000 (13:21 -0500)
committerZachary Ware <zachary.ware@gmail.com>
Wed, 2 Sep 2015 18:21:19 +0000 (13:21 -0500)
Also fixes quoting to match 3.5+

PCbuild/build.bat

index 3d3738b6515e95888272c0d04d1d4f0a657aedfb..cd88d3b7a8c87115f1d080ec67c4bc2f51d0e339 100644 (file)
@@ -1,19 +1,38 @@
 @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\r
-rem  -M  Disable parallel build (disabled by default)\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.  -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\r
+echo.  -M  Disable parallel build (disabled by default)\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
@@ -25,23 +44,24 @@ set verbose=/nologo /v:m
 set kill=\r
 \r
 :CheckOpts\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
-if '%1'=='-t' (set target=%2) & shift & shift & goto CheckOpts\r
-if '%1'=='-d' (set conf=Debug) & shift & goto CheckOpts\r
-if '%1'=='-e' call "%dir%get_externals.bat" & shift & goto CheckOpts\r
-if '%1'=='-m' (set parallel=/m) & shift & goto CheckOpts\r
-if '%1'=='-M' (set parallel=) & shift & goto CheckOpts\r
-if '%1'=='-v' (set verbose=/v:n) & shift & goto CheckOpts\r
-if '%1'=='-k' (set kill=true) & shift & goto 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
+if "%~1"=="-t" (set target=%2) & shift & shift & goto CheckOpts\r
+if "%~1"=="-d" (set conf=Debug) & shift & goto CheckOpts\r
+if "%~1"=="-e" call "%dir%get_externals.bat" & shift & goto CheckOpts\r
+if "%~1"=="-m" (set parallel=/m) & shift & goto CheckOpts\r
+if "%~1"=="-M" (set parallel=) & shift & goto CheckOpts\r
+if "%~1"=="-v" (set verbose=/v:n) & shift & goto CheckOpts\r
+if "%~1"=="-k" (set kill=true) & shift & goto CheckOpts\r
 \r
-if '%platf%'=='x64' (set vs_platf=x86_amd64)\r
+if "%platf%"=="x64" (set vs_platf=x86_amd64)\r
 \r
 rem Setup the environment\r
 call "%dir%env.bat" %vs_platf% >nul\r
 \r
-if '%kill%'=='true' (\r
+if "%kill%"=="true" (\r
     msbuild /v:m /nologo /target:KillPython "%dir%\pythoncore.vcxproj" /p:Configuration=%conf% /p:Platform=%platf% /p:KillPython=true\r
 )\r
 \r