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