2005-02-08 15:59:13 +01:00
|
|
|
::@echo off
|
|
|
|
|
2003-07-16 20:46:15 +02:00
|
|
|
|
|
|
|
:: Set env vars
|
|
|
|
@call setenvvar.bat
|
2005-02-08 15:59:13 +01:00
|
|
|
@if errorlevel 1 (goto :EOF)
|
2003-07-16 20:46:15 +02:00
|
|
|
|
|
|
|
:: verify that boot was run before
|
2007-09-06 15:25:04 +02:00
|
|
|
@if not exist %FB_GEN_DIR%\gpre_boot.exe (goto :HELP_BOOT & goto :EOF)
|
2003-07-16 20:46:15 +02:00
|
|
|
|
2007-02-26 16:18:41 +01:00
|
|
|
@call set_build_target.bat %*
|
2005-02-08 15:59:13 +01:00
|
|
|
|
|
|
|
::Uncomment this to build intlemp
|
|
|
|
::set FB2_INTLEMP=1
|
|
|
|
|
|
|
|
|
2003-07-16 20:46:15 +02:00
|
|
|
::===========
|
|
|
|
:MAIN
|
|
|
|
@call :BUILD_EMPBUILD
|
2006-11-19 15:24:09 +01:00
|
|
|
|
|
|
|
@echo.
|
2007-02-26 16:18:41 +01:00
|
|
|
@echo Building %FB_OBJ_DIR%
|
2006-11-19 15:24:09 +01:00
|
|
|
if "%VS_VER%"=="msvc6" (
|
2007-09-06 15:25:04 +02:00
|
|
|
@call compile.bat %FB_ROOT_PATH%\builds\win32\%VS_VER%\Firebird2 examples_%FB_TARGET_PLATFORM%.log empbuild intlbld
|
2006-11-19 15:24:09 +01:00
|
|
|
) else (
|
2007-09-06 15:25:04 +02:00
|
|
|
@call compile.bat %FB_ROOT_PATH%\builds\win32\%VS_VER%\Firebird2_Examples empbuild_%FB_TARGET_PLATFORM%.log empbuild
|
|
|
|
@if defined FB2_INTLEMP (
|
|
|
|
@call compile.bat %FB_ROOT_PATH%\builds\win32\%VS_VER%\Firebird2_Examples intlbuild_%FB_TARGET_PLATFORM%.log intlbuild
|
|
|
|
)
|
2006-11-19 15:24:09 +01:00
|
|
|
)
|
2007-03-15 16:21:28 +01:00
|
|
|
@echo.
|
2003-07-16 20:46:15 +02:00
|
|
|
@call :MOVE
|
|
|
|
@call :BUILD_EMPLOYEE
|
|
|
|
@call :MOVE2
|
2005-02-08 15:59:13 +01:00
|
|
|
@goto :EOF
|
2003-07-16 20:46:15 +02:00
|
|
|
|
|
|
|
::===========
|
|
|
|
:BUILD_EMPBUILD
|
|
|
|
@echo.
|
|
|
|
@echo Building empbuild.fdb
|
2007-09-06 15:25:04 +02:00
|
|
|
@copy /y %FB_OUTPUT_DIR%\bin\isql.exe %FB_GEN_DIR%\examples\ > nul
|
|
|
|
@copy /y %FB_OUTPUT_DIR%\bin\fbclient.dll %FB_GEN_DIR%\examples\ > nul
|
|
|
|
@copy /y %FB_ROOT_PATH%\examples\empbuild\*.sql %FB_GEN_DIR%\examples\ > nul
|
|
|
|
@copy /y %FB_ROOT_PATH%\examples\empbuild\*.inp %FB_GEN_DIR%\examples\ > nul
|
2003-07-16 20:46:15 +02:00
|
|
|
|
|
|
|
@echo.
|
|
|
|
:: Here we must use cd because isql does not have an option to set a base directory
|
2007-09-06 15:25:04 +02:00
|
|
|
@cd %FB_GEN_DIR%\examples
|
2005-07-12 14:36:12 +02:00
|
|
|
@echo Creating empbuild.fdb...
|
|
|
|
@echo.
|
2003-07-16 20:46:15 +02:00
|
|
|
@del empbuild.fdb 2> nul
|
2007-09-06 15:25:04 +02:00
|
|
|
@%FB_GEN_DIR%\examples\isql -i empbld.sql
|
2005-07-12 14:36:12 +02:00
|
|
|
|
|
|
|
|
|
|
|
if defined FB2_INTLEMP (
|
|
|
|
@echo Creating intlbuild.fdb...
|
|
|
|
@echo.
|
|
|
|
@del intlbuild.fdb 2> nul
|
2007-09-06 15:25:04 +02:00
|
|
|
@%FB_GEN_DIR%\examples\isql -i intlbld.sql
|
2005-07-12 14:36:12 +02:00
|
|
|
)
|
2003-07-16 20:46:15 +02:00
|
|
|
|
2007-02-26 16:18:41 +01:00
|
|
|
@cd %FB_ROOT_PATH%\builds\win32
|
2003-07-16 20:46:15 +02:00
|
|
|
@echo.
|
2007-09-06 15:25:04 +02:00
|
|
|
@echo path = %FB_GEN_DB_DIR%\examples
|
2005-07-12 14:36:12 +02:00
|
|
|
@echo Preprocessing empbuild.e...
|
|
|
|
@echo.
|
2007-09-06 15:25:04 +02:00
|
|
|
@%FB_GEN_DIR%\gpre_embed.exe -r -m -n -z %FB_ROOT_PATH%\examples\empbuild\empbuild.e %FB_GEN_DIR%\examples\empbuild.c -b %FB_GEN_DB_DIR%/examples/
|
2005-07-12 14:36:12 +02:00
|
|
|
|
|
|
|
if defined FB2_INTLEMP (
|
|
|
|
@echo Preprocessing intlbld.e...
|
|
|
|
@echo.
|
2007-09-06 15:25:04 +02:00
|
|
|
@%FB_GEN_DIR%\gpre_embed.exe -r -m -n -z %FB_ROOT_PATH%\examples\empbuild\intlbld.e %FB_GEN_DIR%\examples\intlbld.c -b %FB_GEN_DB_DIR%/examples/
|
2005-07-12 14:36:12 +02:00
|
|
|
)
|
|
|
|
|
2003-07-16 20:46:15 +02:00
|
|
|
@goto :EOF
|
|
|
|
|
|
|
|
|
|
|
|
::===========
|
|
|
|
:MOVE
|
|
|
|
@echo.
|
2007-02-26 16:18:41 +01:00
|
|
|
@rmdir /q /s %FB_OUTPUT_DIR%\examples 2>nul
|
|
|
|
@mkdir %FB_OUTPUT_DIR%\examples
|
|
|
|
@mkdir %FB_OUTPUT_DIR%\examples\api
|
|
|
|
@mkdir %FB_OUTPUT_DIR%\examples\build_unix
|
|
|
|
@mkdir %FB_OUTPUT_DIR%\examples\build_win32
|
|
|
|
@mkdir %FB_OUTPUT_DIR%\examples\dyn
|
|
|
|
@mkdir %FB_OUTPUT_DIR%\examples\empbuild
|
|
|
|
@mkdir %FB_OUTPUT_DIR%\examples\include
|
|
|
|
@mkdir %FB_OUTPUT_DIR%\examples\stat
|
|
|
|
@mkdir %FB_OUTPUT_DIR%\examples\udf
|
2003-07-16 20:46:15 +02:00
|
|
|
@echo Moving files to output directory
|
2007-02-26 16:18:41 +01:00
|
|
|
@copy %FB_ROOT_PATH%\examples\* %FB_OUTPUT_DIR%\examples > nul
|
|
|
|
@ren %FB_OUTPUT_DIR%\examples\readme readme.txt > nul
|
|
|
|
@copy %FB_ROOT_PATH%\examples\api\* %FB_OUTPUT_DIR%\examples\api > nul
|
|
|
|
@copy %FB_ROOT_PATH%\examples\build_unix\* %FB_OUTPUT_DIR%\examples\build_unix > nul
|
|
|
|
@copy %FB_ROOT_PATH%\examples\build_win32\* %FB_OUTPUT_DIR%\examples\build_win32 > nul
|
|
|
|
@copy %FB_ROOT_PATH%\examples\dyn\* %FB_OUTPUT_DIR%\examples\dyn > nul
|
|
|
|
:: @copy %FB_ROOT_PATH%\examples\empbuild\* %FB_OUTPUT_DIR%\examples\empbuild > nul
|
|
|
|
@copy %FB_ROOT_PATH%\examples\empbuild\employe2.sql %FB_OUTPUT_DIR%\examples\empbuild > nul
|
|
|
|
@copy %FB_ROOT_PATH%\examples\include\* %FB_OUTPUT_DIR%\examples\include > nul
|
|
|
|
@copy %FB_ROOT_PATH%\examples\stat\* %FB_OUTPUT_DIR%\examples\stat > nul
|
|
|
|
@copy %FB_ROOT_PATH%\examples\udf\* %FB_OUTPUT_DIR%\examples\udf > nul
|
|
|
|
@copy %FB_ROOT_PATH%\src\extlib\ib_udf* %FB_OUTPUT_DIR%\examples\udf > nul
|
|
|
|
@copy %FB_ROOT_PATH%\src\extlib\fbudf\* %FB_OUTPUT_DIR%\examples\udf > nul
|
|
|
|
|
2007-09-06 15:25:04 +02:00
|
|
|
::@copy %FB_GEN_DIR%\examples\empbuild.c %FB_OUTPUT_DIR%\examples\empbuild\ > nul
|
|
|
|
::@copy %FB_ROOT_PATH%\temp\%FB_OBJ_DIR%\examples\empbuild.exe %FB_GEN_DIR%\examples\empbuild.exe > nul
|
2007-03-15 16:21:28 +01:00
|
|
|
::if defined FB2_INTLEMP (
|
|
|
|
::if "%VS_VER%"=="msvc6" (
|
2007-09-06 15:25:04 +02:00
|
|
|
::@copy %FB_ROOT_PATH%\temp\%FB_OBJ_DIR%\examples\intlbld.exe %FB_GEN_DIR%\examples\intlbuild.exe > nul
|
2007-03-15 16:21:28 +01:00
|
|
|
::) else (
|
2007-09-06 15:25:04 +02:00
|
|
|
::@copy %FB_ROOT_PATH%\temp\%FB_OBJ_DIR%\examples\intlbuild.exe %FB_GEN_DIR%\examples\intlbuild.exe > nul
|
2007-03-15 16:21:28 +01:00
|
|
|
::)
|
|
|
|
::)
|
2003-07-16 20:46:15 +02:00
|
|
|
@goto :EOF
|
|
|
|
|
|
|
|
::===========
|
|
|
|
:: only to test if it works
|
|
|
|
:BUILD_EMPLOYEE
|
|
|
|
@echo.
|
|
|
|
@echo Building employee.fdb
|
|
|
|
:: Here we must use cd because isql does not have an option to set a base directory
|
|
|
|
:: and empbuild.exe uses isql
|
2007-09-06 15:25:04 +02:00
|
|
|
@cd %FB_GEN_DIR%\examples
|
|
|
|
@del %FB_GEN_DIR%\examples\employee.fdb 2>nul
|
|
|
|
@%FB_ROOT_PATH%\temp\%FB_OBJ_DIR%\empbuild\empbuild.exe %FB_GEN_DB_DIR%/examples/employee.fdb
|
2005-02-08 15:59:13 +01:00
|
|
|
|
2007-03-15 16:21:28 +01:00
|
|
|
@if defined FB2_INTLEMP (
|
2005-07-12 14:36:12 +02:00
|
|
|
@echo Building intlemp.fdb
|
2007-09-06 15:25:04 +02:00
|
|
|
@del %FB_GEN_DIR%\examples\intlemp.fdb 2>nul
|
2005-02-08 15:59:13 +01:00
|
|
|
@del isql.tmp 2>nul
|
2007-09-06 15:25:04 +02:00
|
|
|
@echo s;intlemp.fdb;%SERVER_NAME%:%FB_GEN_DIR%\examples\intlemp.fdb;g > isql.tmp
|
|
|
|
@%FB_GEN_DIR%\examples\intlbuild.exe %FB_GEN_DB_DIR%/examples/intlemp.fdb
|
2005-02-08 15:59:13 +01:00
|
|
|
)
|
|
|
|
|
2007-02-26 16:18:41 +01:00
|
|
|
@cd %FB_ROOT_PATH%\builds\win32
|
2003-07-16 20:46:15 +02:00
|
|
|
|
|
|
|
@goto :EOF
|
|
|
|
|
|
|
|
::==============
|
|
|
|
:MOVE2
|
2007-09-06 15:25:04 +02:00
|
|
|
@copy %FB_GEN_DIR%\examples\employee.fdb %FB_OUTPUT_DIR%\examples\empbuild\ > nul
|
2005-02-08 15:59:13 +01:00
|
|
|
|
|
|
|
if defined FB2_INTLEMP (
|
2007-09-06 15:25:04 +02:00
|
|
|
if exist %FB_GEN_DIR%\examples\intlemp.fdb (
|
|
|
|
@copy %FB_GEN_DIR%\examples\intlemp.fdb %FB_OUTPUT_DIR%\examples\empbuild\ > nul
|
2005-07-12 14:36:12 +02:00
|
|
|
)
|
2005-02-08 15:59:13 +01:00
|
|
|
)
|
2003-07-16 20:46:15 +02:00
|
|
|
|
|
|
|
@goto :EOF
|
|
|
|
|
|
|
|
::==============
|
|
|
|
:HELP_BOOT
|
|
|
|
@echo.
|
|
|
|
@echo You must run make_boot.bat before running this script
|
|
|
|
@echo.
|
|
|
|
@goto :EOF
|
|
|
|
|
2005-02-08 15:59:13 +01:00
|
|
|
:ERROR
|
|
|
|
::====
|
|
|
|
@echo.
|
|
|
|
@echo Error - %*
|
|
|
|
@echo.
|
|
|
|
cancel_script > nul 2>&1
|
|
|
|
::End of ERROR
|
|
|
|
::------------
|
|
|
|
@goto :EOF
|
|
|
|
|
|
|
|
|