2003-07-05 03:10:56 +02:00
|
|
|
::
|
2005-02-08 15:59:13 +01:00
|
|
|
:: This bat file doesn't use cd, all the paths are full paths.
|
|
|
|
:: with this convention this bat file is position independent
|
2003-07-05 03:10:56 +02:00
|
|
|
:: and it will be easier to move the place of somefiles.
|
|
|
|
::
|
|
|
|
|
|
|
|
@echo off
|
2003-10-15 14:47:31 +02:00
|
|
|
set ERRLEV=0
|
2003-07-05 03:10:56 +02:00
|
|
|
|
|
|
|
:CHECK_ENV
|
|
|
|
@call setenvvar.bat
|
|
|
|
@if errorlevel 1 (goto :END)
|
|
|
|
|
2007-02-26 16:18:41 +01:00
|
|
|
@call set_build_target.bat %*
|
|
|
|
|
2003-10-19 03:23:34 +02:00
|
|
|
|
2003-07-05 03:10:56 +02:00
|
|
|
::===========
|
|
|
|
:MAIN
|
|
|
|
@echo.
|
|
|
|
@echo Creating directories
|
2007-09-06 15:25:04 +02:00
|
|
|
@rmdir /s /q %FB_GEN_DIR% 2>nul
|
2010-10-21 00:15:48 +02:00
|
|
|
:: Remove previously generated output, and recreate the directory hierarchy.
|
|
|
|
for %%v in ( alice auth burp dsql gpre isql jrd misc msgs qli examples yvalve) do (
|
|
|
|
@mkdir %FB_GEN_DIR%\%%v
|
2005-02-08 15:59:13 +01:00
|
|
|
)
|
|
|
|
|
2007-09-06 15:25:04 +02:00
|
|
|
@rmdir /s /q %FB_GEN_DIR%\utilities 2>nul
|
2010-10-21 00:15:48 +02:00
|
|
|
|
2007-09-06 15:25:04 +02:00
|
|
|
@mkdir %FB_GEN_DIR%\utilities 2>nul
|
|
|
|
@mkdir %FB_GEN_DIR%\utilities\gstat 2>nul
|
2010-07-23 16:06:29 +02:00
|
|
|
@mkdir %FB_GEN_DIR%\auth\SecurityDatabase 2>nul
|
2010-10-21 00:15:48 +02:00
|
|
|
@mkdir %FB_GEN_DIR%\gpre\std 2>nul
|
2003-07-05 03:10:56 +02:00
|
|
|
|
2006-05-27 20:06:09 +02:00
|
|
|
::=======
|
|
|
|
call :btyacc
|
|
|
|
if "%ERRLEV%"=="1" goto :END
|
|
|
|
|
2011-12-27 00:20:12 +01:00
|
|
|
call :LibTomMath
|
|
|
|
if "%ERRLEV%"=="1" goto :END
|
|
|
|
|
2014-12-01 10:04:39 +01:00
|
|
|
call :zlib
|
|
|
|
if "%ERRLEV%"=="1" goto :END
|
|
|
|
|
2006-05-27 20:06:09 +02:00
|
|
|
@echo Generating DSQL parser...
|
2011-01-12 11:46:56 +01:00
|
|
|
@call parse.bat %*
|
2006-05-27 20:06:09 +02:00
|
|
|
if "%ERRLEV%"=="1" goto :END
|
|
|
|
|
2003-07-05 03:10:56 +02:00
|
|
|
::=======
|
2006-11-19 15:24:09 +01:00
|
|
|
call :gpre_boot
|
2003-10-15 14:47:31 +02:00
|
|
|
if "%ERRLEV%"=="1" goto :END
|
2006-11-19 15:24:09 +01:00
|
|
|
|
2003-07-05 03:10:56 +02:00
|
|
|
::=======
|
2010-10-21 00:15:48 +02:00
|
|
|
@echo Preprocessing the source files needed to build gbak, gpre and isql...
|
2003-07-05 03:10:56 +02:00
|
|
|
@call preprocess.bat BOOT
|
2010-10-21 00:15:48 +02:00
|
|
|
|
2003-07-05 03:10:56 +02:00
|
|
|
::=======
|
2010-10-21 00:15:48 +02:00
|
|
|
call :engine
|
2006-06-02 14:55:19 +02:00
|
|
|
if "%ERRLEV%"=="1" goto :END
|
|
|
|
|
2010-10-21 00:15:48 +02:00
|
|
|
call :gbak
|
2006-06-02 14:55:19 +02:00
|
|
|
if "%ERRLEV%"=="1" goto :END
|
|
|
|
|
2010-10-21 00:15:48 +02:00
|
|
|
call :gpre
|
2006-06-02 14:55:19 +02:00
|
|
|
if "%ERRLEV%"=="1" goto :END
|
2006-05-27 20:06:09 +02:00
|
|
|
|
2010-10-21 00:15:48 +02:00
|
|
|
call :isql
|
|
|
|
if "%ERRLEV%"=="1" goto :END
|
2010-03-01 10:04:13 +01:00
|
|
|
|
2010-10-21 00:15:48 +02:00
|
|
|
@findstr /V "@UDF_COMMENT@" %FB_ROOT_PATH%\builds\install\misc\firebird.conf.in > %FB_BIN_DIR%\firebird.conf
|
2007-09-06 15:25:04 +02:00
|
|
|
|
2014-12-01 10:04:39 +01:00
|
|
|
:: Copy ICU and zlib both to Debug and Release configurations
|
2014-07-17 20:48:46 +02:00
|
|
|
|
|
|
|
@call set_build_target.bat %* RELEASE
|
2014-07-17 22:35:37 +02:00
|
|
|
@mkdir %FB_BIN_DIR%
|
2014-07-17 20:48:46 +02:00
|
|
|
@copy %FB_ROOT_PATH%\extern\icu\icudt???.dat %FB_BIN_DIR% >nul 2>&1
|
|
|
|
@copy %FB_ICU_SOURCE_BIN%\*.dll %FB_BIN_DIR% >nul 2>&1
|
2014-12-01 10:04:39 +01:00
|
|
|
@copy %FB_ROOT_PATH%\extern\zlib\%FB_TARGET_PLATFORM%\*.dll %FB_BIN_DIR% >nul 2>&1
|
2014-07-17 20:48:46 +02:00
|
|
|
|
|
|
|
@call set_build_target.bat %* DEBUG
|
2014-07-17 22:35:37 +02:00
|
|
|
@mkdir %FB_BIN_DIR%
|
2014-02-24 17:23:16 +01:00
|
|
|
@copy %FB_ROOT_PATH%\extern\icu\icudt???.dat %FB_BIN_DIR% >nul 2>&1
|
|
|
|
@copy %FB_ICU_SOURCE_BIN%\*.dll %FB_BIN_DIR% >nul 2>&1
|
2014-12-01 10:04:39 +01:00
|
|
|
@copy %FB_ROOT_PATH%\extern\zlib\%FB_TARGET_PLATFORM%\*.dll %FB_BIN_DIR% >nul 2>&1
|
2006-05-27 20:06:09 +02:00
|
|
|
|
2014-07-17 20:48:46 +02:00
|
|
|
@call set_build_target.bat %*
|
|
|
|
|
|
|
|
|
2006-05-27 20:06:09 +02:00
|
|
|
::=======
|
|
|
|
@call :databases
|
2010-10-21 00:15:48 +02:00
|
|
|
|
2003-07-05 03:10:56 +02:00
|
|
|
::=======
|
|
|
|
@echo Preprocessing the entire source tree...
|
|
|
|
@call preprocess.bat
|
2010-10-21 00:15:48 +02:00
|
|
|
|
2003-07-05 03:10:56 +02:00
|
|
|
::=======
|
|
|
|
@call :msgs
|
2003-10-15 14:47:31 +02:00
|
|
|
if "%ERRLEV%"=="1" goto :END
|
2010-10-21 00:15:48 +02:00
|
|
|
|
2003-10-15 14:47:31 +02:00
|
|
|
@call :codes
|
|
|
|
if "%ERRLEV%"=="1" goto :END
|
2010-10-21 00:15:48 +02:00
|
|
|
|
2003-07-05 03:10:56 +02:00
|
|
|
::=======
|
2006-05-27 20:06:09 +02:00
|
|
|
@call create_msgs.bat msg
|
2003-07-05 03:10:56 +02:00
|
|
|
::=======
|
2010-10-21 00:15:48 +02:00
|
|
|
|
2003-07-05 03:10:56 +02:00
|
|
|
@call :NEXT_STEP
|
2006-10-30 16:14:45 +01:00
|
|
|
@goto :END
|
2003-07-05 03:10:56 +02:00
|
|
|
|
|
|
|
|
2006-05-27 20:06:09 +02:00
|
|
|
::===================
|
|
|
|
:: BUILD btyacc
|
|
|
|
:btyacc
|
|
|
|
@echo.
|
2007-02-26 16:18:41 +01:00
|
|
|
@echo Building btyacc (%FB_OBJ_DIR%)...
|
2016-03-06 09:17:00 +01:00
|
|
|
@call compile.bat %FB_ROOT_PATH%\builds\win32\%VS_VER%\FirebirdBoot btyacc_%FB_TARGET_PLATFORM%.log btyacc
|
2006-05-27 20:06:09 +02:00
|
|
|
if errorlevel 1 call :boot2 btyacc
|
|
|
|
goto :EOF
|
|
|
|
|
2011-12-27 00:20:12 +01:00
|
|
|
::===================
|
|
|
|
:: BUILD LibTomMath
|
2014-07-17 20:48:46 +02:00
|
|
|
:: NS: Note we need both debug and non-debug version as it is a static library linked to CRT
|
|
|
|
:: and linking executable with both debug and non-debug CRT results in undefined behavior
|
2011-12-27 00:20:12 +01:00
|
|
|
:LibTomMath
|
|
|
|
@echo.
|
2014-07-17 20:48:46 +02:00
|
|
|
@call set_build_target.bat %* RELEASE
|
|
|
|
@echo Building LibTomMath (%FB_OBJ_DIR%)...
|
|
|
|
@call compile.bat %FB_ROOT_PATH%\extern\libtommath\libtommath_MSVC%MSVC_VERSION% libtommath_%FB_OBJ_DIR%_%FB_TARGET_PLATFORM%.log libtommath
|
|
|
|
if errorlevel 1 call :boot2 libtommath_%FB_OBJ_DIR%
|
|
|
|
@call set_build_target.bat %* DEBUG
|
2011-12-28 16:15:32 +01:00
|
|
|
@echo Building LibTomMath (%FB_OBJ_DIR%)...
|
2014-07-17 20:48:46 +02:00
|
|
|
@call compile.bat %FB_ROOT_PATH%\extern\libtommath\libtommath_MSVC%MSVC_VERSION% libtommath_%FB_OBJ_DIR%_%FB_TARGET_PLATFORM%.log libtommath
|
|
|
|
if errorlevel 1 call :boot2 libtommath_%FB_OBJ_DIR%
|
2012-01-17 13:23:56 +01:00
|
|
|
@call set_build_target.bat %*
|
2011-12-27 00:20:12 +01:00
|
|
|
goto :EOF
|
|
|
|
|
2014-12-01 10:04:39 +01:00
|
|
|
::===================
|
|
|
|
:: Extract zlib
|
|
|
|
:zlib
|
|
|
|
@echo Extracting pre-built zlib
|
|
|
|
if exist %FB_ROOT_PATH%\extern\zlib\zlib.h (
|
|
|
|
@echo %FB_ROOT_PATH%\extern\zlib\zlib.h already extracted
|
|
|
|
) else (
|
|
|
|
%FB_ROOT_PATH%\extern\zlib\zlib.exe -y > zlib_%FB_TARGET_PLATFORM%.log
|
|
|
|
if errorlevel 1 call :boot2 zlib
|
|
|
|
)
|
|
|
|
goto :EOF
|
|
|
|
|
2003-07-05 03:10:56 +02:00
|
|
|
::===================
|
2006-11-19 15:24:09 +01:00
|
|
|
:: BUILD gpre_boot
|
|
|
|
:gpre_boot
|
2003-07-05 03:10:56 +02:00
|
|
|
@echo.
|
2007-02-26 16:18:41 +01:00
|
|
|
@echo Building gpre_boot (%FB_OBJ_DIR%)...
|
2016-03-06 09:17:00 +01:00
|
|
|
@call compile.bat %FB_ROOT_PATH%\builds\win32\%VS_VER%\FirebirdBoot gpre_boot_%FB_TARGET_PLATFORM%.log gpre_boot
|
2010-10-21 00:15:48 +02:00
|
|
|
if errorlevel 1 call :boot2 gpre_boot
|
2003-07-05 03:10:56 +02:00
|
|
|
goto :EOF
|
|
|
|
|
2003-10-19 03:23:34 +02:00
|
|
|
::===================
|
2010-10-21 00:15:48 +02:00
|
|
|
:: BUILD engine
|
|
|
|
:engine
|
|
|
|
@echo.
|
|
|
|
@echo Building engine (%FB_OBJ_DIR%)...
|
2016-03-24 20:56:54 +01:00
|
|
|
@call compile.bat %FB_ROOT_PATH%\builds\win32\%VS_VER%\Firebird engine_%FB_TARGET_PLATFORM%.log engine
|
2016-03-06 09:17:00 +01:00
|
|
|
@call compile.bat %FB_ROOT_PATH%\builds\win32\%VS_VER%\Firebird engine_%FB_TARGET_PLATFORM%.log ib_util
|
2010-10-21 00:15:48 +02:00
|
|
|
if errorlevel 1 call :boot2 engine
|
|
|
|
@goto :EOF
|
2006-05-27 20:06:09 +02:00
|
|
|
|
|
|
|
::===================
|
2010-10-21 00:15:48 +02:00
|
|
|
:: BUILD gbak
|
|
|
|
:gbak
|
2006-05-27 20:06:09 +02:00
|
|
|
@echo.
|
2010-10-21 00:15:48 +02:00
|
|
|
@echo Building gbak (%FB_OBJ_DIR%)...
|
2016-03-06 09:17:00 +01:00
|
|
|
@call compile.bat %FB_ROOT_PATH%\builds\win32\%VS_VER%\Firebird gbak_%FB_TARGET_PLATFORM%.log gbak
|
2010-10-21 00:15:48 +02:00
|
|
|
if errorlevel 1 call :boot2 gbak
|
2006-05-27 20:06:09 +02:00
|
|
|
@goto :EOF
|
|
|
|
|
|
|
|
::===================
|
2010-10-21 00:15:48 +02:00
|
|
|
:: BUILD gpre
|
|
|
|
:gpre
|
2006-05-27 20:06:09 +02:00
|
|
|
@echo.
|
2010-10-21 00:15:48 +02:00
|
|
|
@echo Building gpre (%FB_OBJ_DIR%)...
|
2016-03-06 09:17:00 +01:00
|
|
|
@call compile.bat %FB_ROOT_PATH%\builds\win32\%VS_VER%\Firebird gpre_%FB_TARGET_PLATFORM%.log gpre
|
2010-10-21 00:15:48 +02:00
|
|
|
if errorlevel 1 call :boot2 gpre
|
2003-07-05 03:10:56 +02:00
|
|
|
@goto :EOF
|
2003-10-19 03:23:34 +02:00
|
|
|
|
|
|
|
::===================
|
2010-10-21 00:15:48 +02:00
|
|
|
:: BUILD isql
|
|
|
|
:isql
|
2003-10-19 03:23:34 +02:00
|
|
|
@echo.
|
2010-10-21 00:15:48 +02:00
|
|
|
@echo Building isql (%FB_OBJ_DIR%)...
|
2016-03-06 09:17:00 +01:00
|
|
|
@call compile.bat %FB_ROOT_PATH%\builds\win32\%VS_VER%\Firebird isql_%FB_TARGET_PLATFORM%.log isql
|
2010-10-21 00:15:48 +02:00
|
|
|
if errorlevel 1 call :boot2 isql
|
2003-10-19 03:23:34 +02:00
|
|
|
@goto :EOF
|
|
|
|
|
2006-05-27 20:06:09 +02:00
|
|
|
::===================
|
|
|
|
:: ERROR boot
|
|
|
|
:boot2
|
2003-10-15 14:47:31 +02:00
|
|
|
echo.
|
2007-09-13 12:20:33 +02:00
|
|
|
echo Error building %1, see %1_%FB_TARGET_PLATFORM%.log
|
2003-10-15 14:47:31 +02:00
|
|
|
echo.
|
|
|
|
set ERRLEV=1
|
|
|
|
goto :EOF
|
2003-07-05 03:10:56 +02:00
|
|
|
|
2003-10-19 03:23:34 +02:00
|
|
|
|
2003-07-05 03:10:56 +02:00
|
|
|
::===================
|
2003-10-15 14:47:31 +02:00
|
|
|
:: BUILD messages
|
2003-07-05 03:10:56 +02:00
|
|
|
:msgs
|
|
|
|
@echo.
|
2007-02-26 16:18:41 +01:00
|
|
|
@echo Building build_msg (%FB_OBJ_DIR%)...
|
2016-03-06 09:17:00 +01:00
|
|
|
@call compile.bat %FB_ROOT_PATH%\builds\win32\%VS_VER%\FirebirdBoot build_msg_%FB_TARGET_PLATFORM%.log build_msg
|
2003-10-15 14:47:31 +02:00
|
|
|
if errorlevel 1 goto :msgs2
|
|
|
|
@goto :EOF
|
|
|
|
:msgs2
|
|
|
|
echo.
|
2007-09-06 15:25:04 +02:00
|
|
|
echo Error building build_msg, see build_msg_%FB_TARGET_PLATFORM%.log
|
2003-10-15 14:47:31 +02:00
|
|
|
echo.
|
|
|
|
set ERRLEV=1
|
|
|
|
goto :EOF
|
|
|
|
|
|
|
|
::===================
|
|
|
|
:: BUILD codes
|
|
|
|
:codes
|
|
|
|
@echo.
|
2007-02-26 16:18:41 +01:00
|
|
|
@echo Building codes (%FB_OBJ_DIR%)...
|
2016-03-06 09:17:00 +01:00
|
|
|
@call compile.bat %FB_ROOT_PATH%\builds\win32\%VS_VER%\FirebirdBoot codes_%FB_TARGET_PLATFORM%.log codes
|
2003-10-15 14:47:31 +02:00
|
|
|
if errorlevel 1 goto :codes2
|
2003-07-05 03:10:56 +02:00
|
|
|
@goto :EOF
|
2003-10-15 14:47:31 +02:00
|
|
|
:codes2
|
|
|
|
echo.
|
2007-09-06 15:25:04 +02:00
|
|
|
echo Error building codes, see codes_%FB_TARGET_PLATFORM%.log
|
2003-10-15 14:47:31 +02:00
|
|
|
echo.
|
|
|
|
set ERRLEV=1
|
|
|
|
goto :EOF
|
2003-07-05 03:10:56 +02:00
|
|
|
|
|
|
|
::==============
|
2006-05-27 20:06:09 +02:00
|
|
|
:databases
|
2007-09-06 15:25:04 +02:00
|
|
|
@rmdir /s /q %FB_GEN_DIR%\dbs 2>nul
|
|
|
|
@mkdir %FB_GEN_DIR%\dbs 2>nul
|
2006-05-27 20:06:09 +02:00
|
|
|
|
2016-03-06 09:32:18 +01:00
|
|
|
@echo create database '%FB_GEN_DB_DIR%\dbs\security4.fdb'; | "%FB_BIN_DIR%\isql" -q
|
|
|
|
@"%FB_BIN_DIR%\isql" -q %FB_GEN_DB_DIR%/dbs/security4.fdb -i %FB_ROOT_PATH%\src\dbs\security.sql
|
|
|
|
@copy %FB_GEN_DIR%\dbs\security4.fdb %FB_GEN_DIR%\dbs\security.fdb > nul
|
2006-05-27 20:06:09 +02:00
|
|
|
|
2010-10-21 00:15:48 +02:00
|
|
|
@%FB_BIN_DIR%\gbak -r %FB_ROOT_PATH%\builds\misc\metadata.gbak %FB_GEN_DB_DIR%/dbs/metadata.fdb
|
2006-05-27 20:06:09 +02:00
|
|
|
|
|
|
|
@call create_msgs.bat db
|
|
|
|
|
2010-10-21 00:15:48 +02:00
|
|
|
@%FB_BIN_DIR%\gbak -r %FB_ROOT_PATH%\builds\misc\help.gbak %FB_GEN_DB_DIR%/dbs/help.fdb
|
2007-09-06 15:25:04 +02:00
|
|
|
@copy %FB_GEN_DIR%\dbs\metadata.fdb %FB_GEN_DIR%\dbs\yachts.lnk > nul
|
2006-05-27 20:06:09 +02:00
|
|
|
|
2003-07-05 03:10:56 +02:00
|
|
|
@goto :EOF
|
|
|
|
|
2006-05-27 20:06:09 +02:00
|
|
|
|
2003-07-05 03:10:56 +02:00
|
|
|
::==============
|
2006-05-27 20:06:09 +02:00
|
|
|
:NEXT_STEP
|
2003-07-05 03:10:56 +02:00
|
|
|
@echo.
|
2006-05-27 20:06:09 +02:00
|
|
|
@echo You may now run make_all.bat [DEBUG] [CLEAN]
|
2003-07-05 03:10:56 +02:00
|
|
|
@echo.
|
|
|
|
@goto :EOF
|
|
|
|
|
|
|
|
:END
|