| 1 | @echo off
|
|---|
| 2 | @call env.bat
|
|---|
| 3 |
|
|---|
| 4 | SET _ERROR=
|
|---|
| 5 | SET w32=0
|
|---|
| 6 | SET x64=0
|
|---|
| 7 | SET IA64=0
|
|---|
| 8 | SET hdr=0
|
|---|
| 9 | SET src=0
|
|---|
| 10 | SET clean=0
|
|---|
| 11 | SET upload=0
|
|---|
| 12 | echo Starting build > build.log
|
|---|
| 13 |
|
|---|
| 14 | if "%1" == "" goto args_build_all
|
|---|
| 15 |
|
|---|
| 16 | :args_loop
|
|---|
| 17 | if "%1" == "" goto args_done
|
|---|
| 18 | if "%1" == "w32" set w32=1
|
|---|
| 19 | if "%1" == "x64" set x64=1
|
|---|
| 20 | if "%1" == "ia64" set ia64=1
|
|---|
| 21 | if "%1" == "hdr" set hdr=1
|
|---|
| 22 | if "%1" == "src" set hdr=1
|
|---|
| 23 | if "%1" == "clean" set clean=1
|
|---|
| 24 | if "%1" == "upload" set upload=1
|
|---|
| 25 | shift
|
|---|
| 26 | goto args_loop
|
|---|
| 27 |
|
|---|
| 28 | :args_build_all
|
|---|
| 29 | echo ### BUILDING ALL ### : %1 --
|
|---|
| 30 | SET w32=1
|
|---|
| 31 | SET x64=1
|
|---|
| 32 | SET IA64=1
|
|---|
| 33 | SET hdr=1
|
|---|
| 34 | SET src=1
|
|---|
| 35 |
|
|---|
| 36 | :args_done
|
|---|
| 37 |
|
|---|
| 38 |
|
|---|
| 39 | if not "%clean%" == "1" goto no_build_clean
|
|---|
| 40 | @del/S/Q stage
|
|---|
| 41 | @del/S/Q bjam-tmp-build
|
|---|
| 42 | @del/S/Q bin
|
|---|
| 43 | :no_build_clean
|
|---|
| 44 |
|
|---|
| 45 | if not "%hdr%" == "1" goto no_build_hdr
|
|---|
| 46 | echo %jam% --toolset=msvc --with-cryptopp=%CRYPTOPP_SOURCE% --with-cryptopp-target=%NSCP_INCLUDE%\cryptopp cryptopp-headers >> build.log
|
|---|
| 47 | %jam% --toolset=msvc --with-cryptopp=%CRYPTOPP_SOURCE% --with-cryptopp-target=%NSCP_INCLUDE%\cryptopp cryptopp-headers
|
|---|
| 48 | if %ERRORLEVEL% == -1 goto :error
|
|---|
| 49 | echo :: Result: %ERRORLEVEL% >> build.log
|
|---|
| 50 | :no_build_hdr
|
|---|
| 51 |
|
|---|
| 52 | if not "%src%" == "1" goto no_build_src
|
|---|
| 53 | echo %jam% --toolset=msvc source-archive >> build.log
|
|---|
| 54 | %jam% --toolset=msvc source-archive
|
|---|
| 55 | if %ERRORLEVEL% == -1 goto :error
|
|---|
| 56 | echo :: Result: %ERRORLEVEL% >> build.log
|
|---|
| 57 | :no_build_src
|
|---|
| 58 |
|
|---|
| 59 | if not "%w32%" == "1" goto no_build_x86
|
|---|
| 60 | call :build_one address-model=32 variant=release debug-symbols=on debug-store=database --build-type=complete "--library-path=%TARGET_LIB_x86_DIR%" "--with-psdk-lib=%PLATTFORM_SDK_LIB_x86%"
|
|---|
| 61 | IF DEFINED _ERROR goto :error
|
|---|
| 62 | :no_build_x86
|
|---|
| 63 |
|
|---|
| 64 | if not "%x64%" == "1" goto no_build_x64
|
|---|
| 65 | call :build_one address-model=64 variant=release debug-symbols=on debug-store=database --build-type=complete "--library-path=%TARGET_LIB_x64_DIR%" "--with-psdk-lib=%PLATTFORM_SDK_LIB_x64%"
|
|---|
| 66 | IF DEFINED _ERROR goto :error
|
|---|
| 67 | :no_build_x64
|
|---|
| 68 | rem call build.bat runtime-link=static variant=release architecture=ia64 --library-path=%TARGET_LIB_IA64_DIR%
|
|---|
| 69 |
|
|---|
| 70 | if not "%ia64%" == "1" goto no_build_ia64
|
|---|
| 71 | call :build_one address-model=64 architecture=ia64 variant=release debug-symbols=on debug-store=database --build-type=complete "--library-path=%TARGET_LIB_IA64_DIR%" "--with-psdk-lib=%PLATTFORM_SDK_LIB_IA64%"
|
|---|
| 72 | IF DEFINED _ERROR goto :error
|
|---|
| 73 | :no_build_ia64
|
|---|
| 74 |
|
|---|
| 75 |
|
|---|
| 76 | if not "%upload%" == "1" goto no_build_upload
|
|---|
| 77 | pscp.exe "stage\archive\*.zip" "stage\installer\*.msi" nscp@nsclient.org:/var/nsclient/www/files/nightly/
|
|---|
| 78 | :no_build_upload
|
|---|
| 79 |
|
|---|
| 80 | echo *************
|
|---|
| 81 | echo * *
|
|---|
| 82 | echo * O K *
|
|---|
| 83 | echo * *
|
|---|
| 84 | echo *************
|
|---|
| 85 | goto :eof
|
|---|
| 86 |
|
|---|
| 87 | :build_one
|
|---|
| 88 | echo build.bat runtime-link=static %* >> build.log
|
|---|
| 89 | call build.bat runtime-link=static %*
|
|---|
| 90 | if %ERRORLEVEL% == -1 goto :error_one
|
|---|
| 91 | echo Result: %ERRORLEVEL% >> build.log
|
|---|
| 92 | goto :eof
|
|---|
| 93 |
|
|---|
| 94 | :error_one
|
|---|
| 95 | echo *********************
|
|---|
| 96 | echo * *
|
|---|
| 97 | echo * E R R O R *
|
|---|
| 98 | echo * *
|
|---|
| 99 | echo *********************
|
|---|
| 100 | set _ERROR=1
|
|---|
| 101 | exit /b -1
|
|---|
| 102 | goto :eof
|
|---|
| 103 |
|
|---|
| 104 | :error
|
|---|
| 105 | echo :: Error: %ERRORLEVEL% >> build.log
|
|---|
| 106 | echo *********************
|
|---|
| 107 | echo * *
|
|---|
| 108 | echo * E R R O R *
|
|---|
| 109 | echo * *
|
|---|
| 110 | echo *********************
|
|---|
| 111 | type build.log
|
|---|