source: build/snova/trunk/obuild/DOS/build_lib_sngeom.bat

Last change on this file was 275, checked in by barrand, 17 years ago
  • Property svn:executable set to *
File size: 14.1 KB
Line 
1@ECHO OFF
2SETLOCAL
3
4REM #
5REM # File produced by the obuild tool version 1.0
6REM # for the package snova with version v2r0p0.
7REM #
8
9REM #////////////////////////////////////////////////
10REM # Usage :
11REM #   DOS> CD some_path\pack\version\obuild
12REM #   DOS> DOS\build_sngeom
13REM #
14REM #////////////////////////////////////////////////
15
16REM #////////////////////////////////////////////////
17REM #/// Get path of this file :
18REM #////////////////////////////////////////////////
19SET obuild_snova_path=%~dp0
20REM # Remove ending \obuild\DOS\
21SET obuild_snova_path=%obuild_snova_path:~0,-12%
22
23REM #////////////////////////////////////////////////
24REM #/// Treat arguments :
25REM #////////////////////////////////////////////////
26
27SET obuild_verbose=no
28SET obuild_debug=no
29SET obuild_optimize=yes
30SET obuild_set_x=no
31
32:next_arg
33IF "%1%" == "" GOTO end_args
34
35IF NOT "%1%" == "-v" GOTO end_if_v
36  SET obuild_verbose=yes
37  SHIFT
38  GOTO next_arg
39:end_if_v
40
41IF NOT "%1%" == "-g" GOTO end_if_g
42  SET obuild_debug=yes
43  SHIFT
44  GOTO next_arg
45:end_if_g
46
47IF 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
55REM #////////////////////////////////////////////////
56REM #/// End arguments.
57REM #////////////////////////////////////////////////
58
59IF %obuild_set_x% == yes ECHO ON
60
61IF %obuild_debug% == yes SET obuild_optimize=no
62
63IF "%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
70IF "%obuild_platform%" == "" (
71  ECHO obuild_platform variable not defined.
72  GOTO obuild_return
73)
74
75IF "%OBUILD_DIR_BIN%" == "" (
76  SET obuild_dir_bin=bin_obuild
77) ELSE (
78  SET obuild_dir_bin=%OBUILD_DIR_BIN%
79)
80
81IF "%obuild_dir_bin%" == "" (
82  ECHO obuild_dir_bin variable not defined.
83  GOTO obuild_return
84)
85
86IF NOT EXIST "%obuild_snova_path%\%obuild_dir_bin%" MKDIR "%obuild_snova_path%\%obuild_dir_bin%"
87
88IF NOT EXIST "%obuild_snova_path%\%obuild_dir_bin%" MKDIR "%obuild_snova_path%\%obuild_dir_bin%"
89IF NOT EXIST "%obuild_snova_path%\%obuild_dir_bin%\obuild_platform.exe" (
90  cl.exe /nologo /DWIN32 /MD /O2 /W3  /GX /GR /Fe"%obuild_snova_path%\%obuild_dir_bin%\obuild_platform.exe" "%obuild_snova_path%\obuild\cpp\obuild_platform.cpp" 1> NUL
91  IF EXIST obuild_platform.obj DEL obuild_platform.obj
92)
93
94FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snova_0=%%d
95cd "%obuild_snova_path%\%obuild_dir_bin%"
96IF NOT EXIST .\obuild_platform.exe  ECHO Program obuild_platform.exe not found.  && GOTO obuild_return
97FOR /F "usebackq" %%j IN (`.\obuild_platform.exe  %obuild_platform% Windows_NT`) DO SET obuild_platform_result=%%j
98cd "%obuild_pwd_snova_0%"
99SET obuild_pwd_snova_0=
100IF NOT %obuild_platform_result% == yes GOTO end_if_platform_0
101SET obuild_cxx_command=cl.exe
102:end_if_platform_0
103SET obuild_platform_result=
104IF "%obuild_cxx_command%" == ""  ECHO Variable obuild_cxx_command not defined.  && GOTO obuild_return
105
106FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snova_0=%%d
107cd "%obuild_snova_path%\%obuild_dir_bin%"
108IF NOT EXIST .\obuild_platform.exe  ECHO Program obuild_platform.exe not found.  && GOTO obuild_return
109FOR /F "usebackq" %%j IN (`.\obuild_platform.exe  %obuild_platform% Windows_NT`) DO SET obuild_platform_result=%%j
110cd "%obuild_pwd_snova_0%"
111SET obuild_pwd_snova_0=
112IF NOT %obuild_platform_result% == yes GOTO end_if_platform_1
113SET obuild_cxx_optimize=/O2
114:end_if_platform_1
115SET obuild_platform_result=
116
117FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snova_0=%%d
118cd "%obuild_snova_path%\%obuild_dir_bin%"
119IF NOT EXIST .\obuild_platform.exe  ECHO Program obuild_platform.exe not found.  && GOTO obuild_return
120FOR /F "usebackq" %%j IN (`.\obuild_platform.exe  %obuild_platform% Windows_NT`) DO SET obuild_platform_result=%%j
121cd "%obuild_pwd_snova_0%"
122SET obuild_pwd_snova_0=
123IF NOT %obuild_platform_result% == yes GOTO end_if_platform_2
124SET obuild_cxx_debug=/ZI /Od
125:end_if_platform_2
126SET obuild_platform_result=
127
128FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snova_0=%%d
129cd "%obuild_snova_path%\%obuild_dir_bin%"
130IF NOT EXIST .\obuild_platform.exe  ECHO Program obuild_platform.exe not found.  && GOTO obuild_return
131FOR /F "usebackq" %%j IN (`.\obuild_platform.exe  %obuild_platform% Windows_NT`) DO SET obuild_platform_result=%%j
132cd "%obuild_pwd_snova_0%"
133SET obuild_pwd_snova_0=
134IF NOT %obuild_platform_result% == yes GOTO end_if_platform_3
135SET obuild_cxx_options=/nologo /DWIN32 /MD /GX /GR /W3
136:end_if_platform_3
137SET obuild_platform_result=
138
139IF NOT %obuild_debug% == yes GOTO else_if_db_build_lib_sngeom_sh_4
140  SET obuild_cxx_debug_local=%obuild_cxx_debug%
141  GOTO end_if_db_build_lib_sngeom_sh_4
142:else_if_db_build_lib_sngeom_sh_4
143  SET obuild_cxx_debug_local=
144:end_if_db_build_lib_sngeom_sh_4
145
146IF NOT %obuild_optimize% == yes GOTO else_if_opt_build_lib_sngeom_sh_5
147  SET obuild_cxx_optimize_local=%obuild_cxx_optimize%
148  GOTO end_if_opt_build_lib_sngeom_sh_5
149:else_if_opt_build_lib_sngeom_sh_5
150  SET obuild_cxx_optimize_local=
151:end_if_opt_build_lib_sngeom_sh_5
152
153
154IF NOT EXIST "%obuild_snova_path%\%obuild_dir_bin%" MKDIR "%obuild_snova_path%\%obuild_dir_bin%"
155IF NOT EXIST "%obuild_snova_path%\%obuild_dir_bin%\obuild_find.exe" (
156  cl.exe /nologo /DWIN32 /MD /O2 /W3 /GX /GR /Fe"%obuild_snova_path%\%obuild_dir_bin%\obuild_find.exe" "%obuild_snova_path%\obuild\cpp\obuild_find.cpp" 1> NUL
157  IF EXIST obuild_find.obj DEL obuild_find.obj
158)
159FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snova_0=%%d
160cd "%obuild_snova_path%\%obuild_dir_bin%"
161IF NOT EXIST obuild_find.exe  ECHO Program obuild_find.exe not found.  && GOTO obuild_return
162FOR /F "usebackq delims=;" %%j IN (`.\obuild_find.exe  bhep v1r4p2`) DO SET obuild_bhep_path=%%j
163cd "%obuild_pwd_snova_0%"
164SET obuild_pwd_snova_0=
165IF NOT DEFINED obuild_bhep_path  ECHO Can't find bhep package.  && GOTO obuild_return
166
167SET obuild_cxx_includes=/I"%obuild_snova_path%\source\SNgeom2\include"
168SET obuild_cxx_includes=%obuild_cxx_includes% /I"%obuild_snova_path%\source\GeomUtils\include"
169SET obuild_cxx_includes=%obuild_cxx_includes% /I"%obuild_bhep_path%"
170
171IF EXIST "%obuild_snova_path%\%obuild_dir_bin%\lib_sngeom" RMDIR /S /Q "%obuild_snova_path%\%obuild_dir_bin%\lib_sngeom"
172IF NOT EXIST "%obuild_snova_path%\%obuild_dir_bin%\lib_sngeom" MKDIR "%obuild_snova_path%\%obuild_dir_bin%\lib_sngeom"
173
174@IF %obuild_verbose% == yes @ECHO ON
175cd "%obuild_snova_path%\%obuild_dir_bin%"
176%obuild_cxx_command% /c %obuild_cxx_debug_local% %obuild_cxx_optimize_local% %obuild_cxx_options% %obuild_cxx_macros% %obuild_cxx_includes% /Fo.\lib_sngeom\CALO_block_data.obj  /Tp"..\source\SNgeom2\src\CALO_block_data.cc" 1> cl_exe_error
177@IF ERRORLEVEL 1 @TYPE cl_exe_error && @GOTO obuild_return
178@IF NOT ERRORLEVEL 1 @DEL cl_exe_error
179cd "%obuild_snova_path%\obuild"
180
181cd "%obuild_snova_path%\%obuild_dir_bin%"
182%obuild_cxx_command% /c %obuild_cxx_debug_local% %obuild_cxx_optimize_local% %obuild_cxx_options% %obuild_cxx_macros% %obuild_cxx_includes% /Fo.\lib_sngeom\CALO_geom_data.obj  /Tp"..\source\SNgeom2\src\CALO_geom_data.cc" 1> cl_exe_error
183@IF ERRORLEVEL 1 @TYPE cl_exe_error && @GOTO obuild_return
184@IF NOT ERRORLEVEL 1 @DEL cl_exe_error
185cd "%obuild_snova_path%\obuild"
186
187cd "%obuild_snova_path%\%obuild_dir_bin%"
188%obuild_cxx_command% /c %obuild_cxx_debug_local% %obuild_cxx_optimize_local% %obuild_cxx_options% %obuild_cxx_macros% %obuild_cxx_includes% /Fo.\lib_sngeom\TC_geom_data.obj  /Tp"..\source\SNgeom2\src\TC_geom_data.cc" 1> cl_exe_error
189@IF ERRORLEVEL 1 @TYPE cl_exe_error && @GOTO obuild_return
190@IF NOT ERRORLEVEL 1 @DEL cl_exe_error
191cd "%obuild_snova_path%\obuild"
192
193cd "%obuild_snova_path%\%obuild_dir_bin%"
194%obuild_cxx_command% /c %obuild_cxx_debug_local% %obuild_cxx_optimize_local% %obuild_cxx_options% %obuild_cxx_macros% %obuild_cxx_includes% /Fo.\lib_sngeom\TC_layer_geom_data.obj  /Tp"..\source\SNgeom2\src\TC_layer_geom_data.cc" 1> cl_exe_error
195@IF ERRORLEVEL 1 @TYPE cl_exe_error && @GOTO obuild_return
196@IF NOT ERRORLEVEL 1 @DEL cl_exe_error
197cd "%obuild_snova_path%\obuild"
198
199cd "%obuild_snova_path%\%obuild_dir_bin%"
200%obuild_cxx_command% /c %obuild_cxx_debug_local% %obuild_cxx_optimize_local% %obuild_cxx_options% %obuild_cxx_macros% %obuild_cxx_includes% /Fo.\lib_sngeom\TC_layout_nblocks.obj  /Tp"..\source\SNgeom2\src\TC_layout_nblocks.cc" 1> cl_exe_error
201@IF ERRORLEVEL 1 @TYPE cl_exe_error && @GOTO obuild_return
202@IF NOT ERRORLEVEL 1 @DEL cl_exe_error
203cd "%obuild_snova_path%\obuild"
204
205cd "%obuild_snova_path%\%obuild_dir_bin%"
206%obuild_cxx_command% /c %obuild_cxx_debug_local% %obuild_cxx_optimize_local% %obuild_cxx_options% %obuild_cxx_macros% %obuild_cxx_includes% /Fo.\lib_sngeom\cell_geom_data.obj  /Tp"..\source\SNgeom2\src\cell_geom_data.cc" 1> cl_exe_error
207@IF ERRORLEVEL 1 @TYPE cl_exe_error && @GOTO obuild_return
208@IF NOT ERRORLEVEL 1 @DEL cl_exe_error
209cd "%obuild_snova_path%\obuild"
210
211cd "%obuild_snova_path%\%obuild_dir_bin%"
212%obuild_cxx_command% /c %obuild_cxx_debug_local% %obuild_cxx_optimize_local% %obuild_cxx_options% %obuild_cxx_macros% %obuild_cxx_includes% /Fo.\lib_sngeom\geom_mgr.obj  /Tp"..\source\SNgeom2\src\geom_mgr.cc" 1> cl_exe_error
213@IF ERRORLEVEL 1 @TYPE cl_exe_error && @GOTO obuild_return
214@IF NOT ERRORLEVEL 1 @DEL cl_exe_error
215cd "%obuild_snova_path%\obuild"
216
217cd "%obuild_snova_path%\%obuild_dir_bin%"
218%obuild_cxx_command% /c %obuild_cxx_debug_local% %obuild_cxx_optimize_local% %obuild_cxx_options% %obuild_cxx_macros% %obuild_cxx_includes% /Fo.\lib_sngeom\module_locator.obj  /Tp"..\source\SNgeom2\src\module_locator.cc" 1> cl_exe_error
219@IF ERRORLEVEL 1 @TYPE cl_exe_error && @GOTO obuild_return
220@IF NOT ERRORLEVEL 1 @DEL cl_exe_error
221cd "%obuild_snova_path%\obuild"
222
223cd "%obuild_snova_path%\%obuild_dir_bin%"
224%obuild_cxx_command% /c %obuild_cxx_debug_local% %obuild_cxx_optimize_local% %obuild_cxx_options% %obuild_cxx_macros% %obuild_cxx_includes% /Fo.\lib_sngeom\source_geom_data.obj  /Tp"..\source\SNgeom2\src\source_geom_data.cc" 1> cl_exe_error
225@IF ERRORLEVEL 1 @TYPE cl_exe_error && @GOTO obuild_return
226@IF NOT ERRORLEVEL 1 @DEL cl_exe_error
227cd "%obuild_snova_path%\obuild"
228
229@IF %obuild_verbose% == yes @ECHO OFF
230
231FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snova_0=%%d
232cd "%obuild_snova_path%\%obuild_dir_bin%"
233IF NOT EXIST .\obuild_platform.exe  ECHO Program obuild_platform.exe not found.  && GOTO obuild_return
234FOR /F "usebackq" %%j IN (`.\obuild_platform.exe  %obuild_platform% Windows_NT`) DO SET obuild_platform_result=%%j
235cd "%obuild_pwd_snova_0%"
236SET obuild_pwd_snova_0=
237IF NOT %obuild_platform_result% == yes GOTO end_if_platform_18
238SET obuild_cxx_linker_command=link.exe
239:end_if_platform_18
240SET obuild_platform_result=
241IF "%obuild_cxx_linker_command%" == ""  ECHO Variable obuild_cxx_linker_command not defined.  && GOTO obuild_return
242
243FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snova_0=%%d
244cd "%obuild_snova_path%\%obuild_dir_bin%"
245IF NOT EXIST .\obuild_platform.exe  ECHO Program obuild_platform.exe not found.  && GOTO obuild_return
246FOR /F "usebackq" %%j IN (`.\obuild_platform.exe  %obuild_platform% Windows_NT`) DO SET obuild_platform_result=%%j
247cd "%obuild_pwd_snova_0%"
248SET obuild_pwd_snova_0=
249IF NOT %obuild_platform_result% == yes GOTO end_if_platform_19
250SET obuild_cxx_linker_debug=/DEBUG
251:end_if_platform_19
252SET obuild_platform_result=
253
254FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snova_0=%%d
255cd "%obuild_snova_path%\%obuild_dir_bin%"
256IF NOT EXIST .\obuild_platform.exe  ECHO Program obuild_platform.exe not found.  && GOTO obuild_return
257FOR /F "usebackq" %%j IN (`.\obuild_platform.exe  %obuild_platform% Windows_NT`) DO SET obuild_platform_result=%%j
258cd "%obuild_pwd_snova_0%"
259SET obuild_pwd_snova_0=
260IF NOT %obuild_platform_result% == yes GOTO end_if_platform_20
261SET obuild_cxx_linker_options=/nologo
262:end_if_platform_20
263SET obuild_platform_result=
264
265IF NOT %obuild_debug% == yes GOTO else_if_db_build_lib_sngeom_sh_21
266  SET obuild_cxx_linker_debug_local=%obuild_cxx_linker_debug%
267  GOTO end_if_db_build_lib_sngeom_sh_21
268:else_if_db_build_lib_sngeom_sh_21
269  SET obuild_cxx_linker_debug_local=
270:end_if_db_build_lib_sngeom_sh_21
271
272IF NOT %obuild_optimize% == yes GOTO else_if_opt_build_lib_sngeom_sh_22
273  SET obuild_cxx_linker_optimize_local=%obuild_cxx_linker_optimize%
274  GOTO end_if_opt_build_lib_sngeom_sh_22
275:else_if_opt_build_lib_sngeom_sh_22
276  SET obuild_cxx_linker_optimize_local=
277:end_if_opt_build_lib_sngeom_sh_22
278
279FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snova_0=%%d
280cd "%obuild_snova_path%\%obuild_dir_bin%"
281IF EXIST .\lib_sngeom\tmp_objs DEL .\lib_sngeom\tmp_objs
282FOR %%f IN (.\lib_sngeom\*.obj) DO ECHO %%f >> .\lib_sngeom\tmp_objs
283
284REM # Create the archive library sngeom :
285@IF %obuild_verbose% == yes @ECHO ON
286lib.exe /nologo /machine:ix86 /out:.\lib_sngeom\sngeom.arc @.\lib_sngeom\tmp_objs
287@IF ERRORLEVEL 1 @GOTO obuild_return
288@IF %obuild_verbose% == yes @ECHO OFF
289
290REM # Build the obuild_windef.exe utility program :
291cl.exe /nologo /DWIN32 /MD /O2 /W3 /Feobuild_windef.exe "%obuild_snova_path%\obuild\cpp\obuild_windef.c" 1> NUL
292IF EXIST obuild_windef.obj DEL obuild_windef.obj
293
294REM # Building the .def file :
295@IF %obuild_verbose% == yes @ECHO ON
296dumpbin.exe /symbols /out:.\lib_sngeom\tmp .\lib_sngeom\sngeom.arc 1> dumpbin_exe_error .\lib_sngeom\sngeom.arc
297@IF ERRORLEVEL 1 @TYPE dumpbin_exe_error && @GOTO obuild_return
298@IF NOT ERRORLEVEL 1 @DEL dumpbin_exe_error
299@IF %obuild_verbose% == yes @ECHO OFF
300.\obuild_windef.exe sngeom < .\lib_sngeom\tmp > .\lib_sngeom\sngeom.def
301REM # Building the linking library :
302REM # It produces a .exp file.
303@IF %obuild_verbose% == yes @ECHO ON
304lib.exe /nologo /machine:ix86 /out:.\sngeom.lib /def:.\lib_sngeom\sngeom.def 1> lib_exe_error
305@IF ERRORLEVEL 1 @TYPE lib_exe_error && @GOTO obuild_return
306@IF NOT ERRORLEVEL 1 @DEL lib_exe_error
307@IF %obuild_verbose% == yes @ECHO OFF
308
309REM # Building the DLL :
310IF EXIST .\sngeom.dll DEL .\sngeom.dll
311@IF %obuild_verbose% == yes @ECHO ON
312link.exe /nologo /dll /out:.\sngeom.dll .\sngeom.exp .\lib_sngeom\sngeom.arc %obuild_linked_libraries%
313@IF %obuild_verbose% == yes @ECHO OFF
314
315cd "%obuild_pwd_snova_0%"
316SET obuild_pwd_snova_0=
317REM # Some cleanup :
318IF EXIST "%obuild_snova_path%\%obuild_dir_bin%\lib_sngeom\tmp_objs" DEL "%obuild_snova_path%\%obuild_dir_bin%\lib_sngeom\tmp_objs"
319IF EXIST "%obuild_snova_path%\%obuild_dir_bin%\sngeom.exp" DEL "%obuild_snova_path%\%obuild_dir_bin%\sngeom.exp"
320
321:obuild_return
322ENDLOCAL
323@ECHO ON
Note: See TracBrowser for help on using the repository browser.