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
|
2022-08-08 13:32:53 +02:00
|
|
|
@call setenvvar.bat %*
|
2003-07-05 03:10:56 +02:00
|
|
|
@if errorlevel 1 (goto :END)
|
|
|
|
|
2003-10-19 03:23:34 +02:00
|
|
|
|
2003-07-05 03:10:56 +02:00
|
|
|
::===========
|
|
|
|
:MAIN
|
|
|
|
@echo.
|
2022-08-08 02:14:52 +02:00
|
|
|
|
|
|
|
@echo Cleaning output directory
|
|
|
|
@rmdir /S /Q "%FB_OUTPUT_DIR%" 2>nul
|
|
|
|
:: short delay to let OS complete actions by rmdir above
|
|
|
|
@timeout 1 >nul
|
|
|
|
|
2003-07-05 03:10:56 +02:00
|
|
|
@echo Creating directories
|
2020-08-28 17:53:35 +02:00
|
|
|
:: Create the directory hierarchy.
|
2021-06-08 15:31:18 +02:00
|
|
|
for %%v in ( alice auth burp dsql gpre isql jrd misc msgs examples yvalve utilities) do (
|
2020-08-28 17:53:35 +02:00
|
|
|
@mkdir %FB_GEN_DIR%\%%v 2>nul
|
2005-02-08 15:59:13 +01:00
|
|
|
)
|
|
|
|
|
2007-09-06 15:25:04 +02:00
|
|
|
@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
|
|
|
|
2021-09-15 13:37:17 +02:00
|
|
|
@mkdir %FB_OUTPUT_DIR%\include\firebird\impl 2>nul
|
2022-08-08 02:14:52 +02:00
|
|
|
@mkdir %FB_OUTPUT_DIR%\tzdata 2>nul
|
2021-09-15 13:37:17 +02:00
|
|
|
|
2020-08-28 17:53:35 +02:00
|
|
|
call :interfaces
|
|
|
|
if "%ERRLEV%"=="1" goto :END
|
|
|
|
|
2006-05-27 20:06:09 +02:00
|
|
|
call :btyacc
|
|
|
|
if "%ERRLEV%"=="1" goto :END
|
|
|
|
|
2017-12-29 09:55:31 +01:00
|
|
|
call :LibTom
|
|
|
|
if "%ERRLEV%"=="1" goto :END
|
|
|
|
|
|
|
|
call :decNumber
|
2011-12-27 00:20:12 +01:00
|
|
|
if "%ERRLEV%"=="1" goto :END
|
|
|
|
|
2019-09-16 19:59:54 +02:00
|
|
|
if "%FB_TARGET_PLATFORM%"=="x64" call :ttmath
|
|
|
|
if "%ERRLEV%"=="1" goto :END
|
|
|
|
|
2019-08-12 02:33:45 +02:00
|
|
|
call :re2
|
|
|
|
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
|
|
|
::=======
|
2022-08-08 02:14:52 +02:00
|
|
|
@echo Preprocessing the source files needed to build gpre and isql...
|
2022-08-08 13:32:53 +02:00
|
|
|
@call preprocess.bat %FBBUILD_BUILDTYPE% 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 :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
|
|
|
|
2020-01-15 18:01:32 +01:00
|
|
|
@copy %FB_ROOT_PATH%\builds\install\misc\firebird.conf %FB_BIN_DIR%\firebird.conf
|
2007-09-06 15:25:04 +02:00
|
|
|
|
2022-08-08 02:14:52 +02:00
|
|
|
:: Copy ICU and zlib to the output directory
|
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
|
2022-08-08 02:14:52 +02:00
|
|
|
@copy %FB_ROOT_PATH%\extern\icu\tzdata-extract\* %FB_OUTPUT_DIR%\tzdata >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
|
|
|
|
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...
|
2022-08-08 13:32:53 +02:00
|
|
|
@call preprocess.bat %FBBUILD_BUILDTYPE%
|
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-07-05 03:10:56 +02:00
|
|
|
::=======
|
2022-08-08 13:32:53 +02:00
|
|
|
@call create_msgs.bat %FBBUILD_BUILDTYPE%
|
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%)...
|
2019-04-25 17:20:02 +02:00
|
|
|
@call compile.bat 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
|
|
|
::===================
|
2017-12-29 09:55:31 +01:00
|
|
|
:: BUILD LibTom
|
|
|
|
:LibTom
|
2011-12-27 00:20:12 +01:00
|
|
|
@echo.
|
2011-12-28 16:15:32 +01:00
|
|
|
@echo Building LibTomMath (%FB_OBJ_DIR%)...
|
2022-08-16 12:24:59 +02:00
|
|
|
@call compile.bat extern\libtommath\libtommath_MSVC%MSVC_VERSION% libtommath_%FBBUILD_BUILDTYPE%_%FB_TARGET_PLATFORM%.log libtommath
|
2014-07-17 20:48:46 +02:00
|
|
|
if errorlevel 1 call :boot2 libtommath_%FB_OBJ_DIR%
|
2017-12-29 09:55:31 +01:00
|
|
|
@echo Building LibTomCrypt (%FB_OBJ_DIR%)...
|
2022-08-16 12:24:59 +02:00
|
|
|
@call compile.bat extern\libtomcrypt\libtomcrypt_MSVC%MSVC_VERSION% libtomcrypt_%FBBUILD_BUILDTYPE%_%FB_TARGET_PLATFORM%.log libtomcrypt
|
2017-12-29 09:55:31 +01:00
|
|
|
if errorlevel 1 call :boot2 libtomcrypt_%FB_OBJ_DIR%
|
|
|
|
goto :EOF
|
|
|
|
|
|
|
|
::===================
|
|
|
|
:: BUILD decNumber
|
|
|
|
:decNumber
|
|
|
|
@echo.
|
|
|
|
@echo Building decNumber (%FB_OBJ_DIR%)...
|
2022-08-16 12:24:59 +02:00
|
|
|
@call compile.bat extern\decNumber\msvc\decNumber_MSVC%MSVC_VERSION% decNumber_%FBBUILD_BUILDTYPE%_%FB_TARGET_PLATFORM%.log decNumber
|
2017-12-29 09:55:31 +01:00
|
|
|
if errorlevel 1 call :boot2 decNumber_%FB_OBJ_DIR%
|
2011-12-27 00:20:12 +01:00
|
|
|
goto :EOF
|
|
|
|
|
2019-09-16 19:59:54 +02:00
|
|
|
::===================
|
|
|
|
:: BUILD ttmath
|
|
|
|
:ttmath
|
|
|
|
@echo.
|
2019-09-30 13:45:32 +02:00
|
|
|
@echo Building ttmath (%FB_OBJ_DIR%)...
|
2022-08-16 12:24:59 +02:00
|
|
|
@mkdir %FB_ROOT_PATH%\extern\ttmath\%FBBUILD_BUILDTYPE% 2>nul
|
|
|
|
if /I "%FBBUILD_BUILDTYPE%"=="debug" (
|
|
|
|
@ml64.exe /c /Zi /Fo %FB_ROOT_PATH%\extern\ttmath\%FBBUILD_BUILDTYPE%\ttmathuint_x86_64_msvc.obj %FB_ROOT_PATH%\extern\ttmath\ttmathuint_x86_64_msvc.asm
|
2022-08-08 02:14:53 +02:00
|
|
|
) else (
|
2022-08-16 12:24:59 +02:00
|
|
|
@ml64.exe /c /Fo %FB_ROOT_PATH%\extern\ttmath\%FBBUILD_BUILDTYPE%\ttmathuint_x86_64_msvc.obj %FB_ROOT_PATH%\extern\ttmath\ttmathuint_x86_64_msvc.asm
|
2022-08-08 02:14:53 +02:00
|
|
|
)
|
2019-09-16 19:59:54 +02:00
|
|
|
if errorlevel 1 call :boot2 ttmath_%FB_OBJ_DIR%
|
|
|
|
goto :EOF
|
|
|
|
|
2019-08-12 02:33:45 +02:00
|
|
|
::===================
|
|
|
|
:: BUILD re2
|
|
|
|
:re2
|
|
|
|
@echo.
|
|
|
|
@echo Building re2...
|
2019-08-12 23:57:10 +02:00
|
|
|
@mkdir %FB_ROOT_PATH%\extern\re2\builds\%FB_TARGET_PLATFORM% 2>nul
|
|
|
|
@pushd %FB_ROOT_PATH%\extern\re2\builds\%FB_TARGET_PLATFORM%
|
2021-10-28 18:48:23 +02:00
|
|
|
@cmake -G "%MSVC_CMAKE_GENERATOR%" -A %FB_TARGET_PLATFORM% -S %FB_ROOT_PATH%\extern\re2
|
2020-04-22 15:41:11 +02:00
|
|
|
if errorlevel 1 call :boot2 re2
|
2022-08-08 02:14:53 +02:00
|
|
|
@cmake --build %FB_ROOT_PATH%\extern\re2\builds\%FB_TARGET_PLATFORM% --target ALL_BUILD --config %FBBUILD_BUILDTYPE% > re2_%FBBUILD_BUILDTYPE%_%FB_TARGET_PLATFORM%.log
|
2019-08-12 23:57:10 +02:00
|
|
|
@popd
|
2019-08-12 02:33:45 +02:00
|
|
|
goto :EOF
|
|
|
|
|
2020-08-28 17:53:35 +02:00
|
|
|
::===================
|
2020-09-03 10:38:52 +02:00
|
|
|
:: Build CLOOP and generate interface headers
|
2020-08-28 17:53:35 +02:00
|
|
|
:interfaces
|
|
|
|
@echo.
|
2020-09-03 10:38:52 +02:00
|
|
|
@echo Building CLOOP and generating interfaces...
|
2020-08-28 17:53:35 +02:00
|
|
|
@nmake /s /x interfaces_%FB_TARGET_PLATFORM%.log /f gen_helper.nmake updateCloopInterfaces
|
|
|
|
if errorlevel 1 call :boot2 interfaces
|
|
|
|
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%)...
|
2019-04-25 17:20:02 +02:00
|
|
|
@call compile.bat 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%)...
|
2022-07-18 13:12:24 +02:00
|
|
|
@call compile.bat builds\win32\%VS_VER%\Firebird engine_%FB_TARGET_PLATFORM%.log DLLs\engine
|
|
|
|
@call compile.bat builds\win32\%VS_VER%\Firebird engine_%FB_TARGET_PLATFORM%.log DLLs\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 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%)...
|
2022-07-18 13:12:24 +02:00
|
|
|
@call compile.bat builds\win32\%VS_VER%\Firebird gpre_%FB_TARGET_PLATFORM%.log EXEs\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%)...
|
2022-07-18 13:12:24 +02:00
|
|
|
@call compile.bat builds\win32\%VS_VER%\Firebird isql_%FB_TARGET_PLATFORM%.log EXEs\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%)...
|
2019-04-25 17:20:02 +02:00
|
|
|
@call compile.bat 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
|
|
|
|
|
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
|
|
|
|
2021-05-31 13:36:48 +02:00
|
|
|
@echo Create security5.fdb...
|
|
|
|
@echo create database '%FB_GEN_DB_DIR%\dbs\security5.fdb'; | "%FB_BIN_DIR%\isql" -q
|
2015-04-22 18:39:45 +02:00
|
|
|
@echo Apply security.sql...
|
2021-05-31 13:36:48 +02:00
|
|
|
@"%FB_BIN_DIR%\isql" -q %FB_GEN_DB_DIR%/dbs/security5.fdb -i %FB_ROOT_PATH%\src\dbs\security.sql
|
|
|
|
@copy %FB_GEN_DIR%\dbs\security5.fdb %FB_GEN_DIR%\dbs\security.fdb > nul
|
2006-05-27 20:06:09 +02:00
|
|
|
|
2022-08-08 02:14:52 +02:00
|
|
|
@echo Creating metadata.fdb...
|
|
|
|
@echo create database '%FB_GEN_DB_DIR%/dbs/metadata.fdb'; | "%FB_BIN_DIR%\isql" -q -sqldialect 1
|
|
|
|
@copy %FB_GEN_DIR%\dbs\metadata.fdb %FB_GEN_DIR%\dbs\yachts.lnk > nul
|
|
|
|
|
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
|