|
NCBI Home IEB Home C++ Toolkit docs C Toolkit source browser C Toolkit source browser (2) |
NCBI C++ Toolkit Cross ReferenceC++/compilers/msvc800_prj/ptb.bat |
source navigation diff markup identifier search freetext search file search |
1 @echo off
2 REM $Id: ptb.bat 177298 2009-11-30 14:11:47Z gouriano $
3 REM ===========================================================================
4 REM
5 REM PUBLIC DOMAIN NOTICE
6 REM National Center for Biotechnology Information
7 REM
8 REM This software/database is a "United States Government Work" under the
9 REM terms of the United States Copyright Act. It was written as part of
10 REM the author's official duties as a United States Government employee and
11 REM thus cannot be copyrighted. This software/database is freely available
12 REM to the public for use. The National Library of Medicine and the U.S.
13 REM Government have not placed any restriction on its use or reproduction.
14 REM
15 REM Although all reasonable efforts have been taken to ensure the accuracy
16 REM and reliability of the software and data, the NLM and the U.S.
17 REM Government do not and cannot warrant the performance or results that
18 REM may be obtained by using this software or data. The NLM and the U.S.
19 REM Government disclaim all warranties, express or implied, including
20 REM warranties of performance, merchantability or fitness for any particular
21 REM purpose.
22 REM
23 REM Please cite the author in any work or product based on this material.
24 REM
25 REM ===========================================================================
26 REM
27 REM Author: Andrei Gourianov
28 REM
29 REM Run project_tree_builder.exe to generate MSVC solution and project files
30 REM
31 REM DO NOT ATTEMPT to run this bat file manually
32 REM It should be run by CONFIGURE project only
33 REM (open a solution and build or rebuild CONFIGURE project)
34 REM
35 REM ===========================================================================
36
37 set DEFPTB_LOCATION=\\snowman\win-coremake\App\Ncbi\cppcore\ptb
38 set IDE=800
39 set PTB_EXTRA=
40
41 for %%v in ("%PTB_PATH%" "%SLN_PATH%" "%TREE_ROOT%" "%BUILD_TREE_ROOT%" "%PTB_PLATFORM%") do (
42 if %%v=="" (
43 echo ERROR: required environment variable is missing
44 echo DO NOT ATTEMPT to run this bat file manually
45 echo It should be run by CONFIGURE project only
46 exit /b 1
47 )
48 )
49 set PTBGUI="%TREE_ROOT%\src\build-system\project_tree_builder_gui\bin\ptbgui.jar"
50 set DEFPTB_VERSION_FILE=%TREE_ROOT%\src\build-system\ptb_version.txt
51 set PTB_INI=%TREE_ROOT%\src\build-system\project_tree_builder.ini
52 set PTB_SLN=%BUILD_TREE_ROOT%\static\build\UtilityProjects\PTB.sln
53
54 call "%BUILD_TREE_ROOT%\msvcvars.bat"
55
56
57 REM -------------------------------------------------------------------------
58 REM get PTB version: from DEFPTB_VERSION_FILE or from PREBUILT_PTB_EXE
59
60 set DEFPTB_VERSION=
61 if exist "%DEFPTB_VERSION_FILE%" (
62 for /f %%a in ('type "%DEFPTB_VERSION_FILE%"') do (set DEFPTB_VERSION=%%a& goto donedf)
63 :donedf
64 set DEFPTB_VERSION=%DEFPTB_VERSION: =%
65 )
66 if exist "%PREBUILT_PTB_EXE%" (
67 set ptbver=
68 for /f "tokens=2" %%a in ('"%PREBUILT_PTB_EXE%" -version') do (set ptbver=%%a& goto donepb)
69 :donepb
70 set ptbver=%ptbver: =%
71 if not "%DEFPTB_VERSION%"=="%ptbver%" (
72 echo WARNING: requested PTB version %ptbver% does not match default one: %DEFPTB_VERSION%
73 set DEFPTB_VERSION=%ptbver%
74 )
75 )
76
77 if "%DEFPTB_VERSION%"=="" (
78 echo ERROR: DEFPTB_VERSION not specified
79 exit /b 1
80 )
81 for /f "tokens=1-3 delims=." %%a in ('echo %DEFPTB_VERSION%') do (set PTB_VER=%%a%%b%%c& set PTB_VER_MAJOR=%%a)
82
83
84 REM -------------------------------------------------------------------------
85 REM See if we should and can use Java GUI
86
87 set REQ_GUI_CFG=NO
88 set USE_GUI_CFG=NO
89 for /f "tokens=*" %%i in ('echo %PTB_FLAGS%') do call :PARSE %%i
90 goto :endparse
91 :PARSE
92 if "%1"=="" goto :eof
93 if "%1"=="-cfg" (set REQ_GUI_CFG=YES& goto :eof)
94 shift
95 goto :PARSE
96 :endparse
97 if "%REQ_GUI_CFG%"=="YES" (
98 if %PTB_VER_MAJOR% GEQ 2 (
99 if exist "%PTBGUI%" (
100 java -version >NUL 2>&1
101 if errorlevel 1 (
102 echo WARNING: Java not found, cannot run configuration GUI
103 ) else (
104 set USE_GUI_CFG=YES
105 )
106 ) else (
107 echo WARNING: "%PTBGUI%" not found
108 )
109 )
110 )
111
112
113 REM -------------------------------------------------------------------------
114 REM See if we should and can use saved settings
115
116 set PTB_SAVED_CFG=
117 if not "%PTB_SAVED_CFG_REQ%"=="" (
118 if not exist "%PTB_SAVED_CFG_REQ%" (
119 echo ERROR: %PTB_SAVED_CFG_REQ% not found
120 exit /b 1
121 )
122 if %PTB_VER_MAJOR% GEQ 2 (
123 if %PTB_VER% GEQ 220 (
124 set PTB_SAVED_CFG=-args %PTB_SAVED_CFG_REQ%
125 REM PTB will read PTB_PROJECT from the saved settings
126 set PTB_PROJECT_REQ=""
127 )
128 )
129 )
130
131
132 REM -------------------------------------------------------------------------
133 REM Identify PTB_EXE
134
135 if "%PREBUILT_PTB_EXE%"=="bootstrap" (
136 set DEF_PTB=%PTB_PATH%\project_tree_builder.exe
137 ) else if not "%PREBUILT_PTB_EXE%"=="" (
138 if exist "%PREBUILT_PTB_EXE%" (
139 set DEF_PTB=%PREBUILT_PTB_EXE%
140 ) else (
141 echo ERROR: "%PREBUILT_PTB_EXE%" not found
142 exit /b 1
143 )
144 ) else (
145 if %PTB_VER% GEQ 180 (
146 set DEF_PTB=%DEFPTB_LOCATION%\msvc\%DEFPTB_VERSION%\project_tree_builder.exe
147 ) else (
148 if "%PTB_PLATFORM%"=="x64" (
149 set DEF_PTB=%DEFPTB_LOCATION%\msvc8.64\%DEFPTB_VERSION%\project_tree_builder.exe
150 ) else (
151 set DEF_PTB=%DEFPTB_LOCATION%\msvc8\%DEFPTB_VERSION%\project_tree_builder.exe
152 )
153 )
154 )
155 if exist "%DEF_PTB%" (
156 set PTB_EXE=%DEF_PTB%
157 ) else (
158 echo project_tree_builder.exe not found at %DEF_PTB%
159 set PTB_EXE=%PTB_PATH%\project_tree_builder.exe
160 )
161
162 REM -------------------------------------------------------------------------
163 REM Misc settings
164
165 if %PTB_VER% GEQ 180 (
166 set PTB_EXTRA=%PTB_EXTRA% -ide %IDE% -arch %PTB_PLATFORM%
167 )
168 if not exist "%PTB_INI%" (
169 echo ERROR: "%PTB_INI%" not found
170 exit /b 1
171 )
172 if "%PTB_PROJECT%"=="" set PTB_PROJECT=%PTB_PROJECT_REQ%
173
174
175 REM -------------------------------------------------------------------------
176 REM Build PTB_EXE if needed
177
178 if not exist "%PTB_EXE%" (
179 echo ******************************************************************************
180 echo Building project tree builder locally, please wait
181 echo ******************************************************************************
182 rem --- @echo msbuild "%BUILD_TREE_ROOT%\static\build\ncbi_cpp.sln" /t:"project_tree_builder_exe:Rebuild" /p:Configuration=ReleaseDLL;Platform=%PTB_PLATFORM% /maxcpucount:1
183 rem --- msbuild "%BUILD_TREE_ROOT%\static\build\ncbi_cpp.sln" /t:"project_tree_builder_exe:Rebuild" /p:Configuration=ReleaseDLL;Platform=%PTB_PLATFORM% /maxcpucount:1
184 if exist "%PTB_SLN%" (
185 @echo %DEVENV% "%PTB_SLN%" /rebuild "ReleaseDLL|%PTB_PLATFORM%" /project "project_tree_builder.exe"
186 %DEVENV% "%PTB_SLN%" /rebuild "ReleaseDLL|%PTB_PLATFORM%" /project "project_tree_builder.exe"
187 ) else (
188 @echo %DEVENV% "%BUILD_TREE_ROOT%\static\build\ncbi_cpp.sln" /rebuild "ReleaseDLL|%PTB_PLATFORM%" /project "project_tree_builder.exe"
189 %DEVENV% "%BUILD_TREE_ROOT%\static\build\ncbi_cpp.sln" /rebuild "ReleaseDLL|%PTB_PLATFORM%" /project "project_tree_builder.exe"
190 )
191 ) else (
192 echo ******************************************************************************
193 echo Using PREBUILT project tree builder at %PTB_EXE%
194 echo ******************************************************************************
195 )
196 if not exist "%PTB_EXE%" (
197 echo ERROR: "%PTB_EXE%" not found
198 exit /b 1
199 )
200 "%PTB_EXE%" -version
201 if errorlevel 1 (
202 echo ERROR: cannot find working %PTB_EXE%
203 exit /b 1
204 )
205
206
207 REM -------------------------------------------------------------------------
208 REM Run PTB_EXE
209
210 call "%BUILD_TREE_ROOT%\lock_ptb_config.bat" ON "%BUILD_TREE_ROOT%\"
211 if errorlevel 1 exit /b 1
212
213 echo ******************************************************************************
214 echo Running -CONFIGURE- please wait
215 echo ******************************************************************************
216 echo "%PTB_EXE%" %PTB_FLAGS% %PTB_EXTRA% %PTB_SAVED_CFG% -logfile "%SLN_PATH%_configuration_log.txt" -conffile "%PTB_INI%" "%TREE_ROOT%" %PTB_PROJECT% "%SLN_PATH%"
217 if "%USE_GUI_CFG%"=="YES" (
218 java -jar %PTBGUI% "%PTB_EXE%" -i %PTB_FLAGS% %PTB_EXTRA% %PTB_SAVED_CFG% -logfile "%SLN_PATH%_configuration_log.txt" -conffile "%PTB_INI%" "%TREE_ROOT%" %PTB_PROJECT% "%SLN_PATH%"
219 ) else (
220 "%PTB_EXE%" %PTB_FLAGS% %PTB_EXTRA% %PTB_SAVED_CFG% -logfile "%SLN_PATH%_configuration_log.txt" -conffile "%PTB_INI%" "%TREE_ROOT%" %PTB_PROJECT% "%SLN_PATH%"
221 )
222 if errorlevel 1 (set PTB_RESULT=1) else (set PTB_RESULT=0)
223
224 call "%BUILD_TREE_ROOT%\lock_ptb_config.bat" OFF "%BUILD_TREE_ROOT%\"
225
226 if "%PTB_RESULT%"=="1" (
227 echo ******************************************************************************
228 echo -CONFIGURE- has failed
229 echo Configuration log was saved at "file://%SLN_PATH%_configuration_log.txt"
230 echo ******************************************************************************
231 if exist "%SLN_PATH%_configuration_log.txt" (
232 if "%DIAG_SILENT_ABORT%"=="" start "" "%SLN_PATH%_configuration_log.txt"
233 )
234 exit /b 1
235 ) else (
236 echo ******************************************************************************
237 echo -CONFIGURE- has succeeded
238 echo Configuration log was saved at "file://%SLN_PATH%_configuration_log.txt"
239 echo ******************************************************************************
240 )
|
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more information. |