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 |
---|
13 | REM # or : |
---|
14 | REM # DOS> call DOS\build.bat |
---|
15 | REM # |
---|
16 | REM #//////////////////////////////////////////////// |
---|
17 | |
---|
18 | REM #//////////////////////////////////////////////// |
---|
19 | REM #/// Get path of this file : |
---|
20 | REM #//////////////////////////////////////////////// |
---|
21 | SET obuild_snovis_path=%~dp0 |
---|
22 | REM # Remove ending \obuild\DOS\ |
---|
23 | SET obuild_snovis_path=%obuild_snovis_path:~0,-12% |
---|
24 | |
---|
25 | REM #//////////////////////////////////////////////// |
---|
26 | REM #/// Treat arguments : |
---|
27 | REM #//////////////////////////////////////////////// |
---|
28 | |
---|
29 | SET obuild_verbose=no |
---|
30 | SET obuild_debug=no |
---|
31 | SET obuild_do_mains=yes |
---|
32 | SET obuild_group=main |
---|
33 | |
---|
34 | SET obuild_args= |
---|
35 | |
---|
36 | :next_arg |
---|
37 | IF "%1%" == "" GOTO end_args |
---|
38 | |
---|
39 | IF 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 | |
---|
63 | IF 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 | |
---|
70 | IF 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 | |
---|
77 | IF 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=%obuild_platform%_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 | |
---|
108 | IF 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 | |
---|
114 | IF NOT "%1%" == "-nm" GOTO end_if_nm |
---|
115 | SET obuild_do_mains=no |
---|
116 | SHIFT |
---|
117 | GOTO next_arg |
---|
118 | :end_if_nm |
---|
119 | |
---|
120 | IF 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 | |
---|
127 | REM # Argument without a leading "-" is assumed to |
---|
128 | REM # be the last one and then to be a pattern |
---|
129 | REM # to find and execute command files under |
---|
130 | REM # the DOS directory. |
---|
131 | SET obuild_arg=%1% |
---|
132 | SET obuild_arg1=%1:~0,1% |
---|
133 | IF "%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 | |
---|
141 | REM #//////////////////////////////////////////////// |
---|
142 | REM #/// End arguments. |
---|
143 | REM #//////////////////////////////////////////////// |
---|
144 | |
---|
145 | |
---|
146 | IF NOT %obuild_group% == main GOTO end_if_group_0 |
---|
147 | IF 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 |
---|
155 | IF NOT %obuild_group% == main GOTO end_if_group_1 |
---|
156 | IF 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 | |
---|
165 | IF NOT %obuild_group% == main GOTO end_if_group_2 |
---|
166 | IF 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 |
---|
174 | IF NOT %obuild_group% == main GOTO end_if_group_3 |
---|
175 | IF 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 | |
---|
184 | IF NOT %obuild_group% == main GOTO end_if_group_4 |
---|
185 | IF 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 | :obuild_return |
---|
195 | ENDLOCAL |
---|
196 | @ECHO ON |
---|