blob: 42f46488754dda4e64a99c4dddfaa4b2ba8a0710 [file] [log] [blame]
shanehb2f20bf2011-06-17 07:07:24 +00001#
shaneh603e4262011-06-17 18:52:07 +00002# nmake Makefile for SQLite
shanehb2f20bf2011-06-17 07:07:24 +00003#
mistachkin4712c212014-05-09 20:51:17 +00004###############################################################################
5############################## START OF OPTIONS ###############################
6###############################################################################
shanehb2f20bf2011-06-17 07:07:24 +00007
8# The toplevel directory of the source tree. This is the directory
9# that contains this "Makefile.msc".
10#
11TOP = .
12
mistachkin3e786092016-01-23 07:53:04 +000013# <<mark>>
shaneh6e7850c2011-06-17 15:57:07 +000014# Set this non-0 to create and use the SQLite amalgamation file.
15#
mistachkin0ec07442012-10-12 18:06:07 +000016!IFNDEF USE_AMALGAMATION
shaneh6e7850c2011-06-17 15:57:07 +000017USE_AMALGAMATION = 1
mistachkin0ec07442012-10-12 18:06:07 +000018!ENDIF
mistachkin3e786092016-01-23 07:53:04 +000019# <</mark>>
shaneh6e7850c2011-06-17 15:57:07 +000020
mistachkin2318d332015-01-12 18:02:52 +000021# Set this non-0 to enable full warnings (-W4, etc) when compiling.
22#
23!IFNDEF USE_FULLWARN
mistachkinb1ed7172017-04-14 14:50:34 +000024USE_FULLWARN = 1
mistachkin2318d332015-01-12 18:02:52 +000025!ENDIF
26
mistachkin8c5e8fe2017-02-01 22:32:49 +000027# Set this non-0 to enable treating warnings as errors (-WX, etc) when
28# compiling.
29#
30!IFNDEF USE_FATAL_WARN
31USE_FATAL_WARN = 0
32!ENDIF
33
mistachkin24b6b812016-08-24 18:21:58 +000034# Set this non-0 to enable full runtime error checks (-RTC1, etc). This
35# has no effect if (any) optimizations are enabled.
36#
37!IFNDEF USE_RUNTIME_CHECKS
38USE_RUNTIME_CHECKS = 0
39!ENDIF
40
mistachkin4ef916e2016-08-24 19:58:46 +000041# Set this non-0 to create a SQLite amalgamation file that excludes the
42# various built-in extensions.
43#
44!IFNDEF MINIMAL_AMALGAMATION
45MINIMAL_AMALGAMATION = 0
46!ENDIF
47
mistachkin44723ce2015-03-21 02:22:37 +000048# Set this non-0 to use "stdcall" calling convention for the core library
49# and shell executable.
50#
51!IFNDEF USE_STDCALL
52USE_STDCALL = 0
53!ENDIF
54
55# Set this non-0 to have the shell executable link against the core dynamic
56# link library.
57#
58!IFNDEF DYNAMIC_SHELL
59DYNAMIC_SHELL = 0
60!ENDIF
61
mistachkin13a24f82015-05-13 04:50:30 +000062# Set this non-0 to enable extra code that attempts to detect misuse of the
63# SQLite API.
64#
65!IFNDEF API_ARMOR
66API_ARMOR = 0
67!ENDIF
68
mistachkin2318d332015-01-12 18:02:52 +000069# If necessary, create a list of harmless compiler warnings to disable when
mistachkin44723ce2015-03-21 02:22:37 +000070# compiling the various tools. For the SQLite source code itself, warnings,
mistachkin2318d332015-01-12 18:02:52 +000071# if any, will be disabled from within it.
72#
73!IFNDEF NO_WARN
74!IF $(USE_FULLWARN)!=0
mistachkin22529172015-04-10 21:16:11 +000075NO_WARN = -wd4054 -wd4055 -wd4100 -wd4127 -wd4130 -wd4152 -wd4189 -wd4206
mistachkinf71a2432019-07-29 02:52:11 +000076NO_WARN = $(NO_WARN) -wd4210 -wd4232 -wd4244 -wd4305 -wd4306 -wd4702 -wd4706
mistachkin2318d332015-01-12 18:02:52 +000077!ENDIF
78!ENDIF
79
mistachkina5e2b502014-05-12 22:36:50 +000080# Set this non-0 to use the library paths and other options necessary for
81# Windows Phone 8.1.
mistachkind9b3c542014-05-09 23:31:55 +000082#
83!IFNDEF USE_WP81_OPTS
84USE_WP81_OPTS = 0
85!ENDIF
86
mistachkin76510912013-10-11 23:01:18 +000087# Set this non-0 to split the SQLite amalgamation file into chunks to
88# be used for debugging with Visual Studio.
89#
90!IFNDEF SPLIT_AMALGAMATION
mistachkin0aedc6b2013-10-11 23:02:13 +000091SPLIT_AMALGAMATION = 0
mistachkin76510912013-10-11 23:01:18 +000092!ENDIF
93
mistachkin3e786092016-01-23 07:53:04 +000094# <<mark>>
mistachkina0fcafe2017-12-05 19:07:30 +000095# Set this non-0 to have this makefile assume the Tcl shell executable
mistachkin47be3b22018-01-05 01:22:37 +000096# (tclsh*.exe) is available in the PATH. By default, this is disabled
mistachkina0fcafe2017-12-05 19:07:30 +000097# for compatibility with older build environments. This setting only
98# applies if TCLSH_CMD is not set manually.
99#
100!IFNDEF USE_TCLSH_IN_PATH
mistachkin47be3b22018-01-05 01:22:37 +0000101USE_TCLSH_IN_PATH = 0
mistachkina0fcafe2017-12-05 19:07:30 +0000102!ENDIF
103
mistachkincb6acda2017-12-05 18:54:12 +0000104# Set this non-0 to use zlib, possibly compiling it from source code.
105#
106!IFNDEF USE_ZLIB
107USE_ZLIB = 0
108!ENDIF
109
110# Set this non-0 to build zlib from source code. This is enabled by
111# default and in that case it will be assumed that the ZLIBDIR macro
112# points to the top-level source code directory for zlib.
113#
114!IFNDEF BUILD_ZLIB
115BUILD_ZLIB = 1
116!ENDIF
117
mistachkinc756ded2011-10-02 05:23:16 +0000118# Set this non-0 to use the International Components for Unicode (ICU).
119#
mistachkin0ec07442012-10-12 18:06:07 +0000120!IFNDEF USE_ICU
mistachkinc756ded2011-10-02 05:23:16 +0000121USE_ICU = 0
mistachkin0ec07442012-10-12 18:06:07 +0000122!ENDIF
mistachkin3e786092016-01-23 07:53:04 +0000123# <</mark>>
mistachkinc756ded2011-10-02 05:23:16 +0000124
mistachkin8d967a92012-06-21 04:21:35 +0000125# Set this non-0 to dynamically link to the MSVC runtime library.
126#
mistachkin0ec07442012-10-12 18:06:07 +0000127!IFNDEF USE_CRT_DLL
mistachkin8d967a92012-06-21 04:21:35 +0000128USE_CRT_DLL = 0
mistachkin0ec07442012-10-12 18:06:07 +0000129!ENDIF
mistachkin8d967a92012-06-21 04:21:35 +0000130
mistachkine45e0fb2015-01-21 00:48:46 +0000131# Set this non-0 to link to the RPCRT4 library.
132#
133!IFNDEF USE_RPCRT4_LIB
134USE_RPCRT4_LIB = 0
135!ENDIF
136
mistachkin0157e012013-09-06 21:41:11 +0000137# Set this non-0 to generate assembly code listings for the source code
138# files.
139#
140!IFNDEF USE_LISTINGS
141USE_LISTINGS = 0
142!ENDIF
143
mistachkin52fd8e12012-08-28 01:44:13 +0000144# Set this non-0 to attempt setting the native compiler automatically
145# for cross-compiling the command line tools needed during the compilation
146# process.
147#
mistachkin0ec07442012-10-12 18:06:07 +0000148!IFNDEF XCOMPILE
mistachkin52fd8e12012-08-28 01:44:13 +0000149XCOMPILE = 0
mistachkin0ec07442012-10-12 18:06:07 +0000150!ENDIF
mistachkin52fd8e12012-08-28 01:44:13 +0000151
mistachkinbd58d5f2012-06-30 22:22:34 +0000152# Set this non-0 to use the native libraries paths for cross-compiling
153# the command line tools needed during the compilation process.
154#
mistachkin0ec07442012-10-12 18:06:07 +0000155!IFNDEF USE_NATIVE_LIBPATHS
mistachkinbd58d5f2012-06-30 22:22:34 +0000156USE_NATIVE_LIBPATHS = 0
mistachkin0ec07442012-10-12 18:06:07 +0000157!ENDIF
mistachkinbd58d5f2012-06-30 22:22:34 +0000158
mistachkin08c1c312012-10-06 03:48:25 +0000159# Set this 0 to skip the compiling and embedding of version resources.
160#
mistachkin0ec07442012-10-12 18:06:07 +0000161!IFNDEF USE_RC
mistachkin08c1c312012-10-06 03:48:25 +0000162USE_RC = 1
mistachkin0ec07442012-10-12 18:06:07 +0000163!ENDIF
mistachkin08c1c312012-10-06 03:48:25 +0000164
mistachkin46b721a2012-03-23 12:28:21 +0000165# Set this non-0 to compile binaries suitable for the WinRT environment.
166# This setting does not apply to any binaries that require Tcl to operate
167# properly (i.e. the text fixture, etc).
168#
mistachkin0ec07442012-10-12 18:06:07 +0000169!IFNDEF FOR_WINRT
mistachkin46b721a2012-03-23 12:28:21 +0000170FOR_WINRT = 0
mistachkin0ec07442012-10-12 18:06:07 +0000171!ENDIF
mistachkin46b721a2012-03-23 12:28:21 +0000172
mistachkina819aed2016-02-12 05:19:29 +0000173# Set this non-0 to compile binaries suitable for the UWP environment.
mistachkin318d38c2015-04-22 01:33:53 +0000174# This setting does not apply to any binaries that require Tcl to operate
175# properly (i.e. the text fixture, etc).
176#
mistachkina819aed2016-02-12 05:19:29 +0000177!IFNDEF FOR_UWP
178FOR_UWP = 0
mistachkin318d38c2015-04-22 01:33:53 +0000179!ENDIF
180
mistachkin5d4d9412016-01-22 03:54:36 +0000181# Set this non-0 to compile binaries suitable for the Windows 10 platform.
mistachkinedcb4eb2016-01-22 01:25:15 +0000182#
183!IFNDEF FOR_WIN10
184FOR_WIN10 = 0
185!ENDIF
186
mistachkin3e786092016-01-23 07:53:04 +0000187# <<mark>>
mistachkin31856a32012-07-27 07:13:25 +0000188# Set this non-0 to skip attempting to look for and/or link with the Tcl
189# runtime library.
190#
mistachkin0ec07442012-10-12 18:06:07 +0000191!IFNDEF NO_TCL
mistachkin31856a32012-07-27 07:13:25 +0000192NO_TCL = 0
mistachkin0ec07442012-10-12 18:06:07 +0000193!ENDIF
mistachkin3e786092016-01-23 07:53:04 +0000194# <</mark>>
mistachkin31856a32012-07-27 07:13:25 +0000195
mistachkin4d60be52011-08-26 05:40:31 +0000196# Set this to non-0 to create and use PDBs.
197#
mistachkin0ec07442012-10-12 18:06:07 +0000198!IFNDEF SYMBOLS
mistachkin4d60be52011-08-26 05:40:31 +0000199SYMBOLS = 1
mistachkin0ec07442012-10-12 18:06:07 +0000200!ENDIF
mistachkin4d60be52011-08-26 05:40:31 +0000201
mistachkin2f7d5d82012-08-22 00:39:34 +0000202# Set this to non-0 to use the SQLite debugging heap subsystem.
203#
mistachkin0ec07442012-10-12 18:06:07 +0000204!IFNDEF MEMDEBUG
mistachkin2f7d5d82012-08-22 00:39:34 +0000205MEMDEBUG = 0
mistachkin0ec07442012-10-12 18:06:07 +0000206!ENDIF
mistachkin2f7d5d82012-08-22 00:39:34 +0000207
208# Set this to non-0 to use the Win32 native heap subsystem.
209#
mistachkin0ec07442012-10-12 18:06:07 +0000210!IFNDEF WIN32HEAP
mistachkin2f7d5d82012-08-22 00:39:34 +0000211WIN32HEAP = 0
mistachkin0ec07442012-10-12 18:06:07 +0000212!ENDIF
mistachkin2f7d5d82012-08-22 00:39:34 +0000213
mistachkinb10f22a2015-04-16 16:27:29 +0000214# Set this to non-0 to enable OSTRACE() macros, which can be useful when
215# debugging.
216#
217!IFNDEF OSTRACE
218OSTRACE = 0
219!ENDIF
220
mistachkinf2d25f22011-08-25 04:09:12 +0000221# Set this to one of the following values to enable various debugging
222# features. Each level includes the debugging options from the previous
223# levels. Currently, the recognized values for DEBUG are:
224#
225# 0 == NDEBUG: Disables assert() and other runtime diagnostics.
mistachkincd54bab2014-12-20 21:14:14 +0000226# 1 == SQLITE_ENABLE_API_ARMOR: extra attempts to detect misuse of the API.
227# 2 == Disables NDEBUG and all optimizations and then enables PDBs.
228# 3 == SQLITE_DEBUG: Enables various diagnostics messages and code.
229# 4 == SQLITE_WIN32_MALLOC_VALIDATE: Validate the Win32 native heap per call.
230# 5 == SQLITE_DEBUG_OS_TRACE: Enables output from the OSTRACE() macros.
231# 6 == SQLITE_ENABLE_IOTRACE: Enables output from the IOTRACE() macros.
mistachkinf2d25f22011-08-25 04:09:12 +0000232#
mistachkin0ec07442012-10-12 18:06:07 +0000233!IFNDEF DEBUG
mistachkinf2d25f22011-08-25 04:09:12 +0000234DEBUG = 0
mistachkin0ec07442012-10-12 18:06:07 +0000235!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000236
mistachkina8e41ec2020-05-15 01:18:07 +0000237# <<mark>>
mistachkin696555d2021-07-13 21:59:22 +0000238# By default, use --linemacros=1 argument to the mksqlite3c.tcl tool, which
larrybr06a0ea92021-07-13 20:55:26 +0000239# is used to build the amalgamation. This can be turned off to ease debug
240# of the amalgamation away from the source tree.
mistachkina8e41ec2020-05-15 01:18:07 +0000241#
242!IFNDEF NO_LINEMACROS
243NO_LINEMACROS = 0
244!ENDIF
245# <</mark>>
246
mistachkin8bcd3fa2013-08-29 01:03:38 +0000247# Enable use of available compiler optimizations? Normally, this should be
248# non-zero. Setting this to zero, thus disabling all compiler optimizations,
249# can be useful for testing.
250#
251!IFNDEF OPTIMIZATIONS
252OPTIMIZATIONS = 2
253!ENDIF
254
mistachkin12b35ea2016-05-03 19:40:54 +0000255# Set this to non-0 to enable support for the session extension.
256#
257!IFNDEF SESSION
258SESSION = 0
259!ENDIF
260
mistachkine99cb2d2019-12-20 17:41:15 +0000261# Set this to non-0 to enable support for the rbu extension.
262#
263!IFNDEF RBU
264RBU = 0
265!ENDIF
266
mistachkin5d4d9412016-01-22 03:54:36 +0000267# Set the source code file to be used by executables and libraries when
268# they need the amalgamation.
269#
270!IFNDEF SQLITE3C
271!IF $(SPLIT_AMALGAMATION)!=0
272SQLITE3C = sqlite3-all.c
273!ELSE
274SQLITE3C = sqlite3.c
275!ENDIF
276!ENDIF
277
278# Set the include code file to be used by executables and libraries when
279# they need SQLite.
280#
281!IFNDEF SQLITE3H
282SQLITE3H = sqlite3.h
283!ENDIF
284
mistachkinedcb4eb2016-01-22 01:25:15 +0000285# This is the name to use for the SQLite dynamic link library (DLL).
286#
287!IFNDEF SQLITE3DLL
mistachkinb0c99af2016-02-19 05:07:56 +0000288!IF $(FOR_WIN10)!=0
289SQLITE3DLL = winsqlite3.dll
290!ELSE
mistachkinedcb4eb2016-01-22 01:25:15 +0000291SQLITE3DLL = sqlite3.dll
292!ENDIF
mistachkinb0c99af2016-02-19 05:07:56 +0000293!ENDIF
mistachkinedcb4eb2016-01-22 01:25:15 +0000294
295# This is the name to use for the SQLite import library (LIB).
296#
297!IFNDEF SQLITE3LIB
mistachkinb0c99af2016-02-19 05:07:56 +0000298!IF $(FOR_WIN10)!=0
299SQLITE3LIB = winsqlite3.lib
300!ELSE
mistachkinedcb4eb2016-01-22 01:25:15 +0000301SQLITE3LIB = sqlite3.lib
302!ENDIF
mistachkinb0c99af2016-02-19 05:07:56 +0000303!ENDIF
mistachkinedcb4eb2016-01-22 01:25:15 +0000304
305# This is the name to use for the SQLite shell executable (EXE).
306#
307!IFNDEF SQLITE3EXE
mistachkinb0c99af2016-02-19 05:07:56 +0000308!IF $(FOR_WIN10)!=0
309SQLITE3EXE = winsqlite3shell.exe
310!ELSE
mistachkinedcb4eb2016-01-22 01:25:15 +0000311SQLITE3EXE = sqlite3.exe
312!ENDIF
mistachkinb0c99af2016-02-19 05:07:56 +0000313!ENDIF
mistachkinedcb4eb2016-01-22 01:25:15 +0000314
315# This is the argument used to set the program database (PDB) file for the
316# SQLite shell executable (EXE).
317#
318!IFNDEF SQLITE3EXEPDB
mistachkinb0c99af2016-02-19 05:07:56 +0000319!IF $(FOR_WIN10)!=0
320SQLITE3EXEPDB =
321!ELSE
mistachkinedcb4eb2016-01-22 01:25:15 +0000322SQLITE3EXEPDB = /pdb:sqlite3sh.pdb
323!ENDIF
mistachkinb0c99af2016-02-19 05:07:56 +0000324!ENDIF
mistachkinedcb4eb2016-01-22 01:25:15 +0000325
mistachkincc0164b2016-09-05 20:46:02 +0000326# <<mark>>
mistachkin4ef916e2016-08-24 19:58:46 +0000327# These are the names of the customized Tcl header files used by various parts
328# of this makefile when the stdcall calling convention is in use. It is not
329# used for any other purpose.
330#
331!IFNDEF SQLITETCLH
332SQLITETCLH = sqlite_tcl.h
333!ENDIF
334
335!IFNDEF SQLITETCLDECLSH
336SQLITETCLDECLSH = sqlite_tclDecls.h
337!ENDIF
338
mistachkine2bcbb42019-03-22 01:25:16 +0000339# This is the name to use for the dynamic link library (DLL) containing the
340# Tcl bindings for SQLite.
341#
342!IFNDEF SQLITE3TCLDLL
343SQLITE3TCLDLL = tclsqlite3.dll
344!ENDIF
345
mistachkin4ef916e2016-08-24 19:58:46 +0000346# These are the additional targets that the targets that integrate with the
347# Tcl library should depend on when compiling, etc.
348#
349!IFNDEF SQLITE_TCL_DEP
350!IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
351SQLITE_TCL_DEP = $(SQLITETCLDECLSH) $(SQLITETCLH)
352!ELSE
353SQLITE_TCL_DEP =
354!ENDIF
355!ENDIF
mistachkincc0164b2016-09-05 20:46:02 +0000356# <</mark>>
mistachkin4ef916e2016-08-24 19:58:46 +0000357
mistachkin4712c212014-05-09 20:51:17 +0000358# These are the "standard" SQLite compilation options used when compiling for
359# the Windows platform.
360#
361!IFNDEF OPT_FEATURE_FLAGS
mistachkin4ef916e2016-08-24 19:58:46 +0000362!IF $(MINIMAL_AMALGAMATION)==0
mistachkin4712c212014-05-09 20:51:17 +0000363OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS3=1
mistachkin90d6f482018-09-12 00:48:17 +0000364OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RTREE=1
365OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_GEOPOLY=1
366OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_JSON1=1
367OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_STMTVTAB=1
368OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBPAGE_VTAB=1
369OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBSTAT_VTAB=1
drh691b5c52020-03-23 15:49:22 +0000370OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_BYTECODE_VTAB=1
mistachkin4ef916e2016-08-24 19:58:46 +0000371!ENDIF
mistachkin4712c212014-05-09 20:51:17 +0000372OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_COLUMN_METADATA=1
drh5e18d402016-05-03 13:14:18 +0000373!ENDIF
374
mistachkin12b35ea2016-05-03 19:40:54 +0000375# Should the session extension be enabled? If so, add compilation options
376# to enable it.
drh5e18d402016-05-03 13:14:18 +0000377#
drh5e18d402016-05-03 13:14:18 +0000378!IF $(SESSION)!=0
mistachkin05004782016-03-30 16:23:06 +0000379OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_SESSION=1
380OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_PREUPDATE_HOOK=1
mistachkin4712c212014-05-09 20:51:17 +0000381!ENDIF
382
drhf6e904b2020-12-07 17:15:32 +0000383# Always enable math functions on Windows
384OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_MATH_FUNCTIONS
385
mistachkine99cb2d2019-12-20 17:41:15 +0000386# Should the rbu extension be enabled? If so, add compilation options
387# to enable it.
388#
389!IF $(RBU)!=0
390OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RBU=1
391!ENDIF
392
mistachkinedcb4eb2016-01-22 01:25:15 +0000393# These are the "extended" SQLite compilation options used when compiling for
394# the Windows 10 platform.
395#
396!IFNDEF EXT_FEATURE_FLAGS
397!IF $(FOR_WIN10)!=0
398EXT_FEATURE_FLAGS = $(EXT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS4=1
399EXT_FEATURE_FLAGS = $(EXT_FEATURE_FLAGS) -DSQLITE_SYSTEM_MALLOC=1
400EXT_FEATURE_FLAGS = $(EXT_FEATURE_FLAGS) -DSQLITE_OMIT_LOCALTIME=1
401!ELSE
402EXT_FEATURE_FLAGS =
403!ENDIF
404!ENDIF
405
mistachkin4712c212014-05-09 20:51:17 +0000406###############################################################################
407############################### END OF OPTIONS ################################
408###############################################################################
409
mistachkin55e88d92016-02-08 20:40:57 +0000410# When compiling for the Windows 10 platform, the PLATFORM macro must be set
411# to an appropriate value (e.g. x86, x64, arm, arm64, etc).
412#
413!IF $(FOR_WIN10)!=0
414!IFNDEF PLATFORM
415!ERROR Using the FOR_WIN10 option requires a value for PLATFORM.
416!ENDIF
417!ENDIF
418
mistachkind9b3c542014-05-09 23:31:55 +0000419# This assumes that MSVC is always installed in 32-bit Program Files directory
420# and sets the variable for use in locating other 32-bit installs accordingly.
421#
422PROGRAMFILES_X86 = $(VCINSTALLDIR)\..\..
423PROGRAMFILES_X86 = $(PROGRAMFILES_X86:\\=\)
424
mistachkine37f99c2012-06-30 16:22:05 +0000425# Check for the predefined command macro CC. This should point to the compiler
mistachkinbd58d5f2012-06-30 22:22:34 +0000426# binary for the target platform. If it is not defined, simply define it to
mistachkine37f99c2012-06-30 16:22:05 +0000427# the legacy default value 'cl.exe'.
428#
429!IFNDEF CC
430CC = cl.exe
431!ENDIF
432
mistachkin9aeb9712016-02-26 23:13:16 +0000433# Check for the predefined command macro CSC. This should point to a working
434# C Sharp compiler binary. If it is not defined, simply define it to the
435# legacy default value 'csc.exe'.
436#
437!IFNDEF CSC
438CSC = csc.exe
439!ENDIF
440
mistachkin228aeff2012-06-30 19:24:09 +0000441# Check for the command macro LD. This should point to the linker binary for
mistachkinbd58d5f2012-06-30 22:22:34 +0000442# the target platform. If it is not defined, simply define it to the legacy
mistachkin228aeff2012-06-30 19:24:09 +0000443# default value 'link.exe'.
444#
445!IFNDEF LD
446LD = link.exe
447!ENDIF
448
mistachkin4d9d1f42012-09-03 10:32:32 +0000449# Check for the predefined command macro RC. This should point to the resource
450# compiler binary for the target platform. If it is not defined, simply define
451# it to the legacy default value 'rc.exe'.
452#
453!IFNDEF RC
454RC = rc.exe
455!ENDIF
456
mistachkine48f1ed2016-02-08 20:45:37 +0000457# Check for the MSVC runtime library path macro. Otherwise, this value will
mistachkin4712c212014-05-09 20:51:17 +0000458# default to the 'lib' directory underneath the MSVC installation directory.
459#
460!IFNDEF CRTLIBPATH
461CRTLIBPATH = $(VCINSTALLDIR)\lib
462!ENDIF
463
464CRTLIBPATH = $(CRTLIBPATH:\\=\)
465
mistachkine37f99c2012-06-30 16:22:05 +0000466# Check for the command macro NCC. This should point to the compiler binary
mistachkinbd58d5f2012-06-30 22:22:34 +0000467# for the platform the compilation process is taking place on. If it is not
468# defined, simply define it to have the same value as the CC macro. When
mistachkine37f99c2012-06-30 16:22:05 +0000469# cross-compiling, it is suggested that this macro be modified via the command
470# line (since nmake itself does not provide a built-in method to guess it).
471# For example, to use the x86 compiler when cross-compiling for x64, a command
mistachkinbd58d5f2012-06-30 22:22:34 +0000472# line similar to the following could be used (all on one line):
mistachkine37f99c2012-06-30 16:22:05 +0000473#
mistachkin6f928332012-08-17 11:47:32 +0000474# nmake /f Makefile.msc sqlite3.dll
mistachkin52fd8e12012-08-28 01:44:13 +0000475# XCOMPILE=1 USE_NATIVE_LIBPATHS=1
476#
477# Alternatively, the full path and file name to the compiler binary for the
478# platform the compilation process is taking place may be specified (all on
479# one line):
480#
481# nmake /f Makefile.msc sqlite3.dll
mistachkinbd58d5f2012-06-30 22:22:34 +0000482# "NCC=""%VCINSTALLDIR%\bin\cl.exe"""
483# USE_NATIVE_LIBPATHS=1
mistachkine37f99c2012-06-30 16:22:05 +0000484#
mistachkinfd0ba2a2012-07-27 08:21:45 +0000485!IFDEF NCC
486NCC = $(NCC:\\=\)
mistachkin52fd8e12012-08-28 01:44:13 +0000487!ELSEIF $(XCOMPILE)!=0
mistachkin5fac4202013-12-03 23:33:29 +0000488NCC = "$(VCINSTALLDIR)\bin\$(CC)"
mistachkin52fd8e12012-08-28 01:44:13 +0000489NCC = $(NCC:\\=\)
mistachkinfd0ba2a2012-07-27 08:21:45 +0000490!ELSE
mistachkine37f99c2012-06-30 16:22:05 +0000491NCC = $(CC)
492!ENDIF
493
mistachkine48f1ed2016-02-08 20:45:37 +0000494# Check for the MSVC native runtime library path macro. Otherwise,
mistachkin4712c212014-05-09 20:51:17 +0000495# this value will default to the 'lib' directory underneath the MSVC
mistachkinbd58d5f2012-06-30 22:22:34 +0000496# installation directory.
497#
498!IFNDEF NCRTLIBPATH
499NCRTLIBPATH = $(VCINSTALLDIR)\lib
500!ENDIF
501
mistachkin0b5ae722012-07-27 23:03:47 +0000502NCRTLIBPATH = $(NCRTLIBPATH:\\=\)
503
mistachkine48f1ed2016-02-08 20:45:37 +0000504# Check for the Platform SDK library path macro. Otherwise, this
mistachkinbd58d5f2012-06-30 22:22:34 +0000505# value will default to the 'lib' directory underneath the Windows
506# SDK installation directory (the environment variable used appears
507# to be available when using Visual C++ 2008 or later via the
508# command line).
509#
510!IFNDEF NSDKLIBPATH
511NSDKLIBPATH = $(WINDOWSSDKDIR)\lib
512!ENDIF
513
mistachkin0b5ae722012-07-27 23:03:47 +0000514NSDKLIBPATH = $(NSDKLIBPATH:\\=\)
515
mistachkine48f1ed2016-02-08 20:45:37 +0000516# Check for the UCRT library path macro. Otherwise, this value will
mistachkina6f28892016-02-05 19:40:23 +0000517# default to the version-specific, platform-specific 'lib' directory
518# underneath the Windows SDK installation directory.
519#
520!IFNDEF UCRTLIBPATH
521UCRTLIBPATH = $(WINDOWSSDKDIR)\lib\$(WINDOWSSDKLIBVERSION)\ucrt\$(PLATFORM)
522!ENDIF
523
524UCRTLIBPATH = $(UCRTLIBPATH:\\=\)
525
mistachkinbd58d5f2012-06-30 22:22:34 +0000526# C compiler and options for use in building executables that
shanehb2f20bf2011-06-17 07:07:24 +0000527# will run on the platform that is doing the build.
528#
mistachkin2318d332015-01-12 18:02:52 +0000529!IF $(USE_FULLWARN)!=0
mistachkine2bcbb42019-03-22 01:25:16 +0000530BCC = $(NCC) -nologo -W4 -Fd$*.pdb $(CCOPTS) $(BCCOPTS)
mistachkin2318d332015-01-12 18:02:52 +0000531!ELSE
mistachkine2bcbb42019-03-22 01:25:16 +0000532BCC = $(NCC) -nologo -W3 -Fd$*.pdb $(CCOPTS) $(BCCOPTS)
mistachkin2318d332015-01-12 18:02:52 +0000533!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000534
mistachkin0157e012013-09-06 21:41:11 +0000535# Check if assembly code listings should be generated for the source
536# code files to be compiled.
537#
538!IF $(USE_LISTINGS)!=0
539BCC = $(BCC) -FAcs
540!ENDIF
541
mistachkinbd58d5f2012-06-30 22:22:34 +0000542# Check if the native library paths should be used when compiling
543# the command line tools used during the compilation process. If
544# so, set the necessary macro now.
545#
546!IF $(USE_NATIVE_LIBPATHS)!=0
547NLTLIBPATHS = "/LIBPATH:$(NCRTLIBPATH)" "/LIBPATH:$(NSDKLIBPATH)"
mistachkin6bbe3df2015-04-19 06:18:10 +0000548
549!IFDEF NUCRTLIBPATH
550NUCRTLIBPATH = $(NUCRTLIBPATH:\\=\)
551NLTLIBPATHS = $(NLTLIBPATHS) "/LIBPATH:$(NUCRTLIBPATH)"
552!ENDIF
mistachkinbd58d5f2012-06-30 22:22:34 +0000553!ENDIF
554
555# C compiler and options for use in building executables that
shanehb2f20bf2011-06-17 07:07:24 +0000556# will run on the target platform. (BCC and TCC are usually the
557# same unless your are cross-compiling.)
558#
mistachkin2318d332015-01-12 18:02:52 +0000559!IF $(USE_FULLWARN)!=0
mistachkinf170ea42015-10-16 20:13:57 +0000560TCC = $(CC) -nologo -W4 -DINCLUDE_MSVC_H=1 $(CCOPTS) $(TCCOPTS)
mistachkin2318d332015-01-12 18:02:52 +0000561!ELSE
mistachkinf170ea42015-10-16 20:13:57 +0000562TCC = $(CC) -nologo -W3 $(CCOPTS) $(TCCOPTS)
mistachkin2318d332015-01-12 18:02:52 +0000563!ENDIF
564
mistachkin8c5e8fe2017-02-01 22:32:49 +0000565# Check if warnings should be treated as errors when compiling.
566#
567!IF $(USE_FATAL_WARN)!=0
568TCC = $(TCC) -WX
569!ENDIF
570
mistachkin8988aee2016-02-10 21:45:25 +0000571TCC = $(TCC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) -I$(TOP)\src -fp:precise
572RCC = $(RC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) -I$(TOP)\src $(RCOPTS) $(RCCOPTS)
shaneh6e7850c2011-06-17 15:57:07 +0000573
mistachkin44723ce2015-03-21 02:22:37 +0000574# Check if we want to use the "stdcall" calling convention when compiling.
575# This is not supported by the compilers for non-x86 platforms. It should
576# also be noted here that building any target with these "stdcall" options
577# will most likely fail if the Tcl library is also required. This is due
578# to how the Tcl library functions are declared and exported (i.e. without
579# an explicit calling convention, which results in "cdecl").
580#
mistachkinedcb4eb2016-01-22 01:25:15 +0000581!IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
mistachkin44723ce2015-03-21 02:22:37 +0000582!IF "$(PLATFORM)"=="x86"
mistachkin3c648882022-01-06 17:13:56 +0000583CORE_CCONV_OPTS = -Gz -guard:cf -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
584SHELL_CCONV_OPTS = -Gz -guard:cf -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
mistachkinf27a80c2016-07-28 16:09:52 +0000585# <<mark>>
mistachkin3c648882022-01-06 17:13:56 +0000586TEST_CCONV_OPTS = -Gz -guard:cf -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall -DINCLUDE_SQLITE_TCL_H=1 -DSQLITE_TCLAPI=__cdecl
mistachkinf27a80c2016-07-28 16:09:52 +0000587# <</mark>>
mistachkin44723ce2015-03-21 02:22:37 +0000588!ELSE
589!IFNDEF PLATFORM
mistachkin3c648882022-01-06 17:13:56 +0000590CORE_CCONV_OPTS = -Gz -guard:cf -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
591SHELL_CCONV_OPTS = -Gz -guard:cf -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
mistachkinf27a80c2016-07-28 16:09:52 +0000592# <<mark>>
mistachkin3c648882022-01-06 17:13:56 +0000593TEST_CCONV_OPTS = -Gz -guard:cf -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall -DINCLUDE_SQLITE_TCL_H=1 -DSQLITE_TCLAPI=__cdecl
mistachkinf27a80c2016-07-28 16:09:52 +0000594# <</mark>>
mistachkin44723ce2015-03-21 02:22:37 +0000595!ELSE
596CORE_CCONV_OPTS =
597SHELL_CCONV_OPTS =
mistachkinf27a80c2016-07-28 16:09:52 +0000598# <<mark>>
mistachkin69def7f2016-07-28 04:14:37 +0000599TEST_CCONV_OPTS =
mistachkinf27a80c2016-07-28 16:09:52 +0000600# <</mark>>
mistachkin44723ce2015-03-21 02:22:37 +0000601!ENDIF
602!ENDIF
603!ELSE
604CORE_CCONV_OPTS =
605SHELL_CCONV_OPTS =
mistachkinf27a80c2016-07-28 16:09:52 +0000606# <<mark>>
mistachkin69def7f2016-07-28 04:14:37 +0000607TEST_CCONV_OPTS =
mistachkinf27a80c2016-07-28 16:09:52 +0000608# <</mark>>
mistachkin44723ce2015-03-21 02:22:37 +0000609!ENDIF
610
611# These are additional compiler options used for the core library.
612#
613!IFNDEF CORE_COMPILE_OPTS
mistachkinedcb4eb2016-01-22 01:25:15 +0000614!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
mistachkin44723ce2015-03-21 02:22:37 +0000615CORE_COMPILE_OPTS = $(CORE_CCONV_OPTS) -DSQLITE_API=__declspec(dllexport)
616!ELSE
617CORE_COMPILE_OPTS = $(CORE_CCONV_OPTS)
618!ENDIF
619!ENDIF
620
621# These are the additional targets that the core library should depend on
622# when linking.
623#
624!IFNDEF CORE_LINK_DEP
mistachkin9b88ace2016-02-26 21:01:37 +0000625!IF $(DYNAMIC_SHELL)!=0
mistachkin44723ce2015-03-21 02:22:37 +0000626CORE_LINK_DEP =
mistachkin9b88ace2016-02-26 21:01:37 +0000627!ELSEIF $(FOR_WIN10)==0 || "$(PLATFORM)"=="x86"
mistachkin44723ce2015-03-21 02:22:37 +0000628CORE_LINK_DEP = sqlite3.def
mistachkin9b88ace2016-02-26 21:01:37 +0000629!ELSE
630CORE_LINK_DEP =
mistachkin44723ce2015-03-21 02:22:37 +0000631!ENDIF
632!ENDIF
633
634# These are additional linker options used for the core library.
635#
636!IFNDEF CORE_LINK_OPTS
mistachkin9b88ace2016-02-26 21:01:37 +0000637!IF $(DYNAMIC_SHELL)!=0
mistachkin44723ce2015-03-21 02:22:37 +0000638CORE_LINK_OPTS =
mistachkin9b88ace2016-02-26 21:01:37 +0000639!ELSEIF $(FOR_WIN10)==0 || "$(PLATFORM)"=="x86"
mistachkin44723ce2015-03-21 02:22:37 +0000640CORE_LINK_OPTS = /DEF:sqlite3.def
mistachkin9b88ace2016-02-26 21:01:37 +0000641!ELSE
642CORE_LINK_OPTS =
mistachkin44723ce2015-03-21 02:22:37 +0000643!ENDIF
644!ENDIF
645
646# These are additional compiler options used for the shell executable.
647#
648!IFNDEF SHELL_COMPILE_OPTS
mistachkinedcb4eb2016-01-22 01:25:15 +0000649!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
mistachkin5d4d9412016-01-22 03:54:36 +0000650SHELL_COMPILE_OPTS = $(SHELL_CCONV_OPTS) -DSQLITE_API=__declspec(dllimport)
mistachkin44723ce2015-03-21 02:22:37 +0000651!ELSE
mistachkin5d4d9412016-01-22 03:54:36 +0000652SHELL_COMPILE_OPTS = $(SHELL_CCONV_OPTS)
653!ENDIF
654!ENDIF
655
656# This is the source code that the shell executable should be compiled
657# with.
658#
659!IFNDEF SHELL_CORE_SRC
660!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
661SHELL_CORE_SRC =
mistachkin1f237e32018-07-27 20:45:28 +0000662# <<mark>>
663!ELSEIF $(USE_AMALGAMATION)==0
664SHELL_CORE_SRC =
665# <</mark>>
mistachkin5d4d9412016-01-22 03:54:36 +0000666!ELSE
667SHELL_CORE_SRC = $(SQLITE3C)
mistachkin44723ce2015-03-21 02:22:37 +0000668!ENDIF
669!ENDIF
670
671# This is the core library that the shell executable should depend on.
672#
673!IFNDEF SHELL_CORE_DEP
mistachkinedcb4eb2016-01-22 01:25:15 +0000674!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
675SHELL_CORE_DEP = $(SQLITE3DLL)
mistachkin1f237e32018-07-27 20:45:28 +0000676# <<mark>>
677!ELSEIF $(USE_AMALGAMATION)==0
678SHELL_CORE_DEP = libsqlite3.lib
679# <</mark>>
mistachkin44723ce2015-03-21 02:22:37 +0000680!ELSE
mistachkin5d4d9412016-01-22 03:54:36 +0000681SHELL_CORE_DEP =
mistachkin44723ce2015-03-21 02:22:37 +0000682!ENDIF
683!ENDIF
684
mistachkincb6acda2017-12-05 18:54:12 +0000685# <<mark>>
mistachkin5d7503a2018-01-05 17:12:13 +0000686# If zlib support is enabled, add the dependencies for it.
mistachkincb6acda2017-12-05 18:54:12 +0000687#
688!IF $(USE_ZLIB)!=0 && $(BUILD_ZLIB)!=0
689SHELL_CORE_DEP = zlib $(SHELL_CORE_DEP)
mistachkin5d7503a2018-01-05 17:12:13 +0000690TESTFIXTURE_DEP = zlib $(TESTFIXTURE_DEP)
mistachkincb6acda2017-12-05 18:54:12 +0000691!ENDIF
692# <</mark>>
693
mistachkin44723ce2015-03-21 02:22:37 +0000694# This is the core library that the shell executable should link with.
695#
696!IFNDEF SHELL_CORE_LIB
mistachkinedcb4eb2016-01-22 01:25:15 +0000697!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
698SHELL_CORE_LIB = $(SQLITE3LIB)
mistachkin1f237e32018-07-27 20:45:28 +0000699# <<mark>>
700!ELSEIF $(USE_AMALGAMATION)==0
701SHELL_CORE_LIB = libsqlite3.lib
702# <</mark>>
mistachkin44723ce2015-03-21 02:22:37 +0000703!ELSE
mistachkin5d4d9412016-01-22 03:54:36 +0000704SHELL_CORE_LIB =
mistachkin44723ce2015-03-21 02:22:37 +0000705!ENDIF
706!ENDIF
707
708# These are additional linker options used for the shell executable.
709#
710!IFNDEF SHELL_LINK_OPTS
711SHELL_LINK_OPTS = $(SHELL_CORE_LIB)
712!ENDIF
713
mistachkin0157e012013-09-06 21:41:11 +0000714# Check if assembly code listings should be generated for the source
715# code files to be compiled.
716#
717!IF $(USE_LISTINGS)!=0
718TCC = $(TCC) -FAcs
719!ENDIF
720
mistachkinf39eaf22012-03-20 02:18:42 +0000721# When compiling the library for use in the WinRT environment,
mistachkin46b721a2012-03-23 12:28:21 +0000722# the following compile-time options must be used as well to
mistachkinf39eaf22012-03-20 02:18:42 +0000723# disable use of Win32 APIs that are not available and to enable
724# use of Win32 APIs that are specific to Windows 8 and/or WinRT.
725#
mistachkin46b721a2012-03-23 12:28:21 +0000726!IF $(FOR_WINRT)!=0
mistachkin8d967a92012-06-21 04:21:35 +0000727TCC = $(TCC) -DSQLITE_OS_WINRT=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000728RCC = $(RCC) -DSQLITE_OS_WINRT=1
mistachkin08c1c312012-10-06 03:48:25 +0000729TCC = $(TCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
730RCC = $(RCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
mistachkin8d967a92012-06-21 04:21:35 +0000731!ENDIF
732
mistachkin5d4d9412016-01-22 03:54:36 +0000733# C compiler options for the Windows 10 platform (needs MSVC 2015).
mistachkinedcb4eb2016-01-22 01:25:15 +0000734#
735!IF $(FOR_WIN10)!=0
mistachkin406eeff2016-02-09 18:28:20 +0000736TCC = $(TCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
737BCC = $(BCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
mistachkinedcb4eb2016-01-22 01:25:15 +0000738!ENDIF
739
mistachkin8d967a92012-06-21 04:21:35 +0000740# Also, we need to dynamically link to the correct MSVC runtime
741# when compiling for WinRT (e.g. debug or release) OR if the
742# USE_CRT_DLL option is set to force dynamically linking to the
743# MSVC runtime library.
744#
mistachkina6f28892016-02-05 19:40:23 +0000745!IF $(FOR_WINRT)!=0 || $(USE_CRT_DLL)!=0
mistachkincd54bab2014-12-20 21:14:14 +0000746!IF $(DEBUG)>1
mistachkin8d967a92012-06-21 04:21:35 +0000747TCC = $(TCC) -MDd
mistachkin08c1c312012-10-06 03:48:25 +0000748BCC = $(BCC) -MDd
mistachkin8d967a92012-06-21 04:21:35 +0000749!ELSE
750TCC = $(TCC) -MD
mistachkin08c1c312012-10-06 03:48:25 +0000751BCC = $(BCC) -MD
mistachkin8d967a92012-06-21 04:21:35 +0000752!ENDIF
753!ELSE
mistachkincd54bab2014-12-20 21:14:14 +0000754!IF $(DEBUG)>1
mistachkin8d967a92012-06-21 04:21:35 +0000755TCC = $(TCC) -MTd
mistachkin08c1c312012-10-06 03:48:25 +0000756BCC = $(BCC) -MTd
mistachkin8d967a92012-06-21 04:21:35 +0000757!ELSE
758TCC = $(TCC) -MT
mistachkin08c1c312012-10-06 03:48:25 +0000759BCC = $(BCC) -MT
mistachkin8d967a92012-06-21 04:21:35 +0000760!ENDIF
mistachkin46b721a2012-03-23 12:28:21 +0000761!ENDIF
mistachkinf39eaf22012-03-20 02:18:42 +0000762
mistachkin3e786092016-01-23 07:53:04 +0000763# <<mark>>
mistachkinf39eaf22012-03-20 02:18:42 +0000764# The mksqlite3c.tcl and mksqlite3h.tcl scripts will pull in
shaneh6e7850c2011-06-17 15:57:07 +0000765# any extension header files by default. For non-amalgamation
766# builds, we need to make sure the compiler can find these.
767#
768!IF $(USE_AMALGAMATION)==0
769TCC = $(TCC) -I$(TOP)\ext\fts3
mistachkin4d9d1f42012-09-03 10:32:32 +0000770RCC = $(RCC) -I$(TOP)\ext\fts3
shaneh6e7850c2011-06-17 15:57:07 +0000771TCC = $(TCC) -I$(TOP)\ext\rtree
mistachkin4d9d1f42012-09-03 10:32:32 +0000772RCC = $(RCC) -I$(TOP)\ext\rtree
drh498dcae2013-03-13 11:42:00 +0000773TCC = $(TCC) -I$(TOP)\ext\session
mistachkin38b4daa2013-03-13 19:02:39 +0000774RCC = $(RCC) -I$(TOP)\ext\session
shaneh6e7850c2011-06-17 15:57:07 +0000775!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000776
mistachkinb0427512014-01-30 11:12:52 +0000777# The mksqlite3c.tcl script accepts some options on the command
778# line. When compiling with debugging enabled, some of these
779# options are necessary in order to allow debugging symbols to
780# work correctly with Visual Studio when using the amalgamation.
781#
mistachkin4ef916e2016-08-24 19:58:46 +0000782!IFNDEF MKSQLITE3C_TOOL
783!IF $(MINIMAL_AMALGAMATION)!=0
784MKSQLITE3C_TOOL = $(TOP)\tool\mksqlite3c-noext.tcl
785!ELSE
786MKSQLITE3C_TOOL = $(TOP)\tool\mksqlite3c.tcl
787!ENDIF
788!ENDIF
789
mistachkin22529172015-04-10 21:16:11 +0000790!IFNDEF MKSQLITE3C_ARGS
mistachkin696555d2021-07-13 21:59:22 +0000791!IF $(DEBUG)>1 && $(NO_LINEMACROS)==0
792MKSQLITE3C_ARGS = --linemacros=1
mistachkinb0427512014-01-30 11:12:52 +0000793!ELSE
mistachkin696555d2021-07-13 21:59:22 +0000794MKSQLITE3C_ARGS = --linemacros=0
mistachkinb0427512014-01-30 11:12:52 +0000795!ENDIF
mistachkin4ef916e2016-08-24 19:58:46 +0000796!IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
797MKSQLITE3C_ARGS = $(MKSQLITE3C_ARGS) --useapicall
798!ENDIF
799!ENDIF
800
801# The mksqlite3h.tcl script accepts some options on the command line.
802# When compiling with stdcall support, some of these options are
803# necessary.
804#
805!IFNDEF MKSQLITE3H_ARGS
806!IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
807MKSQLITE3H_ARGS = --useapicall
808!ELSE
809MKSQLITE3H_ARGS =
810!ENDIF
mistachkin22529172015-04-10 21:16:11 +0000811!ENDIF
mistachkin3e786092016-01-23 07:53:04 +0000812# <</mark>>
mistachkinb0427512014-01-30 11:12:52 +0000813
shanehb2f20bf2011-06-17 07:07:24 +0000814# Define -DNDEBUG to compile without debugging (i.e., for production usage)
815# Omitting the define will cause extra debugging code to be inserted and
816# includes extra comments when "EXPLAIN stmt" is used.
817#
mistachkin753c5442011-08-25 02:02:25 +0000818!IF $(DEBUG)==0
shanehb2f20bf2011-06-17 07:07:24 +0000819TCC = $(TCC) -DNDEBUG
mistachkinfec360a2012-04-18 10:29:21 +0000820BCC = $(BCC) -DNDEBUG
mistachkin4d9d1f42012-09-03 10:32:32 +0000821RCC = $(RCC) -DNDEBUG
mistachkin753c5442011-08-25 02:02:25 +0000822!ENDIF
823
mistachkinedcb4eb2016-01-22 01:25:15 +0000824!IF $(DEBUG)>0 || $(API_ARMOR)!=0 || $(FOR_WIN10)!=0
mistachkin13a24f82015-05-13 04:50:30 +0000825TCC = $(TCC) -DSQLITE_ENABLE_API_ARMOR=1
826RCC = $(RCC) -DSQLITE_ENABLE_API_ARMOR=1
mistachkincd54bab2014-12-20 21:14:14 +0000827!ENDIF
828
829!IF $(DEBUG)>2
mistachkin13a24f82015-05-13 04:50:30 +0000830TCC = $(TCC) -DSQLITE_DEBUG=1
831RCC = $(RCC) -DSQLITE_DEBUG=1
mistachkinb3d3bea2017-03-29 23:22:18 +0000832!IF $(DYNAMIC_SHELL)==0
833TCC = $(TCC) -DSQLITE_ENABLE_WHERETRACE -DSQLITE_ENABLE_SELECTTRACE
834RCC = $(RCC) -DSQLITE_ENABLE_WHERETRACE -DSQLITE_ENABLE_SELECTTRACE
835!ENDIF
mistachkin753c5442011-08-25 02:02:25 +0000836!ENDIF
837
mistachkinb10f22a2015-04-16 16:27:29 +0000838!IF $(DEBUG)>4 || $(OSTRACE)!=0
839TCC = $(TCC) -DSQLITE_FORCE_OS_TRACE=1 -DSQLITE_DEBUG_OS_TRACE=1
840RCC = $(RCC) -DSQLITE_FORCE_OS_TRACE=1 -DSQLITE_DEBUG_OS_TRACE=1
mistachkin753c5442011-08-25 02:02:25 +0000841!ENDIF
842
mistachkincd54bab2014-12-20 21:14:14 +0000843!IF $(DEBUG)>5
mistachkin13a24f82015-05-13 04:50:30 +0000844TCC = $(TCC) -DSQLITE_ENABLE_IOTRACE=1
845RCC = $(RCC) -DSQLITE_ENABLE_IOTRACE=1
mistachkin753c5442011-08-25 02:02:25 +0000846!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000847
mistachkinbd58d5f2012-06-30 22:22:34 +0000848# Prevent warnings about "insecure" MSVC runtime library functions
849# being used.
mistachkin176f1b42011-08-02 23:34:00 +0000850#
851TCC = $(TCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
mistachkinfec360a2012-04-18 10:29:21 +0000852BCC = $(BCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
mistachkin4d9d1f42012-09-03 10:32:32 +0000853RCC = $(RCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
mistachkin176f1b42011-08-02 23:34:00 +0000854
mistachkinbd58d5f2012-06-30 22:22:34 +0000855# Prevent warnings about "deprecated" POSIX functions being used.
856#
857TCC = $(TCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
858BCC = $(BCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
mistachkin4d9d1f42012-09-03 10:32:32 +0000859RCC = $(RCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
mistachkinbd58d5f2012-06-30 22:22:34 +0000860
mistachkin2f7d5d82012-08-22 00:39:34 +0000861# Use the SQLite debugging heap subsystem?
mistachkin1b186a92011-08-24 16:13:57 +0000862#
mistachkin2f7d5d82012-08-22 00:39:34 +0000863!IF $(MEMDEBUG)!=0
864TCC = $(TCC) -DSQLITE_MEMDEBUG=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000865RCC = $(RCC) -DSQLITE_MEMDEBUG=1
mistachkin2f7d5d82012-08-22 00:39:34 +0000866
mistachkin2f7d5d82012-08-22 00:39:34 +0000867# Use native Win32 heap subsystem instead of malloc/free?
868#
869!ELSEIF $(WIN32HEAP)!=0
870TCC = $(TCC) -DSQLITE_WIN32_MALLOC=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000871RCC = $(RCC) -DSQLITE_WIN32_MALLOC=1
mistachkin753c5442011-08-25 02:02:25 +0000872
mistachkin753c5442011-08-25 02:02:25 +0000873# Validate the heap on every call into the native Win32 heap subsystem?
874#
mistachkincd54bab2014-12-20 21:14:14 +0000875!IF $(DEBUG)>3
mistachkin753c5442011-08-25 02:02:25 +0000876TCC = $(TCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000877RCC = $(RCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1
mistachkin753c5442011-08-25 02:02:25 +0000878!ENDIF
mistachkin2f7d5d82012-08-22 00:39:34 +0000879!ENDIF
mistachkin1b186a92011-08-24 16:13:57 +0000880
mistachkin3e786092016-01-23 07:53:04 +0000881# <<mark>>
mistachkin5b0b6fd2011-06-25 01:14:36 +0000882# The locations of the Tcl header and library files. Also, the library that
883# non-stubs enabled programs using Tcl must link against. These variables
884# (TCLINCDIR, TCLLIBDIR, and LIBTCL) may be overridden via the environment
885# prior to running nmake in order to match the actual installed location and
886# version on this machine.
shanehb2f20bf2011-06-17 07:07:24 +0000887#
mistachkinb1b808b2019-03-22 22:34:16 +0000888!IFNDEF TCLVERSION
889TCLVERSION = 86
890!ENDIF
891
mistachkin21a3b312019-03-23 00:38:52 +0000892!IFNDEF TCLSUFFIX
893TCLSUFFIX =
894!ENDIF
895
mistachkincb6acda2017-12-05 18:54:12 +0000896!IFNDEF TCLDIR
mistachkina0fcafe2017-12-05 19:07:30 +0000897TCLDIR = $(TOP)\compat\tcl
mistachkincb6acda2017-12-05 18:54:12 +0000898!ENDIF
899
mistachkine37f99c2012-06-30 16:22:05 +0000900!IFNDEF TCLINCDIR
mistachkincb6acda2017-12-05 18:54:12 +0000901TCLINCDIR = $(TCLDIR)\include
mistachkine37f99c2012-06-30 16:22:05 +0000902!ENDIF
mistachkin5b0b6fd2011-06-25 01:14:36 +0000903
mistachkine37f99c2012-06-30 16:22:05 +0000904!IFNDEF TCLLIBDIR
mistachkincb6acda2017-12-05 18:54:12 +0000905TCLLIBDIR = $(TCLDIR)\lib
mistachkine37f99c2012-06-30 16:22:05 +0000906!ENDIF
mistachkin5b0b6fd2011-06-25 01:14:36 +0000907
mistachkine37f99c2012-06-30 16:22:05 +0000908!IFNDEF LIBTCL
mistachkin21a3b312019-03-23 00:38:52 +0000909LIBTCL = tcl$(TCLVERSION)$(TCLSUFFIX).lib
mistachkine37f99c2012-06-30 16:22:05 +0000910!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000911
mistachkin5b663502015-10-10 23:39:55 +0000912!IFNDEF LIBTCLSTUB
mistachkin21a3b312019-03-23 00:38:52 +0000913LIBTCLSTUB = tclstub$(TCLVERSION)$(TCLSUFFIX).lib
mistachkin5b663502015-10-10 23:39:55 +0000914!ENDIF
915
mistachkin88739962015-10-14 23:04:08 +0000916!IFNDEF LIBTCLPATH
mistachkincb6acda2017-12-05 18:54:12 +0000917LIBTCLPATH = $(TCLDIR)\bin
918!ENDIF
919
920# The locations of the zlib header and library files. These variables
921# (ZLIBINCDIR, ZLIBLIBDIR, and ZLIBLIB) may be overridden via the environment
922# prior to running nmake in order to match the actual installed (or source
923# code) location on this machine.
924#
925!IFNDEF ZLIBDIR
926ZLIBDIR = $(TOP)\compat\zlib
927!ENDIF
928
929!IFNDEF ZLIBINCDIR
930ZLIBINCDIR = $(ZLIBDIR)
931!ENDIF
932
933!IFNDEF ZLIBLIBDIR
934ZLIBLIBDIR = $(ZLIBDIR)
935!ENDIF
936
937!IFNDEF ZLIBLIB
938!IF $(DYNAMIC_SHELL)!=0
939ZLIBLIB = zdll.lib
940!ELSE
941ZLIBLIB = zlib.lib
942!ENDIF
mistachkin88739962015-10-14 23:04:08 +0000943!ENDIF
944
mistachkinc756ded2011-10-02 05:23:16 +0000945# The locations of the ICU header and library files. These variables
946# (ICUINCDIR, ICULIBDIR, and LIBICU) may be overridden via the environment
947# prior to running nmake in order to match the actual installed location on
948# this machine.
949#
mistachkincb6acda2017-12-05 18:54:12 +0000950!IFNDEF ICUDIR
mistachkina0fcafe2017-12-05 19:07:30 +0000951ICUDIR = $(TOP)\compat\icu
mistachkincb6acda2017-12-05 18:54:12 +0000952!ENDIF
953
mistachkine37f99c2012-06-30 16:22:05 +0000954!IFNDEF ICUINCDIR
mistachkincb6acda2017-12-05 18:54:12 +0000955ICUINCDIR = $(ICUDIR)\include
mistachkine37f99c2012-06-30 16:22:05 +0000956!ENDIF
mistachkinc756ded2011-10-02 05:23:16 +0000957
mistachkine37f99c2012-06-30 16:22:05 +0000958!IFNDEF ICULIBDIR
mistachkincb6acda2017-12-05 18:54:12 +0000959ICULIBDIR = $(ICUDIR)\lib
mistachkine37f99c2012-06-30 16:22:05 +0000960!ENDIF
mistachkinc756ded2011-10-02 05:23:16 +0000961
mistachkine37f99c2012-06-30 16:22:05 +0000962!IFNDEF LIBICU
mistachkinc756ded2011-10-02 05:23:16 +0000963LIBICU = icuuc.lib icuin.lib
mistachkine37f99c2012-06-30 16:22:05 +0000964!ENDIF
mistachkinc756ded2011-10-02 05:23:16 +0000965
shanehb2f20bf2011-06-17 07:07:24 +0000966# This is the command to use for tclsh - normally just "tclsh", but we may
mistachkin5b0b6fd2011-06-25 01:14:36 +0000967# know the specific version we want to use. This variable (TCLSH_CMD) may be
968# overridden via the environment prior to running nmake in order to select a
969# specific Tcl shell to use.
shanehb2f20bf2011-06-17 07:07:24 +0000970#
mistachkine37f99c2012-06-30 16:22:05 +0000971!IFNDEF TCLSH_CMD
mistachkin47be3b22018-01-05 01:22:37 +0000972!IF $(USE_TCLSH_IN_PATH)!=0 || !EXIST("$(TCLDIR)\bin\tclsh.exe")
drh506a1402016-11-02 19:49:22 +0000973TCLSH_CMD = tclsh
mistachkina0fcafe2017-12-05 19:07:30 +0000974!ELSE
975TCLSH_CMD = $(TCLDIR)\bin\tclsh.exe
976!ENDIF
mistachkine37f99c2012-06-30 16:22:05 +0000977!ENDIF
mistachkin3e786092016-01-23 07:53:04 +0000978# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +0000979
980# Compiler options needed for programs that use the readline() library.
981#
mistachkin8bcd3fa2013-08-29 01:03:38 +0000982!IFNDEF READLINE_FLAGS
shaneh6e7850c2011-06-17 15:57:07 +0000983READLINE_FLAGS = -DHAVE_READLINE=0
mistachkin8bcd3fa2013-08-29 01:03:38 +0000984!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000985
986# The library that programs using readline() must link against.
987#
mistachkin8bcd3fa2013-08-29 01:03:38 +0000988!IFNDEF LIBREADLINE
shaneh6e7850c2011-06-17 15:57:07 +0000989LIBREADLINE =
mistachkin8bcd3fa2013-08-29 01:03:38 +0000990!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000991
992# Should the database engine be compiled threadsafe
993#
994TCC = $(TCC) -DSQLITE_THREADSAFE=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000995RCC = $(RCC) -DSQLITE_THREADSAFE=1
shanehb2f20bf2011-06-17 07:07:24 +0000996
997# Do threads override each others locks by default (1), or do we test (-1)
998#
999TCC = $(TCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1
mistachkin4d9d1f42012-09-03 10:32:32 +00001000RCC = $(RCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1
shanehb2f20bf2011-06-17 07:07:24 +00001001
1002# Any target libraries which libsqlite must be linked against
shaneh6e7850c2011-06-17 15:57:07 +00001003#
mistachkine37f99c2012-06-30 16:22:05 +00001004!IFNDEF TLIBS
shaneh6e7850c2011-06-17 15:57:07 +00001005TLIBS =
mistachkine37f99c2012-06-30 16:22:05 +00001006!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +00001007
1008# Flags controlling use of the in memory btree implementation
1009#
1010# SQLITE_TEMP_STORE is 0 to force temporary tables to be in a file, 1 to
1011# default to file, 2 to default to memory, and 3 to force temporary
1012# tables to always be in memory.
1013#
shaneh6e7850c2011-06-17 15:57:07 +00001014TCC = $(TCC) -DSQLITE_TEMP_STORE=1
mistachkin4d9d1f42012-09-03 10:32:32 +00001015RCC = $(RCC) -DSQLITE_TEMP_STORE=1
shanehb2f20bf2011-06-17 07:07:24 +00001016
1017# Enable/disable loadable extensions, and other optional features
shaneh6e7850c2011-06-17 15:57:07 +00001018# based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*).
1019# The same set of OMIT and ENABLE flags should be passed to the
shanehb2f20bf2011-06-17 07:07:24 +00001020# LEMON parser generator and the mkkeywordhash tool as well.
1021
mistachkin4712c212014-05-09 20:51:17 +00001022# These are the required SQLite compilation options used when compiling for
1023# the Windows platform.
1024#
1025REQ_FEATURE_FLAGS = $(REQ_FEATURE_FLAGS) -DSQLITE_MAX_TRIGGER_DEPTH=100
shanehb2f20bf2011-06-17 07:07:24 +00001026
mistachkine45e0fb2015-01-21 00:48:46 +00001027# If we are linking to the RPCRT4 library, enable features that need it.
1028#
1029!IF $(USE_RPCRT4_LIB)!=0
1030REQ_FEATURE_FLAGS = $(REQ_FEATURE_FLAGS) -DSQLITE_WIN32_USE_UUID=1
1031!ENDIF
1032
mistachkin4712c212014-05-09 20:51:17 +00001033# Add the required and optional SQLite compilation options into the command
1034# lines used to invoke the MSVC code and resource compilers.
1035#
mistachkinedcb4eb2016-01-22 01:25:15 +00001036TCC = $(TCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS)
1037RCC = $(RCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS)
shanehb2f20bf2011-06-17 07:07:24 +00001038
mistachkin4712c212014-05-09 20:51:17 +00001039# Add in any optional parameters specified on the commane line, e.g.
1040# nmake /f Makefile.msc all "OPTS=-DSQLITE_ENABLE_FOO=1 -DSQLITE_OMIT_FOO=1"
1041#
shanehb2f20bf2011-06-17 07:07:24 +00001042TCC = $(TCC) $(OPTS)
mistachkin4d9d1f42012-09-03 10:32:32 +00001043RCC = $(RCC) $(OPTS)
shanehb2f20bf2011-06-17 07:07:24 +00001044
mistachkin8bcd3fa2013-08-29 01:03:38 +00001045# If compiling for debugging, add some defines.
mistachkin4712c212014-05-09 20:51:17 +00001046#
mistachkincd54bab2014-12-20 21:14:14 +00001047!IF $(DEBUG)>1
mistachkin8bcd3fa2013-08-29 01:03:38 +00001048TCC = $(TCC) -D_DEBUG
1049BCC = $(BCC) -D_DEBUG
mistachkin4d9d1f42012-09-03 10:32:32 +00001050RCC = $(RCC) -D_DEBUG
mistachkin4d60be52011-08-26 05:40:31 +00001051!ENDIF
1052
mistachkin8bcd3fa2013-08-29 01:03:38 +00001053# If optimizations are enabled or disabled (either implicitly or
1054# explicitly), add the necessary flags.
mistachkin4712c212014-05-09 20:51:17 +00001055#
mistachkincd54bab2014-12-20 21:14:14 +00001056!IF $(DEBUG)>1 || $(OPTIMIZATIONS)==0
mistachkin8bcd3fa2013-08-29 01:03:38 +00001057TCC = $(TCC) -Od
1058BCC = $(BCC) -Od
mistachkin24b6b812016-08-24 18:21:58 +00001059!IF $(USE_RUNTIME_CHECKS)!=0
1060TCC = $(TCC) -RTC1
1061BCC = $(BCC) -RTC1
1062!ENDIF
mistachkin8bcd3fa2013-08-29 01:03:38 +00001063!ELSEIF $(OPTIMIZATIONS)>=3
1064TCC = $(TCC) -Ox
1065BCC = $(BCC) -Ox
1066!ELSEIF $(OPTIMIZATIONS)==2
1067TCC = $(TCC) -O2
1068BCC = $(BCC) -O2
1069!ELSEIF $(OPTIMIZATIONS)==1
1070TCC = $(TCC) -O1
1071BCC = $(BCC) -O1
1072!ENDIF
1073
1074# If symbols are enabled (or compiling for debugging), enable PDBs.
mistachkin4712c212014-05-09 20:51:17 +00001075#
mistachkincd54bab2014-12-20 21:14:14 +00001076!IF $(DEBUG)>1 || $(SYMBOLS)!=0
mistachkin4d60be52011-08-26 05:40:31 +00001077TCC = $(TCC) -Zi
mistachkinfec360a2012-04-18 10:29:21 +00001078BCC = $(BCC) -Zi
mistachkin753c5442011-08-25 02:02:25 +00001079!ENDIF
1080
mistachkin3e786092016-01-23 07:53:04 +00001081# <<mark>>
mistachkincb6acda2017-12-05 18:54:12 +00001082# If zlib support is enabled, add the compiler options for it.
1083#
1084!IF $(USE_ZLIB)!=0
1085TCC = $(TCC) -DSQLITE_HAVE_ZLIB=1
1086RCC = $(RCC) -DSQLITE_HAVE_ZLIB=1
1087TCC = $(TCC) -I$(ZLIBINCDIR)
1088RCC = $(RCC) -I$(ZLIBINCDIR)
1089!ENDIF
1090
mistachkinc756ded2011-10-02 05:23:16 +00001091# If ICU support is enabled, add the compiler options for it.
mistachkin4712c212014-05-09 20:51:17 +00001092#
mistachkinc756ded2011-10-02 05:23:16 +00001093!IF $(USE_ICU)!=0
1094TCC = $(TCC) -DSQLITE_ENABLE_ICU=1
mistachkin4d9d1f42012-09-03 10:32:32 +00001095RCC = $(RCC) -DSQLITE_ENABLE_ICU=1
mistachkinc756ded2011-10-02 05:23:16 +00001096TCC = $(TCC) -I$(TOP)\ext\icu
mistachkin4d9d1f42012-09-03 10:32:32 +00001097RCC = $(RCC) -I$(TOP)\ext\icu
mistachkinc756ded2011-10-02 05:23:16 +00001098TCC = $(TCC) -I$(ICUINCDIR)
mistachkin4d9d1f42012-09-03 10:32:32 +00001099RCC = $(RCC) -I$(ICUINCDIR)
mistachkinc756ded2011-10-02 05:23:16 +00001100!ENDIF
mistachkin3e786092016-01-23 07:53:04 +00001101# <</mark>>
mistachkinc756ded2011-10-02 05:23:16 +00001102
mistachkin4d9d1f42012-09-03 10:32:32 +00001103# Command line prefixes for compiling code, compiling resources,
1104# linking, etc.
mistachkin4712c212014-05-09 20:51:17 +00001105#
mistachkine2bcbb42019-03-22 01:25:16 +00001106LTCOMPILE = $(TCC) -Fo$@ -Fd$*.pdb
mistachkin4d9d1f42012-09-03 10:32:32 +00001107LTRCOMPILE = $(RCC) -r
shanehb2f20bf2011-06-17 07:07:24 +00001108LTLIB = lib.exe
shaneh2a0b9ef2011-06-20 20:52:32 +00001109LTLINK = $(TCC) -Fe$@
1110
mistachkine45e0fb2015-01-21 00:48:46 +00001111# If requested, link to the RPCRT4 library.
1112#
1113!IF $(USE_RPCRT4_LIB)!=0
mistachkin041343d2017-11-21 21:15:17 +00001114LTLIBS = $(LTLIBS) rpcrt4.lib
mistachkine45e0fb2015-01-21 00:48:46 +00001115!ENDIF
1116
shaneh2a0b9ef2011-06-20 20:52:32 +00001117# If a platform was set, force the linker to target that.
1118# Note that the vcvars*.bat family of batch files typically
1119# set this for you. Otherwise, the linker will attempt
1120# to deduce the binary type based on the object files.
mistachkine37f99c2012-06-30 16:22:05 +00001121!IFDEF PLATFORM
mistachkin44723ce2015-03-21 02:22:37 +00001122LTLINKOPTS = /NOLOGO /MACHINE:$(PLATFORM)
1123LTLIBOPTS = /NOLOGO /MACHINE:$(PLATFORM)
mistachkinb1b808b2019-03-22 22:34:16 +00001124!ELSEIF "$(VISUALSTUDIOVERSION)"=="12.0" || \
1125 "$(VISUALSTUDIOVERSION)"=="14.0" || \
1126 "$(VISUALSTUDIOVERSION)"=="15.0"
mistachkin57494ad2019-03-22 16:52:17 +00001127LTLINKOPTS = /NOLOGO /MACHINE:x86
1128LTLIBOPTS = /NOLOGO /MACHINE:x86
1129!ELSE
mistachkin44723ce2015-03-21 02:22:37 +00001130LTLINKOPTS = /NOLOGO
1131LTLIBOPTS = /NOLOGO
shaneh2a0b9ef2011-06-20 20:52:32 +00001132!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +00001133
mistachkina6ff8572012-04-17 21:00:12 +00001134# When compiling for use in the WinRT environment, the following
1135# linker option must be used to mark the executable as runnable
1136# only in the context of an application container.
1137#
1138!IF $(FOR_WINRT)!=0
1139LTLINKOPTS = $(LTLINKOPTS) /APPCONTAINER
mistachkin318d38c2015-04-22 01:33:53 +00001140!IF "$(VISUALSTUDIOVERSION)"=="12.0" || "$(VISUALSTUDIOVERSION)"=="14.0"
mistachkinf6a23422014-05-05 20:24:34 +00001141!IFNDEF STORELIBPATH
mistachkinda5b1cd2013-07-10 19:39:02 +00001142!IF "$(PLATFORM)"=="x86"
mistachkin4712c212014-05-09 20:51:17 +00001143STORELIBPATH = $(CRTLIBPATH)\store
mistachkinda5b1cd2013-07-10 19:39:02 +00001144!ELSEIF "$(PLATFORM)"=="x64"
mistachkin4712c212014-05-09 20:51:17 +00001145STORELIBPATH = $(CRTLIBPATH)\store\amd64
mistachkin4eaa1292013-07-10 21:33:25 +00001146!ELSEIF "$(PLATFORM)"=="ARM"
mistachkin4712c212014-05-09 20:51:17 +00001147STORELIBPATH = $(CRTLIBPATH)\store\arm
mistachkin4eaa1292013-07-10 21:33:25 +00001148!ELSE
mistachkin4712c212014-05-09 20:51:17 +00001149STORELIBPATH = $(CRTLIBPATH)\store
mistachkinda5b1cd2013-07-10 19:39:02 +00001150!ENDIF
1151!ENDIF
mistachkinf6a23422014-05-05 20:24:34 +00001152STORELIBPATH = $(STORELIBPATH:\\=\)
1153LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(STORELIBPATH)"
1154!ENDIF
mistachkina6ff8572012-04-17 21:00:12 +00001155!ENDIF
1156
mistachkind9b3c542014-05-09 23:31:55 +00001157# When compiling for Windows Phone 8.1, an extra library path is
1158# required.
1159#
1160!IF $(USE_WP81_OPTS)!=0
1161!IFNDEF WP81LIBPATH
1162!IF "$(PLATFORM)"=="x86"
1163WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86
1164!ELSEIF "$(PLATFORM)"=="ARM"
1165WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\ARM
1166!ELSE
1167WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86
mistachkinc756ded2011-10-02 05:23:16 +00001168!ENDIF
mistachkin31856a32012-07-27 07:13:25 +00001169!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +00001170!ENDIF
1171
mistachkind9b3c542014-05-09 23:31:55 +00001172# When compiling for Windows Phone 8.1, some extra linker options
1173# are also required.
1174#
1175!IF $(USE_WP81_OPTS)!=0
1176!IFDEF WP81LIBPATH
1177LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(WP81LIBPATH)"
1178!ENDIF
1179LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE
1180LTLINKOPTS = $(LTLINKOPTS) WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelHost.lib
1181LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:kernel32.lib /NODEFAULTLIB:ole32.lib
1182!ENDIF
1183
mistachkina819aed2016-02-12 05:19:29 +00001184# When compiling for UWP or the Windows 10 platform, some extra linker
mistachkin55e88d92016-02-08 20:40:57 +00001185# options are also required.
mistachkin318d38c2015-04-22 01:33:53 +00001186#
mistachkina819aed2016-02-12 05:19:29 +00001187!IF $(FOR_UWP)!=0 || $(FOR_WIN10)!=0
mistachkin318d38c2015-04-22 01:33:53 +00001188LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE /NODEFAULTLIB:kernel32.lib
1189LTLINKOPTS = $(LTLINKOPTS) mincore.lib
1190!IFDEF PSDKLIBPATH
1191LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(PSDKLIBPATH)"
1192!ENDIF
1193!ENDIF
1194
mistachkina6f28892016-02-05 19:40:23 +00001195!IF $(FOR_WIN10)!=0
mistachkin406eeff2016-02-09 18:28:20 +00001196LTLINKOPTS = $(LTLINKOPTS) /guard:cf "/LIBPATH:$(UCRTLIBPATH)"
mistachkina6f28892016-02-05 19:40:23 +00001197!IF $(DEBUG)>1
1198LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:libucrtd.lib /DEFAULTLIB:ucrtd.lib
1199!ELSE
1200LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib
1201!ENDIF
1202!ENDIF
1203
shanehb2f20bf2011-06-17 07:07:24 +00001204# If either debugging or symbols are enabled, enable PDBs.
mistachkin4712c212014-05-09 20:51:17 +00001205#
mistachkincd54bab2014-12-20 21:14:14 +00001206!IF $(DEBUG)>1 || $(SYMBOLS)!=0
mistachkinf170ea42015-10-16 20:13:57 +00001207LDFLAGS = /DEBUG $(LDOPTS)
1208!ELSE
1209LDFLAGS = $(LDOPTS)
shanehb2f20bf2011-06-17 07:07:24 +00001210!ENDIF
1211
mistachkin3e786092016-01-23 07:53:04 +00001212# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001213# Start with the Tcl related linker options.
mistachkin4712c212014-05-09 20:51:17 +00001214#
shanehb2f20bf2011-06-17 07:07:24 +00001215!IF $(NO_TCL)==0
mistachkin590522c2018-01-05 16:05:51 +00001216TCLLIBPATHS = $(TCLLIBPATHS) /LIBPATH:$(TCLLIBDIR)
1217TCLLIBS = $(TCLLIBS) $(LIBTCL)
mistachkin31856a32012-07-27 07:13:25 +00001218!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +00001219
mistachkincb6acda2017-12-05 18:54:12 +00001220# If zlib support is enabled, add the linker options for it.
1221#
1222!IF $(USE_ZLIB)!=0
1223LTLIBPATHS = $(LTLIBPATHS) /LIBPATH:$(ZLIBLIBDIR)
1224LTLIBS = $(LTLIBS) $(ZLIBLIB)
shanehb2f20bf2011-06-17 07:07:24 +00001225!ENDIF
1226
1227# If ICU support is enabled, add the linker options for it.
mistachkin4712c212014-05-09 20:51:17 +00001228#
shanehb2f20bf2011-06-17 07:07:24 +00001229!IF $(USE_ICU)!=0
1230LTLIBPATHS = $(LTLIBPATHS) /LIBPATH:$(ICULIBDIR)
1231LTLIBS = $(LTLIBS) $(LIBICU)
1232!ENDIF
mistachkin3e786092016-01-23 07:53:04 +00001233# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001234
shanehb2f20bf2011-06-17 07:07:24 +00001235# You should not have to change anything below this line
1236###############################################################################
1237
mistachkin3e786092016-01-23 07:53:04 +00001238# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001239# Object files for the SQLite library (non-amalgamation).
1240#
mistachkinf67feef2013-07-29 19:03:20 +00001241LIBOBJS0 = vdbe.lo parse.lo alter.lo analyze.lo attach.lo auth.lo \
shanehb2f20bf2011-06-17 07:07:24 +00001242 backup.lo bitvec.lo btmutex.lo btree.lo build.lo \
drha43c8c82017-10-11 13:48:11 +00001243 callback.lo complete.lo ctime.lo \
1244 date.lo dbpage.lo dbstat.lo delete.lo \
shanehb2f20bf2011-06-17 07:07:24 +00001245 expr.lo fault.lo fkey.lo \
drh391d4ba2012-05-28 20:22:16 +00001246 fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo \
1247 fts3_porter.lo fts3_snippet.lo fts3_tokenizer.lo fts3_tokenizer1.lo \
drh4d648c72013-04-22 17:07:56 +00001248 fts3_tokenize_vtab.lo fts3_unicode.lo fts3_unicode2.lo fts3_write.lo \
mistachkined52f9f2015-06-26 04:34:36 +00001249 fts5.lo \
shanehb2f20bf2011-06-17 07:07:24 +00001250 func.lo global.lo hash.lo \
mistachkin90d6f482018-09-12 00:48:17 +00001251 icu.lo insert.lo json1.lo legacy.lo loadext.lo \
shanehb2f20bf2011-06-17 07:07:24 +00001252 main.lo malloc.lo mem0.lo mem1.lo mem2.lo mem3.lo mem5.lo \
drhac442f42018-01-03 01:28:46 +00001253 memdb.lo memjournal.lo \
mistachkinf1c6bc52012-06-21 15:09:20 +00001254 mutex.lo mutex_noop.lo mutex_unix.lo mutex_w32.lo \
1255 notify.lo opcodes.lo os.lo os_unix.lo os_win.lo \
mistachkinf67feef2013-07-29 19:03:20 +00001256 pager.lo pcache.lo pcache1.lo pragma.lo prepare.lo printf.lo \
drh498dcae2013-03-13 11:42:00 +00001257 random.lo resolve.lo rowset.lo rtree.lo \
mistachkin90d6f482018-09-12 00:48:17 +00001258 sqlite3session.lo select.lo sqlite3rbu.lo status.lo stmt.lo \
drh38b41492015-06-08 15:08:15 +00001259 table.lo threads.lo tokenize.lo treeview.lo trigger.lo \
drhfcfd7562018-04-12 21:42:51 +00001260 update.lo upsert.lo util.lo vacuum.lo \
mistachkinf67feef2013-07-29 19:03:20 +00001261 vdbeapi.lo vdbeaux.lo vdbeblob.lo vdbemem.lo vdbesort.lo \
dana5ee67d2020-05-18 18:02:37 +00001262 vdbetrace.lo vdbevtab.lo wal.lo walker.lo where.lo wherecode.lo \
1263 whereexpr.lo \
dan980cf252018-06-10 07:42:35 +00001264 window.lo utf.lo vtab.lo
mistachkin3e786092016-01-23 07:53:04 +00001265# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001266
1267# Object files for the amalgamation.
1268#
1269LIBOBJS1 = sqlite3.lo
1270
1271# Determine the real value of LIBOBJ based on the 'configure' script
1272#
mistachkin3e786092016-01-23 07:53:04 +00001273# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001274!IF $(USE_AMALGAMATION)==0
1275LIBOBJ = $(LIBOBJS0)
1276!ELSE
mistachkin3e786092016-01-23 07:53:04 +00001277# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001278LIBOBJ = $(LIBOBJS1)
mistachkin3e786092016-01-23 07:53:04 +00001279# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001280!ENDIF
mistachkin3e786092016-01-23 07:53:04 +00001281# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001282
mistachkin08c1c312012-10-06 03:48:25 +00001283# Determine if embedded resource compilation and usage are enabled.
1284#
1285!IF $(USE_RC)!=0
1286LIBRESOBJS = sqlite3res.lo
1287!ELSE
1288LIBRESOBJS =
1289!ENDIF
1290
mistachkin3e786092016-01-23 07:53:04 +00001291# <<mark>>
mistachkinc04c54b2016-02-11 21:28:16 +00001292# Core source code files, part 1.
shanehb2f20bf2011-06-17 07:07:24 +00001293#
mistachkinc04c54b2016-02-11 21:28:16 +00001294SRC00 = \
shanehb2f20bf2011-06-17 07:07:24 +00001295 $(TOP)\src\alter.c \
1296 $(TOP)\src\analyze.c \
1297 $(TOP)\src\attach.c \
1298 $(TOP)\src\auth.c \
1299 $(TOP)\src\backup.c \
1300 $(TOP)\src\bitvec.c \
1301 $(TOP)\src\btmutex.c \
1302 $(TOP)\src\btree.c \
shanehb2f20bf2011-06-17 07:07:24 +00001303 $(TOP)\src\build.c \
1304 $(TOP)\src\callback.c \
1305 $(TOP)\src\complete.c \
1306 $(TOP)\src\ctime.c \
1307 $(TOP)\src\date.c \
drha43c8c82017-10-11 13:48:11 +00001308 $(TOP)\src\dbpage.c \
drh1a4a6802015-05-04 18:31:09 +00001309 $(TOP)\src\dbstat.c \
shanehb2f20bf2011-06-17 07:07:24 +00001310 $(TOP)\src\delete.c \
1311 $(TOP)\src\expr.c \
1312 $(TOP)\src\fault.c \
1313 $(TOP)\src\fkey.c \
1314 $(TOP)\src\func.c \
1315 $(TOP)\src\global.c \
1316 $(TOP)\src\hash.c \
shanehb2f20bf2011-06-17 07:07:24 +00001317 $(TOP)\src\insert.c \
shanehb2f20bf2011-06-17 07:07:24 +00001318 $(TOP)\src\legacy.c \
1319 $(TOP)\src\loadext.c \
1320 $(TOP)\src\main.c \
1321 $(TOP)\src\malloc.c \
1322 $(TOP)\src\mem0.c \
1323 $(TOP)\src\mem1.c \
1324 $(TOP)\src\mem2.c \
1325 $(TOP)\src\mem3.c \
1326 $(TOP)\src\mem5.c \
drhac442f42018-01-03 01:28:46 +00001327 $(TOP)\src\memdb.c \
shanehb2f20bf2011-06-17 07:07:24 +00001328 $(TOP)\src\memjournal.c \
1329 $(TOP)\src\mutex.c \
shanehb2f20bf2011-06-17 07:07:24 +00001330 $(TOP)\src\mutex_noop.c \
shanehb2f20bf2011-06-17 07:07:24 +00001331 $(TOP)\src\mutex_unix.c \
1332 $(TOP)\src\mutex_w32.c \
1333 $(TOP)\src\notify.c \
1334 $(TOP)\src\os.c \
shanehb2f20bf2011-06-17 07:07:24 +00001335 $(TOP)\src\os_unix.c \
mistachkinc04c54b2016-02-11 21:28:16 +00001336 $(TOP)\src\os_win.c
1337
1338# Core source code files, part 2.
1339#
1340SRC01 = \
shanehb2f20bf2011-06-17 07:07:24 +00001341 $(TOP)\src\pager.c \
shanehb2f20bf2011-06-17 07:07:24 +00001342 $(TOP)\src\pcache.c \
shanehb2f20bf2011-06-17 07:07:24 +00001343 $(TOP)\src\pcache1.c \
1344 $(TOP)\src\pragma.c \
1345 $(TOP)\src\prepare.c \
1346 $(TOP)\src\printf.c \
1347 $(TOP)\src\random.c \
1348 $(TOP)\src\resolve.c \
1349 $(TOP)\src\rowset.c \
1350 $(TOP)\src\select.c \
1351 $(TOP)\src\status.c \
shanehb2f20bf2011-06-17 07:07:24 +00001352 $(TOP)\src\table.c \
drhf51446a2012-07-21 19:40:42 +00001353 $(TOP)\src\threads.c \
shanehb2f20bf2011-06-17 07:07:24 +00001354 $(TOP)\src\tclsqlite.c \
1355 $(TOP)\src\tokenize.c \
drh38b41492015-06-08 15:08:15 +00001356 $(TOP)\src\treeview.c \
shanehb2f20bf2011-06-17 07:07:24 +00001357 $(TOP)\src\trigger.c \
1358 $(TOP)\src\utf.c \
1359 $(TOP)\src\update.c \
drhfcfd7562018-04-12 21:42:51 +00001360 $(TOP)\src\upsert.c \
shanehb2f20bf2011-06-17 07:07:24 +00001361 $(TOP)\src\util.c \
1362 $(TOP)\src\vacuum.c \
1363 $(TOP)\src\vdbe.c \
shanehb2f20bf2011-06-17 07:07:24 +00001364 $(TOP)\src\vdbeapi.c \
1365 $(TOP)\src\vdbeaux.c \
1366 $(TOP)\src\vdbeblob.c \
1367 $(TOP)\src\vdbemem.c \
mistachkin81c428a2011-08-17 02:19:54 +00001368 $(TOP)\src\vdbesort.c \
shanehb2f20bf2011-06-17 07:07:24 +00001369 $(TOP)\src\vdbetrace.c \
drh691b5c52020-03-23 15:49:22 +00001370 $(TOP)\src\vdbevtab.c \
shanehb2f20bf2011-06-17 07:07:24 +00001371 $(TOP)\src\vtab.c \
1372 $(TOP)\src\wal.c \
shanehb2f20bf2011-06-17 07:07:24 +00001373 $(TOP)\src\walker.c \
drhe54df422013-11-12 18:37:25 +00001374 $(TOP)\src\where.c \
drh6f82e852015-06-06 20:12:09 +00001375 $(TOP)\src\wherecode.c \
dan980cf252018-06-10 07:42:35 +00001376 $(TOP)\src\whereexpr.c \
1377 $(TOP)\src\window.c
mistachkinc04c54b2016-02-11 21:28:16 +00001378
mistachkinc04c54b2016-02-11 21:28:16 +00001379# Core miscellaneous files.
1380#
1381SRC03 = \
1382 $(TOP)\src\parse.y
1383
1384# Core header files, part 1.
1385#
1386SRC04 = \
1387 $(TOP)\src\btree.h \
1388 $(TOP)\src\btreeInt.h \
1389 $(TOP)\src\hash.h \
1390 $(TOP)\src\hwtime.h \
1391 $(TOP)\src\msvc.h \
1392 $(TOP)\src\mutex.h \
1393 $(TOP)\src\os.h \
1394 $(TOP)\src\os_common.h \
1395 $(TOP)\src\os_setup.h \
1396 $(TOP)\src\os_win.h
1397
1398# Core header files, part 2.
1399#
1400SRC05 = \
1401 $(TOP)\src\pager.h \
1402 $(TOP)\src\pcache.h \
1403 $(TOP)\src\pragma.h \
1404 $(TOP)\src\sqlite.h.in \
1405 $(TOP)\src\sqlite3ext.h \
1406 $(TOP)\src\sqliteInt.h \
1407 $(TOP)\src\sqliteLimit.h \
1408 $(TOP)\src\vdbe.h \
1409 $(TOP)\src\vdbeInt.h \
1410 $(TOP)\src\vxworks.h \
1411 $(TOP)\src\wal.h \
drhe54df422013-11-12 18:37:25 +00001412 $(TOP)\src\whereInt.h
shanehb2f20bf2011-06-17 07:07:24 +00001413
mistachkinc04c54b2016-02-11 21:28:16 +00001414# Extension source code files, part 1.
shanehb2f20bf2011-06-17 07:07:24 +00001415#
mistachkinc04c54b2016-02-11 21:28:16 +00001416SRC06 = \
shanehb2f20bf2011-06-17 07:07:24 +00001417 $(TOP)\ext\fts1\fts1.c \
shanehb2f20bf2011-06-17 07:07:24 +00001418 $(TOP)\ext\fts1\fts1_hash.c \
shanehb2f20bf2011-06-17 07:07:24 +00001419 $(TOP)\ext\fts1\fts1_porter.c \
drh62679202015-01-29 18:38:05 +00001420 $(TOP)\ext\fts1\fts1_tokenizer1.c \
shanehb2f20bf2011-06-17 07:07:24 +00001421 $(TOP)\ext\fts2\fts2.c \
shanehb2f20bf2011-06-17 07:07:24 +00001422 $(TOP)\ext\fts2\fts2_hash.c \
shanehb2f20bf2011-06-17 07:07:24 +00001423 $(TOP)\ext\fts2\fts2_icu.c \
1424 $(TOP)\ext\fts2\fts2_porter.c \
shanehb2f20bf2011-06-17 07:07:24 +00001425 $(TOP)\ext\fts2\fts2_tokenizer.c \
1426 $(TOP)\ext\fts2\fts2_tokenizer1.c
mistachkinc04c54b2016-02-11 21:28:16 +00001427
1428# Extension source code files, part 2.
1429#
1430SRC07 = \
shanehb2f20bf2011-06-17 07:07:24 +00001431 $(TOP)\ext\fts3\fts3.c \
shanehb2f20bf2011-06-17 07:07:24 +00001432 $(TOP)\ext\fts3\fts3_aux.c \
1433 $(TOP)\ext\fts3\fts3_expr.c \
1434 $(TOP)\ext\fts3\fts3_hash.c \
shanehb2f20bf2011-06-17 07:07:24 +00001435 $(TOP)\ext\fts3\fts3_icu.c \
1436 $(TOP)\ext\fts3\fts3_porter.c \
1437 $(TOP)\ext\fts3\fts3_snippet.c \
shanehb2f20bf2011-06-17 07:07:24 +00001438 $(TOP)\ext\fts3\fts3_tokenizer.c \
1439 $(TOP)\ext\fts3\fts3_tokenizer1.c \
drh4d648c72013-04-22 17:07:56 +00001440 $(TOP)\ext\fts3\fts3_tokenize_vtab.c \
drh391d4ba2012-05-28 20:22:16 +00001441 $(TOP)\ext\fts3\fts3_unicode.c \
1442 $(TOP)\ext\fts3\fts3_unicode2.c \
drh62679202015-01-29 18:38:05 +00001443 $(TOP)\ext\fts3\fts3_write.c \
drh62679202015-01-29 18:38:05 +00001444 $(TOP)\ext\icu\icu.c \
drhedea9112015-03-24 19:02:13 +00001445 $(TOP)\ext\rtree\rtree.c \
drhdbbd8162015-05-19 23:04:26 +00001446 $(TOP)\ext\session\sqlite3session.c \
drh50065652015-10-08 19:29:18 +00001447 $(TOP)\ext\rbu\sqlite3rbu.c \
drhf00f5302017-06-28 15:47:29 +00001448 $(TOP)\ext\misc\json1.c \
drhc6603af2017-06-29 14:33:51 +00001449 $(TOP)\ext\misc\stmt.c
shanehb2f20bf2011-06-17 07:07:24 +00001450
mistachkinc04c54b2016-02-11 21:28:16 +00001451# Extension header files, part 1.
1452#
1453SRC08 = \
1454 $(TOP)\ext\fts1\fts1.h \
1455 $(TOP)\ext\fts1\fts1_hash.h \
1456 $(TOP)\ext\fts1\fts1_tokenizer.h \
1457 $(TOP)\ext\fts2\fts2.h \
1458 $(TOP)\ext\fts2\fts2_hash.h \
1459 $(TOP)\ext\fts2\fts2_tokenizer.h
1460
1461# Extension header files, part 2.
1462#
1463SRC09 = \
1464 $(TOP)\ext\fts3\fts3.h \
1465 $(TOP)\ext\fts3\fts3Int.h \
1466 $(TOP)\ext\fts3\fts3_hash.h \
1467 $(TOP)\ext\fts3\fts3_tokenizer.h \
1468 $(TOP)\ext\icu\sqliteicu.h \
1469 $(TOP)\ext\rtree\rtree.h \
drh748b8fd2018-05-25 19:22:47 +00001470 $(TOP)\ext\rtree\geopoly.c \
mistachkin05004782016-03-30 16:23:06 +00001471 $(TOP)\ext\rbu\sqlite3rbu.h \
1472 $(TOP)\ext\session\sqlite3session.h
shanehb2f20bf2011-06-17 07:07:24 +00001473
1474# Generated source code files
1475#
mistachkinc04c54b2016-02-11 21:28:16 +00001476SRC10 = \
shanehb2f20bf2011-06-17 07:07:24 +00001477 opcodes.c \
mistachkinc04c54b2016-02-11 21:28:16 +00001478 parse.c
1479
1480# Generated header files
1481#
1482SRC11 = \
1483 keywordhash.h \
shanehb2f20bf2011-06-17 07:07:24 +00001484 opcodes.h \
shanehb2f20bf2011-06-17 07:07:24 +00001485 parse.h \
drhaa62d2e2017-10-12 13:47:48 +00001486 shell.c \
mistachkin5d4d9412016-01-22 03:54:36 +00001487 $(SQLITE3H)
shanehb2f20bf2011-06-17 07:07:24 +00001488
mistachkin52b1dbb2016-07-28 14:37:04 +00001489# Generated Tcl header files
1490#
mistachkin4ef916e2016-08-24 19:58:46 +00001491!IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
mistachkin52b1dbb2016-07-28 14:37:04 +00001492SRC12 = \
mistachkin4ef916e2016-08-24 19:58:46 +00001493 $(SQLITETCLH) \
1494 $(SQLITETCLDECLSH)
1495!ELSE
1496SRC12 =
1497!ENDIF
mistachkin52b1dbb2016-07-28 14:37:04 +00001498
drh62679202015-01-29 18:38:05 +00001499# All source code files.
1500#
mistachkin375b0b02020-05-29 21:06:52 +00001501SRC = $(SRC00) $(SRC01) $(SRC03) $(SRC04) $(SRC05) $(SRC06) $(SRC07) $(SRC08) $(SRC09) $(SRC10) $(SRC11) $(SRC12)
drh62679202015-01-29 18:38:05 +00001502
shanehb2f20bf2011-06-17 07:07:24 +00001503# Source code to the test files.
1504#
1505TESTSRC = \
1506 $(TOP)\src\test1.c \
1507 $(TOP)\src\test2.c \
1508 $(TOP)\src\test3.c \
1509 $(TOP)\src\test4.c \
1510 $(TOP)\src\test5.c \
1511 $(TOP)\src\test6.c \
1512 $(TOP)\src\test7.c \
1513 $(TOP)\src\test8.c \
1514 $(TOP)\src\test9.c \
1515 $(TOP)\src\test_autoext.c \
1516 $(TOP)\src\test_async.c \
1517 $(TOP)\src\test_backup.c \
drhddebf162016-03-04 02:59:35 +00001518 $(TOP)\src\test_bestindex.c \
drh5de7d962014-12-05 00:17:39 +00001519 $(TOP)\src\test_blob.c \
shanehb2f20bf2011-06-17 07:07:24 +00001520 $(TOP)\src\test_btree.c \
1521 $(TOP)\src\test_config.c \
dan000f95b2016-09-09 20:00:40 +00001522 $(TOP)\src\test_delete.c \
shanehb2f20bf2011-06-17 07:07:24 +00001523 $(TOP)\src\test_demovfs.c \
1524 $(TOP)\src\test_devsym.c \
mistachkin413c63b2013-01-17 03:18:14 +00001525 $(TOP)\src\test_fs.c \
shanehb2f20bf2011-06-17 07:07:24 +00001526 $(TOP)\src\test_func.c \
shanehb2f20bf2011-06-17 07:07:24 +00001527 $(TOP)\src\test_hexio.c \
1528 $(TOP)\src\test_init.c \
1529 $(TOP)\src\test_intarray.c \
1530 $(TOP)\src\test_journal.c \
1531 $(TOP)\src\test_malloc.c \
drhc318f732017-10-13 15:06:06 +00001532 $(TOP)\src\test_md5.c \
shanehb2f20bf2011-06-17 07:07:24 +00001533 $(TOP)\src\test_multiplex.c \
1534 $(TOP)\src\test_mutex.c \
1535 $(TOP)\src\test_onefile.c \
1536 $(TOP)\src\test_osinst.c \
1537 $(TOP)\src\test_pcache.c \
1538 $(TOP)\src\test_quota.c \
1539 $(TOP)\src\test_rtree.c \
1540 $(TOP)\src\test_schema.c \
1541 $(TOP)\src\test_server.c \
1542 $(TOP)\src\test_superlock.c \
1543 $(TOP)\src\test_syscall.c \
drhc318f732017-10-13 15:06:06 +00001544 $(TOP)\src\test_tclsh.c \
shanehb2f20bf2011-06-17 07:07:24 +00001545 $(TOP)\src\test_tclvar.c \
1546 $(TOP)\src\test_thread.c \
dan1d07f1d2019-04-01 17:24:20 +00001547 $(TOP)\src\test_vdbecov.c \
shanehb2f20bf2011-06-17 07:07:24 +00001548 $(TOP)\src\test_vfs.c \
mistachkin92af1eb2015-11-30 23:29:07 +00001549 $(TOP)\src\test_windirent.c \
dan660af932018-06-18 16:55:22 +00001550 $(TOP)\src\test_window.c \
shanehb2f20bf2011-06-17 07:07:24 +00001551 $(TOP)\src\test_wsd.c \
1552 $(TOP)\ext\fts3\fts3_term.c \
mistachkinadb96a62012-01-16 12:33:36 +00001553 $(TOP)\ext\fts3\fts3_test.c \
mistachkin05004782016-03-30 16:23:06 +00001554 $(TOP)\ext\rbu\test_rbu.c \
dand73ade72021-04-06 17:51:18 +00001555 $(TOP)\ext\session\test_session.c
shanehb2f20bf2011-06-17 07:07:24 +00001556
mistachkinc04c54b2016-02-11 21:28:16 +00001557# Statically linked extensions.
drhe50db1c2013-04-25 14:31:46 +00001558#
drh1fb64af2013-04-25 14:36:28 +00001559TESTEXT = \
drhbd0f1db2017-05-03 12:50:46 +00001560 $(TOP)\ext\expert\sqlite3expert.c \
1561 $(TOP)\ext\expert\test_expert.c \
drh8416fc72013-04-25 16:42:55 +00001562 $(TOP)\ext\misc\amatch.c \
drha94c4842021-03-09 23:38:27 +00001563 $(TOP)\ext\misc\appendvfs.c \
drh2e3f87a2016-07-03 02:35:47 +00001564 $(TOP)\ext\misc\carray.c \
danc30b78f2020-11-18 18:36:43 +00001565 $(TOP)\ext\misc\cksumvfs.c \
drh8416fc72013-04-25 16:42:55 +00001566 $(TOP)\ext\misc\closure.c \
drh35db31b2016-06-02 23:13:21 +00001567 $(TOP)\ext\misc\csv.c \
drhbeb9def2020-06-22 19:12:23 +00001568 $(TOP)\ext\misc\decimal.c \
drh1728bcb2014-11-10 16:49:56 +00001569 $(TOP)\ext\misc\eval.c \
drh9b84f032018-09-16 16:18:01 +00001570 $(TOP)\ext\misc\explain.c \
drh51ed2982014-06-16 12:44:32 +00001571 $(TOP)\ext\misc\fileio.c \
drhe50db1c2013-04-25 14:31:46 +00001572 $(TOP)\ext\misc\fuzzer.c \
mistachkined52f9f2015-06-26 04:34:36 +00001573 $(TOP)\ext\fts5\fts5_tcl.c \
dand3789c02015-08-04 20:29:00 +00001574 $(TOP)\ext\fts5\fts5_test_mi.c \
dan2cfe0492016-01-14 20:05:59 +00001575 $(TOP)\ext\fts5\fts5_test_tok.c \
drh8416fc72013-04-25 16:42:55 +00001576 $(TOP)\ext\misc\ieee754.c \
drh262d5512017-09-18 18:08:54 +00001577 $(TOP)\ext\misc\mmapwarm.c \
drhea41dc42013-04-25 19:31:33 +00001578 $(TOP)\ext\misc\nextchar.c \
drh91694db2018-01-08 20:04:57 +00001579 $(TOP)\ext\misc\normalize.c \
drhdef33672013-05-28 20:25:54 +00001580 $(TOP)\ext\misc\percentile.c \
dan9c039d92019-01-14 20:44:00 +00001581 $(TOP)\ext\misc\prefixes.c \
drhe50db1c2013-04-25 14:31:46 +00001582 $(TOP)\ext\misc\regexp.c \
drh6bada272016-08-09 21:08:42 +00001583 $(TOP)\ext\misc\remember.c \
drh398f8722015-08-19 13:54:20 +00001584 $(TOP)\ext\misc\series.c \
drhb7045ab2013-04-25 14:59:01 +00001585 $(TOP)\ext\misc\spellfix.c \
drh5f8cdac2013-10-14 21:14:42 +00001586 $(TOP)\ext\misc\totype.c \
drh3935ce82017-07-18 20:28:34 +00001587 $(TOP)\ext\misc\unionvtab.c \
dand73ade72021-04-06 17:51:18 +00001588 $(TOP)\ext\misc\wholenumber.c \
dan01ed72f2021-09-17 20:43:27 +00001589 $(TOP)\ext\rtree\test_rtreedoc.c \
dand73ade72021-04-06 17:51:18 +00001590 fts5.c
drhe50db1c2013-04-25 14:31:46 +00001591
mistachkin590522c2018-01-05 16:05:51 +00001592# If use of zlib is enabled, add the "zipfile.c" source file.
1593#
1594!IF $(USE_ZLIB)!=0
1595TESTEXT = $(TESTEXT) $(TOP)\ext\misc\zipfile.c
1596!ENDIF
drhe50db1c2013-04-25 14:31:46 +00001597
shanehb2f20bf2011-06-17 07:07:24 +00001598# Source code to the library files needed by the test fixture
mistachkinadb96a62012-01-16 12:33:36 +00001599# (non-amalgamation)
shanehb2f20bf2011-06-17 07:07:24 +00001600#
1601TESTSRC2 = \
mistachkinc04c54b2016-02-11 21:28:16 +00001602 $(SRC00) \
1603 $(SRC01) \
1604 $(SRC06) \
1605 $(SRC07) \
1606 $(SRC10) \
mistachkin05004782016-03-30 16:23:06 +00001607 $(TOP)\ext\async\sqlite3async.c
shanehb2f20bf2011-06-17 07:07:24 +00001608
1609# Header files used by all library source files.
1610#
1611HDR = \
1612 $(TOP)\src\btree.h \
1613 $(TOP)\src\btreeInt.h \
1614 $(TOP)\src\hash.h \
1615 $(TOP)\src\hwtime.h \
1616 keywordhash.h \
mistachkin2318d332015-01-12 18:02:52 +00001617 $(TOP)\src\msvc.h \
shanehb2f20bf2011-06-17 07:07:24 +00001618 $(TOP)\src\mutex.h \
1619 opcodes.h \
1620 $(TOP)\src\os.h \
1621 $(TOP)\src\os_common.h \
mistachkinf74b9e02013-11-26 01:00:31 +00001622 $(TOP)\src\os_setup.h \
mistachkin8bc52622013-11-25 09:36:07 +00001623 $(TOP)\src\os_win.h \
shanehb2f20bf2011-06-17 07:07:24 +00001624 $(TOP)\src\pager.h \
1625 $(TOP)\src\pcache.h \
shaneh6e7850c2011-06-17 15:57:07 +00001626 parse.h \
drh67e65e52015-02-02 21:34:54 +00001627 $(TOP)\src\pragma.h \
mistachkin5d4d9412016-01-22 03:54:36 +00001628 $(SQLITE3H) \
mistachkine37f7392016-07-28 19:28:35 +00001629 sqlite3ext.h \
shaneh6e7850c2011-06-17 15:57:07 +00001630 $(TOP)\src\sqliteInt.h \
shanehb2f20bf2011-06-17 07:07:24 +00001631 $(TOP)\src\sqliteLimit.h \
1632 $(TOP)\src\vdbe.h \
drhe54df422013-11-12 18:37:25 +00001633 $(TOP)\src\vdbeInt.h \
drh8cd5b252015-03-02 22:06:43 +00001634 $(TOP)\src\vxworks.h \
drhe54df422013-11-12 18:37:25 +00001635 $(TOP)\src\whereInt.h
shanehb2f20bf2011-06-17 07:07:24 +00001636
1637# Header files used by extensions
1638#
1639EXTHDR = $(EXTHDR) \
1640 $(TOP)\ext\fts1\fts1.h \
1641 $(TOP)\ext\fts1\fts1_hash.h \
1642 $(TOP)\ext\fts1\fts1_tokenizer.h
1643EXTHDR = $(EXTHDR) \
1644 $(TOP)\ext\fts2\fts2.h \
1645 $(TOP)\ext\fts2\fts2_hash.h \
1646 $(TOP)\ext\fts2\fts2_tokenizer.h
1647EXTHDR = $(EXTHDR) \
1648 $(TOP)\ext\fts3\fts3.h \
1649 $(TOP)\ext\fts3\fts3Int.h \
1650 $(TOP)\ext\fts3\fts3_hash.h \
1651 $(TOP)\ext\fts3\fts3_tokenizer.h
1652EXTHDR = $(EXTHDR) \
drh748b8fd2018-05-25 19:22:47 +00001653 $(TOP)\ext\rtree\rtree.h \
1654 $(TOP)\ext\rtree\geopoly.c
shanehb2f20bf2011-06-17 07:07:24 +00001655EXTHDR = $(EXTHDR) \
1656 $(TOP)\ext\icu\sqliteicu.h
1657EXTHDR = $(EXTHDR) \
1658 $(TOP)\ext\rtree\sqlite3rtree.h
mistachkinadb96a62012-01-16 12:33:36 +00001659EXTHDR = $(EXTHDR) \
1660 $(TOP)\ext\session\sqlite3session.h
shanehb2f20bf2011-06-17 07:07:24 +00001661
mistachkind4ab1032015-05-11 16:27:33 +00001662# executables needed for testing
drhf4375442015-05-11 12:15:45 +00001663#
1664TESTPROGS = \
1665 testfixture.exe \
mistachkinedcb4eb2016-01-22 01:25:15 +00001666 $(SQLITE3EXE) \
drhf4375442015-05-11 12:15:45 +00001667 sqlite3_analyzer.exe \
drh2737fa02017-10-31 15:49:19 +00001668 sqlite3_checker.exe \
drh290fcaa2016-06-08 01:03:05 +00001669 sqldiff.exe \
drh9dea1732018-01-06 04:34:05 +00001670 dbhash.exe \
1671 sqltclsh.exe
drhf4375442015-05-11 12:15:45 +00001672
drhea93c702015-05-26 18:15:08 +00001673# Databases containing fuzzer test cases
1674#
1675FUZZDATA = \
1676 $(TOP)\test\fuzzdata1.db \
1677 $(TOP)\test\fuzzdata2.db \
drh64ff56f2015-09-23 11:59:50 +00001678 $(TOP)\test\fuzzdata3.db \
drh362b66f2016-11-14 18:27:41 +00001679 $(TOP)\test\fuzzdata4.db \
drh5ecf9032018-05-08 12:49:53 +00001680 $(TOP)\test\fuzzdata5.db \
drh05209e92018-10-31 01:12:06 +00001681 $(TOP)\test\fuzzdata6.db \
drha47e7092019-01-25 04:00:14 +00001682 $(TOP)\test\fuzzdata7.db \
1683 $(TOP)\test\fuzzdata8.db
mistachkin3e786092016-01-23 07:53:04 +00001684# <</mark>>
drhea93c702015-05-26 18:15:08 +00001685
mistachkin5d4d9412016-01-22 03:54:36 +00001686# Additional compiler options for the shell. These are only effective
1687# when the shell is not being dynamically linked.
drhd7f2bea2015-09-19 14:32:51 +00001688#
mistachkin5d4d9412016-01-22 03:54:36 +00001689!IF $(DYNAMIC_SHELL)==0 && $(FOR_WIN10)==0
mistachkin90d6f482018-09-12 00:48:17 +00001690SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_FTS4=1
1691SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_EXPLAIN_COMMENTS=1
1692SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_OFFSET_SQL_FUNC=1
mistachkinedcb4eb2016-01-22 01:25:15 +00001693!ENDIF
1694
mistachkin3e786092016-01-23 07:53:04 +00001695# <<mark>>
mistachkin5d4d9412016-01-22 03:54:36 +00001696# Extra compiler options for various test tools.
1697#
mistachkin690e8852017-10-11 17:50:22 +00001698MPTESTER_COMPILE_OPTS = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5
mistachkin8381be42015-10-09 14:23:56 +00001699FUZZERSHELL_COMPILE_OPTS = -DSQLITE_ENABLE_JSON1
drha47e7092019-01-25 04:00:14 +00001700FUZZCHECK_OPTS = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMSYS5 -DSQLITE_OSS_FUZZ -DSQLITE_MAX_MEMORY=50000000 -DSQLITE_PRINTF_PRECISION_LIMIT=1000
drha47e7092019-01-25 04:00:14 +00001701FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_FTS4
drh95888782021-10-21 20:08:00 +00001702FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_FTS5
drha47e7092019-01-25 04:00:14 +00001703FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_RTREE
1704FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_GEOPOLY
1705FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_DBSTAT_VTAB
drh691b5c52020-03-23 15:49:22 +00001706FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_BYTECODE_VTAB
drha47e7092019-01-25 04:00:14 +00001707
drh362b66f2016-11-14 18:27:41 +00001708FUZZCHECK_SRC = $(TOP)\test\fuzzcheck.c $(TOP)\test\ossfuzz.c
1709OSSSHELL_SRC = $(TOP)\test\ossshell.c $(TOP)\test\ossfuzz.c
mistachkin953fbd12017-02-07 21:09:34 +00001710DBFUZZ_COMPILE_OPTS = -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION
1711KV_COMPILE_OPTS = -DSQLITE_THREADSAFE=0 -DSQLITE_DIRECT_OVERFLOW_READ
mistachkin953fbd12017-02-07 21:09:34 +00001712ST_COMPILE_OPTS = -DSQLITE_THREADSAFE=0
drhf4375442015-05-11 12:15:45 +00001713
mistachkin5d4d9412016-01-22 03:54:36 +00001714# Standard options to testfixture.
drh905da632015-06-10 18:53:09 +00001715#
1716TESTOPTS = --verbose=file --output=test-out.txt
drhf4375442015-05-11 12:15:45 +00001717
mistachkind5be6f02016-01-27 07:28:33 +00001718# Extra targets for the "all" target that require Tcl.
1719#
1720!IF $(NO_TCL)==0
mistachkine2bcbb42019-03-22 01:25:16 +00001721ALL_TCL_TARGETS = $(SQLITE3TCLDLL)
mistachkind5be6f02016-01-27 07:28:33 +00001722!ELSE
1723ALL_TCL_TARGETS =
1724!ENDIF
mistachkin3e786092016-01-23 07:53:04 +00001725# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001726
1727# This is the default Makefile target. The objects listed here
1728# are what get build when you type just "make" with no arguments.
1729#
mistachkinaf238992018-01-05 17:40:38 +00001730core: dll libsqlite3.lib shell
1731
1732# Targets that require the Tcl library.
1733#
1734tcl: $(ALL_TCL_TARGETS)
1735
1736# This Makefile target builds all of the standard binaries.
1737#
1738all: core tcl
shanehb2f20bf2011-06-17 07:07:24 +00001739
mistachkina8a18732016-01-22 22:16:50 +00001740# Dynamic link library section.
1741#
mistachkin9b88ace2016-02-26 21:01:37 +00001742dll: $(SQLITE3DLL)
mistachkina8a18732016-01-22 22:16:50 +00001743
1744# Shell executable.
1745#
mistachkin9b88ace2016-02-26 21:01:37 +00001746shell: $(SQLITE3EXE)
shanehb2f20bf2011-06-17 07:07:24 +00001747
mistachkinb0c99af2016-02-19 05:07:56 +00001748# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001749libsqlite3.lib: $(LIBOBJ)
shaneh29ebea82011-06-21 18:12:07 +00001750 $(LTLIB) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001751
1752libtclsqlite3.lib: tclsqlite.lo libsqlite3.lib
mistachkine2bcbb42019-03-22 01:25:16 +00001753 $(LTLIB) $(LTLIBOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCLSTUB) $(TLIBS)
1754
1755tclsqlite3.def: tclsqlite.lo
1756 echo EXPORTS > tclsqlite3.def
1757 dumpbin /all tclsqlite.lo \
1758 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl include "^\s+/EXPORT:_?((?:Sqlite3|Tclsqlite3)_[^@]*)(?:@\d+)?$$" \1 \
1759 | sort >> tclsqlite3.def
1760
1761pkgIndex.tcl: $(TOP)\VERSION
1762 for /F %%V in ('type "$(TOP)\VERSION"') do ( \
1763 echo package ifneeded sqlite3 @version@ [list load [file join $$dir $(SQLITE3TCLDLL)] sqlite3] \
1764 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact @version@ %%V > pkgIndex.tcl \
1765 )
1766
1767$(SQLITE3TCLDLL): libtclsqlite3.lib $(LIBRESOBJS) tclsqlite3.def pkgIndex.tcl
1768 $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /DEF:tclsqlite3.def /OUT:$@ libtclsqlite3.lib $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
mistachkin3e786092016-01-23 07:53:04 +00001769# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001770
mistachkin9b88ace2016-02-26 21:01:37 +00001771$(SQLITE3DLL): $(LIBOBJ) $(LIBRESOBJS) $(CORE_LINK_DEP)
mistachkina8a18732016-01-22 22:16:50 +00001772 $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL $(CORE_LINK_OPTS) /OUT:$@ $(LIBOBJ) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001773
mistachkin9aeb9712016-02-26 23:13:16 +00001774# <<block2>>
mistachkin9b88ace2016-02-26 21:01:37 +00001775sqlite3.def: libsqlite3.lib
mistachkina8a18732016-01-22 22:16:50 +00001776 echo EXPORTS > sqlite3.def
1777 dumpbin /all libsqlite3.lib \
mistachkine99cb2d2019-12-20 17:41:15 +00001778 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl include "^\s+1 _?(sqlite3(?:session|changeset|changegroup|rebaser|rbu)?_[^@]*)(?:@\d+)?$$" \1 \
mistachkina8a18732016-01-22 22:16:50 +00001779 | sort >> sqlite3.def
mistachkin9aeb9712016-02-26 23:13:16 +00001780# <</block2>>
drhd62c0f42015-04-09 13:34:29 +00001781
drhaa62d2e2017-10-12 13:47:48 +00001782$(SQLITE3EXE): shell.c $(SHELL_CORE_DEP) $(LIBRESOBJS) $(SHELL_CORE_SRC) $(SQLITE3H)
1783 $(LTLINK) $(SHELL_COMPILE_OPTS) $(READLINE_FLAGS) shell.c $(SHELL_CORE_SRC) \
mistachkinedcb4eb2016-01-22 01:25:15 +00001784 /link $(SQLITE3EXEPDB) $(LDFLAGS) $(LTLINKOPTS) $(SHELL_LINK_OPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS)
drh268e72f2015-04-17 14:30:49 +00001785
mistachkin3e786092016-01-23 07:53:04 +00001786# <<mark>>
mistachkin5d4d9412016-01-22 03:54:36 +00001787sqldiff.exe: $(TOP)\tool\sqldiff.c $(SQLITE3C) $(SQLITE3H)
1788 $(LTLINK) $(NO_WARN) $(TOP)\tool\sqldiff.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
mistachkin44723ce2015-03-21 02:22:37 +00001789
drh290fcaa2016-06-08 01:03:05 +00001790dbhash.exe: $(TOP)\tool\dbhash.c $(SQLITE3C) $(SQLITE3H)
1791 $(LTLINK) $(NO_WARN) $(TOP)\tool\dbhash.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
1792
drhda110bf2016-05-05 17:15:23 +00001793scrub.exe: $(TOP)\ext\misc\scrub.c $(SQLITE3C) $(SQLITE3H)
mistachkinac8ba262018-03-07 14:42:17 +00001794 $(LTLINK) $(NO_WARN) -DSCRUB_STANDALONE=1 $(TOP)\ext\misc\scrub.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drhda110bf2016-05-05 17:15:23 +00001795
drhfd0d93f2016-02-07 00:08:08 +00001796srcck1.exe: $(TOP)\tool\srcck1.c
1797 $(BCC) $(NO_WARN) -Fe$@ $(TOP)\tool\srcck1.c
1798
mistachkin1f237e32018-07-27 20:45:28 +00001799sourcetest: srcck1.exe $(SQLITE3C)
1800 srcck1.exe $(SQLITE3C)
drhfd0d93f2016-02-07 00:08:08 +00001801
mistachkin5d4d9412016-01-22 03:54:36 +00001802fuzzershell.exe: $(TOP)\tool\fuzzershell.c $(SQLITE3C) $(SQLITE3H)
1803 $(LTLINK) $(NO_WARN) $(FUZZERSHELL_COMPILE_OPTS) $(TOP)\tool\fuzzershell.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drhbc94dbb2013-04-08 14:28:33 +00001804
mistachkin953fbd12017-02-07 21:09:34 +00001805dbfuzz.exe: $(TOP)\test\dbfuzz.c $(SQLITE3C) $(SQLITE3H)
1806 $(LTLINK) $(NO_WARN) $(DBFUZZ_COMPILE_OPTS) $(TOP)\test\dbfuzz.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
1807
drh362b66f2016-11-14 18:27:41 +00001808fuzzcheck.exe: $(FUZZCHECK_SRC) $(SQLITE3C) $(SQLITE3H)
drha47e7092019-01-25 04:00:14 +00001809 $(LTLINK) $(NO_WARN) $(FUZZCHECK_OPTS) $(FUZZCHECK_SRC) $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh362b66f2016-11-14 18:27:41 +00001810
1811ossshell.exe: $(OSSSHELL_SRC) $(SQLITE3C) $(SQLITE3H)
drha47e7092019-01-25 04:00:14 +00001812 $(LTLINK) $(NO_WARN) $(FUZZCHECK_OPTS) $(OSSSHELL_SRC) $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh1573dc32015-05-25 22:29:26 +00001813
mistachkin98cb7a42018-03-07 21:13:49 +00001814sessionfuzz.exe: zlib $(TOP)\test\sessionfuzz.c $(SQLITE3C) $(SQLITE3H)
1815 $(LTLINK) $(NO_WARN) -I$(ZLIBINCDIR) $(TOP)\test\sessionfuzz.c /link $(LDFLAGS) $(LTLINKOPTS) /LIBPATH:$(ZLIBLIBDIR) $(ZLIBLIB)
1816
mistachkin5d4d9412016-01-22 03:54:36 +00001817mptester.exe: $(TOP)\mptest\mptest.c $(SQLITE3C) $(SQLITE3H)
1818 $(LTLINK) $(NO_WARN) $(MPTESTER_COMPILE_OPTS) $(TOP)\mptest\mptest.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drhbc94dbb2013-04-08 14:28:33 +00001819
mistachkineb48b062015-03-31 17:45:44 +00001820MPTEST1 = mptester mptest.db $(TOP)\mptest\crash01.test --repeat 20
1821MPTEST2 = mptester mptest.db $(TOP)\mptest\multiwrite01.test --repeat 20
mistachkin4d2daba2015-03-31 16:42:16 +00001822
drhfe0ba712015-03-31 13:46:13 +00001823mptest: mptester.exe
mistachkin4d2daba2015-03-31 16:42:16 +00001824 del /Q mptest.db 2>NUL
drhfe0ba712015-03-31 13:46:13 +00001825 $(MPTEST1) --journalmode DELETE
1826 $(MPTEST2) --journalmode WAL
1827 $(MPTEST1) --journalmode WAL
1828 $(MPTEST2) --journalmode PERSIST
1829 $(MPTEST1) --journalmode PERSIST
1830 $(MPTEST2) --journalmode TRUNCATE
1831 $(MPTEST1) --journalmode TRUNCATE
1832 $(MPTEST2) --journalmode DELETE
1833
shanehb2f20bf2011-06-17 07:07:24 +00001834# This target creates a directory named "tsrc" and fills it with
1835# copies of all of the C source code and header files needed to
1836# build on the target system. Some of the C source code and header
1837# files are automatically generated. This target takes care of
1838# all that automatic generation.
1839#
mistachkin4ef916e2016-08-24 19:58:46 +00001840.target_source: $(SRC) $(TOP)\tool\vdbe-compress.tcl fts5.c $(SQLITE_TCL_DEP)
mistachkin44723ce2015-03-21 02:22:37 +00001841 -rmdir /Q/S tsrc 2>NUL
shanehb2f20bf2011-06-17 07:07:24 +00001842 -mkdir tsrc
mistachkine2eb2592016-02-11 21:38:05 +00001843 for %i in ($(SRC00)) do copy /Y %i tsrc
1844 for %i in ($(SRC01)) do copy /Y %i tsrc
mistachkine2eb2592016-02-11 21:38:05 +00001845 for %i in ($(SRC03)) do copy /Y %i tsrc
1846 for %i in ($(SRC04)) do copy /Y %i tsrc
1847 for %i in ($(SRC05)) do copy /Y %i tsrc
1848 for %i in ($(SRC06)) do copy /Y %i tsrc
1849 for %i in ($(SRC07)) do copy /Y %i tsrc
1850 for %i in ($(SRC08)) do copy /Y %i tsrc
1851 for %i in ($(SRC09)) do copy /Y %i tsrc
1852 for %i in ($(SRC10)) do copy /Y %i tsrc
1853 for %i in ($(SRC11)) do copy /Y %i tsrc
mistachkin52b1dbb2016-07-28 14:37:04 +00001854 for %i in ($(SRC12)) do copy /Y %i tsrc
drh50065652015-10-08 19:29:18 +00001855 copy /Y fts5.c tsrc
mistachkin375b0b02020-05-29 21:06:52 +00001856 copy /B tsrc\fts5.c +,,
drh50065652015-10-08 19:29:18 +00001857 copy /Y fts5.h tsrc
mistachkin375b0b02020-05-29 21:06:52 +00001858 copy /B tsrc\fts5.h +,,
mistachkin44723ce2015-03-21 02:22:37 +00001859 del /Q tsrc\sqlite.h.in tsrc\parse.y 2>NUL
drh2dc06482013-12-11 00:59:10 +00001860 $(TCLSH_CMD) $(TOP)\tool\vdbe-compress.tcl $(OPTS) < tsrc\vdbe.c > vdbe.new
shanehb2f20bf2011-06-17 07:07:24 +00001861 move vdbe.new tsrc\vdbe.c
1862 echo > .target_source
1863
mistachkin375b0b02020-05-29 21:06:52 +00001864sqlite3.c: .target_source sqlite3ext.h sqlite3session.h $(MKSQLITE3C_TOOL)
mistachkin4ef916e2016-08-24 19:58:46 +00001865 $(TCLSH_CMD) $(MKSQLITE3C_TOOL) $(MKSQLITE3C_ARGS)
shanehb2f20bf2011-06-17 07:07:24 +00001866
mistachkin48dd9de2012-12-06 04:33:13 +00001867sqlite3-all.c: sqlite3.c $(TOP)\tool\split-sqlite3c.tcl
1868 $(TCLSH_CMD) $(TOP)\tool\split-sqlite3c.tcl
mistachkin3e786092016-01-23 07:53:04 +00001869# <</mark>>
mistachkin76510912013-10-11 23:01:18 +00001870
shanehb2f20bf2011-06-17 07:07:24 +00001871# Rule to build the amalgamation
1872#
mistachkin76510912013-10-11 23:01:18 +00001873sqlite3.lo: $(SQLITE3C)
mistachkin44723ce2015-03-21 02:22:37 +00001874 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(SQLITE3C)
shanehb2f20bf2011-06-17 07:07:24 +00001875
mistachkin3e786092016-01-23 07:53:04 +00001876# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001877# Rules to build the LEMON compiler generator
1878#
drh82415f22015-11-09 19:33:42 +00001879lempar.c: $(TOP)\tool\lempar.c
mistachkin375b0b02020-05-29 21:06:52 +00001880 copy /Y $(TOP)\tool\lempar.c .
1881 copy /B lempar.c +,,
shanehb2f20bf2011-06-17 07:07:24 +00001882
1883lemon.exe: $(TOP)\tool\lemon.c lempar.c
mistachkin2318d332015-01-12 18:02:52 +00001884 $(BCC) $(NO_WARN) -Daccess=_access \
mistachkin460cd9c2015-10-14 22:46:37 +00001885 -Fe$@ $(TOP)\tool\lemon.c /link $(LDFLAGS) $(NLTLINKOPTS) $(NLTLIBPATHS)
shanehb2f20bf2011-06-17 07:07:24 +00001886
drhf39e0ed2017-08-22 19:19:00 +00001887# <<mark>>
1888# Rules to build the source-id generator tool
1889#
1890mksourceid.exe: $(TOP)\tool\mksourceid.c
1891 $(BCC) $(NO_WARN) -Fe$@ $(TOP)\tool\mksourceid.c /link $(LDFLAGS) $(NLTLINKOPTS) $(NLTLIBPATHS)
1892
shanehb2f20bf2011-06-17 07:07:24 +00001893# Rules to build individual *.lo files from generated *.c files. This
1894# applies to:
1895#
1896# parse.lo
1897# opcodes.lo
1898#
1899parse.lo: parse.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001900 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c parse.c
shanehb2f20bf2011-06-17 07:07:24 +00001901
1902opcodes.lo: opcodes.c
mistachkin44723ce2015-03-21 02:22:37 +00001903 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c opcodes.c
mistachkin3e786092016-01-23 07:53:04 +00001904# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001905
mistachkin4d9d1f42012-09-03 10:32:32 +00001906# Rule to build the Win32 resources object file.
1907#
mistachkin08c1c312012-10-06 03:48:25 +00001908!IF $(USE_RC)!=0
mistachkin3e786092016-01-23 07:53:04 +00001909# <<block1>>
mistachkine2bcbb42019-03-22 01:25:16 +00001910$(LIBRESOBJS): $(TOP)\src\sqlite3.rc $(SQLITE3H) $(TOP)\VERSION
mistachkin4d9d1f42012-09-03 10:32:32 +00001911 echo #ifndef SQLITE_RESOURCE_VERSION > sqlite3rc.h
mistachkin8ccc6d42012-09-27 21:03:53 +00001912 for /F %%V in ('type "$(TOP)\VERSION"') do ( \
mistachkin4d9d1f42012-09-03 10:32:32 +00001913 echo #define SQLITE_RESOURCE_VERSION %%V \
mistachkin946ef602015-10-10 01:55:57 +00001914 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact . ^, >> sqlite3rc.h \
mistachkin4d9d1f42012-09-03 10:32:32 +00001915 )
1916 echo #endif >> sqlite3rc.h
mistachkin08c1c312012-10-06 03:48:25 +00001917 $(LTRCOMPILE) -fo $(LIBRESOBJS) $(TOP)\src\sqlite3.rc
mistachkin3e786092016-01-23 07:53:04 +00001918# <</block1>>
mistachkin08c1c312012-10-06 03:48:25 +00001919!ENDIF
mistachkin4d9d1f42012-09-03 10:32:32 +00001920
mistachkin3e786092016-01-23 07:53:04 +00001921# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001922# Rules to build individual *.lo files from files in the src directory.
1923#
1924alter.lo: $(TOP)\src\alter.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001925 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\alter.c
shanehb2f20bf2011-06-17 07:07:24 +00001926
1927analyze.lo: $(TOP)\src\analyze.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001928 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\analyze.c
shanehb2f20bf2011-06-17 07:07:24 +00001929
1930attach.lo: $(TOP)\src\attach.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001931 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\attach.c
shanehb2f20bf2011-06-17 07:07:24 +00001932
1933auth.lo: $(TOP)\src\auth.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001934 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\auth.c
shanehb2f20bf2011-06-17 07:07:24 +00001935
1936backup.lo: $(TOP)\src\backup.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001937 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\backup.c
shanehb2f20bf2011-06-17 07:07:24 +00001938
1939bitvec.lo: $(TOP)\src\bitvec.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001940 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\bitvec.c
shanehb2f20bf2011-06-17 07:07:24 +00001941
1942btmutex.lo: $(TOP)\src\btmutex.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001943 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\btmutex.c
shanehb2f20bf2011-06-17 07:07:24 +00001944
1945btree.lo: $(TOP)\src\btree.c $(HDR) $(TOP)\src\pager.h
mistachkin44723ce2015-03-21 02:22:37 +00001946 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\btree.c
shanehb2f20bf2011-06-17 07:07:24 +00001947
1948build.lo: $(TOP)\src\build.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001949 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\build.c
shanehb2f20bf2011-06-17 07:07:24 +00001950
1951callback.lo: $(TOP)\src\callback.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001952 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\callback.c
shanehb2f20bf2011-06-17 07:07:24 +00001953
1954complete.lo: $(TOP)\src\complete.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001955 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\complete.c
shanehb2f20bf2011-06-17 07:07:24 +00001956
1957ctime.lo: $(TOP)\src\ctime.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001958 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\ctime.c
shanehb2f20bf2011-06-17 07:07:24 +00001959
1960date.lo: $(TOP)\src\date.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001961 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\date.c
shanehb2f20bf2011-06-17 07:07:24 +00001962
drha43c8c82017-10-11 13:48:11 +00001963dbpage.lo: $(TOP)\src\dbpage.c $(HDR)
1964 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\dbpage.c
1965
1966dbstat.lo: $(TOP)\src\dbstat.c $(HDR)
drh1a4a6802015-05-04 18:31:09 +00001967 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\dbstat.c
1968
shanehb2f20bf2011-06-17 07:07:24 +00001969delete.lo: $(TOP)\src\delete.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001970 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\delete.c
shanehb2f20bf2011-06-17 07:07:24 +00001971
1972expr.lo: $(TOP)\src\expr.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001973 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\expr.c
shanehb2f20bf2011-06-17 07:07:24 +00001974
1975fault.lo: $(TOP)\src\fault.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001976 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\fault.c
shanehb2f20bf2011-06-17 07:07:24 +00001977
1978fkey.lo: $(TOP)\src\fkey.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001979 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\fkey.c
shanehb2f20bf2011-06-17 07:07:24 +00001980
1981func.lo: $(TOP)\src\func.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001982 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\func.c
shanehb2f20bf2011-06-17 07:07:24 +00001983
1984global.lo: $(TOP)\src\global.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001985 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\global.c
shanehb2f20bf2011-06-17 07:07:24 +00001986
1987hash.lo: $(TOP)\src\hash.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001988 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\hash.c
shanehb2f20bf2011-06-17 07:07:24 +00001989
1990insert.lo: $(TOP)\src\insert.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001991 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\insert.c
shanehb2f20bf2011-06-17 07:07:24 +00001992
shanehb2f20bf2011-06-17 07:07:24 +00001993legacy.lo: $(TOP)\src\legacy.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001994 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\legacy.c
shanehb2f20bf2011-06-17 07:07:24 +00001995
1996loadext.lo: $(TOP)\src\loadext.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001997 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\loadext.c
shanehb2f20bf2011-06-17 07:07:24 +00001998
1999main.lo: $(TOP)\src\main.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002000 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\main.c
shanehb2f20bf2011-06-17 07:07:24 +00002001
2002malloc.lo: $(TOP)\src\malloc.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002003 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\malloc.c
shanehb2f20bf2011-06-17 07:07:24 +00002004
2005mem0.lo: $(TOP)\src\mem0.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002006 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem0.c
shanehb2f20bf2011-06-17 07:07:24 +00002007
2008mem1.lo: $(TOP)\src\mem1.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002009 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem1.c
shanehb2f20bf2011-06-17 07:07:24 +00002010
2011mem2.lo: $(TOP)\src\mem2.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002012 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem2.c
shanehb2f20bf2011-06-17 07:07:24 +00002013
2014mem3.lo: $(TOP)\src\mem3.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002015 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem3.c
shanehb2f20bf2011-06-17 07:07:24 +00002016
2017mem5.lo: $(TOP)\src\mem5.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002018 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem5.c
shanehb2f20bf2011-06-17 07:07:24 +00002019
mistachkin7de2c3e2018-01-03 12:39:35 +00002020memdb.lo: $(TOP)\src\memdb.c $(HDR)
drhac442f42018-01-03 01:28:46 +00002021 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\memdb.c
2022
shanehb2f20bf2011-06-17 07:07:24 +00002023memjournal.lo: $(TOP)\src\memjournal.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002024 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\memjournal.c
shanehb2f20bf2011-06-17 07:07:24 +00002025
2026mutex.lo: $(TOP)\src\mutex.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002027 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex.c
shanehb2f20bf2011-06-17 07:07:24 +00002028
2029mutex_noop.lo: $(TOP)\src\mutex_noop.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002030 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex_noop.c
shanehb2f20bf2011-06-17 07:07:24 +00002031
shanehb2f20bf2011-06-17 07:07:24 +00002032mutex_unix.lo: $(TOP)\src\mutex_unix.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002033 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex_unix.c
shanehb2f20bf2011-06-17 07:07:24 +00002034
2035mutex_w32.lo: $(TOP)\src\mutex_w32.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002036 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex_w32.c
shanehb2f20bf2011-06-17 07:07:24 +00002037
2038notify.lo: $(TOP)\src\notify.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002039 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\notify.c
shanehb2f20bf2011-06-17 07:07:24 +00002040
2041pager.lo: $(TOP)\src\pager.c $(HDR) $(TOP)\src\pager.h
mistachkin44723ce2015-03-21 02:22:37 +00002042 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pager.c
shanehb2f20bf2011-06-17 07:07:24 +00002043
2044pcache.lo: $(TOP)\src\pcache.c $(HDR) $(TOP)\src\pcache.h
mistachkin44723ce2015-03-21 02:22:37 +00002045 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pcache.c
shanehb2f20bf2011-06-17 07:07:24 +00002046
2047pcache1.lo: $(TOP)\src\pcache1.c $(HDR) $(TOP)\src\pcache.h
mistachkin44723ce2015-03-21 02:22:37 +00002048 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pcache1.c
shanehb2f20bf2011-06-17 07:07:24 +00002049
2050os.lo: $(TOP)\src\os.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002051 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\os.c
shanehb2f20bf2011-06-17 07:07:24 +00002052
2053os_unix.lo: $(TOP)\src\os_unix.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002054 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\os_unix.c
shanehb2f20bf2011-06-17 07:07:24 +00002055
2056os_win.lo: $(TOP)\src\os_win.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002057 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\os_win.c
shanehb2f20bf2011-06-17 07:07:24 +00002058
shanehb2f20bf2011-06-17 07:07:24 +00002059pragma.lo: $(TOP)\src\pragma.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002060 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pragma.c
shanehb2f20bf2011-06-17 07:07:24 +00002061
2062prepare.lo: $(TOP)\src\prepare.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002063 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\prepare.c
shanehb2f20bf2011-06-17 07:07:24 +00002064
2065printf.lo: $(TOP)\src\printf.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002066 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\printf.c
shanehb2f20bf2011-06-17 07:07:24 +00002067
2068random.lo: $(TOP)\src\random.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002069 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\random.c
shanehb2f20bf2011-06-17 07:07:24 +00002070
2071resolve.lo: $(TOP)\src\resolve.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002072 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\resolve.c
shanehb2f20bf2011-06-17 07:07:24 +00002073
2074rowset.lo: $(TOP)\src\rowset.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002075 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\rowset.c
shanehb2f20bf2011-06-17 07:07:24 +00002076
2077select.lo: $(TOP)\src\select.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002078 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\select.c
shanehb2f20bf2011-06-17 07:07:24 +00002079
2080status.lo: $(TOP)\src\status.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002081 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\status.c
shanehb2f20bf2011-06-17 07:07:24 +00002082
2083table.lo: $(TOP)\src\table.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002084 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\table.c
shanehb2f20bf2011-06-17 07:07:24 +00002085
drhf51446a2012-07-21 19:40:42 +00002086threads.lo: $(TOP)\src\threads.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002087 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\threads.c
drhf51446a2012-07-21 19:40:42 +00002088
shanehb2f20bf2011-06-17 07:07:24 +00002089tokenize.lo: $(TOP)\src\tokenize.c keywordhash.h $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002090 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\tokenize.c
shanehb2f20bf2011-06-17 07:07:24 +00002091
drh38b41492015-06-08 15:08:15 +00002092treeview.lo: $(TOP)\src\treeview.c $(HDR)
2093 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\treeview.c
2094
shanehb2f20bf2011-06-17 07:07:24 +00002095trigger.lo: $(TOP)\src\trigger.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002096 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\trigger.c
shanehb2f20bf2011-06-17 07:07:24 +00002097
2098update.lo: $(TOP)\src\update.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002099 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\update.c
shanehb2f20bf2011-06-17 07:07:24 +00002100
drhfcfd7562018-04-12 21:42:51 +00002101upsert.lo: $(TOP)\src\upsert.c $(HDR)
2102 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\upsert.c
2103
shanehb2f20bf2011-06-17 07:07:24 +00002104utf.lo: $(TOP)\src\utf.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002105 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\utf.c
shanehb2f20bf2011-06-17 07:07:24 +00002106
2107util.lo: $(TOP)\src\util.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002108 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\util.c
shanehb2f20bf2011-06-17 07:07:24 +00002109
2110vacuum.lo: $(TOP)\src\vacuum.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002111 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vacuum.c
shanehb2f20bf2011-06-17 07:07:24 +00002112
2113vdbe.lo: $(TOP)\src\vdbe.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002114 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbe.c
shanehb2f20bf2011-06-17 07:07:24 +00002115
2116vdbeapi.lo: $(TOP)\src\vdbeapi.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002117 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbeapi.c
shanehb2f20bf2011-06-17 07:07:24 +00002118
2119vdbeaux.lo: $(TOP)\src\vdbeaux.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002120 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbeaux.c
shanehb2f20bf2011-06-17 07:07:24 +00002121
2122vdbeblob.lo: $(TOP)\src\vdbeblob.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002123 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbeblob.c
shanehb2f20bf2011-06-17 07:07:24 +00002124
2125vdbemem.lo: $(TOP)\src\vdbemem.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002126 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbemem.c
shanehb2f20bf2011-06-17 07:07:24 +00002127
mistachkin81c428a2011-08-17 02:19:54 +00002128vdbesort.lo: $(TOP)\src\vdbesort.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002129 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbesort.c
mistachkin81c428a2011-08-17 02:19:54 +00002130
shanehb2f20bf2011-06-17 07:07:24 +00002131vdbetrace.lo: $(TOP)\src\vdbetrace.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002132 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbetrace.c
shanehb2f20bf2011-06-17 07:07:24 +00002133
drh691b5c52020-03-23 15:49:22 +00002134vdbevtab.lo: $(TOP)\src\vdbevtab.c $(HDR)
2135 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbevtab.c
2136
shanehb2f20bf2011-06-17 07:07:24 +00002137vtab.lo: $(TOP)\src\vtab.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002138 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vtab.c
shanehb2f20bf2011-06-17 07:07:24 +00002139
2140wal.lo: $(TOP)\src\wal.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002141 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\wal.c
shanehb2f20bf2011-06-17 07:07:24 +00002142
2143walker.lo: $(TOP)\src\walker.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002144 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\walker.c
shanehb2f20bf2011-06-17 07:07:24 +00002145
2146where.lo: $(TOP)\src\where.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002147 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\where.c
shanehb2f20bf2011-06-17 07:07:24 +00002148
drh6f82e852015-06-06 20:12:09 +00002149wherecode.lo: $(TOP)\src\wherecode.c $(HDR)
2150 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\wherecode.c
2151
drh6c1f4ef2015-06-08 14:23:15 +00002152whereexpr.lo: $(TOP)\src\whereexpr.c $(HDR)
2153 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\whereexpr.c
2154
dan980cf252018-06-10 07:42:35 +00002155window.lo: $(TOP)\src\window.c $(HDR)
2156 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\window.c
2157
mistachkin4ef916e2016-08-24 19:58:46 +00002158tclsqlite.lo: $(TOP)\src\tclsqlite.c $(HDR) $(SQLITE_TCL_DEP)
mistachkin44723ce2015-03-21 02:22:37 +00002159 $(LTCOMPILE) $(NO_WARN) -DUSE_TCL_STUBS=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c
shanehb2f20bf2011-06-17 07:07:24 +00002160
mistachkin4ef916e2016-08-24 19:58:46 +00002161tclsqlite-shell.lo: $(TOP)\src\tclsqlite.c $(HDR) $(SQLITE_TCL_DEP)
drh96a206f2017-10-13 20:14:06 +00002162 $(LTCOMPILE) $(NO_WARN) -DTCLSH -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c
shanehb2f20bf2011-06-17 07:07:24 +00002163
mistachkin5d4d9412016-01-22 03:54:36 +00002164tclsqlite3.exe: tclsqlite-shell.lo $(SQLITE3C) $(SQLITE3H) $(LIBRESOBJS)
mistachkin590522c2018-01-05 16:05:51 +00002165 $(LTLINK) $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) /OUT:$@ tclsqlite-shell.lo $(LIBRESOBJS) $(TCLLIBS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00002166
2167# Rules to build opcodes.c and opcodes.h
2168#
drh7651e0a2015-10-07 12:11:36 +00002169opcodes.c: opcodes.h $(TOP)\tool\mkopcodec.tcl
2170 $(TCLSH_CMD) $(TOP)\tool\mkopcodec.tcl opcodes.h > opcodes.c
shanehb2f20bf2011-06-17 07:07:24 +00002171
drhb15393b2015-10-07 02:52:09 +00002172opcodes.h: parse.h $(TOP)\src\vdbe.c $(TOP)\tool\mkopcodeh.tcl
mistachkin946ef602015-10-10 01:55:57 +00002173 type parse.h $(TOP)\src\vdbe.c | $(TCLSH_CMD) $(TOP)\tool\mkopcodeh.tcl > opcodes.h
shanehb2f20bf2011-06-17 07:07:24 +00002174
2175# Rules to build parse.c and parse.h - the outputs of lemon.
2176#
2177parse.h: parse.c
2178
drhf1722ba2019-04-05 20:56:46 +00002179parse.c: $(TOP)\src\parse.y lemon.exe
mistachkin44723ce2015-03-21 02:22:37 +00002180 del /Q parse.y parse.h parse.h.temp 2>NUL
mistachkin375b0b02020-05-29 21:06:52 +00002181 copy /Y $(TOP)\src\parse.y .
2182 copy /B parse.y +,,
drhfe03dac2019-11-26 02:22:39 +00002183 .\lemon.exe $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) $(OPTS) -S parse.y
shanehb2f20bf2011-06-17 07:07:24 +00002184
drhf39e0ed2017-08-22 19:19:00 +00002185$(SQLITE3H): $(TOP)\src\sqlite.h.in $(TOP)\manifest mksourceid.exe $(TOP)\VERSION
mistachkin4ef916e2016-08-24 19:58:46 +00002186 $(TCLSH_CMD) $(TOP)\tool\mksqlite3h.tcl $(TOP:\=/) > $(SQLITE3H) $(MKSQLITE3H_ARGS)
shanehb2f20bf2011-06-17 07:07:24 +00002187
mistachkin9b88ace2016-02-26 21:01:37 +00002188sqlite3ext.h: .target_source
mistachkin4ef916e2016-08-24 19:58:46 +00002189!IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
mistachkinc0bebc12016-07-28 18:49:20 +00002190 type tsrc\sqlite3ext.h | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "\(\*\)" "(SQLITE_CALLBACK *)" \
2191 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "\(\*" "(SQLITE_APICALL *" > sqlite3ext.h
mistachkine37f7392016-07-28 19:28:35 +00002192 copy /Y sqlite3ext.h tsrc\sqlite3ext.h
mistachkin4ef916e2016-08-24 19:58:46 +00002193!ELSE
2194 copy /Y tsrc\sqlite3ext.h sqlite3ext.h
mistachkin375b0b02020-05-29 21:06:52 +00002195 copy /B sqlite3ext.h +,,
mistachkin4ef916e2016-08-24 19:58:46 +00002196!ENDIF
mistachkinc978f2d2015-09-21 23:49:35 +00002197
mistachkin375b0b02020-05-29 21:06:52 +00002198sqlite3session.h: $(TOP)\ext\session\sqlite3session.h
2199 copy /Y $(TOP)\ext\session\sqlite3session.h .
2200 copy /B sqlite3session.h +,,
2201
shanehb2f20bf2011-06-17 07:07:24 +00002202mkkeywordhash.exe: $(TOP)\tool\mkkeywordhash.c
mistachkinedcb4eb2016-01-22 01:25:15 +00002203 $(BCC) $(NO_WARN) -Fe$@ $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) $(OPTS) \
mistachkin460cd9c2015-10-14 22:46:37 +00002204 $(TOP)\tool\mkkeywordhash.c /link $(LDFLAGS) $(NLTLINKOPTS) $(NLTLIBPATHS)
shanehb2f20bf2011-06-17 07:07:24 +00002205
2206keywordhash.h: $(TOP)\tool\mkkeywordhash.c mkkeywordhash.exe
mistachkin5b0b6fd2011-06-25 01:14:36 +00002207 .\mkkeywordhash.exe > keywordhash.h
shanehb2f20bf2011-06-17 07:07:24 +00002208
drhaa62d2e2017-10-12 13:47:48 +00002209# Source files that go into making shell.c
2210SHELL_SRC = \
2211 $(TOP)\src\shell.c.in \
mistachkin2d44d552018-03-16 23:53:47 +00002212 $(TOP)\ext\misc\appendvfs.c \
drh8cda77d2020-06-24 15:06:29 +00002213 $(TOP)\ext\misc\completion.c \
mistachkin05de5042021-07-19 03:38:13 +00002214 $(TOP)\ext\misc\decimal.c \
drhaa62d2e2017-10-12 13:47:48 +00002215 $(TOP)\ext\misc\fileio.c \
mistachkin05de5042021-07-19 03:38:13 +00002216 $(TOP)\ext\misc\ieee754.c \
2217 $(TOP)\ext\misc\regexp.c \
2218 $(TOP)\ext\misc\series.c \
drh8cda77d2020-06-24 15:06:29 +00002219 $(TOP)\ext\misc\shathree.c \
mistachkin375b0b02020-05-29 21:06:52 +00002220 $(TOP)\ext\misc\uint.c \
mistachkindfdfd8c2018-01-04 22:46:08 +00002221 $(TOP)\ext\expert\sqlite3expert.c \
drhc9320332018-01-05 16:23:43 +00002222 $(TOP)\ext\expert\sqlite3expert.h \
drh50b910a2019-01-21 14:55:03 +00002223 $(TOP)\ext\misc\memtrace.c \
mistachkin5d7503a2018-01-05 17:12:13 +00002224 $(TOP)\src\test_windirent.c
mistachkin590522c2018-01-05 16:05:51 +00002225
2226# If use of zlib is enabled, add the "zipfile.c" source file.
2227#
2228!IF $(USE_ZLIB)!=0
mistachkin5d7503a2018-01-05 17:12:13 +00002229SHELL_SRC = $(SHELL_SRC) $(TOP)\ext\misc\sqlar.c
mistachkin590522c2018-01-05 16:05:51 +00002230SHELL_SRC = $(SHELL_SRC) $(TOP)\ext\misc\zipfile.c
2231!ENDIF
drhaa62d2e2017-10-12 13:47:48 +00002232
mistachkin835cd432017-10-14 19:54:06 +00002233shell.c: $(SHELL_SRC) $(TOP)\tool\mkshellc.tcl
2234 $(TCLSH_CMD) $(TOP)\tool\mkshellc.tcl > shell.c
shanehb2f20bf2011-06-17 07:07:24 +00002235
mistachkincb6acda2017-12-05 18:54:12 +00002236zlib:
mistachkin11522502018-01-05 01:00:17 +00002237 pushd $(ZLIBDIR) && $(MAKE) /f win32\Makefile.msc clean $(ZLIBLIB) && popd
shanehb2f20bf2011-06-17 07:07:24 +00002238
2239# Rules to build the extension objects.
2240#
2241icu.lo: $(TOP)\ext\icu\icu.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002242 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\icu\icu.c
shanehb2f20bf2011-06-17 07:07:24 +00002243
2244fts2.lo: $(TOP)\ext\fts2\fts2.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002245 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2.c
shanehb2f20bf2011-06-17 07:07:24 +00002246
2247fts2_hash.lo: $(TOP)\ext\fts2\fts2_hash.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002248 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_hash.c
shanehb2f20bf2011-06-17 07:07:24 +00002249
2250fts2_icu.lo: $(TOP)\ext\fts2\fts2_icu.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002251 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_icu.c
shanehb2f20bf2011-06-17 07:07:24 +00002252
2253fts2_porter.lo: $(TOP)\ext\fts2\fts2_porter.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002254 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_porter.c
shanehb2f20bf2011-06-17 07:07:24 +00002255
2256fts2_tokenizer.lo: $(TOP)\ext\fts2\fts2_tokenizer.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002257 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_tokenizer.c
shanehb2f20bf2011-06-17 07:07:24 +00002258
2259fts2_tokenizer1.lo: $(TOP)\ext\fts2\fts2_tokenizer1.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002260 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_tokenizer1.c
shanehb2f20bf2011-06-17 07:07:24 +00002261
2262fts3.lo: $(TOP)\ext\fts3\fts3.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002263 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3.c
shanehb2f20bf2011-06-17 07:07:24 +00002264
2265fts3_aux.lo: $(TOP)\ext\fts3\fts3_aux.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002266 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_aux.c
shanehb2f20bf2011-06-17 07:07:24 +00002267
2268fts3_expr.lo: $(TOP)\ext\fts3\fts3_expr.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002269 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_expr.c
shanehb2f20bf2011-06-17 07:07:24 +00002270
2271fts3_hash.lo: $(TOP)\ext\fts3\fts3_hash.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002272 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_hash.c
shanehb2f20bf2011-06-17 07:07:24 +00002273
2274fts3_icu.lo: $(TOP)\ext\fts3\fts3_icu.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002275 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_icu.c
shanehb2f20bf2011-06-17 07:07:24 +00002276
2277fts3_snippet.lo: $(TOP)\ext\fts3\fts3_snippet.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002278 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_snippet.c
shanehb2f20bf2011-06-17 07:07:24 +00002279
2280fts3_porter.lo: $(TOP)\ext\fts3\fts3_porter.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002281 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_porter.c
shanehb2f20bf2011-06-17 07:07:24 +00002282
2283fts3_tokenizer.lo: $(TOP)\ext\fts3\fts3_tokenizer.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002284 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenizer.c
shanehb2f20bf2011-06-17 07:07:24 +00002285
2286fts3_tokenizer1.lo: $(TOP)\ext\fts3\fts3_tokenizer1.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002287 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenizer1.c
shanehb2f20bf2011-06-17 07:07:24 +00002288
drh4d648c72013-04-22 17:07:56 +00002289fts3_tokenize_vtab.lo: $(TOP)\ext\fts3\fts3_tokenize_vtab.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002290 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenize_vtab.c
drh4d648c72013-04-22 17:07:56 +00002291
drh391d4ba2012-05-28 20:22:16 +00002292fts3_unicode.lo: $(TOP)\ext\fts3\fts3_unicode.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002293 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_unicode.c
drh391d4ba2012-05-28 20:22:16 +00002294
2295fts3_unicode2.lo: $(TOP)\ext\fts3\fts3_unicode2.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002296 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_unicode2.c
drh391d4ba2012-05-28 20:22:16 +00002297
shanehb2f20bf2011-06-17 07:07:24 +00002298fts3_write.lo: $(TOP)\ext\fts3\fts3_write.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002299 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_write.c
shanehb2f20bf2011-06-17 07:07:24 +00002300
mistachkin90d6f482018-09-12 00:48:17 +00002301json1.lo: $(TOP)\ext\misc\json1.c $(HDR) $(EXTHDR)
2302 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\misc\json1.c
2303
2304stmt.lo: $(TOP)\ext\misc\stmt.c $(HDR) $(EXTHDR)
2305 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\misc\stmt.c
2306
shanehb2f20bf2011-06-17 07:07:24 +00002307rtree.lo: $(TOP)\ext\rtree\rtree.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002308 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\rtree\rtree.c
shanehb2f20bf2011-06-17 07:07:24 +00002309
mistachkin4f2c8222016-04-11 22:23:04 +00002310sqlite3session.lo: $(TOP)\ext\session\sqlite3session.c $(HDR) $(EXTHDR)
mistachkin05004782016-03-30 16:23:06 +00002311 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\session\sqlite3session.c
drh498dcae2013-03-13 11:42:00 +00002312
mistachkined52f9f2015-06-26 04:34:36 +00002313# FTS5 things
2314#
2315FTS5_SRC = \
2316 $(TOP)\ext\fts5\fts5.h \
2317 $(TOP)\ext\fts5\fts5Int.h \
2318 $(TOP)\ext\fts5\fts5_aux.c \
2319 $(TOP)\ext\fts5\fts5_buffer.c \
2320 $(TOP)\ext\fts5\fts5_main.c \
2321 $(TOP)\ext\fts5\fts5_config.c \
2322 $(TOP)\ext\fts5\fts5_expr.c \
2323 $(TOP)\ext\fts5\fts5_hash.c \
2324 $(TOP)\ext\fts5\fts5_index.c \
2325 fts5parse.c fts5parse.h \
2326 $(TOP)\ext\fts5\fts5_storage.c \
2327 $(TOP)\ext\fts5\fts5_tokenize.c \
2328 $(TOP)\ext\fts5\fts5_unicode2.c \
2329 $(TOP)\ext\fts5\fts5_varint.c \
2330 $(TOP)\ext\fts5\fts5_vocab.c
2331
mistachkin3384ccb2017-12-13 22:42:55 +00002332LSM1_SRC = \
2333 $(TOP)\ext\lsm1\lsm.h \
2334 $(TOP)\ext\lsm1\lsmInt.h \
2335 $(TOP)\ext\lsm1\lsm_ckpt.c \
2336 $(TOP)\ext\lsm1\lsm_file.c \
2337 $(TOP)\ext\lsm1\lsm_log.c \
2338 $(TOP)\ext\lsm1\lsm_main.c \
2339 $(TOP)\ext\lsm1\lsm_mem.c \
2340 $(TOP)\ext\lsm1\lsm_mutex.c \
2341 $(TOP)\ext\lsm1\lsm_shared.c \
2342 $(TOP)\ext\lsm1\lsm_sorted.c \
2343 $(TOP)\ext\lsm1\lsm_str.c \
2344 $(TOP)\ext\lsm1\lsm_tree.c \
2345 $(TOP)\ext\lsm1\lsm_unix.c \
2346 $(TOP)\ext\lsm1\lsm_varint.c \
2347 $(TOP)\ext\lsm1\lsm_vtab.c \
2348 $(TOP)\ext\lsm1\lsm_win32.c
2349
mistachkined52f9f2015-06-26 04:34:36 +00002350fts5parse.c: $(TOP)\ext\fts5\fts5parse.y lemon.exe
mistachkin375b0b02020-05-29 21:06:52 +00002351 copy /Y $(TOP)\ext\fts5\fts5parse.y .
2352 copy /B fts5parse.y +,,
mistachkined52f9f2015-06-26 04:34:36 +00002353 del /Q fts5parse.h 2>NUL
drhfe03dac2019-11-26 02:22:39 +00002354 .\lemon.exe $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) $(OPTS) -S fts5parse.y
mistachkined52f9f2015-06-26 04:34:36 +00002355
mistachkin9b88ace2016-02-26 21:01:37 +00002356fts5parse.h: fts5parse.c
mistachkined52f9f2015-06-26 04:34:36 +00002357
mistachkin9b88ace2016-02-26 21:01:37 +00002358fts5.c: $(FTS5_SRC)
mistachkined52f9f2015-06-26 04:34:36 +00002359 $(TCLSH_CMD) $(TOP)\ext\fts5\tool\mkfts5c.tcl
mistachkin375b0b02020-05-29 21:06:52 +00002360 copy /Y $(TOP)\ext\fts5\fts5.h .
2361 copy /B fts5.h +,,
mistachkined52f9f2015-06-26 04:34:36 +00002362
mistachkin3384ccb2017-12-13 22:42:55 +00002363lsm1.c: $(LSM1_SRC)
2364 $(TCLSH_CMD) $(TOP)\ext\lsm1\tool\mklsm1c.tcl
mistachkin375b0b02020-05-29 21:06:52 +00002365 copy /Y $(TOP)\ext\lsm1\lsm.h .
2366 copy /B lsm.h +,,
mistachkin3384ccb2017-12-13 22:42:55 +00002367
mistachkined52f9f2015-06-26 04:34:36 +00002368fts5.lo: fts5.c $(HDR) $(EXTHDR)
mistachkin95ae9582015-06-26 20:45:43 +00002369 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c fts5.c
2370
2371fts5_ext.lo: fts5.c $(HDR) $(EXTHDR)
mistachkinae6ca8e2015-07-02 16:50:43 +00002372 $(LTCOMPILE) $(NO_WARN) -c fts5.c
shanehb2f20bf2011-06-17 07:07:24 +00002373
mistachkin95ae9582015-06-26 20:45:43 +00002374fts5.dll: fts5_ext.lo
2375 $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /OUT:$@ fts5_ext.lo
shanehb2f20bf2011-06-17 07:07:24 +00002376
mistachkin83a22532016-01-14 18:01:16 +00002377sqlite3rbu.lo: $(TOP)\ext\rbu\sqlite3rbu.c $(HDR) $(EXTHDR)
2378 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\rbu\sqlite3rbu.c
drh76473772016-01-14 13:22:24 +00002379
shanehb2f20bf2011-06-17 07:07:24 +00002380# Rules to build the 'testfixture' application.
2381#
2382# If using the amalgamation, use sqlite3.c directly to build the test
2383# fixture. Otherwise link against libsqlite3.lib. (This distinction is
2384# necessary because the test fixture requires non-API symbols which are
2385# hidden when the library is built via the amalgamation).
2386#
drh96a206f2017-10-13 20:14:06 +00002387TESTFIXTURE_FLAGS = -DTCLSH_INIT_PROC=sqlite3TestInit -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
mistachkin27b2f052015-01-12 19:49:46 +00002388TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_SERVER=1 -DSQLITE_PRIVATE=""
2389TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_CORE $(NO_WARN)
drhdbc49162016-03-02 03:28:07 +00002390TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_SERIES_CONSTRAINT_VERIFY=1
drh9878fef2016-03-04 03:43:10 +00002391TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_DEFAULT_PAGE_SIZE=1024
mistachkin90d6f482018-09-12 00:48:17 +00002392TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_ENABLE_STMTVTAB=1
2393TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_ENABLE_DBPAGE_VTAB=1
drh691b5c52020-03-23 15:49:22 +00002394TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_ENABLE_BYTECODE_VTAB=1
mistachkin90d6f482018-09-12 00:48:17 +00002395TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_ENABLE_JSON1=1
danc30b78f2020-11-18 18:36:43 +00002396TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_CKSUMVFS_STATIC=1
mistachkin69def7f2016-07-28 04:14:37 +00002397TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) $(TEST_CCONV_OPTS)
shanehb2f20bf2011-06-17 07:07:24 +00002398
mistachkinc04c54b2016-02-11 21:28:16 +00002399TESTFIXTURE_SRC0 = $(TESTEXT) $(TESTSRC2)
mistachkin05004782016-03-30 16:23:06 +00002400TESTFIXTURE_SRC1 = $(TESTEXT) $(SQLITE3C)
shanehb2f20bf2011-06-17 07:07:24 +00002401!IF $(USE_AMALGAMATION)==0
2402TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC0)
2403!ELSE
2404TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC1)
2405!ENDIF
2406
mistachkin4ef916e2016-08-24 19:58:46 +00002407!IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
mistachkin52b1dbb2016-07-28 14:37:04 +00002408sqlite_tclDecls.h:
mistachkin4ef916e2016-08-24 19:58:46 +00002409 echo #ifndef SQLITE_TCLAPI > $(SQLITETCLDECLSH)
2410 echo # define SQLITE_TCLAPI >> $(SQLITETCLDECLSH)
2411 echo #endif >> $(SQLITETCLDECLSH)
mistachkinf27a80c2016-07-28 16:09:52 +00002412 type "$(TCLINCDIR)\tclDecls.h" \
mistachkina121cc72016-07-28 18:06:52 +00002413 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "^(EXTERN(?: CONST\d+?)?\s+?[^\(]*?\s+?)Tcl_" "\1 SQLITE_TCLAPI Tcl_" \
mistachkinf27a80c2016-07-28 16:09:52 +00002414 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "^(EXTERN\s+?(?:void|VOID)\s+?)TclFreeObj" "\1 SQLITE_TCLAPI TclFreeObj" \
2415 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "\(\*tcl_" "(SQLITE_TCLAPI *tcl_" \
mistachkin7c60b262016-07-28 18:18:53 +00002416 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "\(\*tclFreeObj" "(SQLITE_TCLAPI *tclFreeObj" \
mistachkin4ef916e2016-08-24 19:58:46 +00002417 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "\(\*" "(SQLITE_TCLAPI *" >> $(SQLITETCLDECLSH)
mistachkin52b1dbb2016-07-28 14:37:04 +00002418
mistachkin4ef916e2016-08-24 19:58:46 +00002419sqlite_tcl.h:
mistachkinf27a80c2016-07-28 16:09:52 +00002420 type "$(TCLINCDIR)\tcl.h" | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact tclDecls.h sqlite_tclDecls.h \
2421 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "typedef (.*?)\(Tcl_" "typedef \1 (SQLITE_TCLAPI Tcl_" \
2422 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact "void (*freeProc)" "void (SQLITE_TCLAPI *freeProc)" \
2423 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact "Tcl_HashEntry *(*findProc)" "Tcl_HashEntry *(SQLITE_TCLAPI *findProc)" \
mistachkin4ef916e2016-08-24 19:58:46 +00002424 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact "Tcl_HashEntry *(*createProc)" "Tcl_HashEntry *(SQLITE_TCLAPI *createProc)" >> $(SQLITETCLH)
2425!ENDIF
mistachkin52b1dbb2016-07-28 14:37:04 +00002426
mistachkin5d7503a2018-01-05 17:12:13 +00002427testfixture.exe: $(TESTFIXTURE_SRC) $(TESTFIXTURE_DEP) $(SQLITE3H) $(LIBRESOBJS) $(HDR) $(SQLITE_TCL_DEP)
shaneh6e7850c2011-06-17 15:57:07 +00002428 $(LTLINK) -DSQLITE_NO_SYNC=1 $(TESTFIXTURE_FLAGS) \
shanehb2f20bf2011-06-17 07:07:24 +00002429 -DBUILD_sqlite -I$(TCLINCDIR) \
shaneh2a0b9ef2011-06-20 20:52:32 +00002430 $(TESTFIXTURE_SRC) \
mistachkin590522c2018-01-05 16:05:51 +00002431 /link $(LDFLAGS) $(LTLINKOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) $(LIBRESOBJS) $(TCLLIBS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00002432
mistachkin9b88ace2016-02-26 21:01:37 +00002433extensiontest: testfixture.exe testloadext.dll
mistachkin88739962015-10-14 23:04:08 +00002434 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00002435 .\testfixture.exe $(TOP)\test\loadext.test $(TESTOPTS)
mistachkin1925a2e2014-02-24 21:20:25 +00002436
mistachkin8bee11a2018-10-29 17:53:23 +00002437coretestprogs: $(TESTPROGS)
2438
2439testprogs: coretestprogs srcck1.exe fuzzcheck.exe sessionfuzz.exe
2440
dan867bc4d2021-10-07 19:27:17 +00002441fulltest: alltest fuzztest
2442
2443alltest: $(TESTPROGS)
mistachkin88739962015-10-14 23:04:08 +00002444 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00002445 .\testfixture.exe $(TOP)\test\all.test $(TESTOPTS)
shanehb2f20bf2011-06-17 07:07:24 +00002446
drhea93c702015-05-26 18:15:08 +00002447soaktest: $(TESTPROGS)
mistachkin88739962015-10-14 23:04:08 +00002448 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00002449 .\testfixture.exe $(TOP)\test\all.test -soak=1 $(TESTOPTS)
shanehb2f20bf2011-06-17 07:07:24 +00002450
drhf4375442015-05-11 12:15:45 +00002451fulltestonly: $(TESTPROGS) fuzztest
mistachkin88739962015-10-14 23:04:08 +00002452 @set PATH=$(LIBTCLPATH);$(PATH)
mistachkinc60941f2012-09-13 01:51:02 +00002453 .\testfixture.exe $(TOP)\test\full.test
2454
mistachkinedcb4eb2016-01-22 01:25:15 +00002455queryplantest: testfixture.exe shell
mistachkin88739962015-10-14 23:04:08 +00002456 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00002457 .\testfixture.exe $(TOP)\test\permutations.test queryplanner $(TESTOPTS)
mistachkin036acf32013-07-20 00:34:31 +00002458
drhea93c702015-05-26 18:15:08 +00002459fuzztest: fuzzcheck.exe
2460 .\fuzzcheck.exe $(FUZZDATA)
drhf3320712015-04-25 13:39:29 +00002461
drh905da632015-06-10 18:53:09 +00002462# Minimal testing that runs in less than 3 minutes (on a fast machine)
2463#
drhfd0d93f2016-02-07 00:08:08 +00002464quicktest: testfixture.exe sourcetest
mistachkin88739962015-10-14 23:04:08 +00002465 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00002466 .\testfixture.exe $(TOP)\test\extraquick.test $(TESTOPTS)
2467
2468# This is the common case. Run many tests that do not take too long,
2469# including fuzzcheck, sqlite3_analyzer, and sqldiff tests.
2470#
dan622bd632021-11-24 11:33:01 +00002471test: $(TESTPROGS) sourcetest fuzztest tcltest
2472
2473# The veryquick.test TCL tests.
2474#
2475tcltest: testfixture.exe
mistachkin88739962015-10-14 23:04:08 +00002476 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00002477 .\testfixture.exe $(TOP)\test\veryquick.test $(TESTOPTS)
shanehb2f20bf2011-06-17 07:07:24 +00002478
drhea93c702015-05-26 18:15:08 +00002479smoketest: $(TESTPROGS)
mistachkin88739962015-10-14 23:04:08 +00002480 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00002481 .\testfixture.exe $(TOP)\test\main.test $(TESTOPTS)
mistachkin00eb70d2015-04-04 00:02:07 +00002482
drh02c17a42020-05-29 19:45:03 +00002483shelltest: $(TESTPROGS)
2484 .\testfixture.exe $(TOP)\test\permutations.test shell
2485
drh903b2302017-10-13 18:58:55 +00002486sqlite3_analyzer.c: $(SQLITE3C) $(SQLITE3H) $(TOP)\src\tclsqlite.c $(TOP)\tool\spaceanal.tcl $(TOP)\tool\mkccode.tcl $(TOP)\tool\sqlite3_analyzer.c.in $(SQLITE_TCL_DEP)
2487 $(TCLSH_CMD) $(TOP)\tool\mkccode.tcl $(TOP)\tool\sqlite3_analyzer.c.in > $@
shanehb2f20bf2011-06-17 07:07:24 +00002488
mistachkin08c1c312012-10-06 03:48:25 +00002489sqlite3_analyzer.exe: sqlite3_analyzer.c $(LIBRESOBJS)
mistachkind4ab1032015-05-11 16:27:33 +00002490 $(LTLINK) $(NO_WARN) -DBUILD_sqlite -I$(TCLINCDIR) sqlite3_analyzer.c \
mistachkin590522c2018-01-05 16:05:51 +00002491 /link $(LDFLAGS) $(LTLINKOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) $(LIBRESOBJS) $(TCLLIBS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00002492
mistachkin5e6f7822018-01-06 14:44:29 +00002493sqltclsh.c: sqlite3.c $(TOP)\src\tclsqlite.c $(TOP)\tool\sqltclsh.tcl $(TOP)\ext\misc\appendvfs.c $(TOP)\tool\mkccode.tcl $(TOP)\tool\sqltclsh.c.in
drh9dea1732018-01-06 04:34:05 +00002494 $(TCLSH_CMD) $(TOP)\tool\mkccode.tcl $(TOP)\tool\sqltclsh.c.in >sqltclsh.c
2495
mistachkin98dfb2f2018-01-08 14:24:08 +00002496sqltclsh.exe: sqltclsh.c $(SHELL_CORE_DEP) $(LIBRESOBJS)
drh9dea1732018-01-06 04:34:05 +00002497 $(LTLINK) $(NO_WARN) -DBUILD_sqlite -I$(TCLINCDIR) sqltclsh.c \
mistachkin0476b952018-01-06 14:43:33 +00002498 /link $(LDFLAGS) $(LTLINKOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) $(LIBRESOBJS) $(TCLLIBS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00002499
drhbd0f1db2017-05-03 12:50:46 +00002500sqlite3_expert.exe: $(SQLITE3C) $(TOP)\ext\expert\sqlite3expert.h $(TOP)\ext\expert\sqlite3expert.c $(TOP)\ext\expert\expert.c
2501 $(LTLINK) $(NO_WARN) $(TOP)\ext\expert\sqlite3expert.c $(TOP)\ext\expert\expert.c $(SQLITE3C) $(TLIBS)
2502
drh2737fa02017-10-31 15:49:19 +00002503CHECKER_DEPS =\
2504 $(TOP)/tool/mkccode.tcl \
2505 sqlite3.c \
2506 $(TOP)/src/tclsqlite.c \
2507 $(TOP)/ext/repair/sqlite3_checker.tcl \
2508 $(TOP)/ext/repair/checkindex.c \
drh927dd512017-10-31 18:09:40 +00002509 $(TOP)/ext/repair/checkfreelist.c \
drh2737fa02017-10-31 15:49:19 +00002510 $(TOP)/ext/misc/btreeinfo.c \
2511 $(TOP)/ext/repair/sqlite3_checker.c.in
2512
2513sqlite3_checker.c: $(CHECKER_DEPS)
drh2091f0f2017-10-31 15:55:48 +00002514 $(TCLSH_CMD) $(TOP)\tool\mkccode.tcl $(TOP)\ext\repair\sqlite3_checker.c.in > $@
drh2737fa02017-10-31 15:49:19 +00002515
2516sqlite3_checker.exe: sqlite3_checker.c $(LIBRESOBJS)
2517 $(LTLINK) $(NO_WARN) -DBUILD_sqlite -I$(TCLINCDIR) sqlite3_checker.c \
mistachkin370732a2018-01-05 19:25:52 +00002518 /link $(LDFLAGS) $(LTLINKOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) $(LIBRESOBJS) $(TCLLIBS) $(LTLIBS) $(TLIBS)
drh2737fa02017-10-31 15:49:19 +00002519
mistachkinac8ba262018-03-07 14:42:17 +00002520dbdump.exe: $(TOP)\ext\misc\dbdump.c $(SQLITE3C) $(SQLITE3H) $(LIBRESOBJS)
mistachkin943d8252017-03-14 15:27:56 +00002521 $(LTLINK) $(NO_WARN) -DDBDUMP_STANDALONE $(TOP)\ext\misc\dbdump.c $(SQLITE3C) \
2522 /link $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS)
drh4b34eb32017-03-13 22:02:01 +00002523
mistachkinac8ba262018-03-07 14:42:17 +00002524testloadext.lo: $(TOP)\src\test_loadext.c $(SQLITE3H)
mistachkin44723ce2015-03-21 02:22:37 +00002525 $(LTCOMPILE) $(NO_WARN) -c $(TOP)\src\test_loadext.c
mistachkin1925a2e2014-02-24 21:20:25 +00002526
mistachkin9b88ace2016-02-26 21:01:37 +00002527testloadext.dll: testloadext.lo
mistachkin1925a2e2014-02-24 21:20:25 +00002528 $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /OUT:$@ testloadext.lo
2529
drh33746482018-12-13 15:06:26 +00002530dbtotxt.exe: $(TOP)\tool\dbtotxt.c
2531 $(LTLINK) $(NO_WARN) $(TOP)\tool\dbtotxt.c /link $(LDFLAGS) $(LTLINKOPTS)
2532
mistachkin5d4d9412016-01-22 03:54:36 +00002533showdb.exe: $(TOP)\tool\showdb.c $(SQLITE3C) $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002534 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
mistachkin78e3f612015-10-14 20:01:12 +00002535 $(TOP)\tool\showdb.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh9ac3c1e2013-11-07 18:37:31 +00002536
mistachkin5d4d9412016-01-22 03:54:36 +00002537showstat4.exe: $(TOP)\tool\showstat4.c $(SQLITE3C) $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002538 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
mistachkin78e3f612015-10-14 20:01:12 +00002539 $(TOP)\tool\showstat4.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh4bb77ec2014-06-30 11:14:26 +00002540
mistachkin5d4d9412016-01-22 03:54:36 +00002541showjournal.exe: $(TOP)\tool\showjournal.c $(SQLITE3C) $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002542 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
mistachkin78e3f612015-10-14 20:01:12 +00002543 $(TOP)\tool\showjournal.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh4bb77ec2014-06-30 11:14:26 +00002544
mistachkin5d4d9412016-01-22 03:54:36 +00002545showwal.exe: $(TOP)\tool\showwal.c $(SQLITE3C) $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002546 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
mistachkin78e3f612015-10-14 20:01:12 +00002547 $(TOP)\tool\showwal.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh4bb77ec2014-06-30 11:14:26 +00002548
drh666fb692017-10-30 23:25:06 +00002549showshm.exe: $(TOP)\tool\showshm.c
2550 $(LTLINK) $(NO_WARN) $(TOP)\tool\showshm.c /link $(LDFLAGS) $(LTLINKOPTS)
2551
drh731dd6e2018-12-04 16:51:42 +00002552index_usage.exe: $(TOP)\tool\index_usage.c $(SQLITE3C) $(SQLITE3H)
2553 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
2554 $(TOP)\tool\index_usage.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
2555
mistachkin953fbd12017-02-07 21:09:34 +00002556changeset.exe: $(TOP)\ext\session\changeset.c $(SQLITE3C) $(SQLITE3H)
2557 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
2558 -DSQLITE_ENABLE_SESSION=1 -DSQLITE_ENABLE_PREUPDATE_HOOK=1 \
mistachkin05004782016-03-30 16:23:06 +00002559 $(TOP)\ext\session\changeset.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh9f674f22014-08-18 20:23:29 +00002560
danf095a1a2018-11-05 20:37:33 +00002561changesetfuzz.exe: $(TOP)\ext\session\changesetfuzz.c $(SQLITE3C) $(SQLITE3H)
2562 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
2563 -DSQLITE_ENABLE_SESSION=1 -DSQLITE_ENABLE_PREUPDATE_HOOK=1 \
2564 $(TOP)\ext\session\changesetfuzz.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
2565
mistachkin5d4d9412016-01-22 03:54:36 +00002566fts3view.exe: $(TOP)\ext\fts3\tool\fts3view.c $(SQLITE3C) $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002567 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
mistachkin78e3f612015-10-14 20:01:12 +00002568 $(TOP)\ext\fts3\tool\fts3view.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
mistachkinde545272014-07-07 17:57:50 +00002569
mistachkin5d4d9412016-01-22 03:54:36 +00002570rollback-test.exe: $(TOP)\tool\rollback-test.c $(SQLITE3C) $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002571 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
mistachkin78e3f612015-10-14 20:01:12 +00002572 $(TOP)\tool\rollback-test.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh4bb77ec2014-06-30 11:14:26 +00002573
drh355f2e02018-08-23 20:09:19 +00002574atrc.exe: $(TOP)\test\atrc.c $(SQLITE3C) $(SQLITE3H)
2575 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
2576 $(TOP)\test\atrc.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
2577
mistachkin5d4d9412016-01-22 03:54:36 +00002578LogEst.exe: $(TOP)\tool\logest.c $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002579 $(LTLINK) $(NO_WARN) $(TOP)\tool\LogEst.c /link $(LDFLAGS) $(LTLINKOPTS)
drh267a13f2014-06-18 18:10:12 +00002580
mistachkin5d4d9412016-01-22 03:54:36 +00002581wordcount.exe: $(TOP)\test\wordcount.c $(SQLITE3C) $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002582 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
mistachkin78e3f612015-10-14 20:01:12 +00002583 $(TOP)\test\wordcount.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh9ac3c1e2013-11-07 18:37:31 +00002584
mistachkin5d4d9412016-01-22 03:54:36 +00002585speedtest1.exe: $(TOP)\test\speedtest1.c $(SQLITE3C) $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002586 $(LTLINK) $(NO_WARN) $(ST_COMPILE_OPTS) -DSQLITE_OMIT_LOAD_EXTENSION \
mistachkin78e3f612015-10-14 20:01:12 +00002587 $(TOP)\test\speedtest1.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
mistachkinb482a442012-02-11 22:19:26 +00002588
mistachkin953fbd12017-02-07 21:09:34 +00002589kvtest.exe: $(TOP)\test\kvtest.c $(SQLITE3C) $(SQLITE3H)
2590 $(LTLINK) $(NO_WARN) $(KV_COMPILE_OPTS) \
2591 $(TOP)\test\kvtest.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
2592
mistachkin9b88ace2016-02-26 21:01:37 +00002593rbu.exe: $(TOP)\ext\rbu\rbu.c $(TOP)\ext\rbu\sqlite3rbu.c $(SQLITE3C) $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002594 $(LTLINK) $(NO_WARN) -DSQLITE_ENABLE_RBU \
mistachkin5d4d9412016-01-22 03:54:36 +00002595 $(TOP)\ext\rbu\rbu.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
mistachkin9b88ace2016-02-26 21:01:37 +00002596
mistachkinf5b70d02021-07-20 00:18:22 +00002597THREADTEST3_SRC = \
2598 $(TOP)\test\threadtest3.c \
2599 $(TOP)\test\tt3_checkpoint.c \
2600 $(TOP)\test\tt3_index.c \
2601 $(TOP)\test\tt3_vacuum.c \
2602 $(TOP)\test\tt3_stress.c \
2603 $(TOP)\test\tt3_lookaside1.c
danbb2d2a52021-07-19 16:49:13 +00002604
mistachkinf5b70d02021-07-20 00:18:22 +00002605threadtest3.exe: $(THREADTEST3_SRC) $(TOP)\src\test_multiplex.c $(SQLITE3C) $(SQLITE3H)
2606 $(LTLINK) $(NO_WARN) $(TOP)\test\threadtest3.c $(TOP)\src\test_multiplex.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
danbb2d2a52021-07-19 16:49:13 +00002607
mistachkin02679b02017-06-27 05:59:47 +00002608LSMDIR=$(TOP)\ext\lsm1
2609!INCLUDE $(LSMDIR)\Makefile.msc
2610
mistachkin9b88ace2016-02-26 21:01:37 +00002611moreclean: clean
2612 del /Q $(SQLITE3C) $(SQLITE3H) 2>NUL
mistachkin3e786092016-01-23 07:53:04 +00002613# <</mark>>
drh76473772016-01-14 13:22:24 +00002614
shaneh6e7850c2011-06-17 15:57:07 +00002615clean:
mistachkin8dd3ff12015-05-16 03:41:41 +00002616 del /Q *.exp *.lo *.ilk *.lib *.obj *.ncb *.pdb *.sdf *.suo 2>NUL
mistachkin56362a52016-02-19 19:03:04 +00002617 del /Q *.bsc *.def *.cod *.da *.bb *.bbg *.vc gmon.out 2>NUL
mistachkinfe41a982016-02-27 00:21:44 +00002618 del /Q $(SQLITE3EXE) $(SQLITE3DLL) Replace.exe 2>NUL
mistachkin3e786092016-01-23 07:53:04 +00002619# <<mark>>
mistachkine2bcbb42019-03-22 01:25:16 +00002620 del /Q $(SQLITE3TCLDLL) pkgIndex.tcl 2>NUL
mistachkin9b88ace2016-02-26 21:01:37 +00002621 del /Q opcodes.c opcodes.h 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002622 del /Q lemon.* lempar.c parse.* 2>NUL
mistachkin050dc5c2017-09-04 18:44:54 +00002623 del /Q mksourceid.* mkkeywordhash.* keywordhash.h 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002624 del /Q notasharedlib.* 2>NUL
2625 -rmdir /Q/S .deps 2>NUL
2626 -rmdir /Q/S .libs 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002627 -rmdir /Q/S tsrc 2>NUL
2628 del /Q .target_source 2>NUL
mistachkin4ef916e2016-08-24 19:58:46 +00002629 del /Q tclsqlite3.exe $(SQLITETCLH) $(SQLITETCLDECLSH) 2>NUL
mistachkina2d85cb2017-07-07 19:02:51 +00002630 del /Q lsm.dll lsmtest.exe 2>NUL
mistachkin4e2d3d42019-04-01 03:07:21 +00002631 del /Q atrc.exe changesetfuzz.exe dbtotxt.exe index_usage.exe 2>NUL
mistachkin44723ce2015-03-21 02:22:37 +00002632 del /Q testloadext.dll 2>NUL
2633 del /Q testfixture.exe test.db 2>NUL
mistachkin943d8252017-03-14 15:27:56 +00002634 del /Q LogEst.exe fts3view.exe rollback-test.exe showdb.exe dbdump.exe 2>NUL
drhedea9112015-03-24 19:02:13 +00002635 del /Q changeset.exe 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002636 del /Q showjournal.exe showstat4.exe showwal.exe speedtest1.exe 2>NUL
mistachkin27b69972016-02-07 20:39:27 +00002637 del /Q mptester.exe wordcount.exe rbu.exe srcck1.exe 2>NUL
mistachkin1f237e32018-07-27 20:45:28 +00002638 del /Q sqlite3.c sqlite3-*.c sqlite3.h 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002639 del /Q sqlite3rc.h 2>NUL
mistachkin27799892016-03-31 22:53:37 +00002640 del /Q shell.c sqlite3ext.h sqlite3session.h 2>NUL
mistachkin44723ce2015-03-21 02:22:37 +00002641 del /Q sqlite3_analyzer.exe sqlite3_analyzer.c 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002642 del /Q sqlite-*-output.vsix 2>NUL
drh290fcaa2016-06-08 01:03:05 +00002643 del /Q fuzzershell.exe fuzzcheck.exe sqldiff.exe dbhash.exe 2>NUL
mistachkinb649be32018-03-07 14:53:36 +00002644 del /Q sqltclsh.* 2>NUL
mistachkinf5b70d02021-07-20 00:18:22 +00002645 del /Q dbfuzz.exe sessionfuzz.exe threadtest3.exe 2>NUL
mistachkinac8ba262018-03-07 14:42:17 +00002646 del /Q kvtest.exe ossshell.exe scrub.exe 2>NUL
mistachkinb649be32018-03-07 14:53:36 +00002647 del /Q showshm.exe sqlite3_checker.* sqlite3_expert.exe 2>NUL
mistachkinbc50bb72015-07-14 21:56:53 +00002648 del /Q fts5.* fts5parse.* 2>NUL
mistachkin3384ccb2017-12-13 22:42:55 +00002649 del /Q lsm.h lsm1.c 2>NUL
mistachkin3e786092016-01-23 07:53:04 +00002650# <</mark>>