preprocess.bat 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. for %%v in ( %* ) do (
  17. @if "%%v"=="BOOT" (set BOOTBUILD=1) else (set BOOTBUILD=0)
  18. )
  19. @echo.
  20. @if "%BOOTBUILD%"=="1" (call :BOOT_PROCESS) else (call :MASTER_PROCESS)
  21. @set BOOTBUILD=
  22. @set GPRE=
  23. @goto :END
  24. ::===========
  25. :PREPROCESS
  26. @echo Processing %1/%2.epp
  27. @echo Calling GPRE for %1/%2.epp
  28. @if "%3"=="" (call :GPRE_M %1 %2) else (call :GPRE_GDS %1 %2 %3 %4)
  29. @if not exist %FB_GEN_DIR%\%1\%2.cpp (
  30. @move %FB_GEN_DIR%\preprocessing.cpp %FB_GEN_DIR%\%1\%2.cpp
  31. ) else (
  32. @fc %FB_GEN_DIR%\preprocessing.cpp %FB_GEN_DIR%\%1\%2.cpp >nul
  33. @if errorlevel 1 @move %FB_GEN_DIR%\preprocessing.cpp %FB_GEN_DIR%\%1\%2.cpp
  34. )
  35. @echo.
  36. @goto :EOF
  37. ::===========
  38. :GPRE_M
  39. @%GPRE% -n -m %FB_ROOT_PATH%\src\%1\%2.epp %FB_GEN_DIR%\preprocessing.cpp -b %FB_GEN_DB_DIR%/dbs/
  40. @goto :EOF
  41. ::===========
  42. :GPRE_GDS
  43. @%GPRE% -n -ids %3 %4 %FB_ROOT_PATH%\src\%1\%2.epp %FB_GEN_DIR%\preprocessing.cpp -b %FB_GEN_DB_DIR%/dbs/
  44. goto :EOF
  45. ::===========
  46. :BOOT_PROCESS
  47. @echo.
  48. @set GPRE=%FB_BIN_DIR%\gpre_boot -lang_internal
  49. @for %%i in (backup, restore, OdsDetection) do @call :PREPROCESS burp %%i -ocxx -m
  50. @for %%i in (extract, isql, show) do @call :PREPROCESS isql %%i -ocxx
  51. @for %%i in (dba) do @call :PREPROCESS utilities/gstat %%i
  52. @set GPRE=%FB_BIN_DIR%\gpre_boot
  53. @for %%i in (alice_meta) do @call :PREPROCESS alice %%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, SystemTriggers) 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 (metd) do @call :PREPROCESS dsql %%i -gds_cxx
  66. @for %%i in (DdlNodes, PackageNodes) do @call :PREPROCESS dsql %%i -gds_cxx
  67. @for %%i in (gpre_meta) do @call :PREPROCESS gpre/std %%i
  68. @for %%i in (dfw, dpm, dyn_util, fun, grant, ini, met, scl, Function, SystemTriggers) do @call :PREPROCESS jrd %%i -gds_cxx
  69. @for %%i in (extract, isql, show) do @call :PREPROCESS isql %%i -ocxx
  70. @for %%i in (dba) do @call :PREPROCESS utilities/gstat %%i
  71. @for %%i in (stats) do @call :PREPROCESS utilities %%i
  72. @goto :EOF
  73. :END