source: build/snova/trunk/obuild/DOS/build_lib_snvertex.bat @ 275

Last change on this file since 275 was 275, checked in by barrand, 17 years ago
  • Property svn:executable set to *
File size: 15.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_snvertex
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_snvertex_sh_4
140  SET obuild_cxx_debug_local=%obuild_cxx_debug%
141  GOTO end_if_db_build_lib_snvertex_sh_4
142:else_if_db_build_lib_snvertex_sh_4
143  SET obuild_cxx_debug_local=
144:end_if_db_build_lib_snvertex_sh_4
145
146IF NOT %obuild_optimize% == yes GOTO else_if_opt_build_lib_snvertex_sh_5
147  SET obuild_cxx_optimize_local=%obuild_cxx_optimize%
148  GOTO end_if_opt_build_lib_snvertex_sh_5
149:else_if_opt_build_lib_snvertex_sh_5
150  SET obuild_cxx_optimize_local=
151:end_if_opt_build_lib_snvertex_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\SNvertex\include"
168SET obuild_cxx_includes=%obuild_cxx_includes% /I"%obuild_snova_path%\source\GeomUtils\include"
169SET obuild_cxx_includes=%obuild_cxx_includes% /I"%obuild_snova_path%\source\SNgeom2\include"
170SET obuild_cxx_includes=%obuild_cxx_includes% /I"%obuild_bhep_path%"
171
172IF EXIST "%obuild_snova_path%\%obuild_dir_bin%\lib_snvertex" RMDIR /S /Q "%obuild_snova_path%\%obuild_dir_bin%\lib_snvertex"
173IF NOT EXIST "%obuild_snova_path%\%obuild_dir_bin%\lib_snvertex" MKDIR "%obuild_snova_path%\%obuild_dir_bin%\lib_snvertex"
174
175@IF %obuild_verbose% == yes @ECHO ON
176cd "%obuild_snova_path%\%obuild_dir_bin%"
177%obuild_cxx_command% /c %obuild_cxx_debug_local% %obuild_cxx_optimize_local% %obuild_cxx_options% %obuild_cxx_macros% %obuild_cxx_includes% /Fo.\lib_snvertex\CALO_basic_VG.obj  /Tp"..\source\SNvertex\src\CALO_basic_VG.cc" 1> cl_exe_error
178@IF ERRORLEVEL 1 @TYPE cl_exe_error && @GOTO obuild_return
179@IF NOT ERRORLEVEL 1 @DEL cl_exe_error
180cd "%obuild_snova_path%\obuild"
181
182cd "%obuild_snova_path%\%obuild_dir_bin%"
183%obuild_cxx_command% /c %obuild_cxx_debug_local% %obuild_cxx_optimize_local% %obuild_cxx_options% %obuild_cxx_macros% %obuild_cxx_includes% /Fo.\lib_snvertex\base_VG.obj  /Tp"..\source\SNvertex\src\base_VG.cc" 1> cl_exe_error
184@IF ERRORLEVEL 1 @TYPE cl_exe_error && @GOTO obuild_return
185@IF NOT ERRORLEVEL 1 @DEL cl_exe_error
186cd "%obuild_snova_path%\obuild"
187
188cd "%obuild_snova_path%\%obuild_dir_bin%"
189%obuild_cxx_command% /c %obuild_cxx_debug_local% %obuild_cxx_optimize_local% %obuild_cxx_options% %obuild_cxx_macros% %obuild_cxx_includes% /Fo.\lib_snvertex\base_VG_factory.obj  /Tp"..\source\SNvertex\src\base_VG_factory.cc" 1> cl_exe_error
190@IF ERRORLEVEL 1 @TYPE cl_exe_error && @GOTO obuild_return
191@IF NOT ERRORLEVEL 1 @DEL cl_exe_error
192cd "%obuild_snova_path%\obuild"
193
194cd "%obuild_snova_path%\%obuild_dir_bin%"
195%obuild_cxx_command% /c %obuild_cxx_debug_local% %obuild_cxx_optimize_local% %obuild_cxx_options% %obuild_cxx_macros% %obuild_cxx_includes% /Fo.\lib_snvertex\base_geom_VG.obj  /Tp"..\source\SNvertex\src\base_geom_VG.cc" 1> cl_exe_error
196@IF ERRORLEVEL 1 @TYPE cl_exe_error && @GOTO obuild_return
197@IF NOT ERRORLEVEL 1 @DEL cl_exe_error
198cd "%obuild_snova_path%\obuild"
199
200cd "%obuild_snova_path%\%obuild_dir_bin%"
201%obuild_cxx_command% /c %obuild_cxx_debug_local% %obuild_cxx_optimize_local% %obuild_cxx_options% %obuild_cxx_macros% %obuild_cxx_includes% /Fo.\lib_snvertex\box_VG.obj  /Tp"..\source\SNvertex\src\box_VG.cc" 1> cl_exe_error
202@IF ERRORLEVEL 1 @TYPE cl_exe_error && @GOTO obuild_return
203@IF NOT ERRORLEVEL 1 @DEL cl_exe_error
204cd "%obuild_snova_path%\obuild"
205
206cd "%obuild_snova_path%\%obuild_dir_bin%"
207%obuild_cxx_command% /c %obuild_cxx_debug_local% %obuild_cxx_optimize_local% %obuild_cxx_options% %obuild_cxx_macros% %obuild_cxx_includes% /Fo.\lib_snvertex\cylinder_VG.obj  /Tp"..\source\SNvertex\src\cylinder_VG.cc" 1> cl_exe_error
208@IF ERRORLEVEL 1 @TYPE cl_exe_error && @GOTO obuild_return
209@IF NOT ERRORLEVEL 1 @DEL cl_exe_error
210cd "%obuild_snova_path%\obuild"
211
212cd "%obuild_snova_path%\%obuild_dir_bin%"
213%obuild_cxx_command% /c %obuild_cxx_debug_local% %obuild_cxx_optimize_local% %obuild_cxx_options% %obuild_cxx_macros% %obuild_cxx_includes% /Fo.\lib_snvertex\dummy_snvertex.obj  /Tp"..\source\SNvertex\src\dummy_snvertex.cc" 1> cl_exe_error
214@IF ERRORLEVEL 1 @TYPE cl_exe_error && @GOTO obuild_return
215@IF NOT ERRORLEVEL 1 @DEL cl_exe_error
216cd "%obuild_snova_path%\obuild"
217
218cd "%obuild_snova_path%\%obuild_dir_bin%"
219%obuild_cxx_command% /c %obuild_cxx_debug_local% %obuild_cxx_optimize_local% %obuild_cxx_options% %obuild_cxx_macros% %obuild_cxx_includes% /Fo.\lib_snvertex\from_file_VG.obj  /Tp"..\source\SNvertex\src\from_file_VG.cc" 1> cl_exe_error
220@IF ERRORLEVEL 1 @TYPE cl_exe_error && @GOTO obuild_return
221@IF NOT ERRORLEVEL 1 @DEL cl_exe_error
222cd "%obuild_snova_path%\obuild"
223
224cd "%obuild_snova_path%\%obuild_dir_bin%"
225%obuild_cxx_command% /c %obuild_cxx_debug_local% %obuild_cxx_optimize_local% %obuild_cxx_options% %obuild_cxx_macros% %obuild_cxx_includes% /Fo.\lib_snvertex\snvertex_utils.obj  /Tp"..\source\SNvertex\src\snvertex_utils.cc" 1> cl_exe_error
226@IF ERRORLEVEL 1 @TYPE cl_exe_error && @GOTO obuild_return
227@IF NOT ERRORLEVEL 1 @DEL cl_exe_error
228cd "%obuild_snova_path%\obuild"
229
230cd "%obuild_snova_path%\%obuild_dir_bin%"
231%obuild_cxx_command% /c %obuild_cxx_debug_local% %obuild_cxx_optimize_local% %obuild_cxx_options% %obuild_cxx_macros% %obuild_cxx_includes% /Fo.\lib_snvertex\source_simple_VG.obj  /Tp"..\source\SNvertex\src\source_simple_VG.cc" 1> cl_exe_error
232@IF ERRORLEVEL 1 @TYPE cl_exe_error && @GOTO obuild_return
233@IF NOT ERRORLEVEL 1 @DEL cl_exe_error
234cd "%obuild_snova_path%\obuild"
235
236cd "%obuild_snova_path%\%obuild_dir_bin%"
237%obuild_cxx_command% /c %obuild_cxx_debug_local% %obuild_cxx_optimize_local% %obuild_cxx_options% %obuild_cxx_macros% %obuild_cxx_includes% /Fo.\lib_snvertex\spot_VG.obj  /Tp"..\source\SNvertex\src\spot_VG.cc" 1> cl_exe_error
238@IF ERRORLEVEL 1 @TYPE cl_exe_error && @GOTO obuild_return
239@IF NOT ERRORLEVEL 1 @DEL cl_exe_error
240cd "%obuild_snova_path%\obuild"
241
242@IF %obuild_verbose% == yes @ECHO OFF
243
244FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snova_0=%%d
245cd "%obuild_snova_path%\%obuild_dir_bin%"
246IF NOT EXIST .\obuild_platform.exe  ECHO Program obuild_platform.exe not found.  && GOTO obuild_return
247FOR /F "usebackq" %%j IN (`.\obuild_platform.exe  %obuild_platform% Windows_NT`) DO SET obuild_platform_result=%%j
248cd "%obuild_pwd_snova_0%"
249SET obuild_pwd_snova_0=
250IF NOT %obuild_platform_result% == yes GOTO end_if_platform_21
251SET obuild_cxx_linker_command=link.exe
252:end_if_platform_21
253SET obuild_platform_result=
254IF "%obuild_cxx_linker_command%" == ""  ECHO Variable obuild_cxx_linker_command not defined.  && GOTO obuild_return
255
256FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snova_0=%%d
257cd "%obuild_snova_path%\%obuild_dir_bin%"
258IF NOT EXIST .\obuild_platform.exe  ECHO Program obuild_platform.exe not found.  && GOTO obuild_return
259FOR /F "usebackq" %%j IN (`.\obuild_platform.exe  %obuild_platform% Windows_NT`) DO SET obuild_platform_result=%%j
260cd "%obuild_pwd_snova_0%"
261SET obuild_pwd_snova_0=
262IF NOT %obuild_platform_result% == yes GOTO end_if_platform_22
263SET obuild_cxx_linker_debug=/DEBUG
264:end_if_platform_22
265SET obuild_platform_result=
266
267FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snova_0=%%d
268cd "%obuild_snova_path%\%obuild_dir_bin%"
269IF NOT EXIST .\obuild_platform.exe  ECHO Program obuild_platform.exe not found.  && GOTO obuild_return
270FOR /F "usebackq" %%j IN (`.\obuild_platform.exe  %obuild_platform% Windows_NT`) DO SET obuild_platform_result=%%j
271cd "%obuild_pwd_snova_0%"
272SET obuild_pwd_snova_0=
273IF NOT %obuild_platform_result% == yes GOTO end_if_platform_23
274SET obuild_cxx_linker_options=/nologo
275:end_if_platform_23
276SET obuild_platform_result=
277
278IF NOT %obuild_debug% == yes GOTO else_if_db_build_lib_snvertex_sh_24
279  SET obuild_cxx_linker_debug_local=%obuild_cxx_linker_debug%
280  GOTO end_if_db_build_lib_snvertex_sh_24
281:else_if_db_build_lib_snvertex_sh_24
282  SET obuild_cxx_linker_debug_local=
283:end_if_db_build_lib_snvertex_sh_24
284
285IF NOT %obuild_optimize% == yes GOTO else_if_opt_build_lib_snvertex_sh_25
286  SET obuild_cxx_linker_optimize_local=%obuild_cxx_linker_optimize%
287  GOTO end_if_opt_build_lib_snvertex_sh_25
288:else_if_opt_build_lib_snvertex_sh_25
289  SET obuild_cxx_linker_optimize_local=
290:end_if_opt_build_lib_snvertex_sh_25
291
292FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snova_0=%%d
293cd "%obuild_snova_path%\%obuild_dir_bin%"
294IF EXIST .\lib_snvertex\tmp_objs DEL .\lib_snvertex\tmp_objs
295FOR %%f IN (.\lib_snvertex\*.obj) DO ECHO %%f >> .\lib_snvertex\tmp_objs
296
297REM # Create the archive library snvertex :
298@IF %obuild_verbose% == yes @ECHO ON
299lib.exe /nologo /machine:ix86 /out:.\lib_snvertex\snvertex.arc @.\lib_snvertex\tmp_objs
300@IF ERRORLEVEL 1 @GOTO obuild_return
301@IF %obuild_verbose% == yes @ECHO OFF
302
303REM # Build the obuild_windef.exe utility program :
304cl.exe /nologo /DWIN32 /MD /O2 /W3 /Feobuild_windef.exe "%obuild_snova_path%\obuild\cpp\obuild_windef.c" 1> NUL
305IF EXIST obuild_windef.obj DEL obuild_windef.obj
306
307REM # Building the .def file :
308@IF %obuild_verbose% == yes @ECHO ON
309dumpbin.exe /symbols /out:.\lib_snvertex\tmp .\lib_snvertex\snvertex.arc 1> dumpbin_exe_error .\lib_snvertex\snvertex.arc
310@IF ERRORLEVEL 1 @TYPE dumpbin_exe_error && @GOTO obuild_return
311@IF NOT ERRORLEVEL 1 @DEL dumpbin_exe_error
312@IF %obuild_verbose% == yes @ECHO OFF
313.\obuild_windef.exe snvertex < .\lib_snvertex\tmp > .\lib_snvertex\snvertex.def
314REM # Building the linking library :
315REM # It produces a .exp file.
316@IF %obuild_verbose% == yes @ECHO ON
317lib.exe /nologo /machine:ix86 /out:.\snvertex.lib /def:.\lib_snvertex\snvertex.def 1> lib_exe_error
318@IF ERRORLEVEL 1 @TYPE lib_exe_error && @GOTO obuild_return
319@IF NOT ERRORLEVEL 1 @DEL lib_exe_error
320@IF %obuild_verbose% == yes @ECHO OFF
321
322REM # Building the DLL :
323IF EXIST .\snvertex.dll DEL .\snvertex.dll
324@IF %obuild_verbose% == yes @ECHO ON
325link.exe /nologo /dll /out:.\snvertex.dll .\snvertex.exp .\lib_snvertex\snvertex.arc %obuild_linked_libraries%
326@IF %obuild_verbose% == yes @ECHO OFF
327
328cd "%obuild_pwd_snova_0%"
329SET obuild_pwd_snova_0=
330REM # Some cleanup :
331IF EXIST "%obuild_snova_path%\%obuild_dir_bin%\lib_snvertex\tmp_objs" DEL "%obuild_snova_path%\%obuild_dir_bin%\lib_snvertex\tmp_objs"
332IF EXIST "%obuild_snova_path%\%obuild_dir_bin%\snvertex.exp" DEL "%obuild_snova_path%\%obuild_dir_bin%\snvertex.exp"
333
334:obuild_return
335ENDLOCAL
336@ECHO ON
Note: See TracBrowser for help on using the repository browser.