Fossil SCM

Simplify the batch tool changes from [0519493f]. The BUILDDIR environment variable can be set before invoking 'buildmsvc.bat' in order to build out-of-tree.

mistachkin 2020-06-06 19:04 trunk
Commit 7c481db74ef6197fe13a3556ec2d2000f35788de6b8a214ddf6a7af5ba0e4773
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -1483,11 +1483,11 @@
14831483
# file, edit "makemake.tcl" then run "tclsh makemake.tcl"
14841484
# to regenerate this file.
14851485
#
14861486
B = ..
14871487
SRCDIR = $(B)\src
1488
-T = msvcbld
1488
+T = .
14891489
OBJDIR = $(T)
14901490
OX = $(OBJDIR)
14911491
O = .obj
14921492
E = .exe
14931493
P = .pdb
14941494
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -1483,11 +1483,11 @@
1483 # file, edit "makemake.tcl" then run "tclsh makemake.tcl"
1484 # to regenerate this file.
1485 #
1486 B = ..
1487 SRCDIR = $(B)\src
1488 T = msvcbld
1489 OBJDIR = $(T)
1490 OX = $(OBJDIR)
1491 O = .obj
1492 E = .exe
1493 P = .pdb
1494
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -1483,11 +1483,11 @@
1483 # file, edit "makemake.tcl" then run "tclsh makemake.tcl"
1484 # to regenerate this file.
1485 #
1486 B = ..
1487 SRCDIR = $(B)\src
1488 T = .
1489 OBJDIR = $(T)
1490 OX = $(OBJDIR)
1491 O = .obj
1492 E = .exe
1493 P = .pdb
1494
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -8,11 +8,11 @@
88
# file, edit "makemake.tcl" then run "tclsh makemake.tcl"
99
# to regenerate this file.
1010
#
1111
B = ..
1212
SRCDIR = $(B)\src
13
-T = msvcbld
13
+T = .
1414
OBJDIR = $(T)
1515
OX = $(OBJDIR)
1616
O = .obj
1717
E = .exe
1818
P = .pdb
1919
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -8,11 +8,11 @@
8 # file, edit "makemake.tcl" then run "tclsh makemake.tcl"
9 # to regenerate this file.
10 #
11 B = ..
12 SRCDIR = $(B)\src
13 T = msvcbld
14 OBJDIR = $(T)
15 OX = $(OBJDIR)
16 O = .obj
17 E = .exe
18 P = .pdb
19
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -8,11 +8,11 @@
8 # file, edit "makemake.tcl" then run "tclsh makemake.tcl"
9 # to regenerate this file.
10 #
11 B = ..
12 SRCDIR = $(B)\src
13 T = .
14 OBJDIR = $(T)
15 OX = $(OBJDIR)
16 O = .obj
17 E = .exe
18 P = .pdb
19
+22 -20
--- win/buildmsvc.bat
+++ win/buildmsvc.bat
@@ -183,22 +183,17 @@
183183
%_VECHO% VcInstallDir = '%VCINSTALLDIR%'
184184
185185
REM
186186
REM NOTE: Attempt to create the build output directory, if necessary.
187187
REM
188
-
189
-SET OBJDIR=msvcbld
190
-
191
-IF NOT DEFINED BUILDDIR (
192
- IF DEFINED BUILDSUFFIX (
193
- SET BUILDDIR=%ROOT%\%OBJDIR%%BUILDSUFFIX%
194
- )
195
-)
196
-
197
-IF NOT DEFINED BUILDDIR GOTO skip_createBuildDir
198
-
199
-SET OBJDIR=.
188
+IF DEFINED BUILDDIR (
189
+ IF DEFINED BUILDSUFFIX (
190
+ SET BUILDDIR=%BUILDDIR%%BUILDSUFFIX%
191
+ )
192
+) ELSE (
193
+ SET BUILDDIR=%ROOT%\msvcbld%BUILDSUFFIX%
194
+)
200195
201196
%_VECHO% BuildSuffix = '%BUILDSUFFIX%'
202197
%_VECHO% BuildDir = '%BUILDDIR%'
203198
204199
IF NOT EXIST "%BUILDDIR%" (
@@ -210,19 +205,20 @@
210205
)
211206
)
212207
213208
REM
214209
REM NOTE: Attempt to change to the created build output directory so that
215
-REM the generated files will be placed there.
210
+REM the generated files will be placed there, if needed.
216211
REM
217212
%__ECHO2% PUSHD "%BUILDDIR%"
218213
219214
IF ERRORLEVEL 1 (
220215
ECHO Could not change to directory "%BUILDDIR%".
221216
GOTO errors
222217
)
223
-:skip_createBuildDir
218
+
219
+SET NEED_POPD=1
224220
225221
REM
226222
REM NOTE: If requested, setup the build environment to refer to the Windows
227223
REM SDK v7.1A, which is required if the binaries are being built with
228224
REM Visual Studio 201x and need to work on Windows XP.
@@ -233,32 +229,38 @@
233229
)
234230
235231
%_VECHO% Path = '%PATH%'
236232
%_VECHO% Include = '%INCLUDE%'
237233
%_VECHO% Lib = '%LIB%'
234
+%_VECHO% Tools = '%TOOLS%'
235
+%_VECHO% Root = '%ROOT%'
238236
%_VECHO% NmakeArgs = '%NMAKE_ARGS%'
239237
240238
REM
241239
REM NOTE: Attempt to execute NMAKE for the Fossil MSVC makefile, passing
242240
REM anything extra from our command line along (e.g. extra options).
243241
REM Also, pass the base directory of the Fossil source tree as this
244242
REM allows an out-of-source-tree build.
245243
REM
246
-%__ECHO% nmake /f "%TOOLS%\Makefile.msc" B="%ROOT%" T="%OBJDIR%" %NMAKE_ARGS% %*
244
+%__ECHO% nmake /f "%TOOLS%\Makefile.msc" B="%ROOT%" %NMAKE_ARGS% %*
247245
248246
IF ERRORLEVEL 1 (
249247
GOTO errors
250248
)
251249
252250
REM
253
-REM NOTE: Attempt to restore the previously saved directory.
251
+REM NOTE: Attempt to restore the previously saved directory, if needed.
254252
REM
255
-%__ECHO2% POPD
253
+IF DEFINED NEED_POPD (
254
+ %__ECHO2% POPD
255
+
256
+ IF ERRORLEVEL 1 (
257
+ ECHO Could not restore directory.
258
+ GOTO errors
259
+ )
256260
257
-IF ERRORLEVEL 1 (
258
- ECHO Could not restore directory.
259
- GOTO errors
261
+ CALL :fn_UnsetVariable NEED_POPD
260262
)
261263
262264
GOTO no_errors
263265
264266
:fn_UseV110Sdk71A
265267
--- win/buildmsvc.bat
+++ win/buildmsvc.bat
@@ -183,22 +183,17 @@
183 %_VECHO% VcInstallDir = '%VCINSTALLDIR%'
184
185 REM
186 REM NOTE: Attempt to create the build output directory, if necessary.
187 REM
188
189 SET OBJDIR=msvcbld
190
191 IF NOT DEFINED BUILDDIR (
192 IF DEFINED BUILDSUFFIX (
193 SET BUILDDIR=%ROOT%\%OBJDIR%%BUILDSUFFIX%
194 )
195 )
196
197 IF NOT DEFINED BUILDDIR GOTO skip_createBuildDir
198
199 SET OBJDIR=.
200
201 %_VECHO% BuildSuffix = '%BUILDSUFFIX%'
202 %_VECHO% BuildDir = '%BUILDDIR%'
203
204 IF NOT EXIST "%BUILDDIR%" (
@@ -210,19 +205,20 @@
210 )
211 )
212
213 REM
214 REM NOTE: Attempt to change to the created build output directory so that
215 REM the generated files will be placed there.
216 REM
217 %__ECHO2% PUSHD "%BUILDDIR%"
218
219 IF ERRORLEVEL 1 (
220 ECHO Could not change to directory "%BUILDDIR%".
221 GOTO errors
222 )
223 :skip_createBuildDir
 
224
225 REM
226 REM NOTE: If requested, setup the build environment to refer to the Windows
227 REM SDK v7.1A, which is required if the binaries are being built with
228 REM Visual Studio 201x and need to work on Windows XP.
@@ -233,32 +229,38 @@
233 )
234
235 %_VECHO% Path = '%PATH%'
236 %_VECHO% Include = '%INCLUDE%'
237 %_VECHO% Lib = '%LIB%'
 
 
238 %_VECHO% NmakeArgs = '%NMAKE_ARGS%'
239
240 REM
241 REM NOTE: Attempt to execute NMAKE for the Fossil MSVC makefile, passing
242 REM anything extra from our command line along (e.g. extra options).
243 REM Also, pass the base directory of the Fossil source tree as this
244 REM allows an out-of-source-tree build.
245 REM
246 %__ECHO% nmake /f "%TOOLS%\Makefile.msc" B="%ROOT%" T="%OBJDIR%" %NMAKE_ARGS% %*
247
248 IF ERRORLEVEL 1 (
249 GOTO errors
250 )
251
252 REM
253 REM NOTE: Attempt to restore the previously saved directory.
254 REM
255 %__ECHO2% POPD
 
 
 
 
 
 
256
257 IF ERRORLEVEL 1 (
258 ECHO Could not restore directory.
259 GOTO errors
260 )
261
262 GOTO no_errors
263
264 :fn_UseV110Sdk71A
265
--- win/buildmsvc.bat
+++ win/buildmsvc.bat
@@ -183,22 +183,17 @@
183 %_VECHO% VcInstallDir = '%VCINSTALLDIR%'
184
185 REM
186 REM NOTE: Attempt to create the build output directory, if necessary.
187 REM
188 IF DEFINED BUILDDIR (
189 IF DEFINED BUILDSUFFIX (
190 SET BUILDDIR=%BUILDDIR%%BUILDSUFFIX%
191 )
192 ) ELSE (
193 SET BUILDDIR=%ROOT%\msvcbld%BUILDSUFFIX%
194 )
 
 
 
 
 
195
196 %_VECHO% BuildSuffix = '%BUILDSUFFIX%'
197 %_VECHO% BuildDir = '%BUILDDIR%'
198
199 IF NOT EXIST "%BUILDDIR%" (
@@ -210,19 +205,20 @@
205 )
206 )
207
208 REM
209 REM NOTE: Attempt to change to the created build output directory so that
210 REM the generated files will be placed there, if needed.
211 REM
212 %__ECHO2% PUSHD "%BUILDDIR%"
213
214 IF ERRORLEVEL 1 (
215 ECHO Could not change to directory "%BUILDDIR%".
216 GOTO errors
217 )
218
219 SET NEED_POPD=1
220
221 REM
222 REM NOTE: If requested, setup the build environment to refer to the Windows
223 REM SDK v7.1A, which is required if the binaries are being built with
224 REM Visual Studio 201x and need to work on Windows XP.
@@ -233,32 +229,38 @@
229 )
230
231 %_VECHO% Path = '%PATH%'
232 %_VECHO% Include = '%INCLUDE%'
233 %_VECHO% Lib = '%LIB%'
234 %_VECHO% Tools = '%TOOLS%'
235 %_VECHO% Root = '%ROOT%'
236 %_VECHO% NmakeArgs = '%NMAKE_ARGS%'
237
238 REM
239 REM NOTE: Attempt to execute NMAKE for the Fossil MSVC makefile, passing
240 REM anything extra from our command line along (e.g. extra options).
241 REM Also, pass the base directory of the Fossil source tree as this
242 REM allows an out-of-source-tree build.
243 REM
244 %__ECHO% nmake /f "%TOOLS%\Makefile.msc" B="%ROOT%" %NMAKE_ARGS% %*
245
246 IF ERRORLEVEL 1 (
247 GOTO errors
248 )
249
250 REM
251 REM NOTE: Attempt to restore the previously saved directory, if needed.
252 REM
253 IF DEFINED NEED_POPD (
254 %__ECHO2% POPD
255
256 IF ERRORLEVEL 1 (
257 ECHO Could not restore directory.
258 GOTO errors
259 )
260
261 CALL :fn_UnsetVariable NEED_POPD
 
 
262 )
263
264 GOTO no_errors
265
266 :fn_UseV110Sdk71A
267

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button