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