xref: /sqlite-3.40.0/Makefile.msc (revision fee981e5)
1#
2# nmake Makefile for SQLite
3#
4###############################################################################
5############################## START OF OPTIONS ###############################
6###############################################################################
7
8# The toplevel directory of the source tree.  This is the directory
9# that contains this "Makefile.msc".
10#
11TOP = .
12
13# Set this non-0 to create and use the SQLite amalgamation file.
14#
15!IFNDEF USE_AMALGAMATION
16USE_AMALGAMATION = 1
17!ENDIF
18
19# Set this non-0 to enable full warnings (-W4, etc) when compiling.
20#
21!IFNDEF USE_FULLWARN
22USE_FULLWARN = 0
23!ENDIF
24
25# Set this non-0 to use "stdcall" calling convention for the core library
26# and shell executable.
27#
28!IFNDEF USE_STDCALL
29USE_STDCALL = 0
30!ENDIF
31
32# Set this non-0 to have the shell executable link against the core dynamic
33# link library.
34#
35!IFNDEF DYNAMIC_SHELL
36DYNAMIC_SHELL = 0
37!ENDIF
38
39# Set this non-0 to enable extra code that attempts to detect misuse of the
40# SQLite API.
41#
42!IFNDEF API_ARMOR
43API_ARMOR = 0
44!ENDIF
45
46# If necessary, create a list of harmless compiler warnings to disable when
47# compiling the various tools.  For the SQLite source code itself, warnings,
48# if any, will be disabled from within it.
49#
50!IFNDEF NO_WARN
51!IF $(USE_FULLWARN)!=0
52NO_WARN = -wd4054 -wd4055 -wd4100 -wd4127 -wd4130 -wd4152 -wd4189 -wd4206
53NO_WARN = $(NO_WARN) -wd4210 -wd4232 -wd4305 -wd4306 -wd4702 -wd4706
54!ENDIF
55!ENDIF
56
57# Set this non-0 to use the library paths and other options necessary for
58# Windows Phone 8.1.
59#
60!IFNDEF USE_WP81_OPTS
61USE_WP81_OPTS = 0
62!ENDIF
63
64# Set this non-0 to split the SQLite amalgamation file into chunks to
65# be used for debugging with Visual Studio.
66#
67!IFNDEF SPLIT_AMALGAMATION
68SPLIT_AMALGAMATION = 0
69!ENDIF
70
71# Set this non-0 to use the International Components for Unicode (ICU).
72#
73!IFNDEF USE_ICU
74USE_ICU = 0
75!ENDIF
76
77# Set this non-0 to dynamically link to the MSVC runtime library.
78#
79!IFNDEF USE_CRT_DLL
80USE_CRT_DLL = 0
81!ENDIF
82
83# Set this non-0 to link to the RPCRT4 library.
84#
85!IFNDEF USE_RPCRT4_LIB
86USE_RPCRT4_LIB = 0
87!ENDIF
88
89# Set this non-0 to generate assembly code listings for the source code
90# files.
91#
92!IFNDEF USE_LISTINGS
93USE_LISTINGS = 0
94!ENDIF
95
96# Set this non-0 to attempt setting the native compiler automatically
97# for cross-compiling the command line tools needed during the compilation
98# process.
99#
100!IFNDEF XCOMPILE
101XCOMPILE = 0
102!ENDIF
103
104# Set this non-0 to use the native libraries paths for cross-compiling
105# the command line tools needed during the compilation process.
106#
107!IFNDEF USE_NATIVE_LIBPATHS
108USE_NATIVE_LIBPATHS = 0
109!ENDIF
110
111# Set this 0 to skip the compiling and embedding of version resources.
112#
113!IFNDEF USE_RC
114USE_RC = 1
115!ENDIF
116
117# Set this non-0 to compile binaries suitable for the WinRT environment.
118# This setting does not apply to any binaries that require Tcl to operate
119# properly (i.e. the text fixture, etc).
120#
121!IFNDEF FOR_WINRT
122FOR_WINRT = 0
123!ENDIF
124
125# Set this non-0 to compile binaries suitable for the UAP environment.
126# This setting does not apply to any binaries that require Tcl to operate
127# properly (i.e. the text fixture, etc).
128#
129!IFNDEF FOR_UAP
130FOR_UAP = 0
131!ENDIF
132
133# Set this non-0 to compile binaries suitable for the Windows 10 platform.
134#
135!IFNDEF FOR_WIN10
136FOR_WIN10 = 0
137!ENDIF
138
139# Set this non-0 to skip attempting to look for and/or link with the Tcl
140# runtime library.
141#
142!IFNDEF NO_TCL
143NO_TCL = 0
144!ENDIF
145
146# Set this to non-0 to create and use PDBs.
147#
148!IFNDEF SYMBOLS
149SYMBOLS = 1
150!ENDIF
151
152# Set this to non-0 to use the SQLite debugging heap subsystem.
153#
154!IFNDEF MEMDEBUG
155MEMDEBUG = 0
156!ENDIF
157
158# Set this to non-0 to use the Win32 native heap subsystem.
159#
160!IFNDEF WIN32HEAP
161WIN32HEAP = 0
162!ENDIF
163
164# Set this to non-0 to enable OSTRACE() macros, which can be useful when
165# debugging.
166#
167!IFNDEF OSTRACE
168OSTRACE = 0
169!ENDIF
170
171# Set this to one of the following values to enable various debugging
172# features.  Each level includes the debugging options from the previous
173# levels.  Currently, the recognized values for DEBUG are:
174#
175# 0 == NDEBUG: Disables assert() and other runtime diagnostics.
176# 1 == SQLITE_ENABLE_API_ARMOR: extra attempts to detect misuse of the API.
177# 2 == Disables NDEBUG and all optimizations and then enables PDBs.
178# 3 == SQLITE_DEBUG: Enables various diagnostics messages and code.
179# 4 == SQLITE_WIN32_MALLOC_VALIDATE: Validate the Win32 native heap per call.
180# 5 == SQLITE_DEBUG_OS_TRACE: Enables output from the OSTRACE() macros.
181# 6 == SQLITE_ENABLE_IOTRACE: Enables output from the IOTRACE() macros.
182#
183!IFNDEF DEBUG
184DEBUG = 0
185!ENDIF
186
187# Enable use of available compiler optimizations?  Normally, this should be
188# non-zero.  Setting this to zero, thus disabling all compiler optimizations,
189# can be useful for testing.
190#
191!IFNDEF OPTIMIZATIONS
192OPTIMIZATIONS = 2
193!ENDIF
194
195# Set the source code file to be used by executables and libraries when
196# they need the amalgamation.
197#
198!IFNDEF SQLITE3C
199!IF $(SPLIT_AMALGAMATION)!=0
200SQLITE3C = sqlite3-all.c
201!ELSE
202SQLITE3C = sqlite3.c
203!ENDIF
204!ENDIF
205
206# Set the include code file to be used by executables and libraries when
207# they need SQLite.
208#
209!IFNDEF SQLITE3H
210SQLITE3H = sqlite3.h
211!ENDIF
212
213# This is the name to use for the SQLite dynamic link library (DLL).
214#
215!IFNDEF SQLITE3DLL
216SQLITE3DLL = sqlite3.dll
217!ENDIF
218
219# This is the name to use for the SQLite import library (LIB).
220#
221!IFNDEF SQLITE3LIB
222SQLITE3LIB = sqlite3.lib
223!ENDIF
224
225# This is the name to use for the SQLite shell executable (EXE).
226#
227!IFNDEF SQLITE3EXE
228SQLITE3EXE = sqlite3.exe
229!ENDIF
230
231# This is the argument used to set the program database (PDB) file for the
232# SQLite shell executable (EXE).
233#
234!IFNDEF SQLITE3EXEPDB
235SQLITE3EXEPDB = /pdb:sqlite3sh.pdb
236!ENDIF
237
238# These are the "standard" SQLite compilation options used when compiling for
239# the Windows platform.
240#
241!IFNDEF OPT_FEATURE_FLAGS
242OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS3=1
243OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RTREE=1
244OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_COLUMN_METADATA=1
245!ENDIF
246
247# These are the "extended" SQLite compilation options used when compiling for
248# the Windows 10 platform.
249#
250!IFNDEF EXT_FEATURE_FLAGS
251!IF $(FOR_WIN10)!=0
252EXT_FEATURE_FLAGS = $(EXT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS4=1
253EXT_FEATURE_FLAGS = $(EXT_FEATURE_FLAGS) -DSQLITE_SYSTEM_MALLOC=1
254EXT_FEATURE_FLAGS = $(EXT_FEATURE_FLAGS) -DSQLITE_OMIT_LOCALTIME=1
255!ELSE
256EXT_FEATURE_FLAGS =
257!ENDIF
258!ENDIF
259
260###############################################################################
261############################### END OF OPTIONS ################################
262###############################################################################
263
264# This assumes that MSVC is always installed in 32-bit Program Files directory
265# and sets the variable for use in locating other 32-bit installs accordingly.
266#
267PROGRAMFILES_X86 = $(VCINSTALLDIR)\..\..
268PROGRAMFILES_X86 = $(PROGRAMFILES_X86:\\=\)
269
270# Check for the predefined command macro CC.  This should point to the compiler
271# binary for the target platform.  If it is not defined, simply define it to
272# the legacy default value 'cl.exe'.
273#
274!IFNDEF CC
275CC = cl.exe
276!ENDIF
277
278# Check for the command macro LD.  This should point to the linker binary for
279# the target platform.  If it is not defined, simply define it to the legacy
280# default value 'link.exe'.
281#
282!IFNDEF LD
283LD = link.exe
284!ENDIF
285
286# Check for the predefined command macro RC.  This should point to the resource
287# compiler binary for the target platform.  If it is not defined, simply define
288# it to the legacy default value 'rc.exe'.
289#
290!IFNDEF RC
291RC = rc.exe
292!ENDIF
293
294# Check for the MSVC runtime library path macro.  Othertise, this value will
295# default to the 'lib' directory underneath the MSVC installation directory.
296#
297!IFNDEF CRTLIBPATH
298CRTLIBPATH = $(VCINSTALLDIR)\lib
299!ENDIF
300
301CRTLIBPATH = $(CRTLIBPATH:\\=\)
302
303# Check for the command macro NCC.  This should point to the compiler binary
304# for the platform the compilation process is taking place on.  If it is not
305# defined, simply define it to have the same value as the CC macro.  When
306# cross-compiling, it is suggested that this macro be modified via the command
307# line (since nmake itself does not provide a built-in method to guess it).
308# For example, to use the x86 compiler when cross-compiling for x64, a command
309# line similar to the following could be used (all on one line):
310#
311#     nmake /f Makefile.msc sqlite3.dll
312#           XCOMPILE=1 USE_NATIVE_LIBPATHS=1
313#
314# Alternatively, the full path and file name to the compiler binary for the
315# platform the compilation process is taking place may be specified (all on
316# one line):
317#
318#     nmake /f Makefile.msc sqlite3.dll
319#           "NCC=""%VCINSTALLDIR%\bin\cl.exe"""
320#           USE_NATIVE_LIBPATHS=1
321#
322!IFDEF NCC
323NCC = $(NCC:\\=\)
324!ELSEIF $(XCOMPILE)!=0
325NCC = "$(VCINSTALLDIR)\bin\$(CC)"
326NCC = $(NCC:\\=\)
327!ELSE
328NCC = $(CC)
329!ENDIF
330
331# Check for the MSVC native runtime library path macro.  Othertise,
332# this value will default to the 'lib' directory underneath the MSVC
333# installation directory.
334#
335!IFNDEF NCRTLIBPATH
336NCRTLIBPATH = $(VCINSTALLDIR)\lib
337!ENDIF
338
339NCRTLIBPATH = $(NCRTLIBPATH:\\=\)
340
341# Check for the Platform SDK library path macro.  Othertise, this
342# value will default to the 'lib' directory underneath the Windows
343# SDK installation directory (the environment variable used appears
344# to be available when using Visual C++ 2008 or later via the
345# command line).
346#
347!IFNDEF NSDKLIBPATH
348NSDKLIBPATH = $(WINDOWSSDKDIR)\lib
349!ENDIF
350
351NSDKLIBPATH = $(NSDKLIBPATH:\\=\)
352
353# C compiler and options for use in building executables that
354# will run on the platform that is doing the build.
355#
356!IF $(USE_FULLWARN)!=0
357BCC = $(NCC) -nologo -W4 $(CCOPTS) $(BCCOPTS)
358!ELSE
359BCC = $(NCC) -nologo -W3 $(CCOPTS) $(BCCOPTS)
360!ENDIF
361
362# Check if assembly code listings should be generated for the source
363# code files to be compiled.
364#
365!IF $(USE_LISTINGS)!=0
366BCC = $(BCC) -FAcs
367!ENDIF
368
369# Check if the native library paths should be used when compiling
370# the command line tools used during the compilation process.  If
371# so, set the necessary macro now.
372#
373!IF $(USE_NATIVE_LIBPATHS)!=0
374NLTLIBPATHS = "/LIBPATH:$(NCRTLIBPATH)" "/LIBPATH:$(NSDKLIBPATH)"
375
376!IFDEF NUCRTLIBPATH
377NUCRTLIBPATH = $(NUCRTLIBPATH:\\=\)
378NLTLIBPATHS = $(NLTLIBPATHS) "/LIBPATH:$(NUCRTLIBPATH)"
379!ENDIF
380!ENDIF
381
382# C compiler and options for use in building executables that
383# will run on the target platform.  (BCC and TCC are usually the
384# same unless your are cross-compiling.)
385#
386!IF $(USE_FULLWARN)!=0
387TCC = $(CC) -nologo -W4 -DINCLUDE_MSVC_H=1 $(CCOPTS) $(TCCOPTS)
388!ELSE
389TCC = $(CC) -nologo -W3 $(CCOPTS) $(TCCOPTS)
390!ENDIF
391
392TCC = $(TCC) -DSQLITE_OS_WIN=1 -I$(TOP) -I$(TOP)\src -fp:precise
393RCC = $(RC) -DSQLITE_OS_WIN=1 -I$(TOP) -I$(TOP)\src $(RCOPTS) $(RCCOPTS)
394
395# Adjust the names of the primary targets for use with Windows 10.
396#
397!IF $(FOR_WIN10)!=0
398SQLITE3DLL = winsqlite3.dll
399SQLITE3LIB = winsqlite3.lib
400SQLITE3EXE = winsqlite3shell.exe
401SQLITE3EXEPDB =
402!ENDIF
403
404# Check if we want to use the "stdcall" calling convention when compiling.
405# This is not supported by the compilers for non-x86 platforms.  It should
406# also be noted here that building any target with these "stdcall" options
407# will most likely fail if the Tcl library is also required.  This is due
408# to how the Tcl library functions are declared and exported (i.e. without
409# an explicit calling convention, which results in "cdecl").
410#
411!IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
412!IF "$(PLATFORM)"=="x86"
413CORE_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_STDCALL=__stdcall
414SHELL_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_STDCALL=__stdcall
415!ELSE
416!IFNDEF PLATFORM
417CORE_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_STDCALL=__stdcall
418SHELL_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_STDCALL=__stdcall
419!ELSE
420CORE_CCONV_OPTS =
421SHELL_CCONV_OPTS =
422!ENDIF
423!ENDIF
424!ELSE
425CORE_CCONV_OPTS =
426SHELL_CCONV_OPTS =
427!ENDIF
428
429# These are additional compiler options used for the core library.
430#
431!IFNDEF CORE_COMPILE_OPTS
432!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
433CORE_COMPILE_OPTS = $(CORE_CCONV_OPTS) -DSQLITE_API=__declspec(dllexport)
434!ELSE
435CORE_COMPILE_OPTS = $(CORE_CCONV_OPTS)
436!ENDIF
437!ENDIF
438
439# These are the additional targets that the core library should depend on
440# when linking.
441#
442!IFNDEF CORE_LINK_DEP
443!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
444CORE_LINK_DEP =
445!ELSE
446CORE_LINK_DEP = sqlite3.def
447!ENDIF
448!ENDIF
449
450# These are additional linker options used for the core library.
451#
452!IFNDEF CORE_LINK_OPTS
453!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
454CORE_LINK_OPTS =
455!ELSE
456CORE_LINK_OPTS = /DEF:sqlite3.def
457!ENDIF
458!ENDIF
459
460# These are additional compiler options used for the shell executable.
461#
462!IFNDEF SHELL_COMPILE_OPTS
463!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
464SHELL_COMPILE_OPTS = $(SHELL_CCONV_OPTS) -DSQLITE_API=__declspec(dllimport)
465!ELSE
466SHELL_COMPILE_OPTS = $(SHELL_CCONV_OPTS)
467!ENDIF
468!ENDIF
469
470# This is the source code that the shell executable should be compiled
471# with.
472#
473!IFNDEF SHELL_CORE_SRC
474!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
475SHELL_CORE_SRC =
476!ELSE
477SHELL_CORE_SRC = $(SQLITE3C)
478!ENDIF
479!ENDIF
480
481# This is the core library that the shell executable should depend on.
482#
483!IFNDEF SHELL_CORE_DEP
484!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
485SHELL_CORE_DEP = $(SQLITE3DLL)
486!ELSE
487SHELL_CORE_DEP =
488!ENDIF
489!ENDIF
490
491# This is the core library that the shell executable should link with.
492#
493!IFNDEF SHELL_CORE_LIB
494!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
495SHELL_CORE_LIB = $(SQLITE3LIB)
496!ELSE
497SHELL_CORE_LIB =
498!ENDIF
499!ENDIF
500
501# These are additional linker options used for the shell executable.
502#
503!IFNDEF SHELL_LINK_OPTS
504SHELL_LINK_OPTS = $(SHELL_CORE_LIB)
505!ENDIF
506
507# Check if assembly code listings should be generated for the source
508# code files to be compiled.
509#
510!IF $(USE_LISTINGS)!=0
511TCC = $(TCC) -FAcs
512!ENDIF
513
514# When compiling the library for use in the WinRT environment,
515# the following compile-time options must be used as well to
516# disable use of Win32 APIs that are not available and to enable
517# use of Win32 APIs that are specific to Windows 8 and/or WinRT.
518#
519!IF $(FOR_WINRT)!=0
520TCC = $(TCC) -DSQLITE_OS_WINRT=1
521RCC = $(RCC) -DSQLITE_OS_WINRT=1
522TCC = $(TCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
523RCC = $(RCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
524!ENDIF
525
526# C compiler options for the Windows 10 platform (needs MSVC 2015).
527#
528!IF $(FOR_WIN10)!=0
529TCC = $(TCC) /guard:cf -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
530BCC = $(BCC) /guard:cf -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
531!ENDIF
532
533# Also, we need to dynamically link to the correct MSVC runtime
534# when compiling for WinRT (e.g. debug or release) OR if the
535# USE_CRT_DLL option is set to force dynamically linking to the
536# MSVC runtime library.
537#
538!IF $(FOR_WINRT)!=0 || $(FOR_WIN10)!=0 || $(USE_CRT_DLL)!=0
539!IF $(DEBUG)>1
540TCC = $(TCC) -MDd
541BCC = $(BCC) -MDd
542!ELSE
543TCC = $(TCC) -MD
544BCC = $(BCC) -MD
545!ENDIF
546!ELSE
547!IF $(DEBUG)>1
548TCC = $(TCC) -MTd
549BCC = $(BCC) -MTd
550!ELSE
551TCC = $(TCC) -MT
552BCC = $(BCC) -MT
553!ENDIF
554!ENDIF
555
556# The mksqlite3c.tcl and mksqlite3h.tcl scripts will pull in
557# any extension header files by default.  For non-amalgamation
558# builds, we need to make sure the compiler can find these.
559#
560!IF $(USE_AMALGAMATION)==0
561TCC = $(TCC) -I$(TOP)\ext\fts3
562RCC = $(RCC) -I$(TOP)\ext\fts3
563TCC = $(TCC) -I$(TOP)\ext\rtree
564RCC = $(RCC) -I$(TOP)\ext\rtree
565!ENDIF
566
567# The mksqlite3c.tcl script accepts some options on the command
568# line.  When compiling with debugging enabled, some of these
569# options are necessary in order to allow debugging symbols to
570# work correctly with Visual Studio when using the amalgamation.
571#
572!IFNDEF MKSQLITE3C_ARGS
573!IF $(DEBUG)>1
574MKSQLITE3C_ARGS = --linemacros
575!ELSE
576MKSQLITE3C_ARGS =
577!ENDIF
578!ENDIF
579
580# Define -DNDEBUG to compile without debugging (i.e., for production usage)
581# Omitting the define will cause extra debugging code to be inserted and
582# includes extra comments when "EXPLAIN stmt" is used.
583#
584!IF $(DEBUG)==0
585TCC = $(TCC) -DNDEBUG
586BCC = $(BCC) -DNDEBUG
587RCC = $(RCC) -DNDEBUG
588!ENDIF
589
590!IF $(DEBUG)>0 || $(API_ARMOR)!=0 || $(FOR_WIN10)!=0
591TCC = $(TCC) -DSQLITE_ENABLE_API_ARMOR=1
592RCC = $(RCC) -DSQLITE_ENABLE_API_ARMOR=1
593!ENDIF
594
595!IF $(DEBUG)>2
596TCC = $(TCC) -DSQLITE_DEBUG=1
597RCC = $(RCC) -DSQLITE_DEBUG=1
598!ENDIF
599
600!IF $(DEBUG)>4 || $(OSTRACE)!=0
601TCC = $(TCC) -DSQLITE_FORCE_OS_TRACE=1 -DSQLITE_DEBUG_OS_TRACE=1
602RCC = $(RCC) -DSQLITE_FORCE_OS_TRACE=1 -DSQLITE_DEBUG_OS_TRACE=1
603!ENDIF
604
605!IF $(DEBUG)>5
606TCC = $(TCC) -DSQLITE_ENABLE_IOTRACE=1
607RCC = $(RCC) -DSQLITE_ENABLE_IOTRACE=1
608!ENDIF
609
610# Prevent warnings about "insecure" MSVC runtime library functions
611# being used.
612#
613TCC = $(TCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
614BCC = $(BCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
615RCC = $(RCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
616
617# Prevent warnings about "deprecated" POSIX functions being used.
618#
619TCC = $(TCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
620BCC = $(BCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
621RCC = $(RCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
622
623# Use the SQLite debugging heap subsystem?
624#
625!IF $(MEMDEBUG)!=0
626TCC = $(TCC) -DSQLITE_MEMDEBUG=1
627RCC = $(RCC) -DSQLITE_MEMDEBUG=1
628
629# Use native Win32 heap subsystem instead of malloc/free?
630#
631!ELSEIF $(WIN32HEAP)!=0
632TCC = $(TCC) -DSQLITE_WIN32_MALLOC=1
633RCC = $(RCC) -DSQLITE_WIN32_MALLOC=1
634
635# Validate the heap on every call into the native Win32 heap subsystem?
636#
637!IF $(DEBUG)>3
638TCC = $(TCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1
639RCC = $(RCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1
640!ENDIF
641!ENDIF
642
643# The locations of the Tcl header and library files.  Also, the library that
644# non-stubs enabled programs using Tcl must link against.  These variables
645# (TCLINCDIR, TCLLIBDIR, and LIBTCL) may be overridden via the environment
646# prior to running nmake in order to match the actual installed location and
647# version on this machine.
648#
649!IFNDEF TCLINCDIR
650TCLINCDIR = c:\tcl\include
651!ENDIF
652
653!IFNDEF TCLLIBDIR
654TCLLIBDIR = c:\tcl\lib
655!ENDIF
656
657!IFNDEF LIBTCL
658LIBTCL = tcl85.lib
659!ENDIF
660
661!IFNDEF LIBTCLSTUB
662LIBTCLSTUB = tclstub85.lib
663!ENDIF
664
665!IFNDEF LIBTCLPATH
666LIBTCLPATH = c:\tcl\bin
667!ENDIF
668
669# The locations of the ICU header and library files.  These variables
670# (ICUINCDIR, ICULIBDIR, and LIBICU) may be overridden via the environment
671# prior to running nmake in order to match the actual installed location on
672# this machine.
673#
674!IFNDEF ICUINCDIR
675ICUINCDIR = c:\icu\include
676!ENDIF
677
678!IFNDEF ICULIBDIR
679ICULIBDIR = c:\icu\lib
680!ENDIF
681
682!IFNDEF LIBICU
683LIBICU = icuuc.lib icuin.lib
684!ENDIF
685
686# This is the command to use for tclsh - normally just "tclsh", but we may
687# know the specific version we want to use.  This variable (TCLSH_CMD) may be
688# overridden via the environment prior to running nmake in order to select a
689# specific Tcl shell to use.
690#
691!IFNDEF TCLSH_CMD
692TCLSH_CMD = tclsh85
693!ENDIF
694
695# Compiler options needed for programs that use the readline() library.
696#
697!IFNDEF READLINE_FLAGS
698READLINE_FLAGS = -DHAVE_READLINE=0
699!ENDIF
700
701# The library that programs using readline() must link against.
702#
703!IFNDEF LIBREADLINE
704LIBREADLINE =
705!ENDIF
706
707# Should the database engine be compiled threadsafe
708#
709TCC = $(TCC) -DSQLITE_THREADSAFE=1
710RCC = $(RCC) -DSQLITE_THREADSAFE=1
711
712# Do threads override each others locks by default (1), or do we test (-1)
713#
714TCC = $(TCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1
715RCC = $(RCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1
716
717# Any target libraries which libsqlite must be linked against
718#
719!IFNDEF TLIBS
720TLIBS =
721!ENDIF
722
723# Flags controlling use of the in memory btree implementation
724#
725# SQLITE_TEMP_STORE is 0 to force temporary tables to be in a file, 1 to
726# default to file, 2 to default to memory, and 3 to force temporary
727# tables to always be in memory.
728#
729TCC = $(TCC) -DSQLITE_TEMP_STORE=1
730RCC = $(RCC) -DSQLITE_TEMP_STORE=1
731
732# Enable/disable loadable extensions, and other optional features
733# based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*).
734# The same set of OMIT and ENABLE flags should be passed to the
735# LEMON parser generator and the mkkeywordhash tool as well.
736
737# These are the required SQLite compilation options used when compiling for
738# the Windows platform.
739#
740REQ_FEATURE_FLAGS = $(REQ_FEATURE_FLAGS) -DSQLITE_MAX_TRIGGER_DEPTH=100
741
742# If we are linking to the RPCRT4 library, enable features that need it.
743#
744!IF $(USE_RPCRT4_LIB)!=0
745REQ_FEATURE_FLAGS = $(REQ_FEATURE_FLAGS) -DSQLITE_WIN32_USE_UUID=1
746!ENDIF
747
748# Add the required and optional SQLite compilation options into the command
749# lines used to invoke the MSVC code and resource compilers.
750#
751TCC = $(TCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS)
752RCC = $(RCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS)
753
754# Add in any optional parameters specified on the commane line, e.g.
755# nmake /f Makefile.msc all "OPTS=-DSQLITE_ENABLE_FOO=1 -DSQLITE_OMIT_FOO=1"
756#
757TCC = $(TCC) $(OPTS)
758RCC = $(RCC) $(OPTS)
759
760# If compiling for debugging, add some defines.
761#
762!IF $(DEBUG)>1
763TCC = $(TCC) -D_DEBUG
764BCC = $(BCC) -D_DEBUG
765RCC = $(RCC) -D_DEBUG
766!ENDIF
767
768# If optimizations are enabled or disabled (either implicitly or
769# explicitly), add the necessary flags.
770#
771!IF $(DEBUG)>1 || $(OPTIMIZATIONS)==0
772TCC = $(TCC) -Od
773BCC = $(BCC) -Od
774!ELSEIF $(OPTIMIZATIONS)>=3
775TCC = $(TCC) -Ox
776BCC = $(BCC) -Ox
777!ELSEIF $(OPTIMIZATIONS)==2
778TCC = $(TCC) -O2
779BCC = $(BCC) -O2
780!ELSEIF $(OPTIMIZATIONS)==1
781TCC = $(TCC) -O1
782BCC = $(BCC) -O1
783!ENDIF
784
785# If symbols are enabled (or compiling for debugging), enable PDBs.
786#
787!IF $(DEBUG)>1 || $(SYMBOLS)!=0
788TCC = $(TCC) -Zi
789BCC = $(BCC) -Zi
790!ENDIF
791
792# If ICU support is enabled, add the compiler options for it.
793#
794!IF $(USE_ICU)!=0
795TCC = $(TCC) -DSQLITE_ENABLE_ICU=1
796RCC = $(RCC) -DSQLITE_ENABLE_ICU=1
797TCC = $(TCC) -I$(TOP)\ext\icu
798RCC = $(RCC) -I$(TOP)\ext\icu
799TCC = $(TCC) -I$(ICUINCDIR)
800RCC = $(RCC) -I$(ICUINCDIR)
801!ENDIF
802
803# Command line prefixes for compiling code, compiling resources,
804# linking, etc.
805#
806LTCOMPILE = $(TCC) -Fo$@
807LTRCOMPILE = $(RCC) -r
808LTLIB = lib.exe
809LTLINK = $(TCC) -Fe$@
810
811# If requested, link to the RPCRT4 library.
812#
813!IF $(USE_RPCRT4_LIB)!=0
814LTLINK = $(LTLINK) rpcrt4.lib
815!ENDIF
816
817# If a platform was set, force the linker to target that.
818# Note that the vcvars*.bat family of batch files typically
819# set this for you.  Otherwise, the linker will attempt
820# to deduce the binary type based on the object files.
821!IFDEF PLATFORM
822LTLINKOPTS = /NOLOGO /MACHINE:$(PLATFORM)
823LTLIBOPTS = /NOLOGO /MACHINE:$(PLATFORM)
824!ELSE
825LTLINKOPTS = /NOLOGO
826LTLIBOPTS = /NOLOGO
827!ENDIF
828
829# When compiling for use in the WinRT environment, the following
830# linker option must be used to mark the executable as runnable
831# only in the context of an application container.
832#
833!IF $(FOR_WINRT)!=0
834LTLINKOPTS = $(LTLINKOPTS) /APPCONTAINER
835!IF "$(VISUALSTUDIOVERSION)"=="12.0" || "$(VISUALSTUDIOVERSION)"=="14.0"
836!IFNDEF STORELIBPATH
837!IF "$(PLATFORM)"=="x86"
838STORELIBPATH = $(CRTLIBPATH)\store
839!ELSEIF "$(PLATFORM)"=="x64"
840STORELIBPATH = $(CRTLIBPATH)\store\amd64
841!ELSEIF "$(PLATFORM)"=="ARM"
842STORELIBPATH = $(CRTLIBPATH)\store\arm
843!ELSE
844STORELIBPATH = $(CRTLIBPATH)\store
845!ENDIF
846!ENDIF
847STORELIBPATH = $(STORELIBPATH:\\=\)
848LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(STORELIBPATH)"
849!ENDIF
850!ENDIF
851
852# When compiling for Windows Phone 8.1, an extra library path is
853# required.
854#
855!IF $(USE_WP81_OPTS)!=0
856!IFNDEF WP81LIBPATH
857!IF "$(PLATFORM)"=="x86"
858WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86
859!ELSEIF "$(PLATFORM)"=="ARM"
860WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\ARM
861!ELSE
862WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86
863!ENDIF
864!ENDIF
865!ENDIF
866
867# When compiling for Windows Phone 8.1, some extra linker options
868# are also required.
869#
870!IF $(USE_WP81_OPTS)!=0
871!IFDEF WP81LIBPATH
872LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(WP81LIBPATH)"
873!ENDIF
874LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE
875LTLINKOPTS = $(LTLINKOPTS) WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelHost.lib
876LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:kernel32.lib /NODEFAULTLIB:ole32.lib
877!ENDIF
878
879# When compiling for UAP, some extra linker options are also required.
880#
881!IF $(FOR_UAP)!=0
882LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE /NODEFAULTLIB:kernel32.lib
883LTLINKOPTS = $(LTLINKOPTS) mincore.lib
884!IFDEF PSDKLIBPATH
885LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(PSDKLIBPATH)"
886!ENDIF
887!ENDIF
888
889# If either debugging or symbols are enabled, enable PDBs.
890#
891!IF $(DEBUG)>1 || $(SYMBOLS)!=0
892LDFLAGS = /DEBUG $(LDOPTS)
893!ELSE
894LDFLAGS = $(LDOPTS)
895!ENDIF
896
897# Start with the Tcl related linker options.
898#
899!IF $(NO_TCL)==0
900LTLIBPATHS = /LIBPATH:$(TCLLIBDIR)
901LTLIBS = $(LIBTCL)
902!ENDIF
903
904# If ICU support is enabled, add the linker options for it.
905#
906!IF $(USE_ICU)!=0
907LTLIBPATHS = $(LTLIBPATHS) /LIBPATH:$(ICULIBDIR)
908LTLIBS = $(LTLIBS) $(LIBICU)
909!ENDIF
910
911# You should not have to change anything below this line
912###############################################################################
913
914# Object files for the SQLite library (non-amalgamation).
915#
916LIBOBJS0 = vdbe.lo parse.lo alter.lo analyze.lo attach.lo auth.lo \
917         backup.lo bitvec.lo btmutex.lo btree.lo build.lo \
918         callback.lo complete.lo ctime.lo date.lo dbstat.lo delete.lo \
919         expr.lo fault.lo fkey.lo \
920         fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo \
921         fts3_porter.lo fts3_snippet.lo fts3_tokenizer.lo fts3_tokenizer1.lo \
922         fts3_tokenize_vtab.lo fts3_unicode.lo fts3_unicode2.lo fts3_write.lo \
923         fts5.lo \
924         func.lo global.lo hash.lo \
925         icu.lo insert.lo journal.lo legacy.lo loadext.lo \
926         main.lo malloc.lo mem0.lo mem1.lo mem2.lo mem3.lo mem5.lo \
927         memjournal.lo \
928         mutex.lo mutex_noop.lo mutex_unix.lo mutex_w32.lo \
929         notify.lo opcodes.lo os.lo os_unix.lo os_win.lo \
930         pager.lo pcache.lo pcache1.lo pragma.lo prepare.lo printf.lo \
931         random.lo resolve.lo rowset.lo rtree.lo select.lo sqlite3rbu.lo status.lo \
932         table.lo threads.lo tokenize.lo treeview.lo trigger.lo \
933         update.lo util.lo vacuum.lo \
934         vdbeapi.lo vdbeaux.lo vdbeblob.lo vdbemem.lo vdbesort.lo \
935         vdbetrace.lo wal.lo walker.lo where.lo wherecode.lo whereexpr.lo \
936         utf.lo vtab.lo
937
938# Object files for the amalgamation.
939#
940LIBOBJS1 = sqlite3.lo
941
942# Determine the real value of LIBOBJ based on the 'configure' script
943#
944!IF $(USE_AMALGAMATION)==0
945LIBOBJ = $(LIBOBJS0)
946!ELSE
947LIBOBJ = $(LIBOBJS1)
948!ENDIF
949
950# Determine if embedded resource compilation and usage are enabled.
951#
952!IF $(USE_RC)!=0
953LIBRESOBJS = sqlite3res.lo
954!ELSE
955LIBRESOBJS =
956!ENDIF
957
958# All of the source code files.
959#
960SRC1 = \
961  $(TOP)\src\alter.c \
962  $(TOP)\src\analyze.c \
963  $(TOP)\src\attach.c \
964  $(TOP)\src\auth.c \
965  $(TOP)\src\backup.c \
966  $(TOP)\src\bitvec.c \
967  $(TOP)\src\btmutex.c \
968  $(TOP)\src\btree.c \
969  $(TOP)\src\btree.h \
970  $(TOP)\src\btreeInt.h \
971  $(TOP)\src\build.c \
972  $(TOP)\src\callback.c \
973  $(TOP)\src\complete.c \
974  $(TOP)\src\ctime.c \
975  $(TOP)\src\date.c \
976  $(TOP)\src\dbstat.c \
977  $(TOP)\src\delete.c \
978  $(TOP)\src\expr.c \
979  $(TOP)\src\fault.c \
980  $(TOP)\src\fkey.c \
981  $(TOP)\src\func.c \
982  $(TOP)\src\global.c \
983  $(TOP)\src\hash.c \
984  $(TOP)\src\hash.h \
985  $(TOP)\src\hwtime.h \
986  $(TOP)\src\insert.c \
987  $(TOP)\src\journal.c \
988  $(TOP)\src\legacy.c \
989  $(TOP)\src\loadext.c \
990  $(TOP)\src\main.c \
991  $(TOP)\src\malloc.c \
992  $(TOP)\src\mem0.c \
993  $(TOP)\src\mem1.c \
994  $(TOP)\src\mem2.c \
995  $(TOP)\src\mem3.c \
996  $(TOP)\src\mem5.c \
997  $(TOP)\src\memjournal.c \
998  $(TOP)\src\msvc.h \
999  $(TOP)\src\mutex.c \
1000  $(TOP)\src\mutex.h \
1001  $(TOP)\src\mutex_noop.c \
1002  $(TOP)\src\mutex_unix.c \
1003  $(TOP)\src\mutex_w32.c \
1004  $(TOP)\src\notify.c \
1005  $(TOP)\src\os.c \
1006  $(TOP)\src\os.h \
1007  $(TOP)\src\os_common.h \
1008  $(TOP)\src\os_setup.h \
1009  $(TOP)\src\os_unix.c \
1010  $(TOP)\src\os_win.c \
1011  $(TOP)\src\os_win.h
1012SRC2 = \
1013  $(TOP)\src\pager.c \
1014  $(TOP)\src\pager.h \
1015  $(TOP)\src\parse.y \
1016  $(TOP)\src\pcache.c \
1017  $(TOP)\src\pcache.h \
1018  $(TOP)\src\pcache1.c \
1019  $(TOP)\src\pragma.c \
1020  $(TOP)\src\pragma.h \
1021  $(TOP)\src\prepare.c \
1022  $(TOP)\src\printf.c \
1023  $(TOP)\src\random.c \
1024  $(TOP)\src\resolve.c \
1025  $(TOP)\src\rowset.c \
1026  $(TOP)\src\select.c \
1027  $(TOP)\src\status.c \
1028  $(TOP)\src\shell.c \
1029  $(TOP)\src\sqlite.h.in \
1030  $(TOP)\src\sqlite3ext.h \
1031  $(TOP)\src\sqliteInt.h \
1032  $(TOP)\src\sqliteLimit.h \
1033  $(TOP)\src\table.c \
1034  $(TOP)\src\threads.c \
1035  $(TOP)\src\tclsqlite.c \
1036  $(TOP)\src\tokenize.c \
1037  $(TOP)\src\treeview.c \
1038  $(TOP)\src\trigger.c \
1039  $(TOP)\src\utf.c \
1040  $(TOP)\src\update.c \
1041  $(TOP)\src\util.c \
1042  $(TOP)\src\vacuum.c \
1043  $(TOP)\src\vdbe.c \
1044  $(TOP)\src\vdbe.h \
1045  $(TOP)\src\vdbeapi.c \
1046  $(TOP)\src\vdbeaux.c \
1047  $(TOP)\src\vdbeblob.c \
1048  $(TOP)\src\vdbemem.c \
1049  $(TOP)\src\vdbesort.c \
1050  $(TOP)\src\vdbetrace.c \
1051  $(TOP)\src\vdbeInt.h \
1052  $(TOP)\src\vtab.c \
1053  $(TOP)\src\vxworks.h \
1054  $(TOP)\src\wal.c \
1055  $(TOP)\src\wal.h \
1056  $(TOP)\src\walker.c \
1057  $(TOP)\src\where.c \
1058  $(TOP)\src\wherecode.c \
1059  $(TOP)\src\whereexpr.c \
1060  $(TOP)\src\whereInt.h
1061
1062# Source code for extensions
1063#
1064SRC3 = \
1065  $(TOP)\ext\fts1\fts1.c \
1066  $(TOP)\ext\fts1\fts1.h \
1067  $(TOP)\ext\fts1\fts1_hash.c \
1068  $(TOP)\ext\fts1\fts1_hash.h \
1069  $(TOP)\ext\fts1\fts1_porter.c \
1070  $(TOP)\ext\fts1\fts1_tokenizer.h \
1071  $(TOP)\ext\fts1\fts1_tokenizer1.c \
1072  $(TOP)\ext\fts2\fts2.c \
1073  $(TOP)\ext\fts2\fts2.h \
1074  $(TOP)\ext\fts2\fts2_hash.c \
1075  $(TOP)\ext\fts2\fts2_hash.h \
1076  $(TOP)\ext\fts2\fts2_icu.c \
1077  $(TOP)\ext\fts2\fts2_porter.c \
1078  $(TOP)\ext\fts2\fts2_tokenizer.h \
1079  $(TOP)\ext\fts2\fts2_tokenizer.c \
1080  $(TOP)\ext\fts2\fts2_tokenizer1.c
1081SRC4 = \
1082  $(TOP)\ext\fts3\fts3.c \
1083  $(TOP)\ext\fts3\fts3.h \
1084  $(TOP)\ext\fts3\fts3Int.h \
1085  $(TOP)\ext\fts3\fts3_aux.c \
1086  $(TOP)\ext\fts3\fts3_expr.c \
1087  $(TOP)\ext\fts3\fts3_hash.c \
1088  $(TOP)\ext\fts3\fts3_hash.h \
1089  $(TOP)\ext\fts3\fts3_icu.c \
1090  $(TOP)\ext\fts3\fts3_porter.c \
1091  $(TOP)\ext\fts3\fts3_snippet.c \
1092  $(TOP)\ext\fts3\fts3_tokenizer.h \
1093  $(TOP)\ext\fts3\fts3_tokenizer.c \
1094  $(TOP)\ext\fts3\fts3_tokenizer1.c \
1095  $(TOP)\ext\fts3\fts3_tokenize_vtab.c \
1096  $(TOP)\ext\fts3\fts3_unicode.c \
1097  $(TOP)\ext\fts3\fts3_unicode2.c \
1098  $(TOP)\ext\fts3\fts3_write.c \
1099  $(TOP)\ext\icu\sqliteicu.h \
1100  $(TOP)\ext\icu\icu.c \
1101  $(TOP)\ext\rtree\rtree.h \
1102  $(TOP)\ext\rtree\rtree.c \
1103  $(TOP)\ext\rbu\sqlite3rbu.h \
1104  $(TOP)\ext\rbu\sqlite3rbu.c \
1105  $(TOP)\ext\misc\json1.c
1106
1107
1108# Generated source code files
1109#
1110SRC5 = \
1111  keywordhash.h \
1112  opcodes.c \
1113  opcodes.h \
1114  parse.c \
1115  parse.h \
1116  $(SQLITE3H)
1117
1118# All source code files.
1119#
1120SRC = $(SRC1) $(SRC2) $(SRC3) $(SRC4) $(SRC5)
1121
1122# Source code to the test files.
1123#
1124TESTSRC = \
1125  $(TOP)\src\test1.c \
1126  $(TOP)\src\test2.c \
1127  $(TOP)\src\test3.c \
1128  $(TOP)\src\test4.c \
1129  $(TOP)\src\test5.c \
1130  $(TOP)\src\test6.c \
1131  $(TOP)\src\test7.c \
1132  $(TOP)\src\test8.c \
1133  $(TOP)\src\test9.c \
1134  $(TOP)\src\test_autoext.c \
1135  $(TOP)\src\test_async.c \
1136  $(TOP)\src\test_backup.c \
1137  $(TOP)\src\test_blob.c \
1138  $(TOP)\src\test_btree.c \
1139  $(TOP)\src\test_config.c \
1140  $(TOP)\src\test_demovfs.c \
1141  $(TOP)\src\test_devsym.c \
1142  $(TOP)\src\test_fs.c \
1143  $(TOP)\src\test_func.c \
1144  $(TOP)\src\test_hexio.c \
1145  $(TOP)\src\test_init.c \
1146  $(TOP)\src\test_intarray.c \
1147  $(TOP)\src\test_journal.c \
1148  $(TOP)\src\test_malloc.c \
1149  $(TOP)\src\test_multiplex.c \
1150  $(TOP)\src\test_mutex.c \
1151  $(TOP)\src\test_onefile.c \
1152  $(TOP)\src\test_osinst.c \
1153  $(TOP)\src\test_pcache.c \
1154  $(TOP)\src\test_quota.c \
1155  $(TOP)\src\test_rtree.c \
1156  $(TOP)\src\test_schema.c \
1157  $(TOP)\src\test_server.c \
1158  $(TOP)\src\test_superlock.c \
1159  $(TOP)\src\test_syscall.c \
1160  $(TOP)\src\test_tclvar.c \
1161  $(TOP)\src\test_thread.c \
1162  $(TOP)\src\test_vfs.c \
1163  $(TOP)\src\test_windirent.c \
1164  $(TOP)\src\test_wsd.c \
1165  $(TOP)\ext\fts3\fts3_term.c \
1166  $(TOP)\ext\fts3\fts3_test.c \
1167  $(TOP)\ext\rbu\test_rbu.c
1168
1169# Statically linked extensions
1170#
1171TESTEXT = \
1172  $(TOP)\ext\misc\amatch.c \
1173  $(TOP)\ext\misc\closure.c \
1174  $(TOP)\ext\misc\eval.c \
1175  $(TOP)\ext\misc\fileio.c \
1176  $(TOP)\ext\misc\fuzzer.c \
1177  $(TOP)\ext\fts5\fts5_tcl.c \
1178  $(TOP)\ext\fts5\fts5_test_mi.c \
1179  $(TOP)\ext\fts5\fts5_test_tok.c \
1180  $(TOP)\ext\misc\ieee754.c \
1181  $(TOP)\ext\misc\nextchar.c \
1182  $(TOP)\ext\misc\percentile.c \
1183  $(TOP)\ext\misc\regexp.c \
1184  $(TOP)\ext\misc\series.c \
1185  $(TOP)\ext\misc\spellfix.c \
1186  $(TOP)\ext\misc\totype.c \
1187  $(TOP)\ext\misc\wholenumber.c
1188
1189
1190# Source code to the library files needed by the test fixture
1191#
1192TESTSRC2 = \
1193  $(TOP)\src\attach.c \
1194  $(TOP)\src\backup.c \
1195  $(TOP)\src\bitvec.c \
1196  $(TOP)\src\btree.c \
1197  $(TOP)\src\build.c \
1198  $(TOP)\src\ctime.c \
1199  $(TOP)\src\date.c \
1200  $(TOP)\src\dbstat.c \
1201  $(TOP)\src\expr.c \
1202  $(TOP)\src\func.c \
1203  $(TOP)\src\insert.c \
1204  $(TOP)\src\wal.c \
1205  $(TOP)\src\main.c \
1206  $(TOP)\src\mem5.c \
1207  $(TOP)\src\os.c \
1208  $(TOP)\src\os_unix.c \
1209  $(TOP)\src\os_win.c \
1210  $(TOP)\src\pager.c \
1211  $(TOP)\src\pragma.c \
1212  $(TOP)\src\prepare.c \
1213  $(TOP)\src\printf.c \
1214  $(TOP)\src\random.c \
1215  $(TOP)\src\pcache.c \
1216  $(TOP)\src\pcache1.c \
1217  $(TOP)\src\select.c \
1218  $(TOP)\src\tokenize.c \
1219  $(TOP)\src\utf.c \
1220  $(TOP)\src\util.c \
1221  $(TOP)\src\vdbeapi.c \
1222  $(TOP)\src\vdbeaux.c \
1223  $(TOP)\src\vdbe.c \
1224  $(TOP)\src\vdbemem.c \
1225  $(TOP)\src\vdbesort.c \
1226  $(TOP)\src\vdbetrace.c \
1227  $(TOP)\src\where.c \
1228  $(TOP)\src\wherecode.c \
1229  $(TOP)\src\whereexpr.c \
1230  parse.c \
1231  $(TOP)\ext\fts3\fts3.c \
1232  $(TOP)\ext\fts3\fts3_aux.c \
1233  $(TOP)\ext\fts3\fts3_expr.c \
1234  $(TOP)\ext\fts3\fts3_tokenizer.c \
1235  $(TOP)\ext\fts3\fts3_tokenize_vtab.c \
1236  $(TOP)\ext\fts3\fts3_unicode.c \
1237  $(TOP)\ext\fts3\fts3_unicode2.c \
1238  $(TOP)\ext\fts3\fts3_write.c \
1239  $(TOP)\ext\async\sqlite3async.c
1240
1241# Header files used by all library source files.
1242#
1243HDR = \
1244   $(TOP)\src\btree.h \
1245   $(TOP)\src\btreeInt.h \
1246   $(TOP)\src\hash.h \
1247   $(TOP)\src\hwtime.h \
1248   keywordhash.h \
1249   $(TOP)\src\msvc.h \
1250   $(TOP)\src\mutex.h \
1251   opcodes.h \
1252   $(TOP)\src\os.h \
1253   $(TOP)\src\os_common.h \
1254   $(TOP)\src\os_setup.h \
1255   $(TOP)\src\os_win.h \
1256   $(TOP)\src\pager.h \
1257   $(TOP)\src\pcache.h \
1258   parse.h \
1259   $(TOP)\src\pragma.h \
1260   $(SQLITE3H) \
1261   $(TOP)\src\sqlite3ext.h \
1262   $(TOP)\src\sqliteInt.h \
1263   $(TOP)\src\sqliteLimit.h \
1264   $(TOP)\src\vdbe.h \
1265   $(TOP)\src\vdbeInt.h \
1266   $(TOP)\src\vxworks.h \
1267   $(TOP)\src\whereInt.h
1268
1269# Header files used by extensions
1270#
1271EXTHDR = $(EXTHDR) \
1272  $(TOP)\ext\fts1\fts1.h \
1273  $(TOP)\ext\fts1\fts1_hash.h \
1274  $(TOP)\ext\fts1\fts1_tokenizer.h
1275EXTHDR = $(EXTHDR) \
1276  $(TOP)\ext\fts2\fts2.h \
1277  $(TOP)\ext\fts2\fts2_hash.h \
1278  $(TOP)\ext\fts2\fts2_tokenizer.h
1279EXTHDR = $(EXTHDR) \
1280  $(TOP)\ext\fts3\fts3.h \
1281  $(TOP)\ext\fts3\fts3Int.h \
1282  $(TOP)\ext\fts3\fts3_hash.h \
1283  $(TOP)\ext\fts3\fts3_tokenizer.h
1284EXTHDR = $(EXTHDR) \
1285  $(TOP)\ext\rtree\rtree.h
1286EXTHDR = $(EXTHDR) \
1287  $(TOP)\ext\icu\sqliteicu.h
1288EXTHDR = $(EXTHDR) \
1289  $(TOP)\ext\rtree\sqlite3rtree.h
1290
1291# executables needed for testing
1292#
1293TESTPROGS = \
1294  testfixture.exe \
1295  $(SQLITE3EXE) \
1296  sqlite3_analyzer.exe \
1297  sqldiff.exe
1298
1299# Databases containing fuzzer test cases
1300#
1301FUZZDATA = \
1302  $(TOP)\test\fuzzdata1.db \
1303  $(TOP)\test\fuzzdata2.db \
1304  $(TOP)\test\fuzzdata3.db \
1305  $(TOP)\test\fuzzdata4.db
1306
1307# Additional compiler options for the shell.  These are only effective
1308# when the shell is not being dynamically linked.
1309#
1310!IF $(DYNAMIC_SHELL)==0 && $(FOR_WIN10)==0
1311SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_SHELL_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5
1312!ENDIF
1313
1314# Extra compiler options for various test tools.
1315#
1316MPTESTER_COMPILE_OPTS = -DSQLITE_SHELL_JSON1 -DSQLITE_ENABLE_FTS5
1317FUZZERSHELL_COMPILE_OPTS = -DSQLITE_ENABLE_JSON1
1318FUZZCHECK_COMPILE_OPTS = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMSYS5
1319
1320# Standard options to testfixture.
1321#
1322TESTOPTS = --verbose=file --output=test-out.txt
1323
1324# This is the default Makefile target.  The objects listed here
1325# are what get build when you type just "make" with no arguments.
1326#
1327all:	dll libsqlite3.lib shell libtclsqlite3.lib
1328
1329# Dynamic link library section.
1330#
1331dll: $(SQLITE3DLL)
1332
1333# Shell executable.
1334#
1335shell: $(SQLITE3EXE)
1336
1337libsqlite3.lib:	$(LIBOBJ)
1338	$(LTLIB) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS)
1339
1340libtclsqlite3.lib:	tclsqlite.lo libsqlite3.lib
1341	$(LTLIB) $(LTLIBOPTS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCLSTUB) $(TLIBS)
1342
1343$(SQLITE3DLL): $(LIBOBJ) $(LIBRESOBJS) $(CORE_LINK_DEP)
1344	$(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL $(CORE_LINK_OPTS) /OUT:$@ $(LIBOBJ) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
1345
1346sqlite3.def: libsqlite3.lib
1347	echo EXPORTS > sqlite3.def
1348	dumpbin /all libsqlite3.lib \
1349		| $(TCLSH_CMD) $(TOP)\tool\replace.tcl include "^\s+1 _?(sqlite3_.*)$$" \1 \
1350		| sort >> sqlite3.def
1351
1352$(SQLITE3EXE):	$(TOP)\src\shell.c $(SHELL_CORE_DEP) $(LIBRESOBJS) $(SHELL_CORE_SRC) $(SQLITE3H)
1353	$(LTLINK) $(SHELL_COMPILE_OPTS) $(READLINE_FLAGS) $(TOP)\src\shell.c $(SHELL_CORE_SRC) \
1354		/link $(SQLITE3EXEPDB) $(LDFLAGS) $(LTLINKOPTS) $(SHELL_LINK_OPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS)
1355
1356sqldiff.exe:	$(TOP)\tool\sqldiff.c $(SQLITE3C) $(SQLITE3H)
1357	$(LTLINK) $(NO_WARN) $(TOP)\tool\sqldiff.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
1358
1359fuzzershell.exe:	$(TOP)\tool\fuzzershell.c $(SQLITE3C) $(SQLITE3H)
1360	$(LTLINK) $(NO_WARN) $(FUZZERSHELL_COMPILE_OPTS) $(TOP)\tool\fuzzershell.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
1361
1362fuzzcheck.exe:	$(TOP)\test\fuzzcheck.c $(SQLITE3C) $(SQLITE3H)
1363	$(LTLINK) $(NO_WARN) $(FUZZCHECK_COMPILE_OPTS) $(TOP)\test\fuzzcheck.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
1364
1365mptester.exe:	$(TOP)\mptest\mptest.c $(SQLITE3C) $(SQLITE3H)
1366	$(LTLINK) $(NO_WARN) $(MPTESTER_COMPILE_OPTS) $(TOP)\mptest\mptest.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
1367
1368MPTEST1 = mptester mptest.db $(TOP)\mptest\crash01.test --repeat 20
1369MPTEST2 = mptester mptest.db $(TOP)\mptest\multiwrite01.test --repeat 20
1370
1371mptest:	mptester.exe
1372	del /Q mptest.db 2>NUL
1373	$(MPTEST1) --journalmode DELETE
1374	$(MPTEST2) --journalmode WAL
1375	$(MPTEST1) --journalmode WAL
1376	$(MPTEST2) --journalmode PERSIST
1377	$(MPTEST1) --journalmode PERSIST
1378	$(MPTEST2) --journalmode TRUNCATE
1379	$(MPTEST1) --journalmode TRUNCATE
1380	$(MPTEST2) --journalmode DELETE
1381
1382# This target creates a directory named "tsrc" and fills it with
1383# copies of all of the C source code and header files needed to
1384# build on the target system.  Some of the C source code and header
1385# files are automatically generated.  This target takes care of
1386# all that automatic generation.
1387#
1388.target_source:	$(SRC) $(TOP)\tool\vdbe-compress.tcl fts5.c
1389	-rmdir /Q/S tsrc 2>NUL
1390	-mkdir tsrc
1391	for %i in ($(SRC1)) do copy /Y %i tsrc
1392	for %i in ($(SRC2)) do copy /Y %i tsrc
1393	for %i in ($(SRC3)) do copy /Y %i tsrc
1394	for %i in ($(SRC4)) do copy /Y %i tsrc
1395	for %i in ($(SRC5)) do copy /Y %i tsrc
1396	copy /Y fts5.c tsrc
1397	copy /Y fts5.h tsrc
1398	del /Q tsrc\sqlite.h.in tsrc\parse.y 2>NUL
1399	$(TCLSH_CMD) $(TOP)\tool\vdbe-compress.tcl $(OPTS) < tsrc\vdbe.c > vdbe.new
1400	move vdbe.new tsrc\vdbe.c
1401	echo > .target_source
1402
1403sqlite3.c:	.target_source sqlite3ext.h $(TOP)\tool\mksqlite3c.tcl
1404	$(TCLSH_CMD) $(TOP)\tool\mksqlite3c.tcl $(MKSQLITE3C_ARGS)
1405	copy tsrc\shell.c .
1406
1407sqlite3-all.c:	sqlite3.c $(TOP)\tool\split-sqlite3c.tcl
1408	$(TCLSH_CMD) $(TOP)\tool\split-sqlite3c.tcl
1409
1410# Rule to build the amalgamation
1411#
1412sqlite3.lo:	$(SQLITE3C)
1413	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(SQLITE3C)
1414
1415# Rules to build the LEMON compiler generator
1416#
1417lempar.c:	$(TOP)\tool\lempar.c
1418	copy $(TOP)\tool\lempar.c .
1419
1420lemon.exe:	$(TOP)\tool\lemon.c lempar.c
1421	$(BCC) $(NO_WARN) -Daccess=_access \
1422		-Fe$@ $(TOP)\tool\lemon.c /link $(LDFLAGS) $(NLTLINKOPTS) $(NLTLIBPATHS)
1423
1424# Rules to build individual *.lo files from generated *.c files. This
1425# applies to:
1426#
1427#     parse.lo
1428#     opcodes.lo
1429#
1430parse.lo:	parse.c $(HDR)
1431	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c parse.c
1432
1433opcodes.lo:	opcodes.c
1434	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c opcodes.c
1435
1436# Rule to build the Win32 resources object file.
1437#
1438!IF $(USE_RC)!=0
1439$(LIBRESOBJS):	$(TOP)\src\sqlite3.rc $(SQLITE3H)
1440	echo #ifndef SQLITE_RESOURCE_VERSION > sqlite3rc.h
1441	for /F %%V in ('type "$(TOP)\VERSION"') do ( \
1442		echo #define SQLITE_RESOURCE_VERSION %%V \
1443			| $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact . ^, >> sqlite3rc.h \
1444	)
1445	echo #endif >> sqlite3rc.h
1446	$(LTRCOMPILE) -fo $(LIBRESOBJS) $(TOP)\src\sqlite3.rc
1447!ENDIF
1448
1449# Rules to build individual *.lo files from files in the src directory.
1450#
1451alter.lo:	$(TOP)\src\alter.c $(HDR)
1452	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\alter.c
1453
1454analyze.lo:	$(TOP)\src\analyze.c $(HDR)
1455	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\analyze.c
1456
1457attach.lo:	$(TOP)\src\attach.c $(HDR)
1458	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\attach.c
1459
1460auth.lo:	$(TOP)\src\auth.c $(HDR)
1461	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\auth.c
1462
1463backup.lo:	$(TOP)\src\backup.c $(HDR)
1464	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\backup.c
1465
1466bitvec.lo:	$(TOP)\src\bitvec.c $(HDR)
1467	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\bitvec.c
1468
1469btmutex.lo:	$(TOP)\src\btmutex.c $(HDR)
1470	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\btmutex.c
1471
1472btree.lo:	$(TOP)\src\btree.c $(HDR) $(TOP)\src\pager.h
1473	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\btree.c
1474
1475build.lo:	$(TOP)\src\build.c $(HDR)
1476	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\build.c
1477
1478callback.lo:	$(TOP)\src\callback.c $(HDR)
1479	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\callback.c
1480
1481complete.lo:	$(TOP)\src\complete.c $(HDR)
1482	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\complete.c
1483
1484ctime.lo:	$(TOP)\src\ctime.c $(HDR)
1485	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\ctime.c
1486
1487date.lo:	$(TOP)\src\date.c $(HDR)
1488	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\date.c
1489
1490dbstat.lo:	$(TOP)\src\date.c $(HDR)
1491	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\dbstat.c
1492
1493delete.lo:	$(TOP)\src\delete.c $(HDR)
1494	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\delete.c
1495
1496expr.lo:	$(TOP)\src\expr.c $(HDR)
1497	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\expr.c
1498
1499fault.lo:	$(TOP)\src\fault.c $(HDR)
1500	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\fault.c
1501
1502fkey.lo:	$(TOP)\src\fkey.c $(HDR)
1503	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\fkey.c
1504
1505func.lo:	$(TOP)\src\func.c $(HDR)
1506	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\func.c
1507
1508global.lo:	$(TOP)\src\global.c $(HDR)
1509	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\global.c
1510
1511hash.lo:	$(TOP)\src\hash.c $(HDR)
1512	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\hash.c
1513
1514insert.lo:	$(TOP)\src\insert.c $(HDR)
1515	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\insert.c
1516
1517journal.lo:	$(TOP)\src\journal.c $(HDR)
1518	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\journal.c
1519
1520legacy.lo:	$(TOP)\src\legacy.c $(HDR)
1521	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\legacy.c
1522
1523loadext.lo:	$(TOP)\src\loadext.c $(HDR)
1524	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\loadext.c
1525
1526main.lo:	$(TOP)\src\main.c $(HDR)
1527	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\main.c
1528
1529malloc.lo:	$(TOP)\src\malloc.c $(HDR)
1530	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\malloc.c
1531
1532mem0.lo:	$(TOP)\src\mem0.c $(HDR)
1533	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem0.c
1534
1535mem1.lo:	$(TOP)\src\mem1.c $(HDR)
1536	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem1.c
1537
1538mem2.lo:	$(TOP)\src\mem2.c $(HDR)
1539	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem2.c
1540
1541mem3.lo:	$(TOP)\src\mem3.c $(HDR)
1542	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem3.c
1543
1544mem5.lo:	$(TOP)\src\mem5.c $(HDR)
1545	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem5.c
1546
1547memjournal.lo:	$(TOP)\src\memjournal.c $(HDR)
1548	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\memjournal.c
1549
1550mutex.lo:	$(TOP)\src\mutex.c $(HDR)
1551	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex.c
1552
1553mutex_noop.lo:	$(TOP)\src\mutex_noop.c $(HDR)
1554	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex_noop.c
1555
1556mutex_unix.lo:	$(TOP)\src\mutex_unix.c $(HDR)
1557	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex_unix.c
1558
1559mutex_w32.lo:	$(TOP)\src\mutex_w32.c $(HDR)
1560	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex_w32.c
1561
1562notify.lo:	$(TOP)\src\notify.c $(HDR)
1563	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\notify.c
1564
1565pager.lo:	$(TOP)\src\pager.c $(HDR) $(TOP)\src\pager.h
1566	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pager.c
1567
1568pcache.lo:	$(TOP)\src\pcache.c $(HDR) $(TOP)\src\pcache.h
1569	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pcache.c
1570
1571pcache1.lo:	$(TOP)\src\pcache1.c $(HDR) $(TOP)\src\pcache.h
1572	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pcache1.c
1573
1574os.lo:	$(TOP)\src\os.c $(HDR)
1575	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\os.c
1576
1577os_unix.lo:	$(TOP)\src\os_unix.c $(HDR)
1578	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\os_unix.c
1579
1580os_win.lo:	$(TOP)\src\os_win.c $(HDR)
1581	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\os_win.c
1582
1583pragma.lo:	$(TOP)\src\pragma.c $(HDR)
1584	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pragma.c
1585
1586prepare.lo:	$(TOP)\src\prepare.c $(HDR)
1587	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\prepare.c
1588
1589printf.lo:	$(TOP)\src\printf.c $(HDR)
1590	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\printf.c
1591
1592random.lo:	$(TOP)\src\random.c $(HDR)
1593	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\random.c
1594
1595resolve.lo:	$(TOP)\src\resolve.c $(HDR)
1596	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\resolve.c
1597
1598rowset.lo:	$(TOP)\src\rowset.c $(HDR)
1599	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\rowset.c
1600
1601select.lo:	$(TOP)\src\select.c $(HDR)
1602	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\select.c
1603
1604status.lo:	$(TOP)\src\status.c $(HDR)
1605	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\status.c
1606
1607table.lo:	$(TOP)\src\table.c $(HDR)
1608	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\table.c
1609
1610threads.lo:	$(TOP)\src\threads.c $(HDR)
1611	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\threads.c
1612
1613tokenize.lo:	$(TOP)\src\tokenize.c keywordhash.h $(HDR)
1614	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\tokenize.c
1615
1616treeview.lo:	$(TOP)\src\treeview.c $(HDR)
1617	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\treeview.c
1618
1619trigger.lo:	$(TOP)\src\trigger.c $(HDR)
1620	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\trigger.c
1621
1622update.lo:	$(TOP)\src\update.c $(HDR)
1623	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\update.c
1624
1625utf.lo:	$(TOP)\src\utf.c $(HDR)
1626	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\utf.c
1627
1628util.lo:	$(TOP)\src\util.c $(HDR)
1629	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\util.c
1630
1631vacuum.lo:	$(TOP)\src\vacuum.c $(HDR)
1632	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vacuum.c
1633
1634vdbe.lo:	$(TOP)\src\vdbe.c $(HDR)
1635	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbe.c
1636
1637vdbeapi.lo:	$(TOP)\src\vdbeapi.c $(HDR)
1638	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbeapi.c
1639
1640vdbeaux.lo:	$(TOP)\src\vdbeaux.c $(HDR)
1641	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbeaux.c
1642
1643vdbeblob.lo:	$(TOP)\src\vdbeblob.c $(HDR)
1644	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbeblob.c
1645
1646vdbemem.lo:	$(TOP)\src\vdbemem.c $(HDR)
1647	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbemem.c
1648
1649vdbesort.lo:	$(TOP)\src\vdbesort.c $(HDR)
1650	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbesort.c
1651
1652vdbetrace.lo:	$(TOP)\src\vdbetrace.c $(HDR)
1653	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbetrace.c
1654
1655vtab.lo:	$(TOP)\src\vtab.c $(HDR)
1656	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vtab.c
1657
1658wal.lo:	$(TOP)\src\wal.c $(HDR)
1659	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\wal.c
1660
1661walker.lo:	$(TOP)\src\walker.c $(HDR)
1662	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\walker.c
1663
1664where.lo:	$(TOP)\src\where.c $(HDR)
1665	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\where.c
1666
1667wherecode.lo:	$(TOP)\src\wherecode.c $(HDR)
1668	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\wherecode.c
1669
1670whereexpr.lo:	$(TOP)\src\whereexpr.c $(HDR)
1671	$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\whereexpr.c
1672
1673tclsqlite.lo:	$(TOP)\src\tclsqlite.c $(HDR)
1674	$(LTCOMPILE) $(NO_WARN) -DUSE_TCL_STUBS=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c
1675
1676tclsqlite-shell.lo:	$(TOP)\src\tclsqlite.c $(HDR)
1677	$(LTCOMPILE) $(NO_WARN) -DTCLSH=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c
1678
1679tclsqlite3.exe:	tclsqlite-shell.lo $(SQLITE3C) $(SQLITE3H) $(LIBRESOBJS)
1680	$(LTLINK) $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /OUT:$@ tclsqlite-shell.lo $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
1681
1682# Rules to build opcodes.c and opcodes.h
1683#
1684opcodes.c:	opcodes.h $(TOP)\tool\mkopcodec.tcl
1685	$(TCLSH_CMD) $(TOP)\tool\mkopcodec.tcl opcodes.h > opcodes.c
1686
1687opcodes.h:	parse.h $(TOP)\src\vdbe.c $(TOP)\tool\mkopcodeh.tcl
1688	type parse.h $(TOP)\src\vdbe.c | $(TCLSH_CMD) $(TOP)\tool\mkopcodeh.tcl > opcodes.h
1689
1690# Rules to build parse.c and parse.h - the outputs of lemon.
1691#
1692parse.h:	parse.c
1693
1694parse.c:	$(TOP)\src\parse.y lemon.exe $(TOP)\tool\addopcodes.tcl
1695	del /Q parse.y parse.h parse.h.temp 2>NUL
1696	copy $(TOP)\src\parse.y .
1697	.\lemon.exe $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) $(OPTS) parse.y
1698	move parse.h parse.h.temp
1699	$(TCLSH_CMD) $(TOP)\tool\addopcodes.tcl parse.h.temp > parse.h
1700
1701$(SQLITE3H):	$(TOP)\src\sqlite.h.in $(TOP)\manifest.uuid $(TOP)\VERSION
1702	$(TCLSH_CMD) $(TOP)\tool\mksqlite3h.tcl $(TOP:\=/) > $(SQLITE3H)
1703
1704sqlite3ext.h: .target_source
1705	copy tsrc\sqlite3ext.h .
1706
1707mkkeywordhash.exe:	$(TOP)\tool\mkkeywordhash.c
1708	$(BCC) $(NO_WARN) -Fe$@ $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) $(OPTS) \
1709		$(TOP)\tool\mkkeywordhash.c /link $(LDFLAGS) $(NLTLINKOPTS) $(NLTLIBPATHS)
1710
1711keywordhash.h:	$(TOP)\tool\mkkeywordhash.c mkkeywordhash.exe
1712	.\mkkeywordhash.exe > keywordhash.h
1713
1714
1715
1716# Rules to build the extension objects.
1717#
1718icu.lo:	$(TOP)\ext\icu\icu.c $(HDR) $(EXTHDR)
1719	$(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\icu\icu.c
1720
1721fts2.lo:	$(TOP)\ext\fts2\fts2.c $(HDR) $(EXTHDR)
1722	$(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2.c
1723
1724fts2_hash.lo:	$(TOP)\ext\fts2\fts2_hash.c $(HDR) $(EXTHDR)
1725	$(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_hash.c
1726
1727fts2_icu.lo:	$(TOP)\ext\fts2\fts2_icu.c $(HDR) $(EXTHDR)
1728	$(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_icu.c
1729
1730fts2_porter.lo:	$(TOP)\ext\fts2\fts2_porter.c $(HDR) $(EXTHDR)
1731	$(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_porter.c
1732
1733fts2_tokenizer.lo:	$(TOP)\ext\fts2\fts2_tokenizer.c $(HDR) $(EXTHDR)
1734	$(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_tokenizer.c
1735
1736fts2_tokenizer1.lo:	$(TOP)\ext\fts2\fts2_tokenizer1.c $(HDR) $(EXTHDR)
1737	$(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_tokenizer1.c
1738
1739fts3.lo:	$(TOP)\ext\fts3\fts3.c $(HDR) $(EXTHDR)
1740	$(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3.c
1741
1742fts3_aux.lo:	$(TOP)\ext\fts3\fts3_aux.c $(HDR) $(EXTHDR)
1743	$(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_aux.c
1744
1745fts3_expr.lo:	$(TOP)\ext\fts3\fts3_expr.c $(HDR) $(EXTHDR)
1746	$(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_expr.c
1747
1748fts3_hash.lo:	$(TOP)\ext\fts3\fts3_hash.c $(HDR) $(EXTHDR)
1749	$(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_hash.c
1750
1751fts3_icu.lo:	$(TOP)\ext\fts3\fts3_icu.c $(HDR) $(EXTHDR)
1752	$(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_icu.c
1753
1754fts3_snippet.lo:	$(TOP)\ext\fts3\fts3_snippet.c $(HDR) $(EXTHDR)
1755	$(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_snippet.c
1756
1757fts3_porter.lo:	$(TOP)\ext\fts3\fts3_porter.c $(HDR) $(EXTHDR)
1758	$(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_porter.c
1759
1760fts3_tokenizer.lo:	$(TOP)\ext\fts3\fts3_tokenizer.c $(HDR) $(EXTHDR)
1761	$(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenizer.c
1762
1763fts3_tokenizer1.lo:	$(TOP)\ext\fts3\fts3_tokenizer1.c $(HDR) $(EXTHDR)
1764	$(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenizer1.c
1765
1766fts3_tokenize_vtab.lo:	$(TOP)\ext\fts3\fts3_tokenize_vtab.c $(HDR) $(EXTHDR)
1767	$(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenize_vtab.c
1768
1769fts3_unicode.lo:	$(TOP)\ext\fts3\fts3_unicode.c $(HDR) $(EXTHDR)
1770	$(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_unicode.c
1771
1772fts3_unicode2.lo:	$(TOP)\ext\fts3\fts3_unicode2.c $(HDR) $(EXTHDR)
1773	$(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_unicode2.c
1774
1775fts3_write.lo:	$(TOP)\ext\fts3\fts3_write.c $(HDR) $(EXTHDR)
1776	$(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_write.c
1777
1778rtree.lo:	$(TOP)\ext\rtree\rtree.c $(HDR) $(EXTHDR)
1779	$(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\rtree\rtree.c
1780
1781# FTS5 things
1782#
1783FTS5_SRC = \
1784   $(TOP)\ext\fts5\fts5.h \
1785   $(TOP)\ext\fts5\fts5Int.h \
1786   $(TOP)\ext\fts5\fts5_aux.c \
1787   $(TOP)\ext\fts5\fts5_buffer.c \
1788   $(TOP)\ext\fts5\fts5_main.c \
1789   $(TOP)\ext\fts5\fts5_config.c \
1790   $(TOP)\ext\fts5\fts5_expr.c \
1791   $(TOP)\ext\fts5\fts5_hash.c \
1792   $(TOP)\ext\fts5\fts5_index.c \
1793   fts5parse.c fts5parse.h \
1794   $(TOP)\ext\fts5\fts5_storage.c \
1795   $(TOP)\ext\fts5\fts5_tokenize.c \
1796   $(TOP)\ext\fts5\fts5_unicode2.c \
1797   $(TOP)\ext\fts5\fts5_varint.c \
1798   $(TOP)\ext\fts5\fts5_vocab.c
1799
1800fts5parse.c:	$(TOP)\ext\fts5\fts5parse.y lemon.exe
1801	copy $(TOP)\ext\fts5\fts5parse.y .
1802	del /Q fts5parse.h 2>NUL
1803	.\lemon.exe $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) $(OPTS) fts5parse.y
1804
1805fts5parse.h: fts5parse.c
1806
1807fts5.c: $(FTS5_SRC)
1808	$(TCLSH_CMD) $(TOP)\ext\fts5\tool\mkfts5c.tcl
1809	copy $(TOP)\ext\fts5\fts5.h .
1810
1811fts5.lo:	fts5.c $(HDR) $(EXTHDR)
1812	$(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c fts5.c
1813
1814fts5_ext.lo:	fts5.c $(HDR) $(EXTHDR)
1815	$(LTCOMPILE) $(NO_WARN) -c fts5.c
1816
1817fts5.dll:	fts5_ext.lo
1818	$(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /OUT:$@ fts5_ext.lo
1819
1820sqlite3rbu.lo:	$(TOP)\ext\rbu\sqlite3rbu.c $(HDR) $(EXTHDR)
1821	$(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\rbu\sqlite3rbu.c
1822
1823# Rules to build the 'testfixture' application.
1824#
1825# If using the amalgamation, use sqlite3.c directly to build the test
1826# fixture.  Otherwise link against libsqlite3.lib.  (This distinction is
1827# necessary because the test fixture requires non-API symbols which are
1828# hidden when the library is built via the amalgamation).
1829#
1830TESTFIXTURE_FLAGS = -DTCLSH=1 -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
1831TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_SERVER=1 -DSQLITE_PRIVATE=""
1832TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_CORE $(NO_WARN)
1833
1834TESTFIXTURE_SRC0 = $(TESTEXT) $(TESTSRC2) $(SHELL_CORE_DEP)
1835TESTFIXTURE_SRC1 = $(TESTEXT) $(SQLITE3C)
1836!IF $(USE_AMALGAMATION)==0
1837TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC0)
1838!ELSE
1839TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC1)
1840!ENDIF
1841
1842testfixture.exe:	$(TESTFIXTURE_SRC) $(SQLITE3H) $(LIBRESOBJS) $(HDR)
1843	$(LTLINK) -DSQLITE_NO_SYNC=1 $(TESTFIXTURE_FLAGS) \
1844		-DBUILD_sqlite -I$(TCLINCDIR) \
1845		$(TESTFIXTURE_SRC) \
1846		/link $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
1847
1848extensiontest: testfixture.exe testloadext.dll
1849	@set PATH=$(LIBTCLPATH);$(PATH)
1850	.\testfixture.exe $(TOP)\test\loadext.test $(TESTOPTS)
1851
1852fulltest:	$(TESTPROGS) fuzztest
1853	@set PATH=$(LIBTCLPATH);$(PATH)
1854	.\testfixture.exe $(TOP)\test\all.test $(TESTOPTS)
1855
1856soaktest:	$(TESTPROGS)
1857	@set PATH=$(LIBTCLPATH);$(PATH)
1858	.\testfixture.exe $(TOP)\test\all.test -soak=1 $(TESTOPTS)
1859
1860fulltestonly:	$(TESTPROGS) fuzztest
1861	@set PATH=$(LIBTCLPATH);$(PATH)
1862	.\testfixture.exe $(TOP)\test\full.test
1863
1864queryplantest:	testfixture.exe shell
1865	@set PATH=$(LIBTCLPATH);$(PATH)
1866	.\testfixture.exe $(TOP)\test\permutations.test queryplanner $(TESTOPTS)
1867
1868fuzztest:	fuzzcheck.exe
1869	.\fuzzcheck.exe $(FUZZDATA)
1870
1871fastfuzztest:	fuzzcheck.exe
1872	.\fuzzcheck.exe --limit-mem 100M $(FUZZDATA)
1873
1874# Minimal testing that runs in less than 3 minutes (on a fast machine)
1875#
1876quicktest:	testfixture.exe
1877	@set PATH=$(LIBTCLPATH);$(PATH)
1878	.\testfixture.exe $(TOP)\test\extraquick.test $(TESTOPTS)
1879
1880# This is the common case.  Run many tests that do not take too long,
1881# including fuzzcheck, sqlite3_analyzer, and sqldiff tests.
1882#
1883test:	$(TESTPROGS) fastfuzztest
1884	@set PATH=$(LIBTCLPATH);$(PATH)
1885	.\testfixture.exe $(TOP)\test\veryquick.test $(TESTOPTS)
1886
1887smoketest:	$(TESTPROGS)
1888	@set PATH=$(LIBTCLPATH);$(PATH)
1889	.\testfixture.exe $(TOP)\test\main.test $(TESTOPTS)
1890
1891sqlite3_analyzer.c: $(SQLITE3C) $(SQLITE3H) $(TOP)\src\tclsqlite.c $(TOP)\tool\spaceanal.tcl
1892	echo #define TCLSH 2 > $@
1893	echo #define SQLITE_ENABLE_DBSTAT_VTAB 1 >> $@
1894	copy $@ + $(SQLITE3C) + $(TOP)\src\tclsqlite.c $@
1895	echo static const char *tclsh_main_loop(void){ >> $@
1896	echo static const char *zMainloop = >> $@
1897	$(TCLSH_CMD) $(TOP)\tool\tostr.tcl $(TOP)\tool\spaceanal.tcl >> $@
1898	echo ; return zMainloop; } >> $@
1899
1900sqlite3_analyzer.exe:	sqlite3_analyzer.c $(LIBRESOBJS)
1901	$(LTLINK) $(NO_WARN) -DBUILD_sqlite -I$(TCLINCDIR) sqlite3_analyzer.c \
1902		/link $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
1903
1904testloadext.lo:	$(TOP)\src\test_loadext.c
1905	$(LTCOMPILE) $(NO_WARN) -c $(TOP)\src\test_loadext.c
1906
1907testloadext.dll: testloadext.lo
1908	$(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /OUT:$@ testloadext.lo
1909
1910showdb.exe:	$(TOP)\tool\showdb.c $(SQLITE3C) $(SQLITE3H)
1911	$(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
1912		$(TOP)\tool\showdb.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
1913
1914showstat4.exe:	$(TOP)\tool\showstat4.c $(SQLITE3C) $(SQLITE3H)
1915	$(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
1916		$(TOP)\tool\showstat4.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
1917
1918showjournal.exe:	$(TOP)\tool\showjournal.c $(SQLITE3C) $(SQLITE3H)
1919	$(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
1920		$(TOP)\tool\showjournal.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
1921
1922showwal.exe:	$(TOP)\tool\showwal.c $(SQLITE3C) $(SQLITE3H)
1923	$(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
1924		$(TOP)\tool\showwal.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
1925
1926fts3view.exe:	$(TOP)\ext\fts3\tool\fts3view.c $(SQLITE3C) $(SQLITE3H)
1927	$(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
1928		$(TOP)\ext\fts3\tool\fts3view.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
1929
1930rollback-test.exe:	$(TOP)\tool\rollback-test.c $(SQLITE3C) $(SQLITE3H)
1931	$(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
1932		$(TOP)\tool\rollback-test.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
1933
1934LogEst.exe:	$(TOP)\tool\logest.c $(SQLITE3H)
1935	$(LTLINK) $(NO_WARN) -Fe$@ $(TOP)\tool\LogEst.c /link $(LDFLAGS) $(LTLINKOPTS)
1936
1937wordcount.exe:	$(TOP)\test\wordcount.c $(SQLITE3C) $(SQLITE3H)
1938	$(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
1939		$(TOP)\test\wordcount.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
1940
1941speedtest1.exe:	$(TOP)\test\speedtest1.c $(SQLITE3C) $(SQLITE3H)
1942	$(LTLINK) $(NO_WARN) -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
1943		$(TOP)\test\speedtest1.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
1944
1945rbu.exe: $(TOP)\ext\rbu\rbu.c $(TOP)\ext\rbu\sqlite3rbu.c $(SQLITE3C) $(SQLITE3H)
1946	$(LTLINK) $(NO_WARN) -DSQLITE_ENABLE_RBU -Fe$@ \
1947		$(TOP)\ext\rbu\rbu.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
1948
1949clean:
1950	del /Q *.exp *.lo *.ilk *.lib *.obj *.ncb *.pdb *.sdf *.suo 2>NUL
1951	del /Q *.bsc *.cod *.da *.bb *.bbg *.vc gmon.out 2>NUL
1952	del /Q $(SQLITE3C) $(SQLITE3H) opcodes.c opcodes.h 2>NUL
1953	del /Q lemon.* lempar.c parse.* 2>NUL
1954	del /Q mkkeywordhash.* keywordhash.h 2>NUL
1955	del /Q notasharedlib.* 2>NUL
1956	-rmdir /Q/S .deps 2>NUL
1957	-rmdir /Q/S .libs 2>NUL
1958	-rmdir /Q/S quota2a 2>NUL
1959	-rmdir /Q/S quota2b 2>NUL
1960	-rmdir /Q/S quota2c 2>NUL
1961	-rmdir /Q/S tsrc 2>NUL
1962	del /Q .target_source 2>NUL
1963	del /Q tclsqlite3.exe 2>NUL
1964	del /Q testloadext.dll 2>NUL
1965	del /Q testfixture.exe test.db 2>NUL
1966	del /Q LogEst.exe fts3view.exe rollback-test.exe showdb.exe 2>NUL
1967	del /Q showjournal.exe showstat4.exe showwal.exe speedtest1.exe 2>NUL
1968	del /Q mptester.exe wordcount.exe rbu.exe 2>NUL
1969	del /Q $(SQLITE3EXE) $(SQLITE3DLL) sqlite3.def 2>NUL
1970	del /Q sqlite3.c sqlite3-*.c 2>NUL
1971	del /Q sqlite3rc.h 2>NUL
1972	del /Q shell.c sqlite3ext.h 2>NUL
1973	del /Q sqlite3_analyzer.exe sqlite3_analyzer.c 2>NUL
1974	del /Q sqlite-*-output.vsix 2>NUL
1975	del /Q fuzzershell.exe fuzzcheck.exe sqldiff.exe 2>NUL
1976	del /Q fts5.* fts5parse.* 2>NUL
1977