diff options
author | montellese <montellese@xbmc.org> | 2014-07-12 13:57:52 +0200 |
---|---|---|
committer | montellese <montellese@xbmc.org> | 2014-07-17 20:50:30 +0200 |
commit | 6569b0ca2560821f3e76c7a5ef34bc7e2d7cdde9 (patch) | |
tree | 61572bf5ad99c7dfdebc67c3144d981e30f84edd /tools | |
parent | 777106c3feaa585c092d95a7bd7f4074cd703c4b (diff) |
[win32] extend make-addons.bat and make-addons.bat to be able to build specific addons/depends
Diffstat (limited to 'tools')
-rw-r--r-- | tools/buildsteps/win32/make-addon-depends.bat | 39 | ||||
-rw-r--r-- | tools/buildsteps/win32/make-addons.bat | 64 |
2 files changed, 69 insertions, 34 deletions
diff --git a/tools/buildsteps/win32/make-addon-depends.bat b/tools/buildsteps/win32/make-addon-depends.bat index 7197cd80f5..e1c3fdab5e 100644 --- a/tools/buildsteps/win32/make-addon-depends.bat +++ b/tools/buildsteps/win32/make-addon-depends.bat @@ -4,6 +4,18 @@ SETLOCAL SET EXITCODE=0 +SET noclean=false +SET dependency= +FOR %%b in (%1, %2) DO ( + IF %%b == noclean ( + SET noclean=true + ) ELSE ( IF %%b == clean ( + SET noclean=false + ) ELSE ( + SET dependency=%%b + )) +) + rem set Visual C++ build environment call "%VS120COMNTOOLS%..\..\VC\bin\vcvars32.bat" @@ -24,24 +36,23 @@ SET ADDON_DEPENDS_BUILD_PATH=%ADDON_DEPENDS_PATH%\build SET ERRORFILE=%BASE_PATH%\make-addon-depends.error -rem remove the output directory if it exists -IF EXIST "%ADDONS_OUTPUT_PATH%" ( - RMDIR "%ADDONS_OUTPUT_PATH%" /S /Q > NUL +IF %noclean% == false ( + rem remove the output directory if it exists + IF EXIST "%ADDONS_OUTPUT_PATH%" ( + RMDIR "%ADDONS_OUTPUT_PATH%" /S /Q > NUL + ) + + rem remove the build directory if it exists + IF EXIST "%ADDON_DEPENDS_BUILD_PATH%" ( + RMDIR "%ADDON_DEPENDS_BUILD_PATH%" /S /Q > NUL + ) ) rem create the output directory -MKDIR "%ADDONS_OUTPUT_PATH%" - -rem go into the addon depends directory -CD %ADDON_DEPENDS_PATH% - -rem remove the build directory if it exists -IF EXIST "%ADDON_DEPENDS_BUILD_PATH%" ( - RMDIR "%ADDON_DEPENDS_BUILD_PATH%" /S /Q > NUL -) +IF NOT EXIST "%ADDONS_OUTPUT_PATH%" MKDIR "%ADDONS_OUTPUT_PATH%" rem create the build directory -MKDIR "%ADDON_DEPENDS_BUILD_PATH%" +IF NOT EXIST "%ADDON_DEPENDS_BUILD_PATH%" MKDIR "%ADDON_DEPENDS_BUILD_PATH%" rem go into the build directory CD "%ADDON_DEPENDS_BUILD_PATH%" @@ -56,7 +67,7 @@ IF ERRORLEVEL 1 ( ) rem execute nmake to build the addon depends -nmake +nmake %dependency% IF ERRORLEVEL 1 ( ECHO nmake error level: %ERRORLEVEL% > %ERRORFILE% GOTO ERROR diff --git a/tools/buildsteps/win32/make-addons.bat b/tools/buildsteps/win32/make-addons.bat index 36071e508a..10a2a8bc4d 100644 --- a/tools/buildsteps/win32/make-addons.bat +++ b/tools/buildsteps/win32/make-addons.bat @@ -6,9 +6,20 @@ SET EXITCODE=0 SET getdepends=true SET install=false -FOR %%b in (%1) DO ( - IF %%b == nodepends SET getdepends=false - IF %%b == install SET install=true +SET noclean=false +SET addon= +FOR %%b in (%1, %2, %3, %4) DO ( + IF %%b == nodepends ( + SET getdepends=false + ) ELSE ( IF %%b == install ( + SET install=true + ) ELSE ( IF %%b == noclean ( + SET noclean=true + ) ELSE ( IF %%b == clean ( + SET noclean=false + ) ELSE ( + SET addon=%%b + )))) ) rem set Visual C++ build environment @@ -32,34 +43,43 @@ SET ERRORFILE=%BASE_PATH%\make-addons.error SET XBMC_INCLUDE_PATH=%ADDON_DEPENDS_PATH%\include\xbmc SET XBMC_LIB_PATH=%ADDON_DEPENDS_PATH%\lib\xbmc +rem determine whether make-addon-depends.bat should be called with noclean or not +SET addon_depends_mode=clean +IF %noclean% == true ( + SET addon_depends_mode=noclean +) + IF %getdepends% == true ( - CALL make-addon-depends.bat + ECHO -------------------------------------------------- + ECHO Building addon dependencies + ECHO -------------------------------------------------- + + CALL make-addon-depends.bat %addon_depends_mode% IF ERRORLEVEL 1 ( ECHO make-addon-depends error level: %ERRORLEVEL% > %ERRORFILE% GOTO ERROR ) -) -rem make sure the xbmc include and library paths exist -IF EXIST "%XBMC_INCLUDE_PATH%" ( - RMDIR "%XBMC_INCLUDE_PATH%" /S /Q > NUL -) -IF EXIST "%XBMC_LIB_PATH%" ( - RMDIR "%XBMC_LIB_PATH%" /S /Q > NUL + ECHO. ) -MKDIR "%XBMC_INCLUDE_PATH%" -MKDIR "%XBMC_LIB_PATH%" -rem go into the addons directory -CD %ADDONS_PATH% +IF %noclean% == false ( + rem remove the build directory if it exists + IF EXIST "%ADDONS_BUILD_PATH%" ( + RMDIR "%ADDONS_BUILD_PATH%" /S /Q > NUL + ) +) -rem remove the build directory if it exists -IF EXIST "%ADDONS_BUILD_PATH%" ( - RMDIR "%ADDONS_BUILD_PATH%" /S /Q > NUL +rem make sure the xbmc include and library paths exist +IF NOT EXIST "%XBMC_INCLUDE_PATH%" ( + MKDIR "%XBMC_INCLUDE_PATH%" +) +IF NOT EXIST "%XBMC_LIB_PATH%" ( + MKDIR "%XBMC_LIB_PATH%" ) rem create the build directory -MKDIR "%ADDONS_BUILD_PATH%" +IF NOT EXIST "%ADDONS_BUILD_PATH%" MKDIR "%ADDONS_BUILD_PATH%" rem go into the build directory CD "%ADDONS_BUILD_PATH%" @@ -71,6 +91,10 @@ IF %install% == true ( SET ADDONS_INSTALL_PATH=%WORKDIR%\project\Win32BuildSetup\BUILD_WIN32\Xbmc\xbmc-addons ) +ECHO -------------------------------------------------- +ECHO Building addons +ECHO -------------------------------------------------- + rem execute cmake to generate makefiles processable by nmake cmake "%ADDONS_PATH%" -G "NMake Makefiles" ^ -DCMAKE_BUILD_TYPE=Release ^ @@ -87,7 +111,7 @@ IF ERRORLEVEL 1 ( ) rem execute nmake to build the addons -nmake +nmake %addon% IF ERRORLEVEL 1 ( ECHO nmake error level: %ERRORLEVEL% > %ERRORFILE% GOTO ERROR |