preprocess.bat 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. ::
  2. :: Preprocess all .epp files to .cpp
  3. :: ---------------------------------
  4. ::
  5. :: To do:
  6. ::
  7. :: o Better/Some documentation as to what this does
  8. :: o Add some logging/diagnostics, so we can see what is happening
  9. :: and track errors.
  10. :: o License boiler plate, copyright and authorship acknowledgements
  11. ::
  12. @echo off
  13. ::===========
  14. :MAIN
  15. @call setenvvar.bat
  16. @if not defined FB_BIN_DIR (@call set_build_target.bat %*)
  17. @if "%1"=="BOOT" (set BOOTBUILD=1) else (set BOOTBUILD=0)
  18. @echo.
  19. @if "%BOOTBUILD%"=="1" (call :BOOT_PROCESS) else (call :MASTER_PROCESS)
  20. @set BOOTBUILD=
  21. @set GPRE=
  22. @goto :END
  23. ::===========
  24. :PREPROCESS
  25. @echo Processing %1/%2.epp
  26. @echo Calling GPRE for %1/%2.epp
  27. @if "%3"=="" (call :GPRE_M %1 %2) else (call :GPRE_GDS %1 %2 %3 %4)
  28. @if not exist %FB_GEN_DIR%\%1\%2.cpp (
  29. @move %FB_GEN_DIR%\preprocessing.cpp %FB_GEN_DIR%\%1\%2.cpp
  30. ) else (
  31. @fc %FB_GEN_DIR%\preprocessing.cpp %FB_GEN_DIR%\%1\%2.cpp >nul
  32. @if errorlevel 1 @move %FB_GEN_DIR%\preprocessing.cpp %FB_GEN_DIR%\%1\%2.cpp
  33. )
  34. @echo.
  35. @goto :EOF
  36. ::===========
  37. :GPRE_M
  38. @%GPRE% -n -m %FB_ROOT_PATH%\src\%1\%2.epp %FB_GEN_DIR%\preprocessing.cpp -b %FB_GEN_DB_DIR%/dbs/
  39. @goto :EOF
  40. ::===========
  41. :GPRE_GDS
  42. @%GPRE% -n -ids %3 %4 %FB_ROOT_PATH%\src\%1\%2.epp %FB_GEN_DIR%\preprocessing.cpp -b %FB_GEN_DB_DIR%/dbs/
  43. goto :EOF
  44. ::===========
  45. :BOOT_PROCESS
  46. @echo.
  47. @set GPRE=%FB_BIN_DIR%\gpre_boot -lang_internal
  48. @for %%i in (backup, restore, OdsDetection) do @call :PREPROCESS burp %%i -ocxx -m
  49. @for %%i in (extract, isql, show) do @call :PREPROCESS isql %%i -ocxx
  50. @for %%i in (dba) do @call :PREPROCESS utilities/gstat %%i
  51. @set GPRE=%FB_BIN_DIR%\gpre_boot
  52. @for %%i in (alice_meta) do @call :PREPROCESS alice %%i
  53. @for %%i in (array, blob) do @call :PREPROCESS yvalve %%i
  54. @for %%i in (metd, DdlNodes, PackageNodes) do @call :PREPROCESS dsql %%i -gds_cxx
  55. @for %%i in (gpre_meta) do @call :PREPROCESS gpre/std %%i
  56. @for %%i in (dfw, dpm, dyn_util, fun, grant, ini, met, scl, Function) do @call :PREPROCESS jrd %%i -gds_cxx
  57. @for %%i in (stats) do @call :PREPROCESS utilities %%i
  58. @goto :EOF
  59. ::===========
  60. :MASTER_PROCESS
  61. @set GPRE=%FB_BIN_DIR%\gpre
  62. @for %%i in (alice_meta) do @call :PREPROCESS alice %%i
  63. @for %%i in (LegacyManagement) do @call :PREPROCESS auth/SecurityDatabase %%i
  64. @for %%i in (backup, restore, OdsDetection) do @call :PREPROCESS burp %%i -ocxx -m
  65. @for %%i in (array, blob) do @call :PREPROCESS yvalve %%i
  66. @for %%i in (metd) do @call :PREPROCESS dsql %%i -gds_cxx
  67. @for %%i in (DdlNodes, PackageNodes) do @call :PREPROCESS dsql %%i -gds_cxx
  68. @for %%i in (gpre_meta) do @call :PREPROCESS gpre/std %%i
  69. @for %%i in (dfw, dpm, dyn_util, fun, grant, ini, met, scl, Function) do @call :PREPROCESS jrd %%i -gds_cxx
  70. @for %%i in (codes) do @call :PREPROCESS misc %%i
  71. @for %%i in (build_file) do @call :PREPROCESS msgs %%i
  72. @for %%i in (help, meta, proc, show) do @call :PREPROCESS qli %%i
  73. @for %%i in (extract, isql, show) do @call :PREPROCESS isql %%i -ocxx
  74. @for %%i in (dba) do @call :PREPROCESS utilities/gstat %%i
  75. @for %%i in (stats) do @call :PREPROCESS utilities %%i
  76. @goto :EOF
  77. :END