Revert "Merge sqlite-release(3.11.0) into prerelease-integration"
[sqlcipher.git] / Makefile.msc
blob51251fb82e9ee51c6c0f597249e300109c4a4d33
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".
11 TOP = .
13 # Set this non-0 to create and use the SQLite amalgamation file.
15 !IFNDEF USE_AMALGAMATION
16 USE_AMALGAMATION = 1
17 !ENDIF
19 # Set this non-0 to enable full warnings (-W4, etc) when compiling.
21 !IFNDEF USE_FULLWARN
22 USE_FULLWARN = 0
23 !ENDIF
25 # Set this non-0 to use "stdcall" calling convention for the core library
26 # and shell executable.
28 !IFNDEF USE_STDCALL
29 USE_STDCALL = 0
30 !ENDIF
32 # Set this non-0 to have the shell executable link against the core dynamic
33 # link library.
35 !IFNDEF DYNAMIC_SHELL
36 DYNAMIC_SHELL = 0
37 !ENDIF
39 # If necessary, create a list of harmless compiler warnings to disable when
40 # compiling the various tools.  For the SQLite source code itself, warnings,
41 # if any, will be disabled from within it.
43 !IFNDEF NO_WARN
44 !IF $(USE_FULLWARN)!=0
45 NO_WARN = -wd4054 -wd4055 -wd4100 -wd4127 -wd4130 -wd4152 -wd4189 -wd4206
46 NO_WARN = $(NO_WARN) -wd4210 -wd4232 -wd4244 -wd4305 -wd4306 -wd4702 -wd4706
47 !ENDIF
48 !ENDIF
50 # Set this non-0 to use the library paths and other options necessary for
51 # Windows Phone 8.1.
53 !IFNDEF USE_WP81_OPTS
54 USE_WP81_OPTS = 0
55 !ENDIF
57 # Set this non-0 to split the SQLite amalgamation file into chunks to
58 # be used for debugging with Visual Studio.
60 !IFNDEF SPLIT_AMALGAMATION
61 SPLIT_AMALGAMATION = 0
62 !ENDIF
64 # Set this non-0 to use the International Components for Unicode (ICU).
66 !IFNDEF USE_ICU
67 USE_ICU = 0
68 !ENDIF
70 # Set this non-0 to dynamically link to the MSVC runtime library.
72 !IFNDEF USE_CRT_DLL
73 USE_CRT_DLL = 0
74 !ENDIF
76 # Set this non-0 to link to the RPCRT4 library.
78 !IFNDEF USE_RPCRT4_LIB
79 USE_RPCRT4_LIB = 0
80 !ENDIF
82 # Set this non-0 to generate assembly code listings for the source code
83 # files.
85 !IFNDEF USE_LISTINGS
86 USE_LISTINGS = 0
87 !ENDIF
89 # Set this non-0 to attempt setting the native compiler automatically
90 # for cross-compiling the command line tools needed during the compilation
91 # process.
93 !IFNDEF XCOMPILE
94 XCOMPILE = 0
95 !ENDIF
97 # Set this non-0 to use the native libraries paths for cross-compiling
98 # the command line tools needed during the compilation process.
100 !IFNDEF USE_NATIVE_LIBPATHS
101 USE_NATIVE_LIBPATHS = 0
102 !ENDIF
104 # Set this 0 to skip the compiling and embedding of version resources.
106 !IFNDEF USE_RC
107 USE_RC = 1
108 !ENDIF
110 # Set this non-0 to compile binaries suitable for the WinRT environment.
111 # This setting does not apply to any binaries that require Tcl to operate
112 # properly (i.e. the text fixture, etc).
114 !IFNDEF FOR_WINRT
115 FOR_WINRT = 0
116 !ENDIF
118 # Set this non-0 to compile binaries suitable for the UAP environment.
119 # This setting does not apply to any binaries that require Tcl to operate
120 # properly (i.e. the text fixture, etc).
122 !IFNDEF FOR_UAP
123 FOR_UAP = 0
124 !ENDIF
126 # Set this non-0 to skip attempting to look for and/or link with the Tcl
127 # runtime library.
129 !IFNDEF NO_TCL
130 NO_TCL = 0
131 !ENDIF
133 # Set this to non-0 to create and use PDBs.
135 !IFNDEF SYMBOLS
136 SYMBOLS = 1
137 !ENDIF
139 # Set this to non-0 to use the SQLite debugging heap subsystem.
141 !IFNDEF MEMDEBUG
142 MEMDEBUG = 0
143 !ENDIF
145 # Set this to non-0 to use the Win32 native heap subsystem.
147 !IFNDEF WIN32HEAP
148 WIN32HEAP = 0
149 !ENDIF
151 # Set this to non-0 to enable OSTRACE() macros, which can be useful when
152 # debugging.
154 !IFNDEF OSTRACE
155 OSTRACE = 0
156 !ENDIF
158 # Set this to one of the following values to enable various debugging
159 # features.  Each level includes the debugging options from the previous
160 # levels.  Currently, the recognized values for DEBUG are:
162 # 0 == NDEBUG: Disables assert() and other runtime diagnostics.
163 # 1 == SQLITE_ENABLE_API_ARMOR: extra attempts to detect misuse of the API.
164 # 2 == Disables NDEBUG and all optimizations and then enables PDBs.
165 # 3 == SQLITE_DEBUG: Enables various diagnostics messages and code.
166 # 4 == SQLITE_WIN32_MALLOC_VALIDATE: Validate the Win32 native heap per call.
167 # 5 == SQLITE_DEBUG_OS_TRACE: Enables output from the OSTRACE() macros.
168 # 6 == SQLITE_ENABLE_IOTRACE: Enables output from the IOTRACE() macros.
170 !IFNDEF DEBUG
171 DEBUG = 0
172 !ENDIF
174 # Enable use of available compiler optimizations?  Normally, this should be
175 # non-zero.  Setting this to zero, thus disabling all compiler optimizations,
176 # can be useful for testing.
178 !IFNDEF OPTIMIZATIONS
179 OPTIMIZATIONS = 2
180 !ENDIF
182 # These are the "standard" SQLite compilation options used when compiling for
183 # the Windows platform.
185 !IFNDEF OPT_FEATURE_FLAGS
186 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS3=1
187 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RTREE=1
188 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_COLUMN_METADATA=1
189 !ENDIF
191 ###############################################################################
192 ############################### END OF OPTIONS ################################
193 ###############################################################################
195 # This assumes that MSVC is always installed in 32-bit Program Files directory
196 # and sets the variable for use in locating other 32-bit installs accordingly.
198 PROGRAMFILES_X86 = $(VCINSTALLDIR)\..\..
199 PROGRAMFILES_X86 = $(PROGRAMFILES_X86:\\=\)
201 # Check for the predefined command macro CC.  This should point to the compiler
202 # binary for the target platform.  If it is not defined, simply define it to
203 # the legacy default value 'cl.exe'.
205 !IFNDEF CC
206 CC = cl.exe
207 !ENDIF
209 # Check for the command macro LD.  This should point to the linker binary for
210 # the target platform.  If it is not defined, simply define it to the legacy
211 # default value 'link.exe'.
213 !IFNDEF LD
214 LD = link.exe
215 !ENDIF
217 # Check for the predefined command macro RC.  This should point to the resource
218 # compiler binary for the target platform.  If it is not defined, simply define
219 # it to the legacy default value 'rc.exe'.
221 !IFNDEF RC
222 RC = rc.exe
223 !ENDIF
225 # Check for the MSVC runtime library path macro.  Othertise, this value will
226 # default to the 'lib' directory underneath the MSVC installation directory.
228 !IFNDEF CRTLIBPATH
229 CRTLIBPATH = $(VCINSTALLDIR)\lib
230 !ENDIF
232 CRTLIBPATH = $(CRTLIBPATH:\\=\)
234 # Check for the command macro NCC.  This should point to the compiler binary
235 # for the platform the compilation process is taking place on.  If it is not
236 # defined, simply define it to have the same value as the CC macro.  When
237 # cross-compiling, it is suggested that this macro be modified via the command
238 # line (since nmake itself does not provide a built-in method to guess it).
239 # For example, to use the x86 compiler when cross-compiling for x64, a command
240 # line similar to the following could be used (all on one line):
242 #     nmake /f Makefile.msc sqlite3.dll
243 #           XCOMPILE=1 USE_NATIVE_LIBPATHS=1
245 # Alternatively, the full path and file name to the compiler binary for the
246 # platform the compilation process is taking place may be specified (all on
247 # one line):
249 #     nmake /f Makefile.msc sqlite3.dll
250 #           "NCC=""%VCINSTALLDIR%\bin\cl.exe"""
251 #           USE_NATIVE_LIBPATHS=1
253 !IFDEF NCC
254 NCC = $(NCC:\\=\)
255 !ELSEIF $(XCOMPILE)!=0
256 NCC = "$(VCINSTALLDIR)\bin\$(CC)"
257 NCC = $(NCC:\\=\)
258 !ELSE
259 NCC = $(CC)
260 !ENDIF
262 # Check for the MSVC native runtime library path macro.  Othertise,
263 # this value will default to the 'lib' directory underneath the MSVC
264 # installation directory.
266 !IFNDEF NCRTLIBPATH
267 NCRTLIBPATH = $(VCINSTALLDIR)\lib
268 !ENDIF
270 NCRTLIBPATH = $(NCRTLIBPATH:\\=\)
272 # Check for the Platform SDK library path macro.  Othertise, this
273 # value will default to the 'lib' directory underneath the Windows
274 # SDK installation directory (the environment variable used appears
275 # to be available when using Visual C++ 2008 or later via the
276 # command line).
278 !IFNDEF NSDKLIBPATH
279 NSDKLIBPATH = $(WINDOWSSDKDIR)\lib
280 !ENDIF
282 NSDKLIBPATH = $(NSDKLIBPATH:\\=\)
284 # C compiler and options for use in building executables that
285 # will run on the platform that is doing the build.
287 !IF $(USE_FULLWARN)!=0
288 BCC = $(NCC) -nologo -W4
289 !ELSE
290 BCC = $(NCC) -nologo -W3
291 !ENDIF
293 # Check if assembly code listings should be generated for the source
294 # code files to be compiled.
296 !IF $(USE_LISTINGS)!=0
297 BCC = $(BCC) -FAcs
298 !ENDIF
300 # Check if the native library paths should be used when compiling
301 # the command line tools used during the compilation process.  If
302 # so, set the necessary macro now.
304 !IF $(USE_NATIVE_LIBPATHS)!=0
305 NLTLIBPATHS = "/LIBPATH:$(NCRTLIBPATH)" "/LIBPATH:$(NSDKLIBPATH)"
307 !IFDEF NUCRTLIBPATH
308 NUCRTLIBPATH = $(NUCRTLIBPATH:\\=\)
309 NLTLIBPATHS = $(NLTLIBPATHS) "/LIBPATH:$(NUCRTLIBPATH)"
310 !ENDIF
311 !ENDIF
313 # C compiler and options for use in building executables that
314 # will run on the target platform.  (BCC and TCC are usually the
315 # same unless your are cross-compiling.)
317 !IF $(USE_FULLWARN)!=0
318 TCC = $(CC) -nologo -W4 -DINCLUDE_MSVC_H=1
319 !ELSE
320 TCC = $(CC) -nologo -W3
321 !ENDIF
323 TCC = $(TCC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) -I$(TOP)\src -fp:precise
324 RCC = $(RC) -DSQLITE_OS_WIN=1 -I$(TOP) -I$(TOP)\src
326 # Check if we want to use the "stdcall" calling convention when compiling.
327 # This is not supported by the compilers for non-x86 platforms.  It should
328 # also be noted here that building any target with these "stdcall" options
329 # will most likely fail if the Tcl library is also required.  This is due
330 # to how the Tcl library functions are declared and exported (i.e. without
331 # an explicit calling convention, which results in "cdecl").
333 !IF $(USE_STDCALL)!=0
334 !IF "$(PLATFORM)"=="x86"
335 CORE_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_STDCALL=__stdcall
336 SHELL_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_STDCALL=__stdcall
337 !ELSE
338 !IFNDEF PLATFORM
339 CORE_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_STDCALL=__stdcall
340 SHELL_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_STDCALL=__stdcall
341 !ELSE
342 CORE_CCONV_OPTS =
343 SHELL_CCONV_OPTS =
344 !ENDIF
345 !ENDIF
346 !ELSE
347 CORE_CCONV_OPTS =
348 SHELL_CCONV_OPTS =
349 !ENDIF
351 # These are additional compiler options used for the core library.
353 !IFNDEF CORE_COMPILE_OPTS
354 !IF $(DYNAMIC_SHELL)!=0
355 CORE_COMPILE_OPTS = $(CORE_CCONV_OPTS) -DSQLITE_API=__declspec(dllexport)
356 !ELSE
357 CORE_COMPILE_OPTS = $(CORE_CCONV_OPTS)
358 !ENDIF
359 !ENDIF
361 # These are the additional targets that the core library should depend on
362 # when linking.
364 !IFNDEF CORE_LINK_DEP
365 !IF $(DYNAMIC_SHELL)!=0
366 CORE_LINK_DEP =
367 !ELSE
368 CORE_LINK_DEP = sqlite3.def
369 !ENDIF
370 !ENDIF
372 # These are additional linker options used for the core library.
374 !IFNDEF CORE_LINK_OPTS
375 !IF $(DYNAMIC_SHELL)!=0
376 CORE_LINK_OPTS =
377 !ELSE
378 CORE_LINK_OPTS = /DEF:sqlite3.def
379 !ENDIF
380 !ENDIF
382 # These are additional compiler options used for the shell executable.
384 !IFNDEF SHELL_COMPILE_OPTS
385 !IF $(DYNAMIC_SHELL)!=0
386 SHELL_COMPILE_OPTS = $(SHELL_CCONV_OPTS) -DSQLITE_API=__declspec(dllimport)
387 !ELSE
388 SHELL_COMPILE_OPTS = $(SHELL_CCONV_OPTS)
389 !ENDIF
390 !ENDIF
392 # This is the core library that the shell executable should depend on.
394 !IFNDEF SHELL_CORE_DEP
395 !IF $(DYNAMIC_SHELL)!=0
396 SHELL_CORE_DEP = sqlite3.dll
397 !ELSE
398 SHELL_CORE_DEP = libsqlite3.lib
399 !ENDIF
400 !ENDIF
402 # This is the core library that the shell executable should link with.
404 !IFNDEF SHELL_CORE_LIB
405 !IF $(DYNAMIC_SHELL)!=0
406 SHELL_CORE_LIB = sqlite3.lib
407 !ELSE
408 SHELL_CORE_LIB = libsqlite3.lib
409 !ENDIF
410 !ENDIF
412 # These are additional linker options used for the shell executable.
414 !IFNDEF SHELL_LINK_OPTS
415 SHELL_LINK_OPTS = $(SHELL_CORE_LIB)
416 !ENDIF
418 # Check if assembly code listings should be generated for the source
419 # code files to be compiled.
421 !IF $(USE_LISTINGS)!=0
422 TCC = $(TCC) -FAcs
423 !ENDIF
425 # When compiling the library for use in the WinRT environment,
426 # the following compile-time options must be used as well to
427 # disable use of Win32 APIs that are not available and to enable
428 # use of Win32 APIs that are specific to Windows 8 and/or WinRT.
430 !IF $(FOR_WINRT)!=0
431 TCC = $(TCC) -DSQLITE_OS_WINRT=1
432 RCC = $(RCC) -DSQLITE_OS_WINRT=1
433 TCC = $(TCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
434 RCC = $(RCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
435 !ENDIF
437 # Also, we need to dynamically link to the correct MSVC runtime
438 # when compiling for WinRT (e.g. debug or release) OR if the
439 # USE_CRT_DLL option is set to force dynamically linking to the
440 # MSVC runtime library.
442 !IF $(FOR_WINRT)!=0 || $(USE_CRT_DLL)!=0
443 !IF $(DEBUG)>1
444 TCC = $(TCC) -MDd
445 BCC = $(BCC) -MDd
446 !ELSE
447 TCC = $(TCC) -MD
448 BCC = $(BCC) -MD
449 !ENDIF
450 !ELSE
451 !IF $(DEBUG)>1
452 TCC = $(TCC) -MTd
453 BCC = $(BCC) -MTd
454 !ELSE
455 TCC = $(TCC) -MT
456 BCC = $(BCC) -MT
457 !ENDIF
458 !ENDIF
460 # The mksqlite3c.tcl and mksqlite3h.tcl scripts will pull in
461 # any extension header files by default.  For non-amalgamation
462 # builds, we need to make sure the compiler can find these.
464 !IF $(USE_AMALGAMATION)==0
465 TCC = $(TCC) -I$(TOP)\ext\fts3
466 RCC = $(RCC) -I$(TOP)\ext\fts3
467 TCC = $(TCC) -I$(TOP)\ext\rtree
468 RCC = $(RCC) -I$(TOP)\ext\rtree
469 !ENDIF
471 # The mksqlite3c.tcl script accepts some options on the command
472 # line.  When compiling with debugging enabled, some of these
473 # options are necessary in order to allow debugging symbols to
474 # work correctly with Visual Studio when using the amalgamation.
476 !IFNDEF MKSQLITE3C_ARGS
477 !IF $(DEBUG)>1
478 MKSQLITE3C_ARGS = --linemacros
479 !ELSE
480 MKSQLITE3C_ARGS =
481 !ENDIF
482 !ENDIF
484 # Define -DNDEBUG to compile without debugging (i.e., for production usage)
485 # Omitting the define will cause extra debugging code to be inserted and
486 # includes extra comments when "EXPLAIN stmt" is used.
488 !IF $(DEBUG)==0
489 TCC = $(TCC) -DNDEBUG
490 BCC = $(BCC) -DNDEBUG
491 RCC = $(RCC) -DNDEBUG
492 !ENDIF
494 !IF $(DEBUG)>0
495 TCC = $(TCC) -DSQLITE_ENABLE_API_ARMOR
496 RCC = $(RCC) -DSQLITE_ENABLE_API_ARMOR
497 !ENDIF
499 !IF $(DEBUG)>2
500 TCC = $(TCC) -DSQLITE_DEBUG
501 RCC = $(RCC) -DSQLITE_DEBUG
502 !ENDIF
504 !IF $(DEBUG)>4 || $(OSTRACE)!=0
505 TCC = $(TCC) -DSQLITE_FORCE_OS_TRACE=1 -DSQLITE_DEBUG_OS_TRACE=1
506 RCC = $(RCC) -DSQLITE_FORCE_OS_TRACE=1 -DSQLITE_DEBUG_OS_TRACE=1
507 !ENDIF
509 !IF $(DEBUG)>5
510 TCC = $(TCC) -DSQLITE_ENABLE_IOTRACE
511 RCC = $(RCC) -DSQLITE_ENABLE_IOTRACE
512 !ENDIF
514 # Prevent warnings about "insecure" MSVC runtime library functions
515 # being used.
517 TCC = $(TCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
518 BCC = $(BCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
519 RCC = $(RCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
521 # Prevent warnings about "deprecated" POSIX functions being used.
523 TCC = $(TCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
524 BCC = $(BCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
525 RCC = $(RCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
527 # Use the SQLite debugging heap subsystem?
529 !IF $(MEMDEBUG)!=0
530 TCC = $(TCC) -DSQLITE_MEMDEBUG=1
531 RCC = $(RCC) -DSQLITE_MEMDEBUG=1
533 # Use native Win32 heap subsystem instead of malloc/free?
535 !ELSEIF $(WIN32HEAP)!=0
536 TCC = $(TCC) -DSQLITE_WIN32_MALLOC=1
537 RCC = $(RCC) -DSQLITE_WIN32_MALLOC=1
539 # Validate the heap on every call into the native Win32 heap subsystem?
541 !IF $(DEBUG)>3
542 TCC = $(TCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1
543 RCC = $(RCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1
544 !ENDIF
545 !ENDIF
547 # The locations of the Tcl header and library files.  Also, the library that
548 # non-stubs enabled programs using Tcl must link against.  These variables
549 # (TCLINCDIR, TCLLIBDIR, and LIBTCL) may be overridden via the environment
550 # prior to running nmake in order to match the actual installed location and
551 # version on this machine.
553 !IFNDEF TCLINCDIR
554 TCLINCDIR = c:\tcl\include
555 !ENDIF
557 !IFNDEF TCLLIBDIR
558 TCLLIBDIR = c:\tcl\lib
559 !ENDIF
561 !IFNDEF LIBTCL
562 LIBTCL = tcl85.lib
563 !ENDIF
565 # The locations of the ICU header and library files.  These variables
566 # (ICUINCDIR, ICULIBDIR, and LIBICU) may be overridden via the environment
567 # prior to running nmake in order to match the actual installed location on
568 # this machine.
570 !IFNDEF ICUINCDIR
571 ICUINCDIR = c:\icu\include
572 !ENDIF
574 !IFNDEF ICULIBDIR
575 ICULIBDIR = c:\icu\lib
576 !ENDIF
578 !IFNDEF LIBICU
579 LIBICU = icuuc.lib icuin.lib
580 !ENDIF
582 # This is the command to use for tclsh - normally just "tclsh", but we may
583 # know the specific version we want to use.  This variable (TCLSH_CMD) may be
584 # overridden via the environment prior to running nmake in order to select a
585 # specific Tcl shell to use.
587 !IFNDEF TCLSH_CMD
588 TCLSH_CMD = tclsh85
589 !ENDIF
591 # Compiler options needed for programs that use the readline() library.
593 !IFNDEF READLINE_FLAGS
594 READLINE_FLAGS = -DHAVE_READLINE=0
595 !ENDIF
597 # The library that programs using readline() must link against.
599 !IFNDEF LIBREADLINE
600 LIBREADLINE =
601 !ENDIF
603 # Should the database engine be compiled threadsafe
605 TCC = $(TCC) -DSQLITE_THREADSAFE=1
606 RCC = $(RCC) -DSQLITE_THREADSAFE=1
608 # Do threads override each others locks by default (1), or do we test (-1)
610 TCC = $(TCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1
611 RCC = $(RCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1
613 # Any target libraries which libsqlite must be linked against
615 !IFNDEF TLIBS
616 TLIBS =
617 !ENDIF
619 # Flags controlling use of the in memory btree implementation
621 # SQLITE_TEMP_STORE is 0 to force temporary tables to be in a file, 1 to
622 # default to file, 2 to default to memory, and 3 to force temporary
623 # tables to always be in memory.
625 TCC = $(TCC) -DSQLITE_TEMP_STORE=1
626 RCC = $(RCC) -DSQLITE_TEMP_STORE=1
628 # Enable/disable loadable extensions, and other optional features
629 # based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*).
630 # The same set of OMIT and ENABLE flags should be passed to the
631 # LEMON parser generator and the mkkeywordhash tool as well.
633 # These are the required SQLite compilation options used when compiling for
634 # the Windows platform.
636 REQ_FEATURE_FLAGS = $(REQ_FEATURE_FLAGS) -DSQLITE_MAX_TRIGGER_DEPTH=100
638 # If we are linking to the RPCRT4 library, enable features that need it.
640 !IF $(USE_RPCRT4_LIB)!=0
641 REQ_FEATURE_FLAGS = $(REQ_FEATURE_FLAGS) -DSQLITE_WIN32_USE_UUID=1
642 !ENDIF
644 # Add the required and optional SQLite compilation options into the command
645 # lines used to invoke the MSVC code and resource compilers.
647 TCC = $(TCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS)
648 RCC = $(RCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS)
650 # Add in any optional parameters specified on the commane line, e.g.
651 # nmake /f Makefile.msc all "OPTS=-DSQLITE_ENABLE_FOO=1 -DSQLITE_OMIT_FOO=1"
653 TCC = $(TCC) $(OPTS)
654 RCC = $(RCC) $(OPTS)
656 # If compiling for debugging, add some defines.
658 !IF $(DEBUG)>1
659 TCC = $(TCC) -D_DEBUG
660 BCC = $(BCC) -D_DEBUG
661 RCC = $(RCC) -D_DEBUG
662 !ENDIF
664 # If optimizations are enabled or disabled (either implicitly or
665 # explicitly), add the necessary flags.
667 !IF $(DEBUG)>1 || $(OPTIMIZATIONS)==0
668 TCC = $(TCC) -Od
669 BCC = $(BCC) -Od
670 !ELSEIF $(OPTIMIZATIONS)>=3
671 TCC = $(TCC) -Ox
672 BCC = $(BCC) -Ox
673 !ELSEIF $(OPTIMIZATIONS)==2
674 TCC = $(TCC) -O2
675 BCC = $(BCC) -O2
676 !ELSEIF $(OPTIMIZATIONS)==1
677 TCC = $(TCC) -O1
678 BCC = $(BCC) -O1
679 !ENDIF
681 # If symbols are enabled (or compiling for debugging), enable PDBs.
683 !IF $(DEBUG)>1 || $(SYMBOLS)!=0
684 TCC = $(TCC) -Zi
685 BCC = $(BCC) -Zi
686 !ENDIF
688 # If ICU support is enabled, add the compiler options for it.
690 !IF $(USE_ICU)!=0
691 TCC = $(TCC) -DSQLITE_ENABLE_ICU=1
692 RCC = $(RCC) -DSQLITE_ENABLE_ICU=1
693 TCC = $(TCC) -I$(TOP)\ext\icu
694 RCC = $(RCC) -I$(TOP)\ext\icu
695 TCC = $(TCC) -I$(ICUINCDIR)
696 RCC = $(RCC) -I$(ICUINCDIR)
697 !ENDIF
699 # Command line prefixes for compiling code, compiling resources,
700 # linking, etc.
702 LTCOMPILE = $(TCC) -Fo$@
703 LTRCOMPILE = $(RCC) -r
704 LTLIB = lib.exe
705 LTLINK = $(TCC) -Fe$@
707 # If requested, link to the RPCRT4 library.
709 !IF $(USE_RPCRT4_LIB)!=0
710 LTLINK = $(LTLINK) rpcrt4.lib
711 !ENDIF
713 # If a platform was set, force the linker to target that.
714 # Note that the vcvars*.bat family of batch files typically
715 # set this for you.  Otherwise, the linker will attempt
716 # to deduce the binary type based on the object files.
717 !IFDEF PLATFORM
718 LTLINKOPTS = /NOLOGO /MACHINE:$(PLATFORM)
719 LTLIBOPTS = /NOLOGO /MACHINE:$(PLATFORM)
720 !ELSE
721 LTLINKOPTS = /NOLOGO
722 LTLIBOPTS = /NOLOGO
723 !ENDIF
725 # When compiling for use in the WinRT environment, the following
726 # linker option must be used to mark the executable as runnable
727 # only in the context of an application container.
729 !IF $(FOR_WINRT)!=0
730 LTLINKOPTS = $(LTLINKOPTS) /APPCONTAINER
731 !IF "$(VISUALSTUDIOVERSION)"=="12.0" || "$(VISUALSTUDIOVERSION)"=="14.0"
732 !IFNDEF STORELIBPATH
733 !IF "$(PLATFORM)"=="x86"
734 STORELIBPATH = $(CRTLIBPATH)\store
735 !ELSEIF "$(PLATFORM)"=="x64"
736 STORELIBPATH = $(CRTLIBPATH)\store\amd64
737 !ELSEIF "$(PLATFORM)"=="ARM"
738 STORELIBPATH = $(CRTLIBPATH)\store\arm
739 !ELSE
740 STORELIBPATH = $(CRTLIBPATH)\store
741 !ENDIF
742 !ENDIF
743 STORELIBPATH = $(STORELIBPATH:\\=\)
744 LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(STORELIBPATH)"
745 !ENDIF
746 !ENDIF
748 # When compiling for Windows Phone 8.1, an extra library path is
749 # required.
751 !IF $(USE_WP81_OPTS)!=0
752 !IFNDEF WP81LIBPATH
753 !IF "$(PLATFORM)"=="x86"
754 WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86
755 !ELSEIF "$(PLATFORM)"=="ARM"
756 WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\ARM
757 !ELSE
758 WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86
759 !ENDIF
760 !ENDIF
761 !ENDIF
763 # When compiling for Windows Phone 8.1, some extra linker options
764 # are also required.
766 !IF $(USE_WP81_OPTS)!=0
767 !IFDEF WP81LIBPATH
768 LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(WP81LIBPATH)"
769 !ENDIF
770 LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE
771 LTLINKOPTS = $(LTLINKOPTS) WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelHost.lib
772 LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:kernel32.lib /NODEFAULTLIB:ole32.lib
773 !ENDIF
775 # When compiling for UAP, some extra linker options are also required.
777 !IF $(FOR_UAP)!=0
778 LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE /NODEFAULTLIB:kernel32.lib
779 LTLINKOPTS = $(LTLINKOPTS) mincore.lib
780 !IFDEF PSDKLIBPATH
781 LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(PSDKLIBPATH)"
782 !ENDIF
783 !ENDIF
785 # If either debugging or symbols are enabled, enable PDBs.
787 !IF $(DEBUG)>1 || $(SYMBOLS)!=0
788 LDFLAGS = /DEBUG
789 !ENDIF
791 # Start with the Tcl related linker options.
793 !IF $(NO_TCL)==0
794 LTLIBPATHS = /LIBPATH:$(TCLLIBDIR)
795 LTLIBS = $(LIBTCL)
796 !ENDIF
798 # If ICU support is enabled, add the linker options for it.
800 !IF $(USE_ICU)!=0
801 LTLIBPATHS = $(LTLIBPATHS) /LIBPATH:$(ICULIBDIR)
802 LTLIBS = $(LTLIBS) $(LIBICU)
803 !ENDIF
805 # nawk compatible awk.
807 !IFNDEF NAWK
808 NAWK = gawk.exe
809 !ENDIF
811 # You should not have to change anything below this line
812 ###############################################################################
814 # Object files for the SQLite library (non-amalgamation).
816 LIBOBJS0 = vdbe.lo parse.lo alter.lo analyze.lo attach.lo auth.lo \
817          backup.lo bitvec.lo btmutex.lo btree.lo build.lo \
818          callback.lo complete.lo ctime.lo date.lo dbstat.lo delete.lo \
819          expr.lo fault.lo fkey.lo \
820          fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo \
821          fts3_porter.lo fts3_snippet.lo fts3_tokenizer.lo fts3_tokenizer1.lo \
822          fts3_tokenize_vtab.lo fts3_unicode.lo fts3_unicode2.lo fts3_write.lo \
823          func.lo global.lo hash.lo \
824          icu.lo insert.lo journal.lo legacy.lo loadext.lo \
825          main.lo malloc.lo mem0.lo mem1.lo mem2.lo mem3.lo mem5.lo \
826          memjournal.lo \
827          mutex.lo mutex_noop.lo mutex_unix.lo mutex_w32.lo \
828          notify.lo opcodes.lo os.lo os_unix.lo os_win.lo \
829          pager.lo pcache.lo pcache1.lo pragma.lo prepare.lo printf.lo \
830          random.lo resolve.lo rowset.lo rtree.lo select.lo status.lo \
831          table.lo threads.lo tokenize.lo trigger.lo \
832          update.lo util.lo vacuum.lo \
833          vdbeapi.lo vdbeaux.lo vdbeblob.lo vdbemem.lo vdbesort.lo \
834          vdbetrace.lo wal.lo walker.lo where.lo utf.lo vtab.lo
836 # Object files for the amalgamation.
838 LIBOBJS1 = sqlite3.lo
840 # Determine the real value of LIBOBJ based on the 'configure' script
842 !IF $(USE_AMALGAMATION)==0
843 LIBOBJ = $(LIBOBJS0)
844 !ELSE
845 LIBOBJ = $(LIBOBJS1)
846 !ENDIF
848 # Determine if embedded resource compilation and usage are enabled.
850 !IF $(USE_RC)!=0
851 LIBRESOBJS = sqlite3res.lo
852 !ELSE
853 LIBRESOBJS =
854 !ENDIF
856 # All of the source code files.
858 SRC1 = \
859         $(TOP)\src\crypto.c \
860         $(TOP)\src\crypto_cc.c \
861         $(TOP)\src\crypto_impl.c \
862         $(TOP)\src\crypto_libtomcrypt.c \
863         $(TOP)\src\crypto_openssl.c \
864         $(TOP)\src\crypto.h \
865         $(TOP)\src\sqlcipher.h \
866   $(TOP)\src\alter.c \
867   $(TOP)\src\analyze.c \
868   $(TOP)\src\attach.c \
869   $(TOP)\src\auth.c \
870   $(TOP)\src\backup.c \
871   $(TOP)\src\bitvec.c \
872   $(TOP)\src\btmutex.c \
873   $(TOP)\src\btree.c \
874   $(TOP)\src\btree.h \
875   $(TOP)\src\btreeInt.h \
876   $(TOP)\src\build.c \
877   $(TOP)\src\callback.c \
878   $(TOP)\src\complete.c \
879   $(TOP)\src\ctime.c \
880   $(TOP)\src\date.c \
881   $(TOP)\src\dbstat.c \
882   $(TOP)\src\delete.c \
883   $(TOP)\src\expr.c \
884   $(TOP)\src\fault.c \
885   $(TOP)\src\fkey.c \
886   $(TOP)\src\func.c \
887   $(TOP)\src\global.c \
888   $(TOP)\src\hash.c \
889   $(TOP)\src\hash.h \
890   $(TOP)\src\hwtime.h \
891   $(TOP)\src\insert.c \
892   $(TOP)\src\journal.c \
893   $(TOP)\src\legacy.c \
894   $(TOP)\src\loadext.c \
895   $(TOP)\src\main.c \
896   $(TOP)\src\malloc.c \
897   $(TOP)\src\mem0.c \
898   $(TOP)\src\mem1.c \
899   $(TOP)\src\mem2.c \
900   $(TOP)\src\mem3.c \
901   $(TOP)\src\mem5.c \
902   $(TOP)\src\memjournal.c \
903   $(TOP)\src\msvc.h \
904   $(TOP)\src\mutex.c \
905   $(TOP)\src\mutex.h \
906   $(TOP)\src\mutex_noop.c \
907   $(TOP)\src\mutex_unix.c \
908   $(TOP)\src\mutex_w32.c \
909   $(TOP)\src\notify.c \
910   $(TOP)\src\os.c \
911   $(TOP)\src\os.h \
912   $(TOP)\src\os_common.h \
913   $(TOP)\src\os_setup.h \
914   $(TOP)\src\os_unix.c \
915   $(TOP)\src\os_win.c \
916   $(TOP)\src\os_win.h
917 SRC2 = \
918   $(TOP)\src\pager.c \
919   $(TOP)\src\pager.h \
920   $(TOP)\src\parse.y \
921   $(TOP)\src\pcache.c \
922   $(TOP)\src\pcache.h \
923   $(TOP)\src\pcache1.c \
924   $(TOP)\src\pragma.c \
925   $(TOP)\src\pragma.h \
926   $(TOP)\src\prepare.c \
927   $(TOP)\src\printf.c \
928   $(TOP)\src\random.c \
929   $(TOP)\src\resolve.c \
930   $(TOP)\src\rowset.c \
931   $(TOP)\src\select.c \
932   $(TOP)\src\status.c \
933   $(TOP)\src\shell.c \
934   $(TOP)\src\sqlite.h.in \
935   $(TOP)\src\sqlite3ext.h \
936   $(TOP)\src\sqliteInt.h \
937   $(TOP)\src\sqliteLimit.h \
938   $(TOP)\src\table.c \
939   $(TOP)\src\threads.c \
940   $(TOP)\src\tclsqlite.c \
941   $(TOP)\src\tokenize.c \
942   $(TOP)\src\trigger.c \
943   $(TOP)\src\utf.c \
944   $(TOP)\src\update.c \
945   $(TOP)\src\util.c \
946   $(TOP)\src\vacuum.c \
947   $(TOP)\src\vdbe.c \
948   $(TOP)\src\vdbe.h \
949   $(TOP)\src\vdbeapi.c \
950   $(TOP)\src\vdbeaux.c \
951   $(TOP)\src\vdbeblob.c \
952   $(TOP)\src\vdbemem.c \
953   $(TOP)\src\vdbesort.c \
954   $(TOP)\src\vdbetrace.c \
955   $(TOP)\src\vdbeInt.h \
956   $(TOP)\src\vtab.c \
957   $(TOP)\src\vxworks.h \
958   $(TOP)\src\wal.c \
959   $(TOP)\src\wal.h \
960   $(TOP)\src\walker.c \
961   $(TOP)\src\where.c \
962   $(TOP)\src\whereInt.h
964 # Source code for extensions
966 SRC3 = \
967   $(TOP)\ext\fts1\fts1.c \
968   $(TOP)\ext\fts1\fts1.h \
969   $(TOP)\ext\fts1\fts1_hash.c \
970   $(TOP)\ext\fts1\fts1_hash.h \
971   $(TOP)\ext\fts1\fts1_porter.c \
972   $(TOP)\ext\fts1\fts1_tokenizer.h \
973   $(TOP)\ext\fts1\fts1_tokenizer1.c \
974   $(TOP)\ext\fts2\fts2.c \
975   $(TOP)\ext\fts2\fts2.h \
976   $(TOP)\ext\fts2\fts2_hash.c \
977   $(TOP)\ext\fts2\fts2_hash.h \
978   $(TOP)\ext\fts2\fts2_icu.c \
979   $(TOP)\ext\fts2\fts2_porter.c \
980   $(TOP)\ext\fts2\fts2_tokenizer.h \
981   $(TOP)\ext\fts2\fts2_tokenizer.c \
982   $(TOP)\ext\fts2\fts2_tokenizer1.c
983 SRC4 = \
984   $(TOP)\ext\fts3\fts3.c \
985   $(TOP)\ext\fts3\fts3.h \
986   $(TOP)\ext\fts3\fts3Int.h \
987   $(TOP)\ext\fts3\fts3_aux.c \
988   $(TOP)\ext\fts3\fts3_expr.c \
989   $(TOP)\ext\fts3\fts3_hash.c \
990   $(TOP)\ext\fts3\fts3_hash.h \
991   $(TOP)\ext\fts3\fts3_icu.c \
992   $(TOP)\ext\fts3\fts3_porter.c \
993   $(TOP)\ext\fts3\fts3_snippet.c \
994   $(TOP)\ext\fts3\fts3_tokenizer.h \
995   $(TOP)\ext\fts3\fts3_tokenizer.c \
996   $(TOP)\ext\fts3\fts3_tokenizer1.c \
997   $(TOP)\ext\fts3\fts3_tokenize_vtab.c \
998   $(TOP)\ext\fts3\fts3_unicode.c \
999   $(TOP)\ext\fts3\fts3_unicode2.c \
1000   $(TOP)\ext\fts3\fts3_write.c \
1001   $(TOP)\ext\icu\sqliteicu.h \
1002   $(TOP)\ext\icu\icu.c \
1003   $(TOP)\ext\rtree\rtree.h \
1004   $(TOP)\ext\rtree\rtree.c
1007 # Generated source code files
1009 SRC5 = \
1010   keywordhash.h \
1011   opcodes.c \
1012   opcodes.h \
1013   parse.c \
1014   parse.h \
1015   sqlite3.h
1017 # All source code files.
1019 SRC = $(SRC1) $(SRC2) $(SRC3) $(SRC4) $(SRC5)
1021 # Source code to the test files.
1023 TESTSRC = \
1024   $(TOP)\src\test1.c \
1025   $(TOP)\src\test2.c \
1026   $(TOP)\src\test3.c \
1027   $(TOP)\src\test4.c \
1028   $(TOP)\src\test5.c \
1029   $(TOP)\src\test6.c \
1030   $(TOP)\src\test7.c \
1031   $(TOP)\src\test8.c \
1032   $(TOP)\src\test9.c \
1033   $(TOP)\src\test_autoext.c \
1034   $(TOP)\src\test_async.c \
1035   $(TOP)\src\test_backup.c \
1036   $(TOP)\src\test_blob.c \
1037   $(TOP)\src\test_btree.c \
1038   $(TOP)\src\test_config.c \
1039   $(TOP)\src\test_demovfs.c \
1040   $(TOP)\src\test_devsym.c \
1041   $(TOP)\src\test_fs.c \
1042   $(TOP)\src\test_func.c \
1043   $(TOP)\src\test_hexio.c \
1044   $(TOP)\src\test_init.c \
1045   $(TOP)\src\test_intarray.c \
1046   $(TOP)\src\test_journal.c \
1047   $(TOP)\src\test_malloc.c \
1048   $(TOP)\src\test_multiplex.c \
1049   $(TOP)\src\test_mutex.c \
1050   $(TOP)\src\test_onefile.c \
1051   $(TOP)\src\test_osinst.c \
1052   $(TOP)\src\test_pcache.c \
1053   $(TOP)\src\test_quota.c \
1054   $(TOP)\src\test_rtree.c \
1055   $(TOP)\src\test_schema.c \
1056   $(TOP)\src\test_server.c \
1057   $(TOP)\src\test_superlock.c \
1058   $(TOP)\src\test_syscall.c \
1059   $(TOP)\src\test_tclvar.c \
1060   $(TOP)\src\test_thread.c \
1061   $(TOP)\src\test_vfs.c \
1062   $(TOP)\src\test_wsd.c \
1063   $(TOP)\ext\fts3\fts3_term.c \
1064   $(TOP)\ext\fts3\fts3_test.c
1066 # Statically linked extensions
1068 TESTEXT = \
1069   $(TOP)\ext\misc\amatch.c \
1070   $(TOP)\ext\misc\closure.c \
1071   $(TOP)\ext\misc\eval.c \
1072   $(TOP)\ext\misc\fileio.c \
1073   $(TOP)\ext\misc\fuzzer.c \
1074   $(TOP)\ext\misc\ieee754.c \
1075   $(TOP)\ext\misc\nextchar.c \
1076   $(TOP)\ext\misc\percentile.c \
1077   $(TOP)\ext\misc\regexp.c \
1078   $(TOP)\ext\misc\spellfix.c \
1079   $(TOP)\ext\misc\totype.c \
1080   $(TOP)\ext\misc\wholenumber.c
1083 # Source code to the library files needed by the test fixture
1085 TESTSRC2 = \
1086   $(TOP)\src\attach.c \
1087   $(TOP)\src\backup.c \
1088   $(TOP)\src\bitvec.c \
1089   $(TOP)\src\btree.c \
1090   $(TOP)\src\build.c \
1091   $(TOP)\src\ctime.c \
1092   $(TOP)\src\date.c \
1093   $(TOP)\src\dbstat.c \
1094   $(TOP)\src\expr.c \
1095   $(TOP)\src\func.c \
1096   $(TOP)\src\insert.c \
1097   $(TOP)\src\wal.c \
1098   $(TOP)\src\main.c \
1099   $(TOP)\src\mem5.c \
1100   $(TOP)\src\os.c \
1101   $(TOP)\src\os_unix.c \
1102   $(TOP)\src\os_win.c \
1103   $(TOP)\src\pager.c \
1104   $(TOP)\src\pragma.c \
1105   $(TOP)\src\prepare.c \
1106   $(TOP)\src\printf.c \
1107   $(TOP)\src\random.c \
1108   $(TOP)\src\pcache.c \
1109   $(TOP)\src\pcache1.c \
1110   $(TOP)\src\select.c \
1111   $(TOP)\src\tokenize.c \
1112   $(TOP)\src\utf.c \
1113   $(TOP)\src\util.c \
1114   $(TOP)\src\vdbeapi.c \
1115   $(TOP)\src\vdbeaux.c \
1116   $(TOP)\src\vdbe.c \
1117   $(TOP)\src\vdbemem.c \
1118   $(TOP)\src\vdbesort.c \
1119   $(TOP)\src\vdbetrace.c \
1120   $(TOP)\src\where.c \
1121   parse.c \
1122   $(TOP)\ext\fts3\fts3.c \
1123   $(TOP)\ext\fts3\fts3_aux.c \
1124   $(TOP)\ext\fts3\fts3_expr.c \
1125   $(TOP)\ext\fts3\fts3_tokenizer.c \
1126   $(TOP)\ext\fts3\fts3_tokenize_vtab.c \
1127   $(TOP)\ext\fts3\fts3_unicode.c \
1128   $(TOP)\ext\fts3\fts3_unicode2.c \
1129   $(TOP)\ext\fts3\fts3_write.c \
1130   $(TOP)\ext\async\sqlite3async.c
1132 # Header files used by all library source files.
1134 HDR = \
1135    $(TOP)\src\btree.h \
1136    $(TOP)\src\btreeInt.h \
1137    $(TOP)\src\hash.h \
1138    $(TOP)\src\hwtime.h \
1139    keywordhash.h \
1140    $(TOP)\src\msvc.h \
1141    $(TOP)\src\mutex.h \
1142    opcodes.h \
1143    $(TOP)\src\os.h \
1144    $(TOP)\src\os_common.h \
1145    $(TOP)\src\os_setup.h \
1146    $(TOP)\src\os_win.h \
1147    $(TOP)\src\pager.h \
1148    $(TOP)\src\pcache.h \
1149    parse.h \
1150    $(TOP)\src\pragma.h \
1151    sqlite3.h \
1152    $(TOP)\src\sqlite3ext.h \
1153    $(TOP)\src\sqliteInt.h \
1154    $(TOP)\src\sqliteLimit.h \
1155    $(TOP)\src\vdbe.h \
1156    $(TOP)\src\vdbeInt.h \
1157    $(TOP)\src\vxworks.h \
1158    $(TOP)\src\whereInt.h
1160 # Header files used by extensions
1162 EXTHDR = $(EXTHDR) \
1163   $(TOP)\ext\fts1\fts1.h \
1164   $(TOP)\ext\fts1\fts1_hash.h \
1165   $(TOP)\ext\fts1\fts1_tokenizer.h
1166 EXTHDR = $(EXTHDR) \
1167   $(TOP)\ext\fts2\fts2.h \
1168   $(TOP)\ext\fts2\fts2_hash.h \
1169   $(TOP)\ext\fts2\fts2_tokenizer.h
1170 EXTHDR = $(EXTHDR) \
1171   $(TOP)\ext\fts3\fts3.h \
1172   $(TOP)\ext\fts3\fts3Int.h \
1173   $(TOP)\ext\fts3\fts3_hash.h \
1174   $(TOP)\ext\fts3\fts3_tokenizer.h
1175 EXTHDR = $(EXTHDR) \
1176   $(TOP)\ext\rtree\rtree.h
1177 EXTHDR = $(EXTHDR) \
1178   $(TOP)\ext\icu\sqliteicu.h
1179 EXTHDR = $(EXTHDR) \
1180   $(TOP)\ext\rtree\sqlite3rtree.h
1182 # This is the default Makefile target.  The objects listed here
1183 # are what get build when you type just "make" with no arguments.
1185 all:    dll libsqlite3.lib sqlite3.exe libtclsqlite3.lib
1187 libsqlite3.lib: $(LIBOBJ)
1188         $(LTLIB) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS)
1190 libtclsqlite3.lib:      tclsqlite.lo libsqlite3.lib
1191         $(LTLIB) $(LTLIBOPTS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCL:tcl=tclstub) $(TLIBS)
1193 sqlite3.exe:    $(TOP)\src\shell.c $(SHELL_CORE_DEP) $(LIBRESOBJS) sqlite3.h
1194         $(LTLINK) $(SHELL_COMPILE_OPTS) $(READLINE_FLAGS) $(TOP)\src\shell.c \
1195                 /link /pdb:sqlite3sh.pdb $(LTLINKOPTS) $(SHELL_LINK_OPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS)
1197 sqldiff.exe:    $(TOP)\tool\sqldiff.c sqlite3.c sqlite3.h
1198         $(LTLINK) $(TOP)\tool\sqldiff.c sqlite3.c
1200 fuzzershell.exe:        $(TOP)\tool\fuzzershell.c sqlite3.c sqlite3.h
1201         $(LTLINK) $(TOP)\tool\fuzzershell.c sqlite3.c
1203 mptester.exe:   $(TOP)\mptest\mptest.c $(SHELL_CORE_DEP) $(LIBRESOBJS) sqlite3.h
1204         $(LTLINK) $(SHELL_COMPILE_OPTS) $(TOP)\mptest\mptest.c \
1205                 /link $(LTLINKOPTS) $(LTLIBPATHS) $(SHELL_LINK_OPTS) $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS)
1207 MPTEST1 = mptester mptest.db $(TOP)\mptest\crash01.test --repeat 20
1208 MPTEST2 = mptester mptest.db $(TOP)\mptest\multiwrite01.test --repeat 20
1210 mptest: mptester.exe
1211         del /Q mptest.db 2>NUL
1212         $(MPTEST1) --journalmode DELETE
1213         $(MPTEST2) --journalmode WAL
1214         $(MPTEST1) --journalmode WAL
1215         $(MPTEST2) --journalmode PERSIST
1216         $(MPTEST1) --journalmode PERSIST
1217         $(MPTEST2) --journalmode TRUNCATE
1218         $(MPTEST1) --journalmode TRUNCATE
1219         $(MPTEST2) --journalmode DELETE
1221 # This target creates a directory named "tsrc" and fills it with
1222 # copies of all of the C source code and header files needed to
1223 # build on the target system.  Some of the C source code and header
1224 # files are automatically generated.  This target takes care of
1225 # all that automatic generation.
1227 .target_source: $(SRC) $(TOP)\tool\vdbe-compress.tcl
1228         -rmdir /Q/S tsrc 2>NUL
1229         -mkdir tsrc
1230         for %i in ($(SRC1)) do copy /Y %i tsrc
1231         for %i in ($(SRC2)) do copy /Y %i tsrc
1232         for %i in ($(SRC3)) do copy /Y %i tsrc
1233         for %i in ($(SRC4)) do copy /Y %i tsrc
1234         for %i in ($(SRC5)) do copy /Y %i tsrc
1235         del /Q tsrc\sqlite.h.in tsrc\parse.y 2>NUL
1236         $(TCLSH_CMD) $(TOP)\tool\vdbe-compress.tcl $(OPTS) < tsrc\vdbe.c > vdbe.new
1237         move vdbe.new tsrc\vdbe.c
1238         echo > .target_source
1240 sqlite3.c:      .target_source $(TOP)\tool\mksqlite3c.tcl
1241         $(TCLSH_CMD) $(TOP)\tool\mksqlite3c.tcl $(MKSQLITE3C_ARGS)
1242         copy tsrc\shell.c .
1243         copy tsrc\sqlite3ext.h .
1245 sqlite3-all.c:  sqlite3.c $(TOP)\tool\split-sqlite3c.tcl
1246         $(TCLSH_CMD) $(TOP)\tool\split-sqlite3c.tcl
1248 # Set the source code file to be used by executables and libraries when
1249 # they need the amalgamation.
1251 !IF $(SPLIT_AMALGAMATION)!=0
1252 SQLITE3C = sqlite3-all.c
1253 !ELSE
1254 SQLITE3C = sqlite3.c
1255 !ENDIF
1257 # Rule to build the amalgamation
1259 sqlite3.lo:     $(SQLITE3C)
1260         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(SQLITE3C)
1262 # Rules to build the LEMON compiler generator
1264 lempar.c:       $(TOP)\src\lempar.c
1265         copy $(TOP)\src\lempar.c .
1267 lemon.exe:      $(TOP)\tool\lemon.c lempar.c
1268         $(BCC) $(NO_WARN) -Daccess=_access \
1269                 -Fe$@ $(TOP)\tool\lemon.c /link $(NLTLINKOPTS) $(NLTLIBPATHS)
1271 # Rules to build individual *.lo files from generated *.c files. This
1272 # applies to:
1274 #     parse.lo
1275 #     opcodes.lo
1277 parse.lo:       parse.c $(HDR)
1278         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c parse.c
1280 opcodes.lo:     opcodes.c
1281         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c opcodes.c
1283 # Rule to build the Win32 resources object file.
1285 !IF $(USE_RC)!=0
1286 $(LIBRESOBJS):  $(TOP)\src\sqlite3.rc $(HDR)
1287         echo #ifndef SQLITE_RESOURCE_VERSION > sqlite3rc.h
1288         for /F %%V in ('type "$(TOP)\VERSION"') do ( \
1289                 echo #define SQLITE_RESOURCE_VERSION %%V \
1290                         | $(NAWK) "/.*/ { gsub(/[.]/,\",\");print }" >> sqlite3rc.h \
1291         )
1292         echo #endif >> sqlite3rc.h
1293         $(LTRCOMPILE) -fo $(LIBRESOBJS) $(TOP)\src\sqlite3.rc
1294 !ENDIF
1296 # Rules to build individual *.lo files from files in the src directory.
1298 alter.lo:       $(TOP)\src\alter.c $(HDR)
1299         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\alter.c
1301 analyze.lo:     $(TOP)\src\analyze.c $(HDR)
1302         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\analyze.c
1304 attach.lo:      $(TOP)\src\attach.c $(HDR)
1305         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\attach.c
1307 auth.lo:        $(TOP)\src\auth.c $(HDR)
1308         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\auth.c
1310 backup.lo:      $(TOP)\src\backup.c $(HDR)
1311         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\backup.c
1313 bitvec.lo:      $(TOP)\src\bitvec.c $(HDR)
1314         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\bitvec.c
1316 btmutex.lo:     $(TOP)\src\btmutex.c $(HDR)
1317         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\btmutex.c
1319 btree.lo:       $(TOP)\src\btree.c $(HDR) $(TOP)\src\pager.h
1320         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\btree.c
1322 build.lo:       $(TOP)\src\build.c $(HDR)
1323         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\build.c
1325 callback.lo:    $(TOP)\src\callback.c $(HDR)
1326         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\callback.c
1328 complete.lo:    $(TOP)\src\complete.c $(HDR)
1329         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\complete.c
1331 ctime.lo:       $(TOP)\src\ctime.c $(HDR)
1332         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\ctime.c
1334 date.lo:        $(TOP)\src\date.c $(HDR)
1335         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\date.c
1337 dbstat.lo:      $(TOP)\src\date.c $(HDR)
1338         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\dbstat.c
1340 delete.lo:      $(TOP)\src\delete.c $(HDR)
1341         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\delete.c
1343 expr.lo:        $(TOP)\src\expr.c $(HDR)
1344         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\expr.c
1346 fault.lo:       $(TOP)\src\fault.c $(HDR)
1347         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\fault.c
1349 fkey.lo:        $(TOP)\src\fkey.c $(HDR)
1350         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\fkey.c
1352 func.lo:        $(TOP)\src\func.c $(HDR)
1353         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\func.c
1355 global.lo:      $(TOP)\src\global.c $(HDR)
1356         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\global.c
1358 hash.lo:        $(TOP)\src\hash.c $(HDR)
1359         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\hash.c
1361 insert.lo:      $(TOP)\src\insert.c $(HDR)
1362         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\insert.c
1364 journal.lo:     $(TOP)\src\journal.c $(HDR)
1365         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\journal.c
1367 legacy.lo:      $(TOP)\src\legacy.c $(HDR)
1368         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\legacy.c
1370 loadext.lo:     $(TOP)\src\loadext.c $(HDR)
1371         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\loadext.c
1373 main.lo:        $(TOP)\src\main.c $(HDR)
1374         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\main.c
1376 malloc.lo:      $(TOP)\src\malloc.c $(HDR)
1377         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\malloc.c
1379 mem0.lo:        $(TOP)\src\mem0.c $(HDR)
1380         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem0.c
1382 mem1.lo:        $(TOP)\src\mem1.c $(HDR)
1383         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem1.c
1385 mem2.lo:        $(TOP)\src\mem2.c $(HDR)
1386         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem2.c
1388 mem3.lo:        $(TOP)\src\mem3.c $(HDR)
1389         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem3.c
1391 mem5.lo:        $(TOP)\src\mem5.c $(HDR)
1392         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem5.c
1394 memjournal.lo:  $(TOP)\src\memjournal.c $(HDR)
1395         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\memjournal.c
1397 mutex.lo:       $(TOP)\src\mutex.c $(HDR)
1398         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex.c
1400 mutex_noop.lo:  $(TOP)\src\mutex_noop.c $(HDR)
1401         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex_noop.c
1403 mutex_unix.lo:  $(TOP)\src\mutex_unix.c $(HDR)
1404         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex_unix.c
1406 mutex_w32.lo:   $(TOP)\src\mutex_w32.c $(HDR)
1407         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex_w32.c
1409 notify.lo:      $(TOP)\src\notify.c $(HDR)
1410         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\notify.c
1412 pager.lo:       $(TOP)\src\pager.c $(HDR) $(TOP)\src\pager.h
1413         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pager.c
1415 pcache.lo:      $(TOP)\src\pcache.c $(HDR) $(TOP)\src\pcache.h
1416         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pcache.c
1418 pcache1.lo:     $(TOP)\src\pcache1.c $(HDR) $(TOP)\src\pcache.h
1419         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pcache1.c
1421 os.lo:  $(TOP)\src\os.c $(HDR)
1422         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\os.c
1424 os_unix.lo:     $(TOP)\src\os_unix.c $(HDR)
1425         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\os_unix.c
1427 os_win.lo:      $(TOP)\src\os_win.c $(HDR)
1428         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\os_win.c
1430 pragma.lo:      $(TOP)\src\pragma.c $(HDR)
1431         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pragma.c
1433 prepare.lo:     $(TOP)\src\prepare.c $(HDR)
1434         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\prepare.c
1436 printf.lo:      $(TOP)\src\printf.c $(HDR)
1437         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\printf.c
1439 random.lo:      $(TOP)\src\random.c $(HDR)
1440         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\random.c
1442 resolve.lo:     $(TOP)\src\resolve.c $(HDR)
1443         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\resolve.c
1445 rowset.lo:      $(TOP)\src\rowset.c $(HDR)
1446         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\rowset.c
1448 select.lo:      $(TOP)\src\select.c $(HDR)
1449         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\select.c
1451 status.lo:      $(TOP)\src\status.c $(HDR)
1452         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\status.c
1454 table.lo:       $(TOP)\src\table.c $(HDR)
1455         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\table.c
1457 threads.lo:     $(TOP)\src\threads.c $(HDR)
1458         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\threads.c
1460 tokenize.lo:    $(TOP)\src\tokenize.c keywordhash.h $(HDR)
1461         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\tokenize.c
1463 trigger.lo:     $(TOP)\src\trigger.c $(HDR)
1464         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\trigger.c
1466 update.lo:      $(TOP)\src\update.c $(HDR)
1467         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\update.c
1469 utf.lo: $(TOP)\src\utf.c $(HDR)
1470         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\utf.c
1472 util.lo:        $(TOP)\src\util.c $(HDR)
1473         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\util.c
1475 vacuum.lo:      $(TOP)\src\vacuum.c $(HDR)
1476         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vacuum.c
1478 vdbe.lo:        $(TOP)\src\vdbe.c $(HDR)
1479         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbe.c
1481 vdbeapi.lo:     $(TOP)\src\vdbeapi.c $(HDR)
1482         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbeapi.c
1484 vdbeaux.lo:     $(TOP)\src\vdbeaux.c $(HDR)
1485         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbeaux.c
1487 vdbeblob.lo:    $(TOP)\src\vdbeblob.c $(HDR)
1488         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbeblob.c
1490 vdbemem.lo:     $(TOP)\src\vdbemem.c $(HDR)
1491         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbemem.c
1493 vdbesort.lo:    $(TOP)\src\vdbesort.c $(HDR)
1494         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbesort.c
1496 vdbetrace.lo:   $(TOP)\src\vdbetrace.c $(HDR)
1497         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbetrace.c
1499 vtab.lo:        $(TOP)\src\vtab.c $(HDR)
1500         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vtab.c
1502 wal.lo: $(TOP)\src\wal.c $(HDR)
1503         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\wal.c
1505 walker.lo:      $(TOP)\src\walker.c $(HDR)
1506         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\walker.c
1508 where.lo:       $(TOP)\src\where.c $(HDR)
1509         $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\where.c
1511 tclsqlite.lo:   $(TOP)\src\tclsqlite.c $(HDR)
1512         $(LTCOMPILE) $(NO_WARN) -DUSE_TCL_STUBS=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c
1514 tclsqlite-shell.lo:     $(TOP)\src\tclsqlite.c $(HDR)
1515         $(LTCOMPILE) $(NO_WARN) -DTCLSH=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c
1517 tclsqlite3.exe: tclsqlite-shell.lo $(SQLITE3C) $(LIBRESOBJS)
1518         $(LTLINK) $(SQLITE3C) /link $(LTLINKOPTS) $(LTLIBPATHS) /OUT:$@ tclsqlite-shell.lo $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
1520 # Rules to build opcodes.c and opcodes.h
1522 opcodes.c:      opcodes.h $(TOP)\mkopcodec.awk
1523         $(NAWK) -f $(TOP)\mkopcodec.awk opcodes.h > opcodes.c
1525 opcodes.h:      parse.h $(TOP)\src\vdbe.c $(TOP)\mkopcodeh.awk
1526         type parse.h $(TOP)\src\vdbe.c | $(NAWK) -f $(TOP)\mkopcodeh.awk > opcodes.h
1528 # Rules to build parse.c and parse.h - the outputs of lemon.
1530 parse.h:        parse.c
1532 parse.c:        $(TOP)\src\parse.y lemon.exe $(TOP)\addopcodes.awk
1533         del /Q parse.y parse.h parse.h.temp 2>NUL
1534         copy $(TOP)\src\parse.y .
1535         .\lemon.exe $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(OPTS) parse.y
1536         move parse.h parse.h.temp
1537         $(NAWK) -f $(TOP)\addopcodes.awk parse.h.temp > parse.h
1539 sqlite3.h:      $(TOP)\src\sqlite.h.in $(TOP)\manifest.uuid $(TOP)\VERSION
1540         $(TCLSH_CMD) $(TOP)\tool\mksqlite3h.tcl $(TOP:\=/) > sqlite3.h
1542 mkkeywordhash.exe:      $(TOP)\tool\mkkeywordhash.c
1543         $(BCC) $(NO_WARN) -Fe$@ $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(OPTS) \
1544                 $(TOP)\tool\mkkeywordhash.c /link $(NLTLINKOPTS) $(NLTLIBPATHS)
1546 keywordhash.h:  $(TOP)\tool\mkkeywordhash.c mkkeywordhash.exe
1547         .\mkkeywordhash.exe > keywordhash.h
1551 # Rules to build the extension objects.
1553 icu.lo: $(TOP)\ext\icu\icu.c $(HDR) $(EXTHDR)
1554         $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\icu\icu.c
1556 fts2.lo:        $(TOP)\ext\fts2\fts2.c $(HDR) $(EXTHDR)
1557         $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2.c
1559 fts2_hash.lo:   $(TOP)\ext\fts2\fts2_hash.c $(HDR) $(EXTHDR)
1560         $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_hash.c
1562 fts2_icu.lo:    $(TOP)\ext\fts2\fts2_icu.c $(HDR) $(EXTHDR)
1563         $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_icu.c
1565 fts2_porter.lo: $(TOP)\ext\fts2\fts2_porter.c $(HDR) $(EXTHDR)
1566         $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_porter.c
1568 fts2_tokenizer.lo:      $(TOP)\ext\fts2\fts2_tokenizer.c $(HDR) $(EXTHDR)
1569         $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_tokenizer.c
1571 fts2_tokenizer1.lo:     $(TOP)\ext\fts2\fts2_tokenizer1.c $(HDR) $(EXTHDR)
1572         $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_tokenizer1.c
1574 fts3.lo:        $(TOP)\ext\fts3\fts3.c $(HDR) $(EXTHDR)
1575         $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3.c
1577 fts3_aux.lo:    $(TOP)\ext\fts3\fts3_aux.c $(HDR) $(EXTHDR)
1578         $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_aux.c
1580 fts3_expr.lo:   $(TOP)\ext\fts3\fts3_expr.c $(HDR) $(EXTHDR)
1581         $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_expr.c
1583 fts3_hash.lo:   $(TOP)\ext\fts3\fts3_hash.c $(HDR) $(EXTHDR)
1584         $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_hash.c
1586 fts3_icu.lo:    $(TOP)\ext\fts3\fts3_icu.c $(HDR) $(EXTHDR)
1587         $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_icu.c
1589 fts3_snippet.lo:        $(TOP)\ext\fts3\fts3_snippet.c $(HDR) $(EXTHDR)
1590         $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_snippet.c
1592 fts3_porter.lo: $(TOP)\ext\fts3\fts3_porter.c $(HDR) $(EXTHDR)
1593         $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_porter.c
1595 fts3_tokenizer.lo:      $(TOP)\ext\fts3\fts3_tokenizer.c $(HDR) $(EXTHDR)
1596         $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenizer.c
1598 fts3_tokenizer1.lo:     $(TOP)\ext\fts3\fts3_tokenizer1.c $(HDR) $(EXTHDR)
1599         $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenizer1.c
1601 fts3_tokenize_vtab.lo:  $(TOP)\ext\fts3\fts3_tokenize_vtab.c $(HDR) $(EXTHDR)
1602         $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenize_vtab.c
1604 fts3_unicode.lo:        $(TOP)\ext\fts3\fts3_unicode.c $(HDR) $(EXTHDR)
1605         $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_unicode.c
1607 fts3_unicode2.lo:       $(TOP)\ext\fts3\fts3_unicode2.c $(HDR) $(EXTHDR)
1608         $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_unicode2.c
1610 fts3_write.lo:  $(TOP)\ext\fts3\fts3_write.c $(HDR) $(EXTHDR)
1611         $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_write.c
1613 rtree.lo:       $(TOP)\ext\rtree\rtree.c $(HDR) $(EXTHDR)
1614         $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\rtree\rtree.c
1617 # Rules to build the 'testfixture' application.
1619 # If using the amalgamation, use sqlite3.c directly to build the test
1620 # fixture.  Otherwise link against libsqlite3.lib.  (This distinction is
1621 # necessary because the test fixture requires non-API symbols which are
1622 # hidden when the library is built via the amalgamation).
1624 TESTFIXTURE_FLAGS = -DTCLSH=1 -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
1625 TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_SERVER=1 -DSQLITE_PRIVATE=""
1626 TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_CORE $(NO_WARN)
1628 TESTFIXTURE_SRC0 = $(TESTEXT) $(TESTSRC2) $(SHELL_CORE_DEP)
1629 TESTFIXTURE_SRC1 = $(TESTEXT) $(SQLITE3C)
1630 !IF $(USE_AMALGAMATION)==0
1631 TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC0)
1632 !ELSE
1633 TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC1)
1634 !ENDIF
1636 testfixture.exe:        $(TESTFIXTURE_SRC) $(LIBRESOBJS) $(HDR)
1637         $(LTLINK) -DSQLITE_NO_SYNC=1 $(TESTFIXTURE_FLAGS) \
1638                 -DBUILD_sqlite -I$(TCLINCDIR) \
1639                 $(TESTFIXTURE_SRC) \
1640                 /link $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
1642 extensiontest: testfixture.exe testloadext.dll
1643         .\testfixture.exe $(TOP)\test\loadext.test
1645 fulltest:       testfixture.exe sqlite3.exe fuzztest
1646         .\testfixture.exe $(TOP)\test\all.test
1648 soaktest:       testfixture.exe sqlite3.exe fuzzoomtest
1649         .\testfixture.exe $(TOP)\test\all.test -soak=1
1651 fulltestonly:   testfixture.exe sqlite3.exe fuzztest
1652         .\testfixture.exe $(TOP)\test\full.test
1654 queryplantest:  testfixture.exe sqlite3.exe
1655         .\testfixture.exe $(TOP)\test\permutations.test queryplanner
1657 fuzztest:       fuzzershell.exe
1658         .\fuzzershell.exe $(TOP)\test\fuzzdata1.txt $(TOP)\test\fuzzdata2.txt
1660 fuzzoomtest:    fuzzershell.exe
1661         .\fuzzershell.exe -f $(TOP)\test\fuzzdata1.txt --oom
1663 test:   testfixture.exe sqlite3.exe fuzztest
1664         .\testfixture.exe $(TOP)\test\veryquick.test
1666 smoketest:      testfixture.exe
1667         .\testfixture.exe $(TOP)\test\main.test
1669 sqlite3_analyzer.c: $(SQLITE3C) $(TOP)\src\tclsqlite.c $(TOP)\tool\spaceanal.tcl
1670         copy $(SQLITE3C) + $(TOP)\src\tclsqlite.c $@
1671         echo static const char *tclsh_main_loop(void){ >> $@
1672         echo static const char *zMainloop = >> $@
1673         $(NAWK) -f $(TOP)\tool\tostr.awk $(TOP)\tool\spaceanal.tcl >> $@
1674         echo ; return zMainloop; } >> $@
1676 sqlite3_analyzer.exe:   sqlite3_analyzer.c $(LIBRESOBJS)
1677         $(LTLINK) $(NO_WARN) -DBUILD_sqlite -DSQLITE_ENABLE_DBSTAT_VTAB -DTCLSH=2 -I$(TCLINCDIR) sqlite3_analyzer.c \
1678                 /link $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
1680 testloadext.lo: $(TOP)\src\test_loadext.c
1681         $(LTCOMPILE) $(NO_WARN) -c $(TOP)\src\test_loadext.c
1683 testloadext.dll: testloadext.lo
1684         $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /OUT:$@ testloadext.lo
1686 showdb.exe:     $(TOP)\tool\showdb.c $(SQLITE3C)
1687         $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
1688                 $(TOP)\tool\showdb.c $(SQLITE3C)
1690 showstat4.exe:  $(TOP)\tool\showstat4.c $(SQLITE3C)
1691         $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
1692                 $(TOP)\tool\showstat4.c $(SQLITE3C)
1694 showjournal.exe:        $(TOP)\tool\showjournal.c $(SQLITE3C)
1695         $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
1696                 $(TOP)\tool\showjournal.c $(SQLITE3C)
1698 showwal.exe:    $(TOP)\tool\showwal.c $(SQLITE3C)
1699         $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
1700                 $(TOP)\tool\showwal.c $(SQLITE3C)
1702 fts3view.exe:   $(TOP)\ext\fts3\tool\fts3view.c $(SQLITE3C)
1703         $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
1704                 $(TOP)\ext\fts3\tool\fts3view.c $(SQLITE3C)
1706 rollback-test.exe:      $(TOP)\tool\rollback-test.c $(SQLITE3C)
1707         $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
1708                 $(TOP)\tool\rollback-test.c $(SQLITE3C)
1710 LogEst.exe:     $(TOP)\tool\logest.c sqlite3.h
1711         $(LTLINK) $(NO_WARN) -Fe$@ $(TOP)\tool\LogEst.c
1713 wordcount.exe:  $(TOP)\test\wordcount.c $(SQLITE3C)
1714         $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
1715                 $(TOP)\test\wordcount.c $(SQLITE3C)
1717 speedtest1.exe: $(TOP)\test\speedtest1.c $(SQLITE3C)
1718         $(LTLINK) $(NO_WARN) -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
1719                 $(TOP)\test\speedtest1.c $(SQLITE3C)
1721 clean:
1722         del /Q *.exp *.lo *.ilk *.lib *.obj *.pdb 2>NUL
1723         del /Q *.cod *.da *.bb *.bbg gmon.out 2>NUL
1724         del /Q sqlite3.h opcodes.c opcodes.h 2>NUL
1725         del /Q lemon.* lempar.c parse.* 2>NUL
1726         del /Q mkkeywordhash.* keywordhash.h 2>NUL
1727         del /Q notasharedlib.* 2>NUL
1728         -rmdir /Q/S .deps 2>NUL
1729         -rmdir /Q/S .libs 2>NUL
1730         -rmdir /Q/S quota2a 2>NUL
1731         -rmdir /Q/S quota2b 2>NUL
1732         -rmdir /Q/S quota2c 2>NUL
1733         -rmdir /Q/S tsrc 2>NUL
1734         del /Q .target_source 2>NUL
1735         del /Q tclsqlite3.exe 2>NUL
1736         del /Q testloadext.dll 2>NUL
1737         del /Q testfixture.exe test.db 2>NUL
1738         del /Q LogEst.exe fts3view.exe rollback-test.exe showdb.exe 2>NUL
1739         del /Q showjournal.exe showstat4.exe showwal.exe speedtest1.exe 2>NUL
1740         del /Q mptester.exe wordcount.exe 2>NUL
1741         del /Q sqlite3.exe sqlite3.dll sqlite3.def 2>NUL
1742         del /Q sqlite3.c sqlite3-*.c 2>NUL
1743         del /Q sqlite3rc.h 2>NUL
1744         del /Q shell.c sqlite3ext.h 2>NUL
1745         del /Q sqlite3_analyzer.exe sqlite3_analyzer.c 2>NUL
1746         del /Q sqlite-*-output.vsix 2>NUL
1748 # Dynamic link library section.
1750 dll: sqlite3.dll
1752 sqlite3.def: libsqlite3.lib
1753         echo EXPORTS > sqlite3.def
1754         dumpbin /all libsqlite3.lib \
1755                 | $(NAWK) "/ 1 _?sqlite3_/ { sub(/^.* _?/,\"\");print }" \
1756                 | sort >> sqlite3.def
1758 sqlite3.dll: $(LIBOBJ) $(LIBRESOBJS) $(CORE_LINK_DEP)
1759         $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL $(CORE_LINK_OPTS) /OUT:$@ $(LIBOBJ) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)