blob: d0b7860d9027be315a2670756bf0b02483dc7659 [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
mistachkin8bcd3fa2013-08-29 01:03:38 +0000237# Enable use of available compiler optimizations? Normally, this should be
238# non-zero. Setting this to zero, thus disabling all compiler optimizations,
239# can be useful for testing.
240#
241!IFNDEF OPTIMIZATIONS
242OPTIMIZATIONS = 2
243!ENDIF
244
mistachkin12b35ea2016-05-03 19:40:54 +0000245# Set this to non-0 to enable support for the session extension.
246#
247!IFNDEF SESSION
248SESSION = 0
249!ENDIF
250
mistachkine99cb2d2019-12-20 17:41:15 +0000251# Set this to non-0 to enable support for the rbu extension.
252#
253!IFNDEF RBU
254RBU = 0
255!ENDIF
256
mistachkin5d4d9412016-01-22 03:54:36 +0000257# Set the source code file to be used by executables and libraries when
258# they need the amalgamation.
259#
260!IFNDEF SQLITE3C
261!IF $(SPLIT_AMALGAMATION)!=0
262SQLITE3C = sqlite3-all.c
263!ELSE
264SQLITE3C = sqlite3.c
265!ENDIF
266!ENDIF
267
268# Set the include code file to be used by executables and libraries when
269# they need SQLite.
270#
271!IFNDEF SQLITE3H
272SQLITE3H = sqlite3.h
273!ENDIF
274
mistachkinedcb4eb2016-01-22 01:25:15 +0000275# This is the name to use for the SQLite dynamic link library (DLL).
276#
277!IFNDEF SQLITE3DLL
mistachkinb0c99af2016-02-19 05:07:56 +0000278!IF $(FOR_WIN10)!=0
279SQLITE3DLL = winsqlite3.dll
280!ELSE
mistachkinedcb4eb2016-01-22 01:25:15 +0000281SQLITE3DLL = sqlite3.dll
282!ENDIF
mistachkinb0c99af2016-02-19 05:07:56 +0000283!ENDIF
mistachkinedcb4eb2016-01-22 01:25:15 +0000284
285# This is the name to use for the SQLite import library (LIB).
286#
287!IFNDEF SQLITE3LIB
mistachkinb0c99af2016-02-19 05:07:56 +0000288!IF $(FOR_WIN10)!=0
289SQLITE3LIB = winsqlite3.lib
290!ELSE
mistachkinedcb4eb2016-01-22 01:25:15 +0000291SQLITE3LIB = sqlite3.lib
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 shell executable (EXE).
296#
297!IFNDEF SQLITE3EXE
mistachkinb0c99af2016-02-19 05:07:56 +0000298!IF $(FOR_WIN10)!=0
299SQLITE3EXE = winsqlite3shell.exe
300!ELSE
mistachkinedcb4eb2016-01-22 01:25:15 +0000301SQLITE3EXE = sqlite3.exe
302!ENDIF
mistachkinb0c99af2016-02-19 05:07:56 +0000303!ENDIF
mistachkinedcb4eb2016-01-22 01:25:15 +0000304
305# This is the argument used to set the program database (PDB) file for the
306# SQLite shell executable (EXE).
307#
308!IFNDEF SQLITE3EXEPDB
mistachkinb0c99af2016-02-19 05:07:56 +0000309!IF $(FOR_WIN10)!=0
310SQLITE3EXEPDB =
311!ELSE
mistachkinedcb4eb2016-01-22 01:25:15 +0000312SQLITE3EXEPDB = /pdb:sqlite3sh.pdb
313!ENDIF
mistachkinb0c99af2016-02-19 05:07:56 +0000314!ENDIF
mistachkinedcb4eb2016-01-22 01:25:15 +0000315
mistachkincc0164b2016-09-05 20:46:02 +0000316# <<mark>>
mistachkin4ef916e2016-08-24 19:58:46 +0000317# These are the names of the customized Tcl header files used by various parts
318# of this makefile when the stdcall calling convention is in use. It is not
319# used for any other purpose.
320#
321!IFNDEF SQLITETCLH
322SQLITETCLH = sqlite_tcl.h
323!ENDIF
324
325!IFNDEF SQLITETCLDECLSH
326SQLITETCLDECLSH = sqlite_tclDecls.h
327!ENDIF
328
mistachkine2bcbb42019-03-22 01:25:16 +0000329# This is the name to use for the dynamic link library (DLL) containing the
330# Tcl bindings for SQLite.
331#
332!IFNDEF SQLITE3TCLDLL
333SQLITE3TCLDLL = tclsqlite3.dll
334!ENDIF
335
mistachkin4ef916e2016-08-24 19:58:46 +0000336# These are the additional targets that the targets that integrate with the
337# Tcl library should depend on when compiling, etc.
338#
339!IFNDEF SQLITE_TCL_DEP
340!IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
341SQLITE_TCL_DEP = $(SQLITETCLDECLSH) $(SQLITETCLH)
342!ELSE
343SQLITE_TCL_DEP =
344!ENDIF
345!ENDIF
mistachkincc0164b2016-09-05 20:46:02 +0000346# <</mark>>
mistachkin4ef916e2016-08-24 19:58:46 +0000347
mistachkin4712c212014-05-09 20:51:17 +0000348# These are the "standard" SQLite compilation options used when compiling for
349# the Windows platform.
350#
351!IFNDEF OPT_FEATURE_FLAGS
mistachkin4ef916e2016-08-24 19:58:46 +0000352!IF $(MINIMAL_AMALGAMATION)==0
mistachkin4712c212014-05-09 20:51:17 +0000353OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS3=1
mistachkin90d6f482018-09-12 00:48:17 +0000354OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RTREE=1
355OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_GEOPOLY=1
356OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_JSON1=1
357OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_STMTVTAB=1
358OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBPAGE_VTAB=1
359OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBSTAT_VTAB=1
drhf6fa95b2018-11-28 01:45:05 +0000360OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DESERIALIZE=1
mistachkin4ef916e2016-08-24 19:58:46 +0000361!ENDIF
mistachkin4712c212014-05-09 20:51:17 +0000362OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_COLUMN_METADATA=1
drh5e18d402016-05-03 13:14:18 +0000363!ENDIF
364
mistachkin12b35ea2016-05-03 19:40:54 +0000365# Should the session extension be enabled? If so, add compilation options
366# to enable it.
drh5e18d402016-05-03 13:14:18 +0000367#
drh5e18d402016-05-03 13:14:18 +0000368!IF $(SESSION)!=0
mistachkin05004782016-03-30 16:23:06 +0000369OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_SESSION=1
370OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_PREUPDATE_HOOK=1
mistachkin4712c212014-05-09 20:51:17 +0000371!ENDIF
372
mistachkine99cb2d2019-12-20 17:41:15 +0000373# Should the rbu extension be enabled? If so, add compilation options
374# to enable it.
375#
376!IF $(RBU)!=0
377OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RBU=1
378!ENDIF
379
mistachkinedcb4eb2016-01-22 01:25:15 +0000380# These are the "extended" SQLite compilation options used when compiling for
381# the Windows 10 platform.
382#
383!IFNDEF EXT_FEATURE_FLAGS
384!IF $(FOR_WIN10)!=0
385EXT_FEATURE_FLAGS = $(EXT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS4=1
386EXT_FEATURE_FLAGS = $(EXT_FEATURE_FLAGS) -DSQLITE_SYSTEM_MALLOC=1
387EXT_FEATURE_FLAGS = $(EXT_FEATURE_FLAGS) -DSQLITE_OMIT_LOCALTIME=1
388!ELSE
389EXT_FEATURE_FLAGS =
390!ENDIF
391!ENDIF
392
mistachkin4712c212014-05-09 20:51:17 +0000393###############################################################################
394############################### END OF OPTIONS ################################
395###############################################################################
396
mistachkin55e88d92016-02-08 20:40:57 +0000397# When compiling for the Windows 10 platform, the PLATFORM macro must be set
398# to an appropriate value (e.g. x86, x64, arm, arm64, etc).
399#
400!IF $(FOR_WIN10)!=0
401!IFNDEF PLATFORM
402!ERROR Using the FOR_WIN10 option requires a value for PLATFORM.
403!ENDIF
404!ENDIF
405
mistachkind9b3c542014-05-09 23:31:55 +0000406# This assumes that MSVC is always installed in 32-bit Program Files directory
407# and sets the variable for use in locating other 32-bit installs accordingly.
408#
409PROGRAMFILES_X86 = $(VCINSTALLDIR)\..\..
410PROGRAMFILES_X86 = $(PROGRAMFILES_X86:\\=\)
411
mistachkine37f99c2012-06-30 16:22:05 +0000412# Check for the predefined command macro CC. This should point to the compiler
mistachkinbd58d5f2012-06-30 22:22:34 +0000413# binary for the target platform. If it is not defined, simply define it to
mistachkine37f99c2012-06-30 16:22:05 +0000414# the legacy default value 'cl.exe'.
415#
416!IFNDEF CC
417CC = cl.exe
418!ENDIF
419
mistachkin9aeb9712016-02-26 23:13:16 +0000420# Check for the predefined command macro CSC. This should point to a working
421# C Sharp compiler binary. If it is not defined, simply define it to the
422# legacy default value 'csc.exe'.
423#
424!IFNDEF CSC
425CSC = csc.exe
426!ENDIF
427
mistachkin228aeff2012-06-30 19:24:09 +0000428# Check for the command macro LD. This should point to the linker binary for
mistachkinbd58d5f2012-06-30 22:22:34 +0000429# the target platform. If it is not defined, simply define it to the legacy
mistachkin228aeff2012-06-30 19:24:09 +0000430# default value 'link.exe'.
431#
432!IFNDEF LD
433LD = link.exe
434!ENDIF
435
mistachkin4d9d1f42012-09-03 10:32:32 +0000436# Check for the predefined command macro RC. This should point to the resource
437# compiler binary for the target platform. If it is not defined, simply define
438# it to the legacy default value 'rc.exe'.
439#
440!IFNDEF RC
441RC = rc.exe
442!ENDIF
443
mistachkine48f1ed2016-02-08 20:45:37 +0000444# Check for the MSVC runtime library path macro. Otherwise, this value will
mistachkin4712c212014-05-09 20:51:17 +0000445# default to the 'lib' directory underneath the MSVC installation directory.
446#
447!IFNDEF CRTLIBPATH
448CRTLIBPATH = $(VCINSTALLDIR)\lib
449!ENDIF
450
451CRTLIBPATH = $(CRTLIBPATH:\\=\)
452
mistachkine37f99c2012-06-30 16:22:05 +0000453# Check for the command macro NCC. This should point to the compiler binary
mistachkinbd58d5f2012-06-30 22:22:34 +0000454# for the platform the compilation process is taking place on. If it is not
455# defined, simply define it to have the same value as the CC macro. When
mistachkine37f99c2012-06-30 16:22:05 +0000456# cross-compiling, it is suggested that this macro be modified via the command
457# line (since nmake itself does not provide a built-in method to guess it).
458# For example, to use the x86 compiler when cross-compiling for x64, a command
mistachkinbd58d5f2012-06-30 22:22:34 +0000459# line similar to the following could be used (all on one line):
mistachkine37f99c2012-06-30 16:22:05 +0000460#
mistachkin6f928332012-08-17 11:47:32 +0000461# nmake /f Makefile.msc sqlite3.dll
mistachkin52fd8e12012-08-28 01:44:13 +0000462# XCOMPILE=1 USE_NATIVE_LIBPATHS=1
463#
464# Alternatively, the full path and file name to the compiler binary for the
465# platform the compilation process is taking place may be specified (all on
466# one line):
467#
468# nmake /f Makefile.msc sqlite3.dll
mistachkinbd58d5f2012-06-30 22:22:34 +0000469# "NCC=""%VCINSTALLDIR%\bin\cl.exe"""
470# USE_NATIVE_LIBPATHS=1
mistachkine37f99c2012-06-30 16:22:05 +0000471#
mistachkinfd0ba2a2012-07-27 08:21:45 +0000472!IFDEF NCC
473NCC = $(NCC:\\=\)
mistachkin52fd8e12012-08-28 01:44:13 +0000474!ELSEIF $(XCOMPILE)!=0
mistachkin5fac4202013-12-03 23:33:29 +0000475NCC = "$(VCINSTALLDIR)\bin\$(CC)"
mistachkin52fd8e12012-08-28 01:44:13 +0000476NCC = $(NCC:\\=\)
mistachkinfd0ba2a2012-07-27 08:21:45 +0000477!ELSE
mistachkine37f99c2012-06-30 16:22:05 +0000478NCC = $(CC)
479!ENDIF
480
mistachkine48f1ed2016-02-08 20:45:37 +0000481# Check for the MSVC native runtime library path macro. Otherwise,
mistachkin4712c212014-05-09 20:51:17 +0000482# this value will default to the 'lib' directory underneath the MSVC
mistachkinbd58d5f2012-06-30 22:22:34 +0000483# installation directory.
484#
485!IFNDEF NCRTLIBPATH
486NCRTLIBPATH = $(VCINSTALLDIR)\lib
487!ENDIF
488
mistachkin0b5ae722012-07-27 23:03:47 +0000489NCRTLIBPATH = $(NCRTLIBPATH:\\=\)
490
mistachkine48f1ed2016-02-08 20:45:37 +0000491# Check for the Platform SDK library path macro. Otherwise, this
mistachkinbd58d5f2012-06-30 22:22:34 +0000492# value will default to the 'lib' directory underneath the Windows
493# SDK installation directory (the environment variable used appears
494# to be available when using Visual C++ 2008 or later via the
495# command line).
496#
497!IFNDEF NSDKLIBPATH
498NSDKLIBPATH = $(WINDOWSSDKDIR)\lib
499!ENDIF
500
mistachkin0b5ae722012-07-27 23:03:47 +0000501NSDKLIBPATH = $(NSDKLIBPATH:\\=\)
502
mistachkine48f1ed2016-02-08 20:45:37 +0000503# Check for the UCRT library path macro. Otherwise, this value will
mistachkina6f28892016-02-05 19:40:23 +0000504# default to the version-specific, platform-specific 'lib' directory
505# underneath the Windows SDK installation directory.
506#
507!IFNDEF UCRTLIBPATH
508UCRTLIBPATH = $(WINDOWSSDKDIR)\lib\$(WINDOWSSDKLIBVERSION)\ucrt\$(PLATFORM)
509!ENDIF
510
511UCRTLIBPATH = $(UCRTLIBPATH:\\=\)
512
mistachkinbd58d5f2012-06-30 22:22:34 +0000513# C compiler and options for use in building executables that
shanehb2f20bf2011-06-17 07:07:24 +0000514# will run on the platform that is doing the build.
515#
mistachkin2318d332015-01-12 18:02:52 +0000516!IF $(USE_FULLWARN)!=0
mistachkine2bcbb42019-03-22 01:25:16 +0000517BCC = $(NCC) -nologo -W4 -Fd$*.pdb $(CCOPTS) $(BCCOPTS)
mistachkin2318d332015-01-12 18:02:52 +0000518!ELSE
mistachkine2bcbb42019-03-22 01:25:16 +0000519BCC = $(NCC) -nologo -W3 -Fd$*.pdb $(CCOPTS) $(BCCOPTS)
mistachkin2318d332015-01-12 18:02:52 +0000520!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000521
mistachkin0157e012013-09-06 21:41:11 +0000522# Check if assembly code listings should be generated for the source
523# code files to be compiled.
524#
525!IF $(USE_LISTINGS)!=0
526BCC = $(BCC) -FAcs
527!ENDIF
528
mistachkinbd58d5f2012-06-30 22:22:34 +0000529# Check if the native library paths should be used when compiling
530# the command line tools used during the compilation process. If
531# so, set the necessary macro now.
532#
533!IF $(USE_NATIVE_LIBPATHS)!=0
534NLTLIBPATHS = "/LIBPATH:$(NCRTLIBPATH)" "/LIBPATH:$(NSDKLIBPATH)"
mistachkin6bbe3df2015-04-19 06:18:10 +0000535
536!IFDEF NUCRTLIBPATH
537NUCRTLIBPATH = $(NUCRTLIBPATH:\\=\)
538NLTLIBPATHS = $(NLTLIBPATHS) "/LIBPATH:$(NUCRTLIBPATH)"
539!ENDIF
mistachkinbd58d5f2012-06-30 22:22:34 +0000540!ENDIF
541
542# C compiler and options for use in building executables that
shanehb2f20bf2011-06-17 07:07:24 +0000543# will run on the target platform. (BCC and TCC are usually the
544# same unless your are cross-compiling.)
545#
mistachkin2318d332015-01-12 18:02:52 +0000546!IF $(USE_FULLWARN)!=0
mistachkinf170ea42015-10-16 20:13:57 +0000547TCC = $(CC) -nologo -W4 -DINCLUDE_MSVC_H=1 $(CCOPTS) $(TCCOPTS)
mistachkin2318d332015-01-12 18:02:52 +0000548!ELSE
mistachkinf170ea42015-10-16 20:13:57 +0000549TCC = $(CC) -nologo -W3 $(CCOPTS) $(TCCOPTS)
mistachkin2318d332015-01-12 18:02:52 +0000550!ENDIF
551
mistachkin8c5e8fe2017-02-01 22:32:49 +0000552# Check if warnings should be treated as errors when compiling.
553#
554!IF $(USE_FATAL_WARN)!=0
555TCC = $(TCC) -WX
556!ENDIF
557
mistachkin8988aee2016-02-10 21:45:25 +0000558TCC = $(TCC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) -I$(TOP)\src -fp:precise
559RCC = $(RC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) -I$(TOP)\src $(RCOPTS) $(RCCOPTS)
shaneh6e7850c2011-06-17 15:57:07 +0000560
mistachkin44723ce2015-03-21 02:22:37 +0000561# Check if we want to use the "stdcall" calling convention when compiling.
562# This is not supported by the compilers for non-x86 platforms. It should
563# also be noted here that building any target with these "stdcall" options
564# will most likely fail if the Tcl library is also required. This is due
565# to how the Tcl library functions are declared and exported (i.e. without
566# an explicit calling convention, which results in "cdecl").
567#
mistachkinedcb4eb2016-01-22 01:25:15 +0000568!IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
mistachkin44723ce2015-03-21 02:22:37 +0000569!IF "$(PLATFORM)"=="x86"
mistachkin69def7f2016-07-28 04:14:37 +0000570CORE_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
571SHELL_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
mistachkinf27a80c2016-07-28 16:09:52 +0000572# <<mark>>
mistachkin52b1dbb2016-07-28 14:37:04 +0000573TEST_CCONV_OPTS = -Gz -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 +0000574# <</mark>>
mistachkin44723ce2015-03-21 02:22:37 +0000575!ELSE
576!IFNDEF PLATFORM
mistachkin69def7f2016-07-28 04:14:37 +0000577CORE_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
578SHELL_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
mistachkinf27a80c2016-07-28 16:09:52 +0000579# <<mark>>
mistachkin52b1dbb2016-07-28 14:37:04 +0000580TEST_CCONV_OPTS = -Gz -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 +0000581# <</mark>>
mistachkin44723ce2015-03-21 02:22:37 +0000582!ELSE
583CORE_CCONV_OPTS =
584SHELL_CCONV_OPTS =
mistachkinf27a80c2016-07-28 16:09:52 +0000585# <<mark>>
mistachkin69def7f2016-07-28 04:14:37 +0000586TEST_CCONV_OPTS =
mistachkinf27a80c2016-07-28 16:09:52 +0000587# <</mark>>
mistachkin44723ce2015-03-21 02:22:37 +0000588!ENDIF
589!ENDIF
590!ELSE
591CORE_CCONV_OPTS =
592SHELL_CCONV_OPTS =
mistachkinf27a80c2016-07-28 16:09:52 +0000593# <<mark>>
mistachkin69def7f2016-07-28 04:14:37 +0000594TEST_CCONV_OPTS =
mistachkinf27a80c2016-07-28 16:09:52 +0000595# <</mark>>
mistachkin44723ce2015-03-21 02:22:37 +0000596!ENDIF
597
598# These are additional compiler options used for the core library.
599#
600!IFNDEF CORE_COMPILE_OPTS
mistachkinedcb4eb2016-01-22 01:25:15 +0000601!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
mistachkin44723ce2015-03-21 02:22:37 +0000602CORE_COMPILE_OPTS = $(CORE_CCONV_OPTS) -DSQLITE_API=__declspec(dllexport)
603!ELSE
604CORE_COMPILE_OPTS = $(CORE_CCONV_OPTS)
605!ENDIF
606!ENDIF
607
608# These are the additional targets that the core library should depend on
609# when linking.
610#
611!IFNDEF CORE_LINK_DEP
mistachkin9b88ace2016-02-26 21:01:37 +0000612!IF $(DYNAMIC_SHELL)!=0
mistachkin44723ce2015-03-21 02:22:37 +0000613CORE_LINK_DEP =
mistachkin9b88ace2016-02-26 21:01:37 +0000614!ELSEIF $(FOR_WIN10)==0 || "$(PLATFORM)"=="x86"
mistachkin44723ce2015-03-21 02:22:37 +0000615CORE_LINK_DEP = sqlite3.def
mistachkin9b88ace2016-02-26 21:01:37 +0000616!ELSE
617CORE_LINK_DEP =
mistachkin44723ce2015-03-21 02:22:37 +0000618!ENDIF
619!ENDIF
620
621# These are additional linker options used for the core library.
622#
623!IFNDEF CORE_LINK_OPTS
mistachkin9b88ace2016-02-26 21:01:37 +0000624!IF $(DYNAMIC_SHELL)!=0
mistachkin44723ce2015-03-21 02:22:37 +0000625CORE_LINK_OPTS =
mistachkin9b88ace2016-02-26 21:01:37 +0000626!ELSEIF $(FOR_WIN10)==0 || "$(PLATFORM)"=="x86"
mistachkin44723ce2015-03-21 02:22:37 +0000627CORE_LINK_OPTS = /DEF:sqlite3.def
mistachkin9b88ace2016-02-26 21:01:37 +0000628!ELSE
629CORE_LINK_OPTS =
mistachkin44723ce2015-03-21 02:22:37 +0000630!ENDIF
631!ENDIF
632
633# These are additional compiler options used for the shell executable.
634#
635!IFNDEF SHELL_COMPILE_OPTS
mistachkinedcb4eb2016-01-22 01:25:15 +0000636!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
mistachkin5d4d9412016-01-22 03:54:36 +0000637SHELL_COMPILE_OPTS = $(SHELL_CCONV_OPTS) -DSQLITE_API=__declspec(dllimport)
mistachkin44723ce2015-03-21 02:22:37 +0000638!ELSE
mistachkin5d4d9412016-01-22 03:54:36 +0000639SHELL_COMPILE_OPTS = $(SHELL_CCONV_OPTS)
640!ENDIF
641!ENDIF
642
643# This is the source code that the shell executable should be compiled
644# with.
645#
646!IFNDEF SHELL_CORE_SRC
647!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
648SHELL_CORE_SRC =
mistachkin1f237e32018-07-27 20:45:28 +0000649# <<mark>>
650!ELSEIF $(USE_AMALGAMATION)==0
651SHELL_CORE_SRC =
652# <</mark>>
mistachkin5d4d9412016-01-22 03:54:36 +0000653!ELSE
654SHELL_CORE_SRC = $(SQLITE3C)
mistachkin44723ce2015-03-21 02:22:37 +0000655!ENDIF
656!ENDIF
657
658# This is the core library that the shell executable should depend on.
659#
660!IFNDEF SHELL_CORE_DEP
mistachkinedcb4eb2016-01-22 01:25:15 +0000661!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
662SHELL_CORE_DEP = $(SQLITE3DLL)
mistachkin1f237e32018-07-27 20:45:28 +0000663# <<mark>>
664!ELSEIF $(USE_AMALGAMATION)==0
665SHELL_CORE_DEP = libsqlite3.lib
666# <</mark>>
mistachkin44723ce2015-03-21 02:22:37 +0000667!ELSE
mistachkin5d4d9412016-01-22 03:54:36 +0000668SHELL_CORE_DEP =
mistachkin44723ce2015-03-21 02:22:37 +0000669!ENDIF
670!ENDIF
671
mistachkincb6acda2017-12-05 18:54:12 +0000672# <<mark>>
mistachkin5d7503a2018-01-05 17:12:13 +0000673# If zlib support is enabled, add the dependencies for it.
mistachkincb6acda2017-12-05 18:54:12 +0000674#
675!IF $(USE_ZLIB)!=0 && $(BUILD_ZLIB)!=0
676SHELL_CORE_DEP = zlib $(SHELL_CORE_DEP)
mistachkin5d7503a2018-01-05 17:12:13 +0000677TESTFIXTURE_DEP = zlib $(TESTFIXTURE_DEP)
mistachkincb6acda2017-12-05 18:54:12 +0000678!ENDIF
679# <</mark>>
680
mistachkin44723ce2015-03-21 02:22:37 +0000681# This is the core library that the shell executable should link with.
682#
683!IFNDEF SHELL_CORE_LIB
mistachkinedcb4eb2016-01-22 01:25:15 +0000684!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
685SHELL_CORE_LIB = $(SQLITE3LIB)
mistachkin1f237e32018-07-27 20:45:28 +0000686# <<mark>>
687!ELSEIF $(USE_AMALGAMATION)==0
688SHELL_CORE_LIB = libsqlite3.lib
689# <</mark>>
mistachkin44723ce2015-03-21 02:22:37 +0000690!ELSE
mistachkin5d4d9412016-01-22 03:54:36 +0000691SHELL_CORE_LIB =
mistachkin44723ce2015-03-21 02:22:37 +0000692!ENDIF
693!ENDIF
694
695# These are additional linker options used for the shell executable.
696#
697!IFNDEF SHELL_LINK_OPTS
698SHELL_LINK_OPTS = $(SHELL_CORE_LIB)
699!ENDIF
700
mistachkin0157e012013-09-06 21:41:11 +0000701# Check if assembly code listings should be generated for the source
702# code files to be compiled.
703#
704!IF $(USE_LISTINGS)!=0
705TCC = $(TCC) -FAcs
706!ENDIF
707
mistachkinf39eaf22012-03-20 02:18:42 +0000708# When compiling the library for use in the WinRT environment,
mistachkin46b721a2012-03-23 12:28:21 +0000709# the following compile-time options must be used as well to
mistachkinf39eaf22012-03-20 02:18:42 +0000710# disable use of Win32 APIs that are not available and to enable
711# use of Win32 APIs that are specific to Windows 8 and/or WinRT.
712#
mistachkin46b721a2012-03-23 12:28:21 +0000713!IF $(FOR_WINRT)!=0
mistachkin8d967a92012-06-21 04:21:35 +0000714TCC = $(TCC) -DSQLITE_OS_WINRT=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000715RCC = $(RCC) -DSQLITE_OS_WINRT=1
mistachkin08c1c312012-10-06 03:48:25 +0000716TCC = $(TCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
717RCC = $(RCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
mistachkin8d967a92012-06-21 04:21:35 +0000718!ENDIF
719
mistachkin5d4d9412016-01-22 03:54:36 +0000720# C compiler options for the Windows 10 platform (needs MSVC 2015).
mistachkinedcb4eb2016-01-22 01:25:15 +0000721#
722!IF $(FOR_WIN10)!=0
mistachkin406eeff2016-02-09 18:28:20 +0000723TCC = $(TCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
724BCC = $(BCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
mistachkinedcb4eb2016-01-22 01:25:15 +0000725!ENDIF
726
mistachkin8d967a92012-06-21 04:21:35 +0000727# Also, we need to dynamically link to the correct MSVC runtime
728# when compiling for WinRT (e.g. debug or release) OR if the
729# USE_CRT_DLL option is set to force dynamically linking to the
730# MSVC runtime library.
731#
mistachkina6f28892016-02-05 19:40:23 +0000732!IF $(FOR_WINRT)!=0 || $(USE_CRT_DLL)!=0
mistachkincd54bab2014-12-20 21:14:14 +0000733!IF $(DEBUG)>1
mistachkin8d967a92012-06-21 04:21:35 +0000734TCC = $(TCC) -MDd
mistachkin08c1c312012-10-06 03:48:25 +0000735BCC = $(BCC) -MDd
mistachkin8d967a92012-06-21 04:21:35 +0000736!ELSE
737TCC = $(TCC) -MD
mistachkin08c1c312012-10-06 03:48:25 +0000738BCC = $(BCC) -MD
mistachkin8d967a92012-06-21 04:21:35 +0000739!ENDIF
740!ELSE
mistachkincd54bab2014-12-20 21:14:14 +0000741!IF $(DEBUG)>1
mistachkin8d967a92012-06-21 04:21:35 +0000742TCC = $(TCC) -MTd
mistachkin08c1c312012-10-06 03:48:25 +0000743BCC = $(BCC) -MTd
mistachkin8d967a92012-06-21 04:21:35 +0000744!ELSE
745TCC = $(TCC) -MT
mistachkin08c1c312012-10-06 03:48:25 +0000746BCC = $(BCC) -MT
mistachkin8d967a92012-06-21 04:21:35 +0000747!ENDIF
mistachkin46b721a2012-03-23 12:28:21 +0000748!ENDIF
mistachkinf39eaf22012-03-20 02:18:42 +0000749
mistachkin3e786092016-01-23 07:53:04 +0000750# <<mark>>
mistachkinf39eaf22012-03-20 02:18:42 +0000751# The mksqlite3c.tcl and mksqlite3h.tcl scripts will pull in
shaneh6e7850c2011-06-17 15:57:07 +0000752# any extension header files by default. For non-amalgamation
753# builds, we need to make sure the compiler can find these.
754#
755!IF $(USE_AMALGAMATION)==0
756TCC = $(TCC) -I$(TOP)\ext\fts3
mistachkin4d9d1f42012-09-03 10:32:32 +0000757RCC = $(RCC) -I$(TOP)\ext\fts3
shaneh6e7850c2011-06-17 15:57:07 +0000758TCC = $(TCC) -I$(TOP)\ext\rtree
mistachkin4d9d1f42012-09-03 10:32:32 +0000759RCC = $(RCC) -I$(TOP)\ext\rtree
drh498dcae2013-03-13 11:42:00 +0000760TCC = $(TCC) -I$(TOP)\ext\session
mistachkin38b4daa2013-03-13 19:02:39 +0000761RCC = $(RCC) -I$(TOP)\ext\session
shaneh6e7850c2011-06-17 15:57:07 +0000762!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000763
mistachkinb0427512014-01-30 11:12:52 +0000764# The mksqlite3c.tcl script accepts some options on the command
765# line. When compiling with debugging enabled, some of these
766# options are necessary in order to allow debugging symbols to
767# work correctly with Visual Studio when using the amalgamation.
768#
mistachkin4ef916e2016-08-24 19:58:46 +0000769!IFNDEF MKSQLITE3C_TOOL
770!IF $(MINIMAL_AMALGAMATION)!=0
771MKSQLITE3C_TOOL = $(TOP)\tool\mksqlite3c-noext.tcl
772!ELSE
773MKSQLITE3C_TOOL = $(TOP)\tool\mksqlite3c.tcl
774!ENDIF
775!ENDIF
776
mistachkin22529172015-04-10 21:16:11 +0000777!IFNDEF MKSQLITE3C_ARGS
mistachkincd54bab2014-12-20 21:14:14 +0000778!IF $(DEBUG)>1
mistachkinb0427512014-01-30 11:12:52 +0000779MKSQLITE3C_ARGS = --linemacros
780!ELSE
781MKSQLITE3C_ARGS =
782!ENDIF
mistachkin4ef916e2016-08-24 19:58:46 +0000783!IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
784MKSQLITE3C_ARGS = $(MKSQLITE3C_ARGS) --useapicall
785!ENDIF
786!ENDIF
787
788# The mksqlite3h.tcl script accepts some options on the command line.
789# When compiling with stdcall support, some of these options are
790# necessary.
791#
792!IFNDEF MKSQLITE3H_ARGS
793!IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
794MKSQLITE3H_ARGS = --useapicall
795!ELSE
796MKSQLITE3H_ARGS =
797!ENDIF
mistachkin22529172015-04-10 21:16:11 +0000798!ENDIF
mistachkin3e786092016-01-23 07:53:04 +0000799# <</mark>>
mistachkinb0427512014-01-30 11:12:52 +0000800
shanehb2f20bf2011-06-17 07:07:24 +0000801# Define -DNDEBUG to compile without debugging (i.e., for production usage)
802# Omitting the define will cause extra debugging code to be inserted and
803# includes extra comments when "EXPLAIN stmt" is used.
804#
mistachkin753c5442011-08-25 02:02:25 +0000805!IF $(DEBUG)==0
shanehb2f20bf2011-06-17 07:07:24 +0000806TCC = $(TCC) -DNDEBUG
mistachkinfec360a2012-04-18 10:29:21 +0000807BCC = $(BCC) -DNDEBUG
mistachkin4d9d1f42012-09-03 10:32:32 +0000808RCC = $(RCC) -DNDEBUG
mistachkin753c5442011-08-25 02:02:25 +0000809!ENDIF
810
mistachkinedcb4eb2016-01-22 01:25:15 +0000811!IF $(DEBUG)>0 || $(API_ARMOR)!=0 || $(FOR_WIN10)!=0
mistachkin13a24f82015-05-13 04:50:30 +0000812TCC = $(TCC) -DSQLITE_ENABLE_API_ARMOR=1
813RCC = $(RCC) -DSQLITE_ENABLE_API_ARMOR=1
mistachkincd54bab2014-12-20 21:14:14 +0000814!ENDIF
815
816!IF $(DEBUG)>2
mistachkin13a24f82015-05-13 04:50:30 +0000817TCC = $(TCC) -DSQLITE_DEBUG=1
818RCC = $(RCC) -DSQLITE_DEBUG=1
mistachkinb3d3bea2017-03-29 23:22:18 +0000819!IF $(DYNAMIC_SHELL)==0
820TCC = $(TCC) -DSQLITE_ENABLE_WHERETRACE -DSQLITE_ENABLE_SELECTTRACE
821RCC = $(RCC) -DSQLITE_ENABLE_WHERETRACE -DSQLITE_ENABLE_SELECTTRACE
822!ENDIF
mistachkin753c5442011-08-25 02:02:25 +0000823!ENDIF
824
mistachkinb10f22a2015-04-16 16:27:29 +0000825!IF $(DEBUG)>4 || $(OSTRACE)!=0
826TCC = $(TCC) -DSQLITE_FORCE_OS_TRACE=1 -DSQLITE_DEBUG_OS_TRACE=1
827RCC = $(RCC) -DSQLITE_FORCE_OS_TRACE=1 -DSQLITE_DEBUG_OS_TRACE=1
mistachkin753c5442011-08-25 02:02:25 +0000828!ENDIF
829
mistachkincd54bab2014-12-20 21:14:14 +0000830!IF $(DEBUG)>5
mistachkin13a24f82015-05-13 04:50:30 +0000831TCC = $(TCC) -DSQLITE_ENABLE_IOTRACE=1
832RCC = $(RCC) -DSQLITE_ENABLE_IOTRACE=1
mistachkin753c5442011-08-25 02:02:25 +0000833!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000834
mistachkinbd58d5f2012-06-30 22:22:34 +0000835# Prevent warnings about "insecure" MSVC runtime library functions
836# being used.
mistachkin176f1b42011-08-02 23:34:00 +0000837#
838TCC = $(TCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
mistachkinfec360a2012-04-18 10:29:21 +0000839BCC = $(BCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
mistachkin4d9d1f42012-09-03 10:32:32 +0000840RCC = $(RCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
mistachkin176f1b42011-08-02 23:34:00 +0000841
mistachkinbd58d5f2012-06-30 22:22:34 +0000842# Prevent warnings about "deprecated" POSIX functions being used.
843#
844TCC = $(TCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
845BCC = $(BCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
mistachkin4d9d1f42012-09-03 10:32:32 +0000846RCC = $(RCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
mistachkinbd58d5f2012-06-30 22:22:34 +0000847
mistachkin2f7d5d82012-08-22 00:39:34 +0000848# Use the SQLite debugging heap subsystem?
mistachkin1b186a92011-08-24 16:13:57 +0000849#
mistachkin2f7d5d82012-08-22 00:39:34 +0000850!IF $(MEMDEBUG)!=0
851TCC = $(TCC) -DSQLITE_MEMDEBUG=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000852RCC = $(RCC) -DSQLITE_MEMDEBUG=1
mistachkin2f7d5d82012-08-22 00:39:34 +0000853
mistachkin2f7d5d82012-08-22 00:39:34 +0000854# Use native Win32 heap subsystem instead of malloc/free?
855#
856!ELSEIF $(WIN32HEAP)!=0
857TCC = $(TCC) -DSQLITE_WIN32_MALLOC=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000858RCC = $(RCC) -DSQLITE_WIN32_MALLOC=1
mistachkin753c5442011-08-25 02:02:25 +0000859
mistachkin753c5442011-08-25 02:02:25 +0000860# Validate the heap on every call into the native Win32 heap subsystem?
861#
mistachkincd54bab2014-12-20 21:14:14 +0000862!IF $(DEBUG)>3
mistachkin753c5442011-08-25 02:02:25 +0000863TCC = $(TCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000864RCC = $(RCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1
mistachkin753c5442011-08-25 02:02:25 +0000865!ENDIF
mistachkin2f7d5d82012-08-22 00:39:34 +0000866!ENDIF
mistachkin1b186a92011-08-24 16:13:57 +0000867
mistachkin3e786092016-01-23 07:53:04 +0000868# <<mark>>
mistachkin5b0b6fd2011-06-25 01:14:36 +0000869# The locations of the Tcl header and library files. Also, the library that
870# non-stubs enabled programs using Tcl must link against. These variables
871# (TCLINCDIR, TCLLIBDIR, and LIBTCL) may be overridden via the environment
872# prior to running nmake in order to match the actual installed location and
873# version on this machine.
shanehb2f20bf2011-06-17 07:07:24 +0000874#
mistachkinb1b808b2019-03-22 22:34:16 +0000875!IFNDEF TCLVERSION
876TCLVERSION = 86
877!ENDIF
878
mistachkin21a3b312019-03-23 00:38:52 +0000879!IFNDEF TCLSUFFIX
880TCLSUFFIX =
881!ENDIF
882
mistachkincb6acda2017-12-05 18:54:12 +0000883!IFNDEF TCLDIR
mistachkina0fcafe2017-12-05 19:07:30 +0000884TCLDIR = $(TOP)\compat\tcl
mistachkincb6acda2017-12-05 18:54:12 +0000885!ENDIF
886
mistachkine37f99c2012-06-30 16:22:05 +0000887!IFNDEF TCLINCDIR
mistachkincb6acda2017-12-05 18:54:12 +0000888TCLINCDIR = $(TCLDIR)\include
mistachkine37f99c2012-06-30 16:22:05 +0000889!ENDIF
mistachkin5b0b6fd2011-06-25 01:14:36 +0000890
mistachkine37f99c2012-06-30 16:22:05 +0000891!IFNDEF TCLLIBDIR
mistachkincb6acda2017-12-05 18:54:12 +0000892TCLLIBDIR = $(TCLDIR)\lib
mistachkine37f99c2012-06-30 16:22:05 +0000893!ENDIF
mistachkin5b0b6fd2011-06-25 01:14:36 +0000894
mistachkine37f99c2012-06-30 16:22:05 +0000895!IFNDEF LIBTCL
mistachkin21a3b312019-03-23 00:38:52 +0000896LIBTCL = tcl$(TCLVERSION)$(TCLSUFFIX).lib
mistachkine37f99c2012-06-30 16:22:05 +0000897!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000898
mistachkin5b663502015-10-10 23:39:55 +0000899!IFNDEF LIBTCLSTUB
mistachkin21a3b312019-03-23 00:38:52 +0000900LIBTCLSTUB = tclstub$(TCLVERSION)$(TCLSUFFIX).lib
mistachkin5b663502015-10-10 23:39:55 +0000901!ENDIF
902
mistachkin88739962015-10-14 23:04:08 +0000903!IFNDEF LIBTCLPATH
mistachkincb6acda2017-12-05 18:54:12 +0000904LIBTCLPATH = $(TCLDIR)\bin
905!ENDIF
906
907# The locations of the zlib header and library files. These variables
908# (ZLIBINCDIR, ZLIBLIBDIR, and ZLIBLIB) may be overridden via the environment
909# prior to running nmake in order to match the actual installed (or source
910# code) location on this machine.
911#
912!IFNDEF ZLIBDIR
913ZLIBDIR = $(TOP)\compat\zlib
914!ENDIF
915
916!IFNDEF ZLIBINCDIR
917ZLIBINCDIR = $(ZLIBDIR)
918!ENDIF
919
920!IFNDEF ZLIBLIBDIR
921ZLIBLIBDIR = $(ZLIBDIR)
922!ENDIF
923
924!IFNDEF ZLIBLIB
925!IF $(DYNAMIC_SHELL)!=0
926ZLIBLIB = zdll.lib
927!ELSE
928ZLIBLIB = zlib.lib
929!ENDIF
mistachkin88739962015-10-14 23:04:08 +0000930!ENDIF
931
mistachkinc756ded2011-10-02 05:23:16 +0000932# The locations of the ICU header and library files. These variables
933# (ICUINCDIR, ICULIBDIR, and LIBICU) may be overridden via the environment
934# prior to running nmake in order to match the actual installed location on
935# this machine.
936#
mistachkincb6acda2017-12-05 18:54:12 +0000937!IFNDEF ICUDIR
mistachkina0fcafe2017-12-05 19:07:30 +0000938ICUDIR = $(TOP)\compat\icu
mistachkincb6acda2017-12-05 18:54:12 +0000939!ENDIF
940
mistachkine37f99c2012-06-30 16:22:05 +0000941!IFNDEF ICUINCDIR
mistachkincb6acda2017-12-05 18:54:12 +0000942ICUINCDIR = $(ICUDIR)\include
mistachkine37f99c2012-06-30 16:22:05 +0000943!ENDIF
mistachkinc756ded2011-10-02 05:23:16 +0000944
mistachkine37f99c2012-06-30 16:22:05 +0000945!IFNDEF ICULIBDIR
mistachkincb6acda2017-12-05 18:54:12 +0000946ICULIBDIR = $(ICUDIR)\lib
mistachkine37f99c2012-06-30 16:22:05 +0000947!ENDIF
mistachkinc756ded2011-10-02 05:23:16 +0000948
mistachkine37f99c2012-06-30 16:22:05 +0000949!IFNDEF LIBICU
mistachkinc756ded2011-10-02 05:23:16 +0000950LIBICU = icuuc.lib icuin.lib
mistachkine37f99c2012-06-30 16:22:05 +0000951!ENDIF
mistachkinc756ded2011-10-02 05:23:16 +0000952
shanehb2f20bf2011-06-17 07:07:24 +0000953# This is the command to use for tclsh - normally just "tclsh", but we may
mistachkin5b0b6fd2011-06-25 01:14:36 +0000954# know the specific version we want to use. This variable (TCLSH_CMD) may be
955# overridden via the environment prior to running nmake in order to select a
956# specific Tcl shell to use.
shanehb2f20bf2011-06-17 07:07:24 +0000957#
mistachkine37f99c2012-06-30 16:22:05 +0000958!IFNDEF TCLSH_CMD
mistachkin47be3b22018-01-05 01:22:37 +0000959!IF $(USE_TCLSH_IN_PATH)!=0 || !EXIST("$(TCLDIR)\bin\tclsh.exe")
drh506a1402016-11-02 19:49:22 +0000960TCLSH_CMD = tclsh
mistachkina0fcafe2017-12-05 19:07:30 +0000961!ELSE
962TCLSH_CMD = $(TCLDIR)\bin\tclsh.exe
963!ENDIF
mistachkine37f99c2012-06-30 16:22:05 +0000964!ENDIF
mistachkin3e786092016-01-23 07:53:04 +0000965# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +0000966
967# Compiler options needed for programs that use the readline() library.
968#
mistachkin8bcd3fa2013-08-29 01:03:38 +0000969!IFNDEF READLINE_FLAGS
shaneh6e7850c2011-06-17 15:57:07 +0000970READLINE_FLAGS = -DHAVE_READLINE=0
mistachkin8bcd3fa2013-08-29 01:03:38 +0000971!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000972
973# The library that programs using readline() must link against.
974#
mistachkin8bcd3fa2013-08-29 01:03:38 +0000975!IFNDEF LIBREADLINE
shaneh6e7850c2011-06-17 15:57:07 +0000976LIBREADLINE =
mistachkin8bcd3fa2013-08-29 01:03:38 +0000977!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000978
979# Should the database engine be compiled threadsafe
980#
981TCC = $(TCC) -DSQLITE_THREADSAFE=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000982RCC = $(RCC) -DSQLITE_THREADSAFE=1
shanehb2f20bf2011-06-17 07:07:24 +0000983
984# Do threads override each others locks by default (1), or do we test (-1)
985#
986TCC = $(TCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1
mistachkin4d9d1f42012-09-03 10:32:32 +0000987RCC = $(RCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1
shanehb2f20bf2011-06-17 07:07:24 +0000988
989# Any target libraries which libsqlite must be linked against
shaneh6e7850c2011-06-17 15:57:07 +0000990#
mistachkine37f99c2012-06-30 16:22:05 +0000991!IFNDEF TLIBS
shaneh6e7850c2011-06-17 15:57:07 +0000992TLIBS =
mistachkine37f99c2012-06-30 16:22:05 +0000993!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000994
995# Flags controlling use of the in memory btree implementation
996#
997# SQLITE_TEMP_STORE is 0 to force temporary tables to be in a file, 1 to
998# default to file, 2 to default to memory, and 3 to force temporary
999# tables to always be in memory.
1000#
shaneh6e7850c2011-06-17 15:57:07 +00001001TCC = $(TCC) -DSQLITE_TEMP_STORE=1
mistachkin4d9d1f42012-09-03 10:32:32 +00001002RCC = $(RCC) -DSQLITE_TEMP_STORE=1
shanehb2f20bf2011-06-17 07:07:24 +00001003
1004# Enable/disable loadable extensions, and other optional features
shaneh6e7850c2011-06-17 15:57:07 +00001005# based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*).
1006# The same set of OMIT and ENABLE flags should be passed to the
shanehb2f20bf2011-06-17 07:07:24 +00001007# LEMON parser generator and the mkkeywordhash tool as well.
1008
mistachkin4712c212014-05-09 20:51:17 +00001009# These are the required SQLite compilation options used when compiling for
1010# the Windows platform.
1011#
1012REQ_FEATURE_FLAGS = $(REQ_FEATURE_FLAGS) -DSQLITE_MAX_TRIGGER_DEPTH=100
shanehb2f20bf2011-06-17 07:07:24 +00001013
mistachkine45e0fb2015-01-21 00:48:46 +00001014# If we are linking to the RPCRT4 library, enable features that need it.
1015#
1016!IF $(USE_RPCRT4_LIB)!=0
1017REQ_FEATURE_FLAGS = $(REQ_FEATURE_FLAGS) -DSQLITE_WIN32_USE_UUID=1
1018!ENDIF
1019
mistachkin4712c212014-05-09 20:51:17 +00001020# Add the required and optional SQLite compilation options into the command
1021# lines used to invoke the MSVC code and resource compilers.
1022#
mistachkinedcb4eb2016-01-22 01:25:15 +00001023TCC = $(TCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS)
1024RCC = $(RCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS)
shanehb2f20bf2011-06-17 07:07:24 +00001025
mistachkin4712c212014-05-09 20:51:17 +00001026# Add in any optional parameters specified on the commane line, e.g.
1027# nmake /f Makefile.msc all "OPTS=-DSQLITE_ENABLE_FOO=1 -DSQLITE_OMIT_FOO=1"
1028#
shanehb2f20bf2011-06-17 07:07:24 +00001029TCC = $(TCC) $(OPTS)
mistachkin4d9d1f42012-09-03 10:32:32 +00001030RCC = $(RCC) $(OPTS)
shanehb2f20bf2011-06-17 07:07:24 +00001031
mistachkin8bcd3fa2013-08-29 01:03:38 +00001032# If compiling for debugging, add some defines.
mistachkin4712c212014-05-09 20:51:17 +00001033#
mistachkincd54bab2014-12-20 21:14:14 +00001034!IF $(DEBUG)>1
mistachkin8bcd3fa2013-08-29 01:03:38 +00001035TCC = $(TCC) -D_DEBUG
1036BCC = $(BCC) -D_DEBUG
mistachkin4d9d1f42012-09-03 10:32:32 +00001037RCC = $(RCC) -D_DEBUG
mistachkin4d60be52011-08-26 05:40:31 +00001038!ENDIF
1039
mistachkin8bcd3fa2013-08-29 01:03:38 +00001040# If optimizations are enabled or disabled (either implicitly or
1041# explicitly), add the necessary flags.
mistachkin4712c212014-05-09 20:51:17 +00001042#
mistachkincd54bab2014-12-20 21:14:14 +00001043!IF $(DEBUG)>1 || $(OPTIMIZATIONS)==0
mistachkin8bcd3fa2013-08-29 01:03:38 +00001044TCC = $(TCC) -Od
1045BCC = $(BCC) -Od
mistachkin24b6b812016-08-24 18:21:58 +00001046!IF $(USE_RUNTIME_CHECKS)!=0
1047TCC = $(TCC) -RTC1
1048BCC = $(BCC) -RTC1
1049!ENDIF
mistachkin8bcd3fa2013-08-29 01:03:38 +00001050!ELSEIF $(OPTIMIZATIONS)>=3
1051TCC = $(TCC) -Ox
1052BCC = $(BCC) -Ox
1053!ELSEIF $(OPTIMIZATIONS)==2
1054TCC = $(TCC) -O2
1055BCC = $(BCC) -O2
1056!ELSEIF $(OPTIMIZATIONS)==1
1057TCC = $(TCC) -O1
1058BCC = $(BCC) -O1
1059!ENDIF
1060
1061# If symbols are enabled (or compiling for debugging), enable PDBs.
mistachkin4712c212014-05-09 20:51:17 +00001062#
mistachkincd54bab2014-12-20 21:14:14 +00001063!IF $(DEBUG)>1 || $(SYMBOLS)!=0
mistachkin4d60be52011-08-26 05:40:31 +00001064TCC = $(TCC) -Zi
mistachkinfec360a2012-04-18 10:29:21 +00001065BCC = $(BCC) -Zi
mistachkin753c5442011-08-25 02:02:25 +00001066!ENDIF
1067
mistachkin3e786092016-01-23 07:53:04 +00001068# <<mark>>
mistachkincb6acda2017-12-05 18:54:12 +00001069# If zlib support is enabled, add the compiler options for it.
1070#
1071!IF $(USE_ZLIB)!=0
1072TCC = $(TCC) -DSQLITE_HAVE_ZLIB=1
1073RCC = $(RCC) -DSQLITE_HAVE_ZLIB=1
1074TCC = $(TCC) -I$(ZLIBINCDIR)
1075RCC = $(RCC) -I$(ZLIBINCDIR)
1076!ENDIF
1077
mistachkinc756ded2011-10-02 05:23:16 +00001078# If ICU support is enabled, add the compiler options for it.
mistachkin4712c212014-05-09 20:51:17 +00001079#
mistachkinc756ded2011-10-02 05:23:16 +00001080!IF $(USE_ICU)!=0
1081TCC = $(TCC) -DSQLITE_ENABLE_ICU=1
mistachkin4d9d1f42012-09-03 10:32:32 +00001082RCC = $(RCC) -DSQLITE_ENABLE_ICU=1
mistachkinc756ded2011-10-02 05:23:16 +00001083TCC = $(TCC) -I$(TOP)\ext\icu
mistachkin4d9d1f42012-09-03 10:32:32 +00001084RCC = $(RCC) -I$(TOP)\ext\icu
mistachkinc756ded2011-10-02 05:23:16 +00001085TCC = $(TCC) -I$(ICUINCDIR)
mistachkin4d9d1f42012-09-03 10:32:32 +00001086RCC = $(RCC) -I$(ICUINCDIR)
mistachkinc756ded2011-10-02 05:23:16 +00001087!ENDIF
mistachkin3e786092016-01-23 07:53:04 +00001088# <</mark>>
mistachkinc756ded2011-10-02 05:23:16 +00001089
mistachkin4d9d1f42012-09-03 10:32:32 +00001090# Command line prefixes for compiling code, compiling resources,
1091# linking, etc.
mistachkin4712c212014-05-09 20:51:17 +00001092#
mistachkine2bcbb42019-03-22 01:25:16 +00001093LTCOMPILE = $(TCC) -Fo$@ -Fd$*.pdb
mistachkin4d9d1f42012-09-03 10:32:32 +00001094LTRCOMPILE = $(RCC) -r
shanehb2f20bf2011-06-17 07:07:24 +00001095LTLIB = lib.exe
shaneh2a0b9ef2011-06-20 20:52:32 +00001096LTLINK = $(TCC) -Fe$@
1097
mistachkine45e0fb2015-01-21 00:48:46 +00001098# If requested, link to the RPCRT4 library.
1099#
1100!IF $(USE_RPCRT4_LIB)!=0
mistachkin041343d2017-11-21 21:15:17 +00001101LTLIBS = $(LTLIBS) rpcrt4.lib
mistachkine45e0fb2015-01-21 00:48:46 +00001102!ENDIF
1103
shaneh2a0b9ef2011-06-20 20:52:32 +00001104# If a platform was set, force the linker to target that.
1105# Note that the vcvars*.bat family of batch files typically
1106# set this for you. Otherwise, the linker will attempt
1107# to deduce the binary type based on the object files.
mistachkine37f99c2012-06-30 16:22:05 +00001108!IFDEF PLATFORM
mistachkin44723ce2015-03-21 02:22:37 +00001109LTLINKOPTS = /NOLOGO /MACHINE:$(PLATFORM)
1110LTLIBOPTS = /NOLOGO /MACHINE:$(PLATFORM)
mistachkinb1b808b2019-03-22 22:34:16 +00001111!ELSEIF "$(VISUALSTUDIOVERSION)"=="12.0" || \
1112 "$(VISUALSTUDIOVERSION)"=="14.0" || \
1113 "$(VISUALSTUDIOVERSION)"=="15.0"
mistachkin57494ad2019-03-22 16:52:17 +00001114LTLINKOPTS = /NOLOGO /MACHINE:x86
1115LTLIBOPTS = /NOLOGO /MACHINE:x86
1116!ELSE
mistachkin44723ce2015-03-21 02:22:37 +00001117LTLINKOPTS = /NOLOGO
1118LTLIBOPTS = /NOLOGO
shaneh2a0b9ef2011-06-20 20:52:32 +00001119!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +00001120
mistachkina6ff8572012-04-17 21:00:12 +00001121# When compiling for use in the WinRT environment, the following
1122# linker option must be used to mark the executable as runnable
1123# only in the context of an application container.
1124#
1125!IF $(FOR_WINRT)!=0
1126LTLINKOPTS = $(LTLINKOPTS) /APPCONTAINER
mistachkin318d38c2015-04-22 01:33:53 +00001127!IF "$(VISUALSTUDIOVERSION)"=="12.0" || "$(VISUALSTUDIOVERSION)"=="14.0"
mistachkinf6a23422014-05-05 20:24:34 +00001128!IFNDEF STORELIBPATH
mistachkinda5b1cd2013-07-10 19:39:02 +00001129!IF "$(PLATFORM)"=="x86"
mistachkin4712c212014-05-09 20:51:17 +00001130STORELIBPATH = $(CRTLIBPATH)\store
mistachkinda5b1cd2013-07-10 19:39:02 +00001131!ELSEIF "$(PLATFORM)"=="x64"
mistachkin4712c212014-05-09 20:51:17 +00001132STORELIBPATH = $(CRTLIBPATH)\store\amd64
mistachkin4eaa1292013-07-10 21:33:25 +00001133!ELSEIF "$(PLATFORM)"=="ARM"
mistachkin4712c212014-05-09 20:51:17 +00001134STORELIBPATH = $(CRTLIBPATH)\store\arm
mistachkin4eaa1292013-07-10 21:33:25 +00001135!ELSE
mistachkin4712c212014-05-09 20:51:17 +00001136STORELIBPATH = $(CRTLIBPATH)\store
mistachkinda5b1cd2013-07-10 19:39:02 +00001137!ENDIF
1138!ENDIF
mistachkinf6a23422014-05-05 20:24:34 +00001139STORELIBPATH = $(STORELIBPATH:\\=\)
1140LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(STORELIBPATH)"
1141!ENDIF
mistachkina6ff8572012-04-17 21:00:12 +00001142!ENDIF
1143
mistachkind9b3c542014-05-09 23:31:55 +00001144# When compiling for Windows Phone 8.1, an extra library path is
1145# required.
1146#
1147!IF $(USE_WP81_OPTS)!=0
1148!IFNDEF WP81LIBPATH
1149!IF "$(PLATFORM)"=="x86"
1150WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86
1151!ELSEIF "$(PLATFORM)"=="ARM"
1152WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\ARM
1153!ELSE
1154WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86
mistachkinc756ded2011-10-02 05:23:16 +00001155!ENDIF
mistachkin31856a32012-07-27 07:13:25 +00001156!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +00001157!ENDIF
1158
mistachkind9b3c542014-05-09 23:31:55 +00001159# When compiling for Windows Phone 8.1, some extra linker options
1160# are also required.
1161#
1162!IF $(USE_WP81_OPTS)!=0
1163!IFDEF WP81LIBPATH
1164LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(WP81LIBPATH)"
1165!ENDIF
1166LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE
1167LTLINKOPTS = $(LTLINKOPTS) WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelHost.lib
1168LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:kernel32.lib /NODEFAULTLIB:ole32.lib
1169!ENDIF
1170
mistachkina819aed2016-02-12 05:19:29 +00001171# When compiling for UWP or the Windows 10 platform, some extra linker
mistachkin55e88d92016-02-08 20:40:57 +00001172# options are also required.
mistachkin318d38c2015-04-22 01:33:53 +00001173#
mistachkina819aed2016-02-12 05:19:29 +00001174!IF $(FOR_UWP)!=0 || $(FOR_WIN10)!=0
mistachkin318d38c2015-04-22 01:33:53 +00001175LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE /NODEFAULTLIB:kernel32.lib
1176LTLINKOPTS = $(LTLINKOPTS) mincore.lib
1177!IFDEF PSDKLIBPATH
1178LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(PSDKLIBPATH)"
1179!ENDIF
1180!ENDIF
1181
mistachkina6f28892016-02-05 19:40:23 +00001182!IF $(FOR_WIN10)!=0
mistachkin406eeff2016-02-09 18:28:20 +00001183LTLINKOPTS = $(LTLINKOPTS) /guard:cf "/LIBPATH:$(UCRTLIBPATH)"
mistachkina6f28892016-02-05 19:40:23 +00001184!IF $(DEBUG)>1
1185LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:libucrtd.lib /DEFAULTLIB:ucrtd.lib
1186!ELSE
1187LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib
1188!ENDIF
1189!ENDIF
1190
shanehb2f20bf2011-06-17 07:07:24 +00001191# If either debugging or symbols are enabled, enable PDBs.
mistachkin4712c212014-05-09 20:51:17 +00001192#
mistachkincd54bab2014-12-20 21:14:14 +00001193!IF $(DEBUG)>1 || $(SYMBOLS)!=0
mistachkinf170ea42015-10-16 20:13:57 +00001194LDFLAGS = /DEBUG $(LDOPTS)
1195!ELSE
1196LDFLAGS = $(LDOPTS)
shanehb2f20bf2011-06-17 07:07:24 +00001197!ENDIF
1198
mistachkin3e786092016-01-23 07:53:04 +00001199# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001200# Start with the Tcl related linker options.
mistachkin4712c212014-05-09 20:51:17 +00001201#
shanehb2f20bf2011-06-17 07:07:24 +00001202!IF $(NO_TCL)==0
mistachkin590522c2018-01-05 16:05:51 +00001203TCLLIBPATHS = $(TCLLIBPATHS) /LIBPATH:$(TCLLIBDIR)
1204TCLLIBS = $(TCLLIBS) $(LIBTCL)
mistachkin31856a32012-07-27 07:13:25 +00001205!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +00001206
mistachkincb6acda2017-12-05 18:54:12 +00001207# If zlib support is enabled, add the linker options for it.
1208#
1209!IF $(USE_ZLIB)!=0
1210LTLIBPATHS = $(LTLIBPATHS) /LIBPATH:$(ZLIBLIBDIR)
1211LTLIBS = $(LTLIBS) $(ZLIBLIB)
shanehb2f20bf2011-06-17 07:07:24 +00001212!ENDIF
1213
1214# If ICU support is enabled, add the linker options for it.
mistachkin4712c212014-05-09 20:51:17 +00001215#
shanehb2f20bf2011-06-17 07:07:24 +00001216!IF $(USE_ICU)!=0
1217LTLIBPATHS = $(LTLIBPATHS) /LIBPATH:$(ICULIBDIR)
1218LTLIBS = $(LTLIBS) $(LIBICU)
1219!ENDIF
mistachkin3e786092016-01-23 07:53:04 +00001220# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001221
shanehb2f20bf2011-06-17 07:07:24 +00001222# You should not have to change anything below this line
1223###############################################################################
1224
mistachkin3e786092016-01-23 07:53:04 +00001225# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001226# Object files for the SQLite library (non-amalgamation).
1227#
mistachkinf67feef2013-07-29 19:03:20 +00001228LIBOBJS0 = vdbe.lo parse.lo alter.lo analyze.lo attach.lo auth.lo \
shanehb2f20bf2011-06-17 07:07:24 +00001229 backup.lo bitvec.lo btmutex.lo btree.lo build.lo \
drha43c8c82017-10-11 13:48:11 +00001230 callback.lo complete.lo ctime.lo \
1231 date.lo dbpage.lo dbstat.lo delete.lo \
shanehb2f20bf2011-06-17 07:07:24 +00001232 expr.lo fault.lo fkey.lo \
drh391d4ba2012-05-28 20:22:16 +00001233 fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo \
1234 fts3_porter.lo fts3_snippet.lo fts3_tokenizer.lo fts3_tokenizer1.lo \
drh4d648c72013-04-22 17:07:56 +00001235 fts3_tokenize_vtab.lo fts3_unicode.lo fts3_unicode2.lo fts3_write.lo \
mistachkined52f9f2015-06-26 04:34:36 +00001236 fts5.lo \
shanehb2f20bf2011-06-17 07:07:24 +00001237 func.lo global.lo hash.lo \
mistachkin90d6f482018-09-12 00:48:17 +00001238 icu.lo insert.lo json1.lo legacy.lo loadext.lo \
shanehb2f20bf2011-06-17 07:07:24 +00001239 main.lo malloc.lo mem0.lo mem1.lo mem2.lo mem3.lo mem5.lo \
drhac442f42018-01-03 01:28:46 +00001240 memdb.lo memjournal.lo \
mistachkinf1c6bc52012-06-21 15:09:20 +00001241 mutex.lo mutex_noop.lo mutex_unix.lo mutex_w32.lo \
1242 notify.lo opcodes.lo os.lo os_unix.lo os_win.lo \
mistachkinf67feef2013-07-29 19:03:20 +00001243 pager.lo pcache.lo pcache1.lo pragma.lo prepare.lo printf.lo \
drh498dcae2013-03-13 11:42:00 +00001244 random.lo resolve.lo rowset.lo rtree.lo \
mistachkin90d6f482018-09-12 00:48:17 +00001245 sqlite3session.lo select.lo sqlite3rbu.lo status.lo stmt.lo \
drh38b41492015-06-08 15:08:15 +00001246 table.lo threads.lo tokenize.lo treeview.lo trigger.lo \
drhfcfd7562018-04-12 21:42:51 +00001247 update.lo upsert.lo util.lo vacuum.lo \
mistachkinf67feef2013-07-29 19:03:20 +00001248 vdbeapi.lo vdbeaux.lo vdbeblob.lo vdbemem.lo vdbesort.lo \
drh6c1f4ef2015-06-08 14:23:15 +00001249 vdbetrace.lo wal.lo walker.lo where.lo wherecode.lo whereexpr.lo \
dan980cf252018-06-10 07:42:35 +00001250 window.lo utf.lo vtab.lo
mistachkin3e786092016-01-23 07:53:04 +00001251# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001252
1253# Object files for the amalgamation.
1254#
1255LIBOBJS1 = sqlite3.lo
1256
1257# Determine the real value of LIBOBJ based on the 'configure' script
1258#
mistachkin3e786092016-01-23 07:53:04 +00001259# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001260!IF $(USE_AMALGAMATION)==0
1261LIBOBJ = $(LIBOBJS0)
1262!ELSE
mistachkin3e786092016-01-23 07:53:04 +00001263# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001264LIBOBJ = $(LIBOBJS1)
mistachkin3e786092016-01-23 07:53:04 +00001265# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001266!ENDIF
mistachkin3e786092016-01-23 07:53:04 +00001267# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001268
mistachkin08c1c312012-10-06 03:48:25 +00001269# Determine if embedded resource compilation and usage are enabled.
1270#
1271!IF $(USE_RC)!=0
1272LIBRESOBJS = sqlite3res.lo
1273!ELSE
1274LIBRESOBJS =
1275!ENDIF
1276
mistachkin3e786092016-01-23 07:53:04 +00001277# <<mark>>
mistachkinc04c54b2016-02-11 21:28:16 +00001278# Core source code files, part 1.
shanehb2f20bf2011-06-17 07:07:24 +00001279#
mistachkinc04c54b2016-02-11 21:28:16 +00001280SRC00 = \
shanehb2f20bf2011-06-17 07:07:24 +00001281 $(TOP)\src\alter.c \
1282 $(TOP)\src\analyze.c \
1283 $(TOP)\src\attach.c \
1284 $(TOP)\src\auth.c \
1285 $(TOP)\src\backup.c \
1286 $(TOP)\src\bitvec.c \
1287 $(TOP)\src\btmutex.c \
1288 $(TOP)\src\btree.c \
shanehb2f20bf2011-06-17 07:07:24 +00001289 $(TOP)\src\build.c \
1290 $(TOP)\src\callback.c \
1291 $(TOP)\src\complete.c \
1292 $(TOP)\src\ctime.c \
1293 $(TOP)\src\date.c \
drha43c8c82017-10-11 13:48:11 +00001294 $(TOP)\src\dbpage.c \
drh1a4a6802015-05-04 18:31:09 +00001295 $(TOP)\src\dbstat.c \
shanehb2f20bf2011-06-17 07:07:24 +00001296 $(TOP)\src\delete.c \
1297 $(TOP)\src\expr.c \
1298 $(TOP)\src\fault.c \
1299 $(TOP)\src\fkey.c \
1300 $(TOP)\src\func.c \
1301 $(TOP)\src\global.c \
1302 $(TOP)\src\hash.c \
shanehb2f20bf2011-06-17 07:07:24 +00001303 $(TOP)\src\insert.c \
shanehb2f20bf2011-06-17 07:07:24 +00001304 $(TOP)\src\legacy.c \
1305 $(TOP)\src\loadext.c \
1306 $(TOP)\src\main.c \
1307 $(TOP)\src\malloc.c \
1308 $(TOP)\src\mem0.c \
1309 $(TOP)\src\mem1.c \
1310 $(TOP)\src\mem2.c \
1311 $(TOP)\src\mem3.c \
1312 $(TOP)\src\mem5.c \
drhac442f42018-01-03 01:28:46 +00001313 $(TOP)\src\memdb.c \
shanehb2f20bf2011-06-17 07:07:24 +00001314 $(TOP)\src\memjournal.c \
1315 $(TOP)\src\mutex.c \
shanehb2f20bf2011-06-17 07:07:24 +00001316 $(TOP)\src\mutex_noop.c \
shanehb2f20bf2011-06-17 07:07:24 +00001317 $(TOP)\src\mutex_unix.c \
1318 $(TOP)\src\mutex_w32.c \
1319 $(TOP)\src\notify.c \
1320 $(TOP)\src\os.c \
shanehb2f20bf2011-06-17 07:07:24 +00001321 $(TOP)\src\os_unix.c \
mistachkinc04c54b2016-02-11 21:28:16 +00001322 $(TOP)\src\os_win.c
1323
1324# Core source code files, part 2.
1325#
1326SRC01 = \
shanehb2f20bf2011-06-17 07:07:24 +00001327 $(TOP)\src\pager.c \
shanehb2f20bf2011-06-17 07:07:24 +00001328 $(TOP)\src\pcache.c \
shanehb2f20bf2011-06-17 07:07:24 +00001329 $(TOP)\src\pcache1.c \
1330 $(TOP)\src\pragma.c \
1331 $(TOP)\src\prepare.c \
1332 $(TOP)\src\printf.c \
1333 $(TOP)\src\random.c \
1334 $(TOP)\src\resolve.c \
1335 $(TOP)\src\rowset.c \
1336 $(TOP)\src\select.c \
1337 $(TOP)\src\status.c \
shanehb2f20bf2011-06-17 07:07:24 +00001338 $(TOP)\src\table.c \
drhf51446a2012-07-21 19:40:42 +00001339 $(TOP)\src\threads.c \
shanehb2f20bf2011-06-17 07:07:24 +00001340 $(TOP)\src\tclsqlite.c \
1341 $(TOP)\src\tokenize.c \
drh38b41492015-06-08 15:08:15 +00001342 $(TOP)\src\treeview.c \
shanehb2f20bf2011-06-17 07:07:24 +00001343 $(TOP)\src\trigger.c \
1344 $(TOP)\src\utf.c \
1345 $(TOP)\src\update.c \
drhfcfd7562018-04-12 21:42:51 +00001346 $(TOP)\src\upsert.c \
shanehb2f20bf2011-06-17 07:07:24 +00001347 $(TOP)\src\util.c \
1348 $(TOP)\src\vacuum.c \
1349 $(TOP)\src\vdbe.c \
shanehb2f20bf2011-06-17 07:07:24 +00001350 $(TOP)\src\vdbeapi.c \
1351 $(TOP)\src\vdbeaux.c \
1352 $(TOP)\src\vdbeblob.c \
1353 $(TOP)\src\vdbemem.c \
mistachkin81c428a2011-08-17 02:19:54 +00001354 $(TOP)\src\vdbesort.c \
shanehb2f20bf2011-06-17 07:07:24 +00001355 $(TOP)\src\vdbetrace.c \
shanehb2f20bf2011-06-17 07:07:24 +00001356 $(TOP)\src\vtab.c \
1357 $(TOP)\src\wal.c \
shanehb2f20bf2011-06-17 07:07:24 +00001358 $(TOP)\src\walker.c \
drhe54df422013-11-12 18:37:25 +00001359 $(TOP)\src\where.c \
drh6f82e852015-06-06 20:12:09 +00001360 $(TOP)\src\wherecode.c \
dan980cf252018-06-10 07:42:35 +00001361 $(TOP)\src\whereexpr.c \
1362 $(TOP)\src\window.c
mistachkinc04c54b2016-02-11 21:28:16 +00001363
mistachkinc04c54b2016-02-11 21:28:16 +00001364# Core miscellaneous files.
1365#
1366SRC03 = \
1367 $(TOP)\src\parse.y
1368
1369# Core header files, part 1.
1370#
1371SRC04 = \
1372 $(TOP)\src\btree.h \
1373 $(TOP)\src\btreeInt.h \
1374 $(TOP)\src\hash.h \
1375 $(TOP)\src\hwtime.h \
1376 $(TOP)\src\msvc.h \
1377 $(TOP)\src\mutex.h \
1378 $(TOP)\src\os.h \
1379 $(TOP)\src\os_common.h \
1380 $(TOP)\src\os_setup.h \
1381 $(TOP)\src\os_win.h
1382
1383# Core header files, part 2.
1384#
1385SRC05 = \
1386 $(TOP)\src\pager.h \
1387 $(TOP)\src\pcache.h \
1388 $(TOP)\src\pragma.h \
1389 $(TOP)\src\sqlite.h.in \
1390 $(TOP)\src\sqlite3ext.h \
1391 $(TOP)\src\sqliteInt.h \
1392 $(TOP)\src\sqliteLimit.h \
1393 $(TOP)\src\vdbe.h \
1394 $(TOP)\src\vdbeInt.h \
1395 $(TOP)\src\vxworks.h \
1396 $(TOP)\src\wal.h \
drhe54df422013-11-12 18:37:25 +00001397 $(TOP)\src\whereInt.h
shanehb2f20bf2011-06-17 07:07:24 +00001398
mistachkinc04c54b2016-02-11 21:28:16 +00001399# Extension source code files, part 1.
shanehb2f20bf2011-06-17 07:07:24 +00001400#
mistachkinc04c54b2016-02-11 21:28:16 +00001401SRC06 = \
shanehb2f20bf2011-06-17 07:07:24 +00001402 $(TOP)\ext\fts1\fts1.c \
shanehb2f20bf2011-06-17 07:07:24 +00001403 $(TOP)\ext\fts1\fts1_hash.c \
shanehb2f20bf2011-06-17 07:07:24 +00001404 $(TOP)\ext\fts1\fts1_porter.c \
drh62679202015-01-29 18:38:05 +00001405 $(TOP)\ext\fts1\fts1_tokenizer1.c \
shanehb2f20bf2011-06-17 07:07:24 +00001406 $(TOP)\ext\fts2\fts2.c \
shanehb2f20bf2011-06-17 07:07:24 +00001407 $(TOP)\ext\fts2\fts2_hash.c \
shanehb2f20bf2011-06-17 07:07:24 +00001408 $(TOP)\ext\fts2\fts2_icu.c \
1409 $(TOP)\ext\fts2\fts2_porter.c \
shanehb2f20bf2011-06-17 07:07:24 +00001410 $(TOP)\ext\fts2\fts2_tokenizer.c \
1411 $(TOP)\ext\fts2\fts2_tokenizer1.c
mistachkinc04c54b2016-02-11 21:28:16 +00001412
1413# Extension source code files, part 2.
1414#
1415SRC07 = \
shanehb2f20bf2011-06-17 07:07:24 +00001416 $(TOP)\ext\fts3\fts3.c \
shanehb2f20bf2011-06-17 07:07:24 +00001417 $(TOP)\ext\fts3\fts3_aux.c \
1418 $(TOP)\ext\fts3\fts3_expr.c \
1419 $(TOP)\ext\fts3\fts3_hash.c \
shanehb2f20bf2011-06-17 07:07:24 +00001420 $(TOP)\ext\fts3\fts3_icu.c \
1421 $(TOP)\ext\fts3\fts3_porter.c \
1422 $(TOP)\ext\fts3\fts3_snippet.c \
shanehb2f20bf2011-06-17 07:07:24 +00001423 $(TOP)\ext\fts3\fts3_tokenizer.c \
1424 $(TOP)\ext\fts3\fts3_tokenizer1.c \
drh4d648c72013-04-22 17:07:56 +00001425 $(TOP)\ext\fts3\fts3_tokenize_vtab.c \
drh391d4ba2012-05-28 20:22:16 +00001426 $(TOP)\ext\fts3\fts3_unicode.c \
1427 $(TOP)\ext\fts3\fts3_unicode2.c \
drh62679202015-01-29 18:38:05 +00001428 $(TOP)\ext\fts3\fts3_write.c \
drh62679202015-01-29 18:38:05 +00001429 $(TOP)\ext\icu\icu.c \
drhedea9112015-03-24 19:02:13 +00001430 $(TOP)\ext\rtree\rtree.c \
drhdbbd8162015-05-19 23:04:26 +00001431 $(TOP)\ext\session\sqlite3session.c \
drh50065652015-10-08 19:29:18 +00001432 $(TOP)\ext\rbu\sqlite3rbu.c \
drhf00f5302017-06-28 15:47:29 +00001433 $(TOP)\ext\misc\json1.c \
drhc6603af2017-06-29 14:33:51 +00001434 $(TOP)\ext\misc\stmt.c
shanehb2f20bf2011-06-17 07:07:24 +00001435
mistachkinc04c54b2016-02-11 21:28:16 +00001436# Extension header files, part 1.
1437#
1438SRC08 = \
1439 $(TOP)\ext\fts1\fts1.h \
1440 $(TOP)\ext\fts1\fts1_hash.h \
1441 $(TOP)\ext\fts1\fts1_tokenizer.h \
1442 $(TOP)\ext\fts2\fts2.h \
1443 $(TOP)\ext\fts2\fts2_hash.h \
1444 $(TOP)\ext\fts2\fts2_tokenizer.h
1445
1446# Extension header files, part 2.
1447#
1448SRC09 = \
1449 $(TOP)\ext\fts3\fts3.h \
1450 $(TOP)\ext\fts3\fts3Int.h \
1451 $(TOP)\ext\fts3\fts3_hash.h \
1452 $(TOP)\ext\fts3\fts3_tokenizer.h \
1453 $(TOP)\ext\icu\sqliteicu.h \
1454 $(TOP)\ext\rtree\rtree.h \
drh748b8fd2018-05-25 19:22:47 +00001455 $(TOP)\ext\rtree\geopoly.c \
mistachkin05004782016-03-30 16:23:06 +00001456 $(TOP)\ext\rbu\sqlite3rbu.h \
1457 $(TOP)\ext\session\sqlite3session.h
shanehb2f20bf2011-06-17 07:07:24 +00001458
1459# Generated source code files
1460#
mistachkinc04c54b2016-02-11 21:28:16 +00001461SRC10 = \
shanehb2f20bf2011-06-17 07:07:24 +00001462 opcodes.c \
mistachkinc04c54b2016-02-11 21:28:16 +00001463 parse.c
1464
1465# Generated header files
1466#
1467SRC11 = \
1468 keywordhash.h \
shanehb2f20bf2011-06-17 07:07:24 +00001469 opcodes.h \
shanehb2f20bf2011-06-17 07:07:24 +00001470 parse.h \
drhaa62d2e2017-10-12 13:47:48 +00001471 shell.c \
mistachkin5d4d9412016-01-22 03:54:36 +00001472 $(SQLITE3H)
shanehb2f20bf2011-06-17 07:07:24 +00001473
mistachkin52b1dbb2016-07-28 14:37:04 +00001474# Generated Tcl header files
1475#
mistachkin4ef916e2016-08-24 19:58:46 +00001476!IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
mistachkin52b1dbb2016-07-28 14:37:04 +00001477SRC12 = \
mistachkin4ef916e2016-08-24 19:58:46 +00001478 $(SQLITETCLH) \
1479 $(SQLITETCLDECLSH)
1480!ELSE
1481SRC12 =
1482!ENDIF
mistachkin52b1dbb2016-07-28 14:37:04 +00001483
drh62679202015-01-29 18:38:05 +00001484# All source code files.
1485#
drhaa62d2e2017-10-12 13:47:48 +00001486SRC = $(SRC00) $(SRC01) $(SRC03) $(SRC04) $(SRC05) $(SRC06) $(SRC07) $(SRC08) $(SRC09) $(SRC10) $(SRC11)
drh62679202015-01-29 18:38:05 +00001487
shanehb2f20bf2011-06-17 07:07:24 +00001488# Source code to the test files.
1489#
1490TESTSRC = \
1491 $(TOP)\src\test1.c \
1492 $(TOP)\src\test2.c \
1493 $(TOP)\src\test3.c \
1494 $(TOP)\src\test4.c \
1495 $(TOP)\src\test5.c \
1496 $(TOP)\src\test6.c \
1497 $(TOP)\src\test7.c \
1498 $(TOP)\src\test8.c \
1499 $(TOP)\src\test9.c \
1500 $(TOP)\src\test_autoext.c \
1501 $(TOP)\src\test_async.c \
1502 $(TOP)\src\test_backup.c \
drhddebf162016-03-04 02:59:35 +00001503 $(TOP)\src\test_bestindex.c \
drh5de7d962014-12-05 00:17:39 +00001504 $(TOP)\src\test_blob.c \
shanehb2f20bf2011-06-17 07:07:24 +00001505 $(TOP)\src\test_btree.c \
1506 $(TOP)\src\test_config.c \
dan000f95b2016-09-09 20:00:40 +00001507 $(TOP)\src\test_delete.c \
shanehb2f20bf2011-06-17 07:07:24 +00001508 $(TOP)\src\test_demovfs.c \
1509 $(TOP)\src\test_devsym.c \
mistachkin413c63b2013-01-17 03:18:14 +00001510 $(TOP)\src\test_fs.c \
shanehb2f20bf2011-06-17 07:07:24 +00001511 $(TOP)\src\test_func.c \
shanehb2f20bf2011-06-17 07:07:24 +00001512 $(TOP)\src\test_hexio.c \
1513 $(TOP)\src\test_init.c \
1514 $(TOP)\src\test_intarray.c \
1515 $(TOP)\src\test_journal.c \
1516 $(TOP)\src\test_malloc.c \
drhc318f732017-10-13 15:06:06 +00001517 $(TOP)\src\test_md5.c \
shanehb2f20bf2011-06-17 07:07:24 +00001518 $(TOP)\src\test_multiplex.c \
1519 $(TOP)\src\test_mutex.c \
1520 $(TOP)\src\test_onefile.c \
1521 $(TOP)\src\test_osinst.c \
1522 $(TOP)\src\test_pcache.c \
1523 $(TOP)\src\test_quota.c \
1524 $(TOP)\src\test_rtree.c \
1525 $(TOP)\src\test_schema.c \
1526 $(TOP)\src\test_server.c \
1527 $(TOP)\src\test_superlock.c \
1528 $(TOP)\src\test_syscall.c \
drhc318f732017-10-13 15:06:06 +00001529 $(TOP)\src\test_tclsh.c \
shanehb2f20bf2011-06-17 07:07:24 +00001530 $(TOP)\src\test_tclvar.c \
1531 $(TOP)\src\test_thread.c \
dan1d07f1d2019-04-01 17:24:20 +00001532 $(TOP)\src\test_vdbecov.c \
shanehb2f20bf2011-06-17 07:07:24 +00001533 $(TOP)\src\test_vfs.c \
mistachkin92af1eb2015-11-30 23:29:07 +00001534 $(TOP)\src\test_windirent.c \
dan660af932018-06-18 16:55:22 +00001535 $(TOP)\src\test_window.c \
shanehb2f20bf2011-06-17 07:07:24 +00001536 $(TOP)\src\test_wsd.c \
1537 $(TOP)\ext\fts3\fts3_term.c \
mistachkinadb96a62012-01-16 12:33:36 +00001538 $(TOP)\ext\fts3\fts3_test.c \
mistachkin05004782016-03-30 16:23:06 +00001539 $(TOP)\ext\rbu\test_rbu.c \
1540 $(TOP)\ext\session\test_session.c
shanehb2f20bf2011-06-17 07:07:24 +00001541
mistachkinc04c54b2016-02-11 21:28:16 +00001542# Statically linked extensions.
drhe50db1c2013-04-25 14:31:46 +00001543#
drh1fb64af2013-04-25 14:36:28 +00001544TESTEXT = \
drhbd0f1db2017-05-03 12:50:46 +00001545 $(TOP)\ext\expert\sqlite3expert.c \
1546 $(TOP)\ext\expert\test_expert.c \
drh8416fc72013-04-25 16:42:55 +00001547 $(TOP)\ext\misc\amatch.c \
drh2e3f87a2016-07-03 02:35:47 +00001548 $(TOP)\ext\misc\carray.c \
drh8416fc72013-04-25 16:42:55 +00001549 $(TOP)\ext\misc\closure.c \
drh35db31b2016-06-02 23:13:21 +00001550 $(TOP)\ext\misc\csv.c \
drh1728bcb2014-11-10 16:49:56 +00001551 $(TOP)\ext\misc\eval.c \
drh9b84f032018-09-16 16:18:01 +00001552 $(TOP)\ext\misc\explain.c \
drh51ed2982014-06-16 12:44:32 +00001553 $(TOP)\ext\misc\fileio.c \
drhe50db1c2013-04-25 14:31:46 +00001554 $(TOP)\ext\misc\fuzzer.c \
mistachkined52f9f2015-06-26 04:34:36 +00001555 $(TOP)\ext\fts5\fts5_tcl.c \
dand3789c02015-08-04 20:29:00 +00001556 $(TOP)\ext\fts5\fts5_test_mi.c \
dan2cfe0492016-01-14 20:05:59 +00001557 $(TOP)\ext\fts5\fts5_test_tok.c \
drh8416fc72013-04-25 16:42:55 +00001558 $(TOP)\ext\misc\ieee754.c \
drh262d5512017-09-18 18:08:54 +00001559 $(TOP)\ext\misc\mmapwarm.c \
drhea41dc42013-04-25 19:31:33 +00001560 $(TOP)\ext\misc\nextchar.c \
drh91694db2018-01-08 20:04:57 +00001561 $(TOP)\ext\misc\normalize.c \
drhdef33672013-05-28 20:25:54 +00001562 $(TOP)\ext\misc\percentile.c \
dan9c039d92019-01-14 20:44:00 +00001563 $(TOP)\ext\misc\prefixes.c \
drhe50db1c2013-04-25 14:31:46 +00001564 $(TOP)\ext\misc\regexp.c \
drh6bada272016-08-09 21:08:42 +00001565 $(TOP)\ext\misc\remember.c \
drh398f8722015-08-19 13:54:20 +00001566 $(TOP)\ext\misc\series.c \
drhb7045ab2013-04-25 14:59:01 +00001567 $(TOP)\ext\misc\spellfix.c \
drh5f8cdac2013-10-14 21:14:42 +00001568 $(TOP)\ext\misc\totype.c \
drh3935ce82017-07-18 20:28:34 +00001569 $(TOP)\ext\misc\unionvtab.c \
drhe50db1c2013-04-25 14:31:46 +00001570 $(TOP)\ext\misc\wholenumber.c
1571
mistachkin590522c2018-01-05 16:05:51 +00001572# If use of zlib is enabled, add the "zipfile.c" source file.
1573#
1574!IF $(USE_ZLIB)!=0
1575TESTEXT = $(TESTEXT) $(TOP)\ext\misc\zipfile.c
1576!ENDIF
drhe50db1c2013-04-25 14:31:46 +00001577
shanehb2f20bf2011-06-17 07:07:24 +00001578# Source code to the library files needed by the test fixture
mistachkinadb96a62012-01-16 12:33:36 +00001579# (non-amalgamation)
shanehb2f20bf2011-06-17 07:07:24 +00001580#
1581TESTSRC2 = \
mistachkinc04c54b2016-02-11 21:28:16 +00001582 $(SRC00) \
1583 $(SRC01) \
1584 $(SRC06) \
1585 $(SRC07) \
1586 $(SRC10) \
mistachkin05004782016-03-30 16:23:06 +00001587 $(TOP)\ext\async\sqlite3async.c
shanehb2f20bf2011-06-17 07:07:24 +00001588
1589# Header files used by all library source files.
1590#
1591HDR = \
1592 $(TOP)\src\btree.h \
1593 $(TOP)\src\btreeInt.h \
1594 $(TOP)\src\hash.h \
1595 $(TOP)\src\hwtime.h \
1596 keywordhash.h \
mistachkin2318d332015-01-12 18:02:52 +00001597 $(TOP)\src\msvc.h \
shanehb2f20bf2011-06-17 07:07:24 +00001598 $(TOP)\src\mutex.h \
1599 opcodes.h \
1600 $(TOP)\src\os.h \
1601 $(TOP)\src\os_common.h \
mistachkinf74b9e02013-11-26 01:00:31 +00001602 $(TOP)\src\os_setup.h \
mistachkin8bc52622013-11-25 09:36:07 +00001603 $(TOP)\src\os_win.h \
shanehb2f20bf2011-06-17 07:07:24 +00001604 $(TOP)\src\pager.h \
1605 $(TOP)\src\pcache.h \
shaneh6e7850c2011-06-17 15:57:07 +00001606 parse.h \
drh67e65e52015-02-02 21:34:54 +00001607 $(TOP)\src\pragma.h \
mistachkin5d4d9412016-01-22 03:54:36 +00001608 $(SQLITE3H) \
mistachkine37f7392016-07-28 19:28:35 +00001609 sqlite3ext.h \
shaneh6e7850c2011-06-17 15:57:07 +00001610 $(TOP)\src\sqliteInt.h \
shanehb2f20bf2011-06-17 07:07:24 +00001611 $(TOP)\src\sqliteLimit.h \
1612 $(TOP)\src\vdbe.h \
drhe54df422013-11-12 18:37:25 +00001613 $(TOP)\src\vdbeInt.h \
drh8cd5b252015-03-02 22:06:43 +00001614 $(TOP)\src\vxworks.h \
drhe54df422013-11-12 18:37:25 +00001615 $(TOP)\src\whereInt.h
shanehb2f20bf2011-06-17 07:07:24 +00001616
1617# Header files used by extensions
1618#
1619EXTHDR = $(EXTHDR) \
1620 $(TOP)\ext\fts1\fts1.h \
1621 $(TOP)\ext\fts1\fts1_hash.h \
1622 $(TOP)\ext\fts1\fts1_tokenizer.h
1623EXTHDR = $(EXTHDR) \
1624 $(TOP)\ext\fts2\fts2.h \
1625 $(TOP)\ext\fts2\fts2_hash.h \
1626 $(TOP)\ext\fts2\fts2_tokenizer.h
1627EXTHDR = $(EXTHDR) \
1628 $(TOP)\ext\fts3\fts3.h \
1629 $(TOP)\ext\fts3\fts3Int.h \
1630 $(TOP)\ext\fts3\fts3_hash.h \
1631 $(TOP)\ext\fts3\fts3_tokenizer.h
1632EXTHDR = $(EXTHDR) \
drh748b8fd2018-05-25 19:22:47 +00001633 $(TOP)\ext\rtree\rtree.h \
1634 $(TOP)\ext\rtree\geopoly.c
shanehb2f20bf2011-06-17 07:07:24 +00001635EXTHDR = $(EXTHDR) \
1636 $(TOP)\ext\icu\sqliteicu.h
1637EXTHDR = $(EXTHDR) \
1638 $(TOP)\ext\rtree\sqlite3rtree.h
mistachkinadb96a62012-01-16 12:33:36 +00001639EXTHDR = $(EXTHDR) \
1640 $(TOP)\ext\session\sqlite3session.h
shanehb2f20bf2011-06-17 07:07:24 +00001641
mistachkind4ab1032015-05-11 16:27:33 +00001642# executables needed for testing
drhf4375442015-05-11 12:15:45 +00001643#
1644TESTPROGS = \
1645 testfixture.exe \
mistachkinedcb4eb2016-01-22 01:25:15 +00001646 $(SQLITE3EXE) \
drhf4375442015-05-11 12:15:45 +00001647 sqlite3_analyzer.exe \
drh2737fa02017-10-31 15:49:19 +00001648 sqlite3_checker.exe \
drh290fcaa2016-06-08 01:03:05 +00001649 sqldiff.exe \
drh9dea1732018-01-06 04:34:05 +00001650 dbhash.exe \
1651 sqltclsh.exe
drhf4375442015-05-11 12:15:45 +00001652
drhea93c702015-05-26 18:15:08 +00001653# Databases containing fuzzer test cases
1654#
1655FUZZDATA = \
1656 $(TOP)\test\fuzzdata1.db \
1657 $(TOP)\test\fuzzdata2.db \
drh64ff56f2015-09-23 11:59:50 +00001658 $(TOP)\test\fuzzdata3.db \
drh362b66f2016-11-14 18:27:41 +00001659 $(TOP)\test\fuzzdata4.db \
drh5ecf9032018-05-08 12:49:53 +00001660 $(TOP)\test\fuzzdata5.db \
drh05209e92018-10-31 01:12:06 +00001661 $(TOP)\test\fuzzdata6.db \
drha47e7092019-01-25 04:00:14 +00001662 $(TOP)\test\fuzzdata7.db \
1663 $(TOP)\test\fuzzdata8.db
mistachkin3e786092016-01-23 07:53:04 +00001664# <</mark>>
drhea93c702015-05-26 18:15:08 +00001665
mistachkin5d4d9412016-01-22 03:54:36 +00001666# Additional compiler options for the shell. These are only effective
1667# when the shell is not being dynamically linked.
drhd7f2bea2015-09-19 14:32:51 +00001668#
mistachkin5d4d9412016-01-22 03:54:36 +00001669!IF $(DYNAMIC_SHELL)==0 && $(FOR_WIN10)==0
mistachkin90d6f482018-09-12 00:48:17 +00001670SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_FTS4=1
1671SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_EXPLAIN_COMMENTS=1
1672SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_OFFSET_SQL_FUNC=1
drh60f34ae2018-10-30 13:19:49 +00001673SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_DESERIALIZE=1
mistachkinedcb4eb2016-01-22 01:25:15 +00001674!ENDIF
1675
mistachkin3e786092016-01-23 07:53:04 +00001676# <<mark>>
mistachkin5d4d9412016-01-22 03:54:36 +00001677# Extra compiler options for various test tools.
1678#
mistachkin690e8852017-10-11 17:50:22 +00001679MPTESTER_COMPILE_OPTS = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5
mistachkin8381be42015-10-09 14:23:56 +00001680FUZZERSHELL_COMPILE_OPTS = -DSQLITE_ENABLE_JSON1
drha47e7092019-01-25 04:00:14 +00001681FUZZCHECK_OPTS = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMSYS5 -DSQLITE_OSS_FUZZ -DSQLITE_MAX_MEMORY=50000000 -DSQLITE_PRINTF_PRECISION_LIMIT=1000
1682FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_DESERIALIZE
1683FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_FTS4
1684FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_RTREE
1685FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_GEOPOLY
1686FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_DBSTAT_VTAB
1687
drh362b66f2016-11-14 18:27:41 +00001688FUZZCHECK_SRC = $(TOP)\test\fuzzcheck.c $(TOP)\test\ossfuzz.c
1689OSSSHELL_SRC = $(TOP)\test\ossshell.c $(TOP)\test\ossfuzz.c
mistachkin953fbd12017-02-07 21:09:34 +00001690DBFUZZ_COMPILE_OPTS = -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION
1691KV_COMPILE_OPTS = -DSQLITE_THREADSAFE=0 -DSQLITE_DIRECT_OVERFLOW_READ
mistachkin953fbd12017-02-07 21:09:34 +00001692ST_COMPILE_OPTS = -DSQLITE_THREADSAFE=0
drhf4375442015-05-11 12:15:45 +00001693
mistachkin5d4d9412016-01-22 03:54:36 +00001694# Standard options to testfixture.
drh905da632015-06-10 18:53:09 +00001695#
1696TESTOPTS = --verbose=file --output=test-out.txt
drhf4375442015-05-11 12:15:45 +00001697
mistachkind5be6f02016-01-27 07:28:33 +00001698# Extra targets for the "all" target that require Tcl.
1699#
1700!IF $(NO_TCL)==0
mistachkine2bcbb42019-03-22 01:25:16 +00001701ALL_TCL_TARGETS = $(SQLITE3TCLDLL)
mistachkind5be6f02016-01-27 07:28:33 +00001702!ELSE
1703ALL_TCL_TARGETS =
1704!ENDIF
mistachkin3e786092016-01-23 07:53:04 +00001705# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001706
1707# This is the default Makefile target. The objects listed here
1708# are what get build when you type just "make" with no arguments.
1709#
mistachkinaf238992018-01-05 17:40:38 +00001710core: dll libsqlite3.lib shell
1711
1712# Targets that require the Tcl library.
1713#
1714tcl: $(ALL_TCL_TARGETS)
1715
1716# This Makefile target builds all of the standard binaries.
1717#
1718all: core tcl
shanehb2f20bf2011-06-17 07:07:24 +00001719
mistachkina8a18732016-01-22 22:16:50 +00001720# Dynamic link library section.
1721#
mistachkin9b88ace2016-02-26 21:01:37 +00001722dll: $(SQLITE3DLL)
mistachkina8a18732016-01-22 22:16:50 +00001723
1724# Shell executable.
1725#
mistachkin9b88ace2016-02-26 21:01:37 +00001726shell: $(SQLITE3EXE)
shanehb2f20bf2011-06-17 07:07:24 +00001727
mistachkinb0c99af2016-02-19 05:07:56 +00001728# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001729libsqlite3.lib: $(LIBOBJ)
shaneh29ebea82011-06-21 18:12:07 +00001730 $(LTLIB) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001731
1732libtclsqlite3.lib: tclsqlite.lo libsqlite3.lib
mistachkine2bcbb42019-03-22 01:25:16 +00001733 $(LTLIB) $(LTLIBOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCLSTUB) $(TLIBS)
1734
1735tclsqlite3.def: tclsqlite.lo
1736 echo EXPORTS > tclsqlite3.def
1737 dumpbin /all tclsqlite.lo \
1738 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl include "^\s+/EXPORT:_?((?:Sqlite3|Tclsqlite3)_[^@]*)(?:@\d+)?$$" \1 \
1739 | sort >> tclsqlite3.def
1740
1741pkgIndex.tcl: $(TOP)\VERSION
1742 for /F %%V in ('type "$(TOP)\VERSION"') do ( \
1743 echo package ifneeded sqlite3 @version@ [list load [file join $$dir $(SQLITE3TCLDLL)] sqlite3] \
1744 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact @version@ %%V > pkgIndex.tcl \
1745 )
1746
1747$(SQLITE3TCLDLL): libtclsqlite3.lib $(LIBRESOBJS) tclsqlite3.def pkgIndex.tcl
1748 $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /DEF:tclsqlite3.def /OUT:$@ libtclsqlite3.lib $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
mistachkin3e786092016-01-23 07:53:04 +00001749# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001750
mistachkin9b88ace2016-02-26 21:01:37 +00001751$(SQLITE3DLL): $(LIBOBJ) $(LIBRESOBJS) $(CORE_LINK_DEP)
mistachkina8a18732016-01-22 22:16:50 +00001752 $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL $(CORE_LINK_OPTS) /OUT:$@ $(LIBOBJ) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001753
mistachkin9aeb9712016-02-26 23:13:16 +00001754# <<block2>>
mistachkin9b88ace2016-02-26 21:01:37 +00001755sqlite3.def: libsqlite3.lib
mistachkina8a18732016-01-22 22:16:50 +00001756 echo EXPORTS > sqlite3.def
1757 dumpbin /all libsqlite3.lib \
mistachkine99cb2d2019-12-20 17:41:15 +00001758 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl include "^\s+1 _?(sqlite3(?:session|changeset|changegroup|rebaser|rbu)?_[^@]*)(?:@\d+)?$$" \1 \
mistachkina8a18732016-01-22 22:16:50 +00001759 | sort >> sqlite3.def
mistachkin9aeb9712016-02-26 23:13:16 +00001760# <</block2>>
drhd62c0f42015-04-09 13:34:29 +00001761
drhaa62d2e2017-10-12 13:47:48 +00001762$(SQLITE3EXE): shell.c $(SHELL_CORE_DEP) $(LIBRESOBJS) $(SHELL_CORE_SRC) $(SQLITE3H)
1763 $(LTLINK) $(SHELL_COMPILE_OPTS) $(READLINE_FLAGS) shell.c $(SHELL_CORE_SRC) \
mistachkinedcb4eb2016-01-22 01:25:15 +00001764 /link $(SQLITE3EXEPDB) $(LDFLAGS) $(LTLINKOPTS) $(SHELL_LINK_OPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS)
drh268e72f2015-04-17 14:30:49 +00001765
mistachkin3e786092016-01-23 07:53:04 +00001766# <<mark>>
mistachkin5d4d9412016-01-22 03:54:36 +00001767sqldiff.exe: $(TOP)\tool\sqldiff.c $(SQLITE3C) $(SQLITE3H)
1768 $(LTLINK) $(NO_WARN) $(TOP)\tool\sqldiff.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
mistachkin44723ce2015-03-21 02:22:37 +00001769
drh290fcaa2016-06-08 01:03:05 +00001770dbhash.exe: $(TOP)\tool\dbhash.c $(SQLITE3C) $(SQLITE3H)
1771 $(LTLINK) $(NO_WARN) $(TOP)\tool\dbhash.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
1772
drhda110bf2016-05-05 17:15:23 +00001773scrub.exe: $(TOP)\ext\misc\scrub.c $(SQLITE3C) $(SQLITE3H)
mistachkinac8ba262018-03-07 14:42:17 +00001774 $(LTLINK) $(NO_WARN) -DSCRUB_STANDALONE=1 $(TOP)\ext\misc\scrub.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drhda110bf2016-05-05 17:15:23 +00001775
drhfd0d93f2016-02-07 00:08:08 +00001776srcck1.exe: $(TOP)\tool\srcck1.c
1777 $(BCC) $(NO_WARN) -Fe$@ $(TOP)\tool\srcck1.c
1778
mistachkin1f237e32018-07-27 20:45:28 +00001779sourcetest: srcck1.exe $(SQLITE3C)
1780 srcck1.exe $(SQLITE3C)
drhfd0d93f2016-02-07 00:08:08 +00001781
mistachkin5d4d9412016-01-22 03:54:36 +00001782fuzzershell.exe: $(TOP)\tool\fuzzershell.c $(SQLITE3C) $(SQLITE3H)
1783 $(LTLINK) $(NO_WARN) $(FUZZERSHELL_COMPILE_OPTS) $(TOP)\tool\fuzzershell.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drhbc94dbb2013-04-08 14:28:33 +00001784
mistachkin953fbd12017-02-07 21:09:34 +00001785dbfuzz.exe: $(TOP)\test\dbfuzz.c $(SQLITE3C) $(SQLITE3H)
1786 $(LTLINK) $(NO_WARN) $(DBFUZZ_COMPILE_OPTS) $(TOP)\test\dbfuzz.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
1787
drh362b66f2016-11-14 18:27:41 +00001788fuzzcheck.exe: $(FUZZCHECK_SRC) $(SQLITE3C) $(SQLITE3H)
drha47e7092019-01-25 04:00:14 +00001789 $(LTLINK) $(NO_WARN) $(FUZZCHECK_OPTS) $(FUZZCHECK_SRC) $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh362b66f2016-11-14 18:27:41 +00001790
1791ossshell.exe: $(OSSSHELL_SRC) $(SQLITE3C) $(SQLITE3H)
drha47e7092019-01-25 04:00:14 +00001792 $(LTLINK) $(NO_WARN) $(FUZZCHECK_OPTS) $(OSSSHELL_SRC) $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh1573dc32015-05-25 22:29:26 +00001793
mistachkin98cb7a42018-03-07 21:13:49 +00001794sessionfuzz.exe: zlib $(TOP)\test\sessionfuzz.c $(SQLITE3C) $(SQLITE3H)
1795 $(LTLINK) $(NO_WARN) -I$(ZLIBINCDIR) $(TOP)\test\sessionfuzz.c /link $(LDFLAGS) $(LTLINKOPTS) /LIBPATH:$(ZLIBLIBDIR) $(ZLIBLIB)
1796
mistachkin5d4d9412016-01-22 03:54:36 +00001797mptester.exe: $(TOP)\mptest\mptest.c $(SQLITE3C) $(SQLITE3H)
1798 $(LTLINK) $(NO_WARN) $(MPTESTER_COMPILE_OPTS) $(TOP)\mptest\mptest.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drhbc94dbb2013-04-08 14:28:33 +00001799
mistachkineb48b062015-03-31 17:45:44 +00001800MPTEST1 = mptester mptest.db $(TOP)\mptest\crash01.test --repeat 20
1801MPTEST2 = mptester mptest.db $(TOP)\mptest\multiwrite01.test --repeat 20
mistachkin4d2daba2015-03-31 16:42:16 +00001802
drhfe0ba712015-03-31 13:46:13 +00001803mptest: mptester.exe
mistachkin4d2daba2015-03-31 16:42:16 +00001804 del /Q mptest.db 2>NUL
drhfe0ba712015-03-31 13:46:13 +00001805 $(MPTEST1) --journalmode DELETE
1806 $(MPTEST2) --journalmode WAL
1807 $(MPTEST1) --journalmode WAL
1808 $(MPTEST2) --journalmode PERSIST
1809 $(MPTEST1) --journalmode PERSIST
1810 $(MPTEST2) --journalmode TRUNCATE
1811 $(MPTEST1) --journalmode TRUNCATE
1812 $(MPTEST2) --journalmode DELETE
1813
shanehb2f20bf2011-06-17 07:07:24 +00001814# This target creates a directory named "tsrc" and fills it with
1815# copies of all of the C source code and header files needed to
1816# build on the target system. Some of the C source code and header
1817# files are automatically generated. This target takes care of
1818# all that automatic generation.
1819#
mistachkin4ef916e2016-08-24 19:58:46 +00001820.target_source: $(SRC) $(TOP)\tool\vdbe-compress.tcl fts5.c $(SQLITE_TCL_DEP)
mistachkin44723ce2015-03-21 02:22:37 +00001821 -rmdir /Q/S tsrc 2>NUL
shanehb2f20bf2011-06-17 07:07:24 +00001822 -mkdir tsrc
mistachkine2eb2592016-02-11 21:38:05 +00001823 for %i in ($(SRC00)) do copy /Y %i tsrc
1824 for %i in ($(SRC01)) do copy /Y %i tsrc
mistachkine2eb2592016-02-11 21:38:05 +00001825 for %i in ($(SRC03)) do copy /Y %i tsrc
1826 for %i in ($(SRC04)) do copy /Y %i tsrc
1827 for %i in ($(SRC05)) do copy /Y %i tsrc
1828 for %i in ($(SRC06)) do copy /Y %i tsrc
1829 for %i in ($(SRC07)) do copy /Y %i tsrc
1830 for %i in ($(SRC08)) do copy /Y %i tsrc
1831 for %i in ($(SRC09)) do copy /Y %i tsrc
1832 for %i in ($(SRC10)) do copy /Y %i tsrc
1833 for %i in ($(SRC11)) do copy /Y %i tsrc
mistachkin52b1dbb2016-07-28 14:37:04 +00001834 for %i in ($(SRC12)) do copy /Y %i tsrc
drh50065652015-10-08 19:29:18 +00001835 copy /Y fts5.c tsrc
1836 copy /Y fts5.h tsrc
mistachkin44723ce2015-03-21 02:22:37 +00001837 del /Q tsrc\sqlite.h.in tsrc\parse.y 2>NUL
drh2dc06482013-12-11 00:59:10 +00001838 $(TCLSH_CMD) $(TOP)\tool\vdbe-compress.tcl $(OPTS) < tsrc\vdbe.c > vdbe.new
shanehb2f20bf2011-06-17 07:07:24 +00001839 move vdbe.new tsrc\vdbe.c
1840 echo > .target_source
1841
mistachkin4ef916e2016-08-24 19:58:46 +00001842sqlite3.c: .target_source sqlite3ext.h $(MKSQLITE3C_TOOL)
1843 $(TCLSH_CMD) $(MKSQLITE3C_TOOL) $(MKSQLITE3C_ARGS)
drhe191e2c2013-03-19 15:23:18 +00001844 copy $(TOP)\ext\session\sqlite3session.h .
shanehb2f20bf2011-06-17 07:07:24 +00001845
mistachkin48dd9de2012-12-06 04:33:13 +00001846sqlite3-all.c: sqlite3.c $(TOP)\tool\split-sqlite3c.tcl
1847 $(TCLSH_CMD) $(TOP)\tool\split-sqlite3c.tcl
mistachkin3e786092016-01-23 07:53:04 +00001848# <</mark>>
mistachkin76510912013-10-11 23:01:18 +00001849
shanehb2f20bf2011-06-17 07:07:24 +00001850# Rule to build the amalgamation
1851#
mistachkin76510912013-10-11 23:01:18 +00001852sqlite3.lo: $(SQLITE3C)
mistachkin44723ce2015-03-21 02:22:37 +00001853 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(SQLITE3C)
shanehb2f20bf2011-06-17 07:07:24 +00001854
mistachkin3e786092016-01-23 07:53:04 +00001855# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001856# Rules to build the LEMON compiler generator
1857#
drh82415f22015-11-09 19:33:42 +00001858lempar.c: $(TOP)\tool\lempar.c
1859 copy $(TOP)\tool\lempar.c .
shanehb2f20bf2011-06-17 07:07:24 +00001860
1861lemon.exe: $(TOP)\tool\lemon.c lempar.c
mistachkin2318d332015-01-12 18:02:52 +00001862 $(BCC) $(NO_WARN) -Daccess=_access \
mistachkin460cd9c2015-10-14 22:46:37 +00001863 -Fe$@ $(TOP)\tool\lemon.c /link $(LDFLAGS) $(NLTLINKOPTS) $(NLTLIBPATHS)
shanehb2f20bf2011-06-17 07:07:24 +00001864
drhf39e0ed2017-08-22 19:19:00 +00001865# <<mark>>
1866# Rules to build the source-id generator tool
1867#
1868mksourceid.exe: $(TOP)\tool\mksourceid.c
1869 $(BCC) $(NO_WARN) -Fe$@ $(TOP)\tool\mksourceid.c /link $(LDFLAGS) $(NLTLINKOPTS) $(NLTLIBPATHS)
1870
shanehb2f20bf2011-06-17 07:07:24 +00001871# Rules to build individual *.lo files from generated *.c files. This
1872# applies to:
1873#
1874# parse.lo
1875# opcodes.lo
1876#
1877parse.lo: parse.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001878 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c parse.c
shanehb2f20bf2011-06-17 07:07:24 +00001879
1880opcodes.lo: opcodes.c
mistachkin44723ce2015-03-21 02:22:37 +00001881 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c opcodes.c
mistachkin3e786092016-01-23 07:53:04 +00001882# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001883
mistachkin4d9d1f42012-09-03 10:32:32 +00001884# Rule to build the Win32 resources object file.
1885#
mistachkin08c1c312012-10-06 03:48:25 +00001886!IF $(USE_RC)!=0
mistachkin3e786092016-01-23 07:53:04 +00001887# <<block1>>
mistachkine2bcbb42019-03-22 01:25:16 +00001888$(LIBRESOBJS): $(TOP)\src\sqlite3.rc $(SQLITE3H) $(TOP)\VERSION
mistachkin4d9d1f42012-09-03 10:32:32 +00001889 echo #ifndef SQLITE_RESOURCE_VERSION > sqlite3rc.h
mistachkin8ccc6d42012-09-27 21:03:53 +00001890 for /F %%V in ('type "$(TOP)\VERSION"') do ( \
mistachkin4d9d1f42012-09-03 10:32:32 +00001891 echo #define SQLITE_RESOURCE_VERSION %%V \
mistachkin946ef602015-10-10 01:55:57 +00001892 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact . ^, >> sqlite3rc.h \
mistachkin4d9d1f42012-09-03 10:32:32 +00001893 )
1894 echo #endif >> sqlite3rc.h
mistachkin08c1c312012-10-06 03:48:25 +00001895 $(LTRCOMPILE) -fo $(LIBRESOBJS) $(TOP)\src\sqlite3.rc
mistachkin3e786092016-01-23 07:53:04 +00001896# <</block1>>
mistachkin08c1c312012-10-06 03:48:25 +00001897!ENDIF
mistachkin4d9d1f42012-09-03 10:32:32 +00001898
mistachkin3e786092016-01-23 07:53:04 +00001899# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001900# Rules to build individual *.lo files from files in the src directory.
1901#
1902alter.lo: $(TOP)\src\alter.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001903 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\alter.c
shanehb2f20bf2011-06-17 07:07:24 +00001904
1905analyze.lo: $(TOP)\src\analyze.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001906 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\analyze.c
shanehb2f20bf2011-06-17 07:07:24 +00001907
1908attach.lo: $(TOP)\src\attach.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001909 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\attach.c
shanehb2f20bf2011-06-17 07:07:24 +00001910
1911auth.lo: $(TOP)\src\auth.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001912 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\auth.c
shanehb2f20bf2011-06-17 07:07:24 +00001913
1914backup.lo: $(TOP)\src\backup.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001915 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\backup.c
shanehb2f20bf2011-06-17 07:07:24 +00001916
1917bitvec.lo: $(TOP)\src\bitvec.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001918 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\bitvec.c
shanehb2f20bf2011-06-17 07:07:24 +00001919
1920btmutex.lo: $(TOP)\src\btmutex.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001921 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\btmutex.c
shanehb2f20bf2011-06-17 07:07:24 +00001922
1923btree.lo: $(TOP)\src\btree.c $(HDR) $(TOP)\src\pager.h
mistachkin44723ce2015-03-21 02:22:37 +00001924 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\btree.c
shanehb2f20bf2011-06-17 07:07:24 +00001925
1926build.lo: $(TOP)\src\build.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001927 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\build.c
shanehb2f20bf2011-06-17 07:07:24 +00001928
1929callback.lo: $(TOP)\src\callback.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001930 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\callback.c
shanehb2f20bf2011-06-17 07:07:24 +00001931
1932complete.lo: $(TOP)\src\complete.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001933 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\complete.c
shanehb2f20bf2011-06-17 07:07:24 +00001934
1935ctime.lo: $(TOP)\src\ctime.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001936 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\ctime.c
shanehb2f20bf2011-06-17 07:07:24 +00001937
1938date.lo: $(TOP)\src\date.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001939 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\date.c
shanehb2f20bf2011-06-17 07:07:24 +00001940
drha43c8c82017-10-11 13:48:11 +00001941dbpage.lo: $(TOP)\src\dbpage.c $(HDR)
1942 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\dbpage.c
1943
1944dbstat.lo: $(TOP)\src\dbstat.c $(HDR)
drh1a4a6802015-05-04 18:31:09 +00001945 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\dbstat.c
1946
shanehb2f20bf2011-06-17 07:07:24 +00001947delete.lo: $(TOP)\src\delete.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001948 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\delete.c
shanehb2f20bf2011-06-17 07:07:24 +00001949
1950expr.lo: $(TOP)\src\expr.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001951 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\expr.c
shanehb2f20bf2011-06-17 07:07:24 +00001952
1953fault.lo: $(TOP)\src\fault.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001954 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\fault.c
shanehb2f20bf2011-06-17 07:07:24 +00001955
1956fkey.lo: $(TOP)\src\fkey.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001957 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\fkey.c
shanehb2f20bf2011-06-17 07:07:24 +00001958
1959func.lo: $(TOP)\src\func.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001960 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\func.c
shanehb2f20bf2011-06-17 07:07:24 +00001961
1962global.lo: $(TOP)\src\global.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001963 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\global.c
shanehb2f20bf2011-06-17 07:07:24 +00001964
1965hash.lo: $(TOP)\src\hash.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001966 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\hash.c
shanehb2f20bf2011-06-17 07:07:24 +00001967
1968insert.lo: $(TOP)\src\insert.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001969 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\insert.c
shanehb2f20bf2011-06-17 07:07:24 +00001970
shanehb2f20bf2011-06-17 07:07:24 +00001971legacy.lo: $(TOP)\src\legacy.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001972 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\legacy.c
shanehb2f20bf2011-06-17 07:07:24 +00001973
1974loadext.lo: $(TOP)\src\loadext.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001975 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\loadext.c
shanehb2f20bf2011-06-17 07:07:24 +00001976
1977main.lo: $(TOP)\src\main.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001978 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\main.c
shanehb2f20bf2011-06-17 07:07:24 +00001979
1980malloc.lo: $(TOP)\src\malloc.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001981 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\malloc.c
shanehb2f20bf2011-06-17 07:07:24 +00001982
1983mem0.lo: $(TOP)\src\mem0.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001984 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem0.c
shanehb2f20bf2011-06-17 07:07:24 +00001985
1986mem1.lo: $(TOP)\src\mem1.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001987 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem1.c
shanehb2f20bf2011-06-17 07:07:24 +00001988
1989mem2.lo: $(TOP)\src\mem2.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001990 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem2.c
shanehb2f20bf2011-06-17 07:07:24 +00001991
1992mem3.lo: $(TOP)\src\mem3.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001993 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem3.c
shanehb2f20bf2011-06-17 07:07:24 +00001994
1995mem5.lo: $(TOP)\src\mem5.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001996 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem5.c
shanehb2f20bf2011-06-17 07:07:24 +00001997
mistachkin7de2c3e2018-01-03 12:39:35 +00001998memdb.lo: $(TOP)\src\memdb.c $(HDR)
drhac442f42018-01-03 01:28:46 +00001999 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\memdb.c
2000
shanehb2f20bf2011-06-17 07:07:24 +00002001memjournal.lo: $(TOP)\src\memjournal.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002002 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\memjournal.c
shanehb2f20bf2011-06-17 07:07:24 +00002003
2004mutex.lo: $(TOP)\src\mutex.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002005 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex.c
shanehb2f20bf2011-06-17 07:07:24 +00002006
2007mutex_noop.lo: $(TOP)\src\mutex_noop.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002008 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex_noop.c
shanehb2f20bf2011-06-17 07:07:24 +00002009
shanehb2f20bf2011-06-17 07:07:24 +00002010mutex_unix.lo: $(TOP)\src\mutex_unix.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002011 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex_unix.c
shanehb2f20bf2011-06-17 07:07:24 +00002012
2013mutex_w32.lo: $(TOP)\src\mutex_w32.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002014 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex_w32.c
shanehb2f20bf2011-06-17 07:07:24 +00002015
2016notify.lo: $(TOP)\src\notify.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002017 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\notify.c
shanehb2f20bf2011-06-17 07:07:24 +00002018
2019pager.lo: $(TOP)\src\pager.c $(HDR) $(TOP)\src\pager.h
mistachkin44723ce2015-03-21 02:22:37 +00002020 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pager.c
shanehb2f20bf2011-06-17 07:07:24 +00002021
2022pcache.lo: $(TOP)\src\pcache.c $(HDR) $(TOP)\src\pcache.h
mistachkin44723ce2015-03-21 02:22:37 +00002023 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pcache.c
shanehb2f20bf2011-06-17 07:07:24 +00002024
2025pcache1.lo: $(TOP)\src\pcache1.c $(HDR) $(TOP)\src\pcache.h
mistachkin44723ce2015-03-21 02:22:37 +00002026 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pcache1.c
shanehb2f20bf2011-06-17 07:07:24 +00002027
2028os.lo: $(TOP)\src\os.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002029 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\os.c
shanehb2f20bf2011-06-17 07:07:24 +00002030
2031os_unix.lo: $(TOP)\src\os_unix.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002032 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\os_unix.c
shanehb2f20bf2011-06-17 07:07:24 +00002033
2034os_win.lo: $(TOP)\src\os_win.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002035 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\os_win.c
shanehb2f20bf2011-06-17 07:07:24 +00002036
shanehb2f20bf2011-06-17 07:07:24 +00002037pragma.lo: $(TOP)\src\pragma.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002038 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pragma.c
shanehb2f20bf2011-06-17 07:07:24 +00002039
2040prepare.lo: $(TOP)\src\prepare.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002041 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\prepare.c
shanehb2f20bf2011-06-17 07:07:24 +00002042
2043printf.lo: $(TOP)\src\printf.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002044 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\printf.c
shanehb2f20bf2011-06-17 07:07:24 +00002045
2046random.lo: $(TOP)\src\random.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002047 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\random.c
shanehb2f20bf2011-06-17 07:07:24 +00002048
2049resolve.lo: $(TOP)\src\resolve.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002050 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\resolve.c
shanehb2f20bf2011-06-17 07:07:24 +00002051
2052rowset.lo: $(TOP)\src\rowset.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002053 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\rowset.c
shanehb2f20bf2011-06-17 07:07:24 +00002054
2055select.lo: $(TOP)\src\select.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002056 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\select.c
shanehb2f20bf2011-06-17 07:07:24 +00002057
2058status.lo: $(TOP)\src\status.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002059 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\status.c
shanehb2f20bf2011-06-17 07:07:24 +00002060
2061table.lo: $(TOP)\src\table.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002062 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\table.c
shanehb2f20bf2011-06-17 07:07:24 +00002063
drhf51446a2012-07-21 19:40:42 +00002064threads.lo: $(TOP)\src\threads.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002065 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\threads.c
drhf51446a2012-07-21 19:40:42 +00002066
shanehb2f20bf2011-06-17 07:07:24 +00002067tokenize.lo: $(TOP)\src\tokenize.c keywordhash.h $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002068 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\tokenize.c
shanehb2f20bf2011-06-17 07:07:24 +00002069
drh38b41492015-06-08 15:08:15 +00002070treeview.lo: $(TOP)\src\treeview.c $(HDR)
2071 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\treeview.c
2072
shanehb2f20bf2011-06-17 07:07:24 +00002073trigger.lo: $(TOP)\src\trigger.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002074 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\trigger.c
shanehb2f20bf2011-06-17 07:07:24 +00002075
2076update.lo: $(TOP)\src\update.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002077 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\update.c
shanehb2f20bf2011-06-17 07:07:24 +00002078
drhfcfd7562018-04-12 21:42:51 +00002079upsert.lo: $(TOP)\src\upsert.c $(HDR)
2080 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\upsert.c
2081
shanehb2f20bf2011-06-17 07:07:24 +00002082utf.lo: $(TOP)\src\utf.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002083 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\utf.c
shanehb2f20bf2011-06-17 07:07:24 +00002084
2085util.lo: $(TOP)\src\util.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002086 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\util.c
shanehb2f20bf2011-06-17 07:07:24 +00002087
2088vacuum.lo: $(TOP)\src\vacuum.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002089 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vacuum.c
shanehb2f20bf2011-06-17 07:07:24 +00002090
2091vdbe.lo: $(TOP)\src\vdbe.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002092 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbe.c
shanehb2f20bf2011-06-17 07:07:24 +00002093
2094vdbeapi.lo: $(TOP)\src\vdbeapi.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002095 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbeapi.c
shanehb2f20bf2011-06-17 07:07:24 +00002096
2097vdbeaux.lo: $(TOP)\src\vdbeaux.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002098 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbeaux.c
shanehb2f20bf2011-06-17 07:07:24 +00002099
2100vdbeblob.lo: $(TOP)\src\vdbeblob.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002101 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbeblob.c
shanehb2f20bf2011-06-17 07:07:24 +00002102
2103vdbemem.lo: $(TOP)\src\vdbemem.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002104 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbemem.c
shanehb2f20bf2011-06-17 07:07:24 +00002105
mistachkin81c428a2011-08-17 02:19:54 +00002106vdbesort.lo: $(TOP)\src\vdbesort.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002107 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbesort.c
mistachkin81c428a2011-08-17 02:19:54 +00002108
shanehb2f20bf2011-06-17 07:07:24 +00002109vdbetrace.lo: $(TOP)\src\vdbetrace.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002110 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbetrace.c
shanehb2f20bf2011-06-17 07:07:24 +00002111
2112vtab.lo: $(TOP)\src\vtab.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002113 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vtab.c
shanehb2f20bf2011-06-17 07:07:24 +00002114
2115wal.lo: $(TOP)\src\wal.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002116 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\wal.c
shanehb2f20bf2011-06-17 07:07:24 +00002117
2118walker.lo: $(TOP)\src\walker.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002119 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\walker.c
shanehb2f20bf2011-06-17 07:07:24 +00002120
2121where.lo: $(TOP)\src\where.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002122 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\where.c
shanehb2f20bf2011-06-17 07:07:24 +00002123
drh6f82e852015-06-06 20:12:09 +00002124wherecode.lo: $(TOP)\src\wherecode.c $(HDR)
2125 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\wherecode.c
2126
drh6c1f4ef2015-06-08 14:23:15 +00002127whereexpr.lo: $(TOP)\src\whereexpr.c $(HDR)
2128 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\whereexpr.c
2129
dan980cf252018-06-10 07:42:35 +00002130window.lo: $(TOP)\src\window.c $(HDR)
2131 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\window.c
2132
mistachkin4ef916e2016-08-24 19:58:46 +00002133tclsqlite.lo: $(TOP)\src\tclsqlite.c $(HDR) $(SQLITE_TCL_DEP)
mistachkin44723ce2015-03-21 02:22:37 +00002134 $(LTCOMPILE) $(NO_WARN) -DUSE_TCL_STUBS=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c
shanehb2f20bf2011-06-17 07:07:24 +00002135
mistachkin4ef916e2016-08-24 19:58:46 +00002136tclsqlite-shell.lo: $(TOP)\src\tclsqlite.c $(HDR) $(SQLITE_TCL_DEP)
drh96a206f2017-10-13 20:14:06 +00002137 $(LTCOMPILE) $(NO_WARN) -DTCLSH -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c
shanehb2f20bf2011-06-17 07:07:24 +00002138
mistachkin5d4d9412016-01-22 03:54:36 +00002139tclsqlite3.exe: tclsqlite-shell.lo $(SQLITE3C) $(SQLITE3H) $(LIBRESOBJS)
mistachkin590522c2018-01-05 16:05:51 +00002140 $(LTLINK) $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) /OUT:$@ tclsqlite-shell.lo $(LIBRESOBJS) $(TCLLIBS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00002141
2142# Rules to build opcodes.c and opcodes.h
2143#
drh7651e0a2015-10-07 12:11:36 +00002144opcodes.c: opcodes.h $(TOP)\tool\mkopcodec.tcl
2145 $(TCLSH_CMD) $(TOP)\tool\mkopcodec.tcl opcodes.h > opcodes.c
shanehb2f20bf2011-06-17 07:07:24 +00002146
drhb15393b2015-10-07 02:52:09 +00002147opcodes.h: parse.h $(TOP)\src\vdbe.c $(TOP)\tool\mkopcodeh.tcl
mistachkin946ef602015-10-10 01:55:57 +00002148 type parse.h $(TOP)\src\vdbe.c | $(TCLSH_CMD) $(TOP)\tool\mkopcodeh.tcl > opcodes.h
shanehb2f20bf2011-06-17 07:07:24 +00002149
2150# Rules to build parse.c and parse.h - the outputs of lemon.
2151#
2152parse.h: parse.c
2153
drhf1722ba2019-04-05 20:56:46 +00002154parse.c: $(TOP)\src\parse.y lemon.exe
mistachkin44723ce2015-03-21 02:22:37 +00002155 del /Q parse.y parse.h parse.h.temp 2>NUL
shanehb2f20bf2011-06-17 07:07:24 +00002156 copy $(TOP)\src\parse.y .
drhfe03dac2019-11-26 02:22:39 +00002157 .\lemon.exe $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) $(OPTS) -S parse.y
shanehb2f20bf2011-06-17 07:07:24 +00002158
drhf39e0ed2017-08-22 19:19:00 +00002159$(SQLITE3H): $(TOP)\src\sqlite.h.in $(TOP)\manifest mksourceid.exe $(TOP)\VERSION
mistachkin4ef916e2016-08-24 19:58:46 +00002160 $(TCLSH_CMD) $(TOP)\tool\mksqlite3h.tcl $(TOP:\=/) > $(SQLITE3H) $(MKSQLITE3H_ARGS)
shanehb2f20bf2011-06-17 07:07:24 +00002161
mistachkin9b88ace2016-02-26 21:01:37 +00002162sqlite3ext.h: .target_source
mistachkin4ef916e2016-08-24 19:58:46 +00002163!IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
mistachkinc0bebc12016-07-28 18:49:20 +00002164 type tsrc\sqlite3ext.h | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "\(\*\)" "(SQLITE_CALLBACK *)" \
2165 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "\(\*" "(SQLITE_APICALL *" > sqlite3ext.h
mistachkine37f7392016-07-28 19:28:35 +00002166 copy /Y sqlite3ext.h tsrc\sqlite3ext.h
mistachkin4ef916e2016-08-24 19:58:46 +00002167!ELSE
2168 copy /Y tsrc\sqlite3ext.h sqlite3ext.h
2169!ENDIF
mistachkinc978f2d2015-09-21 23:49:35 +00002170
shanehb2f20bf2011-06-17 07:07:24 +00002171mkkeywordhash.exe: $(TOP)\tool\mkkeywordhash.c
mistachkinedcb4eb2016-01-22 01:25:15 +00002172 $(BCC) $(NO_WARN) -Fe$@ $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) $(OPTS) \
mistachkin460cd9c2015-10-14 22:46:37 +00002173 $(TOP)\tool\mkkeywordhash.c /link $(LDFLAGS) $(NLTLINKOPTS) $(NLTLIBPATHS)
shanehb2f20bf2011-06-17 07:07:24 +00002174
2175keywordhash.h: $(TOP)\tool\mkkeywordhash.c mkkeywordhash.exe
mistachkin5b0b6fd2011-06-25 01:14:36 +00002176 .\mkkeywordhash.exe > keywordhash.h
shanehb2f20bf2011-06-17 07:07:24 +00002177
drhaa62d2e2017-10-12 13:47:48 +00002178# Source files that go into making shell.c
2179SHELL_SRC = \
2180 $(TOP)\src\shell.c.in \
mistachkin2d44d552018-03-16 23:53:47 +00002181 $(TOP)\ext\misc\appendvfs.c \
drhaa62d2e2017-10-12 13:47:48 +00002182 $(TOP)\ext\misc\shathree.c \
2183 $(TOP)\ext\misc\fileio.c \
mistachkindfdfd8c2018-01-04 22:46:08 +00002184 $(TOP)\ext\misc\completion.c \
mistachkindfdfd8c2018-01-04 22:46:08 +00002185 $(TOP)\ext\expert\sqlite3expert.c \
drhc9320332018-01-05 16:23:43 +00002186 $(TOP)\ext\expert\sqlite3expert.h \
drh50b910a2019-01-21 14:55:03 +00002187 $(TOP)\ext\misc\memtrace.c \
mistachkin5d7503a2018-01-05 17:12:13 +00002188 $(TOP)\src\test_windirent.c
mistachkin590522c2018-01-05 16:05:51 +00002189
2190# If use of zlib is enabled, add the "zipfile.c" source file.
2191#
2192!IF $(USE_ZLIB)!=0
mistachkin5d7503a2018-01-05 17:12:13 +00002193SHELL_SRC = $(SHELL_SRC) $(TOP)\ext\misc\sqlar.c
mistachkin590522c2018-01-05 16:05:51 +00002194SHELL_SRC = $(SHELL_SRC) $(TOP)\ext\misc\zipfile.c
2195!ENDIF
drhaa62d2e2017-10-12 13:47:48 +00002196
mistachkin835cd432017-10-14 19:54:06 +00002197shell.c: $(SHELL_SRC) $(TOP)\tool\mkshellc.tcl
2198 $(TCLSH_CMD) $(TOP)\tool\mkshellc.tcl > shell.c
shanehb2f20bf2011-06-17 07:07:24 +00002199
mistachkincb6acda2017-12-05 18:54:12 +00002200zlib:
mistachkin11522502018-01-05 01:00:17 +00002201 pushd $(ZLIBDIR) && $(MAKE) /f win32\Makefile.msc clean $(ZLIBLIB) && popd
shanehb2f20bf2011-06-17 07:07:24 +00002202
2203# Rules to build the extension objects.
2204#
2205icu.lo: $(TOP)\ext\icu\icu.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002206 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\icu\icu.c
shanehb2f20bf2011-06-17 07:07:24 +00002207
2208fts2.lo: $(TOP)\ext\fts2\fts2.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002209 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2.c
shanehb2f20bf2011-06-17 07:07:24 +00002210
2211fts2_hash.lo: $(TOP)\ext\fts2\fts2_hash.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002212 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_hash.c
shanehb2f20bf2011-06-17 07:07:24 +00002213
2214fts2_icu.lo: $(TOP)\ext\fts2\fts2_icu.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002215 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_icu.c
shanehb2f20bf2011-06-17 07:07:24 +00002216
2217fts2_porter.lo: $(TOP)\ext\fts2\fts2_porter.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002218 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_porter.c
shanehb2f20bf2011-06-17 07:07:24 +00002219
2220fts2_tokenizer.lo: $(TOP)\ext\fts2\fts2_tokenizer.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002221 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_tokenizer.c
shanehb2f20bf2011-06-17 07:07:24 +00002222
2223fts2_tokenizer1.lo: $(TOP)\ext\fts2\fts2_tokenizer1.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002224 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_tokenizer1.c
shanehb2f20bf2011-06-17 07:07:24 +00002225
2226fts3.lo: $(TOP)\ext\fts3\fts3.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002227 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3.c
shanehb2f20bf2011-06-17 07:07:24 +00002228
2229fts3_aux.lo: $(TOP)\ext\fts3\fts3_aux.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002230 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_aux.c
shanehb2f20bf2011-06-17 07:07:24 +00002231
2232fts3_expr.lo: $(TOP)\ext\fts3\fts3_expr.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002233 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_expr.c
shanehb2f20bf2011-06-17 07:07:24 +00002234
2235fts3_hash.lo: $(TOP)\ext\fts3\fts3_hash.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002236 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_hash.c
shanehb2f20bf2011-06-17 07:07:24 +00002237
2238fts3_icu.lo: $(TOP)\ext\fts3\fts3_icu.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002239 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_icu.c
shanehb2f20bf2011-06-17 07:07:24 +00002240
2241fts3_snippet.lo: $(TOP)\ext\fts3\fts3_snippet.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002242 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_snippet.c
shanehb2f20bf2011-06-17 07:07:24 +00002243
2244fts3_porter.lo: $(TOP)\ext\fts3\fts3_porter.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002245 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_porter.c
shanehb2f20bf2011-06-17 07:07:24 +00002246
2247fts3_tokenizer.lo: $(TOP)\ext\fts3\fts3_tokenizer.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002248 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenizer.c
shanehb2f20bf2011-06-17 07:07:24 +00002249
2250fts3_tokenizer1.lo: $(TOP)\ext\fts3\fts3_tokenizer1.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002251 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenizer1.c
shanehb2f20bf2011-06-17 07:07:24 +00002252
drh4d648c72013-04-22 17:07:56 +00002253fts3_tokenize_vtab.lo: $(TOP)\ext\fts3\fts3_tokenize_vtab.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002254 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenize_vtab.c
drh4d648c72013-04-22 17:07:56 +00002255
drh391d4ba2012-05-28 20:22:16 +00002256fts3_unicode.lo: $(TOP)\ext\fts3\fts3_unicode.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002257 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_unicode.c
drh391d4ba2012-05-28 20:22:16 +00002258
2259fts3_unicode2.lo: $(TOP)\ext\fts3\fts3_unicode2.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002260 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_unicode2.c
drh391d4ba2012-05-28 20:22:16 +00002261
shanehb2f20bf2011-06-17 07:07:24 +00002262fts3_write.lo: $(TOP)\ext\fts3\fts3_write.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002263 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_write.c
shanehb2f20bf2011-06-17 07:07:24 +00002264
mistachkin90d6f482018-09-12 00:48:17 +00002265json1.lo: $(TOP)\ext\misc\json1.c $(HDR) $(EXTHDR)
2266 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\misc\json1.c
2267
2268stmt.lo: $(TOP)\ext\misc\stmt.c $(HDR) $(EXTHDR)
2269 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\misc\stmt.c
2270
shanehb2f20bf2011-06-17 07:07:24 +00002271rtree.lo: $(TOP)\ext\rtree\rtree.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002272 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\rtree\rtree.c
shanehb2f20bf2011-06-17 07:07:24 +00002273
mistachkin4f2c8222016-04-11 22:23:04 +00002274sqlite3session.lo: $(TOP)\ext\session\sqlite3session.c $(HDR) $(EXTHDR)
mistachkin05004782016-03-30 16:23:06 +00002275 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\session\sqlite3session.c
drh498dcae2013-03-13 11:42:00 +00002276
mistachkined52f9f2015-06-26 04:34:36 +00002277# FTS5 things
2278#
2279FTS5_SRC = \
2280 $(TOP)\ext\fts5\fts5.h \
2281 $(TOP)\ext\fts5\fts5Int.h \
2282 $(TOP)\ext\fts5\fts5_aux.c \
2283 $(TOP)\ext\fts5\fts5_buffer.c \
2284 $(TOP)\ext\fts5\fts5_main.c \
2285 $(TOP)\ext\fts5\fts5_config.c \
2286 $(TOP)\ext\fts5\fts5_expr.c \
2287 $(TOP)\ext\fts5\fts5_hash.c \
2288 $(TOP)\ext\fts5\fts5_index.c \
2289 fts5parse.c fts5parse.h \
2290 $(TOP)\ext\fts5\fts5_storage.c \
2291 $(TOP)\ext\fts5\fts5_tokenize.c \
2292 $(TOP)\ext\fts5\fts5_unicode2.c \
2293 $(TOP)\ext\fts5\fts5_varint.c \
2294 $(TOP)\ext\fts5\fts5_vocab.c
2295
mistachkin3384ccb2017-12-13 22:42:55 +00002296LSM1_SRC = \
2297 $(TOP)\ext\lsm1\lsm.h \
2298 $(TOP)\ext\lsm1\lsmInt.h \
2299 $(TOP)\ext\lsm1\lsm_ckpt.c \
2300 $(TOP)\ext\lsm1\lsm_file.c \
2301 $(TOP)\ext\lsm1\lsm_log.c \
2302 $(TOP)\ext\lsm1\lsm_main.c \
2303 $(TOP)\ext\lsm1\lsm_mem.c \
2304 $(TOP)\ext\lsm1\lsm_mutex.c \
2305 $(TOP)\ext\lsm1\lsm_shared.c \
2306 $(TOP)\ext\lsm1\lsm_sorted.c \
2307 $(TOP)\ext\lsm1\lsm_str.c \
2308 $(TOP)\ext\lsm1\lsm_tree.c \
2309 $(TOP)\ext\lsm1\lsm_unix.c \
2310 $(TOP)\ext\lsm1\lsm_varint.c \
2311 $(TOP)\ext\lsm1\lsm_vtab.c \
2312 $(TOP)\ext\lsm1\lsm_win32.c
2313
mistachkined52f9f2015-06-26 04:34:36 +00002314fts5parse.c: $(TOP)\ext\fts5\fts5parse.y lemon.exe
2315 copy $(TOP)\ext\fts5\fts5parse.y .
2316 del /Q fts5parse.h 2>NUL
drhfe03dac2019-11-26 02:22:39 +00002317 .\lemon.exe $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) $(OPTS) -S fts5parse.y
mistachkined52f9f2015-06-26 04:34:36 +00002318
mistachkin9b88ace2016-02-26 21:01:37 +00002319fts5parse.h: fts5parse.c
mistachkined52f9f2015-06-26 04:34:36 +00002320
mistachkin9b88ace2016-02-26 21:01:37 +00002321fts5.c: $(FTS5_SRC)
mistachkined52f9f2015-06-26 04:34:36 +00002322 $(TCLSH_CMD) $(TOP)\ext\fts5\tool\mkfts5c.tcl
dana153bbc2015-07-02 20:12:34 +00002323 copy $(TOP)\ext\fts5\fts5.h .
mistachkined52f9f2015-06-26 04:34:36 +00002324
mistachkin3384ccb2017-12-13 22:42:55 +00002325lsm1.c: $(LSM1_SRC)
2326 $(TCLSH_CMD) $(TOP)\ext\lsm1\tool\mklsm1c.tcl
2327 copy $(TOP)\ext\lsm1\lsm.h .
2328
mistachkined52f9f2015-06-26 04:34:36 +00002329fts5.lo: fts5.c $(HDR) $(EXTHDR)
mistachkin95ae9582015-06-26 20:45:43 +00002330 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c fts5.c
2331
2332fts5_ext.lo: fts5.c $(HDR) $(EXTHDR)
mistachkinae6ca8e2015-07-02 16:50:43 +00002333 $(LTCOMPILE) $(NO_WARN) -c fts5.c
shanehb2f20bf2011-06-17 07:07:24 +00002334
mistachkin95ae9582015-06-26 20:45:43 +00002335fts5.dll: fts5_ext.lo
2336 $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /OUT:$@ fts5_ext.lo
shanehb2f20bf2011-06-17 07:07:24 +00002337
mistachkin83a22532016-01-14 18:01:16 +00002338sqlite3rbu.lo: $(TOP)\ext\rbu\sqlite3rbu.c $(HDR) $(EXTHDR)
2339 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\rbu\sqlite3rbu.c
drh76473772016-01-14 13:22:24 +00002340
shanehb2f20bf2011-06-17 07:07:24 +00002341# Rules to build the 'testfixture' application.
2342#
2343# If using the amalgamation, use sqlite3.c directly to build the test
2344# fixture. Otherwise link against libsqlite3.lib. (This distinction is
2345# necessary because the test fixture requires non-API symbols which are
2346# hidden when the library is built via the amalgamation).
2347#
drh96a206f2017-10-13 20:14:06 +00002348TESTFIXTURE_FLAGS = -DTCLSH_INIT_PROC=sqlite3TestInit -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
mistachkin27b2f052015-01-12 19:49:46 +00002349TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_SERVER=1 -DSQLITE_PRIVATE=""
2350TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_CORE $(NO_WARN)
drhdbc49162016-03-02 03:28:07 +00002351TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_SERIES_CONSTRAINT_VERIFY=1
drh9878fef2016-03-04 03:43:10 +00002352TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_DEFAULT_PAGE_SIZE=1024
mistachkin90d6f482018-09-12 00:48:17 +00002353TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_ENABLE_STMTVTAB=1
2354TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_ENABLE_DBPAGE_VTAB=1
2355TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_ENABLE_JSON1=1
drh1641f112018-12-13 21:05:45 +00002356TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_ENABLE_DESERIALIZE=1
mistachkin69def7f2016-07-28 04:14:37 +00002357TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) $(TEST_CCONV_OPTS)
shanehb2f20bf2011-06-17 07:07:24 +00002358
mistachkinc04c54b2016-02-11 21:28:16 +00002359TESTFIXTURE_SRC0 = $(TESTEXT) $(TESTSRC2)
mistachkin05004782016-03-30 16:23:06 +00002360TESTFIXTURE_SRC1 = $(TESTEXT) $(SQLITE3C)
shanehb2f20bf2011-06-17 07:07:24 +00002361!IF $(USE_AMALGAMATION)==0
2362TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC0)
2363!ELSE
2364TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC1)
2365!ENDIF
2366
mistachkin4ef916e2016-08-24 19:58:46 +00002367!IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
mistachkin52b1dbb2016-07-28 14:37:04 +00002368sqlite_tclDecls.h:
mistachkin4ef916e2016-08-24 19:58:46 +00002369 echo #ifndef SQLITE_TCLAPI > $(SQLITETCLDECLSH)
2370 echo # define SQLITE_TCLAPI >> $(SQLITETCLDECLSH)
2371 echo #endif >> $(SQLITETCLDECLSH)
mistachkinf27a80c2016-07-28 16:09:52 +00002372 type "$(TCLINCDIR)\tclDecls.h" \
mistachkina121cc72016-07-28 18:06:52 +00002373 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "^(EXTERN(?: CONST\d+?)?\s+?[^\(]*?\s+?)Tcl_" "\1 SQLITE_TCLAPI Tcl_" \
mistachkinf27a80c2016-07-28 16:09:52 +00002374 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "^(EXTERN\s+?(?:void|VOID)\s+?)TclFreeObj" "\1 SQLITE_TCLAPI TclFreeObj" \
2375 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "\(\*tcl_" "(SQLITE_TCLAPI *tcl_" \
mistachkin7c60b262016-07-28 18:18:53 +00002376 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "\(\*tclFreeObj" "(SQLITE_TCLAPI *tclFreeObj" \
mistachkin4ef916e2016-08-24 19:58:46 +00002377 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "\(\*" "(SQLITE_TCLAPI *" >> $(SQLITETCLDECLSH)
mistachkin52b1dbb2016-07-28 14:37:04 +00002378
mistachkin4ef916e2016-08-24 19:58:46 +00002379sqlite_tcl.h:
mistachkinf27a80c2016-07-28 16:09:52 +00002380 type "$(TCLINCDIR)\tcl.h" | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact tclDecls.h sqlite_tclDecls.h \
2381 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "typedef (.*?)\(Tcl_" "typedef \1 (SQLITE_TCLAPI Tcl_" \
2382 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact "void (*freeProc)" "void (SQLITE_TCLAPI *freeProc)" \
2383 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact "Tcl_HashEntry *(*findProc)" "Tcl_HashEntry *(SQLITE_TCLAPI *findProc)" \
mistachkin4ef916e2016-08-24 19:58:46 +00002384 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact "Tcl_HashEntry *(*createProc)" "Tcl_HashEntry *(SQLITE_TCLAPI *createProc)" >> $(SQLITETCLH)
2385!ENDIF
mistachkin52b1dbb2016-07-28 14:37:04 +00002386
mistachkin5d7503a2018-01-05 17:12:13 +00002387testfixture.exe: $(TESTFIXTURE_SRC) $(TESTFIXTURE_DEP) $(SQLITE3H) $(LIBRESOBJS) $(HDR) $(SQLITE_TCL_DEP)
shaneh6e7850c2011-06-17 15:57:07 +00002388 $(LTLINK) -DSQLITE_NO_SYNC=1 $(TESTFIXTURE_FLAGS) \
shanehb2f20bf2011-06-17 07:07:24 +00002389 -DBUILD_sqlite -I$(TCLINCDIR) \
shaneh2a0b9ef2011-06-20 20:52:32 +00002390 $(TESTFIXTURE_SRC) \
mistachkin590522c2018-01-05 16:05:51 +00002391 /link $(LDFLAGS) $(LTLINKOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) $(LIBRESOBJS) $(TCLLIBS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00002392
mistachkin9b88ace2016-02-26 21:01:37 +00002393extensiontest: testfixture.exe testloadext.dll
mistachkin88739962015-10-14 23:04:08 +00002394 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00002395 .\testfixture.exe $(TOP)\test\loadext.test $(TESTOPTS)
mistachkin1925a2e2014-02-24 21:20:25 +00002396
mistachkin8bee11a2018-10-29 17:53:23 +00002397coretestprogs: $(TESTPROGS)
2398
2399testprogs: coretestprogs srcck1.exe fuzzcheck.exe sessionfuzz.exe
2400
drhf4375442015-05-11 12:15:45 +00002401fulltest: $(TESTPROGS) fuzztest
mistachkin88739962015-10-14 23:04:08 +00002402 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00002403 .\testfixture.exe $(TOP)\test\all.test $(TESTOPTS)
shanehb2f20bf2011-06-17 07:07:24 +00002404
drhea93c702015-05-26 18:15:08 +00002405soaktest: $(TESTPROGS)
mistachkin88739962015-10-14 23:04:08 +00002406 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00002407 .\testfixture.exe $(TOP)\test\all.test -soak=1 $(TESTOPTS)
shanehb2f20bf2011-06-17 07:07:24 +00002408
drhf4375442015-05-11 12:15:45 +00002409fulltestonly: $(TESTPROGS) fuzztest
mistachkin88739962015-10-14 23:04:08 +00002410 @set PATH=$(LIBTCLPATH);$(PATH)
mistachkinc60941f2012-09-13 01:51:02 +00002411 .\testfixture.exe $(TOP)\test\full.test
2412
mistachkinedcb4eb2016-01-22 01:25:15 +00002413queryplantest: testfixture.exe shell
mistachkin88739962015-10-14 23:04:08 +00002414 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00002415 .\testfixture.exe $(TOP)\test\permutations.test queryplanner $(TESTOPTS)
mistachkin036acf32013-07-20 00:34:31 +00002416
drhea93c702015-05-26 18:15:08 +00002417fuzztest: fuzzcheck.exe
2418 .\fuzzcheck.exe $(FUZZDATA)
drhf3320712015-04-25 13:39:29 +00002419
drh905da632015-06-10 18:53:09 +00002420# Minimal testing that runs in less than 3 minutes (on a fast machine)
2421#
drhfd0d93f2016-02-07 00:08:08 +00002422quicktest: testfixture.exe sourcetest
mistachkin88739962015-10-14 23:04:08 +00002423 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00002424 .\testfixture.exe $(TOP)\test\extraquick.test $(TESTOPTS)
2425
2426# This is the common case. Run many tests that do not take too long,
2427# including fuzzcheck, sqlite3_analyzer, and sqldiff tests.
2428#
drhc0efa4d2019-10-09 13:52:31 +00002429test: $(TESTPROGS) sourcetest fuzztest
mistachkin88739962015-10-14 23:04:08 +00002430 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00002431 .\testfixture.exe $(TOP)\test\veryquick.test $(TESTOPTS)
shanehb2f20bf2011-06-17 07:07:24 +00002432
drhea93c702015-05-26 18:15:08 +00002433smoketest: $(TESTPROGS)
mistachkin88739962015-10-14 23:04:08 +00002434 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00002435 .\testfixture.exe $(TOP)\test\main.test $(TESTOPTS)
mistachkin00eb70d2015-04-04 00:02:07 +00002436
drh903b2302017-10-13 18:58:55 +00002437sqlite3_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)
2438 $(TCLSH_CMD) $(TOP)\tool\mkccode.tcl $(TOP)\tool\sqlite3_analyzer.c.in > $@
shanehb2f20bf2011-06-17 07:07:24 +00002439
mistachkin08c1c312012-10-06 03:48:25 +00002440sqlite3_analyzer.exe: sqlite3_analyzer.c $(LIBRESOBJS)
mistachkind4ab1032015-05-11 16:27:33 +00002441 $(LTLINK) $(NO_WARN) -DBUILD_sqlite -I$(TCLINCDIR) sqlite3_analyzer.c \
mistachkin590522c2018-01-05 16:05:51 +00002442 /link $(LDFLAGS) $(LTLINKOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) $(LIBRESOBJS) $(TCLLIBS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00002443
mistachkin5e6f7822018-01-06 14:44:29 +00002444sqltclsh.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 +00002445 $(TCLSH_CMD) $(TOP)\tool\mkccode.tcl $(TOP)\tool\sqltclsh.c.in >sqltclsh.c
2446
mistachkin98dfb2f2018-01-08 14:24:08 +00002447sqltclsh.exe: sqltclsh.c $(SHELL_CORE_DEP) $(LIBRESOBJS)
drh9dea1732018-01-06 04:34:05 +00002448 $(LTLINK) $(NO_WARN) -DBUILD_sqlite -I$(TCLINCDIR) sqltclsh.c \
mistachkin0476b952018-01-06 14:43:33 +00002449 /link $(LDFLAGS) $(LTLINKOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) $(LIBRESOBJS) $(TCLLIBS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00002450
drhbd0f1db2017-05-03 12:50:46 +00002451sqlite3_expert.exe: $(SQLITE3C) $(TOP)\ext\expert\sqlite3expert.h $(TOP)\ext\expert\sqlite3expert.c $(TOP)\ext\expert\expert.c
2452 $(LTLINK) $(NO_WARN) $(TOP)\ext\expert\sqlite3expert.c $(TOP)\ext\expert\expert.c $(SQLITE3C) $(TLIBS)
2453
drh2737fa02017-10-31 15:49:19 +00002454CHECKER_DEPS =\
2455 $(TOP)/tool/mkccode.tcl \
2456 sqlite3.c \
2457 $(TOP)/src/tclsqlite.c \
2458 $(TOP)/ext/repair/sqlite3_checker.tcl \
2459 $(TOP)/ext/repair/checkindex.c \
drh927dd512017-10-31 18:09:40 +00002460 $(TOP)/ext/repair/checkfreelist.c \
drh2737fa02017-10-31 15:49:19 +00002461 $(TOP)/ext/misc/btreeinfo.c \
2462 $(TOP)/ext/repair/sqlite3_checker.c.in
2463
2464sqlite3_checker.c: $(CHECKER_DEPS)
drh2091f0f2017-10-31 15:55:48 +00002465 $(TCLSH_CMD) $(TOP)\tool\mkccode.tcl $(TOP)\ext\repair\sqlite3_checker.c.in > $@
drh2737fa02017-10-31 15:49:19 +00002466
2467sqlite3_checker.exe: sqlite3_checker.c $(LIBRESOBJS)
2468 $(LTLINK) $(NO_WARN) -DBUILD_sqlite -I$(TCLINCDIR) sqlite3_checker.c \
mistachkin370732a2018-01-05 19:25:52 +00002469 /link $(LDFLAGS) $(LTLINKOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) $(LIBRESOBJS) $(TCLLIBS) $(LTLIBS) $(TLIBS)
drh2737fa02017-10-31 15:49:19 +00002470
mistachkinac8ba262018-03-07 14:42:17 +00002471dbdump.exe: $(TOP)\ext\misc\dbdump.c $(SQLITE3C) $(SQLITE3H) $(LIBRESOBJS)
mistachkin943d8252017-03-14 15:27:56 +00002472 $(LTLINK) $(NO_WARN) -DDBDUMP_STANDALONE $(TOP)\ext\misc\dbdump.c $(SQLITE3C) \
2473 /link $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS)
drh4b34eb32017-03-13 22:02:01 +00002474
mistachkinac8ba262018-03-07 14:42:17 +00002475testloadext.lo: $(TOP)\src\test_loadext.c $(SQLITE3H)
mistachkin44723ce2015-03-21 02:22:37 +00002476 $(LTCOMPILE) $(NO_WARN) -c $(TOP)\src\test_loadext.c
mistachkin1925a2e2014-02-24 21:20:25 +00002477
mistachkin9b88ace2016-02-26 21:01:37 +00002478testloadext.dll: testloadext.lo
mistachkin1925a2e2014-02-24 21:20:25 +00002479 $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /OUT:$@ testloadext.lo
2480
drh33746482018-12-13 15:06:26 +00002481dbtotxt.exe: $(TOP)\tool\dbtotxt.c
2482 $(LTLINK) $(NO_WARN) $(TOP)\tool\dbtotxt.c /link $(LDFLAGS) $(LTLINKOPTS)
2483
mistachkin5d4d9412016-01-22 03:54:36 +00002484showdb.exe: $(TOP)\tool\showdb.c $(SQLITE3C) $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002485 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
mistachkin78e3f612015-10-14 20:01:12 +00002486 $(TOP)\tool\showdb.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh9ac3c1e2013-11-07 18:37:31 +00002487
mistachkin5d4d9412016-01-22 03:54:36 +00002488showstat4.exe: $(TOP)\tool\showstat4.c $(SQLITE3C) $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002489 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
mistachkin78e3f612015-10-14 20:01:12 +00002490 $(TOP)\tool\showstat4.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh4bb77ec2014-06-30 11:14:26 +00002491
mistachkin5d4d9412016-01-22 03:54:36 +00002492showjournal.exe: $(TOP)\tool\showjournal.c $(SQLITE3C) $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002493 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
mistachkin78e3f612015-10-14 20:01:12 +00002494 $(TOP)\tool\showjournal.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh4bb77ec2014-06-30 11:14:26 +00002495
mistachkin5d4d9412016-01-22 03:54:36 +00002496showwal.exe: $(TOP)\tool\showwal.c $(SQLITE3C) $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002497 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
mistachkin78e3f612015-10-14 20:01:12 +00002498 $(TOP)\tool\showwal.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh4bb77ec2014-06-30 11:14:26 +00002499
drh666fb692017-10-30 23:25:06 +00002500showshm.exe: $(TOP)\tool\showshm.c
2501 $(LTLINK) $(NO_WARN) $(TOP)\tool\showshm.c /link $(LDFLAGS) $(LTLINKOPTS)
2502
drh731dd6e2018-12-04 16:51:42 +00002503index_usage.exe: $(TOP)\tool\index_usage.c $(SQLITE3C) $(SQLITE3H)
2504 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
2505 $(TOP)\tool\index_usage.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
2506
mistachkin953fbd12017-02-07 21:09:34 +00002507changeset.exe: $(TOP)\ext\session\changeset.c $(SQLITE3C) $(SQLITE3H)
2508 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
2509 -DSQLITE_ENABLE_SESSION=1 -DSQLITE_ENABLE_PREUPDATE_HOOK=1 \
mistachkin05004782016-03-30 16:23:06 +00002510 $(TOP)\ext\session\changeset.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh9f674f22014-08-18 20:23:29 +00002511
danf095a1a2018-11-05 20:37:33 +00002512changesetfuzz.exe: $(TOP)\ext\session\changesetfuzz.c $(SQLITE3C) $(SQLITE3H)
2513 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
2514 -DSQLITE_ENABLE_SESSION=1 -DSQLITE_ENABLE_PREUPDATE_HOOK=1 \
2515 $(TOP)\ext\session\changesetfuzz.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
2516
mistachkin5d4d9412016-01-22 03:54:36 +00002517fts3view.exe: $(TOP)\ext\fts3\tool\fts3view.c $(SQLITE3C) $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002518 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
mistachkin78e3f612015-10-14 20:01:12 +00002519 $(TOP)\ext\fts3\tool\fts3view.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
mistachkinde545272014-07-07 17:57:50 +00002520
mistachkin5d4d9412016-01-22 03:54:36 +00002521rollback-test.exe: $(TOP)\tool\rollback-test.c $(SQLITE3C) $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002522 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
mistachkin78e3f612015-10-14 20:01:12 +00002523 $(TOP)\tool\rollback-test.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh4bb77ec2014-06-30 11:14:26 +00002524
drh355f2e02018-08-23 20:09:19 +00002525atrc.exe: $(TOP)\test\atrc.c $(SQLITE3C) $(SQLITE3H)
2526 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
2527 $(TOP)\test\atrc.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
2528
mistachkin5d4d9412016-01-22 03:54:36 +00002529LogEst.exe: $(TOP)\tool\logest.c $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002530 $(LTLINK) $(NO_WARN) $(TOP)\tool\LogEst.c /link $(LDFLAGS) $(LTLINKOPTS)
drh267a13f2014-06-18 18:10:12 +00002531
mistachkin5d4d9412016-01-22 03:54:36 +00002532wordcount.exe: $(TOP)\test\wordcount.c $(SQLITE3C) $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002533 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
mistachkin78e3f612015-10-14 20:01:12 +00002534 $(TOP)\test\wordcount.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh9ac3c1e2013-11-07 18:37:31 +00002535
mistachkin5d4d9412016-01-22 03:54:36 +00002536speedtest1.exe: $(TOP)\test\speedtest1.c $(SQLITE3C) $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002537 $(LTLINK) $(NO_WARN) $(ST_COMPILE_OPTS) -DSQLITE_OMIT_LOAD_EXTENSION \
mistachkin78e3f612015-10-14 20:01:12 +00002538 $(TOP)\test\speedtest1.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
mistachkinb482a442012-02-11 22:19:26 +00002539
mistachkin953fbd12017-02-07 21:09:34 +00002540kvtest.exe: $(TOP)\test\kvtest.c $(SQLITE3C) $(SQLITE3H)
2541 $(LTLINK) $(NO_WARN) $(KV_COMPILE_OPTS) \
2542 $(TOP)\test\kvtest.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
2543
mistachkin9b88ace2016-02-26 21:01:37 +00002544rbu.exe: $(TOP)\ext\rbu\rbu.c $(TOP)\ext\rbu\sqlite3rbu.c $(SQLITE3C) $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002545 $(LTLINK) $(NO_WARN) -DSQLITE_ENABLE_RBU \
mistachkin5d4d9412016-01-22 03:54:36 +00002546 $(TOP)\ext\rbu\rbu.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
mistachkin9b88ace2016-02-26 21:01:37 +00002547
mistachkin02679b02017-06-27 05:59:47 +00002548LSMDIR=$(TOP)\ext\lsm1
2549!INCLUDE $(LSMDIR)\Makefile.msc
2550
mistachkin9b88ace2016-02-26 21:01:37 +00002551moreclean: clean
2552 del /Q $(SQLITE3C) $(SQLITE3H) 2>NUL
mistachkin3e786092016-01-23 07:53:04 +00002553# <</mark>>
drh76473772016-01-14 13:22:24 +00002554
shaneh6e7850c2011-06-17 15:57:07 +00002555clean:
mistachkin8dd3ff12015-05-16 03:41:41 +00002556 del /Q *.exp *.lo *.ilk *.lib *.obj *.ncb *.pdb *.sdf *.suo 2>NUL
mistachkin56362a52016-02-19 19:03:04 +00002557 del /Q *.bsc *.def *.cod *.da *.bb *.bbg *.vc gmon.out 2>NUL
mistachkinfe41a982016-02-27 00:21:44 +00002558 del /Q $(SQLITE3EXE) $(SQLITE3DLL) Replace.exe 2>NUL
mistachkin3e786092016-01-23 07:53:04 +00002559# <<mark>>
mistachkine2bcbb42019-03-22 01:25:16 +00002560 del /Q $(SQLITE3TCLDLL) pkgIndex.tcl 2>NUL
mistachkin9b88ace2016-02-26 21:01:37 +00002561 del /Q opcodes.c opcodes.h 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002562 del /Q lemon.* lempar.c parse.* 2>NUL
mistachkin050dc5c2017-09-04 18:44:54 +00002563 del /Q mksourceid.* mkkeywordhash.* keywordhash.h 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002564 del /Q notasharedlib.* 2>NUL
2565 -rmdir /Q/S .deps 2>NUL
2566 -rmdir /Q/S .libs 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002567 -rmdir /Q/S tsrc 2>NUL
2568 del /Q .target_source 2>NUL
mistachkin4ef916e2016-08-24 19:58:46 +00002569 del /Q tclsqlite3.exe $(SQLITETCLH) $(SQLITETCLDECLSH) 2>NUL
mistachkina2d85cb2017-07-07 19:02:51 +00002570 del /Q lsm.dll lsmtest.exe 2>NUL
mistachkin4e2d3d42019-04-01 03:07:21 +00002571 del /Q atrc.exe changesetfuzz.exe dbtotxt.exe index_usage.exe 2>NUL
mistachkin44723ce2015-03-21 02:22:37 +00002572 del /Q testloadext.dll 2>NUL
2573 del /Q testfixture.exe test.db 2>NUL
mistachkin943d8252017-03-14 15:27:56 +00002574 del /Q LogEst.exe fts3view.exe rollback-test.exe showdb.exe dbdump.exe 2>NUL
drhedea9112015-03-24 19:02:13 +00002575 del /Q changeset.exe 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002576 del /Q showjournal.exe showstat4.exe showwal.exe speedtest1.exe 2>NUL
mistachkin27b69972016-02-07 20:39:27 +00002577 del /Q mptester.exe wordcount.exe rbu.exe srcck1.exe 2>NUL
mistachkin1f237e32018-07-27 20:45:28 +00002578 del /Q sqlite3.c sqlite3-*.c sqlite3.h 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002579 del /Q sqlite3rc.h 2>NUL
mistachkin27799892016-03-31 22:53:37 +00002580 del /Q shell.c sqlite3ext.h sqlite3session.h 2>NUL
mistachkin44723ce2015-03-21 02:22:37 +00002581 del /Q sqlite3_analyzer.exe sqlite3_analyzer.c 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002582 del /Q sqlite-*-output.vsix 2>NUL
drh290fcaa2016-06-08 01:03:05 +00002583 del /Q fuzzershell.exe fuzzcheck.exe sqldiff.exe dbhash.exe 2>NUL
mistachkinb649be32018-03-07 14:53:36 +00002584 del /Q sqltclsh.* 2>NUL
mistachkin83686922018-03-08 18:09:22 +00002585 del /Q dbfuzz.exe sessionfuzz.exe 2>NUL
mistachkinac8ba262018-03-07 14:42:17 +00002586 del /Q kvtest.exe ossshell.exe scrub.exe 2>NUL
mistachkinb649be32018-03-07 14:53:36 +00002587 del /Q showshm.exe sqlite3_checker.* sqlite3_expert.exe 2>NUL
mistachkinbc50bb72015-07-14 21:56:53 +00002588 del /Q fts5.* fts5parse.* 2>NUL
mistachkin3384ccb2017-12-13 22:42:55 +00002589 del /Q lsm.h lsm1.c 2>NUL
mistachkin3e786092016-01-23 07:53:04 +00002590# <</mark>>