4 :: build-all-msvc.bat --
\r
6 :: Multi-Platform Build Tool for MSVC
\r
10 REM This batch script is used to build the SQLite DLL for multiple platforms
\r
11 REM and configurations using MSVC. The built SQLite DLLs, their associated
\r
12 REM import libraries, and optionally their symbols files, are placed within
\r
13 REM the directory specified on the command line, in sub-directories named for
\r
14 REM their respective platforms and configurations. This batch script must be
\r
15 REM run from inside a Visual Studio Command Prompt for the desired version of
\r
16 REM Visual Studio ^(the initial platform configured for the command prompt does
\r
17 REM not really matter^). Exactly one command line argument is required, the
\r
18 REM name of an existing directory to be used as the final destination directory
\r
19 REM for the generated output files, which will be placed in sub-directories
\r
20 REM created therein. Ideally, the directory specified should be empty.
\r
24 REM CD /D C:\dev\sqlite\core
\r
25 REM tool\build-all-msvc.bat C:\Temp
\r
27 REM In the example above, "C:\dev\sqlite\core" represents the root of the
\r
28 REM source tree for SQLite and "C:\Temp" represents the final destination
\r
29 REM directory for the generated output files.
\r
31 REM Please note that the SQLite build process performed by the Makefile
\r
32 REM associated with this batch script requires a Tcl shell to be present
\r
33 REM in a directory contained in the PATH environment variable unless a
\r
34 REM pre-existing amalgamation file is used.
\r
36 REM There are several environment variables that may be set to modify the
\r
37 REM behavior of this batch script and its associated Makefile. The list of
\r
38 REM platforms to build may be overriden by using the PLATFORMS environment
\r
39 REM variable, which should contain a list of platforms ^(e.g. x86 x86_amd64
\r
40 REM x86_arm^). All platforms must be supported by the version of Visual Studio
\r
41 REM being used. The list of configurations to build may be overridden by
\r
42 REM setting the CONFIGURATIONS environment variable, which should contain a
\r
43 REM list of configurations to build ^(e.g. Debug Retail^). Neither of these
\r
44 REM variable values may contain any double quotes, surrounding or embedded.
\r
46 REM Finally, the NCRTLIBPATH, NUCRTLIBPATH, and NSDKLIBPATH environment
\r
47 REM variables may be set to specify the location of the CRT, Universal CRT, and
\r
48 REM Windows SDK, respectively, that may be needed to compile executables native
\r
49 REM to the architecture of the build machine during any cross-compilation that
\r
50 REM may be necessary, depending on the platforms to be built. These values in
\r
51 REM these three variables should be surrounded by double quotes if they contain
\r
54 REM There are a few other environment variables that impact the build process
\r
55 REM when set ^(to anything^), they are:
\r
59 REM When set, the "clean" target will not be used during each build iteration.
\r
60 REM However, the target binaries, if any, will still be deleted manually prior
\r
61 REM to being rebuilt. Setting this environment variable is only rarely needed
\r
62 REM and could cause issues in some circumstances; therefore, setting it is not
\r
67 REM When set, copying of symbol files ^(*.pdb^) created during the build will
\r
68 REM be skipped and they will not appear in the final destination directory.
\r
69 REM Setting this environment variable is never strictly needed and could cause
\r
70 REM issues in some circumstances; therefore, setting it is not recommended.
\r
74 REM When set, the command line shell will be built for each selected platform
\r
75 REM and configuration as well. In addition, the command line shell binaries
\r
76 REM will be copied, with their symbols, to the final destination directory.
\r
78 REM USE_WINV63_NSDKLIBPATH
\r
80 REM When set, modifies how the NSDKLIBPATH environment variable is built, based
\r
81 REM on the WindowsSdkDir environment variable. It forces this batch script to
\r
82 REM assume the Windows 8.1 SDK location should be used.
\r
84 REM USE_WINV100_NSDKLIBPATH
\r
86 REM When set, modifies how the NSDKLIBPATH environment variable is built, based
\r
87 REM on the WindowsSdkDir environment variable. It causes this batch script to
\r
88 REM assume the Windows 10.0 SDK location should be used.
\r
92 REM When set, the value is expanded and passed to the NMAKE command line, after
\r
93 REM its other arguments. This is used to specify additional NMAKE options, for
\r
96 REM SET NMAKE_ARGS=FOR_WINRT=1
\r
98 REM Using the above command before running this tool will cause the compiled
\r
99 REM binaries to target the WinRT environment, which provides a subset of the
\r
104 REM SET __ECHO=ECHO
\r
105 REM SET __ECHO2=ECHO
\r
106 REM SET __ECHO3=ECHO
\r
107 IF NOT DEFINED _AECHO (SET _AECHO=REM)
\r
108 IF NOT DEFINED _CECHO (SET _CECHO=REM)
\r
109 IF NOT DEFINED _VECHO (SET _VECHO=REM)
\r
112 IF DEFINED __ECHO SET REDIRECT=^^^>
\r
114 %_AECHO% Running %0 %*
\r
118 %_VECHO% DFlags = '%DFLAGS%'
\r
120 SET FFLAGS=/V /F /G /H /I /R /Y /Z
\r
122 %_VECHO% FFlags = '%FFLAGS%'
\r
125 SET ROOT=%ROOT:\\=\%
\r
127 %_VECHO% Root = '%ROOT%'
\r
130 REM NOTE: The first and only argument to this batch file should be the output
\r
131 REM directory where the platform-specific binary directories should be
\r
134 SET BINARYDIRECTORY=%1
\r
136 IF NOT DEFINED BINARYDIRECTORY (
\r
140 %_VECHO% BinaryDirectory = '%BINARYDIRECTORY%'
\r
149 REM NOTE: From this point, we need a clean error level. Reset it now.
\r
151 CALL :fn_ResetErrorLevel
\r
154 REM NOTE: Change the current directory to the root of the source tree, saving
\r
155 REM the current directory on the directory stack.
\r
157 %__ECHO2% PUSHD "%ROOT%"
\r
160 ECHO Could not change directory to "%ROOT%".
\r
165 REM NOTE: This batch file requires the ComSpec environment variable to be set,
\r
166 REM typically to something like "C:\Windows\System32\cmd.exe".
\r
168 IF NOT DEFINED ComSpec (
\r
169 ECHO The ComSpec environment variable must be defined.
\r
174 REM NOTE: This batch file requires the VcInstallDir environment variable to be
\r
175 REM set. Tyipcally, this means this batch file needs to be run from an
\r
176 REM MSVC command prompt.
\r
178 IF NOT DEFINED VCINSTALLDIR (
\r
179 ECHO The VCINSTALLDIR environment variable must be defined.
\r
184 REM NOTE: If the list of platforms is not already set, use the default list.
\r
186 IF NOT DEFINED PLATFORMS (
\r
187 SET PLATFORMS=x86 x86_amd64 x86_arm
\r
190 %_VECHO% Platforms = '%PLATFORMS%'
\r
193 REM NOTE: If the list of configurations is not already set, use the default
\r
196 IF NOT DEFINED CONFIGURATIONS (
\r
197 SET CONFIGURATIONS=Debug Retail
\r
200 %_VECHO% Configurations = '%CONFIGURATIONS%'
\r
203 REM NOTE: If the command used to invoke NMAKE is not already set, use the
\r
206 IF NOT DEFINED NMAKE_CMD (
\r
207 SET NMAKE_CMD=nmake -B -f Makefile.msc
\r
210 %_VECHO% NmakeCmd = '%NMAKE_CMD%'
\r
211 %_VECHO% NmakeArgs = '%NMAKE_ARGS%'
\r
214 REM NOTE: Setup environment variables to translate between the MSVC platform
\r
215 REM names and the names to be used for the platform-specific binary
\r
222 SET x86_amd64_NAME=x64
\r
223 SET x86_arm_NAME=ARM
\r
224 SET x86_x64_NAME=x64
\r
226 %_VECHO% amd64_Name = '%amd64_NAME%'
\r
227 %_VECHO% arm_Name = '%arm_NAME%'
\r
228 %_VECHO% x64_Name = '%x64_NAME%'
\r
229 %_VECHO% x86_Name = '%x86_NAME%'
\r
230 %_VECHO% x86_amd64_Name = '%x86_amd64_NAME%'
\r
231 %_VECHO% x86_arm_Name = '%x86_arm_NAME%'
\r
232 %_VECHO% x86_x64_Name = '%x86_x64_NAME%'
\r
235 REM NOTE: Check for the external tools needed during the build process ^(i.e.
\r
236 REM those that do not get compiled as part of the build process itself^)
\r
237 REM along the PATH.
\r
239 IF DEFINED TCLSH_CMD (
\r
240 SET TCLSH_FILE=%TCLSH_CMD%
\r
242 SET TCLSH_FILE=tclsh85.exe
\r
245 FOR %%T IN (%TCLSH_FILE%) DO (
\r
246 SET %%T_PATH=%%~dp$PATH:T
\r
250 REM NOTE: A Tcl shell executable is required during the SQLite build process
\r
251 REM unless a pre-existing amalgamation file is used.
\r
253 IF NOT DEFINED %TCLSH_FILE%_PATH (
\r
254 ECHO The Tcl shell executable "%TCLSH_FILE%" is required to be in the PATH.
\r
259 REM NOTE: Set the TOOLPATH variable to contain all the directories where the
\r
260 REM external tools were found in the search above.
\r
262 CALL :fn_CopyVariable %TCLSH_FILE%_PATH TOOLPATH
\r
264 %_VECHO% ToolPath = '%TOOLPATH%'
\r
267 REM NOTE: Setting the Windows SDK library path is only required for MSVC
\r
268 REM 2012, 2013, and 2015.
\r
270 CALL :fn_UnsetVariable SET_NSDKLIBPATH
\r
273 REM NOTE: Setting the Universal CRT library path is only required for MSVC
\r
276 CALL :fn_UnsetVariable SET_NUCRTLIBPATH
\r
279 REM NOTE: Check for MSVC 2012, 2013, and 2015 specially because the Windows
\r
280 REM SDK directory handling is slightly different for those versions.
\r
282 IF "%VisualStudioVersion%" == "11.0" (
\r
284 REM NOTE: If the Windows SDK library path has already been set, do not set
\r
285 REM it to something else later on.
\r
287 IF NOT DEFINED NSDKLIBPATH (
\r
288 SET SET_NSDKLIBPATH=1
\r
290 ) ELSE IF "%VisualStudioVersion%" == "12.0" (
\r
292 REM NOTE: If the Windows SDK library path has already been set, do not set
\r
293 REM it to something else later on.
\r
295 IF NOT DEFINED NSDKLIBPATH (
\r
296 SET SET_NSDKLIBPATH=1
\r
298 ) ELSE IF "%VisualStudioVersion%" == "14.0" (
\r
300 REM NOTE: If the Windows SDK library path has already been set, do not set
\r
301 REM it to something else later on.
\r
303 IF NOT DEFINED NSDKLIBPATH (
\r
304 SET SET_NSDKLIBPATH=1
\r
308 REM NOTE: If the Universal CRT library path has already been set, do not set
\r
309 REM it to something else later on.
\r
311 IF NOT DEFINED NUCRTLIBPATH (
\r
312 SET SET_NUCRTLIBPATH=1
\r
317 REM NOTE: This is the name of the sub-directory where the UCRT libraries may
\r
318 REM be found. It is only used when compiling against the UCRT.
\r
320 IF DEFINED UCRTVersion (
\r
321 SET NUCRTVER=%UCRTVersion%
\r
323 SET NUCRTVER=10.0.10586.0
\r
327 REM NOTE: This is the name of the sub-directory where the Windows 10.0 SDK
\r
328 REM libraries may be found. It is only used when compiling with the
\r
329 REM Windows 10.0 SDK.
\r
331 IF DEFINED WindowsSDKLibVersion (
\r
332 SET WIN10SDKVER=%WindowsSDKLibVersion:\=%
\r
334 SET WIN10SDKVER=%NUCRTVER%
\r
338 REM NOTE: Check if this is the Windows Phone SDK. If so, a different batch
\r
339 REM file is necessary to setup the build environment. Since the variable
\r
340 REM values involved here may contain parenthesis, using GOTO instead of
\r
341 REM an IF block is required.
\r
343 IF DEFINED WindowsPhoneKitDir GOTO set_vcvarsall_phone
\r
344 SET VCVARSALL=%VCINSTALLDIR%\vcvarsall.bat
\r
345 GOTO set_vcvarsall_done
\r
346 :set_vcvarsall_phone
\r
347 SET VCVARSALL=%VCINSTALLDIR%\WPSDK\WP80\vcvarsphoneall.bat
\r
348 :set_vcvarsall_done
\r
349 SET VCVARSALL=%VCVARSALL:\\=\%
\r
352 REM NOTE: This is the outer loop. There should be exactly one iteration per
\r
355 FOR %%P IN (%PLATFORMS%) DO (
\r
357 REM NOTE: Using the MSVC platform name, lookup the simpler platform name to
\r
358 REM be used for the name of the platform-specific binary directory via
\r
359 REM the environment variables setup earlier.
\r
361 CALL :fn_CopyVariable %%P_NAME PLATFORMNAME
\r
364 REM NOTE: This is the second loop. There should be exactly one iteration.
\r
365 REM This loop is necessary because the PlatformName environment
\r
366 REM variable was set above and that value is needed by some of the
\r
367 REM commands contained in the inner loop. If these commands were
\r
368 REM directly contained in the outer loop, the PlatformName environment
\r
369 REM variable would be stuck with its initial empty value instead.
\r
371 FOR /F "tokens=2* delims==" %%D IN ('SET PLATFORMNAME') DO (
\r
373 REM NOTE: Attempt to clean the environment of all variables used by MSVC
\r
374 REM and/or Visual Studio. This block may need to be updated in the
\r
375 REM future to account for additional environment variables.
\r
377 CALL :fn_UnsetVariable CommandPromptType
\r
378 CALL :fn_UnsetVariable DevEnvDir
\r
379 CALL :fn_UnsetVariable DNX_HOME
\r
380 CALL :fn_UnsetVariable ExtensionSdkDir
\r
381 CALL :fn_UnsetVariable Framework35Version
\r
382 CALL :fn_UnsetVariable Framework40Version
\r
383 CALL :fn_UnsetVariable FrameworkDir
\r
384 CALL :fn_UnsetVariable FrameworkDir32
\r
385 CALL :fn_UnsetVariable FrameworkVersion
\r
386 CALL :fn_UnsetVariable FrameworkVersion32
\r
387 CALL :fn_UnsetVariable FSHARPINSTALLDIR
\r
388 CALL :fn_UnsetVariable INCLUDE
\r
389 CALL :fn_UnsetVariable LIB
\r
390 CALL :fn_UnsetVariable LIBPATH
\r
391 CALL :fn_UnsetVariable NETFXSDKDir
\r
392 CALL :fn_UnsetVariable Platform
\r
393 CALL :fn_UnsetVariable UCRTVersion
\r
394 CALL :fn_UnsetVariable UniversalCRTSdkDir
\r
395 REM CALL :fn_UnsetVariable VCINSTALLDIR
\r
396 CALL :fn_UnsetVariable VSINSTALLDIR
\r
397 CALL :fn_UnsetVariable WindowsLibPath
\r
398 CALL :fn_UnsetVariable WindowsPhoneKitDir
\r
399 CALL :fn_UnsetVariable WindowsSdkDir
\r
400 CALL :fn_UnsetVariable WindowsSdkDir_35
\r
401 CALL :fn_UnsetVariable WindowsSdkDir_old
\r
402 CALL :fn_UnsetVariable WindowsSDKLibVersion
\r
403 CALL :fn_UnsetVariable WindowsSDKVersion
\r
404 CALL :fn_UnsetVariable WindowsSDK_ExecutablePath_x86
\r
405 CALL :fn_UnsetVariable WindowsSDK_ExecutablePath_x64
\r
408 REM NOTE: Reset the PATH here to the absolute bare minimum required.
\r
410 SET PATH=%TOOLPATH%;%SystemRoot%\System32;%SystemRoot%
\r
413 REM NOTE: This is the inner loop. There are normally two iterations, one
\r
414 REM for each supported build configuration, e.g. Debug or Retail.
\r
416 FOR %%B IN (%CONFIGURATIONS%) DO (
\r
418 REM NOTE: When preparing the debug build, set the DEBUG and MEMDEBUG
\r
419 REM environment variables to be picked up by the MSVC makefile
\r
422 %_AECHO% Building the %%B configuration for platform %%P with name %%D...
\r
424 IF /I "%%B" == "Debug" (
\r
426 REM NOTE: Using this level for the DEBUG environment variable should
\r
427 REM disable all compiler optimizations and prevent use of the
\r
428 REM NDEBUG define. Additionally, both SQLITE_ENABLE_API_ARMOR
\r
429 REM and SQLITE_DEBUG defines should be enabled.
\r
434 REM NOTE: Setting this to non-zero should enable the SQLITE_MEMDEBUG
\r
439 CALL :fn_UnsetVariable DEBUG
\r
440 CALL :fn_UnsetVariable MEMDEBUG
\r
444 REM NOTE: Launch a nested command shell to perform the following steps:
\r
446 REM 1. Setup the MSVC environment for this platform using the
\r
447 REM official batch file.
\r
449 REM 2. Make sure that no stale build output files are present.
\r
451 REM 3. Build the "sqlite3.dll" and "sqlite3.lib" binaries for this
\r
454 REM 4. Copy the "sqlite3.dll" and "sqlite3.lib" binaries for this
\r
455 REM platform to the platform-specific directory beneath the
\r
456 REM binary directory.
\r
458 REM 5. Unless prevented from doing so, copy the "sqlite3.pdb"
\r
459 REM symbols file for this platform to the platform-specific
\r
460 REM directory beneath the binary directory.
\r
464 REM NOTE: Attempt to setup the MSVC environment for this platform.
\r
466 %__ECHO3% CALL "%VCVARSALL%" %%P
\r
469 ECHO Failed to call "%VCVARSALL%" for platform %%P.
\r
474 REM NOTE: If this batch file is not running in "what-if" mode, check to
\r
475 REM be sure we were actually able to setup the MSVC environment
\r
476 REM as current versions of their official batch file do not set
\r
477 REM the exit code upon failure.
\r
479 IF NOT DEFINED __ECHO3 (
\r
480 IF NOT DEFINED WindowsPhoneKitDir (
\r
481 IF NOT DEFINED WindowsSdkDir (
\r
482 ECHO Cannot build, Windows SDK not found for platform %%P.
\r
489 REM NOTE: When using MSVC 2012, 2013, or 2015, the native SDK path
\r
490 REM cannot simply be the "lib" sub-directory beneath the location
\r
491 REM specified in the WindowsSdkDir environment variable because
\r
492 REM that location does not actually contain the necessary library
\r
493 REM files for x86. This must be done for each iteration because
\r
494 REM it relies upon the WindowsSdkDir environment variable being
\r
495 REM set by the batch file used to setup the MSVC environment.
\r
497 IF DEFINED SET_NSDKLIBPATH (
\r
499 REM NOTE: The Windows Phone SDK has a slightly different directory
\r
500 REM structure and must be handled specially here.
\r
502 IF DEFINED WindowsPhoneKitDir (
\r
503 CALL :fn_CopyVariable WindowsPhoneKitDir NSDKLIBPATH
\r
504 CALL :fn_AppendVariable NSDKLIBPATH \lib\x86
\r
505 ) ELSE IF DEFINED WindowsSdkDir (
\r
506 CALL :fn_CopyVariable WindowsSdkDir NSDKLIBPATH
\r
509 REM NOTE: The Windows 8.x and Windows 10.0 SDKs have a slightly
\r
510 REM different directory naming conventions.
\r
512 IF DEFINED USE_WINV100_NSDKLIBPATH (
\r
513 CALL :fn_AppendVariable NSDKLIBPATH \..\10\lib\%WIN10SDKVER%\um\x86
\r
514 CALL :fn_CopyVariable WindowsSdkDir PSDKLIBPATH
\r
515 CALL :fn_AppendVariable PSDKLIBPATH lib\%WIN10SDKVER%\um\%%D
\r
516 ) ELSE IF DEFINED USE_WINV63_NSDKLIBPATH (
\r
517 CALL :fn_AppendVariable NSDKLIBPATH \lib\winv6.3\um\x86
\r
518 ) ELSE IF "%VisualStudioVersion%" == "12.0" (
\r
519 CALL :fn_AppendVariable NSDKLIBPATH \..\8.0\lib\win8\um\x86
\r
520 ) ELSE IF "%VisualStudioVersion%" == "14.0" (
\r
521 CALL :fn_AppendVariable NSDKLIBPATH \..\8.0\lib\win8\um\x86
\r
523 CALL :fn_AppendVariable NSDKLIBPATH \lib\win8\um\x86
\r
529 REM NOTE: When using MSVC 2015, setting the Universal CRT library path
\r
530 REM for x86 may be required as well. This must also be done for
\r
531 REM each iteration because it relies upon the UniversalCRTSdkDir
\r
532 REM environment variable being set by the batch file used to
\r
533 REM setup the MSVC environment.
\r
535 IF DEFINED SET_NUCRTLIBPATH (
\r
536 IF DEFINED UniversalCRTSdkDir (
\r
537 CALL :fn_CopyVariable UniversalCRTSdkDir NUCRTLIBPATH
\r
538 CALL :fn_AppendVariable NUCRTLIBPATH \lib\%NUCRTVER%\ucrt\x86
\r
543 REM NOTE: Unless prevented from doing so, invoke NMAKE with the MSVC
\r
544 REM makefile to clean any stale build output from previous
\r
545 REM iterations of this loop and/or previous runs of this batch
\r
548 IF NOT DEFINED NOCLEAN (
\r
549 %__ECHO% %NMAKE_CMD% clean
\r
552 ECHO Failed to clean for platform %%P.
\r
557 REM NOTE: Even when the cleaning step has been disabled, we still
\r
558 REM need to remove the build output for all the files we are
\r
559 REM specifically wanting to build for each platform.
\r
561 %_AECHO% Cleaning final core library output files only...
\r
562 %__ECHO% DEL /Q *.lo sqlite3.dll sqlite3.lib sqlite3.pdb 2%REDIRECT% NUL
\r
566 REM NOTE: Call NMAKE with the MSVC makefile to build the "sqlite3.dll"
\r
567 REM binary. The x86 compiler will be used to compile the native
\r
568 REM command line tools needed during the build process itself.
\r
569 REM Also, disable looking for and/or linking to the native Tcl
\r
570 REM runtime library.
\r
572 %__ECHO% %NMAKE_CMD% sqlite3.dll XCOMPILE=1 USE_NATIVE_LIBPATHS=1 NO_TCL=1 %NMAKE_ARGS%
\r
575 ECHO Failed to build %%B "sqlite3.dll" for platform %%P.
\r
580 REM NOTE: Copy the "sqlite3.dll" file to the appropriate directory for
\r
581 REM the build and platform beneath the binary directory.
\r
583 %__ECHO% XCOPY sqlite3.dll "%BINARYDIRECTORY%\%%B\%%D\" %FFLAGS% %DFLAGS%
\r
586 ECHO Failed to copy "sqlite3.dll" to "%BINARYDIRECTORY%\%%B\%%D\".
\r
591 REM NOTE: Copy the "sqlite3.lib" file to the appropriate directory for
\r
592 REM the build and platform beneath the binary directory.
\r
594 %__ECHO% XCOPY sqlite3.lib "%BINARYDIRECTORY%\%%B\%%D\" %FFLAGS% %DFLAGS%
\r
597 ECHO Failed to copy "sqlite3.lib" to "%BINARYDIRECTORY%\%%B\%%D\".
\r
602 REM NOTE: Copy the "sqlite3.pdb" file to the appropriate directory for
\r
603 REM the build and platform beneath the binary directory unless we
\r
604 REM are prevented from doing so.
\r
606 IF NOT DEFINED NOSYMBOLS (
\r
607 %__ECHO% XCOPY sqlite3.pdb "%BINARYDIRECTORY%\%%B\%%D\" %FFLAGS% %DFLAGS%
\r
610 ECHO Failed to copy "sqlite3.pdb" to "%BINARYDIRECTORY%\%%B\%%D\".
\r
616 REM NOTE: If requested, also build the shell executable.
\r
618 IF DEFINED BUILD_ALL_SHELL (
\r
620 REM NOTE: If necessary, make sure any previous build output for the
\r
621 REM shell executable is deleted.
\r
623 IF DEFINED NOCLEAN (
\r
625 REM NOTE: Even when the cleaning step has been disabled, we still
\r
626 REM need to remove the build output for all the files we are
\r
627 REM specifically wanting to build for each platform.
\r
629 %_AECHO% Cleaning final shell executable output files only...
\r
630 %__ECHO% DEL /Q sqlite3.exe sqlite3sh.pdb 2%REDIRECT% NUL
\r
634 REM NOTE: Call NMAKE with the MSVC makefile to build the "sqlite3.exe"
\r
635 REM binary. The x86 compiler will be used to compile the native
\r
636 REM command line tools needed during the build process itself.
\r
637 REM Also, disable looking for and/or linking to the native Tcl
\r
638 REM runtime library.
\r
640 %__ECHO% %NMAKE_CMD% sqlite3.exe XCOMPILE=1 USE_NATIVE_LIBPATHS=1 NO_TCL=1 %NMAKE_ARGS%
\r
643 ECHO Failed to build %%B "sqlite3.exe" for platform %%P.
\r
648 REM NOTE: Copy the "sqlite3.exe" file to the appropriate directory
\r
649 REM for the build and platform beneath the binary directory.
\r
651 %__ECHO% XCOPY sqlite3.exe "%BINARYDIRECTORY%\%%B\%%D\" %FFLAGS% %DFLAGS%
\r
654 ECHO Failed to copy "sqlite3.exe" to "%BINARYDIRECTORY%\%%B\%%D\".
\r
659 REM NOTE: Copy the "sqlite3sh.pdb" file to the appropriate directory
\r
660 REM for the build and platform beneath the binary directory
\r
661 REM unless we are prevented from doing so.
\r
663 IF NOT DEFINED NOSYMBOLS (
\r
664 %__ECHO% XCOPY sqlite3sh.pdb "%BINARYDIRECTORY%\%%B\%%D\" %FFLAGS% %DFLAGS%
\r
667 ECHO Failed to copy "sqlite3sh.pdb" to "%BINARYDIRECTORY%\%%B\%%D\".
\r
677 REM NOTE: Handle any errors generated during the nested command shell.
\r
685 REM NOTE: Restore the saved current directory from the directory stack.
\r
690 ECHO Could not restore directory.
\r
695 REM NOTE: If we get to this point, we have succeeded.
\r
701 SET __ECHO_CMD=ECHO %%%2%%
\r
702 FOR /F "delims=" %%V IN ('%__ECHO_CMD%') DO (
\r
703 IF NOT "%%V" == "" (
\r
704 IF NOT "%%V" == "%%%2%%" (
\r
705 %_VECHO% %1 = '%%V'
\r
712 :fn_ResetErrorLevel
\r
717 VERIFY MAYBE 2> NUL
\r
721 IF NOT DEFINED %1 GOTO :EOF
\r
722 IF "%2" == "" GOTO :EOF
\r
724 SET __ECHO_CMD=ECHO %%%1%%
\r
725 FOR /F "delims=" %%V IN ('%__ECHO_CMD%') DO (
\r
728 ENDLOCAL && SET %2=%VALUE%
\r
741 CALL :fn_ResetErrorLevel
\r
745 SET __ECHO_CMD=ECHO %%%1%%
\r
747 FOR /F "delims=" %%V IN ('%__ECHO_CMD%') DO (
\r
754 CALL :fn_ResetErrorLevel
\r
759 ECHO Usage: %~nx0 ^<binaryDirectory^>
\r
764 CALL :fn_SetErrorLevel
\r
767 ECHO Failure, errors were encountered.
\r
771 CALL :fn_ResetErrorLevel
\r
774 ECHO Success, no errors were encountered.
\r
778 %__ECHO% EXIT /B %ERRORLEVEL%
\r