]> granicus.if.org Git - python/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 error in 'kill' target (already fixed in 2.7, somehow the fix
didn't make it to this branch).

PCbuild/build.bat

index 0fb01d777d7ea1ab47edf0b82b893234e70d5d14..6ca628b1010963f492575d80e708518fa04a08fa 100644 (file)
@@ -1,19 +1,39 @@
 @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
@@ -25,6 +45,7 @@ set verbose=/nologo /v:m
 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
@@ -43,7 +64,7 @@ rem Setup the environment
 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