Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXhmikosR <xhmikosr@users.sourceforge.net>2011-05-03 14:04:08 +0400
committerXhmikosR <xhmikosr@users.sourceforge.net>2011-05-03 14:04:08 +0400
commit961b4a95a40e34efb1da37ea21469e73c736deed (patch)
treec404b38e03a2fe19ad345485bd1c9e4518ade112 /build.bat
parent789b5f8e6e8b6e0e57f57496c23b0fbd47f2c5d4 (diff)
update build batch files
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@3067 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'build.bat')
-rw-r--r--build.bat114
1 files changed, 57 insertions, 57 deletions
diff --git a/build.bat b/build.bat
index 4830fe2a3..7bf5a41f5 100644
--- a/build.bat
+++ b/build.bat
@@ -2,71 +2,20 @@
CLS
SETLOCAL
-IF /I "%1"=="help" GOTO showhelp
-IF /I "%1"=="/help" GOTO showhelp
-IF /I "%1"=="-help" GOTO showhelp
-IF /I "%1"=="--help" GOTO showhelp
-IF /I "%1"=="/?" GOTO showhelp
-GOTO start
+IF /I "%~1"=="help" GOTO SHOWHELP
+IF /I "%~1"=="/help" GOTO SHOWHELP
+IF /I "%~1"=="-help" GOTO SHOWHELP
+IF /I "%~1"=="--help" GOTO SHOWHELP
+IF /I "%~1"=="/?" GOTO SHOWHELP
-:showhelp
-TITLE build.bat %1
-ECHO.
-ECHO Usage:
-ECHO build.bat [clean^|build^|rebuild] [null^|x86^|x64] [null^|Main^|Resource] [Debug]
-ECHO.
-ECHO Executing "build.bat" will use the defaults: "build.bat build null null"
-ECHO.
-ECHO Examples:
-ECHO build.bat build x86 Resource -Will build the x86 resources only
-ECHO build.bat build null Resource -Will build both x86 and x64 resources only
-ECHO build.bat build x86 -Will build x86 Main exe and the resources
-ECHO build.bat build x86 null Debug -Will build x86 Main Debug exe and resources
-ECHO.
-ECHO "null" can be replaced with anything, e.g. "all": build.bat build x86 all Debug
-ECHO.
-ECHO NOTE: Debug only applies to Main project [mpc-hc.sln]
-ECHO.
-ENDLOCAL
-EXIT /B
-
-
-:start
REM pre-build checks
IF "%VS90COMNTOOLS%" == "" GOTO MissingVar
IF "%MINGW32%" == "" GOTO MissingVar
IF "%MINGW64%" == "" GOTO MissingVar
+CALL :SubDetectInnoSetup
-REM Detect if we are running on 64bit WIN and use Wow6432Node
-IF "%PROGRAMFILES(x86)%zzz"=="zzz" (
- SET "U_=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
-) ELSE (
- SET "U_=HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall"
-)
-FOR /F "delims=" %%a IN (
- 'REG QUERY "%U_%\Inno Setup 5_is1" /v "Inno Setup: App Path"2^>Nul^|FIND "REG_"') DO (
- SET "InnoSetupPath=%%a" & CALL :SubInnoSetupPath %%InnoSetupPath:*Z=%%)
-
-GOTO NoVarMissing
-
-
-:MissingVar
-COLOR 0C
-TITLE Compiling MPC-HC [ERROR]
-ECHO Not all build dependencies found. To build MPC-HC you need:
-ECHO * Visual Studio 2008 (SP1) installed
-ECHO * MinGW 32bit with MSYS pointed to in MINGW32 environment variable
-ECHO * MinGW 64bit with MSYS pointed to in MINGW64 environment variable
-ECHO. & ECHO.
-ECHO Press any key to exit...
-PAUSE >NUL
-ENDLOCAL
-EXIT /B
-
-
-:NoVarMissing
REM set up variables
SET start_time=%date%-%time%
@@ -190,6 +139,57 @@ IF %ERRORLEVEL% NEQ 0 GOTO EndWithError
EXIT /B
+:SHOWHELP
+TITLE "%~nx0 %1"
+ECHO.
+ECHO Usage:
+ECHO %~nx0 [clean^|build^|rebuild] [null^|x86^|x64] [null^|Main^|Resource] [Debug]
+ECHO.
+ECHO Executing "%~nx0" will use the defaults: "%~nx0 build null null"
+ECHO.
+ECHO Examples:
+ECHO %~nx0 build x86 Resource -Will build the x86 resources only
+ECHO %~nx0 build null Resource -Will build both x86 and x64 resources only
+ECHO %~nx0 build x86 -Will build x86 Main exe and the resources
+ECHO %~nx0 build x86 null Debug -Will build x86 Main Debug exe and resources
+ECHO.
+ECHO "null" can be replaced with anything, e.g. "all": %~nx0 build x86 all Debug
+ECHO.
+ECHO NOTE: Debug only applies to Main project [mpc-hc.sln]
+ECHO.
+ENDLOCAL
+EXIT /B
+
+
+:MissingVar
+COLOR 0C
+TITLE Compiling MPC-HC [ERROR]
+ECHO Not all build dependencies found. To build MPC-HC you need:
+ECHO * Visual Studio 2008 (SP1) installed
+ECHO * MinGW 32bit with MSYS pointed to in MINGW32 environment variable
+ECHO * MinGW 64bit with MSYS pointed to in MINGW64 environment variable
+ECHO. & ECHO.
+ECHO Press any key to exit...
+PAUSE >NUL
+ENDLOCAL
+EXIT /B
+
+
+:SubDetectInnoSetup
+REM Detect if we are running on 64bit WIN and use Wow6432Node, and set the path
+REM of Inno Setup accordingly
+IF "%PROGRAMFILES(x86)%zzz"=="zzz" (
+ SET "U_=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
+) ELSE (
+ SET "U_=HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall"
+)
+
+FOR /F "delims=" %%a IN (
+ 'REG QUERY "%U_%\Inno Setup 5_is1" /v "Inno Setup: App Path"2^>Nul^|FIND "REG_"') DO (
+ SET "InnoSetupPath=%%a" & CALL :SubInnoSetupPath %%InnoSetupPath:*Z=%%)
+EXIT /B
+
+
:SubInnoSetupPath
SET InnoSetupPath=%*
EXIT /B