[246] | 1 | @ECHO OFF |
---|
| 2 | SETLOCAL |
---|
| 3 | |
---|
| 4 | REM # |
---|
| 5 | REM # File produced by the obuild tool version 1.0 |
---|
| 6 | REM # for the package snovis with version v1r1. |
---|
| 7 | REM # |
---|
| 8 | |
---|
| 9 | REM #//////////////////////////////////////////////// |
---|
| 10 | REM # Usage : |
---|
| 11 | REM # DOS> CD some_path\pack\version\obuild |
---|
| 12 | REM # DOS> DOS\build_G4LabUIOnX |
---|
| 13 | REM # |
---|
| 14 | REM #//////////////////////////////////////////////// |
---|
| 15 | |
---|
| 16 | REM #//////////////////////////////////////////////// |
---|
| 17 | REM #/// Get path of this file : |
---|
| 18 | REM #//////////////////////////////////////////////// |
---|
| 19 | SET obuild_snovis_path=%~dp0 |
---|
| 20 | REM # Remove ending \obuild\DOS\ |
---|
| 21 | SET obuild_snovis_path=%obuild_snovis_path:~0,-12% |
---|
| 22 | |
---|
| 23 | REM #//////////////////////////////////////////////// |
---|
| 24 | REM #/// Treat arguments : |
---|
| 25 | REM #//////////////////////////////////////////////// |
---|
| 26 | |
---|
| 27 | SET obuild_verbose=no |
---|
| 28 | SET obuild_debug=no |
---|
| 29 | SET obuild_optimize=yes |
---|
| 30 | SET obuild_set_x=no |
---|
| 31 | |
---|
| 32 | :next_arg |
---|
| 33 | IF "%1%" == "" GOTO end_args |
---|
| 34 | |
---|
| 35 | IF NOT "%1%" == "-v" GOTO end_if_v |
---|
| 36 | SET obuild_verbose=yes |
---|
| 37 | SHIFT |
---|
| 38 | GOTO next_arg |
---|
| 39 | :end_if_v |
---|
| 40 | |
---|
| 41 | IF NOT "%1%" == "-g" GOTO end_if_g |
---|
| 42 | SET obuild_debug=yes |
---|
| 43 | SHIFT |
---|
| 44 | GOTO next_arg |
---|
| 45 | :end_if_g |
---|
| 46 | |
---|
| 47 | IF NOT "%1%" == "-x" GOTO end_if_x |
---|
| 48 | SET obuild_set_x=yes |
---|
| 49 | SHIFT |
---|
| 50 | GOTO next_arg |
---|
| 51 | :end_if_x |
---|
| 52 | |
---|
| 53 | :end_args |
---|
| 54 | |
---|
| 55 | REM #//////////////////////////////////////////////// |
---|
| 56 | REM #/// End arguments. |
---|
| 57 | REM #//////////////////////////////////////////////// |
---|
| 58 | |
---|
| 59 | IF %obuild_set_x% == yes ECHO ON |
---|
| 60 | |
---|
| 61 | IF %obuild_debug% == yes SET obuild_optimize=no |
---|
| 62 | |
---|
| 63 | IF "%OBUILD_PLATFORM%" == "" ( |
---|
| 64 | IF "%OS%" == "" ECHO Environment variable OS not found. & GOTO obuild_return |
---|
| 65 | SET obuild_platform=%OS% |
---|
| 66 | ) ELSE ( |
---|
| 67 | SET obuild_platform=%OBUILD_PLATFORM% |
---|
| 68 | ) |
---|
| 69 | |
---|
| 70 | IF "%obuild_platform%" == "" ( |
---|
| 71 | ECHO obuild_platform variable not defined. |
---|
| 72 | GOTO obuild_return |
---|
| 73 | ) |
---|
| 74 | |
---|
| 75 | IF "%OBUILD_DIR_BIN%" == "" ( |
---|
[276] | 76 | SET obuild_dir_bin=bin_obuild |
---|
[246] | 77 | ) ELSE ( |
---|
| 78 | SET obuild_dir_bin=%OBUILD_DIR_BIN% |
---|
| 79 | ) |
---|
| 80 | |
---|
| 81 | IF "%obuild_dir_bin%" == "" ( |
---|
| 82 | ECHO obuild_dir_bin variable not defined. |
---|
| 83 | GOTO obuild_return |
---|
| 84 | ) |
---|
| 85 | |
---|
| 86 | IF NOT EXIST "%obuild_snovis_path%\%obuild_dir_bin%" MKDIR "%obuild_snovis_path%\%obuild_dir_bin%" |
---|
| 87 | |
---|
| 88 | IF NOT EXIST "%obuild_snovis_path%\%obuild_dir_bin%" MKDIR "%obuild_snovis_path%\%obuild_dir_bin%" |
---|
| 89 | IF NOT EXIST "%obuild_snovis_path%\%obuild_dir_bin%\obuild_platform.exe" ( |
---|
| 90 | cl.exe /nologo /DWIN32 /MD /O2 /W3 /GX /GR /Fe"%obuild_snovis_path%\%obuild_dir_bin%\obuild_platform.exe" "%obuild_snovis_path%\obuild\cpp\obuild_platform.cpp" 1> NUL |
---|
| 91 | IF EXIST obuild_platform.obj DEL obuild_platform.obj |
---|
| 92 | ) |
---|
| 93 | |
---|
| 94 | FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d |
---|
| 95 | cd "%obuild_snovis_path%\%obuild_dir_bin%" |
---|
| 96 | IF NOT EXIST .\obuild_platform.exe ECHO Program obuild_platform.exe not found. && GOTO obuild_return |
---|
| 97 | FOR /F "usebackq" %%j IN (`.\obuild_platform.exe %obuild_platform% Windows_NT`) DO SET obuild_platform_result=%%j |
---|
| 98 | cd "%obuild_pwd_snovis_0%" |
---|
| 99 | SET obuild_pwd_snovis_0= |
---|
[276] | 100 | IF NOT %obuild_platform_result% == yes GOTO end_if_platform_0 |
---|
[246] | 101 | SET obuild_cxx_command=cl.exe |
---|
[276] | 102 | :end_if_platform_0 |
---|
[246] | 103 | SET obuild_platform_result= |
---|
| 104 | IF "%obuild_cxx_command%" == "" ECHO Variable obuild_cxx_command not defined. && GOTO obuild_return |
---|
| 105 | |
---|
| 106 | FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d |
---|
| 107 | cd "%obuild_snovis_path%\%obuild_dir_bin%" |
---|
| 108 | IF NOT EXIST .\obuild_platform.exe ECHO Program obuild_platform.exe not found. && GOTO obuild_return |
---|
| 109 | FOR /F "usebackq" %%j IN (`.\obuild_platform.exe %obuild_platform% Windows_NT`) DO SET obuild_platform_result=%%j |
---|
| 110 | cd "%obuild_pwd_snovis_0%" |
---|
| 111 | SET obuild_pwd_snovis_0= |
---|
[276] | 112 | IF NOT %obuild_platform_result% == yes GOTO end_if_platform_1 |
---|
[246] | 113 | SET obuild_cxx_optimize=/O2 |
---|
[276] | 114 | :end_if_platform_1 |
---|
[246] | 115 | SET obuild_platform_result= |
---|
| 116 | |
---|
| 117 | FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d |
---|
| 118 | cd "%obuild_snovis_path%\%obuild_dir_bin%" |
---|
| 119 | IF NOT EXIST .\obuild_platform.exe ECHO Program obuild_platform.exe not found. && GOTO obuild_return |
---|
| 120 | FOR /F "usebackq" %%j IN (`.\obuild_platform.exe %obuild_platform% Windows_NT`) DO SET obuild_platform_result=%%j |
---|
| 121 | cd "%obuild_pwd_snovis_0%" |
---|
| 122 | SET obuild_pwd_snovis_0= |
---|
[276] | 123 | IF NOT %obuild_platform_result% == yes GOTO end_if_platform_2 |
---|
[246] | 124 | SET obuild_cxx_debug=/ZI /Od |
---|
[276] | 125 | :end_if_platform_2 |
---|
[246] | 126 | SET obuild_platform_result= |
---|
| 127 | |
---|
| 128 | FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d |
---|
| 129 | cd "%obuild_snovis_path%\%obuild_dir_bin%" |
---|
| 130 | IF NOT EXIST .\obuild_platform.exe ECHO Program obuild_platform.exe not found. && GOTO obuild_return |
---|
| 131 | FOR /F "usebackq" %%j IN (`.\obuild_platform.exe %obuild_platform% Windows_NT`) DO SET obuild_platform_result=%%j |
---|
| 132 | cd "%obuild_pwd_snovis_0%" |
---|
| 133 | SET obuild_pwd_snovis_0= |
---|
[276] | 134 | IF NOT %obuild_platform_result% == yes GOTO end_if_platform_3 |
---|
[246] | 135 | SET obuild_cxx_options=/nologo /DWIN32 /MD /GX /GR /W3 |
---|
[276] | 136 | :end_if_platform_3 |
---|
[246] | 137 | SET obuild_platform_result= |
---|
| 138 | |
---|
[276] | 139 | IF NOT %obuild_debug% == yes GOTO else_if_db_build_lib_G4LabUIOnX_sh_4 |
---|
[246] | 140 | SET obuild_cxx_debug_local=%obuild_cxx_debug% |
---|
[276] | 141 | GOTO end_if_db_build_lib_G4LabUIOnX_sh_4 |
---|
| 142 | :else_if_db_build_lib_G4LabUIOnX_sh_4 |
---|
[246] | 143 | SET obuild_cxx_debug_local= |
---|
[276] | 144 | :end_if_db_build_lib_G4LabUIOnX_sh_4 |
---|
[246] | 145 | |
---|
[276] | 146 | IF NOT %obuild_optimize% == yes GOTO else_if_opt_build_lib_G4LabUIOnX_sh_5 |
---|
[246] | 147 | SET obuild_cxx_optimize_local=%obuild_cxx_optimize% |
---|
[276] | 148 | GOTO end_if_opt_build_lib_G4LabUIOnX_sh_5 |
---|
| 149 | :else_if_opt_build_lib_G4LabUIOnX_sh_5 |
---|
[246] | 150 | SET obuild_cxx_optimize_local= |
---|
[276] | 151 | :end_if_opt_build_lib_G4LabUIOnX_sh_5 |
---|
[246] | 152 | |
---|
| 153 | |
---|
| 154 | |
---|
| 155 | SET obuild_cxx_includes=/I"%obuild_snovis_path%\source" |
---|
| 156 | |
---|
| 157 | IF EXIST "%obuild_snovis_path%\%obuild_dir_bin%\lib_G4LabUIOnX" RMDIR /S /Q "%obuild_snovis_path%\%obuild_dir_bin%\lib_G4LabUIOnX" |
---|
| 158 | IF NOT EXIST "%obuild_snovis_path%\%obuild_dir_bin%\lib_G4LabUIOnX" MKDIR "%obuild_snovis_path%\%obuild_dir_bin%\lib_G4LabUIOnX" |
---|
| 159 | |
---|
| 160 | @IF %obuild_verbose% == yes @ECHO ON |
---|
| 161 | cd "%obuild_snovis_path%\%obuild_dir_bin%" |
---|
| 162 | %obuild_cxx_command% /c %obuild_cxx_debug_local% %obuild_cxx_optimize_local% %obuild_cxx_options% %obuild_cxx_macros% %obuild_cxx_includes% /Fo.\lib_G4LabUIOnX\UIOnX.obj /Tp"..\source\G4Lab\cxx\UIOnX.cxx" 1> cl_exe_error |
---|
| 163 | @IF ERRORLEVEL 1 @TYPE cl_exe_error && @GOTO obuild_return |
---|
| 164 | @IF NOT ERRORLEVEL 1 @DEL cl_exe_error |
---|
| 165 | cd "%obuild_snovis_path%\obuild" |
---|
| 166 | |
---|
| 167 | @IF %obuild_verbose% == yes @ECHO OFF |
---|
| 168 | |
---|
| 169 | FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d |
---|
| 170 | cd "%obuild_snovis_path%\%obuild_dir_bin%" |
---|
| 171 | IF NOT EXIST .\obuild_platform.exe ECHO Program obuild_platform.exe not found. && GOTO obuild_return |
---|
| 172 | FOR /F "usebackq" %%j IN (`.\obuild_platform.exe %obuild_platform% Windows_NT`) DO SET obuild_platform_result=%%j |
---|
| 173 | cd "%obuild_pwd_snovis_0%" |
---|
| 174 | SET obuild_pwd_snovis_0= |
---|
[276] | 175 | IF NOT %obuild_platform_result% == yes GOTO end_if_platform_8 |
---|
[246] | 176 | SET obuild_cxx_linker_command=link.exe |
---|
[276] | 177 | :end_if_platform_8 |
---|
[246] | 178 | SET obuild_platform_result= |
---|
| 179 | IF "%obuild_cxx_linker_command%" == "" ECHO Variable obuild_cxx_linker_command not defined. && GOTO obuild_return |
---|
| 180 | |
---|
| 181 | FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d |
---|
| 182 | cd "%obuild_snovis_path%\%obuild_dir_bin%" |
---|
| 183 | IF NOT EXIST .\obuild_platform.exe ECHO Program obuild_platform.exe not found. && GOTO obuild_return |
---|
| 184 | FOR /F "usebackq" %%j IN (`.\obuild_platform.exe %obuild_platform% Windows_NT`) DO SET obuild_platform_result=%%j |
---|
| 185 | cd "%obuild_pwd_snovis_0%" |
---|
| 186 | SET obuild_pwd_snovis_0= |
---|
[276] | 187 | IF NOT %obuild_platform_result% == yes GOTO end_if_platform_9 |
---|
[246] | 188 | SET obuild_cxx_linker_debug=/DEBUG |
---|
[276] | 189 | :end_if_platform_9 |
---|
[246] | 190 | SET obuild_platform_result= |
---|
| 191 | |
---|
| 192 | FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d |
---|
| 193 | cd "%obuild_snovis_path%\%obuild_dir_bin%" |
---|
| 194 | IF NOT EXIST .\obuild_platform.exe ECHO Program obuild_platform.exe not found. && GOTO obuild_return |
---|
| 195 | FOR /F "usebackq" %%j IN (`.\obuild_platform.exe %obuild_platform% Windows_NT`) DO SET obuild_platform_result=%%j |
---|
| 196 | cd "%obuild_pwd_snovis_0%" |
---|
| 197 | SET obuild_pwd_snovis_0= |
---|
[276] | 198 | IF NOT %obuild_platform_result% == yes GOTO end_if_platform_10 |
---|
[246] | 199 | SET obuild_cxx_linker_options=/nologo |
---|
[276] | 200 | :end_if_platform_10 |
---|
[246] | 201 | SET obuild_platform_result= |
---|
| 202 | |
---|
[276] | 203 | IF NOT %obuild_debug% == yes GOTO else_if_db_build_lib_G4LabUIOnX_sh_11 |
---|
[246] | 204 | SET obuild_cxx_linker_debug_local=%obuild_cxx_linker_debug% |
---|
[276] | 205 | GOTO end_if_db_build_lib_G4LabUIOnX_sh_11 |
---|
| 206 | :else_if_db_build_lib_G4LabUIOnX_sh_11 |
---|
[246] | 207 | SET obuild_cxx_linker_debug_local= |
---|
[276] | 208 | :end_if_db_build_lib_G4LabUIOnX_sh_11 |
---|
[246] | 209 | |
---|
[276] | 210 | IF NOT %obuild_optimize% == yes GOTO else_if_opt_build_lib_G4LabUIOnX_sh_12 |
---|
[246] | 211 | SET obuild_cxx_linker_optimize_local=%obuild_cxx_linker_optimize% |
---|
[276] | 212 | GOTO end_if_opt_build_lib_G4LabUIOnX_sh_12 |
---|
| 213 | :else_if_opt_build_lib_G4LabUIOnX_sh_12 |
---|
[246] | 214 | SET obuild_cxx_linker_optimize_local= |
---|
[276] | 215 | :end_if_opt_build_lib_G4LabUIOnX_sh_12 |
---|
[246] | 216 | |
---|
| 217 | FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d |
---|
| 218 | cd "%obuild_snovis_path%\%obuild_dir_bin%" |
---|
| 219 | IF EXIST .\lib_G4LabUIOnX\tmp_objs DEL .\lib_G4LabUIOnX\tmp_objs |
---|
| 220 | FOR %%f IN (.\lib_G4LabUIOnX\*.obj) DO ECHO %%f >> .\lib_G4LabUIOnX\tmp_objs |
---|
| 221 | |
---|
| 222 | REM # Create the archive library G4LabUIOnX : |
---|
| 223 | @IF %obuild_verbose% == yes @ECHO ON |
---|
| 224 | lib.exe /nologo /machine:ix86 /out:.\lib_G4LabUIOnX\G4LabUIOnX.arc @.\lib_G4LabUIOnX\tmp_objs |
---|
| 225 | @IF ERRORLEVEL 1 @GOTO obuild_return |
---|
| 226 | @IF %obuild_verbose% == yes @ECHO OFF |
---|
| 227 | |
---|
| 228 | REM # Build the obuild_windef.exe utility program : |
---|
| 229 | cl.exe /nologo /DWIN32 /MD /O2 /W3 /Feobuild_windef.exe "%obuild_snovis_path%\obuild\cpp\obuild_windef.c" 1> NUL |
---|
| 230 | IF EXIST obuild_windef.obj DEL obuild_windef.obj |
---|
| 231 | |
---|
| 232 | REM # Building the .def file : |
---|
| 233 | @IF %obuild_verbose% == yes @ECHO ON |
---|
| 234 | dumpbin.exe /symbols /out:.\lib_G4LabUIOnX\tmp .\lib_G4LabUIOnX\G4LabUIOnX.arc 1> dumpbin_exe_error .\lib_G4LabUIOnX\G4LabUIOnX.arc |
---|
| 235 | @IF ERRORLEVEL 1 @TYPE dumpbin_exe_error && @GOTO obuild_return |
---|
| 236 | @IF NOT ERRORLEVEL 1 @DEL dumpbin_exe_error |
---|
| 237 | @IF %obuild_verbose% == yes @ECHO OFF |
---|
| 238 | .\obuild_windef.exe G4LabUIOnX < .\lib_G4LabUIOnX\tmp > .\lib_G4LabUIOnX\G4LabUIOnX.def |
---|
| 239 | REM # Building the linking library : |
---|
| 240 | REM # It produces a .exp file. |
---|
| 241 | @IF %obuild_verbose% == yes @ECHO ON |
---|
| 242 | lib.exe /nologo /machine:ix86 /out:.\G4LabUIOnX.lib /def:.\lib_G4LabUIOnX\G4LabUIOnX.def 1> lib_exe_error |
---|
| 243 | @IF ERRORLEVEL 1 @TYPE lib_exe_error && @GOTO obuild_return |
---|
| 244 | @IF NOT ERRORLEVEL 1 @DEL lib_exe_error |
---|
| 245 | @IF %obuild_verbose% == yes @ECHO OFF |
---|
| 246 | |
---|
| 247 | REM # Building the DLL : |
---|
| 248 | IF EXIST .\G4LabUIOnX.dll DEL .\G4LabUIOnX.dll |
---|
| 249 | @IF %obuild_verbose% == yes @ECHO ON |
---|
| 250 | link.exe /nologo /dll /out:.\G4LabUIOnX.dll .\G4LabUIOnX.exp .\lib_G4LabUIOnX\G4LabUIOnX.arc %obuild_linked_libraries% |
---|
| 251 | @IF %obuild_verbose% == yes @ECHO OFF |
---|
| 252 | |
---|
| 253 | cd "%obuild_pwd_snovis_0%" |
---|
| 254 | SET obuild_pwd_snovis_0= |
---|
| 255 | REM # Some cleanup : |
---|
| 256 | IF EXIST "%obuild_snovis_path%\%obuild_dir_bin%\lib_G4LabUIOnX\tmp_objs" DEL "%obuild_snovis_path%\%obuild_dir_bin%\lib_G4LabUIOnX\tmp_objs" |
---|
| 257 | IF EXIST "%obuild_snovis_path%\%obuild_dir_bin%\G4LabUIOnX.exp" DEL "%obuild_snovis_path%\%obuild_dir_bin%\G4LabUIOnX.exp" |
---|
| 258 | |
---|
| 259 | :obuild_return |
---|
| 260 | ENDLOCAL |
---|
| 261 | @ECHO ON |
---|