blob: 17c04af1008e404639bd035afb6e250cc89a97c3 [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
mistachkinb9becaa2015-12-16 23:30:30 +000076NO_WARN = $(NO_WARN) -wd4210 -wd4232 -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
mistachkin5d4d9412016-01-22 03:54:36 +0000251# Set the source code file to be used by executables and libraries when
252# they need the amalgamation.
253#
254!IFNDEF SQLITE3C
255!IF $(SPLIT_AMALGAMATION)!=0
256SQLITE3C = sqlite3-all.c
257!ELSE
258SQLITE3C = sqlite3.c
259!ENDIF
260!ENDIF
261
262# Set the include code file to be used by executables and libraries when
263# they need SQLite.
264#
265!IFNDEF SQLITE3H
266SQLITE3H = sqlite3.h
267!ENDIF
268
mistachkinedcb4eb2016-01-22 01:25:15 +0000269# This is the name to use for the SQLite dynamic link library (DLL).
270#
271!IFNDEF SQLITE3DLL
mistachkinb0c99af2016-02-19 05:07:56 +0000272!IF $(FOR_WIN10)!=0
273SQLITE3DLL = winsqlite3.dll
274!ELSE
mistachkinedcb4eb2016-01-22 01:25:15 +0000275SQLITE3DLL = sqlite3.dll
276!ENDIF
mistachkinb0c99af2016-02-19 05:07:56 +0000277!ENDIF
mistachkinedcb4eb2016-01-22 01:25:15 +0000278
279# This is the name to use for the SQLite import library (LIB).
280#
281!IFNDEF SQLITE3LIB
mistachkinb0c99af2016-02-19 05:07:56 +0000282!IF $(FOR_WIN10)!=0
283SQLITE3LIB = winsqlite3.lib
284!ELSE
mistachkinedcb4eb2016-01-22 01:25:15 +0000285SQLITE3LIB = sqlite3.lib
286!ENDIF
mistachkinb0c99af2016-02-19 05:07:56 +0000287!ENDIF
mistachkinedcb4eb2016-01-22 01:25:15 +0000288
289# This is the name to use for the SQLite shell executable (EXE).
290#
291!IFNDEF SQLITE3EXE
mistachkinb0c99af2016-02-19 05:07:56 +0000292!IF $(FOR_WIN10)!=0
293SQLITE3EXE = winsqlite3shell.exe
294!ELSE
mistachkinedcb4eb2016-01-22 01:25:15 +0000295SQLITE3EXE = sqlite3.exe
296!ENDIF
mistachkinb0c99af2016-02-19 05:07:56 +0000297!ENDIF
mistachkinedcb4eb2016-01-22 01:25:15 +0000298
299# This is the argument used to set the program database (PDB) file for the
300# SQLite shell executable (EXE).
301#
302!IFNDEF SQLITE3EXEPDB
mistachkinb0c99af2016-02-19 05:07:56 +0000303!IF $(FOR_WIN10)!=0
304SQLITE3EXEPDB =
305!ELSE
mistachkinedcb4eb2016-01-22 01:25:15 +0000306SQLITE3EXEPDB = /pdb:sqlite3sh.pdb
307!ENDIF
mistachkinb0c99af2016-02-19 05:07:56 +0000308!ENDIF
mistachkinedcb4eb2016-01-22 01:25:15 +0000309
mistachkincc0164b2016-09-05 20:46:02 +0000310# <<mark>>
mistachkin4ef916e2016-08-24 19:58:46 +0000311# These are the names of the customized Tcl header files used by various parts
312# of this makefile when the stdcall calling convention is in use. It is not
313# used for any other purpose.
314#
315!IFNDEF SQLITETCLH
316SQLITETCLH = sqlite_tcl.h
317!ENDIF
318
319!IFNDEF SQLITETCLDECLSH
320SQLITETCLDECLSH = sqlite_tclDecls.h
321!ENDIF
322
323# These are the additional targets that the targets that integrate with the
324# Tcl library should depend on when compiling, etc.
325#
326!IFNDEF SQLITE_TCL_DEP
327!IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
328SQLITE_TCL_DEP = $(SQLITETCLDECLSH) $(SQLITETCLH)
329!ELSE
330SQLITE_TCL_DEP =
331!ENDIF
332!ENDIF
mistachkincc0164b2016-09-05 20:46:02 +0000333# <</mark>>
mistachkin4ef916e2016-08-24 19:58:46 +0000334
mistachkin4712c212014-05-09 20:51:17 +0000335# These are the "standard" SQLite compilation options used when compiling for
336# the Windows platform.
337#
338!IFNDEF OPT_FEATURE_FLAGS
mistachkin4ef916e2016-08-24 19:58:46 +0000339!IF $(MINIMAL_AMALGAMATION)==0
mistachkin4712c212014-05-09 20:51:17 +0000340OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS3=1
341OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RTREE=1
mistachkin4ef916e2016-08-24 19:58:46 +0000342!ENDIF
mistachkin4712c212014-05-09 20:51:17 +0000343OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_COLUMN_METADATA=1
drh5e18d402016-05-03 13:14:18 +0000344!ENDIF
345
mistachkin12b35ea2016-05-03 19:40:54 +0000346# Should the session extension be enabled? If so, add compilation options
347# to enable it.
drh5e18d402016-05-03 13:14:18 +0000348#
drh5e18d402016-05-03 13:14:18 +0000349!IF $(SESSION)!=0
mistachkin05004782016-03-30 16:23:06 +0000350OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_SESSION=1
351OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_PREUPDATE_HOOK=1
mistachkin4712c212014-05-09 20:51:17 +0000352!ENDIF
353
mistachkinedcb4eb2016-01-22 01:25:15 +0000354# These are the "extended" SQLite compilation options used when compiling for
355# the Windows 10 platform.
356#
357!IFNDEF EXT_FEATURE_FLAGS
358!IF $(FOR_WIN10)!=0
359EXT_FEATURE_FLAGS = $(EXT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS4=1
360EXT_FEATURE_FLAGS = $(EXT_FEATURE_FLAGS) -DSQLITE_SYSTEM_MALLOC=1
361EXT_FEATURE_FLAGS = $(EXT_FEATURE_FLAGS) -DSQLITE_OMIT_LOCALTIME=1
362!ELSE
363EXT_FEATURE_FLAGS =
364!ENDIF
365!ENDIF
366
mistachkin4712c212014-05-09 20:51:17 +0000367###############################################################################
368############################### END OF OPTIONS ################################
369###############################################################################
370
mistachkin55e88d92016-02-08 20:40:57 +0000371# When compiling for the Windows 10 platform, the PLATFORM macro must be set
372# to an appropriate value (e.g. x86, x64, arm, arm64, etc).
373#
374!IF $(FOR_WIN10)!=0
375!IFNDEF PLATFORM
376!ERROR Using the FOR_WIN10 option requires a value for PLATFORM.
377!ENDIF
378!ENDIF
379
mistachkind9b3c542014-05-09 23:31:55 +0000380# This assumes that MSVC is always installed in 32-bit Program Files directory
381# and sets the variable for use in locating other 32-bit installs accordingly.
382#
383PROGRAMFILES_X86 = $(VCINSTALLDIR)\..\..
384PROGRAMFILES_X86 = $(PROGRAMFILES_X86:\\=\)
385
mistachkine37f99c2012-06-30 16:22:05 +0000386# Check for the predefined command macro CC. This should point to the compiler
mistachkinbd58d5f2012-06-30 22:22:34 +0000387# binary for the target platform. If it is not defined, simply define it to
mistachkine37f99c2012-06-30 16:22:05 +0000388# the legacy default value 'cl.exe'.
389#
390!IFNDEF CC
391CC = cl.exe
392!ENDIF
393
mistachkin9aeb9712016-02-26 23:13:16 +0000394# Check for the predefined command macro CSC. This should point to a working
395# C Sharp compiler binary. If it is not defined, simply define it to the
396# legacy default value 'csc.exe'.
397#
398!IFNDEF CSC
399CSC = csc.exe
400!ENDIF
401
mistachkin228aeff2012-06-30 19:24:09 +0000402# Check for the command macro LD. This should point to the linker binary for
mistachkinbd58d5f2012-06-30 22:22:34 +0000403# the target platform. If it is not defined, simply define it to the legacy
mistachkin228aeff2012-06-30 19:24:09 +0000404# default value 'link.exe'.
405#
406!IFNDEF LD
407LD = link.exe
408!ENDIF
409
mistachkin4d9d1f42012-09-03 10:32:32 +0000410# Check for the predefined command macro RC. This should point to the resource
411# compiler binary for the target platform. If it is not defined, simply define
412# it to the legacy default value 'rc.exe'.
413#
414!IFNDEF RC
415RC = rc.exe
416!ENDIF
417
mistachkine48f1ed2016-02-08 20:45:37 +0000418# Check for the MSVC runtime library path macro. Otherwise, this value will
mistachkin4712c212014-05-09 20:51:17 +0000419# default to the 'lib' directory underneath the MSVC installation directory.
420#
421!IFNDEF CRTLIBPATH
422CRTLIBPATH = $(VCINSTALLDIR)\lib
423!ENDIF
424
425CRTLIBPATH = $(CRTLIBPATH:\\=\)
426
mistachkine37f99c2012-06-30 16:22:05 +0000427# Check for the command macro NCC. This should point to the compiler binary
mistachkinbd58d5f2012-06-30 22:22:34 +0000428# for the platform the compilation process is taking place on. If it is not
429# defined, simply define it to have the same value as the CC macro. When
mistachkine37f99c2012-06-30 16:22:05 +0000430# cross-compiling, it is suggested that this macro be modified via the command
431# line (since nmake itself does not provide a built-in method to guess it).
432# For example, to use the x86 compiler when cross-compiling for x64, a command
mistachkinbd58d5f2012-06-30 22:22:34 +0000433# line similar to the following could be used (all on one line):
mistachkine37f99c2012-06-30 16:22:05 +0000434#
mistachkin6f928332012-08-17 11:47:32 +0000435# nmake /f Makefile.msc sqlite3.dll
mistachkin52fd8e12012-08-28 01:44:13 +0000436# XCOMPILE=1 USE_NATIVE_LIBPATHS=1
437#
438# Alternatively, the full path and file name to the compiler binary for the
439# platform the compilation process is taking place may be specified (all on
440# one line):
441#
442# nmake /f Makefile.msc sqlite3.dll
mistachkinbd58d5f2012-06-30 22:22:34 +0000443# "NCC=""%VCINSTALLDIR%\bin\cl.exe"""
444# USE_NATIVE_LIBPATHS=1
mistachkine37f99c2012-06-30 16:22:05 +0000445#
mistachkinfd0ba2a2012-07-27 08:21:45 +0000446!IFDEF NCC
447NCC = $(NCC:\\=\)
mistachkin52fd8e12012-08-28 01:44:13 +0000448!ELSEIF $(XCOMPILE)!=0
mistachkin5fac4202013-12-03 23:33:29 +0000449NCC = "$(VCINSTALLDIR)\bin\$(CC)"
mistachkin52fd8e12012-08-28 01:44:13 +0000450NCC = $(NCC:\\=\)
mistachkinfd0ba2a2012-07-27 08:21:45 +0000451!ELSE
mistachkine37f99c2012-06-30 16:22:05 +0000452NCC = $(CC)
453!ENDIF
454
mistachkine48f1ed2016-02-08 20:45:37 +0000455# Check for the MSVC native runtime library path macro. Otherwise,
mistachkin4712c212014-05-09 20:51:17 +0000456# this value will default to the 'lib' directory underneath the MSVC
mistachkinbd58d5f2012-06-30 22:22:34 +0000457# installation directory.
458#
459!IFNDEF NCRTLIBPATH
460NCRTLIBPATH = $(VCINSTALLDIR)\lib
461!ENDIF
462
mistachkin0b5ae722012-07-27 23:03:47 +0000463NCRTLIBPATH = $(NCRTLIBPATH:\\=\)
464
mistachkine48f1ed2016-02-08 20:45:37 +0000465# Check for the Platform SDK library path macro. Otherwise, this
mistachkinbd58d5f2012-06-30 22:22:34 +0000466# value will default to the 'lib' directory underneath the Windows
467# SDK installation directory (the environment variable used appears
468# to be available when using Visual C++ 2008 or later via the
469# command line).
470#
471!IFNDEF NSDKLIBPATH
472NSDKLIBPATH = $(WINDOWSSDKDIR)\lib
473!ENDIF
474
mistachkin0b5ae722012-07-27 23:03:47 +0000475NSDKLIBPATH = $(NSDKLIBPATH:\\=\)
476
mistachkine48f1ed2016-02-08 20:45:37 +0000477# Check for the UCRT library path macro. Otherwise, this value will
mistachkina6f28892016-02-05 19:40:23 +0000478# default to the version-specific, platform-specific 'lib' directory
479# underneath the Windows SDK installation directory.
480#
481!IFNDEF UCRTLIBPATH
482UCRTLIBPATH = $(WINDOWSSDKDIR)\lib\$(WINDOWSSDKLIBVERSION)\ucrt\$(PLATFORM)
483!ENDIF
484
485UCRTLIBPATH = $(UCRTLIBPATH:\\=\)
486
mistachkinbd58d5f2012-06-30 22:22:34 +0000487# C compiler and options for use in building executables that
shanehb2f20bf2011-06-17 07:07:24 +0000488# will run on the platform that is doing the build.
489#
mistachkin2318d332015-01-12 18:02:52 +0000490!IF $(USE_FULLWARN)!=0
mistachkinf170ea42015-10-16 20:13:57 +0000491BCC = $(NCC) -nologo -W4 $(CCOPTS) $(BCCOPTS)
mistachkin2318d332015-01-12 18:02:52 +0000492!ELSE
mistachkinf170ea42015-10-16 20:13:57 +0000493BCC = $(NCC) -nologo -W3 $(CCOPTS) $(BCCOPTS)
mistachkin2318d332015-01-12 18:02:52 +0000494!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000495
mistachkin0157e012013-09-06 21:41:11 +0000496# Check if assembly code listings should be generated for the source
497# code files to be compiled.
498#
499!IF $(USE_LISTINGS)!=0
500BCC = $(BCC) -FAcs
501!ENDIF
502
mistachkinbd58d5f2012-06-30 22:22:34 +0000503# Check if the native library paths should be used when compiling
504# the command line tools used during the compilation process. If
505# so, set the necessary macro now.
506#
507!IF $(USE_NATIVE_LIBPATHS)!=0
508NLTLIBPATHS = "/LIBPATH:$(NCRTLIBPATH)" "/LIBPATH:$(NSDKLIBPATH)"
mistachkin6bbe3df2015-04-19 06:18:10 +0000509
510!IFDEF NUCRTLIBPATH
511NUCRTLIBPATH = $(NUCRTLIBPATH:\\=\)
512NLTLIBPATHS = $(NLTLIBPATHS) "/LIBPATH:$(NUCRTLIBPATH)"
513!ENDIF
mistachkinbd58d5f2012-06-30 22:22:34 +0000514!ENDIF
515
516# C compiler and options for use in building executables that
shanehb2f20bf2011-06-17 07:07:24 +0000517# will run on the target platform. (BCC and TCC are usually the
518# same unless your are cross-compiling.)
519#
mistachkin2318d332015-01-12 18:02:52 +0000520!IF $(USE_FULLWARN)!=0
mistachkinf170ea42015-10-16 20:13:57 +0000521TCC = $(CC) -nologo -W4 -DINCLUDE_MSVC_H=1 $(CCOPTS) $(TCCOPTS)
mistachkin2318d332015-01-12 18:02:52 +0000522!ELSE
mistachkinf170ea42015-10-16 20:13:57 +0000523TCC = $(CC) -nologo -W3 $(CCOPTS) $(TCCOPTS)
mistachkin2318d332015-01-12 18:02:52 +0000524!ENDIF
525
mistachkin8c5e8fe2017-02-01 22:32:49 +0000526# Check if warnings should be treated as errors when compiling.
527#
528!IF $(USE_FATAL_WARN)!=0
529TCC = $(TCC) -WX
530!ENDIF
531
mistachkin8988aee2016-02-10 21:45:25 +0000532TCC = $(TCC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) -I$(TOP)\src -fp:precise
533RCC = $(RC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) -I$(TOP)\src $(RCOPTS) $(RCCOPTS)
shaneh6e7850c2011-06-17 15:57:07 +0000534
mistachkin44723ce2015-03-21 02:22:37 +0000535# Check if we want to use the "stdcall" calling convention when compiling.
536# This is not supported by the compilers for non-x86 platforms. It should
537# also be noted here that building any target with these "stdcall" options
538# will most likely fail if the Tcl library is also required. This is due
539# to how the Tcl library functions are declared and exported (i.e. without
540# an explicit calling convention, which results in "cdecl").
541#
mistachkinedcb4eb2016-01-22 01:25:15 +0000542!IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
mistachkin44723ce2015-03-21 02:22:37 +0000543!IF "$(PLATFORM)"=="x86"
mistachkin69def7f2016-07-28 04:14:37 +0000544CORE_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
545SHELL_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
mistachkinf27a80c2016-07-28 16:09:52 +0000546# <<mark>>
mistachkin52b1dbb2016-07-28 14:37:04 +0000547TEST_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 +0000548# <</mark>>
mistachkin44723ce2015-03-21 02:22:37 +0000549!ELSE
550!IFNDEF PLATFORM
mistachkin69def7f2016-07-28 04:14:37 +0000551CORE_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
552SHELL_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
mistachkinf27a80c2016-07-28 16:09:52 +0000553# <<mark>>
mistachkin52b1dbb2016-07-28 14:37:04 +0000554TEST_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 +0000555# <</mark>>
mistachkin44723ce2015-03-21 02:22:37 +0000556!ELSE
557CORE_CCONV_OPTS =
558SHELL_CCONV_OPTS =
mistachkinf27a80c2016-07-28 16:09:52 +0000559# <<mark>>
mistachkin69def7f2016-07-28 04:14:37 +0000560TEST_CCONV_OPTS =
mistachkinf27a80c2016-07-28 16:09:52 +0000561# <</mark>>
mistachkin44723ce2015-03-21 02:22:37 +0000562!ENDIF
563!ENDIF
564!ELSE
565CORE_CCONV_OPTS =
566SHELL_CCONV_OPTS =
mistachkinf27a80c2016-07-28 16:09:52 +0000567# <<mark>>
mistachkin69def7f2016-07-28 04:14:37 +0000568TEST_CCONV_OPTS =
mistachkinf27a80c2016-07-28 16:09:52 +0000569# <</mark>>
mistachkin44723ce2015-03-21 02:22:37 +0000570!ENDIF
571
572# These are additional compiler options used for the core library.
573#
574!IFNDEF CORE_COMPILE_OPTS
mistachkinedcb4eb2016-01-22 01:25:15 +0000575!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
mistachkin44723ce2015-03-21 02:22:37 +0000576CORE_COMPILE_OPTS = $(CORE_CCONV_OPTS) -DSQLITE_API=__declspec(dllexport)
577!ELSE
578CORE_COMPILE_OPTS = $(CORE_CCONV_OPTS)
579!ENDIF
580!ENDIF
581
582# These are the additional targets that the core library should depend on
583# when linking.
584#
585!IFNDEF CORE_LINK_DEP
mistachkin9b88ace2016-02-26 21:01:37 +0000586!IF $(DYNAMIC_SHELL)!=0
mistachkin44723ce2015-03-21 02:22:37 +0000587CORE_LINK_DEP =
mistachkin9b88ace2016-02-26 21:01:37 +0000588!ELSEIF $(FOR_WIN10)==0 || "$(PLATFORM)"=="x86"
mistachkin44723ce2015-03-21 02:22:37 +0000589CORE_LINK_DEP = sqlite3.def
mistachkin9b88ace2016-02-26 21:01:37 +0000590!ELSE
591CORE_LINK_DEP =
mistachkin44723ce2015-03-21 02:22:37 +0000592!ENDIF
593!ENDIF
594
595# These are additional linker options used for the core library.
596#
597!IFNDEF CORE_LINK_OPTS
mistachkin9b88ace2016-02-26 21:01:37 +0000598!IF $(DYNAMIC_SHELL)!=0
mistachkin44723ce2015-03-21 02:22:37 +0000599CORE_LINK_OPTS =
mistachkin9b88ace2016-02-26 21:01:37 +0000600!ELSEIF $(FOR_WIN10)==0 || "$(PLATFORM)"=="x86"
mistachkin44723ce2015-03-21 02:22:37 +0000601CORE_LINK_OPTS = /DEF:sqlite3.def
mistachkin9b88ace2016-02-26 21:01:37 +0000602!ELSE
603CORE_LINK_OPTS =
mistachkin44723ce2015-03-21 02:22:37 +0000604!ENDIF
605!ENDIF
606
607# These are additional compiler options used for the shell executable.
608#
609!IFNDEF SHELL_COMPILE_OPTS
mistachkinedcb4eb2016-01-22 01:25:15 +0000610!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
mistachkin5d4d9412016-01-22 03:54:36 +0000611SHELL_COMPILE_OPTS = $(SHELL_CCONV_OPTS) -DSQLITE_API=__declspec(dllimport)
mistachkin44723ce2015-03-21 02:22:37 +0000612!ELSE
mistachkin5d4d9412016-01-22 03:54:36 +0000613SHELL_COMPILE_OPTS = $(SHELL_CCONV_OPTS)
614!ENDIF
615!ENDIF
616
617# This is the source code that the shell executable should be compiled
618# with.
619#
620!IFNDEF SHELL_CORE_SRC
621!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
622SHELL_CORE_SRC =
mistachkin1f237e32018-07-27 20:45:28 +0000623# <<mark>>
624!ELSEIF $(USE_AMALGAMATION)==0
625SHELL_CORE_SRC =
626# <</mark>>
mistachkin5d4d9412016-01-22 03:54:36 +0000627!ELSE
628SHELL_CORE_SRC = $(SQLITE3C)
mistachkin44723ce2015-03-21 02:22:37 +0000629!ENDIF
630!ENDIF
631
632# This is the core library that the shell executable should depend on.
633#
634!IFNDEF SHELL_CORE_DEP
mistachkinedcb4eb2016-01-22 01:25:15 +0000635!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
636SHELL_CORE_DEP = $(SQLITE3DLL)
mistachkin1f237e32018-07-27 20:45:28 +0000637# <<mark>>
638!ELSEIF $(USE_AMALGAMATION)==0
639SHELL_CORE_DEP = libsqlite3.lib
640# <</mark>>
mistachkin44723ce2015-03-21 02:22:37 +0000641!ELSE
mistachkin5d4d9412016-01-22 03:54:36 +0000642SHELL_CORE_DEP =
mistachkin44723ce2015-03-21 02:22:37 +0000643!ENDIF
644!ENDIF
645
mistachkincb6acda2017-12-05 18:54:12 +0000646# <<mark>>
mistachkin5d7503a2018-01-05 17:12:13 +0000647# If zlib support is enabled, add the dependencies for it.
mistachkincb6acda2017-12-05 18:54:12 +0000648#
649!IF $(USE_ZLIB)!=0 && $(BUILD_ZLIB)!=0
650SHELL_CORE_DEP = zlib $(SHELL_CORE_DEP)
mistachkin5d7503a2018-01-05 17:12:13 +0000651TESTFIXTURE_DEP = zlib $(TESTFIXTURE_DEP)
mistachkincb6acda2017-12-05 18:54:12 +0000652!ENDIF
653# <</mark>>
654
mistachkin44723ce2015-03-21 02:22:37 +0000655# This is the core library that the shell executable should link with.
656#
657!IFNDEF SHELL_CORE_LIB
mistachkinedcb4eb2016-01-22 01:25:15 +0000658!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
659SHELL_CORE_LIB = $(SQLITE3LIB)
mistachkin1f237e32018-07-27 20:45:28 +0000660# <<mark>>
661!ELSEIF $(USE_AMALGAMATION)==0
662SHELL_CORE_LIB = libsqlite3.lib
663# <</mark>>
mistachkin44723ce2015-03-21 02:22:37 +0000664!ELSE
mistachkin5d4d9412016-01-22 03:54:36 +0000665SHELL_CORE_LIB =
mistachkin44723ce2015-03-21 02:22:37 +0000666!ENDIF
667!ENDIF
668
669# These are additional linker options used for the shell executable.
670#
671!IFNDEF SHELL_LINK_OPTS
672SHELL_LINK_OPTS = $(SHELL_CORE_LIB)
673!ENDIF
674
mistachkin0157e012013-09-06 21:41:11 +0000675# Check if assembly code listings should be generated for the source
676# code files to be compiled.
677#
678!IF $(USE_LISTINGS)!=0
679TCC = $(TCC) -FAcs
680!ENDIF
681
mistachkinf39eaf22012-03-20 02:18:42 +0000682# When compiling the library for use in the WinRT environment,
mistachkin46b721a2012-03-23 12:28:21 +0000683# the following compile-time options must be used as well to
mistachkinf39eaf22012-03-20 02:18:42 +0000684# disable use of Win32 APIs that are not available and to enable
685# use of Win32 APIs that are specific to Windows 8 and/or WinRT.
686#
mistachkin46b721a2012-03-23 12:28:21 +0000687!IF $(FOR_WINRT)!=0
mistachkin8d967a92012-06-21 04:21:35 +0000688TCC = $(TCC) -DSQLITE_OS_WINRT=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000689RCC = $(RCC) -DSQLITE_OS_WINRT=1
mistachkin08c1c312012-10-06 03:48:25 +0000690TCC = $(TCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
691RCC = $(RCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
mistachkin8d967a92012-06-21 04:21:35 +0000692!ENDIF
693
mistachkin5d4d9412016-01-22 03:54:36 +0000694# C compiler options for the Windows 10 platform (needs MSVC 2015).
mistachkinedcb4eb2016-01-22 01:25:15 +0000695#
696!IF $(FOR_WIN10)!=0
mistachkin406eeff2016-02-09 18:28:20 +0000697TCC = $(TCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
698BCC = $(BCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
mistachkinedcb4eb2016-01-22 01:25:15 +0000699!ENDIF
700
mistachkin8d967a92012-06-21 04:21:35 +0000701# Also, we need to dynamically link to the correct MSVC runtime
702# when compiling for WinRT (e.g. debug or release) OR if the
703# USE_CRT_DLL option is set to force dynamically linking to the
704# MSVC runtime library.
705#
mistachkina6f28892016-02-05 19:40:23 +0000706!IF $(FOR_WINRT)!=0 || $(USE_CRT_DLL)!=0
mistachkincd54bab2014-12-20 21:14:14 +0000707!IF $(DEBUG)>1
mistachkin8d967a92012-06-21 04:21:35 +0000708TCC = $(TCC) -MDd
mistachkin08c1c312012-10-06 03:48:25 +0000709BCC = $(BCC) -MDd
mistachkin8d967a92012-06-21 04:21:35 +0000710!ELSE
711TCC = $(TCC) -MD
mistachkin08c1c312012-10-06 03:48:25 +0000712BCC = $(BCC) -MD
mistachkin8d967a92012-06-21 04:21:35 +0000713!ENDIF
714!ELSE
mistachkincd54bab2014-12-20 21:14:14 +0000715!IF $(DEBUG)>1
mistachkin8d967a92012-06-21 04:21:35 +0000716TCC = $(TCC) -MTd
mistachkin08c1c312012-10-06 03:48:25 +0000717BCC = $(BCC) -MTd
mistachkin8d967a92012-06-21 04:21:35 +0000718!ELSE
719TCC = $(TCC) -MT
mistachkin08c1c312012-10-06 03:48:25 +0000720BCC = $(BCC) -MT
mistachkin8d967a92012-06-21 04:21:35 +0000721!ENDIF
mistachkin46b721a2012-03-23 12:28:21 +0000722!ENDIF
mistachkinf39eaf22012-03-20 02:18:42 +0000723
mistachkin3e786092016-01-23 07:53:04 +0000724# <<mark>>
mistachkinf39eaf22012-03-20 02:18:42 +0000725# The mksqlite3c.tcl and mksqlite3h.tcl scripts will pull in
shaneh6e7850c2011-06-17 15:57:07 +0000726# any extension header files by default. For non-amalgamation
727# builds, we need to make sure the compiler can find these.
728#
729!IF $(USE_AMALGAMATION)==0
730TCC = $(TCC) -I$(TOP)\ext\fts3
mistachkin4d9d1f42012-09-03 10:32:32 +0000731RCC = $(RCC) -I$(TOP)\ext\fts3
shaneh6e7850c2011-06-17 15:57:07 +0000732TCC = $(TCC) -I$(TOP)\ext\rtree
mistachkin4d9d1f42012-09-03 10:32:32 +0000733RCC = $(RCC) -I$(TOP)\ext\rtree
drh498dcae2013-03-13 11:42:00 +0000734TCC = $(TCC) -I$(TOP)\ext\session
mistachkin38b4daa2013-03-13 19:02:39 +0000735RCC = $(RCC) -I$(TOP)\ext\session
shaneh6e7850c2011-06-17 15:57:07 +0000736!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000737
mistachkinb0427512014-01-30 11:12:52 +0000738# The mksqlite3c.tcl script accepts some options on the command
739# line. When compiling with debugging enabled, some of these
740# options are necessary in order to allow debugging symbols to
741# work correctly with Visual Studio when using the amalgamation.
742#
mistachkin4ef916e2016-08-24 19:58:46 +0000743!IFNDEF MKSQLITE3C_TOOL
744!IF $(MINIMAL_AMALGAMATION)!=0
745MKSQLITE3C_TOOL = $(TOP)\tool\mksqlite3c-noext.tcl
746!ELSE
747MKSQLITE3C_TOOL = $(TOP)\tool\mksqlite3c.tcl
748!ENDIF
749!ENDIF
750
mistachkin22529172015-04-10 21:16:11 +0000751!IFNDEF MKSQLITE3C_ARGS
mistachkincd54bab2014-12-20 21:14:14 +0000752!IF $(DEBUG)>1
mistachkinb0427512014-01-30 11:12:52 +0000753MKSQLITE3C_ARGS = --linemacros
754!ELSE
755MKSQLITE3C_ARGS =
756!ENDIF
mistachkin4ef916e2016-08-24 19:58:46 +0000757!IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
758MKSQLITE3C_ARGS = $(MKSQLITE3C_ARGS) --useapicall
759!ENDIF
760!ENDIF
761
762# The mksqlite3h.tcl script accepts some options on the command line.
763# When compiling with stdcall support, some of these options are
764# necessary.
765#
766!IFNDEF MKSQLITE3H_ARGS
767!IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
768MKSQLITE3H_ARGS = --useapicall
769!ELSE
770MKSQLITE3H_ARGS =
771!ENDIF
mistachkin22529172015-04-10 21:16:11 +0000772!ENDIF
mistachkin3e786092016-01-23 07:53:04 +0000773# <</mark>>
mistachkinb0427512014-01-30 11:12:52 +0000774
shanehb2f20bf2011-06-17 07:07:24 +0000775# Define -DNDEBUG to compile without debugging (i.e., for production usage)
776# Omitting the define will cause extra debugging code to be inserted and
777# includes extra comments when "EXPLAIN stmt" is used.
778#
mistachkin753c5442011-08-25 02:02:25 +0000779!IF $(DEBUG)==0
shanehb2f20bf2011-06-17 07:07:24 +0000780TCC = $(TCC) -DNDEBUG
mistachkinfec360a2012-04-18 10:29:21 +0000781BCC = $(BCC) -DNDEBUG
mistachkin4d9d1f42012-09-03 10:32:32 +0000782RCC = $(RCC) -DNDEBUG
mistachkin753c5442011-08-25 02:02:25 +0000783!ENDIF
784
mistachkinedcb4eb2016-01-22 01:25:15 +0000785!IF $(DEBUG)>0 || $(API_ARMOR)!=0 || $(FOR_WIN10)!=0
mistachkin13a24f82015-05-13 04:50:30 +0000786TCC = $(TCC) -DSQLITE_ENABLE_API_ARMOR=1
787RCC = $(RCC) -DSQLITE_ENABLE_API_ARMOR=1
mistachkincd54bab2014-12-20 21:14:14 +0000788!ENDIF
789
790!IF $(DEBUG)>2
mistachkin13a24f82015-05-13 04:50:30 +0000791TCC = $(TCC) -DSQLITE_DEBUG=1
792RCC = $(RCC) -DSQLITE_DEBUG=1
mistachkinb3d3bea2017-03-29 23:22:18 +0000793!IF $(DYNAMIC_SHELL)==0
794TCC = $(TCC) -DSQLITE_ENABLE_WHERETRACE -DSQLITE_ENABLE_SELECTTRACE
795RCC = $(RCC) -DSQLITE_ENABLE_WHERETRACE -DSQLITE_ENABLE_SELECTTRACE
796!ENDIF
mistachkin753c5442011-08-25 02:02:25 +0000797!ENDIF
798
mistachkinb10f22a2015-04-16 16:27:29 +0000799!IF $(DEBUG)>4 || $(OSTRACE)!=0
800TCC = $(TCC) -DSQLITE_FORCE_OS_TRACE=1 -DSQLITE_DEBUG_OS_TRACE=1
801RCC = $(RCC) -DSQLITE_FORCE_OS_TRACE=1 -DSQLITE_DEBUG_OS_TRACE=1
mistachkin753c5442011-08-25 02:02:25 +0000802!ENDIF
803
mistachkincd54bab2014-12-20 21:14:14 +0000804!IF $(DEBUG)>5
mistachkin13a24f82015-05-13 04:50:30 +0000805TCC = $(TCC) -DSQLITE_ENABLE_IOTRACE=1
806RCC = $(RCC) -DSQLITE_ENABLE_IOTRACE=1
mistachkin753c5442011-08-25 02:02:25 +0000807!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000808
mistachkinbd58d5f2012-06-30 22:22:34 +0000809# Prevent warnings about "insecure" MSVC runtime library functions
810# being used.
mistachkin176f1b42011-08-02 23:34:00 +0000811#
812TCC = $(TCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
mistachkinfec360a2012-04-18 10:29:21 +0000813BCC = $(BCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
mistachkin4d9d1f42012-09-03 10:32:32 +0000814RCC = $(RCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
mistachkin176f1b42011-08-02 23:34:00 +0000815
mistachkinbd58d5f2012-06-30 22:22:34 +0000816# Prevent warnings about "deprecated" POSIX functions being used.
817#
818TCC = $(TCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
819BCC = $(BCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
mistachkin4d9d1f42012-09-03 10:32:32 +0000820RCC = $(RCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
mistachkinbd58d5f2012-06-30 22:22:34 +0000821
mistachkin2f7d5d82012-08-22 00:39:34 +0000822# Use the SQLite debugging heap subsystem?
mistachkin1b186a92011-08-24 16:13:57 +0000823#
mistachkin2f7d5d82012-08-22 00:39:34 +0000824!IF $(MEMDEBUG)!=0
825TCC = $(TCC) -DSQLITE_MEMDEBUG=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000826RCC = $(RCC) -DSQLITE_MEMDEBUG=1
mistachkin2f7d5d82012-08-22 00:39:34 +0000827
mistachkin2f7d5d82012-08-22 00:39:34 +0000828# Use native Win32 heap subsystem instead of malloc/free?
829#
830!ELSEIF $(WIN32HEAP)!=0
831TCC = $(TCC) -DSQLITE_WIN32_MALLOC=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000832RCC = $(RCC) -DSQLITE_WIN32_MALLOC=1
mistachkin753c5442011-08-25 02:02:25 +0000833
mistachkin753c5442011-08-25 02:02:25 +0000834# Validate the heap on every call into the native Win32 heap subsystem?
835#
mistachkincd54bab2014-12-20 21:14:14 +0000836!IF $(DEBUG)>3
mistachkin753c5442011-08-25 02:02:25 +0000837TCC = $(TCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000838RCC = $(RCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1
mistachkin753c5442011-08-25 02:02:25 +0000839!ENDIF
mistachkin2f7d5d82012-08-22 00:39:34 +0000840!ENDIF
mistachkin1b186a92011-08-24 16:13:57 +0000841
mistachkin3e786092016-01-23 07:53:04 +0000842# <<mark>>
mistachkin5b0b6fd2011-06-25 01:14:36 +0000843# The locations of the Tcl header and library files. Also, the library that
844# non-stubs enabled programs using Tcl must link against. These variables
845# (TCLINCDIR, TCLLIBDIR, and LIBTCL) may be overridden via the environment
846# prior to running nmake in order to match the actual installed location and
847# version on this machine.
shanehb2f20bf2011-06-17 07:07:24 +0000848#
mistachkincb6acda2017-12-05 18:54:12 +0000849!IFNDEF TCLDIR
mistachkina0fcafe2017-12-05 19:07:30 +0000850TCLDIR = $(TOP)\compat\tcl
mistachkincb6acda2017-12-05 18:54:12 +0000851!ENDIF
852
mistachkine37f99c2012-06-30 16:22:05 +0000853!IFNDEF TCLINCDIR
mistachkincb6acda2017-12-05 18:54:12 +0000854TCLINCDIR = $(TCLDIR)\include
mistachkine37f99c2012-06-30 16:22:05 +0000855!ENDIF
mistachkin5b0b6fd2011-06-25 01:14:36 +0000856
mistachkine37f99c2012-06-30 16:22:05 +0000857!IFNDEF TCLLIBDIR
mistachkincb6acda2017-12-05 18:54:12 +0000858TCLLIBDIR = $(TCLDIR)\lib
mistachkine37f99c2012-06-30 16:22:05 +0000859!ENDIF
mistachkin5b0b6fd2011-06-25 01:14:36 +0000860
mistachkine37f99c2012-06-30 16:22:05 +0000861!IFNDEF LIBTCL
drh506a1402016-11-02 19:49:22 +0000862LIBTCL = tcl86.lib
mistachkine37f99c2012-06-30 16:22:05 +0000863!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000864
mistachkin5b663502015-10-10 23:39:55 +0000865!IFNDEF LIBTCLSTUB
drh506a1402016-11-02 19:49:22 +0000866LIBTCLSTUB = tclstub86.lib
mistachkin5b663502015-10-10 23:39:55 +0000867!ENDIF
868
mistachkin88739962015-10-14 23:04:08 +0000869!IFNDEF LIBTCLPATH
mistachkincb6acda2017-12-05 18:54:12 +0000870LIBTCLPATH = $(TCLDIR)\bin
871!ENDIF
872
873# The locations of the zlib header and library files. These variables
874# (ZLIBINCDIR, ZLIBLIBDIR, and ZLIBLIB) may be overridden via the environment
875# prior to running nmake in order to match the actual installed (or source
876# code) location on this machine.
877#
878!IFNDEF ZLIBDIR
879ZLIBDIR = $(TOP)\compat\zlib
880!ENDIF
881
882!IFNDEF ZLIBINCDIR
883ZLIBINCDIR = $(ZLIBDIR)
884!ENDIF
885
886!IFNDEF ZLIBLIBDIR
887ZLIBLIBDIR = $(ZLIBDIR)
888!ENDIF
889
890!IFNDEF ZLIBLIB
891!IF $(DYNAMIC_SHELL)!=0
892ZLIBLIB = zdll.lib
893!ELSE
894ZLIBLIB = zlib.lib
895!ENDIF
mistachkin88739962015-10-14 23:04:08 +0000896!ENDIF
897
mistachkinc756ded2011-10-02 05:23:16 +0000898# The locations of the ICU header and library files. These variables
899# (ICUINCDIR, ICULIBDIR, and LIBICU) may be overridden via the environment
900# prior to running nmake in order to match the actual installed location on
901# this machine.
902#
mistachkincb6acda2017-12-05 18:54:12 +0000903!IFNDEF ICUDIR
mistachkina0fcafe2017-12-05 19:07:30 +0000904ICUDIR = $(TOP)\compat\icu
mistachkincb6acda2017-12-05 18:54:12 +0000905!ENDIF
906
mistachkine37f99c2012-06-30 16:22:05 +0000907!IFNDEF ICUINCDIR
mistachkincb6acda2017-12-05 18:54:12 +0000908ICUINCDIR = $(ICUDIR)\include
mistachkine37f99c2012-06-30 16:22:05 +0000909!ENDIF
mistachkinc756ded2011-10-02 05:23:16 +0000910
mistachkine37f99c2012-06-30 16:22:05 +0000911!IFNDEF ICULIBDIR
mistachkincb6acda2017-12-05 18:54:12 +0000912ICULIBDIR = $(ICUDIR)\lib
mistachkine37f99c2012-06-30 16:22:05 +0000913!ENDIF
mistachkinc756ded2011-10-02 05:23:16 +0000914
mistachkine37f99c2012-06-30 16:22:05 +0000915!IFNDEF LIBICU
mistachkinc756ded2011-10-02 05:23:16 +0000916LIBICU = icuuc.lib icuin.lib
mistachkine37f99c2012-06-30 16:22:05 +0000917!ENDIF
mistachkinc756ded2011-10-02 05:23:16 +0000918
shanehb2f20bf2011-06-17 07:07:24 +0000919# This is the command to use for tclsh - normally just "tclsh", but we may
mistachkin5b0b6fd2011-06-25 01:14:36 +0000920# know the specific version we want to use. This variable (TCLSH_CMD) may be
921# overridden via the environment prior to running nmake in order to select a
922# specific Tcl shell to use.
shanehb2f20bf2011-06-17 07:07:24 +0000923#
mistachkine37f99c2012-06-30 16:22:05 +0000924!IFNDEF TCLSH_CMD
mistachkin47be3b22018-01-05 01:22:37 +0000925!IF $(USE_TCLSH_IN_PATH)!=0 || !EXIST("$(TCLDIR)\bin\tclsh.exe")
drh506a1402016-11-02 19:49:22 +0000926TCLSH_CMD = tclsh
mistachkina0fcafe2017-12-05 19:07:30 +0000927!ELSE
928TCLSH_CMD = $(TCLDIR)\bin\tclsh.exe
929!ENDIF
mistachkine37f99c2012-06-30 16:22:05 +0000930!ENDIF
mistachkin3e786092016-01-23 07:53:04 +0000931# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +0000932
933# Compiler options needed for programs that use the readline() library.
934#
mistachkin8bcd3fa2013-08-29 01:03:38 +0000935!IFNDEF READLINE_FLAGS
shaneh6e7850c2011-06-17 15:57:07 +0000936READLINE_FLAGS = -DHAVE_READLINE=0
mistachkin8bcd3fa2013-08-29 01:03:38 +0000937!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000938
939# The library that programs using readline() must link against.
940#
mistachkin8bcd3fa2013-08-29 01:03:38 +0000941!IFNDEF LIBREADLINE
shaneh6e7850c2011-06-17 15:57:07 +0000942LIBREADLINE =
mistachkin8bcd3fa2013-08-29 01:03:38 +0000943!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000944
945# Should the database engine be compiled threadsafe
946#
947TCC = $(TCC) -DSQLITE_THREADSAFE=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000948RCC = $(RCC) -DSQLITE_THREADSAFE=1
shanehb2f20bf2011-06-17 07:07:24 +0000949
950# Do threads override each others locks by default (1), or do we test (-1)
951#
952TCC = $(TCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1
mistachkin4d9d1f42012-09-03 10:32:32 +0000953RCC = $(RCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1
shanehb2f20bf2011-06-17 07:07:24 +0000954
955# Any target libraries which libsqlite must be linked against
shaneh6e7850c2011-06-17 15:57:07 +0000956#
mistachkine37f99c2012-06-30 16:22:05 +0000957!IFNDEF TLIBS
shaneh6e7850c2011-06-17 15:57:07 +0000958TLIBS =
mistachkine37f99c2012-06-30 16:22:05 +0000959!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000960
961# Flags controlling use of the in memory btree implementation
962#
963# SQLITE_TEMP_STORE is 0 to force temporary tables to be in a file, 1 to
964# default to file, 2 to default to memory, and 3 to force temporary
965# tables to always be in memory.
966#
shaneh6e7850c2011-06-17 15:57:07 +0000967TCC = $(TCC) -DSQLITE_TEMP_STORE=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000968RCC = $(RCC) -DSQLITE_TEMP_STORE=1
shanehb2f20bf2011-06-17 07:07:24 +0000969
970# Enable/disable loadable extensions, and other optional features
shaneh6e7850c2011-06-17 15:57:07 +0000971# based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*).
972# The same set of OMIT and ENABLE flags should be passed to the
shanehb2f20bf2011-06-17 07:07:24 +0000973# LEMON parser generator and the mkkeywordhash tool as well.
974
mistachkin4712c212014-05-09 20:51:17 +0000975# These are the required SQLite compilation options used when compiling for
976# the Windows platform.
977#
978REQ_FEATURE_FLAGS = $(REQ_FEATURE_FLAGS) -DSQLITE_MAX_TRIGGER_DEPTH=100
shanehb2f20bf2011-06-17 07:07:24 +0000979
mistachkine45e0fb2015-01-21 00:48:46 +0000980# If we are linking to the RPCRT4 library, enable features that need it.
981#
982!IF $(USE_RPCRT4_LIB)!=0
983REQ_FEATURE_FLAGS = $(REQ_FEATURE_FLAGS) -DSQLITE_WIN32_USE_UUID=1
984!ENDIF
985
mistachkin4712c212014-05-09 20:51:17 +0000986# Add the required and optional SQLite compilation options into the command
987# lines used to invoke the MSVC code and resource compilers.
988#
mistachkinedcb4eb2016-01-22 01:25:15 +0000989TCC = $(TCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS)
990RCC = $(RCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS)
shanehb2f20bf2011-06-17 07:07:24 +0000991
mistachkin4712c212014-05-09 20:51:17 +0000992# Add in any optional parameters specified on the commane line, e.g.
993# nmake /f Makefile.msc all "OPTS=-DSQLITE_ENABLE_FOO=1 -DSQLITE_OMIT_FOO=1"
994#
shanehb2f20bf2011-06-17 07:07:24 +0000995TCC = $(TCC) $(OPTS)
mistachkin4d9d1f42012-09-03 10:32:32 +0000996RCC = $(RCC) $(OPTS)
shanehb2f20bf2011-06-17 07:07:24 +0000997
mistachkin8bcd3fa2013-08-29 01:03:38 +0000998# If compiling for debugging, add some defines.
mistachkin4712c212014-05-09 20:51:17 +0000999#
mistachkincd54bab2014-12-20 21:14:14 +00001000!IF $(DEBUG)>1
mistachkin8bcd3fa2013-08-29 01:03:38 +00001001TCC = $(TCC) -D_DEBUG
1002BCC = $(BCC) -D_DEBUG
mistachkin4d9d1f42012-09-03 10:32:32 +00001003RCC = $(RCC) -D_DEBUG
mistachkin4d60be52011-08-26 05:40:31 +00001004!ENDIF
1005
mistachkin8bcd3fa2013-08-29 01:03:38 +00001006# If optimizations are enabled or disabled (either implicitly or
1007# explicitly), add the necessary flags.
mistachkin4712c212014-05-09 20:51:17 +00001008#
mistachkincd54bab2014-12-20 21:14:14 +00001009!IF $(DEBUG)>1 || $(OPTIMIZATIONS)==0
mistachkin8bcd3fa2013-08-29 01:03:38 +00001010TCC = $(TCC) -Od
1011BCC = $(BCC) -Od
mistachkin24b6b812016-08-24 18:21:58 +00001012!IF $(USE_RUNTIME_CHECKS)!=0
1013TCC = $(TCC) -RTC1
1014BCC = $(BCC) -RTC1
1015!ENDIF
mistachkin8bcd3fa2013-08-29 01:03:38 +00001016!ELSEIF $(OPTIMIZATIONS)>=3
1017TCC = $(TCC) -Ox
1018BCC = $(BCC) -Ox
1019!ELSEIF $(OPTIMIZATIONS)==2
1020TCC = $(TCC) -O2
1021BCC = $(BCC) -O2
1022!ELSEIF $(OPTIMIZATIONS)==1
1023TCC = $(TCC) -O1
1024BCC = $(BCC) -O1
1025!ENDIF
1026
1027# If symbols are enabled (or compiling for debugging), enable PDBs.
mistachkin4712c212014-05-09 20:51:17 +00001028#
mistachkincd54bab2014-12-20 21:14:14 +00001029!IF $(DEBUG)>1 || $(SYMBOLS)!=0
mistachkin4d60be52011-08-26 05:40:31 +00001030TCC = $(TCC) -Zi
mistachkinfec360a2012-04-18 10:29:21 +00001031BCC = $(BCC) -Zi
mistachkin753c5442011-08-25 02:02:25 +00001032!ENDIF
1033
mistachkin3e786092016-01-23 07:53:04 +00001034# <<mark>>
mistachkincb6acda2017-12-05 18:54:12 +00001035# If zlib support is enabled, add the compiler options for it.
1036#
1037!IF $(USE_ZLIB)!=0
1038TCC = $(TCC) -DSQLITE_HAVE_ZLIB=1
1039RCC = $(RCC) -DSQLITE_HAVE_ZLIB=1
1040TCC = $(TCC) -I$(ZLIBINCDIR)
1041RCC = $(RCC) -I$(ZLIBINCDIR)
1042!ENDIF
1043
mistachkinc756ded2011-10-02 05:23:16 +00001044# If ICU support is enabled, add the compiler options for it.
mistachkin4712c212014-05-09 20:51:17 +00001045#
mistachkinc756ded2011-10-02 05:23:16 +00001046!IF $(USE_ICU)!=0
1047TCC = $(TCC) -DSQLITE_ENABLE_ICU=1
mistachkin4d9d1f42012-09-03 10:32:32 +00001048RCC = $(RCC) -DSQLITE_ENABLE_ICU=1
mistachkinc756ded2011-10-02 05:23:16 +00001049TCC = $(TCC) -I$(TOP)\ext\icu
mistachkin4d9d1f42012-09-03 10:32:32 +00001050RCC = $(RCC) -I$(TOP)\ext\icu
mistachkinc756ded2011-10-02 05:23:16 +00001051TCC = $(TCC) -I$(ICUINCDIR)
mistachkin4d9d1f42012-09-03 10:32:32 +00001052RCC = $(RCC) -I$(ICUINCDIR)
mistachkinc756ded2011-10-02 05:23:16 +00001053!ENDIF
mistachkin3e786092016-01-23 07:53:04 +00001054# <</mark>>
mistachkinc756ded2011-10-02 05:23:16 +00001055
mistachkin4d9d1f42012-09-03 10:32:32 +00001056# Command line prefixes for compiling code, compiling resources,
1057# linking, etc.
mistachkin4712c212014-05-09 20:51:17 +00001058#
shanehb2f20bf2011-06-17 07:07:24 +00001059LTCOMPILE = $(TCC) -Fo$@
mistachkin4d9d1f42012-09-03 10:32:32 +00001060LTRCOMPILE = $(RCC) -r
shanehb2f20bf2011-06-17 07:07:24 +00001061LTLIB = lib.exe
shaneh2a0b9ef2011-06-20 20:52:32 +00001062LTLINK = $(TCC) -Fe$@
1063
mistachkine45e0fb2015-01-21 00:48:46 +00001064# If requested, link to the RPCRT4 library.
1065#
1066!IF $(USE_RPCRT4_LIB)!=0
mistachkin041343d2017-11-21 21:15:17 +00001067LTLIBS = $(LTLIBS) rpcrt4.lib
mistachkine45e0fb2015-01-21 00:48:46 +00001068!ENDIF
1069
shaneh2a0b9ef2011-06-20 20:52:32 +00001070# If a platform was set, force the linker to target that.
1071# Note that the vcvars*.bat family of batch files typically
1072# set this for you. Otherwise, the linker will attempt
1073# to deduce the binary type based on the object files.
mistachkine37f99c2012-06-30 16:22:05 +00001074!IFDEF PLATFORM
mistachkin44723ce2015-03-21 02:22:37 +00001075LTLINKOPTS = /NOLOGO /MACHINE:$(PLATFORM)
1076LTLIBOPTS = /NOLOGO /MACHINE:$(PLATFORM)
1077!ELSE
1078LTLINKOPTS = /NOLOGO
1079LTLIBOPTS = /NOLOGO
shaneh2a0b9ef2011-06-20 20:52:32 +00001080!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +00001081
mistachkina6ff8572012-04-17 21:00:12 +00001082# When compiling for use in the WinRT environment, the following
1083# linker option must be used to mark the executable as runnable
1084# only in the context of an application container.
1085#
1086!IF $(FOR_WINRT)!=0
1087LTLINKOPTS = $(LTLINKOPTS) /APPCONTAINER
mistachkin318d38c2015-04-22 01:33:53 +00001088!IF "$(VISUALSTUDIOVERSION)"=="12.0" || "$(VISUALSTUDIOVERSION)"=="14.0"
mistachkinf6a23422014-05-05 20:24:34 +00001089!IFNDEF STORELIBPATH
mistachkinda5b1cd2013-07-10 19:39:02 +00001090!IF "$(PLATFORM)"=="x86"
mistachkin4712c212014-05-09 20:51:17 +00001091STORELIBPATH = $(CRTLIBPATH)\store
mistachkinda5b1cd2013-07-10 19:39:02 +00001092!ELSEIF "$(PLATFORM)"=="x64"
mistachkin4712c212014-05-09 20:51:17 +00001093STORELIBPATH = $(CRTLIBPATH)\store\amd64
mistachkin4eaa1292013-07-10 21:33:25 +00001094!ELSEIF "$(PLATFORM)"=="ARM"
mistachkin4712c212014-05-09 20:51:17 +00001095STORELIBPATH = $(CRTLIBPATH)\store\arm
mistachkin4eaa1292013-07-10 21:33:25 +00001096!ELSE
mistachkin4712c212014-05-09 20:51:17 +00001097STORELIBPATH = $(CRTLIBPATH)\store
mistachkinda5b1cd2013-07-10 19:39:02 +00001098!ENDIF
1099!ENDIF
mistachkinf6a23422014-05-05 20:24:34 +00001100STORELIBPATH = $(STORELIBPATH:\\=\)
1101LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(STORELIBPATH)"
1102!ENDIF
mistachkina6ff8572012-04-17 21:00:12 +00001103!ENDIF
1104
mistachkind9b3c542014-05-09 23:31:55 +00001105# When compiling for Windows Phone 8.1, an extra library path is
1106# required.
1107#
1108!IF $(USE_WP81_OPTS)!=0
1109!IFNDEF WP81LIBPATH
1110!IF "$(PLATFORM)"=="x86"
1111WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86
1112!ELSEIF "$(PLATFORM)"=="ARM"
1113WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\ARM
1114!ELSE
1115WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86
mistachkinc756ded2011-10-02 05:23:16 +00001116!ENDIF
mistachkin31856a32012-07-27 07:13:25 +00001117!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +00001118!ENDIF
1119
mistachkind9b3c542014-05-09 23:31:55 +00001120# When compiling for Windows Phone 8.1, some extra linker options
1121# are also required.
1122#
1123!IF $(USE_WP81_OPTS)!=0
1124!IFDEF WP81LIBPATH
1125LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(WP81LIBPATH)"
1126!ENDIF
1127LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE
1128LTLINKOPTS = $(LTLINKOPTS) WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelHost.lib
1129LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:kernel32.lib /NODEFAULTLIB:ole32.lib
1130!ENDIF
1131
mistachkina819aed2016-02-12 05:19:29 +00001132# When compiling for UWP or the Windows 10 platform, some extra linker
mistachkin55e88d92016-02-08 20:40:57 +00001133# options are also required.
mistachkin318d38c2015-04-22 01:33:53 +00001134#
mistachkina819aed2016-02-12 05:19:29 +00001135!IF $(FOR_UWP)!=0 || $(FOR_WIN10)!=0
mistachkin318d38c2015-04-22 01:33:53 +00001136LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE /NODEFAULTLIB:kernel32.lib
1137LTLINKOPTS = $(LTLINKOPTS) mincore.lib
1138!IFDEF PSDKLIBPATH
1139LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(PSDKLIBPATH)"
1140!ENDIF
1141!ENDIF
1142
mistachkina6f28892016-02-05 19:40:23 +00001143!IF $(FOR_WIN10)!=0
mistachkin406eeff2016-02-09 18:28:20 +00001144LTLINKOPTS = $(LTLINKOPTS) /guard:cf "/LIBPATH:$(UCRTLIBPATH)"
mistachkina6f28892016-02-05 19:40:23 +00001145!IF $(DEBUG)>1
1146LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:libucrtd.lib /DEFAULTLIB:ucrtd.lib
1147!ELSE
1148LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib
1149!ENDIF
1150!ENDIF
1151
shanehb2f20bf2011-06-17 07:07:24 +00001152# If either debugging or symbols are enabled, enable PDBs.
mistachkin4712c212014-05-09 20:51:17 +00001153#
mistachkincd54bab2014-12-20 21:14:14 +00001154!IF $(DEBUG)>1 || $(SYMBOLS)!=0
mistachkinf170ea42015-10-16 20:13:57 +00001155LDFLAGS = /DEBUG $(LDOPTS)
1156!ELSE
1157LDFLAGS = $(LDOPTS)
shanehb2f20bf2011-06-17 07:07:24 +00001158!ENDIF
1159
mistachkin3e786092016-01-23 07:53:04 +00001160# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001161# Start with the Tcl related linker options.
mistachkin4712c212014-05-09 20:51:17 +00001162#
shanehb2f20bf2011-06-17 07:07:24 +00001163!IF $(NO_TCL)==0
mistachkin590522c2018-01-05 16:05:51 +00001164TCLLIBPATHS = $(TCLLIBPATHS) /LIBPATH:$(TCLLIBDIR)
1165TCLLIBS = $(TCLLIBS) $(LIBTCL)
mistachkin31856a32012-07-27 07:13:25 +00001166!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +00001167
mistachkincb6acda2017-12-05 18:54:12 +00001168# If zlib support is enabled, add the linker options for it.
1169#
1170!IF $(USE_ZLIB)!=0
1171LTLIBPATHS = $(LTLIBPATHS) /LIBPATH:$(ZLIBLIBDIR)
1172LTLIBS = $(LTLIBS) $(ZLIBLIB)
shanehb2f20bf2011-06-17 07:07:24 +00001173!ENDIF
1174
1175# If ICU support is enabled, add the linker options for it.
mistachkin4712c212014-05-09 20:51:17 +00001176#
shanehb2f20bf2011-06-17 07:07:24 +00001177!IF $(USE_ICU)!=0
1178LTLIBPATHS = $(LTLIBPATHS) /LIBPATH:$(ICULIBDIR)
1179LTLIBS = $(LTLIBS) $(LIBICU)
1180!ENDIF
mistachkin3e786092016-01-23 07:53:04 +00001181# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001182
shanehb2f20bf2011-06-17 07:07:24 +00001183# You should not have to change anything below this line
1184###############################################################################
1185
mistachkin3e786092016-01-23 07:53:04 +00001186# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001187# Object files for the SQLite library (non-amalgamation).
1188#
mistachkinf67feef2013-07-29 19:03:20 +00001189LIBOBJS0 = vdbe.lo parse.lo alter.lo analyze.lo attach.lo auth.lo \
shanehb2f20bf2011-06-17 07:07:24 +00001190 backup.lo bitvec.lo btmutex.lo btree.lo build.lo \
drha43c8c82017-10-11 13:48:11 +00001191 callback.lo complete.lo ctime.lo \
1192 date.lo dbpage.lo dbstat.lo delete.lo \
shanehb2f20bf2011-06-17 07:07:24 +00001193 expr.lo fault.lo fkey.lo \
drh391d4ba2012-05-28 20:22:16 +00001194 fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo \
1195 fts3_porter.lo fts3_snippet.lo fts3_tokenizer.lo fts3_tokenizer1.lo \
drh4d648c72013-04-22 17:07:56 +00001196 fts3_tokenize_vtab.lo fts3_unicode.lo fts3_unicode2.lo fts3_write.lo \
mistachkined52f9f2015-06-26 04:34:36 +00001197 fts5.lo \
shanehb2f20bf2011-06-17 07:07:24 +00001198 func.lo global.lo hash.lo \
drhc2f18ad2016-03-05 15:35:09 +00001199 icu.lo insert.lo legacy.lo loadext.lo \
shanehb2f20bf2011-06-17 07:07:24 +00001200 main.lo malloc.lo mem0.lo mem1.lo mem2.lo mem3.lo mem5.lo \
drhac442f42018-01-03 01:28:46 +00001201 memdb.lo memjournal.lo \
mistachkinf1c6bc52012-06-21 15:09:20 +00001202 mutex.lo mutex_noop.lo mutex_unix.lo mutex_w32.lo \
1203 notify.lo opcodes.lo os.lo os_unix.lo os_win.lo \
mistachkinf67feef2013-07-29 19:03:20 +00001204 pager.lo pcache.lo pcache1.lo pragma.lo prepare.lo printf.lo \
drh498dcae2013-03-13 11:42:00 +00001205 random.lo resolve.lo rowset.lo rtree.lo \
drhcb75bff2016-01-14 14:48:17 +00001206 sqlite3session.lo select.lo sqlite3rbu.lo status.lo \
drh38b41492015-06-08 15:08:15 +00001207 table.lo threads.lo tokenize.lo treeview.lo trigger.lo \
drhfcfd7562018-04-12 21:42:51 +00001208 update.lo upsert.lo util.lo vacuum.lo \
mistachkinf67feef2013-07-29 19:03:20 +00001209 vdbeapi.lo vdbeaux.lo vdbeblob.lo vdbemem.lo vdbesort.lo \
drh6c1f4ef2015-06-08 14:23:15 +00001210 vdbetrace.lo wal.lo walker.lo where.lo wherecode.lo whereexpr.lo \
dan980cf252018-06-10 07:42:35 +00001211 window.lo utf.lo vtab.lo
mistachkin3e786092016-01-23 07:53:04 +00001212# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001213
1214# Object files for the amalgamation.
1215#
1216LIBOBJS1 = sqlite3.lo
1217
1218# Determine the real value of LIBOBJ based on the 'configure' script
1219#
mistachkin3e786092016-01-23 07:53:04 +00001220# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001221!IF $(USE_AMALGAMATION)==0
1222LIBOBJ = $(LIBOBJS0)
1223!ELSE
mistachkin3e786092016-01-23 07:53:04 +00001224# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001225LIBOBJ = $(LIBOBJS1)
mistachkin3e786092016-01-23 07:53:04 +00001226# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001227!ENDIF
mistachkin3e786092016-01-23 07:53:04 +00001228# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001229
mistachkin08c1c312012-10-06 03:48:25 +00001230# Determine if embedded resource compilation and usage are enabled.
1231#
1232!IF $(USE_RC)!=0
1233LIBRESOBJS = sqlite3res.lo
1234!ELSE
1235LIBRESOBJS =
1236!ENDIF
1237
mistachkin3e786092016-01-23 07:53:04 +00001238# <<mark>>
mistachkinc04c54b2016-02-11 21:28:16 +00001239# Core source code files, part 1.
shanehb2f20bf2011-06-17 07:07:24 +00001240#
mistachkinc04c54b2016-02-11 21:28:16 +00001241SRC00 = \
shanehb2f20bf2011-06-17 07:07:24 +00001242 $(TOP)\src\alter.c \
1243 $(TOP)\src\analyze.c \
1244 $(TOP)\src\attach.c \
1245 $(TOP)\src\auth.c \
1246 $(TOP)\src\backup.c \
1247 $(TOP)\src\bitvec.c \
1248 $(TOP)\src\btmutex.c \
1249 $(TOP)\src\btree.c \
shanehb2f20bf2011-06-17 07:07:24 +00001250 $(TOP)\src\build.c \
1251 $(TOP)\src\callback.c \
1252 $(TOP)\src\complete.c \
1253 $(TOP)\src\ctime.c \
1254 $(TOP)\src\date.c \
drha43c8c82017-10-11 13:48:11 +00001255 $(TOP)\src\dbpage.c \
drh1a4a6802015-05-04 18:31:09 +00001256 $(TOP)\src\dbstat.c \
shanehb2f20bf2011-06-17 07:07:24 +00001257 $(TOP)\src\delete.c \
1258 $(TOP)\src\expr.c \
1259 $(TOP)\src\fault.c \
1260 $(TOP)\src\fkey.c \
1261 $(TOP)\src\func.c \
1262 $(TOP)\src\global.c \
1263 $(TOP)\src\hash.c \
shanehb2f20bf2011-06-17 07:07:24 +00001264 $(TOP)\src\insert.c \
shanehb2f20bf2011-06-17 07:07:24 +00001265 $(TOP)\src\legacy.c \
1266 $(TOP)\src\loadext.c \
1267 $(TOP)\src\main.c \
1268 $(TOP)\src\malloc.c \
1269 $(TOP)\src\mem0.c \
1270 $(TOP)\src\mem1.c \
1271 $(TOP)\src\mem2.c \
1272 $(TOP)\src\mem3.c \
1273 $(TOP)\src\mem5.c \
drhac442f42018-01-03 01:28:46 +00001274 $(TOP)\src\memdb.c \
shanehb2f20bf2011-06-17 07:07:24 +00001275 $(TOP)\src\memjournal.c \
1276 $(TOP)\src\mutex.c \
shanehb2f20bf2011-06-17 07:07:24 +00001277 $(TOP)\src\mutex_noop.c \
shanehb2f20bf2011-06-17 07:07:24 +00001278 $(TOP)\src\mutex_unix.c \
1279 $(TOP)\src\mutex_w32.c \
1280 $(TOP)\src\notify.c \
1281 $(TOP)\src\os.c \
shanehb2f20bf2011-06-17 07:07:24 +00001282 $(TOP)\src\os_unix.c \
mistachkinc04c54b2016-02-11 21:28:16 +00001283 $(TOP)\src\os_win.c
1284
1285# Core source code files, part 2.
1286#
1287SRC01 = \
shanehb2f20bf2011-06-17 07:07:24 +00001288 $(TOP)\src\pager.c \
shanehb2f20bf2011-06-17 07:07:24 +00001289 $(TOP)\src\pcache.c \
shanehb2f20bf2011-06-17 07:07:24 +00001290 $(TOP)\src\pcache1.c \
1291 $(TOP)\src\pragma.c \
1292 $(TOP)\src\prepare.c \
1293 $(TOP)\src\printf.c \
1294 $(TOP)\src\random.c \
1295 $(TOP)\src\resolve.c \
1296 $(TOP)\src\rowset.c \
1297 $(TOP)\src\select.c \
1298 $(TOP)\src\status.c \
shanehb2f20bf2011-06-17 07:07:24 +00001299 $(TOP)\src\table.c \
drhf51446a2012-07-21 19:40:42 +00001300 $(TOP)\src\threads.c \
shanehb2f20bf2011-06-17 07:07:24 +00001301 $(TOP)\src\tclsqlite.c \
1302 $(TOP)\src\tokenize.c \
drh38b41492015-06-08 15:08:15 +00001303 $(TOP)\src\treeview.c \
shanehb2f20bf2011-06-17 07:07:24 +00001304 $(TOP)\src\trigger.c \
1305 $(TOP)\src\utf.c \
1306 $(TOP)\src\update.c \
drhfcfd7562018-04-12 21:42:51 +00001307 $(TOP)\src\upsert.c \
shanehb2f20bf2011-06-17 07:07:24 +00001308 $(TOP)\src\util.c \
1309 $(TOP)\src\vacuum.c \
1310 $(TOP)\src\vdbe.c \
shanehb2f20bf2011-06-17 07:07:24 +00001311 $(TOP)\src\vdbeapi.c \
1312 $(TOP)\src\vdbeaux.c \
1313 $(TOP)\src\vdbeblob.c \
1314 $(TOP)\src\vdbemem.c \
mistachkin81c428a2011-08-17 02:19:54 +00001315 $(TOP)\src\vdbesort.c \
shanehb2f20bf2011-06-17 07:07:24 +00001316 $(TOP)\src\vdbetrace.c \
shanehb2f20bf2011-06-17 07:07:24 +00001317 $(TOP)\src\vtab.c \
1318 $(TOP)\src\wal.c \
shanehb2f20bf2011-06-17 07:07:24 +00001319 $(TOP)\src\walker.c \
drhe54df422013-11-12 18:37:25 +00001320 $(TOP)\src\where.c \
drh6f82e852015-06-06 20:12:09 +00001321 $(TOP)\src\wherecode.c \
dan980cf252018-06-10 07:42:35 +00001322 $(TOP)\src\whereexpr.c \
1323 $(TOP)\src\window.c
mistachkinc04c54b2016-02-11 21:28:16 +00001324
mistachkinc04c54b2016-02-11 21:28:16 +00001325# Core miscellaneous files.
1326#
1327SRC03 = \
1328 $(TOP)\src\parse.y
1329
1330# Core header files, part 1.
1331#
1332SRC04 = \
1333 $(TOP)\src\btree.h \
1334 $(TOP)\src\btreeInt.h \
1335 $(TOP)\src\hash.h \
1336 $(TOP)\src\hwtime.h \
1337 $(TOP)\src\msvc.h \
1338 $(TOP)\src\mutex.h \
1339 $(TOP)\src\os.h \
1340 $(TOP)\src\os_common.h \
1341 $(TOP)\src\os_setup.h \
1342 $(TOP)\src\os_win.h
1343
1344# Core header files, part 2.
1345#
1346SRC05 = \
1347 $(TOP)\src\pager.h \
1348 $(TOP)\src\pcache.h \
1349 $(TOP)\src\pragma.h \
1350 $(TOP)\src\sqlite.h.in \
1351 $(TOP)\src\sqlite3ext.h \
1352 $(TOP)\src\sqliteInt.h \
1353 $(TOP)\src\sqliteLimit.h \
1354 $(TOP)\src\vdbe.h \
1355 $(TOP)\src\vdbeInt.h \
1356 $(TOP)\src\vxworks.h \
1357 $(TOP)\src\wal.h \
drhe54df422013-11-12 18:37:25 +00001358 $(TOP)\src\whereInt.h
shanehb2f20bf2011-06-17 07:07:24 +00001359
mistachkinc04c54b2016-02-11 21:28:16 +00001360# Extension source code files, part 1.
shanehb2f20bf2011-06-17 07:07:24 +00001361#
mistachkinc04c54b2016-02-11 21:28:16 +00001362SRC06 = \
shanehb2f20bf2011-06-17 07:07:24 +00001363 $(TOP)\ext\fts1\fts1.c \
shanehb2f20bf2011-06-17 07:07:24 +00001364 $(TOP)\ext\fts1\fts1_hash.c \
shanehb2f20bf2011-06-17 07:07:24 +00001365 $(TOP)\ext\fts1\fts1_porter.c \
drh62679202015-01-29 18:38:05 +00001366 $(TOP)\ext\fts1\fts1_tokenizer1.c \
shanehb2f20bf2011-06-17 07:07:24 +00001367 $(TOP)\ext\fts2\fts2.c \
shanehb2f20bf2011-06-17 07:07:24 +00001368 $(TOP)\ext\fts2\fts2_hash.c \
shanehb2f20bf2011-06-17 07:07:24 +00001369 $(TOP)\ext\fts2\fts2_icu.c \
1370 $(TOP)\ext\fts2\fts2_porter.c \
shanehb2f20bf2011-06-17 07:07:24 +00001371 $(TOP)\ext\fts2\fts2_tokenizer.c \
1372 $(TOP)\ext\fts2\fts2_tokenizer1.c
mistachkinc04c54b2016-02-11 21:28:16 +00001373
1374# Extension source code files, part 2.
1375#
1376SRC07 = \
shanehb2f20bf2011-06-17 07:07:24 +00001377 $(TOP)\ext\fts3\fts3.c \
shanehb2f20bf2011-06-17 07:07:24 +00001378 $(TOP)\ext\fts3\fts3_aux.c \
1379 $(TOP)\ext\fts3\fts3_expr.c \
1380 $(TOP)\ext\fts3\fts3_hash.c \
shanehb2f20bf2011-06-17 07:07:24 +00001381 $(TOP)\ext\fts3\fts3_icu.c \
1382 $(TOP)\ext\fts3\fts3_porter.c \
1383 $(TOP)\ext\fts3\fts3_snippet.c \
shanehb2f20bf2011-06-17 07:07:24 +00001384 $(TOP)\ext\fts3\fts3_tokenizer.c \
1385 $(TOP)\ext\fts3\fts3_tokenizer1.c \
drh4d648c72013-04-22 17:07:56 +00001386 $(TOP)\ext\fts3\fts3_tokenize_vtab.c \
drh391d4ba2012-05-28 20:22:16 +00001387 $(TOP)\ext\fts3\fts3_unicode.c \
1388 $(TOP)\ext\fts3\fts3_unicode2.c \
drh62679202015-01-29 18:38:05 +00001389 $(TOP)\ext\fts3\fts3_write.c \
drh62679202015-01-29 18:38:05 +00001390 $(TOP)\ext\icu\icu.c \
drhedea9112015-03-24 19:02:13 +00001391 $(TOP)\ext\rtree\rtree.c \
drhdbbd8162015-05-19 23:04:26 +00001392 $(TOP)\ext\session\sqlite3session.c \
drh50065652015-10-08 19:29:18 +00001393 $(TOP)\ext\rbu\sqlite3rbu.c \
drhf00f5302017-06-28 15:47:29 +00001394 $(TOP)\ext\misc\json1.c \
drhc6603af2017-06-29 14:33:51 +00001395 $(TOP)\ext\misc\stmt.c
shanehb2f20bf2011-06-17 07:07:24 +00001396
mistachkinc04c54b2016-02-11 21:28:16 +00001397# Extension header files, part 1.
1398#
1399SRC08 = \
1400 $(TOP)\ext\fts1\fts1.h \
1401 $(TOP)\ext\fts1\fts1_hash.h \
1402 $(TOP)\ext\fts1\fts1_tokenizer.h \
1403 $(TOP)\ext\fts2\fts2.h \
1404 $(TOP)\ext\fts2\fts2_hash.h \
1405 $(TOP)\ext\fts2\fts2_tokenizer.h
1406
1407# Extension header files, part 2.
1408#
1409SRC09 = \
1410 $(TOP)\ext\fts3\fts3.h \
1411 $(TOP)\ext\fts3\fts3Int.h \
1412 $(TOP)\ext\fts3\fts3_hash.h \
1413 $(TOP)\ext\fts3\fts3_tokenizer.h \
1414 $(TOP)\ext\icu\sqliteicu.h \
1415 $(TOP)\ext\rtree\rtree.h \
mistachkin05004782016-03-30 16:23:06 +00001416 $(TOP)\ext\rbu\sqlite3rbu.h \
1417 $(TOP)\ext\session\sqlite3session.h
shanehb2f20bf2011-06-17 07:07:24 +00001418
1419# Generated source code files
1420#
mistachkinc04c54b2016-02-11 21:28:16 +00001421SRC10 = \
shanehb2f20bf2011-06-17 07:07:24 +00001422 opcodes.c \
mistachkinc04c54b2016-02-11 21:28:16 +00001423 parse.c
1424
1425# Generated header files
1426#
1427SRC11 = \
1428 keywordhash.h \
shanehb2f20bf2011-06-17 07:07:24 +00001429 opcodes.h \
shanehb2f20bf2011-06-17 07:07:24 +00001430 parse.h \
drhaa62d2e2017-10-12 13:47:48 +00001431 shell.c \
mistachkin5d4d9412016-01-22 03:54:36 +00001432 $(SQLITE3H)
shanehb2f20bf2011-06-17 07:07:24 +00001433
mistachkin52b1dbb2016-07-28 14:37:04 +00001434# Generated Tcl header files
1435#
mistachkin4ef916e2016-08-24 19:58:46 +00001436!IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
mistachkin52b1dbb2016-07-28 14:37:04 +00001437SRC12 = \
mistachkin4ef916e2016-08-24 19:58:46 +00001438 $(SQLITETCLH) \
1439 $(SQLITETCLDECLSH)
1440!ELSE
1441SRC12 =
1442!ENDIF
mistachkin52b1dbb2016-07-28 14:37:04 +00001443
drh62679202015-01-29 18:38:05 +00001444# All source code files.
1445#
drhaa62d2e2017-10-12 13:47:48 +00001446SRC = $(SRC00) $(SRC01) $(SRC03) $(SRC04) $(SRC05) $(SRC06) $(SRC07) $(SRC08) $(SRC09) $(SRC10) $(SRC11)
drh62679202015-01-29 18:38:05 +00001447
shanehb2f20bf2011-06-17 07:07:24 +00001448# Source code to the test files.
1449#
1450TESTSRC = \
1451 $(TOP)\src\test1.c \
1452 $(TOP)\src\test2.c \
1453 $(TOP)\src\test3.c \
1454 $(TOP)\src\test4.c \
1455 $(TOP)\src\test5.c \
1456 $(TOP)\src\test6.c \
1457 $(TOP)\src\test7.c \
1458 $(TOP)\src\test8.c \
1459 $(TOP)\src\test9.c \
1460 $(TOP)\src\test_autoext.c \
1461 $(TOP)\src\test_async.c \
1462 $(TOP)\src\test_backup.c \
drhddebf162016-03-04 02:59:35 +00001463 $(TOP)\src\test_bestindex.c \
drh5de7d962014-12-05 00:17:39 +00001464 $(TOP)\src\test_blob.c \
shanehb2f20bf2011-06-17 07:07:24 +00001465 $(TOP)\src\test_btree.c \
1466 $(TOP)\src\test_config.c \
dan000f95b2016-09-09 20:00:40 +00001467 $(TOP)\src\test_delete.c \
shanehb2f20bf2011-06-17 07:07:24 +00001468 $(TOP)\src\test_demovfs.c \
1469 $(TOP)\src\test_devsym.c \
mistachkin413c63b2013-01-17 03:18:14 +00001470 $(TOP)\src\test_fs.c \
shanehb2f20bf2011-06-17 07:07:24 +00001471 $(TOP)\src\test_func.c \
shanehb2f20bf2011-06-17 07:07:24 +00001472 $(TOP)\src\test_hexio.c \
1473 $(TOP)\src\test_init.c \
1474 $(TOP)\src\test_intarray.c \
1475 $(TOP)\src\test_journal.c \
1476 $(TOP)\src\test_malloc.c \
drhc318f732017-10-13 15:06:06 +00001477 $(TOP)\src\test_md5.c \
shanehb2f20bf2011-06-17 07:07:24 +00001478 $(TOP)\src\test_multiplex.c \
1479 $(TOP)\src\test_mutex.c \
1480 $(TOP)\src\test_onefile.c \
1481 $(TOP)\src\test_osinst.c \
1482 $(TOP)\src\test_pcache.c \
1483 $(TOP)\src\test_quota.c \
1484 $(TOP)\src\test_rtree.c \
1485 $(TOP)\src\test_schema.c \
1486 $(TOP)\src\test_server.c \
1487 $(TOP)\src\test_superlock.c \
1488 $(TOP)\src\test_syscall.c \
drhc318f732017-10-13 15:06:06 +00001489 $(TOP)\src\test_tclsh.c \
shanehb2f20bf2011-06-17 07:07:24 +00001490 $(TOP)\src\test_tclvar.c \
1491 $(TOP)\src\test_thread.c \
1492 $(TOP)\src\test_vfs.c \
mistachkin92af1eb2015-11-30 23:29:07 +00001493 $(TOP)\src\test_windirent.c \
dan660af932018-06-18 16:55:22 +00001494 $(TOP)\src\test_window.c \
shanehb2f20bf2011-06-17 07:07:24 +00001495 $(TOP)\src\test_wsd.c \
1496 $(TOP)\ext\fts3\fts3_term.c \
mistachkinadb96a62012-01-16 12:33:36 +00001497 $(TOP)\ext\fts3\fts3_test.c \
mistachkin05004782016-03-30 16:23:06 +00001498 $(TOP)\ext\rbu\test_rbu.c \
1499 $(TOP)\ext\session\test_session.c
shanehb2f20bf2011-06-17 07:07:24 +00001500
mistachkinc04c54b2016-02-11 21:28:16 +00001501# Statically linked extensions.
drhe50db1c2013-04-25 14:31:46 +00001502#
drh1fb64af2013-04-25 14:36:28 +00001503TESTEXT = \
drhbd0f1db2017-05-03 12:50:46 +00001504 $(TOP)\ext\expert\sqlite3expert.c \
1505 $(TOP)\ext\expert\test_expert.c \
drh8416fc72013-04-25 16:42:55 +00001506 $(TOP)\ext\misc\amatch.c \
drh2e3f87a2016-07-03 02:35:47 +00001507 $(TOP)\ext\misc\carray.c \
drh8416fc72013-04-25 16:42:55 +00001508 $(TOP)\ext\misc\closure.c \
drh35db31b2016-06-02 23:13:21 +00001509 $(TOP)\ext\misc\csv.c \
drh1728bcb2014-11-10 16:49:56 +00001510 $(TOP)\ext\misc\eval.c \
drh51ed2982014-06-16 12:44:32 +00001511 $(TOP)\ext\misc\fileio.c \
drhe50db1c2013-04-25 14:31:46 +00001512 $(TOP)\ext\misc\fuzzer.c \
mistachkined52f9f2015-06-26 04:34:36 +00001513 $(TOP)\ext\fts5\fts5_tcl.c \
dand3789c02015-08-04 20:29:00 +00001514 $(TOP)\ext\fts5\fts5_test_mi.c \
dan2cfe0492016-01-14 20:05:59 +00001515 $(TOP)\ext\fts5\fts5_test_tok.c \
drh8416fc72013-04-25 16:42:55 +00001516 $(TOP)\ext\misc\ieee754.c \
drh262d5512017-09-18 18:08:54 +00001517 $(TOP)\ext\misc\mmapwarm.c \
drhea41dc42013-04-25 19:31:33 +00001518 $(TOP)\ext\misc\nextchar.c \
drh91694db2018-01-08 20:04:57 +00001519 $(TOP)\ext\misc\normalize.c \
drhdef33672013-05-28 20:25:54 +00001520 $(TOP)\ext\misc\percentile.c \
drhe50db1c2013-04-25 14:31:46 +00001521 $(TOP)\ext\misc\regexp.c \
drh6bada272016-08-09 21:08:42 +00001522 $(TOP)\ext\misc\remember.c \
drh398f8722015-08-19 13:54:20 +00001523 $(TOP)\ext\misc\series.c \
drhb7045ab2013-04-25 14:59:01 +00001524 $(TOP)\ext\misc\spellfix.c \
drh5f8cdac2013-10-14 21:14:42 +00001525 $(TOP)\ext\misc\totype.c \
drh3935ce82017-07-18 20:28:34 +00001526 $(TOP)\ext\misc\unionvtab.c \
drhe50db1c2013-04-25 14:31:46 +00001527 $(TOP)\ext\misc\wholenumber.c
1528
mistachkin590522c2018-01-05 16:05:51 +00001529# If use of zlib is enabled, add the "zipfile.c" source file.
1530#
1531!IF $(USE_ZLIB)!=0
1532TESTEXT = $(TESTEXT) $(TOP)\ext\misc\zipfile.c
1533!ENDIF
drhe50db1c2013-04-25 14:31:46 +00001534
shanehb2f20bf2011-06-17 07:07:24 +00001535# Source code to the library files needed by the test fixture
mistachkinadb96a62012-01-16 12:33:36 +00001536# (non-amalgamation)
shanehb2f20bf2011-06-17 07:07:24 +00001537#
1538TESTSRC2 = \
mistachkinc04c54b2016-02-11 21:28:16 +00001539 $(SRC00) \
1540 $(SRC01) \
1541 $(SRC06) \
1542 $(SRC07) \
1543 $(SRC10) \
mistachkin05004782016-03-30 16:23:06 +00001544 $(TOP)\ext\async\sqlite3async.c
shanehb2f20bf2011-06-17 07:07:24 +00001545
1546# Header files used by all library source files.
1547#
1548HDR = \
1549 $(TOP)\src\btree.h \
1550 $(TOP)\src\btreeInt.h \
1551 $(TOP)\src\hash.h \
1552 $(TOP)\src\hwtime.h \
1553 keywordhash.h \
mistachkin2318d332015-01-12 18:02:52 +00001554 $(TOP)\src\msvc.h \
shanehb2f20bf2011-06-17 07:07:24 +00001555 $(TOP)\src\mutex.h \
1556 opcodes.h \
1557 $(TOP)\src\os.h \
1558 $(TOP)\src\os_common.h \
mistachkinf74b9e02013-11-26 01:00:31 +00001559 $(TOP)\src\os_setup.h \
mistachkin8bc52622013-11-25 09:36:07 +00001560 $(TOP)\src\os_win.h \
shanehb2f20bf2011-06-17 07:07:24 +00001561 $(TOP)\src\pager.h \
1562 $(TOP)\src\pcache.h \
shaneh6e7850c2011-06-17 15:57:07 +00001563 parse.h \
drh67e65e52015-02-02 21:34:54 +00001564 $(TOP)\src\pragma.h \
mistachkin5d4d9412016-01-22 03:54:36 +00001565 $(SQLITE3H) \
mistachkine37f7392016-07-28 19:28:35 +00001566 sqlite3ext.h \
shaneh6e7850c2011-06-17 15:57:07 +00001567 $(TOP)\src\sqliteInt.h \
shanehb2f20bf2011-06-17 07:07:24 +00001568 $(TOP)\src\sqliteLimit.h \
1569 $(TOP)\src\vdbe.h \
drhe54df422013-11-12 18:37:25 +00001570 $(TOP)\src\vdbeInt.h \
drh8cd5b252015-03-02 22:06:43 +00001571 $(TOP)\src\vxworks.h \
drhe54df422013-11-12 18:37:25 +00001572 $(TOP)\src\whereInt.h
shanehb2f20bf2011-06-17 07:07:24 +00001573
1574# Header files used by extensions
1575#
1576EXTHDR = $(EXTHDR) \
1577 $(TOP)\ext\fts1\fts1.h \
1578 $(TOP)\ext\fts1\fts1_hash.h \
1579 $(TOP)\ext\fts1\fts1_tokenizer.h
1580EXTHDR = $(EXTHDR) \
1581 $(TOP)\ext\fts2\fts2.h \
1582 $(TOP)\ext\fts2\fts2_hash.h \
1583 $(TOP)\ext\fts2\fts2_tokenizer.h
1584EXTHDR = $(EXTHDR) \
1585 $(TOP)\ext\fts3\fts3.h \
1586 $(TOP)\ext\fts3\fts3Int.h \
1587 $(TOP)\ext\fts3\fts3_hash.h \
1588 $(TOP)\ext\fts3\fts3_tokenizer.h
1589EXTHDR = $(EXTHDR) \
1590 $(TOP)\ext\rtree\rtree.h
1591EXTHDR = $(EXTHDR) \
1592 $(TOP)\ext\icu\sqliteicu.h
1593EXTHDR = $(EXTHDR) \
1594 $(TOP)\ext\rtree\sqlite3rtree.h
mistachkinadb96a62012-01-16 12:33:36 +00001595EXTHDR = $(EXTHDR) \
1596 $(TOP)\ext\session\sqlite3session.h
shanehb2f20bf2011-06-17 07:07:24 +00001597
mistachkind4ab1032015-05-11 16:27:33 +00001598# executables needed for testing
drhf4375442015-05-11 12:15:45 +00001599#
1600TESTPROGS = \
1601 testfixture.exe \
mistachkinedcb4eb2016-01-22 01:25:15 +00001602 $(SQLITE3EXE) \
drhf4375442015-05-11 12:15:45 +00001603 sqlite3_analyzer.exe \
drh2737fa02017-10-31 15:49:19 +00001604 sqlite3_checker.exe \
drh290fcaa2016-06-08 01:03:05 +00001605 sqldiff.exe \
drh9dea1732018-01-06 04:34:05 +00001606 dbhash.exe \
1607 sqltclsh.exe
drhf4375442015-05-11 12:15:45 +00001608
drhea93c702015-05-26 18:15:08 +00001609# Databases containing fuzzer test cases
1610#
1611FUZZDATA = \
1612 $(TOP)\test\fuzzdata1.db \
1613 $(TOP)\test\fuzzdata2.db \
drh64ff56f2015-09-23 11:59:50 +00001614 $(TOP)\test\fuzzdata3.db \
drh362b66f2016-11-14 18:27:41 +00001615 $(TOP)\test\fuzzdata4.db \
drh5ecf9032018-05-08 12:49:53 +00001616 $(TOP)\test\fuzzdata5.db \
1617 $(TOP)\test\fuzzdata6.db
mistachkin3e786092016-01-23 07:53:04 +00001618# <</mark>>
drhea93c702015-05-26 18:15:08 +00001619
mistachkin5d4d9412016-01-22 03:54:36 +00001620# Additional compiler options for the shell. These are only effective
1621# when the shell is not being dynamically linked.
drhd7f2bea2015-09-19 14:32:51 +00001622#
mistachkin5d4d9412016-01-22 03:54:36 +00001623!IF $(DYNAMIC_SHELL)==0 && $(FOR_WIN10)==0
drh9b40ab42017-10-11 17:25:08 +00001624SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_STMTVTAB
drhca5cf122017-10-11 17:13:29 +00001625SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_ENABLE_DBSTAT_VTAB
drh470fc9d2018-01-01 19:33:12 +00001626SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_INTROSPECTION_PRAGMAS
drhd99c7b72018-01-10 19:15:21 +00001627SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_RTREE
mistachkinedcb4eb2016-01-22 01:25:15 +00001628!ENDIF
1629
mistachkin3e786092016-01-23 07:53:04 +00001630# <<mark>>
mistachkin5d4d9412016-01-22 03:54:36 +00001631# Extra compiler options for various test tools.
1632#
mistachkin690e8852017-10-11 17:50:22 +00001633MPTESTER_COMPILE_OPTS = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5
mistachkin8381be42015-10-09 14:23:56 +00001634FUZZERSHELL_COMPILE_OPTS = -DSQLITE_ENABLE_JSON1
drhcc398962018-02-20 15:23:37 +00001635FUZZCHECK_COMPILE_OPTS = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMSYS5 -DSQLITE_OSS_FUZZ -DSQLITE_MAX_MEMORY=50000000 -DSQLITE_PRINTF_PRECISION_LIMIT=1000
drh362b66f2016-11-14 18:27:41 +00001636FUZZCHECK_SRC = $(TOP)\test\fuzzcheck.c $(TOP)\test\ossfuzz.c
1637OSSSHELL_SRC = $(TOP)\test\ossshell.c $(TOP)\test\ossfuzz.c
mistachkin953fbd12017-02-07 21:09:34 +00001638DBFUZZ_COMPILE_OPTS = -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION
1639KV_COMPILE_OPTS = -DSQLITE_THREADSAFE=0 -DSQLITE_DIRECT_OVERFLOW_READ
mistachkin953fbd12017-02-07 21:09:34 +00001640ST_COMPILE_OPTS = -DSQLITE_THREADSAFE=0
drhf4375442015-05-11 12:15:45 +00001641
mistachkin5d4d9412016-01-22 03:54:36 +00001642# Standard options to testfixture.
drh905da632015-06-10 18:53:09 +00001643#
1644TESTOPTS = --verbose=file --output=test-out.txt
drhf4375442015-05-11 12:15:45 +00001645
mistachkind5be6f02016-01-27 07:28:33 +00001646# Extra targets for the "all" target that require Tcl.
1647#
1648!IF $(NO_TCL)==0
1649ALL_TCL_TARGETS = libtclsqlite3.lib
1650!ELSE
1651ALL_TCL_TARGETS =
1652!ENDIF
mistachkin3e786092016-01-23 07:53:04 +00001653# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001654
1655# This is the default Makefile target. The objects listed here
1656# are what get build when you type just "make" with no arguments.
1657#
mistachkinaf238992018-01-05 17:40:38 +00001658core: dll libsqlite3.lib shell
1659
1660# Targets that require the Tcl library.
1661#
1662tcl: $(ALL_TCL_TARGETS)
1663
1664# This Makefile target builds all of the standard binaries.
1665#
1666all: core tcl
shanehb2f20bf2011-06-17 07:07:24 +00001667
mistachkina8a18732016-01-22 22:16:50 +00001668# Dynamic link library section.
1669#
mistachkin9b88ace2016-02-26 21:01:37 +00001670dll: $(SQLITE3DLL)
mistachkina8a18732016-01-22 22:16:50 +00001671
1672# Shell executable.
1673#
mistachkin9b88ace2016-02-26 21:01:37 +00001674shell: $(SQLITE3EXE)
shanehb2f20bf2011-06-17 07:07:24 +00001675
mistachkinb0c99af2016-02-19 05:07:56 +00001676# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001677libsqlite3.lib: $(LIBOBJ)
shaneh29ebea82011-06-21 18:12:07 +00001678 $(LTLIB) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001679
1680libtclsqlite3.lib: tclsqlite.lo libsqlite3.lib
mistachkin5b663502015-10-10 23:39:55 +00001681 $(LTLIB) $(LTLIBOPTS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCLSTUB) $(TLIBS)
mistachkin3e786092016-01-23 07:53:04 +00001682# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001683
mistachkin9b88ace2016-02-26 21:01:37 +00001684$(SQLITE3DLL): $(LIBOBJ) $(LIBRESOBJS) $(CORE_LINK_DEP)
mistachkina8a18732016-01-22 22:16:50 +00001685 $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL $(CORE_LINK_OPTS) /OUT:$@ $(LIBOBJ) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001686
mistachkin9aeb9712016-02-26 23:13:16 +00001687# <<block2>>
mistachkin9b88ace2016-02-26 21:01:37 +00001688sqlite3.def: libsqlite3.lib
mistachkina8a18732016-01-22 22:16:50 +00001689 echo EXPORTS > sqlite3.def
1690 dumpbin /all libsqlite3.lib \
mistachkin8384e432018-04-10 18:56:21 +00001691 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl include "^\s+1 _?(sqlite3(?:session|changeset|changegroup|rebaser)?_[^@]*)(?:@\d+)?$$" \1 \
mistachkina8a18732016-01-22 22:16:50 +00001692 | sort >> sqlite3.def
mistachkin9aeb9712016-02-26 23:13:16 +00001693# <</block2>>
drhd62c0f42015-04-09 13:34:29 +00001694
drhaa62d2e2017-10-12 13:47:48 +00001695$(SQLITE3EXE): shell.c $(SHELL_CORE_DEP) $(LIBRESOBJS) $(SHELL_CORE_SRC) $(SQLITE3H)
1696 $(LTLINK) $(SHELL_COMPILE_OPTS) $(READLINE_FLAGS) shell.c $(SHELL_CORE_SRC) \
mistachkinedcb4eb2016-01-22 01:25:15 +00001697 /link $(SQLITE3EXEPDB) $(LDFLAGS) $(LTLINKOPTS) $(SHELL_LINK_OPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS)
drh268e72f2015-04-17 14:30:49 +00001698
mistachkin3e786092016-01-23 07:53:04 +00001699# <<mark>>
mistachkin5d4d9412016-01-22 03:54:36 +00001700sqldiff.exe: $(TOP)\tool\sqldiff.c $(SQLITE3C) $(SQLITE3H)
1701 $(LTLINK) $(NO_WARN) $(TOP)\tool\sqldiff.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
mistachkin44723ce2015-03-21 02:22:37 +00001702
drh290fcaa2016-06-08 01:03:05 +00001703dbhash.exe: $(TOP)\tool\dbhash.c $(SQLITE3C) $(SQLITE3H)
1704 $(LTLINK) $(NO_WARN) $(TOP)\tool\dbhash.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
1705
drhda110bf2016-05-05 17:15:23 +00001706scrub.exe: $(TOP)\ext\misc\scrub.c $(SQLITE3C) $(SQLITE3H)
mistachkinac8ba262018-03-07 14:42:17 +00001707 $(LTLINK) $(NO_WARN) -DSCRUB_STANDALONE=1 $(TOP)\ext\misc\scrub.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drhda110bf2016-05-05 17:15:23 +00001708
drhfd0d93f2016-02-07 00:08:08 +00001709srcck1.exe: $(TOP)\tool\srcck1.c
1710 $(BCC) $(NO_WARN) -Fe$@ $(TOP)\tool\srcck1.c
1711
mistachkin1f237e32018-07-27 20:45:28 +00001712sourcetest: srcck1.exe $(SQLITE3C)
1713 srcck1.exe $(SQLITE3C)
drhfd0d93f2016-02-07 00:08:08 +00001714
mistachkin5d4d9412016-01-22 03:54:36 +00001715fuzzershell.exe: $(TOP)\tool\fuzzershell.c $(SQLITE3C) $(SQLITE3H)
1716 $(LTLINK) $(NO_WARN) $(FUZZERSHELL_COMPILE_OPTS) $(TOP)\tool\fuzzershell.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drhbc94dbb2013-04-08 14:28:33 +00001717
mistachkin953fbd12017-02-07 21:09:34 +00001718dbfuzz.exe: $(TOP)\test\dbfuzz.c $(SQLITE3C) $(SQLITE3H)
1719 $(LTLINK) $(NO_WARN) $(DBFUZZ_COMPILE_OPTS) $(TOP)\test\dbfuzz.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
1720
drh362b66f2016-11-14 18:27:41 +00001721fuzzcheck.exe: $(FUZZCHECK_SRC) $(SQLITE3C) $(SQLITE3H)
1722 $(LTLINK) $(NO_WARN) $(FUZZCHECK_COMPILE_OPTS) $(FUZZCHECK_SRC) $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
1723
1724ossshell.exe: $(OSSSHELL_SRC) $(SQLITE3C) $(SQLITE3H)
1725 $(LTLINK) $(NO_WARN) $(FUZZCHECK_COMPILE_OPTS) $(OSSSHELL_SRC) $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh1573dc32015-05-25 22:29:26 +00001726
mistachkin98cb7a42018-03-07 21:13:49 +00001727sessionfuzz.exe: zlib $(TOP)\test\sessionfuzz.c $(SQLITE3C) $(SQLITE3H)
1728 $(LTLINK) $(NO_WARN) -I$(ZLIBINCDIR) $(TOP)\test\sessionfuzz.c /link $(LDFLAGS) $(LTLINKOPTS) /LIBPATH:$(ZLIBLIBDIR) $(ZLIBLIB)
1729
mistachkin5d4d9412016-01-22 03:54:36 +00001730mptester.exe: $(TOP)\mptest\mptest.c $(SQLITE3C) $(SQLITE3H)
1731 $(LTLINK) $(NO_WARN) $(MPTESTER_COMPILE_OPTS) $(TOP)\mptest\mptest.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drhbc94dbb2013-04-08 14:28:33 +00001732
mistachkineb48b062015-03-31 17:45:44 +00001733MPTEST1 = mptester mptest.db $(TOP)\mptest\crash01.test --repeat 20
1734MPTEST2 = mptester mptest.db $(TOP)\mptest\multiwrite01.test --repeat 20
mistachkin4d2daba2015-03-31 16:42:16 +00001735
drhfe0ba712015-03-31 13:46:13 +00001736mptest: mptester.exe
mistachkin4d2daba2015-03-31 16:42:16 +00001737 del /Q mptest.db 2>NUL
drhfe0ba712015-03-31 13:46:13 +00001738 $(MPTEST1) --journalmode DELETE
1739 $(MPTEST2) --journalmode WAL
1740 $(MPTEST1) --journalmode WAL
1741 $(MPTEST2) --journalmode PERSIST
1742 $(MPTEST1) --journalmode PERSIST
1743 $(MPTEST2) --journalmode TRUNCATE
1744 $(MPTEST1) --journalmode TRUNCATE
1745 $(MPTEST2) --journalmode DELETE
1746
shanehb2f20bf2011-06-17 07:07:24 +00001747# This target creates a directory named "tsrc" and fills it with
1748# copies of all of the C source code and header files needed to
1749# build on the target system. Some of the C source code and header
1750# files are automatically generated. This target takes care of
1751# all that automatic generation.
1752#
mistachkin4ef916e2016-08-24 19:58:46 +00001753.target_source: $(SRC) $(TOP)\tool\vdbe-compress.tcl fts5.c $(SQLITE_TCL_DEP)
mistachkin44723ce2015-03-21 02:22:37 +00001754 -rmdir /Q/S tsrc 2>NUL
shanehb2f20bf2011-06-17 07:07:24 +00001755 -mkdir tsrc
mistachkine2eb2592016-02-11 21:38:05 +00001756 for %i in ($(SRC00)) do copy /Y %i tsrc
1757 for %i in ($(SRC01)) do copy /Y %i tsrc
mistachkine2eb2592016-02-11 21:38:05 +00001758 for %i in ($(SRC03)) do copy /Y %i tsrc
1759 for %i in ($(SRC04)) do copy /Y %i tsrc
1760 for %i in ($(SRC05)) do copy /Y %i tsrc
1761 for %i in ($(SRC06)) do copy /Y %i tsrc
1762 for %i in ($(SRC07)) do copy /Y %i tsrc
1763 for %i in ($(SRC08)) do copy /Y %i tsrc
1764 for %i in ($(SRC09)) do copy /Y %i tsrc
1765 for %i in ($(SRC10)) do copy /Y %i tsrc
1766 for %i in ($(SRC11)) do copy /Y %i tsrc
mistachkin52b1dbb2016-07-28 14:37:04 +00001767 for %i in ($(SRC12)) do copy /Y %i tsrc
drh50065652015-10-08 19:29:18 +00001768 copy /Y fts5.c tsrc
1769 copy /Y fts5.h tsrc
mistachkin44723ce2015-03-21 02:22:37 +00001770 del /Q tsrc\sqlite.h.in tsrc\parse.y 2>NUL
drh2dc06482013-12-11 00:59:10 +00001771 $(TCLSH_CMD) $(TOP)\tool\vdbe-compress.tcl $(OPTS) < tsrc\vdbe.c > vdbe.new
shanehb2f20bf2011-06-17 07:07:24 +00001772 move vdbe.new tsrc\vdbe.c
1773 echo > .target_source
1774
mistachkin4ef916e2016-08-24 19:58:46 +00001775sqlite3.c: .target_source sqlite3ext.h $(MKSQLITE3C_TOOL)
1776 $(TCLSH_CMD) $(MKSQLITE3C_TOOL) $(MKSQLITE3C_ARGS)
drhe191e2c2013-03-19 15:23:18 +00001777 copy $(TOP)\ext\session\sqlite3session.h .
shanehb2f20bf2011-06-17 07:07:24 +00001778
mistachkin48dd9de2012-12-06 04:33:13 +00001779sqlite3-all.c: sqlite3.c $(TOP)\tool\split-sqlite3c.tcl
1780 $(TCLSH_CMD) $(TOP)\tool\split-sqlite3c.tcl
mistachkin3e786092016-01-23 07:53:04 +00001781# <</mark>>
mistachkin76510912013-10-11 23:01:18 +00001782
shanehb2f20bf2011-06-17 07:07:24 +00001783# Rule to build the amalgamation
1784#
mistachkin76510912013-10-11 23:01:18 +00001785sqlite3.lo: $(SQLITE3C)
mistachkin44723ce2015-03-21 02:22:37 +00001786 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(SQLITE3C)
shanehb2f20bf2011-06-17 07:07:24 +00001787
mistachkin3e786092016-01-23 07:53:04 +00001788# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001789# Rules to build the LEMON compiler generator
1790#
drh82415f22015-11-09 19:33:42 +00001791lempar.c: $(TOP)\tool\lempar.c
1792 copy $(TOP)\tool\lempar.c .
shanehb2f20bf2011-06-17 07:07:24 +00001793
1794lemon.exe: $(TOP)\tool\lemon.c lempar.c
mistachkin2318d332015-01-12 18:02:52 +00001795 $(BCC) $(NO_WARN) -Daccess=_access \
mistachkin460cd9c2015-10-14 22:46:37 +00001796 -Fe$@ $(TOP)\tool\lemon.c /link $(LDFLAGS) $(NLTLINKOPTS) $(NLTLIBPATHS)
shanehb2f20bf2011-06-17 07:07:24 +00001797
drhf39e0ed2017-08-22 19:19:00 +00001798# <<mark>>
1799# Rules to build the source-id generator tool
1800#
1801mksourceid.exe: $(TOP)\tool\mksourceid.c
1802 $(BCC) $(NO_WARN) -Fe$@ $(TOP)\tool\mksourceid.c /link $(LDFLAGS) $(NLTLINKOPTS) $(NLTLIBPATHS)
1803
shanehb2f20bf2011-06-17 07:07:24 +00001804# Rules to build individual *.lo files from generated *.c files. This
1805# applies to:
1806#
1807# parse.lo
1808# opcodes.lo
1809#
1810parse.lo: parse.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001811 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c parse.c
shanehb2f20bf2011-06-17 07:07:24 +00001812
1813opcodes.lo: opcodes.c
mistachkin44723ce2015-03-21 02:22:37 +00001814 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c opcodes.c
mistachkin3e786092016-01-23 07:53:04 +00001815# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001816
mistachkin4d9d1f42012-09-03 10:32:32 +00001817# Rule to build the Win32 resources object file.
1818#
mistachkin08c1c312012-10-06 03:48:25 +00001819!IF $(USE_RC)!=0
mistachkin3e786092016-01-23 07:53:04 +00001820# <<block1>>
mistachkina8a18732016-01-22 22:16:50 +00001821$(LIBRESOBJS): $(TOP)\src\sqlite3.rc $(SQLITE3H)
mistachkin4d9d1f42012-09-03 10:32:32 +00001822 echo #ifndef SQLITE_RESOURCE_VERSION > sqlite3rc.h
mistachkin8ccc6d42012-09-27 21:03:53 +00001823 for /F %%V in ('type "$(TOP)\VERSION"') do ( \
mistachkin4d9d1f42012-09-03 10:32:32 +00001824 echo #define SQLITE_RESOURCE_VERSION %%V \
mistachkin946ef602015-10-10 01:55:57 +00001825 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact . ^, >> sqlite3rc.h \
mistachkin4d9d1f42012-09-03 10:32:32 +00001826 )
1827 echo #endif >> sqlite3rc.h
mistachkin08c1c312012-10-06 03:48:25 +00001828 $(LTRCOMPILE) -fo $(LIBRESOBJS) $(TOP)\src\sqlite3.rc
mistachkin3e786092016-01-23 07:53:04 +00001829# <</block1>>
mistachkin08c1c312012-10-06 03:48:25 +00001830!ENDIF
mistachkin4d9d1f42012-09-03 10:32:32 +00001831
mistachkin3e786092016-01-23 07:53:04 +00001832# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001833# Rules to build individual *.lo files from files in the src directory.
1834#
1835alter.lo: $(TOP)\src\alter.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001836 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\alter.c
shanehb2f20bf2011-06-17 07:07:24 +00001837
1838analyze.lo: $(TOP)\src\analyze.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001839 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\analyze.c
shanehb2f20bf2011-06-17 07:07:24 +00001840
1841attach.lo: $(TOP)\src\attach.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001842 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\attach.c
shanehb2f20bf2011-06-17 07:07:24 +00001843
1844auth.lo: $(TOP)\src\auth.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001845 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\auth.c
shanehb2f20bf2011-06-17 07:07:24 +00001846
1847backup.lo: $(TOP)\src\backup.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001848 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\backup.c
shanehb2f20bf2011-06-17 07:07:24 +00001849
1850bitvec.lo: $(TOP)\src\bitvec.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001851 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\bitvec.c
shanehb2f20bf2011-06-17 07:07:24 +00001852
1853btmutex.lo: $(TOP)\src\btmutex.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001854 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\btmutex.c
shanehb2f20bf2011-06-17 07:07:24 +00001855
1856btree.lo: $(TOP)\src\btree.c $(HDR) $(TOP)\src\pager.h
mistachkin44723ce2015-03-21 02:22:37 +00001857 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\btree.c
shanehb2f20bf2011-06-17 07:07:24 +00001858
1859build.lo: $(TOP)\src\build.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001860 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\build.c
shanehb2f20bf2011-06-17 07:07:24 +00001861
1862callback.lo: $(TOP)\src\callback.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001863 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\callback.c
shanehb2f20bf2011-06-17 07:07:24 +00001864
1865complete.lo: $(TOP)\src\complete.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001866 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\complete.c
shanehb2f20bf2011-06-17 07:07:24 +00001867
1868ctime.lo: $(TOP)\src\ctime.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001869 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\ctime.c
shanehb2f20bf2011-06-17 07:07:24 +00001870
1871date.lo: $(TOP)\src\date.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001872 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\date.c
shanehb2f20bf2011-06-17 07:07:24 +00001873
drha43c8c82017-10-11 13:48:11 +00001874dbpage.lo: $(TOP)\src\dbpage.c $(HDR)
1875 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\dbpage.c
1876
1877dbstat.lo: $(TOP)\src\dbstat.c $(HDR)
drh1a4a6802015-05-04 18:31:09 +00001878 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\dbstat.c
1879
shanehb2f20bf2011-06-17 07:07:24 +00001880delete.lo: $(TOP)\src\delete.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001881 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\delete.c
shanehb2f20bf2011-06-17 07:07:24 +00001882
1883expr.lo: $(TOP)\src\expr.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001884 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\expr.c
shanehb2f20bf2011-06-17 07:07:24 +00001885
1886fault.lo: $(TOP)\src\fault.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001887 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\fault.c
shanehb2f20bf2011-06-17 07:07:24 +00001888
1889fkey.lo: $(TOP)\src\fkey.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001890 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\fkey.c
shanehb2f20bf2011-06-17 07:07:24 +00001891
1892func.lo: $(TOP)\src\func.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001893 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\func.c
shanehb2f20bf2011-06-17 07:07:24 +00001894
1895global.lo: $(TOP)\src\global.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001896 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\global.c
shanehb2f20bf2011-06-17 07:07:24 +00001897
1898hash.lo: $(TOP)\src\hash.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001899 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\hash.c
shanehb2f20bf2011-06-17 07:07:24 +00001900
1901insert.lo: $(TOP)\src\insert.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001902 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\insert.c
shanehb2f20bf2011-06-17 07:07:24 +00001903
shanehb2f20bf2011-06-17 07:07:24 +00001904legacy.lo: $(TOP)\src\legacy.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001905 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\legacy.c
shanehb2f20bf2011-06-17 07:07:24 +00001906
1907loadext.lo: $(TOP)\src\loadext.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001908 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\loadext.c
shanehb2f20bf2011-06-17 07:07:24 +00001909
1910main.lo: $(TOP)\src\main.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001911 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\main.c
shanehb2f20bf2011-06-17 07:07:24 +00001912
1913malloc.lo: $(TOP)\src\malloc.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001914 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\malloc.c
shanehb2f20bf2011-06-17 07:07:24 +00001915
1916mem0.lo: $(TOP)\src\mem0.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001917 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem0.c
shanehb2f20bf2011-06-17 07:07:24 +00001918
1919mem1.lo: $(TOP)\src\mem1.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001920 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem1.c
shanehb2f20bf2011-06-17 07:07:24 +00001921
1922mem2.lo: $(TOP)\src\mem2.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001923 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem2.c
shanehb2f20bf2011-06-17 07:07:24 +00001924
1925mem3.lo: $(TOP)\src\mem3.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001926 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem3.c
shanehb2f20bf2011-06-17 07:07:24 +00001927
1928mem5.lo: $(TOP)\src\mem5.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001929 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem5.c
shanehb2f20bf2011-06-17 07:07:24 +00001930
mistachkin7de2c3e2018-01-03 12:39:35 +00001931memdb.lo: $(TOP)\src\memdb.c $(HDR)
drhac442f42018-01-03 01:28:46 +00001932 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\memdb.c
1933
shanehb2f20bf2011-06-17 07:07:24 +00001934memjournal.lo: $(TOP)\src\memjournal.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001935 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\memjournal.c
shanehb2f20bf2011-06-17 07:07:24 +00001936
1937mutex.lo: $(TOP)\src\mutex.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001938 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex.c
shanehb2f20bf2011-06-17 07:07:24 +00001939
1940mutex_noop.lo: $(TOP)\src\mutex_noop.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001941 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex_noop.c
shanehb2f20bf2011-06-17 07:07:24 +00001942
shanehb2f20bf2011-06-17 07:07:24 +00001943mutex_unix.lo: $(TOP)\src\mutex_unix.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001944 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex_unix.c
shanehb2f20bf2011-06-17 07:07:24 +00001945
1946mutex_w32.lo: $(TOP)\src\mutex_w32.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001947 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex_w32.c
shanehb2f20bf2011-06-17 07:07:24 +00001948
1949notify.lo: $(TOP)\src\notify.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001950 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\notify.c
shanehb2f20bf2011-06-17 07:07:24 +00001951
1952pager.lo: $(TOP)\src\pager.c $(HDR) $(TOP)\src\pager.h
mistachkin44723ce2015-03-21 02:22:37 +00001953 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pager.c
shanehb2f20bf2011-06-17 07:07:24 +00001954
1955pcache.lo: $(TOP)\src\pcache.c $(HDR) $(TOP)\src\pcache.h
mistachkin44723ce2015-03-21 02:22:37 +00001956 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pcache.c
shanehb2f20bf2011-06-17 07:07:24 +00001957
1958pcache1.lo: $(TOP)\src\pcache1.c $(HDR) $(TOP)\src\pcache.h
mistachkin44723ce2015-03-21 02:22:37 +00001959 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pcache1.c
shanehb2f20bf2011-06-17 07:07:24 +00001960
1961os.lo: $(TOP)\src\os.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001962 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\os.c
shanehb2f20bf2011-06-17 07:07:24 +00001963
1964os_unix.lo: $(TOP)\src\os_unix.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001965 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\os_unix.c
shanehb2f20bf2011-06-17 07:07:24 +00001966
1967os_win.lo: $(TOP)\src\os_win.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001968 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\os_win.c
shanehb2f20bf2011-06-17 07:07:24 +00001969
shanehb2f20bf2011-06-17 07:07:24 +00001970pragma.lo: $(TOP)\src\pragma.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001971 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pragma.c
shanehb2f20bf2011-06-17 07:07:24 +00001972
1973prepare.lo: $(TOP)\src\prepare.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001974 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\prepare.c
shanehb2f20bf2011-06-17 07:07:24 +00001975
1976printf.lo: $(TOP)\src\printf.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001977 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\printf.c
shanehb2f20bf2011-06-17 07:07:24 +00001978
1979random.lo: $(TOP)\src\random.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001980 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\random.c
shanehb2f20bf2011-06-17 07:07:24 +00001981
1982resolve.lo: $(TOP)\src\resolve.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001983 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\resolve.c
shanehb2f20bf2011-06-17 07:07:24 +00001984
1985rowset.lo: $(TOP)\src\rowset.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001986 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\rowset.c
shanehb2f20bf2011-06-17 07:07:24 +00001987
1988select.lo: $(TOP)\src\select.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001989 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\select.c
shanehb2f20bf2011-06-17 07:07:24 +00001990
1991status.lo: $(TOP)\src\status.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001992 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\status.c
shanehb2f20bf2011-06-17 07:07:24 +00001993
1994table.lo: $(TOP)\src\table.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001995 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\table.c
shanehb2f20bf2011-06-17 07:07:24 +00001996
drhf51446a2012-07-21 19:40:42 +00001997threads.lo: $(TOP)\src\threads.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001998 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\threads.c
drhf51446a2012-07-21 19:40:42 +00001999
shanehb2f20bf2011-06-17 07:07:24 +00002000tokenize.lo: $(TOP)\src\tokenize.c keywordhash.h $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002001 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\tokenize.c
shanehb2f20bf2011-06-17 07:07:24 +00002002
drh38b41492015-06-08 15:08:15 +00002003treeview.lo: $(TOP)\src\treeview.c $(HDR)
2004 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\treeview.c
2005
shanehb2f20bf2011-06-17 07:07:24 +00002006trigger.lo: $(TOP)\src\trigger.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002007 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\trigger.c
shanehb2f20bf2011-06-17 07:07:24 +00002008
2009update.lo: $(TOP)\src\update.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002010 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\update.c
shanehb2f20bf2011-06-17 07:07:24 +00002011
drhfcfd7562018-04-12 21:42:51 +00002012upsert.lo: $(TOP)\src\upsert.c $(HDR)
2013 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\upsert.c
2014
shanehb2f20bf2011-06-17 07:07:24 +00002015utf.lo: $(TOP)\src\utf.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002016 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\utf.c
shanehb2f20bf2011-06-17 07:07:24 +00002017
2018util.lo: $(TOP)\src\util.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002019 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\util.c
shanehb2f20bf2011-06-17 07:07:24 +00002020
2021vacuum.lo: $(TOP)\src\vacuum.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002022 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vacuum.c
shanehb2f20bf2011-06-17 07:07:24 +00002023
2024vdbe.lo: $(TOP)\src\vdbe.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002025 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbe.c
shanehb2f20bf2011-06-17 07:07:24 +00002026
2027vdbeapi.lo: $(TOP)\src\vdbeapi.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002028 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbeapi.c
shanehb2f20bf2011-06-17 07:07:24 +00002029
2030vdbeaux.lo: $(TOP)\src\vdbeaux.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002031 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbeaux.c
shanehb2f20bf2011-06-17 07:07:24 +00002032
2033vdbeblob.lo: $(TOP)\src\vdbeblob.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002034 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbeblob.c
shanehb2f20bf2011-06-17 07:07:24 +00002035
2036vdbemem.lo: $(TOP)\src\vdbemem.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002037 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbemem.c
shanehb2f20bf2011-06-17 07:07:24 +00002038
mistachkin81c428a2011-08-17 02:19:54 +00002039vdbesort.lo: $(TOP)\src\vdbesort.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002040 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbesort.c
mistachkin81c428a2011-08-17 02:19:54 +00002041
shanehb2f20bf2011-06-17 07:07:24 +00002042vdbetrace.lo: $(TOP)\src\vdbetrace.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002043 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbetrace.c
shanehb2f20bf2011-06-17 07:07:24 +00002044
2045vtab.lo: $(TOP)\src\vtab.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002046 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vtab.c
shanehb2f20bf2011-06-17 07:07:24 +00002047
2048wal.lo: $(TOP)\src\wal.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002049 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\wal.c
shanehb2f20bf2011-06-17 07:07:24 +00002050
2051walker.lo: $(TOP)\src\walker.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002052 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\walker.c
shanehb2f20bf2011-06-17 07:07:24 +00002053
2054where.lo: $(TOP)\src\where.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00002055 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\where.c
shanehb2f20bf2011-06-17 07:07:24 +00002056
drh6f82e852015-06-06 20:12:09 +00002057wherecode.lo: $(TOP)\src\wherecode.c $(HDR)
2058 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\wherecode.c
2059
drh6c1f4ef2015-06-08 14:23:15 +00002060whereexpr.lo: $(TOP)\src\whereexpr.c $(HDR)
2061 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\whereexpr.c
2062
dan980cf252018-06-10 07:42:35 +00002063window.lo: $(TOP)\src\window.c $(HDR)
2064 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\window.c
2065
mistachkin4ef916e2016-08-24 19:58:46 +00002066tclsqlite.lo: $(TOP)\src\tclsqlite.c $(HDR) $(SQLITE_TCL_DEP)
mistachkin44723ce2015-03-21 02:22:37 +00002067 $(LTCOMPILE) $(NO_WARN) -DUSE_TCL_STUBS=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c
shanehb2f20bf2011-06-17 07:07:24 +00002068
mistachkin4ef916e2016-08-24 19:58:46 +00002069tclsqlite-shell.lo: $(TOP)\src\tclsqlite.c $(HDR) $(SQLITE_TCL_DEP)
drh96a206f2017-10-13 20:14:06 +00002070 $(LTCOMPILE) $(NO_WARN) -DTCLSH -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c
shanehb2f20bf2011-06-17 07:07:24 +00002071
mistachkin5d4d9412016-01-22 03:54:36 +00002072tclsqlite3.exe: tclsqlite-shell.lo $(SQLITE3C) $(SQLITE3H) $(LIBRESOBJS)
mistachkin590522c2018-01-05 16:05:51 +00002073 $(LTLINK) $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) /OUT:$@ tclsqlite-shell.lo $(LIBRESOBJS) $(TCLLIBS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00002074
2075# Rules to build opcodes.c and opcodes.h
2076#
drh7651e0a2015-10-07 12:11:36 +00002077opcodes.c: opcodes.h $(TOP)\tool\mkopcodec.tcl
2078 $(TCLSH_CMD) $(TOP)\tool\mkopcodec.tcl opcodes.h > opcodes.c
shanehb2f20bf2011-06-17 07:07:24 +00002079
drhb15393b2015-10-07 02:52:09 +00002080opcodes.h: parse.h $(TOP)\src\vdbe.c $(TOP)\tool\mkopcodeh.tcl
mistachkin946ef602015-10-10 01:55:57 +00002081 type parse.h $(TOP)\src\vdbe.c | $(TCLSH_CMD) $(TOP)\tool\mkopcodeh.tcl > opcodes.h
shanehb2f20bf2011-06-17 07:07:24 +00002082
2083# Rules to build parse.c and parse.h - the outputs of lemon.
2084#
2085parse.h: parse.c
2086
drh60a15a42015-10-07 12:21:14 +00002087parse.c: $(TOP)\src\parse.y lemon.exe $(TOP)\tool\addopcodes.tcl
mistachkin44723ce2015-03-21 02:22:37 +00002088 del /Q parse.y parse.h parse.h.temp 2>NUL
shanehb2f20bf2011-06-17 07:07:24 +00002089 copy $(TOP)\src\parse.y .
mistachkinedcb4eb2016-01-22 01:25:15 +00002090 .\lemon.exe $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) $(OPTS) parse.y
shanehb2f20bf2011-06-17 07:07:24 +00002091 move parse.h parse.h.temp
drh60a15a42015-10-07 12:21:14 +00002092 $(TCLSH_CMD) $(TOP)\tool\addopcodes.tcl parse.h.temp > parse.h
shanehb2f20bf2011-06-17 07:07:24 +00002093
drhf39e0ed2017-08-22 19:19:00 +00002094$(SQLITE3H): $(TOP)\src\sqlite.h.in $(TOP)\manifest mksourceid.exe $(TOP)\VERSION
mistachkin4ef916e2016-08-24 19:58:46 +00002095 $(TCLSH_CMD) $(TOP)\tool\mksqlite3h.tcl $(TOP:\=/) > $(SQLITE3H) $(MKSQLITE3H_ARGS)
shanehb2f20bf2011-06-17 07:07:24 +00002096
mistachkin9b88ace2016-02-26 21:01:37 +00002097sqlite3ext.h: .target_source
mistachkin4ef916e2016-08-24 19:58:46 +00002098!IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
mistachkinc0bebc12016-07-28 18:49:20 +00002099 type tsrc\sqlite3ext.h | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "\(\*\)" "(SQLITE_CALLBACK *)" \
2100 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "\(\*" "(SQLITE_APICALL *" > sqlite3ext.h
mistachkine37f7392016-07-28 19:28:35 +00002101 copy /Y sqlite3ext.h tsrc\sqlite3ext.h
mistachkin4ef916e2016-08-24 19:58:46 +00002102!ELSE
2103 copy /Y tsrc\sqlite3ext.h sqlite3ext.h
2104!ENDIF
mistachkinc978f2d2015-09-21 23:49:35 +00002105
shanehb2f20bf2011-06-17 07:07:24 +00002106mkkeywordhash.exe: $(TOP)\tool\mkkeywordhash.c
mistachkinedcb4eb2016-01-22 01:25:15 +00002107 $(BCC) $(NO_WARN) -Fe$@ $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) $(OPTS) \
mistachkin460cd9c2015-10-14 22:46:37 +00002108 $(TOP)\tool\mkkeywordhash.c /link $(LDFLAGS) $(NLTLINKOPTS) $(NLTLIBPATHS)
shanehb2f20bf2011-06-17 07:07:24 +00002109
2110keywordhash.h: $(TOP)\tool\mkkeywordhash.c mkkeywordhash.exe
mistachkin5b0b6fd2011-06-25 01:14:36 +00002111 .\mkkeywordhash.exe > keywordhash.h
shanehb2f20bf2011-06-17 07:07:24 +00002112
drhaa62d2e2017-10-12 13:47:48 +00002113# Source files that go into making shell.c
2114SHELL_SRC = \
2115 $(TOP)\src\shell.c.in \
mistachkin2d44d552018-03-16 23:53:47 +00002116 $(TOP)\ext\misc\appendvfs.c \
drhaa62d2e2017-10-12 13:47:48 +00002117 $(TOP)\ext\misc\shathree.c \
2118 $(TOP)\ext\misc\fileio.c \
mistachkindfdfd8c2018-01-04 22:46:08 +00002119 $(TOP)\ext\misc\completion.c \
mistachkindfdfd8c2018-01-04 22:46:08 +00002120 $(TOP)\ext\expert\sqlite3expert.c \
drhc9320332018-01-05 16:23:43 +00002121 $(TOP)\ext\expert\sqlite3expert.h \
mistachkin5d7503a2018-01-05 17:12:13 +00002122 $(TOP)\src\test_windirent.c
mistachkin590522c2018-01-05 16:05:51 +00002123
2124# If use of zlib is enabled, add the "zipfile.c" source file.
2125#
2126!IF $(USE_ZLIB)!=0
mistachkin5d7503a2018-01-05 17:12:13 +00002127SHELL_SRC = $(SHELL_SRC) $(TOP)\ext\misc\sqlar.c
mistachkin590522c2018-01-05 16:05:51 +00002128SHELL_SRC = $(SHELL_SRC) $(TOP)\ext\misc\zipfile.c
2129!ENDIF
drhaa62d2e2017-10-12 13:47:48 +00002130
mistachkin835cd432017-10-14 19:54:06 +00002131shell.c: $(SHELL_SRC) $(TOP)\tool\mkshellc.tcl
2132 $(TCLSH_CMD) $(TOP)\tool\mkshellc.tcl > shell.c
shanehb2f20bf2011-06-17 07:07:24 +00002133
mistachkincb6acda2017-12-05 18:54:12 +00002134zlib:
mistachkin11522502018-01-05 01:00:17 +00002135 pushd $(ZLIBDIR) && $(MAKE) /f win32\Makefile.msc clean $(ZLIBLIB) && popd
shanehb2f20bf2011-06-17 07:07:24 +00002136
2137# Rules to build the extension objects.
2138#
2139icu.lo: $(TOP)\ext\icu\icu.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002140 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\icu\icu.c
shanehb2f20bf2011-06-17 07:07:24 +00002141
2142fts2.lo: $(TOP)\ext\fts2\fts2.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002143 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2.c
shanehb2f20bf2011-06-17 07:07:24 +00002144
2145fts2_hash.lo: $(TOP)\ext\fts2\fts2_hash.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002146 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_hash.c
shanehb2f20bf2011-06-17 07:07:24 +00002147
2148fts2_icu.lo: $(TOP)\ext\fts2\fts2_icu.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002149 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_icu.c
shanehb2f20bf2011-06-17 07:07:24 +00002150
2151fts2_porter.lo: $(TOP)\ext\fts2\fts2_porter.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002152 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_porter.c
shanehb2f20bf2011-06-17 07:07:24 +00002153
2154fts2_tokenizer.lo: $(TOP)\ext\fts2\fts2_tokenizer.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002155 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_tokenizer.c
shanehb2f20bf2011-06-17 07:07:24 +00002156
2157fts2_tokenizer1.lo: $(TOP)\ext\fts2\fts2_tokenizer1.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002158 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_tokenizer1.c
shanehb2f20bf2011-06-17 07:07:24 +00002159
2160fts3.lo: $(TOP)\ext\fts3\fts3.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002161 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3.c
shanehb2f20bf2011-06-17 07:07:24 +00002162
2163fts3_aux.lo: $(TOP)\ext\fts3\fts3_aux.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002164 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_aux.c
shanehb2f20bf2011-06-17 07:07:24 +00002165
2166fts3_expr.lo: $(TOP)\ext\fts3\fts3_expr.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002167 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_expr.c
shanehb2f20bf2011-06-17 07:07:24 +00002168
2169fts3_hash.lo: $(TOP)\ext\fts3\fts3_hash.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002170 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_hash.c
shanehb2f20bf2011-06-17 07:07:24 +00002171
2172fts3_icu.lo: $(TOP)\ext\fts3\fts3_icu.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002173 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_icu.c
shanehb2f20bf2011-06-17 07:07:24 +00002174
2175fts3_snippet.lo: $(TOP)\ext\fts3\fts3_snippet.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002176 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_snippet.c
shanehb2f20bf2011-06-17 07:07:24 +00002177
2178fts3_porter.lo: $(TOP)\ext\fts3\fts3_porter.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002179 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_porter.c
shanehb2f20bf2011-06-17 07:07:24 +00002180
2181fts3_tokenizer.lo: $(TOP)\ext\fts3\fts3_tokenizer.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002182 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenizer.c
shanehb2f20bf2011-06-17 07:07:24 +00002183
2184fts3_tokenizer1.lo: $(TOP)\ext\fts3\fts3_tokenizer1.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002185 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenizer1.c
shanehb2f20bf2011-06-17 07:07:24 +00002186
drh4d648c72013-04-22 17:07:56 +00002187fts3_tokenize_vtab.lo: $(TOP)\ext\fts3\fts3_tokenize_vtab.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002188 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenize_vtab.c
drh4d648c72013-04-22 17:07:56 +00002189
drh391d4ba2012-05-28 20:22:16 +00002190fts3_unicode.lo: $(TOP)\ext\fts3\fts3_unicode.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002191 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_unicode.c
drh391d4ba2012-05-28 20:22:16 +00002192
2193fts3_unicode2.lo: $(TOP)\ext\fts3\fts3_unicode2.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002194 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_unicode2.c
drh391d4ba2012-05-28 20:22:16 +00002195
shanehb2f20bf2011-06-17 07:07:24 +00002196fts3_write.lo: $(TOP)\ext\fts3\fts3_write.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002197 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_write.c
shanehb2f20bf2011-06-17 07:07:24 +00002198
2199rtree.lo: $(TOP)\ext\rtree\rtree.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002200 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\rtree\rtree.c
shanehb2f20bf2011-06-17 07:07:24 +00002201
mistachkin4f2c8222016-04-11 22:23:04 +00002202sqlite3session.lo: $(TOP)\ext\session\sqlite3session.c $(HDR) $(EXTHDR)
mistachkin05004782016-03-30 16:23:06 +00002203 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\session\sqlite3session.c
drh498dcae2013-03-13 11:42:00 +00002204
mistachkined52f9f2015-06-26 04:34:36 +00002205# FTS5 things
2206#
2207FTS5_SRC = \
2208 $(TOP)\ext\fts5\fts5.h \
2209 $(TOP)\ext\fts5\fts5Int.h \
2210 $(TOP)\ext\fts5\fts5_aux.c \
2211 $(TOP)\ext\fts5\fts5_buffer.c \
2212 $(TOP)\ext\fts5\fts5_main.c \
2213 $(TOP)\ext\fts5\fts5_config.c \
2214 $(TOP)\ext\fts5\fts5_expr.c \
2215 $(TOP)\ext\fts5\fts5_hash.c \
2216 $(TOP)\ext\fts5\fts5_index.c \
2217 fts5parse.c fts5parse.h \
2218 $(TOP)\ext\fts5\fts5_storage.c \
2219 $(TOP)\ext\fts5\fts5_tokenize.c \
2220 $(TOP)\ext\fts5\fts5_unicode2.c \
2221 $(TOP)\ext\fts5\fts5_varint.c \
2222 $(TOP)\ext\fts5\fts5_vocab.c
2223
mistachkin3384ccb2017-12-13 22:42:55 +00002224LSM1_SRC = \
2225 $(TOP)\ext\lsm1\lsm.h \
2226 $(TOP)\ext\lsm1\lsmInt.h \
2227 $(TOP)\ext\lsm1\lsm_ckpt.c \
2228 $(TOP)\ext\lsm1\lsm_file.c \
2229 $(TOP)\ext\lsm1\lsm_log.c \
2230 $(TOP)\ext\lsm1\lsm_main.c \
2231 $(TOP)\ext\lsm1\lsm_mem.c \
2232 $(TOP)\ext\lsm1\lsm_mutex.c \
2233 $(TOP)\ext\lsm1\lsm_shared.c \
2234 $(TOP)\ext\lsm1\lsm_sorted.c \
2235 $(TOP)\ext\lsm1\lsm_str.c \
2236 $(TOP)\ext\lsm1\lsm_tree.c \
2237 $(TOP)\ext\lsm1\lsm_unix.c \
2238 $(TOP)\ext\lsm1\lsm_varint.c \
2239 $(TOP)\ext\lsm1\lsm_vtab.c \
2240 $(TOP)\ext\lsm1\lsm_win32.c
2241
mistachkined52f9f2015-06-26 04:34:36 +00002242fts5parse.c: $(TOP)\ext\fts5\fts5parse.y lemon.exe
2243 copy $(TOP)\ext\fts5\fts5parse.y .
2244 del /Q fts5parse.h 2>NUL
mistachkinedcb4eb2016-01-22 01:25:15 +00002245 .\lemon.exe $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) $(OPTS) fts5parse.y
mistachkined52f9f2015-06-26 04:34:36 +00002246
mistachkin9b88ace2016-02-26 21:01:37 +00002247fts5parse.h: fts5parse.c
mistachkined52f9f2015-06-26 04:34:36 +00002248
mistachkin9b88ace2016-02-26 21:01:37 +00002249fts5.c: $(FTS5_SRC)
mistachkined52f9f2015-06-26 04:34:36 +00002250 $(TCLSH_CMD) $(TOP)\ext\fts5\tool\mkfts5c.tcl
dana153bbc2015-07-02 20:12:34 +00002251 copy $(TOP)\ext\fts5\fts5.h .
mistachkined52f9f2015-06-26 04:34:36 +00002252
mistachkin3384ccb2017-12-13 22:42:55 +00002253lsm1.c: $(LSM1_SRC)
2254 $(TCLSH_CMD) $(TOP)\ext\lsm1\tool\mklsm1c.tcl
2255 copy $(TOP)\ext\lsm1\lsm.h .
2256
mistachkined52f9f2015-06-26 04:34:36 +00002257fts5.lo: fts5.c $(HDR) $(EXTHDR)
mistachkin95ae9582015-06-26 20:45:43 +00002258 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c fts5.c
2259
2260fts5_ext.lo: fts5.c $(HDR) $(EXTHDR)
mistachkinae6ca8e2015-07-02 16:50:43 +00002261 $(LTCOMPILE) $(NO_WARN) -c fts5.c
shanehb2f20bf2011-06-17 07:07:24 +00002262
mistachkin95ae9582015-06-26 20:45:43 +00002263fts5.dll: fts5_ext.lo
2264 $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /OUT:$@ fts5_ext.lo
shanehb2f20bf2011-06-17 07:07:24 +00002265
mistachkin83a22532016-01-14 18:01:16 +00002266sqlite3rbu.lo: $(TOP)\ext\rbu\sqlite3rbu.c $(HDR) $(EXTHDR)
2267 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\rbu\sqlite3rbu.c
drh76473772016-01-14 13:22:24 +00002268
shanehb2f20bf2011-06-17 07:07:24 +00002269# Rules to build the 'testfixture' application.
2270#
2271# If using the amalgamation, use sqlite3.c directly to build the test
2272# fixture. Otherwise link against libsqlite3.lib. (This distinction is
2273# necessary because the test fixture requires non-API symbols which are
2274# hidden when the library is built via the amalgamation).
2275#
drh96a206f2017-10-13 20:14:06 +00002276TESTFIXTURE_FLAGS = -DTCLSH_INIT_PROC=sqlite3TestInit -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
mistachkin27b2f052015-01-12 19:49:46 +00002277TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_SERVER=1 -DSQLITE_PRIVATE=""
2278TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_CORE $(NO_WARN)
drhdbc49162016-03-02 03:28:07 +00002279TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_SERIES_CONSTRAINT_VERIFY=1
drh9878fef2016-03-04 03:43:10 +00002280TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_DEFAULT_PAGE_SIZE=1024
drhc6603af2017-06-29 14:33:51 +00002281TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_ENABLE_STMTVTAB
drh1df64702017-10-13 15:56:26 +00002282TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_ENABLE_DBPAGE_VTAB
mistachkinfda08672018-02-23 13:38:20 +00002283TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_ENABLE_JSON1
mistachkin69def7f2016-07-28 04:14:37 +00002284TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) $(TEST_CCONV_OPTS)
shanehb2f20bf2011-06-17 07:07:24 +00002285
mistachkinc04c54b2016-02-11 21:28:16 +00002286TESTFIXTURE_SRC0 = $(TESTEXT) $(TESTSRC2)
mistachkin05004782016-03-30 16:23:06 +00002287TESTFIXTURE_SRC1 = $(TESTEXT) $(SQLITE3C)
shanehb2f20bf2011-06-17 07:07:24 +00002288!IF $(USE_AMALGAMATION)==0
2289TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC0)
2290!ELSE
2291TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC1)
2292!ENDIF
2293
mistachkin4ef916e2016-08-24 19:58:46 +00002294!IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
mistachkin52b1dbb2016-07-28 14:37:04 +00002295sqlite_tclDecls.h:
mistachkin4ef916e2016-08-24 19:58:46 +00002296 echo #ifndef SQLITE_TCLAPI > $(SQLITETCLDECLSH)
2297 echo # define SQLITE_TCLAPI >> $(SQLITETCLDECLSH)
2298 echo #endif >> $(SQLITETCLDECLSH)
mistachkinf27a80c2016-07-28 16:09:52 +00002299 type "$(TCLINCDIR)\tclDecls.h" \
mistachkina121cc72016-07-28 18:06:52 +00002300 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "^(EXTERN(?: CONST\d+?)?\s+?[^\(]*?\s+?)Tcl_" "\1 SQLITE_TCLAPI Tcl_" \
mistachkinf27a80c2016-07-28 16:09:52 +00002301 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "^(EXTERN\s+?(?:void|VOID)\s+?)TclFreeObj" "\1 SQLITE_TCLAPI TclFreeObj" \
2302 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "\(\*tcl_" "(SQLITE_TCLAPI *tcl_" \
mistachkin7c60b262016-07-28 18:18:53 +00002303 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "\(\*tclFreeObj" "(SQLITE_TCLAPI *tclFreeObj" \
mistachkin4ef916e2016-08-24 19:58:46 +00002304 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "\(\*" "(SQLITE_TCLAPI *" >> $(SQLITETCLDECLSH)
mistachkin52b1dbb2016-07-28 14:37:04 +00002305
mistachkin4ef916e2016-08-24 19:58:46 +00002306sqlite_tcl.h:
mistachkinf27a80c2016-07-28 16:09:52 +00002307 type "$(TCLINCDIR)\tcl.h" | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact tclDecls.h sqlite_tclDecls.h \
2308 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "typedef (.*?)\(Tcl_" "typedef \1 (SQLITE_TCLAPI Tcl_" \
2309 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact "void (*freeProc)" "void (SQLITE_TCLAPI *freeProc)" \
2310 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact "Tcl_HashEntry *(*findProc)" "Tcl_HashEntry *(SQLITE_TCLAPI *findProc)" \
mistachkin4ef916e2016-08-24 19:58:46 +00002311 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact "Tcl_HashEntry *(*createProc)" "Tcl_HashEntry *(SQLITE_TCLAPI *createProc)" >> $(SQLITETCLH)
2312!ENDIF
mistachkin52b1dbb2016-07-28 14:37:04 +00002313
mistachkin5d7503a2018-01-05 17:12:13 +00002314testfixture.exe: $(TESTFIXTURE_SRC) $(TESTFIXTURE_DEP) $(SQLITE3H) $(LIBRESOBJS) $(HDR) $(SQLITE_TCL_DEP)
shaneh6e7850c2011-06-17 15:57:07 +00002315 $(LTLINK) -DSQLITE_NO_SYNC=1 $(TESTFIXTURE_FLAGS) \
shanehb2f20bf2011-06-17 07:07:24 +00002316 -DBUILD_sqlite -I$(TCLINCDIR) \
shaneh2a0b9ef2011-06-20 20:52:32 +00002317 $(TESTFIXTURE_SRC) \
mistachkin590522c2018-01-05 16:05:51 +00002318 /link $(LDFLAGS) $(LTLINKOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) $(LIBRESOBJS) $(TCLLIBS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00002319
mistachkin9b88ace2016-02-26 21:01:37 +00002320extensiontest: testfixture.exe testloadext.dll
mistachkin88739962015-10-14 23:04:08 +00002321 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00002322 .\testfixture.exe $(TOP)\test\loadext.test $(TESTOPTS)
mistachkin1925a2e2014-02-24 21:20:25 +00002323
drhf4375442015-05-11 12:15:45 +00002324fulltest: $(TESTPROGS) fuzztest
mistachkin88739962015-10-14 23:04:08 +00002325 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00002326 .\testfixture.exe $(TOP)\test\all.test $(TESTOPTS)
shanehb2f20bf2011-06-17 07:07:24 +00002327
drhea93c702015-05-26 18:15:08 +00002328soaktest: $(TESTPROGS)
mistachkin88739962015-10-14 23:04:08 +00002329 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00002330 .\testfixture.exe $(TOP)\test\all.test -soak=1 $(TESTOPTS)
shanehb2f20bf2011-06-17 07:07:24 +00002331
drhf4375442015-05-11 12:15:45 +00002332fulltestonly: $(TESTPROGS) fuzztest
mistachkin88739962015-10-14 23:04:08 +00002333 @set PATH=$(LIBTCLPATH);$(PATH)
mistachkinc60941f2012-09-13 01:51:02 +00002334 .\testfixture.exe $(TOP)\test\full.test
2335
mistachkinedcb4eb2016-01-22 01:25:15 +00002336queryplantest: testfixture.exe shell
mistachkin88739962015-10-14 23:04:08 +00002337 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00002338 .\testfixture.exe $(TOP)\test\permutations.test queryplanner $(TESTOPTS)
mistachkin036acf32013-07-20 00:34:31 +00002339
drhea93c702015-05-26 18:15:08 +00002340fuzztest: fuzzcheck.exe
2341 .\fuzzcheck.exe $(FUZZDATA)
drhf3320712015-04-25 13:39:29 +00002342
drha523e312015-07-24 17:26:13 +00002343fastfuzztest: fuzzcheck.exe
drh53e66c32015-07-24 15:49:23 +00002344 .\fuzzcheck.exe --limit-mem 100M $(FUZZDATA)
shanehb2f20bf2011-06-17 07:07:24 +00002345
drh905da632015-06-10 18:53:09 +00002346# Minimal testing that runs in less than 3 minutes (on a fast machine)
2347#
drhfd0d93f2016-02-07 00:08:08 +00002348quicktest: testfixture.exe sourcetest
mistachkin88739962015-10-14 23:04:08 +00002349 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00002350 .\testfixture.exe $(TOP)\test\extraquick.test $(TESTOPTS)
2351
2352# This is the common case. Run many tests that do not take too long,
2353# including fuzzcheck, sqlite3_analyzer, and sqldiff tests.
2354#
drhfd0d93f2016-02-07 00:08:08 +00002355test: $(TESTPROGS) sourcetest fastfuzztest
mistachkin88739962015-10-14 23:04:08 +00002356 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00002357 .\testfixture.exe $(TOP)\test\veryquick.test $(TESTOPTS)
shanehb2f20bf2011-06-17 07:07:24 +00002358
drhea93c702015-05-26 18:15:08 +00002359smoketest: $(TESTPROGS)
mistachkin88739962015-10-14 23:04:08 +00002360 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00002361 .\testfixture.exe $(TOP)\test\main.test $(TESTOPTS)
mistachkin00eb70d2015-04-04 00:02:07 +00002362
drh903b2302017-10-13 18:58:55 +00002363sqlite3_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)
2364 $(TCLSH_CMD) $(TOP)\tool\mkccode.tcl $(TOP)\tool\sqlite3_analyzer.c.in > $@
shanehb2f20bf2011-06-17 07:07:24 +00002365
mistachkin08c1c312012-10-06 03:48:25 +00002366sqlite3_analyzer.exe: sqlite3_analyzer.c $(LIBRESOBJS)
mistachkind4ab1032015-05-11 16:27:33 +00002367 $(LTLINK) $(NO_WARN) -DBUILD_sqlite -I$(TCLINCDIR) sqlite3_analyzer.c \
mistachkin590522c2018-01-05 16:05:51 +00002368 /link $(LDFLAGS) $(LTLINKOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) $(LIBRESOBJS) $(TCLLIBS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00002369
mistachkin5e6f7822018-01-06 14:44:29 +00002370sqltclsh.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 +00002371 $(TCLSH_CMD) $(TOP)\tool\mkccode.tcl $(TOP)\tool\sqltclsh.c.in >sqltclsh.c
2372
mistachkin98dfb2f2018-01-08 14:24:08 +00002373sqltclsh.exe: sqltclsh.c $(SHELL_CORE_DEP) $(LIBRESOBJS)
drh9dea1732018-01-06 04:34:05 +00002374 $(LTLINK) $(NO_WARN) -DBUILD_sqlite -I$(TCLINCDIR) sqltclsh.c \
mistachkin0476b952018-01-06 14:43:33 +00002375 /link $(LDFLAGS) $(LTLINKOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) $(LIBRESOBJS) $(TCLLIBS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00002376
drhbd0f1db2017-05-03 12:50:46 +00002377sqlite3_expert.exe: $(SQLITE3C) $(TOP)\ext\expert\sqlite3expert.h $(TOP)\ext\expert\sqlite3expert.c $(TOP)\ext\expert\expert.c
2378 $(LTLINK) $(NO_WARN) $(TOP)\ext\expert\sqlite3expert.c $(TOP)\ext\expert\expert.c $(SQLITE3C) $(TLIBS)
2379
drh2737fa02017-10-31 15:49:19 +00002380CHECKER_DEPS =\
2381 $(TOP)/tool/mkccode.tcl \
2382 sqlite3.c \
2383 $(TOP)/src/tclsqlite.c \
2384 $(TOP)/ext/repair/sqlite3_checker.tcl \
2385 $(TOP)/ext/repair/checkindex.c \
drh927dd512017-10-31 18:09:40 +00002386 $(TOP)/ext/repair/checkfreelist.c \
drh2737fa02017-10-31 15:49:19 +00002387 $(TOP)/ext/misc/btreeinfo.c \
2388 $(TOP)/ext/repair/sqlite3_checker.c.in
2389
2390sqlite3_checker.c: $(CHECKER_DEPS)
drh2091f0f2017-10-31 15:55:48 +00002391 $(TCLSH_CMD) $(TOP)\tool\mkccode.tcl $(TOP)\ext\repair\sqlite3_checker.c.in > $@
drh2737fa02017-10-31 15:49:19 +00002392
2393sqlite3_checker.exe: sqlite3_checker.c $(LIBRESOBJS)
2394 $(LTLINK) $(NO_WARN) -DBUILD_sqlite -I$(TCLINCDIR) sqlite3_checker.c \
mistachkin370732a2018-01-05 19:25:52 +00002395 /link $(LDFLAGS) $(LTLINKOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) $(LIBRESOBJS) $(TCLLIBS) $(LTLIBS) $(TLIBS)
drh2737fa02017-10-31 15:49:19 +00002396
mistachkinac8ba262018-03-07 14:42:17 +00002397dbdump.exe: $(TOP)\ext\misc\dbdump.c $(SQLITE3C) $(SQLITE3H) $(LIBRESOBJS)
mistachkin943d8252017-03-14 15:27:56 +00002398 $(LTLINK) $(NO_WARN) -DDBDUMP_STANDALONE $(TOP)\ext\misc\dbdump.c $(SQLITE3C) \
2399 /link $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS)
drh4b34eb32017-03-13 22:02:01 +00002400
mistachkinac8ba262018-03-07 14:42:17 +00002401testloadext.lo: $(TOP)\src\test_loadext.c $(SQLITE3H)
mistachkin44723ce2015-03-21 02:22:37 +00002402 $(LTCOMPILE) $(NO_WARN) -c $(TOP)\src\test_loadext.c
mistachkin1925a2e2014-02-24 21:20:25 +00002403
mistachkin9b88ace2016-02-26 21:01:37 +00002404testloadext.dll: testloadext.lo
mistachkin1925a2e2014-02-24 21:20:25 +00002405 $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /OUT:$@ testloadext.lo
2406
mistachkin5d4d9412016-01-22 03:54:36 +00002407showdb.exe: $(TOP)\tool\showdb.c $(SQLITE3C) $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002408 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
mistachkin78e3f612015-10-14 20:01:12 +00002409 $(TOP)\tool\showdb.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh9ac3c1e2013-11-07 18:37:31 +00002410
mistachkin5d4d9412016-01-22 03:54:36 +00002411showstat4.exe: $(TOP)\tool\showstat4.c $(SQLITE3C) $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002412 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
mistachkin78e3f612015-10-14 20:01:12 +00002413 $(TOP)\tool\showstat4.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh4bb77ec2014-06-30 11:14:26 +00002414
mistachkin5d4d9412016-01-22 03:54:36 +00002415showjournal.exe: $(TOP)\tool\showjournal.c $(SQLITE3C) $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002416 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
mistachkin78e3f612015-10-14 20:01:12 +00002417 $(TOP)\tool\showjournal.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh4bb77ec2014-06-30 11:14:26 +00002418
mistachkin5d4d9412016-01-22 03:54:36 +00002419showwal.exe: $(TOP)\tool\showwal.c $(SQLITE3C) $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002420 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
mistachkin78e3f612015-10-14 20:01:12 +00002421 $(TOP)\tool\showwal.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh4bb77ec2014-06-30 11:14:26 +00002422
drh666fb692017-10-30 23:25:06 +00002423showshm.exe: $(TOP)\tool\showshm.c
2424 $(LTLINK) $(NO_WARN) $(TOP)\tool\showshm.c /link $(LDFLAGS) $(LTLINKOPTS)
2425
mistachkin953fbd12017-02-07 21:09:34 +00002426changeset.exe: $(TOP)\ext\session\changeset.c $(SQLITE3C) $(SQLITE3H)
2427 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
2428 -DSQLITE_ENABLE_SESSION=1 -DSQLITE_ENABLE_PREUPDATE_HOOK=1 \
mistachkin05004782016-03-30 16:23:06 +00002429 $(TOP)\ext\session\changeset.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh9f674f22014-08-18 20:23:29 +00002430
mistachkin5d4d9412016-01-22 03:54:36 +00002431fts3view.exe: $(TOP)\ext\fts3\tool\fts3view.c $(SQLITE3C) $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002432 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
mistachkin78e3f612015-10-14 20:01:12 +00002433 $(TOP)\ext\fts3\tool\fts3view.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
mistachkinde545272014-07-07 17:57:50 +00002434
mistachkin5d4d9412016-01-22 03:54:36 +00002435rollback-test.exe: $(TOP)\tool\rollback-test.c $(SQLITE3C) $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002436 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
mistachkin78e3f612015-10-14 20:01:12 +00002437 $(TOP)\tool\rollback-test.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh4bb77ec2014-06-30 11:14:26 +00002438
mistachkin5d4d9412016-01-22 03:54:36 +00002439LogEst.exe: $(TOP)\tool\logest.c $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002440 $(LTLINK) $(NO_WARN) $(TOP)\tool\LogEst.c /link $(LDFLAGS) $(LTLINKOPTS)
drh267a13f2014-06-18 18:10:12 +00002441
mistachkin5d4d9412016-01-22 03:54:36 +00002442wordcount.exe: $(TOP)\test\wordcount.c $(SQLITE3C) $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002443 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
mistachkin78e3f612015-10-14 20:01:12 +00002444 $(TOP)\test\wordcount.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh9ac3c1e2013-11-07 18:37:31 +00002445
mistachkin5d4d9412016-01-22 03:54:36 +00002446speedtest1.exe: $(TOP)\test\speedtest1.c $(SQLITE3C) $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002447 $(LTLINK) $(NO_WARN) $(ST_COMPILE_OPTS) -DSQLITE_OMIT_LOAD_EXTENSION \
mistachkin78e3f612015-10-14 20:01:12 +00002448 $(TOP)\test\speedtest1.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
mistachkinb482a442012-02-11 22:19:26 +00002449
mistachkin953fbd12017-02-07 21:09:34 +00002450kvtest.exe: $(TOP)\test\kvtest.c $(SQLITE3C) $(SQLITE3H)
2451 $(LTLINK) $(NO_WARN) $(KV_COMPILE_OPTS) \
2452 $(TOP)\test\kvtest.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
2453
mistachkin9b88ace2016-02-26 21:01:37 +00002454rbu.exe: $(TOP)\ext\rbu\rbu.c $(TOP)\ext\rbu\sqlite3rbu.c $(SQLITE3C) $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002455 $(LTLINK) $(NO_WARN) -DSQLITE_ENABLE_RBU \
mistachkin5d4d9412016-01-22 03:54:36 +00002456 $(TOP)\ext\rbu\rbu.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
mistachkin9b88ace2016-02-26 21:01:37 +00002457
mistachkin02679b02017-06-27 05:59:47 +00002458LSMDIR=$(TOP)\ext\lsm1
2459!INCLUDE $(LSMDIR)\Makefile.msc
2460
mistachkin9b88ace2016-02-26 21:01:37 +00002461moreclean: clean
2462 del /Q $(SQLITE3C) $(SQLITE3H) 2>NUL
mistachkin3e786092016-01-23 07:53:04 +00002463# <</mark>>
drh76473772016-01-14 13:22:24 +00002464
shaneh6e7850c2011-06-17 15:57:07 +00002465clean:
mistachkin8dd3ff12015-05-16 03:41:41 +00002466 del /Q *.exp *.lo *.ilk *.lib *.obj *.ncb *.pdb *.sdf *.suo 2>NUL
mistachkin56362a52016-02-19 19:03:04 +00002467 del /Q *.bsc *.def *.cod *.da *.bb *.bbg *.vc gmon.out 2>NUL
mistachkinfe41a982016-02-27 00:21:44 +00002468 del /Q $(SQLITE3EXE) $(SQLITE3DLL) Replace.exe 2>NUL
mistachkin3e786092016-01-23 07:53:04 +00002469# <<mark>>
mistachkin9b88ace2016-02-26 21:01:37 +00002470 del /Q opcodes.c opcodes.h 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002471 del /Q lemon.* lempar.c parse.* 2>NUL
mistachkin050dc5c2017-09-04 18:44:54 +00002472 del /Q mksourceid.* mkkeywordhash.* keywordhash.h 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002473 del /Q notasharedlib.* 2>NUL
2474 -rmdir /Q/S .deps 2>NUL
2475 -rmdir /Q/S .libs 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002476 -rmdir /Q/S tsrc 2>NUL
2477 del /Q .target_source 2>NUL
mistachkin4ef916e2016-08-24 19:58:46 +00002478 del /Q tclsqlite3.exe $(SQLITETCLH) $(SQLITETCLDECLSH) 2>NUL
mistachkina2d85cb2017-07-07 19:02:51 +00002479 del /Q lsm.dll lsmtest.exe 2>NUL
mistachkin44723ce2015-03-21 02:22:37 +00002480 del /Q testloadext.dll 2>NUL
2481 del /Q testfixture.exe test.db 2>NUL
mistachkin943d8252017-03-14 15:27:56 +00002482 del /Q LogEst.exe fts3view.exe rollback-test.exe showdb.exe dbdump.exe 2>NUL
drhedea9112015-03-24 19:02:13 +00002483 del /Q changeset.exe 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002484 del /Q showjournal.exe showstat4.exe showwal.exe speedtest1.exe 2>NUL
mistachkin27b69972016-02-07 20:39:27 +00002485 del /Q mptester.exe wordcount.exe rbu.exe srcck1.exe 2>NUL
mistachkin1f237e32018-07-27 20:45:28 +00002486 del /Q sqlite3.c sqlite3-*.c sqlite3.h 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002487 del /Q sqlite3rc.h 2>NUL
mistachkin27799892016-03-31 22:53:37 +00002488 del /Q shell.c sqlite3ext.h sqlite3session.h 2>NUL
mistachkin44723ce2015-03-21 02:22:37 +00002489 del /Q sqlite3_analyzer.exe sqlite3_analyzer.c 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002490 del /Q sqlite-*-output.vsix 2>NUL
drh290fcaa2016-06-08 01:03:05 +00002491 del /Q fuzzershell.exe fuzzcheck.exe sqldiff.exe dbhash.exe 2>NUL
mistachkinb649be32018-03-07 14:53:36 +00002492 del /Q sqltclsh.* 2>NUL
mistachkin83686922018-03-08 18:09:22 +00002493 del /Q dbfuzz.exe sessionfuzz.exe 2>NUL
mistachkinac8ba262018-03-07 14:42:17 +00002494 del /Q kvtest.exe ossshell.exe scrub.exe 2>NUL
mistachkinb649be32018-03-07 14:53:36 +00002495 del /Q showshm.exe sqlite3_checker.* sqlite3_expert.exe 2>NUL
mistachkinbc50bb72015-07-14 21:56:53 +00002496 del /Q fts5.* fts5parse.* 2>NUL
mistachkin3384ccb2017-12-13 22:42:55 +00002497 del /Q lsm.h lsm1.c 2>NUL
mistachkin3e786092016-01-23 07:53:04 +00002498# <</mark>>