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
|
2005-02-08 15:59:13 +01:00
|
|
|
@if not exist %ROOT_PATH%\gen\gpre_boot.exe (goto :HELP_BOOT & goto :EOF)
|
2003-07-16 20:46:15 +02:00
|
|
|
|
|
|
|
::===========
|
|
|
|
:: Read input values
|
|
|
|
@set DBG=
|
|
|
|
@set DBG_DIR=release
|
|
|
|
@set CLEAN=/build
|
|
|
|
@if "%1"=="DEBUG" ((set DBG=TRUE) && (set DBG_DIR=debug))
|
|
|
|
@if "%2"=="DEBUG" ((set DBG=TRUE) && (set DBG_DIR=debug))
|
|
|
|
@if "%1"=="CLEAN" (set CLEAN=/REBUILD)
|
|
|
|
@if "%2"=="CLEAN" (set CLEAN=/REBUILD)
|
|
|
|
|
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.
|
|
|
|
@echo Building %DBG_DIR%
|
|
|
|
if "%VS_VER%"=="msvc6" (
|
|
|
|
@compile.bat %ROOT_PATH%\builds\win32\%VS_VER%\Firebird2 examples.log empbuild intlbld
|
|
|
|
) else (
|
|
|
|
@compile.bat %ROOT_PATH%\builds\win32\%VS_VER%\Firebird2_Examples empbuild.log empbuild
|
|
|
|
if defined FB2_INTLEMP (
|
|
|
|
@compile.bat %ROOT_PATH%\builds\win32\%VS_VER%\Firebird2_Examples intlbuild.log intlbuild
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
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
|
2005-02-11 08:06:14 +01:00
|
|
|
@copy /y %ROOT_PATH%\output\bin\isql.exe %ROOT_PATH%\gen\examples\ > nul
|
2003-07-16 20:46:15 +02:00
|
|
|
@copy /y %ROOT_PATH%\examples\empbuild\*.sql %ROOT_PATH%\gen\examples\ > nul
|
|
|
|
@copy /y %ROOT_PATH%\examples\empbuild\*.inp %ROOT_PATH%\gen\examples\ > nul
|
|
|
|
|
|
|
|
@echo.
|
|
|
|
:: Here we must use cd because isql does not have an option to set a base directory
|
|
|
|
@cd %ROOT_PATH%\gen\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
|
|
|
|
@%ROOT_PATH%\gen\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
|
2003-07-16 20:46:15 +02:00
|
|
|
@%ROOT_PATH%\gen\examples\isql -i intlbld.sql
|
2005-07-12 14:36:12 +02:00
|
|
|
)
|
2003-07-16 20:46:15 +02:00
|
|
|
|
2005-07-12 14:36:12 +02:00
|
|
|
@cd %ROOT_PATH%\builds\win32
|
2003-07-16 20:46:15 +02:00
|
|
|
@echo.
|
|
|
|
@echo path = %DB_PATH%/gen/examples
|
2005-07-12 14:36:12 +02:00
|
|
|
@echo Preprocessing empbuild.e...
|
|
|
|
@echo.
|
2006-03-29 15:44:55 +02:00
|
|
|
@%ROOT_PATH%\gen\gpre_embed.exe -r -m -n -z %ROOT_PATH%\examples\empbuild\empbuild.e %ROOT_PATH%\gen\examples\empbuild.c -b %DB_PATH%/gen/examples/
|
2005-07-12 14:36:12 +02:00
|
|
|
|
|
|
|
if defined FB2_INTLEMP (
|
|
|
|
@echo Preprocessing intlbld.e...
|
|
|
|
@echo.
|
2006-03-29 15:44:55 +02:00
|
|
|
@%ROOT_PATH%\gen\gpre_embed.exe -r -m -n -z %ROOT_PATH%\examples\empbuild\intlbld.e %ROOT_PATH%\gen\examples\intlbld.c -b %DB_PATH%/gen/examples/
|
2005-07-12 14:36:12 +02:00
|
|
|
)
|
|
|
|
|
2003-07-16 20:46:15 +02:00
|
|
|
@goto :EOF
|
|
|
|
|
|
|
|
|
|
|
|
::===========
|
|
|
|
:MOVE
|
|
|
|
@echo.
|
|
|
|
@rmdir /q /s %ROOT_PATH%\output\examples 2>nul
|
|
|
|
@mkdir %ROOT_PATH%\output\examples
|
|
|
|
@mkdir %ROOT_PATH%\output\examples\api
|
|
|
|
@mkdir %ROOT_PATH%\output\examples\build_unix
|
|
|
|
@mkdir %ROOT_PATH%\output\examples\build_win32
|
|
|
|
@mkdir %ROOT_PATH%\output\examples\dyn
|
|
|
|
@mkdir %ROOT_PATH%\output\examples\empbuild
|
|
|
|
@mkdir %ROOT_PATH%\output\examples\include
|
|
|
|
@mkdir %ROOT_PATH%\output\examples\stat
|
|
|
|
@mkdir %ROOT_PATH%\output\examples\udf
|
|
|
|
@echo Moving files to output directory
|
|
|
|
@copy %ROOT_PATH%\examples\* %ROOT_PATH%\output\examples > nul
|
2005-03-01 15:53:46 +01:00
|
|
|
@ren %ROOT_PATH%\output\examples\readme readme.txt > nul
|
2003-07-16 20:46:15 +02:00
|
|
|
@copy %ROOT_PATH%\examples\api\* %ROOT_PATH%\output\examples\api > nul
|
|
|
|
@copy %ROOT_PATH%\examples\build_unix\* %ROOT_PATH%\output\examples\build_unix > nul
|
|
|
|
@copy %ROOT_PATH%\examples\build_win32\* %ROOT_PATH%\output\examples\build_win32 > nul
|
|
|
|
@copy %ROOT_PATH%\examples\dyn\* %ROOT_PATH%\output\examples\dyn > nul
|
|
|
|
:: @copy %ROOT_PATH%\examples\empbuild\* %ROOT_PATH%\output\examples\empbuild > nul
|
|
|
|
@copy %ROOT_PATH%\examples\empbuild\employe2.sql %ROOT_PATH%\output\examples\empbuild > nul
|
|
|
|
@copy %ROOT_PATH%\examples\include\* %ROOT_PATH%\output\examples\include > nul
|
|
|
|
@copy %ROOT_PATH%\examples\stat\* %ROOT_PATH%\output\examples\stat > nul
|
|
|
|
@copy %ROOT_PATH%\examples\udf\* %ROOT_PATH%\output\examples\udf > nul
|
|
|
|
@copy %ROOT_PATH%\src\extlib\ib_udf* %ROOT_PATH%\output\examples\udf > nul
|
|
|
|
@copy %ROOT_PATH%\src\extlib\fbudf\* %ROOT_PATH%\output\examples\udf > nul
|
|
|
|
|
|
|
|
:: @copy %ROOT_PATH%\gen\examples\empbuild.c %ROOT_PATH%\output\examples\empbuild\ > nul
|
|
|
|
@copy %ROOT_PATH%\temp\%DBG_DIR%\examples\empbuild.exe %ROOT_PATH%\gen\examples\empbuild.exe > nul
|
2005-02-08 15:59:13 +01:00
|
|
|
if defined FB2_INTLEMP (
|
|
|
|
if "%VS_VER%"=="msvc6" (
|
|
|
|
@copy %ROOT_PATH%\temp\%DBG_DIR%\examples\intlbld.exe %ROOT_PATH%\gen\examples\intlbuild.exe > nul
|
|
|
|
) else (
|
|
|
|
@copy %ROOT_PATH%\temp\%DBG_DIR%\examples\intlbuild.exe %ROOT_PATH%\gen\examples\intlbuild.exe > nul
|
|
|
|
)
|
|
|
|
)
|
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
|
|
|
|
@cd %ROOT_PATH%\gen\examples
|
|
|
|
@del %ROOT_PATH%\gen\examples\employee.fdb 2>nul
|
|
|
|
@%ROOT_PATH%\gen\examples\empbuild.exe %DB_PATH%/gen/examples/employee.fdb
|
2005-02-08 15:59:13 +01:00
|
|
|
|
|
|
|
if defined FB2_INTLEMP (
|
2005-07-12 14:36:12 +02:00
|
|
|
@echo Building intlemp.fdb
|
|
|
|
@del %ROOT_PATH%\gen\examples\intlemp.fdb 2>nul
|
2005-02-08 15:59:13 +01:00
|
|
|
@del isql.tmp 2>nul
|
|
|
|
@echo s;intlemp.fdb;%SERVER_NAME%:%ROOT_PATH%\gen\examples\intlemp.fdb;g > isql.tmp
|
|
|
|
@%ROOT_PATH%\gen\examples\intlbuild.exe %DB_PATH%/gen/examples/intlemp.fdb
|
|
|
|
)
|
|
|
|
|
2003-07-16 20:46:15 +02:00
|
|
|
@cd %ROOT_PATH%\builds\win32
|
|
|
|
|
|
|
|
@goto :EOF
|
|
|
|
|
|
|
|
::==============
|
|
|
|
:MOVE2
|
|
|
|
@copy %ROOT_PATH%\gen\examples\employee.fdb %ROOT_PATH%\output\examples\empbuild\ > nul
|
2005-02-08 15:59:13 +01:00
|
|
|
|
|
|
|
if defined FB2_INTLEMP (
|
2005-07-12 14:36:12 +02:00
|
|
|
if exist %ROOT_PATH%\gen\examples\intlemp.fdb (
|
2005-02-08 15:59:13 +01:00
|
|
|
@copy %ROOT_PATH%\gen\examples\intlemp.fdb %ROOT_PATH%\output\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
|
|
|
|
|
|
|
|
|