2 # nmake Makefile for SQLite
4 ###############################################################################
5 ############################## START OF OPTIONS ###############################
6 ###############################################################################
8 # The toplevel directory of the source tree. This is the directory
9 # that contains this "Makefile.msc".
14 # Set this non-0 to create and use the SQLite amalgamation file.
16 !IFNDEF USE_AMALGAMATION
21 # Set this non-0 to enable full warnings (-W4, etc) when compiling.
27 # Set this non-0 to enable full runtime error checks (-RTC1, etc). This
28 # has no effect if (any) optimizations are enabled.
30 !IFNDEF USE_RUNTIME_CHECKS
31 USE_RUNTIME_CHECKS = 0
34 # Set this non-0 to use "stdcall" calling convention for the core library
35 # and shell executable.
41 # Set this non-0 to have the shell executable link against the core dynamic
48 # Set this non-0 to enable extra code that attempts to detect misuse of the
55 # If necessary, create a list of harmless compiler warnings to disable when
56 # compiling the various tools. For the SQLite source code itself, warnings,
57 # if any, will be disabled from within it.
60 !IF $(USE_FULLWARN)!=0
61 NO_WARN = -wd4054 -wd4055 -wd4100 -wd4127 -wd4130 -wd4152 -wd4189 -wd4206
62 NO_WARN = $(NO_WARN) -wd4210 -wd4232 -wd4305 -wd4306 -wd4702 -wd4706
66 # Set this non-0 to use the library paths and other options necessary for
73 # Set this non-0 to split the SQLite amalgamation file into chunks to
74 # be used for debugging with Visual Studio.
76 !IFNDEF SPLIT_AMALGAMATION
77 SPLIT_AMALGAMATION = 0
81 # Set this non-0 to use the International Components for Unicode (ICU).
88 # Set this non-0 to dynamically link to the MSVC runtime library.
94 # Set this non-0 to link to the RPCRT4 library.
96 !IFNDEF USE_RPCRT4_LIB
100 # Set this non-0 to generate assembly code listings for the source code
107 # Set this non-0 to attempt setting the native compiler automatically
108 # for cross-compiling the command line tools needed during the compilation
115 # Set this non-0 to use the native libraries paths for cross-compiling
116 # the command line tools needed during the compilation process.
118 !IFNDEF USE_NATIVE_LIBPATHS
119 USE_NATIVE_LIBPATHS = 0
122 # Set this 0 to skip the compiling and embedding of version resources.
128 # Set this non-0 to compile binaries suitable for the WinRT environment.
129 # This setting does not apply to any binaries that require Tcl to operate
130 # properly (i.e. the text fixture, etc).
136 # Set this non-0 to compile binaries suitable for the UWP environment.
137 # This setting does not apply to any binaries that require Tcl to operate
138 # properly (i.e. the text fixture, etc).
144 # Set this non-0 to compile binaries suitable for the Windows 10 platform.
151 # Set this non-0 to skip attempting to look for and/or link with the Tcl
159 # Set this to non-0 to create and use PDBs.
165 # Set this to non-0 to use the SQLite debugging heap subsystem.
171 # Set this to non-0 to use the Win32 native heap subsystem.
177 # Set this to non-0 to enable OSTRACE() macros, which can be useful when
184 # Set this to one of the following values to enable various debugging
185 # features. Each level includes the debugging options from the previous
186 # levels. Currently, the recognized values for DEBUG are:
188 # 0 == NDEBUG: Disables assert() and other runtime diagnostics.
189 # 1 == SQLITE_ENABLE_API_ARMOR: extra attempts to detect misuse of the API.
190 # 2 == Disables NDEBUG and all optimizations and then enables PDBs.
191 # 3 == SQLITE_DEBUG: Enables various diagnostics messages and code.
192 # 4 == SQLITE_WIN32_MALLOC_VALIDATE: Validate the Win32 native heap per call.
193 # 5 == SQLITE_DEBUG_OS_TRACE: Enables output from the OSTRACE() macros.
194 # 6 == SQLITE_ENABLE_IOTRACE: Enables output from the IOTRACE() macros.
200 # Enable use of available compiler optimizations? Normally, this should be
201 # non-zero. Setting this to zero, thus disabling all compiler optimizations,
202 # can be useful for testing.
204 !IFNDEF OPTIMIZATIONS
208 # Set this to non-0 to enable support for the session extension.
214 # Set the source code file to be used by executables and libraries when
215 # they need the amalgamation.
218 !IF $(SPLIT_AMALGAMATION)!=0
219 SQLITE3C = sqlite3-all.c
225 # Set the include code file to be used by executables and libraries when
232 # This is the name to use for the SQLite dynamic link library (DLL).
236 SQLITE3DLL = winsqlite3.dll
238 SQLITE3DLL = sqlite3.dll
242 # This is the name to use for the SQLite import library (LIB).
246 SQLITE3LIB = winsqlite3.lib
248 SQLITE3LIB = sqlite3.lib
252 # This is the name to use for the SQLite shell executable (EXE).
256 SQLITE3EXE = winsqlite3shell.exe
258 SQLITE3EXE = sqlite3.exe
262 # This is the argument used to set the program database (PDB) file for the
263 # SQLite shell executable (EXE).
265 !IFNDEF SQLITE3EXEPDB
269 SQLITE3EXEPDB = /pdb:sqlite3sh.pdb
273 # These are the "standard" SQLite compilation options used when compiling for
274 # the Windows platform.
276 !IFNDEF OPT_FEATURE_FLAGS
277 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS3=1
278 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RTREE=1
279 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_COLUMN_METADATA=1
282 # Should the session extension be enabled? If so, add compilation options
286 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_SESSION=1
287 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_PREUPDATE_HOOK=1
290 # These are the "extended" SQLite compilation options used when compiling for
291 # the Windows 10 platform.
293 !IFNDEF EXT_FEATURE_FLAGS
295 EXT_FEATURE_FLAGS = $(EXT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS4=1
296 EXT_FEATURE_FLAGS = $(EXT_FEATURE_FLAGS) -DSQLITE_SYSTEM_MALLOC=1
297 EXT_FEATURE_FLAGS = $(EXT_FEATURE_FLAGS) -DSQLITE_OMIT_LOCALTIME=1
303 ###############################################################################
304 ############################### END OF OPTIONS ################################
305 ###############################################################################
307 # When compiling for the Windows 10 platform, the PLATFORM macro must be set
308 # to an appropriate value (e.g. x86, x64, arm, arm64, etc).
312 !ERROR Using the FOR_WIN10 option requires a value for PLATFORM.
316 # This assumes that MSVC is always installed in 32-bit Program Files directory
317 # and sets the variable for use in locating other 32-bit installs accordingly.
319 PROGRAMFILES_X86 = $(VCINSTALLDIR)\..\..
320 PROGRAMFILES_X86 = $(PROGRAMFILES_X86:\\=\)
322 # Check for the predefined command macro CC. This should point to the compiler
323 # binary for the target platform. If it is not defined, simply define it to
324 # the legacy default value 'cl.exe'.
330 # Check for the predefined command macro CSC. This should point to a working
331 # C Sharp compiler binary. If it is not defined, simply define it to the
332 # legacy default value 'csc.exe'.
338 # Check for the command macro LD. This should point to the linker binary for
339 # the target platform. If it is not defined, simply define it to the legacy
340 # default value 'link.exe'.
346 # Check for the predefined command macro RC. This should point to the resource
347 # compiler binary for the target platform. If it is not defined, simply define
348 # it to the legacy default value 'rc.exe'.
354 # Check for the MSVC runtime library path macro. Otherwise, this value will
355 # default to the 'lib' directory underneath the MSVC installation directory.
358 CRTLIBPATH = $(VCINSTALLDIR)\lib
361 CRTLIBPATH = $(CRTLIBPATH:\\=\)
363 # Check for the command macro NCC. This should point to the compiler binary
364 # for the platform the compilation process is taking place on. If it is not
365 # defined, simply define it to have the same value as the CC macro. When
366 # cross-compiling, it is suggested that this macro be modified via the command
367 # line (since nmake itself does not provide a built-in method to guess it).
368 # For example, to use the x86 compiler when cross-compiling for x64, a command
369 # line similar to the following could be used (all on one line):
371 # nmake /f Makefile.msc sqlite3.dll
372 # XCOMPILE=1 USE_NATIVE_LIBPATHS=1
374 # Alternatively, the full path and file name to the compiler binary for the
375 # platform the compilation process is taking place may be specified (all on
378 # nmake /f Makefile.msc sqlite3.dll
379 # "NCC=""%VCINSTALLDIR%\bin\cl.exe"""
380 # USE_NATIVE_LIBPATHS=1
384 !ELSEIF $(XCOMPILE)!=0
385 NCC = "$(VCINSTALLDIR)\bin\$(CC)"
391 # Check for the MSVC native runtime library path macro. Otherwise,
392 # this value will default to the 'lib' directory underneath the MSVC
393 # installation directory.
396 NCRTLIBPATH = $(VCINSTALLDIR)\lib
399 NCRTLIBPATH = $(NCRTLIBPATH:\\=\)
401 # Check for the Platform SDK library path macro. Otherwise, this
402 # value will default to the 'lib' directory underneath the Windows
403 # SDK installation directory (the environment variable used appears
404 # to be available when using Visual C++ 2008 or later via the
408 NSDKLIBPATH = $(WINDOWSSDKDIR)\lib
411 NSDKLIBPATH = $(NSDKLIBPATH:\\=\)
413 # Check for the UCRT library path macro. Otherwise, this value will
414 # default to the version-specific, platform-specific 'lib' directory
415 # underneath the Windows SDK installation directory.
418 UCRTLIBPATH = $(WINDOWSSDKDIR)\lib\$(WINDOWSSDKLIBVERSION)\ucrt\$(PLATFORM)
421 UCRTLIBPATH = $(UCRTLIBPATH:\\=\)
423 # C compiler and options for use in building executables that
424 # will run on the platform that is doing the build.
426 !IF $(USE_FULLWARN)!=0
427 BCC = $(NCC) -nologo -W4 $(CCOPTS) $(BCCOPTS)
429 BCC = $(NCC) -nologo -W3 $(CCOPTS) $(BCCOPTS)
432 # Check if assembly code listings should be generated for the source
433 # code files to be compiled.
435 !IF $(USE_LISTINGS)!=0
439 # Check if the native library paths should be used when compiling
440 # the command line tools used during the compilation process. If
441 # so, set the necessary macro now.
443 !IF $(USE_NATIVE_LIBPATHS)!=0
444 NLTLIBPATHS = "/LIBPATH:$(NCRTLIBPATH)" "/LIBPATH:$(NSDKLIBPATH)"
447 NUCRTLIBPATH = $(NUCRTLIBPATH:\\=\)
448 NLTLIBPATHS = $(NLTLIBPATHS) "/LIBPATH:$(NUCRTLIBPATH)"
452 # C compiler and options for use in building executables that
453 # will run on the target platform. (BCC and TCC are usually the
454 # same unless your are cross-compiling.)
456 !IF $(USE_FULLWARN)!=0
457 TCC = $(CC) -nologo -W4 -DINCLUDE_MSVC_H=1 $(CCOPTS) $(TCCOPTS)
459 TCC = $(CC) -nologo -W3 $(CCOPTS) $(TCCOPTS)
462 TCC = $(TCC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) -I$(TOP)\src -fp:precise
463 RCC = $(RC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) -I$(TOP)\src $(RCOPTS) $(RCCOPTS)
465 # Check if we want to use the "stdcall" calling convention when compiling.
466 # This is not supported by the compilers for non-x86 platforms. It should
467 # also be noted here that building any target with these "stdcall" options
468 # will most likely fail if the Tcl library is also required. This is due
469 # to how the Tcl library functions are declared and exported (i.e. without
470 # an explicit calling convention, which results in "cdecl").
472 !IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
473 !IF "$(PLATFORM)"=="x86"
474 CORE_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
475 SHELL_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
477 TEST_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall -DINCLUDE_SQLITE_TCL_H=1 -DSQLITE_TCLAPI=__cdecl
481 CORE_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
482 SHELL_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
484 TEST_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall -DINCLUDE_SQLITE_TCL_H=1 -DSQLITE_TCLAPI=__cdecl
502 # These are additional compiler options used for the core library.
504 !IFNDEF CORE_COMPILE_OPTS
505 !IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
506 CORE_COMPILE_OPTS = $(CORE_CCONV_OPTS) -DSQLITE_API=__declspec(dllexport)
508 CORE_COMPILE_OPTS = $(CORE_CCONV_OPTS)
512 # These are the additional targets that the core library should depend on
515 !IFNDEF CORE_LINK_DEP
516 !IF $(DYNAMIC_SHELL)!=0
518 !ELSEIF $(FOR_WIN10)==0 || "$(PLATFORM)"=="x86"
519 CORE_LINK_DEP = sqlite3.def
525 # These are additional linker options used for the core library.
527 !IFNDEF CORE_LINK_OPTS
528 !IF $(DYNAMIC_SHELL)!=0
530 !ELSEIF $(FOR_WIN10)==0 || "$(PLATFORM)"=="x86"
531 CORE_LINK_OPTS = /DEF:sqlite3.def
537 # These are additional compiler options used for the shell executable.
539 !IFNDEF SHELL_COMPILE_OPTS
540 !IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
541 SHELL_COMPILE_OPTS = $(SHELL_CCONV_OPTS) -DSQLITE_API=__declspec(dllimport)
543 SHELL_COMPILE_OPTS = $(SHELL_CCONV_OPTS)
547 # This is the source code that the shell executable should be compiled
550 !IFNDEF SHELL_CORE_SRC
551 !IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
554 SHELL_CORE_SRC = $(SQLITE3C)
558 # This is the core library that the shell executable should depend on.
560 !IFNDEF SHELL_CORE_DEP
561 !IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
562 SHELL_CORE_DEP = $(SQLITE3DLL)
568 # This is the core library that the shell executable should link with.
570 !IFNDEF SHELL_CORE_LIB
571 !IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
572 SHELL_CORE_LIB = $(SQLITE3LIB)
578 # These are additional linker options used for the shell executable.
580 !IFNDEF SHELL_LINK_OPTS
581 SHELL_LINK_OPTS = $(SHELL_CORE_LIB)
584 # Check if assembly code listings should be generated for the source
585 # code files to be compiled.
587 !IF $(USE_LISTINGS)!=0
591 # When compiling the library for use in the WinRT environment,
592 # the following compile-time options must be used as well to
593 # disable use of Win32 APIs that are not available and to enable
594 # use of Win32 APIs that are specific to Windows 8 and/or WinRT.
597 TCC = $(TCC) -DSQLITE_OS_WINRT=1
598 RCC = $(RCC) -DSQLITE_OS_WINRT=1
599 TCC = $(TCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
600 RCC = $(RCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
603 # C compiler options for the Windows 10 platform (needs MSVC 2015).
606 TCC = $(TCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
607 BCC = $(BCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
610 # Also, we need to dynamically link to the correct MSVC runtime
611 # when compiling for WinRT (e.g. debug or release) OR if the
612 # USE_CRT_DLL option is set to force dynamically linking to the
613 # MSVC runtime library.
615 !IF $(FOR_WINRT)!=0 || $(USE_CRT_DLL)!=0
634 # The mksqlite3c.tcl and mksqlite3h.tcl scripts will pull in
635 # any extension header files by default. For non-amalgamation
636 # builds, we need to make sure the compiler can find these.
638 !IF $(USE_AMALGAMATION)==0
639 TCC = $(TCC) -I$(TOP)\ext\fts3
640 RCC = $(RCC) -I$(TOP)\ext\fts3
641 TCC = $(TCC) -I$(TOP)\ext\rtree
642 RCC = $(RCC) -I$(TOP)\ext\rtree
643 TCC = $(TCC) -I$(TOP)\ext\session
644 RCC = $(RCC) -I$(TOP)\ext\session
647 # The mksqlite3c.tcl script accepts some options on the command
648 # line. When compiling with debugging enabled, some of these
649 # options are necessary in order to allow debugging symbols to
650 # work correctly with Visual Studio when using the amalgamation.
652 !IFNDEF MKSQLITE3C_ARGS
654 MKSQLITE3C_ARGS = --linemacros
661 # Define -DNDEBUG to compile without debugging (i.e., for production usage)
662 # Omitting the define will cause extra debugging code to be inserted and
663 # includes extra comments when "EXPLAIN stmt" is used.
666 TCC = $(TCC) -DNDEBUG
667 BCC = $(BCC) -DNDEBUG
668 RCC = $(RCC) -DNDEBUG
671 !IF $(DEBUG)>0 || $(API_ARMOR)!=0 || $(FOR_WIN10)!=0
672 TCC = $(TCC) -DSQLITE_ENABLE_API_ARMOR=1
673 RCC = $(RCC) -DSQLITE_ENABLE_API_ARMOR=1
677 TCC = $(TCC) -DSQLITE_DEBUG=1
678 RCC = $(RCC) -DSQLITE_DEBUG=1
681 !IF $(DEBUG)>4 || $(OSTRACE)!=0
682 TCC = $(TCC) -DSQLITE_FORCE_OS_TRACE=1 -DSQLITE_DEBUG_OS_TRACE=1
683 RCC = $(RCC) -DSQLITE_FORCE_OS_TRACE=1 -DSQLITE_DEBUG_OS_TRACE=1
687 TCC = $(TCC) -DSQLITE_ENABLE_IOTRACE=1
688 RCC = $(RCC) -DSQLITE_ENABLE_IOTRACE=1
691 # Prevent warnings about "insecure" MSVC runtime library functions
694 TCC = $(TCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
695 BCC = $(BCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
696 RCC = $(RCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
698 # Prevent warnings about "deprecated" POSIX functions being used.
700 TCC = $(TCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
701 BCC = $(BCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
702 RCC = $(RCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
704 # Use the SQLite debugging heap subsystem?
707 TCC = $(TCC) -DSQLITE_MEMDEBUG=1
708 RCC = $(RCC) -DSQLITE_MEMDEBUG=1
710 # Use native Win32 heap subsystem instead of malloc/free?
712 !ELSEIF $(WIN32HEAP)!=0
713 TCC = $(TCC) -DSQLITE_WIN32_MALLOC=1
714 RCC = $(RCC) -DSQLITE_WIN32_MALLOC=1
716 # Validate the heap on every call into the native Win32 heap subsystem?
719 TCC = $(TCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1
720 RCC = $(RCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1
725 # The locations of the Tcl header and library files. Also, the library that
726 # non-stubs enabled programs using Tcl must link against. These variables
727 # (TCLINCDIR, TCLLIBDIR, and LIBTCL) may be overridden via the environment
728 # prior to running nmake in order to match the actual installed location and
729 # version on this machine.
732 TCLINCDIR = c:\tcl\include
736 TCLLIBDIR = c:\tcl\lib
744 LIBTCLSTUB = tclstub85.lib
748 LIBTCLPATH = c:\tcl\bin
751 # The locations of the ICU header and library files. These variables
752 # (ICUINCDIR, ICULIBDIR, and LIBICU) may be overridden via the environment
753 # prior to running nmake in order to match the actual installed location on
757 ICUINCDIR = c:\icu\include
761 ICULIBDIR = c:\icu\lib
765 LIBICU = icuuc.lib icuin.lib
768 # This is the command to use for tclsh - normally just "tclsh", but we may
769 # know the specific version we want to use. This variable (TCLSH_CMD) may be
770 # overridden via the environment prior to running nmake in order to select a
771 # specific Tcl shell to use.
778 # Compiler options needed for programs that use the readline() library.
780 !IFNDEF READLINE_FLAGS
781 READLINE_FLAGS = -DHAVE_READLINE=0
784 # The library that programs using readline() must link against.
790 # Should the database engine be compiled threadsafe
792 TCC = $(TCC) -DSQLITE_THREADSAFE=1
793 RCC = $(RCC) -DSQLITE_THREADSAFE=1
795 # Do threads override each others locks by default (1), or do we test (-1)
797 TCC = $(TCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1
798 RCC = $(RCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1
800 # Any target libraries which libsqlite must be linked against
806 # Flags controlling use of the in memory btree implementation
808 # SQLITE_TEMP_STORE is 0 to force temporary tables to be in a file, 1 to
809 # default to file, 2 to default to memory, and 3 to force temporary
810 # tables to always be in memory.
812 TCC = $(TCC) -DSQLITE_TEMP_STORE=1
813 RCC = $(RCC) -DSQLITE_TEMP_STORE=1
815 # Enable/disable loadable extensions, and other optional features
816 # based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*).
817 # The same set of OMIT and ENABLE flags should be passed to the
818 # LEMON parser generator and the mkkeywordhash tool as well.
820 # These are the required SQLite compilation options used when compiling for
821 # the Windows platform.
823 REQ_FEATURE_FLAGS = $(REQ_FEATURE_FLAGS) -DSQLITE_MAX_TRIGGER_DEPTH=100
825 # If we are linking to the RPCRT4 library, enable features that need it.
827 !IF $(USE_RPCRT4_LIB)!=0
828 REQ_FEATURE_FLAGS = $(REQ_FEATURE_FLAGS) -DSQLITE_WIN32_USE_UUID=1
831 # Add the required and optional SQLite compilation options into the command
832 # lines used to invoke the MSVC code and resource compilers.
834 TCC = $(TCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS)
835 RCC = $(RCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS)
837 # Add in any optional parameters specified on the commane line, e.g.
838 # nmake /f Makefile.msc all "OPTS=-DSQLITE_ENABLE_FOO=1 -DSQLITE_OMIT_FOO=1"
843 # If compiling for debugging, add some defines.
846 TCC = $(TCC) -D_DEBUG
847 BCC = $(BCC) -D_DEBUG
848 RCC = $(RCC) -D_DEBUG
851 # If optimizations are enabled or disabled (either implicitly or
852 # explicitly), add the necessary flags.
854 !IF $(DEBUG)>1 || $(OPTIMIZATIONS)==0
857 !IF $(USE_RUNTIME_CHECKS)!=0
861 !ELSEIF $(OPTIMIZATIONS)>=3
864 !ELSEIF $(OPTIMIZATIONS)==2
867 !ELSEIF $(OPTIMIZATIONS)==1
872 # If symbols are enabled (or compiling for debugging), enable PDBs.
874 !IF $(DEBUG)>1 || $(SYMBOLS)!=0
880 # If ICU support is enabled, add the compiler options for it.
883 TCC = $(TCC) -DSQLITE_ENABLE_ICU=1
884 RCC = $(RCC) -DSQLITE_ENABLE_ICU=1
885 TCC = $(TCC) -I$(TOP)\ext\icu
886 RCC = $(RCC) -I$(TOP)\ext\icu
887 TCC = $(TCC) -I$(ICUINCDIR)
888 RCC = $(RCC) -I$(ICUINCDIR)
892 # Command line prefixes for compiling code, compiling resources,
895 LTCOMPILE = $(TCC) -Fo$@
896 LTRCOMPILE = $(RCC) -r
898 LTLINK = $(TCC) -Fe$@
900 # If requested, link to the RPCRT4 library.
902 !IF $(USE_RPCRT4_LIB)!=0
903 LTLINK = $(LTLINK) rpcrt4.lib
906 # If a platform was set, force the linker to target that.
907 # Note that the vcvars*.bat family of batch files typically
908 # set this for you. Otherwise, the linker will attempt
909 # to deduce the binary type based on the object files.
911 LTLINKOPTS = /NOLOGO /MACHINE:$(PLATFORM)
912 LTLIBOPTS = /NOLOGO /MACHINE:$(PLATFORM)
918 # When compiling for use in the WinRT environment, the following
919 # linker option must be used to mark the executable as runnable
920 # only in the context of an application container.
923 LTLINKOPTS = $(LTLINKOPTS) /APPCONTAINER
924 !IF "$(VISUALSTUDIOVERSION)"=="12.0" || "$(VISUALSTUDIOVERSION)"=="14.0"
926 !IF "$(PLATFORM)"=="x86"
927 STORELIBPATH = $(CRTLIBPATH)\store
928 !ELSEIF "$(PLATFORM)"=="x64"
929 STORELIBPATH = $(CRTLIBPATH)\store\amd64
930 !ELSEIF "$(PLATFORM)"=="ARM"
931 STORELIBPATH = $(CRTLIBPATH)\store\arm
933 STORELIBPATH = $(CRTLIBPATH)\store
936 STORELIBPATH = $(STORELIBPATH:\\=\)
937 LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(STORELIBPATH)"
941 # When compiling for Windows Phone 8.1, an extra library path is
944 !IF $(USE_WP81_OPTS)!=0
946 !IF "$(PLATFORM)"=="x86"
947 WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86
948 !ELSEIF "$(PLATFORM)"=="ARM"
949 WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\ARM
951 WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86
956 # When compiling for Windows Phone 8.1, some extra linker options
959 !IF $(USE_WP81_OPTS)!=0
961 LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(WP81LIBPATH)"
963 LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE
964 LTLINKOPTS = $(LTLINKOPTS) WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelHost.lib
965 LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:kernel32.lib /NODEFAULTLIB:ole32.lib
968 # When compiling for UWP or the Windows 10 platform, some extra linker
969 # options are also required.
971 !IF $(FOR_UWP)!=0 || $(FOR_WIN10)!=0
972 LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE /NODEFAULTLIB:kernel32.lib
973 LTLINKOPTS = $(LTLINKOPTS) mincore.lib
975 LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(PSDKLIBPATH)"
980 LTLINKOPTS = $(LTLINKOPTS) /guard:cf "/LIBPATH:$(UCRTLIBPATH)"
982 LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:libucrtd.lib /DEFAULTLIB:ucrtd.lib
984 LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib
988 # If either debugging or symbols are enabled, enable PDBs.
990 !IF $(DEBUG)>1 || $(SYMBOLS)!=0
991 LDFLAGS = /DEBUG $(LDOPTS)
997 # Start with the Tcl related linker options.
1000 LTLIBPATHS = /LIBPATH:$(TCLLIBDIR)
1004 # If ICU support is enabled, add the linker options for it.
1007 LTLIBPATHS = $(LTLIBPATHS) /LIBPATH:$(ICULIBDIR)
1008 LTLIBS = $(LTLIBS) $(LIBICU)
1012 # You should not have to change anything below this line
1013 ###############################################################################
1016 # Object files for the SQLite library (non-amalgamation).
1018 LIBOBJS0 = vdbe.lo parse.lo alter.lo analyze.lo attach.lo auth.lo \
1019 backup.lo bitvec.lo btmutex.lo btree.lo build.lo \
1020 callback.lo complete.lo ctime.lo date.lo dbstat.lo delete.lo \
1021 expr.lo fault.lo fkey.lo \
1022 fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo \
1023 fts3_porter.lo fts3_snippet.lo fts3_tokenizer.lo fts3_tokenizer1.lo \
1024 fts3_tokenize_vtab.lo fts3_unicode.lo fts3_unicode2.lo fts3_write.lo \
1026 func.lo global.lo hash.lo \
1027 icu.lo insert.lo legacy.lo loadext.lo \
1028 main.lo malloc.lo mem0.lo mem1.lo mem2.lo mem3.lo mem5.lo \
1030 mutex.lo mutex_noop.lo mutex_unix.lo mutex_w32.lo \
1031 notify.lo opcodes.lo os.lo os_unix.lo os_win.lo \
1032 pager.lo pcache.lo pcache1.lo pragma.lo prepare.lo printf.lo \
1033 random.lo resolve.lo rowset.lo rtree.lo \
1034 sqlite3session.lo select.lo sqlite3rbu.lo status.lo \
1035 table.lo threads.lo tokenize.lo treeview.lo trigger.lo \
1036 update.lo util.lo vacuum.lo \
1037 vdbeapi.lo vdbeaux.lo vdbeblob.lo vdbemem.lo vdbesort.lo \
1038 vdbetrace.lo wal.lo walker.lo where.lo wherecode.lo whereexpr.lo \
1042 # Object files for the amalgamation.
1044 LIBOBJS1 = sqlite3.lo
1046 # Determine the real value of LIBOBJ based on the 'configure' script
1049 !IF $(USE_AMALGAMATION)==0
1050 LIBOBJ = $(LIBOBJS0)
1053 LIBOBJ = $(LIBOBJS1)
1058 # Determine if embedded resource compilation and usage are enabled.
1061 LIBRESOBJS = sqlite3res.lo
1067 # Core source code files, part 1.
1070 $(TOP)\src\alter.c \
1071 $(TOP)\src\analyze.c \
1072 $(TOP)\src\attach.c \
1074 $(TOP)\src\backup.c \
1075 $(TOP)\src\bitvec.c \
1076 $(TOP)\src\btmutex.c \
1077 $(TOP)\src\btree.c \
1078 $(TOP)\src\build.c \
1079 $(TOP)\src\callback.c \
1080 $(TOP)\src\complete.c \
1081 $(TOP)\src\ctime.c \
1083 $(TOP)\src\dbstat.c \
1084 $(TOP)\src\delete.c \
1086 $(TOP)\src\fault.c \
1089 $(TOP)\src\global.c \
1091 $(TOP)\src\insert.c \
1092 $(TOP)\src\legacy.c \
1093 $(TOP)\src\loadext.c \
1095 $(TOP)\src\malloc.c \
1101 $(TOP)\src\memjournal.c \
1102 $(TOP)\src\mutex.c \
1103 $(TOP)\src\mutex_noop.c \
1104 $(TOP)\src\mutex_unix.c \
1105 $(TOP)\src\mutex_w32.c \
1106 $(TOP)\src\notify.c \
1108 $(TOP)\src\os_unix.c \
1111 # Core source code files, part 2.
1114 $(TOP)\src\pager.c \
1115 $(TOP)\src\pcache.c \
1116 $(TOP)\src\pcache1.c \
1117 $(TOP)\src\pragma.c \
1118 $(TOP)\src\prepare.c \
1119 $(TOP)\src\printf.c \
1120 $(TOP)\src\random.c \
1121 $(TOP)\src\resolve.c \
1122 $(TOP)\src\rowset.c \
1123 $(TOP)\src\select.c \
1124 $(TOP)\src\status.c \
1125 $(TOP)\src\table.c \
1126 $(TOP)\src\threads.c \
1127 $(TOP)\src\tclsqlite.c \
1128 $(TOP)\src\tokenize.c \
1129 $(TOP)\src\treeview.c \
1130 $(TOP)\src\trigger.c \
1132 $(TOP)\src\update.c \
1134 $(TOP)\src\vacuum.c \
1136 $(TOP)\src\vdbeapi.c \
1137 $(TOP)\src\vdbeaux.c \
1138 $(TOP)\src\vdbeblob.c \
1139 $(TOP)\src\vdbemem.c \
1140 $(TOP)\src\vdbesort.c \
1141 $(TOP)\src\vdbetrace.c \
1144 $(TOP)\src\walker.c \
1145 $(TOP)\src\where.c \
1146 $(TOP)\src\wherecode.c \
1147 $(TOP)\src\whereexpr.c
1149 # Shell source code files.
1154 # Core miscellaneous files.
1159 # Core header files, part 1.
1162 $(TOP)\src\btree.h \
1163 $(TOP)\src\btreeInt.h \
1165 $(TOP)\src\hwtime.h \
1167 $(TOP)\src\mutex.h \
1169 $(TOP)\src\os_common.h \
1170 $(TOP)\src\os_setup.h \
1173 # Core header files, part 2.
1176 $(TOP)\src\pager.h \
1177 $(TOP)\src\pcache.h \
1178 $(TOP)\src\pragma.h \
1179 $(TOP)\src\sqlite.h.in \
1180 $(TOP)\src\sqlite3ext.h \
1181 $(TOP)\src\sqliteInt.h \
1182 $(TOP)\src\sqliteLimit.h \
1184 $(TOP)\src\vdbeInt.h \
1185 $(TOP)\src\vxworks.h \
1187 $(TOP)\src\whereInt.h
1189 # Extension source code files, part 1.
1192 $(TOP)\ext\fts1\fts1.c \
1193 $(TOP)\ext\fts1\fts1_hash.c \
1194 $(TOP)\ext\fts1\fts1_porter.c \
1195 $(TOP)\ext\fts1\fts1_tokenizer1.c \
1196 $(TOP)\ext\fts2\fts2.c \
1197 $(TOP)\ext\fts2\fts2_hash.c \
1198 $(TOP)\ext\fts2\fts2_icu.c \
1199 $(TOP)\ext\fts2\fts2_porter.c \
1200 $(TOP)\ext\fts2\fts2_tokenizer.c \
1201 $(TOP)\ext\fts2\fts2_tokenizer1.c
1203 # Extension source code files, part 2.
1206 $(TOP)\ext\fts3\fts3.c \
1207 $(TOP)\ext\fts3\fts3_aux.c \
1208 $(TOP)\ext\fts3\fts3_expr.c \
1209 $(TOP)\ext\fts3\fts3_hash.c \
1210 $(TOP)\ext\fts3\fts3_icu.c \
1211 $(TOP)\ext\fts3\fts3_porter.c \
1212 $(TOP)\ext\fts3\fts3_snippet.c \
1213 $(TOP)\ext\fts3\fts3_tokenizer.c \
1214 $(TOP)\ext\fts3\fts3_tokenizer1.c \
1215 $(TOP)\ext\fts3\fts3_tokenize_vtab.c \
1216 $(TOP)\ext\fts3\fts3_unicode.c \
1217 $(TOP)\ext\fts3\fts3_unicode2.c \
1218 $(TOP)\ext\fts3\fts3_write.c \
1219 $(TOP)\ext\icu\icu.c \
1220 $(TOP)\ext\rtree\rtree.c \
1221 $(TOP)\ext\session\sqlite3session.c \
1222 $(TOP)\ext\rbu\sqlite3rbu.c \
1223 $(TOP)\ext\misc\json1.c
1225 # Extension header files, part 1.
1228 $(TOP)\ext\fts1\fts1.h \
1229 $(TOP)\ext\fts1\fts1_hash.h \
1230 $(TOP)\ext\fts1\fts1_tokenizer.h \
1231 $(TOP)\ext\fts2\fts2.h \
1232 $(TOP)\ext\fts2\fts2_hash.h \
1233 $(TOP)\ext\fts2\fts2_tokenizer.h
1235 # Extension header files, part 2.
1238 $(TOP)\ext\fts3\fts3.h \
1239 $(TOP)\ext\fts3\fts3Int.h \
1240 $(TOP)\ext\fts3\fts3_hash.h \
1241 $(TOP)\ext\fts3\fts3_tokenizer.h \
1242 $(TOP)\ext\icu\sqliteicu.h \
1243 $(TOP)\ext\rtree\rtree.h \
1244 $(TOP)\ext\rbu\sqlite3rbu.h \
1245 $(TOP)\ext\session\sqlite3session.h
1247 # Generated source code files
1253 # Generated header files
1261 # Generated Tcl header files
1267 # All source code files.
1269 SRC = $(SRC00) $(SRC01) $(SRC02) $(SRC03) $(SRC04) $(SRC05) $(SRC06) $(SRC07) $(SRC08) $(SRC09) $(SRC10) $(SRC11)
1271 # Source code to the test files.
1274 $(TOP)\src\test1.c \
1275 $(TOP)\src\test2.c \
1276 $(TOP)\src\test3.c \
1277 $(TOP)\src\test4.c \
1278 $(TOP)\src\test5.c \
1279 $(TOP)\src\test6.c \
1280 $(TOP)\src\test7.c \
1281 $(TOP)\src\test8.c \
1282 $(TOP)\src\test9.c \
1283 $(TOP)\src\test_autoext.c \
1284 $(TOP)\src\test_async.c \
1285 $(TOP)\src\test_backup.c \
1286 $(TOP)\src\test_bestindex.c \
1287 $(TOP)\src\test_blob.c \
1288 $(TOP)\src\test_btree.c \
1289 $(TOP)\src\test_config.c \
1290 $(TOP)\src\test_demovfs.c \
1291 $(TOP)\src\test_devsym.c \
1292 $(TOP)\src\test_fs.c \
1293 $(TOP)\src\test_func.c \
1294 $(TOP)\src\test_hexio.c \
1295 $(TOP)\src\test_init.c \
1296 $(TOP)\src\test_intarray.c \
1297 $(TOP)\src\test_journal.c \
1298 $(TOP)\src\test_malloc.c \
1299 $(TOP)\src\test_multiplex.c \
1300 $(TOP)\src\test_mutex.c \
1301 $(TOP)\src\test_onefile.c \
1302 $(TOP)\src\test_osinst.c \
1303 $(TOP)\src\test_pcache.c \
1304 $(TOP)\src\test_quota.c \
1305 $(TOP)\src\test_rtree.c \
1306 $(TOP)\src\test_schema.c \
1307 $(TOP)\src\test_server.c \
1308 $(TOP)\src\test_superlock.c \
1309 $(TOP)\src\test_syscall.c \
1310 $(TOP)\src\test_tclvar.c \
1311 $(TOP)\src\test_thread.c \
1312 $(TOP)\src\test_vfs.c \
1313 $(TOP)\src\test_windirent.c \
1314 $(TOP)\src\test_wsd.c \
1315 $(TOP)\ext\fts3\fts3_term.c \
1316 $(TOP)\ext\fts3\fts3_test.c \
1317 $(TOP)\ext\rbu\test_rbu.c \
1318 $(TOP)\ext\session\test_session.c
1320 # Statically linked extensions.
1323 $(TOP)\ext\misc\amatch.c \
1324 $(TOP)\ext\misc\carray.c \
1325 $(TOP)\ext\misc\closure.c \
1326 $(TOP)\ext\misc\csv.c \
1327 $(TOP)\ext\misc\eval.c \
1328 $(TOP)\ext\misc\fileio.c \
1329 $(TOP)\ext\misc\fuzzer.c \
1330 $(TOP)\ext\fts5\fts5_tcl.c \
1331 $(TOP)\ext\fts5\fts5_test_mi.c \
1332 $(TOP)\ext\fts5\fts5_test_tok.c \
1333 $(TOP)\ext\misc\ieee754.c \
1334 $(TOP)\ext\misc\nextchar.c \
1335 $(TOP)\ext\misc\percentile.c \
1336 $(TOP)\ext\misc\regexp.c \
1337 $(TOP)\ext\misc\series.c \
1338 $(TOP)\ext\misc\spellfix.c \
1339 $(TOP)\ext\misc\totype.c \
1340 $(TOP)\ext\misc\wholenumber.c
1342 # Source code to the library files needed by the test fixture
1343 # (non-amalgamation)
1351 $(TOP)\ext\async\sqlite3async.c
1353 # Header files used by all library source files.
1356 $(TOP)\src\btree.h \
1357 $(TOP)\src\btreeInt.h \
1359 $(TOP)\src\hwtime.h \
1362 $(TOP)\src\mutex.h \
1365 $(TOP)\src\os_common.h \
1366 $(TOP)\src\os_setup.h \
1367 $(TOP)\src\os_win.h \
1368 $(TOP)\src\pager.h \
1369 $(TOP)\src\pcache.h \
1371 $(TOP)\src\pragma.h \
1374 $(TOP)\src\sqliteInt.h \
1375 $(TOP)\src\sqliteLimit.h \
1377 $(TOP)\src\vdbeInt.h \
1378 $(TOP)\src\vxworks.h \
1379 $(TOP)\src\whereInt.h
1381 # Header files used by extensions
1383 EXTHDR = $(EXTHDR) \
1384 $(TOP)\ext\fts1\fts1.h \
1385 $(TOP)\ext\fts1\fts1_hash.h \
1386 $(TOP)\ext\fts1\fts1_tokenizer.h
1387 EXTHDR = $(EXTHDR) \
1388 $(TOP)\ext\fts2\fts2.h \
1389 $(TOP)\ext\fts2\fts2_hash.h \
1390 $(TOP)\ext\fts2\fts2_tokenizer.h
1391 EXTHDR = $(EXTHDR) \
1392 $(TOP)\ext\fts3\fts3.h \
1393 $(TOP)\ext\fts3\fts3Int.h \
1394 $(TOP)\ext\fts3\fts3_hash.h \
1395 $(TOP)\ext\fts3\fts3_tokenizer.h
1396 EXTHDR = $(EXTHDR) \
1397 $(TOP)\ext\rtree\rtree.h
1398 EXTHDR = $(EXTHDR) \
1399 $(TOP)\ext\icu\sqliteicu.h
1400 EXTHDR = $(EXTHDR) \
1401 $(TOP)\ext\rtree\sqlite3rtree.h
1402 EXTHDR = $(EXTHDR) \
1403 $(TOP)\ext\session\sqlite3session.h
1405 # executables needed for testing
1410 sqlite3_analyzer.exe \
1414 # Databases containing fuzzer test cases
1417 $(TOP)\test\fuzzdata1.db \
1418 $(TOP)\test\fuzzdata2.db \
1419 $(TOP)\test\fuzzdata3.db \
1420 $(TOP)\test\fuzzdata4.db
1423 # Additional compiler options for the shell. These are only effective
1424 # when the shell is not being dynamically linked.
1426 !IF $(DYNAMIC_SHELL)==0 && $(FOR_WIN10)==0
1427 SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_SHELL_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS
1431 # Extra compiler options for various test tools.
1433 MPTESTER_COMPILE_OPTS = -DSQLITE_SHELL_JSON1 -DSQLITE_ENABLE_FTS5
1434 FUZZERSHELL_COMPILE_OPTS = -DSQLITE_ENABLE_JSON1
1435 FUZZCHECK_COMPILE_OPTS = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMSYS5
1437 # Standard options to testfixture.
1439 TESTOPTS = --verbose=file --output=test-out.txt
1441 # Extra targets for the "all" target that require Tcl.
1444 ALL_TCL_TARGETS = libtclsqlite3.lib
1450 # This is the default Makefile target. The objects listed here
1451 # are what get build when you type just "make" with no arguments.
1453 all: dll libsqlite3.lib shell $(ALL_TCL_TARGETS)
1455 # Dynamic link library section.
1461 shell: $(SQLITE3EXE)
1464 libsqlite3.lib: $(LIBOBJ)
1465 $(LTLIB) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS)
1467 libtclsqlite3.lib: tclsqlite.lo libsqlite3.lib
1468 $(LTLIB) $(LTLIBOPTS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCLSTUB) $(TLIBS)
1471 $(SQLITE3DLL): $(LIBOBJ) $(LIBRESOBJS) $(CORE_LINK_DEP)
1472 $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL $(CORE_LINK_OPTS) /OUT:$@ $(LIBOBJ) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
1475 sqlite3.def: libsqlite3.lib
1476 echo EXPORTS > sqlite3.def
1477 dumpbin /all libsqlite3.lib \
1478 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl include "^\s+1 _?(sqlite3_[^@]*)(?:@\d+)?$$" \1 \
1479 | sort >> sqlite3.def
1482 $(SQLITE3EXE): $(TOP)\src\shell.c $(SHELL_CORE_DEP) $(LIBRESOBJS) $(SHELL_CORE_SRC) $(SQLITE3H)
1483 $(LTLINK) $(SHELL_COMPILE_OPTS) $(READLINE_FLAGS) $(TOP)\src\shell.c $(SHELL_CORE_SRC) \
1484 /link $(SQLITE3EXEPDB) $(LDFLAGS) $(LTLINKOPTS) $(SHELL_LINK_OPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS)
1487 sqldiff.exe: $(TOP)\tool\sqldiff.c $(SQLITE3C) $(SQLITE3H)
1488 $(LTLINK) $(NO_WARN) $(TOP)\tool\sqldiff.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
1490 dbhash.exe: $(TOP)\tool\dbhash.c $(SQLITE3C) $(SQLITE3H)
1491 $(LTLINK) $(NO_WARN) $(TOP)\tool\dbhash.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
1493 scrub.exe: $(TOP)\ext\misc\scrub.c $(SQLITE3C) $(SQLITE3H)
1494 $(LTLINK) $(NO_WARN) $(TOP)\ext\misc\scrub.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
1496 srcck1.exe: $(TOP)\tool\srcck1.c
1497 $(BCC) $(NO_WARN) -Fe$@ $(TOP)\tool\srcck1.c
1499 sourcetest: srcck1.exe sqlite3.c
1500 srcck1.exe sqlite3.c
1502 fuzzershell.exe: $(TOP)\tool\fuzzershell.c $(SQLITE3C) $(SQLITE3H)
1503 $(LTLINK) $(NO_WARN) $(FUZZERSHELL_COMPILE_OPTS) $(TOP)\tool\fuzzershell.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
1505 fuzzcheck.exe: $(TOP)\test\fuzzcheck.c $(SQLITE3C) $(SQLITE3H)
1506 $(LTLINK) $(NO_WARN) $(FUZZCHECK_COMPILE_OPTS) $(TOP)\test\fuzzcheck.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
1508 mptester.exe: $(TOP)\mptest\mptest.c $(SQLITE3C) $(SQLITE3H)
1509 $(LTLINK) $(NO_WARN) $(MPTESTER_COMPILE_OPTS) $(TOP)\mptest\mptest.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
1511 MPTEST1 = mptester mptest.db $(TOP)\mptest\crash01.test --repeat 20
1512 MPTEST2 = mptester mptest.db $(TOP)\mptest\multiwrite01.test --repeat 20
1514 mptest: mptester.exe
1515 del /Q mptest.db 2>NUL
1516 $(MPTEST1) --journalmode DELETE
1517 $(MPTEST2) --journalmode WAL
1518 $(MPTEST1) --journalmode WAL
1519 $(MPTEST2) --journalmode PERSIST
1520 $(MPTEST1) --journalmode PERSIST
1521 $(MPTEST2) --journalmode TRUNCATE
1522 $(MPTEST1) --journalmode TRUNCATE
1523 $(MPTEST2) --journalmode DELETE
1525 # This target creates a directory named "tsrc" and fills it with
1526 # copies of all of the C source code and header files needed to
1527 # build on the target system. Some of the C source code and header
1528 # files are automatically generated. This target takes care of
1529 # all that automatic generation.
1531 .target_source: $(SRC) $(TOP)\tool\vdbe-compress.tcl fts5.c sqlite_tcl.h
1532 -rmdir /Q/S tsrc 2>NUL
1534 for %i in ($(SRC00)) do copy /Y %i tsrc
1535 for %i in ($(SRC01)) do copy /Y %i tsrc
1536 for %i in ($(SRC02)) do copy /Y %i tsrc
1537 for %i in ($(SRC03)) do copy /Y %i tsrc
1538 for %i in ($(SRC04)) do copy /Y %i tsrc
1539 for %i in ($(SRC05)) do copy /Y %i tsrc
1540 for %i in ($(SRC06)) do copy /Y %i tsrc
1541 for %i in ($(SRC07)) do copy /Y %i tsrc
1542 for %i in ($(SRC08)) do copy /Y %i tsrc
1543 for %i in ($(SRC09)) do copy /Y %i tsrc
1544 for %i in ($(SRC10)) do copy /Y %i tsrc
1545 for %i in ($(SRC11)) do copy /Y %i tsrc
1546 for %i in ($(SRC12)) do copy /Y %i tsrc
1549 del /Q tsrc\sqlite.h.in tsrc\parse.y 2>NUL
1550 $(TCLSH_CMD) $(TOP)\tool\vdbe-compress.tcl $(OPTS) < tsrc\vdbe.c > vdbe.new
1551 move vdbe.new tsrc\vdbe.c
1552 echo > .target_source
1554 sqlite3.c: .target_source sqlite3ext.h $(TOP)\tool\mksqlite3c.tcl
1555 $(TCLSH_CMD) $(TOP)\tool\mksqlite3c.tcl $(MKSQLITE3C_ARGS)
1557 copy $(TOP)\ext\session\sqlite3session.h .
1559 sqlite3-all.c: sqlite3.c $(TOP)\tool\split-sqlite3c.tcl
1560 $(TCLSH_CMD) $(TOP)\tool\split-sqlite3c.tcl
1563 # Rule to build the amalgamation
1565 sqlite3.lo: $(SQLITE3C)
1566 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(SQLITE3C)
1569 # Rules to build the LEMON compiler generator
1571 lempar.c: $(TOP)\tool\lempar.c
1572 copy $(TOP)\tool\lempar.c .
1574 lemon.exe: $(TOP)\tool\lemon.c lempar.c
1575 $(BCC) $(NO_WARN) -Daccess=_access \
1576 -Fe$@ $(TOP)\tool\lemon.c /link $(LDFLAGS) $(NLTLINKOPTS) $(NLTLIBPATHS)
1578 # Rules to build individual *.lo files from generated *.c files. This
1584 parse.lo: parse.c $(HDR)
1585 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c parse.c
1587 opcodes.lo: opcodes.c
1588 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c opcodes.c
1591 # Rule to build the Win32 resources object file.
1595 $(LIBRESOBJS): $(TOP)\src\sqlite3.rc $(SQLITE3H)
1596 echo #ifndef SQLITE_RESOURCE_VERSION > sqlite3rc.h
1597 for /F %%V in ('type "$(TOP)\VERSION"') do ( \
1598 echo #define SQLITE_RESOURCE_VERSION %%V \
1599 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact . ^, >> sqlite3rc.h \
1601 echo #endif >> sqlite3rc.h
1602 $(LTRCOMPILE) -fo $(LIBRESOBJS) $(TOP)\src\sqlite3.rc
1607 # Rules to build individual *.lo files from files in the src directory.
1609 alter.lo: $(TOP)\src\alter.c $(HDR)
1610 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\alter.c
1612 analyze.lo: $(TOP)\src\analyze.c $(HDR)
1613 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\analyze.c
1615 attach.lo: $(TOP)\src\attach.c $(HDR)
1616 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\attach.c
1618 auth.lo: $(TOP)\src\auth.c $(HDR)
1619 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\auth.c
1621 backup.lo: $(TOP)\src\backup.c $(HDR)
1622 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\backup.c
1624 bitvec.lo: $(TOP)\src\bitvec.c $(HDR)
1625 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\bitvec.c
1627 btmutex.lo: $(TOP)\src\btmutex.c $(HDR)
1628 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\btmutex.c
1630 btree.lo: $(TOP)\src\btree.c $(HDR) $(TOP)\src\pager.h
1631 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\btree.c
1633 build.lo: $(TOP)\src\build.c $(HDR)
1634 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\build.c
1636 callback.lo: $(TOP)\src\callback.c $(HDR)
1637 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\callback.c
1639 complete.lo: $(TOP)\src\complete.c $(HDR)
1640 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\complete.c
1642 ctime.lo: $(TOP)\src\ctime.c $(HDR)
1643 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\ctime.c
1645 date.lo: $(TOP)\src\date.c $(HDR)
1646 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\date.c
1648 dbstat.lo: $(TOP)\src\date.c $(HDR)
1649 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\dbstat.c
1651 delete.lo: $(TOP)\src\delete.c $(HDR)
1652 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\delete.c
1654 expr.lo: $(TOP)\src\expr.c $(HDR)
1655 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\expr.c
1657 fault.lo: $(TOP)\src\fault.c $(HDR)
1658 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\fault.c
1660 fkey.lo: $(TOP)\src\fkey.c $(HDR)
1661 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\fkey.c
1663 func.lo: $(TOP)\src\func.c $(HDR)
1664 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\func.c
1666 global.lo: $(TOP)\src\global.c $(HDR)
1667 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\global.c
1669 hash.lo: $(TOP)\src\hash.c $(HDR)
1670 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\hash.c
1672 insert.lo: $(TOP)\src\insert.c $(HDR)
1673 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\insert.c
1675 legacy.lo: $(TOP)\src\legacy.c $(HDR)
1676 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\legacy.c
1678 loadext.lo: $(TOP)\src\loadext.c $(HDR)
1679 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\loadext.c
1681 main.lo: $(TOP)\src\main.c $(HDR)
1682 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\main.c
1684 malloc.lo: $(TOP)\src\malloc.c $(HDR)
1685 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\malloc.c
1687 mem0.lo: $(TOP)\src\mem0.c $(HDR)
1688 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem0.c
1690 mem1.lo: $(TOP)\src\mem1.c $(HDR)
1691 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem1.c
1693 mem2.lo: $(TOP)\src\mem2.c $(HDR)
1694 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem2.c
1696 mem3.lo: $(TOP)\src\mem3.c $(HDR)
1697 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem3.c
1699 mem5.lo: $(TOP)\src\mem5.c $(HDR)
1700 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem5.c
1702 memjournal.lo: $(TOP)\src\memjournal.c $(HDR)
1703 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\memjournal.c
1705 mutex.lo: $(TOP)\src\mutex.c $(HDR)
1706 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex.c
1708 mutex_noop.lo: $(TOP)\src\mutex_noop.c $(HDR)
1709 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex_noop.c
1711 mutex_unix.lo: $(TOP)\src\mutex_unix.c $(HDR)
1712 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex_unix.c
1714 mutex_w32.lo: $(TOP)\src\mutex_w32.c $(HDR)
1715 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex_w32.c
1717 notify.lo: $(TOP)\src\notify.c $(HDR)
1718 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\notify.c
1720 pager.lo: $(TOP)\src\pager.c $(HDR) $(TOP)\src\pager.h
1721 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pager.c
1723 pcache.lo: $(TOP)\src\pcache.c $(HDR) $(TOP)\src\pcache.h
1724 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pcache.c
1726 pcache1.lo: $(TOP)\src\pcache1.c $(HDR) $(TOP)\src\pcache.h
1727 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pcache1.c
1729 os.lo: $(TOP)\src\os.c $(HDR)
1730 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\os.c
1732 os_unix.lo: $(TOP)\src\os_unix.c $(HDR)
1733 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\os_unix.c
1735 os_win.lo: $(TOP)\src\os_win.c $(HDR)
1736 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\os_win.c
1738 pragma.lo: $(TOP)\src\pragma.c $(HDR)
1739 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pragma.c
1741 prepare.lo: $(TOP)\src\prepare.c $(HDR)
1742 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\prepare.c
1744 printf.lo: $(TOP)\src\printf.c $(HDR)
1745 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\printf.c
1747 random.lo: $(TOP)\src\random.c $(HDR)
1748 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\random.c
1750 resolve.lo: $(TOP)\src\resolve.c $(HDR)
1751 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\resolve.c
1753 rowset.lo: $(TOP)\src\rowset.c $(HDR)
1754 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\rowset.c
1756 select.lo: $(TOP)\src\select.c $(HDR)
1757 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\select.c
1759 status.lo: $(TOP)\src\status.c $(HDR)
1760 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\status.c
1762 table.lo: $(TOP)\src\table.c $(HDR)
1763 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\table.c
1765 threads.lo: $(TOP)\src\threads.c $(HDR)
1766 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\threads.c
1768 tokenize.lo: $(TOP)\src\tokenize.c keywordhash.h $(HDR)
1769 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\tokenize.c
1771 treeview.lo: $(TOP)\src\treeview.c $(HDR)
1772 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\treeview.c
1774 trigger.lo: $(TOP)\src\trigger.c $(HDR)
1775 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\trigger.c
1777 update.lo: $(TOP)\src\update.c $(HDR)
1778 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\update.c
1780 utf.lo: $(TOP)\src\utf.c $(HDR)
1781 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\utf.c
1783 util.lo: $(TOP)\src\util.c $(HDR)
1784 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\util.c
1786 vacuum.lo: $(TOP)\src\vacuum.c $(HDR)
1787 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vacuum.c
1789 vdbe.lo: $(TOP)\src\vdbe.c $(HDR)
1790 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbe.c
1792 vdbeapi.lo: $(TOP)\src\vdbeapi.c $(HDR)
1793 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbeapi.c
1795 vdbeaux.lo: $(TOP)\src\vdbeaux.c $(HDR)
1796 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbeaux.c
1798 vdbeblob.lo: $(TOP)\src\vdbeblob.c $(HDR)
1799 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbeblob.c
1801 vdbemem.lo: $(TOP)\src\vdbemem.c $(HDR)
1802 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbemem.c
1804 vdbesort.lo: $(TOP)\src\vdbesort.c $(HDR)
1805 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbesort.c
1807 vdbetrace.lo: $(TOP)\src\vdbetrace.c $(HDR)
1808 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbetrace.c
1810 vtab.lo: $(TOP)\src\vtab.c $(HDR)
1811 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vtab.c
1813 wal.lo: $(TOP)\src\wal.c $(HDR)
1814 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\wal.c
1816 walker.lo: $(TOP)\src\walker.c $(HDR)
1817 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\walker.c
1819 where.lo: $(TOP)\src\where.c $(HDR)
1820 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\where.c
1822 wherecode.lo: $(TOP)\src\wherecode.c $(HDR)
1823 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\wherecode.c
1825 whereexpr.lo: $(TOP)\src\whereexpr.c $(HDR)
1826 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\whereexpr.c
1828 tclsqlite.lo: $(TOP)\src\tclsqlite.c $(HDR) sqlite_tcl.h
1829 $(LTCOMPILE) $(NO_WARN) -DUSE_TCL_STUBS=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c
1831 tclsqlite-shell.lo: $(TOP)\src\tclsqlite.c $(HDR) sqlite_tcl.h
1832 $(LTCOMPILE) $(NO_WARN) -DTCLSH=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c
1834 tclsqlite3.exe: tclsqlite-shell.lo $(SQLITE3C) $(SQLITE3H) $(LIBRESOBJS)
1835 $(LTLINK) $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /OUT:$@ tclsqlite-shell.lo $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
1837 # Rules to build opcodes.c and opcodes.h
1839 opcodes.c: opcodes.h $(TOP)\tool\mkopcodec.tcl
1840 $(TCLSH_CMD) $(TOP)\tool\mkopcodec.tcl opcodes.h > opcodes.c
1842 opcodes.h: parse.h $(TOP)\src\vdbe.c $(TOP)\tool\mkopcodeh.tcl
1843 type parse.h $(TOP)\src\vdbe.c | $(TCLSH_CMD) $(TOP)\tool\mkopcodeh.tcl > opcodes.h
1845 # Rules to build parse.c and parse.h - the outputs of lemon.
1849 parse.c: $(TOP)\src\parse.y lemon.exe $(TOP)\tool\addopcodes.tcl
1850 del /Q parse.y parse.h parse.h.temp 2>NUL
1851 copy $(TOP)\src\parse.y .
1852 .\lemon.exe $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) $(OPTS) parse.y
1853 move parse.h parse.h.temp
1854 $(TCLSH_CMD) $(TOP)\tool\addopcodes.tcl parse.h.temp > parse.h
1856 $(SQLITE3H): $(TOP)\src\sqlite.h.in $(TOP)\manifest.uuid $(TOP)\VERSION
1857 $(TCLSH_CMD) $(TOP)\tool\mksqlite3h.tcl $(TOP:\=/) > $(SQLITE3H)
1859 sqlite3ext.h: .target_source
1860 type tsrc\sqlite3ext.h | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "\(\*\)" "(SQLITE_CALLBACK *)" \
1861 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "\(\*" "(SQLITE_APICALL *" > sqlite3ext.h
1862 copy /Y sqlite3ext.h tsrc\sqlite3ext.h
1864 mkkeywordhash.exe: $(TOP)\tool\mkkeywordhash.c
1865 $(BCC) $(NO_WARN) -Fe$@ $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) $(OPTS) \
1866 $(TOP)\tool\mkkeywordhash.c /link $(LDFLAGS) $(NLTLINKOPTS) $(NLTLIBPATHS)
1868 keywordhash.h: $(TOP)\tool\mkkeywordhash.c mkkeywordhash.exe
1869 .\mkkeywordhash.exe > keywordhash.h
1873 # Rules to build the extension objects.
1875 icu.lo: $(TOP)\ext\icu\icu.c $(HDR) $(EXTHDR)
1876 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\icu\icu.c
1878 fts2.lo: $(TOP)\ext\fts2\fts2.c $(HDR) $(EXTHDR)
1879 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2.c
1881 fts2_hash.lo: $(TOP)\ext\fts2\fts2_hash.c $(HDR) $(EXTHDR)
1882 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_hash.c
1884 fts2_icu.lo: $(TOP)\ext\fts2\fts2_icu.c $(HDR) $(EXTHDR)
1885 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_icu.c
1887 fts2_porter.lo: $(TOP)\ext\fts2\fts2_porter.c $(HDR) $(EXTHDR)
1888 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_porter.c
1890 fts2_tokenizer.lo: $(TOP)\ext\fts2\fts2_tokenizer.c $(HDR) $(EXTHDR)
1891 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_tokenizer.c
1893 fts2_tokenizer1.lo: $(TOP)\ext\fts2\fts2_tokenizer1.c $(HDR) $(EXTHDR)
1894 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_tokenizer1.c
1896 fts3.lo: $(TOP)\ext\fts3\fts3.c $(HDR) $(EXTHDR)
1897 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3.c
1899 fts3_aux.lo: $(TOP)\ext\fts3\fts3_aux.c $(HDR) $(EXTHDR)
1900 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_aux.c
1902 fts3_expr.lo: $(TOP)\ext\fts3\fts3_expr.c $(HDR) $(EXTHDR)
1903 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_expr.c
1905 fts3_hash.lo: $(TOP)\ext\fts3\fts3_hash.c $(HDR) $(EXTHDR)
1906 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_hash.c
1908 fts3_icu.lo: $(TOP)\ext\fts3\fts3_icu.c $(HDR) $(EXTHDR)
1909 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_icu.c
1911 fts3_snippet.lo: $(TOP)\ext\fts3\fts3_snippet.c $(HDR) $(EXTHDR)
1912 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_snippet.c
1914 fts3_porter.lo: $(TOP)\ext\fts3\fts3_porter.c $(HDR) $(EXTHDR)
1915 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_porter.c
1917 fts3_tokenizer.lo: $(TOP)\ext\fts3\fts3_tokenizer.c $(HDR) $(EXTHDR)
1918 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenizer.c
1920 fts3_tokenizer1.lo: $(TOP)\ext\fts3\fts3_tokenizer1.c $(HDR) $(EXTHDR)
1921 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenizer1.c
1923 fts3_tokenize_vtab.lo: $(TOP)\ext\fts3\fts3_tokenize_vtab.c $(HDR) $(EXTHDR)
1924 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenize_vtab.c
1926 fts3_unicode.lo: $(TOP)\ext\fts3\fts3_unicode.c $(HDR) $(EXTHDR)
1927 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_unicode.c
1929 fts3_unicode2.lo: $(TOP)\ext\fts3\fts3_unicode2.c $(HDR) $(EXTHDR)
1930 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_unicode2.c
1932 fts3_write.lo: $(TOP)\ext\fts3\fts3_write.c $(HDR) $(EXTHDR)
1933 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_write.c
1935 rtree.lo: $(TOP)\ext\rtree\rtree.c $(HDR) $(EXTHDR)
1936 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\rtree\rtree.c
1938 sqlite3session.lo: $(TOP)\ext\session\sqlite3session.c $(HDR) $(EXTHDR)
1939 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\session\sqlite3session.c
1944 $(TOP)\ext\fts5\fts5.h \
1945 $(TOP)\ext\fts5\fts5Int.h \
1946 $(TOP)\ext\fts5\fts5_aux.c \
1947 $(TOP)\ext\fts5\fts5_buffer.c \
1948 $(TOP)\ext\fts5\fts5_main.c \
1949 $(TOP)\ext\fts5\fts5_config.c \
1950 $(TOP)\ext\fts5\fts5_expr.c \
1951 $(TOP)\ext\fts5\fts5_hash.c \
1952 $(TOP)\ext\fts5\fts5_index.c \
1953 fts5parse.c fts5parse.h \
1954 $(TOP)\ext\fts5\fts5_storage.c \
1955 $(TOP)\ext\fts5\fts5_tokenize.c \
1956 $(TOP)\ext\fts5\fts5_unicode2.c \
1957 $(TOP)\ext\fts5\fts5_varint.c \
1958 $(TOP)\ext\fts5\fts5_vocab.c
1960 fts5parse.c: $(TOP)\ext\fts5\fts5parse.y lemon.exe
1961 copy $(TOP)\ext\fts5\fts5parse.y .
1962 del /Q fts5parse.h 2>NUL
1963 .\lemon.exe $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) $(OPTS) fts5parse.y
1965 fts5parse.h: fts5parse.c
1968 $(TCLSH_CMD) $(TOP)\ext\fts5\tool\mkfts5c.tcl
1969 copy $(TOP)\ext\fts5\fts5.h .
1971 fts5.lo: fts5.c $(HDR) $(EXTHDR)
1972 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c fts5.c
1974 fts5_ext.lo: fts5.c $(HDR) $(EXTHDR)
1975 $(LTCOMPILE) $(NO_WARN) -c fts5.c
1977 fts5.dll: fts5_ext.lo
1978 $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /OUT:$@ fts5_ext.lo
1980 sqlite3rbu.lo: $(TOP)\ext\rbu\sqlite3rbu.c $(HDR) $(EXTHDR)
1981 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\rbu\sqlite3rbu.c
1983 # Rules to build the 'testfixture' application.
1985 # If using the amalgamation, use sqlite3.c directly to build the test
1986 # fixture. Otherwise link against libsqlite3.lib. (This distinction is
1987 # necessary because the test fixture requires non-API symbols which are
1988 # hidden when the library is built via the amalgamation).
1990 TESTFIXTURE_FLAGS = -DTCLSH=1 -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
1991 TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_SERVER=1 -DSQLITE_PRIVATE=""
1992 TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_CORE $(NO_WARN)
1993 TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_SERIES_CONSTRAINT_VERIFY=1
1994 TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_DEFAULT_PAGE_SIZE=1024
1995 TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) $(TEST_CCONV_OPTS)
1997 TESTFIXTURE_SRC0 = $(TESTEXT) $(TESTSRC2)
1998 TESTFIXTURE_SRC1 = $(TESTEXT) $(SQLITE3C)
1999 !IF $(USE_AMALGAMATION)==0
2000 TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC0)
2002 TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC1)
2006 echo #ifndef SQLITE_TCLAPI > sqlite_tclDecls.h
2007 echo # define SQLITE_TCLAPI >> sqlite_tclDecls.h
2008 echo #endif >> sqlite_tclDecls.h
2009 type "$(TCLINCDIR)\tclDecls.h" \
2010 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "^(EXTERN(?: CONST\d+?)?\s+?[^\(]*?\s+?)Tcl_" "\1 SQLITE_TCLAPI Tcl_" \
2011 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "^(EXTERN\s+?(?:void|VOID)\s+?)TclFreeObj" "\1 SQLITE_TCLAPI TclFreeObj" \
2012 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "\(\*tcl_" "(SQLITE_TCLAPI *tcl_" \
2013 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "\(\*tclFreeObj" "(SQLITE_TCLAPI *tclFreeObj" \
2014 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "\(\*" "(SQLITE_TCLAPI *" >> sqlite_tclDecls.h
2016 sqlite_tcl.h: sqlite_tclDecls.h
2017 type "$(TCLINCDIR)\tcl.h" | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact tclDecls.h sqlite_tclDecls.h \
2018 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "typedef (.*?)\(Tcl_" "typedef \1 (SQLITE_TCLAPI Tcl_" \
2019 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact "void (*freeProc)" "void (SQLITE_TCLAPI *freeProc)" \
2020 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact "Tcl_HashEntry *(*findProc)" "Tcl_HashEntry *(SQLITE_TCLAPI *findProc)" \
2021 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact "Tcl_HashEntry *(*createProc)" "Tcl_HashEntry *(SQLITE_TCLAPI *createProc)" >> sqlite_tcl.h
2023 testfixture.exe: $(TESTFIXTURE_SRC) $(SQLITE3H) $(LIBRESOBJS) $(HDR) sqlite_tcl.h
2024 $(LTLINK) -DSQLITE_NO_SYNC=1 $(TESTFIXTURE_FLAGS) \
2025 -DBUILD_sqlite -I$(TCLINCDIR) \
2026 $(TESTFIXTURE_SRC) \
2027 /link $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
2029 extensiontest: testfixture.exe testloadext.dll
2030 @set PATH=$(LIBTCLPATH);$(PATH)
2031 .\testfixture.exe $(TOP)\test\loadext.test $(TESTOPTS)
2033 fulltest: $(TESTPROGS) fuzztest
2034 @set PATH=$(LIBTCLPATH);$(PATH)
2035 .\testfixture.exe $(TOP)\test\all.test $(TESTOPTS)
2037 soaktest: $(TESTPROGS)
2038 @set PATH=$(LIBTCLPATH);$(PATH)
2039 .\testfixture.exe $(TOP)\test\all.test -soak=1 $(TESTOPTS)
2041 fulltestonly: $(TESTPROGS) fuzztest
2042 @set PATH=$(LIBTCLPATH);$(PATH)
2043 .\testfixture.exe $(TOP)\test\full.test
2045 queryplantest: testfixture.exe shell
2046 @set PATH=$(LIBTCLPATH);$(PATH)
2047 .\testfixture.exe $(TOP)\test\permutations.test queryplanner $(TESTOPTS)
2049 fuzztest: fuzzcheck.exe
2050 .\fuzzcheck.exe $(FUZZDATA)
2052 fastfuzztest: fuzzcheck.exe
2053 .\fuzzcheck.exe --limit-mem 100M $(FUZZDATA)
2055 # Minimal testing that runs in less than 3 minutes (on a fast machine)
2057 quicktest: testfixture.exe sourcetest
2058 @set PATH=$(LIBTCLPATH);$(PATH)
2059 .\testfixture.exe $(TOP)\test\extraquick.test $(TESTOPTS)
2061 # This is the common case. Run many tests that do not take too long,
2062 # including fuzzcheck, sqlite3_analyzer, and sqldiff tests.
2064 test: $(TESTPROGS) sourcetest fastfuzztest
2065 @set PATH=$(LIBTCLPATH);$(PATH)
2066 .\testfixture.exe $(TOP)\test\veryquick.test $(TESTOPTS)
2068 smoketest: $(TESTPROGS)
2069 @set PATH=$(LIBTCLPATH);$(PATH)
2070 .\testfixture.exe $(TOP)\test\main.test $(TESTOPTS)
2072 sqlite3_analyzer.c: $(SQLITE3C) $(SQLITE3H) $(TOP)\src\tclsqlite.c $(TOP)\tool\spaceanal.tcl sqlite_tcl.h
2073 echo #define TCLSH 2 > $@
2074 echo #define SQLITE_ENABLE_DBSTAT_VTAB 1 >> $@
2075 copy $@ + $(SQLITE3C) + $(TOP)\src\tclsqlite.c $@
2076 echo static const char *tclsh_main_loop(void){ >> $@
2077 echo static const char *zMainloop = >> $@
2078 $(TCLSH_CMD) $(TOP)\tool\tostr.tcl $(TOP)\tool\spaceanal.tcl >> $@
2079 echo ; return zMainloop; } >> $@
2081 sqlite3_analyzer.exe: sqlite3_analyzer.c $(LIBRESOBJS)
2082 $(LTLINK) $(NO_WARN) -DBUILD_sqlite -I$(TCLINCDIR) sqlite3_analyzer.c \
2083 /link $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
2085 testloadext.lo: $(TOP)\src\test_loadext.c
2086 $(LTCOMPILE) $(NO_WARN) -c $(TOP)\src\test_loadext.c
2088 testloadext.dll: testloadext.lo
2089 $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /OUT:$@ testloadext.lo
2091 showdb.exe: $(TOP)\tool\showdb.c $(SQLITE3C) $(SQLITE3H)
2092 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
2093 $(TOP)\tool\showdb.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
2095 showstat4.exe: $(TOP)\tool\showstat4.c $(SQLITE3C) $(SQLITE3H)
2096 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
2097 $(TOP)\tool\showstat4.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
2099 showjournal.exe: $(TOP)\tool\showjournal.c $(SQLITE3C) $(SQLITE3H)
2100 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
2101 $(TOP)\tool\showjournal.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
2103 showwal.exe: $(TOP)\tool\showwal.c $(SQLITE3C) $(SQLITE3H)
2104 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
2105 $(TOP)\tool\showwal.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
2107 changeset.exe: $(TOP)\ext\session\changeset.c $(SQLITE3C)
2108 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
2109 $(TOP)\ext\session\changeset.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
2111 fts3view.exe: $(TOP)\ext\fts3\tool\fts3view.c $(SQLITE3C) $(SQLITE3H)
2112 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
2113 $(TOP)\ext\fts3\tool\fts3view.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
2115 rollback-test.exe: $(TOP)\tool\rollback-test.c $(SQLITE3C) $(SQLITE3H)
2116 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
2117 $(TOP)\tool\rollback-test.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
2119 LogEst.exe: $(TOP)\tool\logest.c $(SQLITE3H)
2120 $(LTLINK) $(NO_WARN) -Fe$@ $(TOP)\tool\LogEst.c /link $(LDFLAGS) $(LTLINKOPTS)
2122 wordcount.exe: $(TOP)\test\wordcount.c $(SQLITE3C) $(SQLITE3H)
2123 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
2124 $(TOP)\test\wordcount.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
2126 speedtest1.exe: $(TOP)\test\speedtest1.c $(SQLITE3C) $(SQLITE3H)
2127 $(LTLINK) $(NO_WARN) -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
2128 $(TOP)\test\speedtest1.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
2130 rbu.exe: $(TOP)\ext\rbu\rbu.c $(TOP)\ext\rbu\sqlite3rbu.c $(SQLITE3C) $(SQLITE3H)
2131 $(LTLINK) $(NO_WARN) -DSQLITE_ENABLE_RBU -Fe$@ \
2132 $(TOP)\ext\rbu\rbu.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
2135 del /Q $(SQLITE3C) $(SQLITE3H) 2>NUL
2139 del /Q *.exp *.lo *.ilk *.lib *.obj *.ncb *.pdb *.sdf *.suo 2>NUL
2140 del /Q *.bsc *.def *.cod *.da *.bb *.bbg *.vc gmon.out 2>NUL
2141 del /Q $(SQLITE3EXE) $(SQLITE3DLL) Replace.exe 2>NUL
2143 del /Q sqlite3.c sqlite3.h 2>NUL
2144 del /Q opcodes.c opcodes.h 2>NUL
2145 del /Q lemon.* lempar.c parse.* 2>NUL
2146 del /Q mkkeywordhash.* keywordhash.h 2>NUL
2147 del /Q notasharedlib.* 2>NUL
2148 -rmdir /Q/S .deps 2>NUL
2149 -rmdir /Q/S .libs 2>NUL
2150 -rmdir /Q/S tsrc 2>NUL
2151 del /Q .target_source 2>NUL
2152 del /Q tclsqlite3.exe sqlite_tcl.h sqlite_tclDecls.h 2>NUL
2153 del /Q testloadext.dll 2>NUL
2154 del /Q testfixture.exe test.db 2>NUL
2155 del /Q LogEst.exe fts3view.exe rollback-test.exe showdb.exe 2>NUL
2156 del /Q changeset.exe 2>NUL
2157 del /Q showjournal.exe showstat4.exe showwal.exe speedtest1.exe 2>NUL
2158 del /Q mptester.exe wordcount.exe rbu.exe srcck1.exe 2>NUL
2159 del /Q sqlite3.c sqlite3-*.c 2>NUL
2160 del /Q sqlite3rc.h 2>NUL
2161 del /Q shell.c sqlite3ext.h sqlite3session.h 2>NUL
2162 del /Q sqlite3_analyzer.exe sqlite3_analyzer.c 2>NUL
2163 del /Q sqlite-*-output.vsix 2>NUL
2164 del /Q fuzzershell.exe fuzzcheck.exe sqldiff.exe dbhash.exe 2>NUL
2165 del /Q fts5.* fts5parse.* 2>NUL