source: snovis/trunk/obuild/DOS/build.bat

Last change on this file was 276, checked in by barrand, 16 years ago
  • Property svn:executable set to *
File size: 4.9 KB
Line 
1@ECHO OFF
2SETLOCAL
3
4REM #
5REM # File produced by the obuild tool version 1.0
6REM # for the package snovis with version v1r1.
7REM #
8
9REM #////////////////////////////////////////////////
10REM # Usage :
11REM #   DOS> CD some_path\pack\version\obuild
12REM #   DOS> DOS\build
13REM # or :
14REM #   DOS> call DOS\build.bat
15REM #
16REM #////////////////////////////////////////////////
17
18REM #////////////////////////////////////////////////
19REM #/// Get path of this file :
20REM #////////////////////////////////////////////////
21SET obuild_snovis_path=%~dp0
22REM # Remove ending \obuild\DOS\
23SET obuild_snovis_path=%obuild_snovis_path:~0,-12%
24
25REM #////////////////////////////////////////////////
26REM #/// Treat arguments :
27REM #////////////////////////////////////////////////
28
29SET obuild_verbose=no
30SET obuild_debug=no
31SET obuild_do_mains=yes
32SET obuild_group=main
33
34SET obuild_args=
35
36:next_arg
37IF "%1%" == "" GOTO end_args
38
39IF NOT "%1%" == "-h" GOTO end_if_h
40  ECHO Usage :
41  ECHO   build [Options] [Target]
42  ECHO Options :
43  ECHO   -v : verbose.
44  ECHO   -g : build in debug mode.
45  ECHO   -e : erase binary directory.
46  ECHO   -x : execute with ECHO ON"
47  ECHO   -nm : build the not-main components.
48  ECHO   -group group : build the given group of components.
49  ECHO Target :
50  ECHO   If no option is specify and a ending
51  ECHO  string is given ; this string is given
52  ECHO  to a find command of the form :
53  ECHO     find ./sh -name "*target*" -exec {} \;
54  ECHO  in order to execute selected scripts under
55  ECHO  the sh directory.
56  ECHO Examples :
57  ECHO   build app
58  ECHO   build -v _lib
59  ECHO   build -v -g dll_
60  GOTO obuild_return
61:end_if_h
62
63IF NOT "%1%" == "-v" GOTO end_if_v
64  SET obuild_verbose=yes
65  SET obuild_args=%obuild_args% -v
66  SHIFT
67  GOTO next_arg
68:end_if_v
69
70IF NOT "%1%" == "-g" GOTO end_if_g
71  SET obuild_debug=yes
72  SET obuild_args=%obuild_args% -g
73  SHIFT
74  GOTO next_arg
75:end_if_g
76
77IF NOT "%1%" == "-e" GOTO end_if_e
78
79  IF "%OBUILD_PLATFORM%" == "" (
80    IF "%OS%" == "" ECHO Environment variable OS not found. & GOTO obuild_return
81    SET obuild_platform=%OS%
82  ) ELSE (
83    SET obuild_platform=%OBUILD_PLATFORM%
84  )
85
86  IF "%obuild_platform%" == "" (
87    ECHO obuild_platform variable not defined.
88    GOTO obuild_return
89  )
90
91  IF "%OBUILD_DIR_BIN%" == "" (
92    SET obuild_dir_bin=bin_obuild
93  ) ELSE (
94    SET obuild_dir_bin=%OBUILD_DIR_BIN%
95  )
96
97  IF "%obuild_dir_bin%" == "" (
98    ECHO obuild_dir_bin variable not defined.
99    GOTO obuild_return
100  )
101
102  IF EXIST "%obuild_snovis_path%\%obuild_dir_bin%" RMDIR /S /Q "%obuild_snovis_path%\%obuild_dir_bin%"
103
104  GOTO obuild_return
105
106:end_if_e
107
108IF NOT "%1%" == "-x" GOTO end_if_x
109  SET obuild_args=%obuild_args% -x
110  SHIFT
111  GOTO next_arg
112:end_if_x
113
114IF NOT "%1%" == "-nm" GOTO end_if_nm
115  SET obuild_do_mains=no
116  SHIFT
117  GOTO next_arg
118:end_if_nm
119
120IF NOT "%1%" == "-group" GOTO end_if_group
121  SHIFT
122  SET obuild_group=%1%
123  SHIFT
124  GOTO next_arg
125:end_if_group
126
127REM # Argument without a leading "-" is assumed to
128REM # be the last one and then to be a pattern
129REM # to find and execute command files under
130REM # the DOS directory.
131SET obuild_arg=%1%
132SET obuild_arg1=%1:~0,1%
133IF "%obuild_arg1%" == "-" GOTO obuild_return
134
135  FOR %%f IN (DOS\*%obuild_arg%*) DO %%f %obuild_args%
136
137  GOTO obuild_return
138
139:end_args
140
141REM #////////////////////////////////////////////////
142REM #/// End arguments.
143REM #////////////////////////////////////////////////
144
145
146IF NOT %obuild_group% == main GOTO end_if_group_0
147IF NOT %obuild_do_mains% == yes GOTO end_if_main_0
148  IF NOT EXIST .\DOS\build_lib_G4LabCore.bat  GOTO end_if_build_0
149    CALL .\DOS\build_lib_G4LabCore.bat %obuild_args%
150    @IF ERRORLEVEL 1 @GOTO obuild_return
151    @ECHO OFF
152:end_if_build_0
153:end_if_main_0
154:end_if_group_0
155IF NOT %obuild_group% == main GOTO end_if_group_1
156IF NOT %obuild_do_mains% == yes GOTO end_if_main_1
157  IF NOT EXIST .\DOS\build_lib_G4LabUIOnX.bat  GOTO end_if_build_1
158    CALL .\DOS\build_lib_G4LabUIOnX.bat %obuild_args%
159    @IF ERRORLEVEL 1 @GOTO obuild_return
160    @ECHO OFF
161:end_if_build_1
162:end_if_main_1
163:end_if_group_1
164
165IF NOT %obuild_group% == main GOTO end_if_group_2
166IF NOT %obuild_do_mains% == yes GOTO end_if_main_2
167  IF NOT EXIST .\DOS\build_dll_G4Lab.bat  GOTO end_if_build_2
168    CALL .\DOS\build_dll_G4Lab.bat %obuild_args%
169    @IF ERRORLEVEL 1 @GOTO obuild_return
170    @ECHO OFF
171:end_if_build_2
172:end_if_main_2
173:end_if_group_2
174IF NOT %obuild_group% == main GOTO end_if_group_3
175IF NOT %obuild_do_mains% == yes GOTO end_if_main_3
176  IF NOT EXIST .\DOS\build_dll_snovis.bat  GOTO end_if_build_3
177    CALL .\DOS\build_dll_snovis.bat %obuild_args%
178    @IF ERRORLEVEL 1 @GOTO obuild_return
179    @ECHO OFF
180:end_if_build_3
181:end_if_main_3
182:end_if_group_3
183
184IF NOT %obuild_group% == main GOTO end_if_group_4
185IF NOT %obuild_do_mains% == yes GOTO end_if_main_4
186  IF NOT EXIST .\DOS\build_app_prog_snovis.bat  GOTO end_if_build_4
187    CALL .\DOS\build_app_prog_snovis.bat %obuild_args%
188    @IF ERRORLEVEL 1 @GOTO obuild_return
189    @ECHO OFF
190:end_if_build_4
191:end_if_main_4
192:end_if_group_4
193
194
195:obuild_return
196ENDLOCAL
197@ECHO ON
Note: See TracBrowser for help on using the repository browser.