blob: e65f99d75887df45d5b076b80a02cf443ffd9df1 [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
24USE_FULLWARN = 0
25!ENDIF
26
mistachkin44723ce2015-03-21 02:22:37 +000027# Set this non-0 to use "stdcall" calling convention for the core library
28# and shell executable.
29#
30!IFNDEF USE_STDCALL
31USE_STDCALL = 0
32!ENDIF
33
34# Set this non-0 to have the shell executable link against the core dynamic
35# link library.
36#
37!IFNDEF DYNAMIC_SHELL
38DYNAMIC_SHELL = 0
39!ENDIF
40
mistachkin13a24f82015-05-13 04:50:30 +000041# Set this non-0 to enable extra code that attempts to detect misuse of the
42# SQLite API.
43#
44!IFNDEF API_ARMOR
45API_ARMOR = 0
46!ENDIF
47
mistachkin2318d332015-01-12 18:02:52 +000048# If necessary, create a list of harmless compiler warnings to disable when
mistachkin44723ce2015-03-21 02:22:37 +000049# compiling the various tools. For the SQLite source code itself, warnings,
mistachkin2318d332015-01-12 18:02:52 +000050# if any, will be disabled from within it.
51#
52!IFNDEF NO_WARN
53!IF $(USE_FULLWARN)!=0
mistachkin22529172015-04-10 21:16:11 +000054NO_WARN = -wd4054 -wd4055 -wd4100 -wd4127 -wd4130 -wd4152 -wd4189 -wd4206
mistachkinb9becaa2015-12-16 23:30:30 +000055NO_WARN = $(NO_WARN) -wd4210 -wd4232 -wd4305 -wd4306 -wd4702 -wd4706
mistachkin2318d332015-01-12 18:02:52 +000056!ENDIF
57!ENDIF
58
mistachkina5e2b502014-05-12 22:36:50 +000059# Set this non-0 to use the library paths and other options necessary for
60# Windows Phone 8.1.
mistachkind9b3c542014-05-09 23:31:55 +000061#
62!IFNDEF USE_WP81_OPTS
63USE_WP81_OPTS = 0
64!ENDIF
65
mistachkin76510912013-10-11 23:01:18 +000066# Set this non-0 to split the SQLite amalgamation file into chunks to
67# be used for debugging with Visual Studio.
68#
69!IFNDEF SPLIT_AMALGAMATION
mistachkin0aedc6b2013-10-11 23:02:13 +000070SPLIT_AMALGAMATION = 0
mistachkin76510912013-10-11 23:01:18 +000071!ENDIF
72
mistachkin3e786092016-01-23 07:53:04 +000073# <<mark>>
mistachkinc756ded2011-10-02 05:23:16 +000074# Set this non-0 to use the International Components for Unicode (ICU).
75#
mistachkin0ec07442012-10-12 18:06:07 +000076!IFNDEF USE_ICU
mistachkinc756ded2011-10-02 05:23:16 +000077USE_ICU = 0
mistachkin0ec07442012-10-12 18:06:07 +000078!ENDIF
mistachkin3e786092016-01-23 07:53:04 +000079# <</mark>>
mistachkinc756ded2011-10-02 05:23:16 +000080
mistachkin8d967a92012-06-21 04:21:35 +000081# Set this non-0 to dynamically link to the MSVC runtime library.
82#
mistachkin0ec07442012-10-12 18:06:07 +000083!IFNDEF USE_CRT_DLL
mistachkin8d967a92012-06-21 04:21:35 +000084USE_CRT_DLL = 0
mistachkin0ec07442012-10-12 18:06:07 +000085!ENDIF
mistachkin8d967a92012-06-21 04:21:35 +000086
mistachkine45e0fb2015-01-21 00:48:46 +000087# Set this non-0 to link to the RPCRT4 library.
88#
89!IFNDEF USE_RPCRT4_LIB
90USE_RPCRT4_LIB = 0
91!ENDIF
92
mistachkin0157e012013-09-06 21:41:11 +000093# Set this non-0 to generate assembly code listings for the source code
94# files.
95#
96!IFNDEF USE_LISTINGS
97USE_LISTINGS = 0
98!ENDIF
99
mistachkin52fd8e12012-08-28 01:44:13 +0000100# Set this non-0 to attempt setting the native compiler automatically
101# for cross-compiling the command line tools needed during the compilation
102# process.
103#
mistachkin0ec07442012-10-12 18:06:07 +0000104!IFNDEF XCOMPILE
mistachkin52fd8e12012-08-28 01:44:13 +0000105XCOMPILE = 0
mistachkin0ec07442012-10-12 18:06:07 +0000106!ENDIF
mistachkin52fd8e12012-08-28 01:44:13 +0000107
mistachkinbd58d5f2012-06-30 22:22:34 +0000108# Set this non-0 to use the native libraries paths for cross-compiling
109# the command line tools needed during the compilation process.
110#
mistachkin0ec07442012-10-12 18:06:07 +0000111!IFNDEF USE_NATIVE_LIBPATHS
mistachkinbd58d5f2012-06-30 22:22:34 +0000112USE_NATIVE_LIBPATHS = 0
mistachkin0ec07442012-10-12 18:06:07 +0000113!ENDIF
mistachkinbd58d5f2012-06-30 22:22:34 +0000114
mistachkin08c1c312012-10-06 03:48:25 +0000115# Set this 0 to skip the compiling and embedding of version resources.
116#
mistachkin0ec07442012-10-12 18:06:07 +0000117!IFNDEF USE_RC
mistachkin08c1c312012-10-06 03:48:25 +0000118USE_RC = 1
mistachkin0ec07442012-10-12 18:06:07 +0000119!ENDIF
mistachkin08c1c312012-10-06 03:48:25 +0000120
mistachkin46b721a2012-03-23 12:28:21 +0000121# Set this non-0 to compile binaries suitable for the WinRT environment.
122# This setting does not apply to any binaries that require Tcl to operate
123# properly (i.e. the text fixture, etc).
124#
mistachkin0ec07442012-10-12 18:06:07 +0000125!IFNDEF FOR_WINRT
mistachkin46b721a2012-03-23 12:28:21 +0000126FOR_WINRT = 0
mistachkin0ec07442012-10-12 18:06:07 +0000127!ENDIF
mistachkin46b721a2012-03-23 12:28:21 +0000128
mistachkina819aed2016-02-12 05:19:29 +0000129# Set this non-0 to compile binaries suitable for the UWP environment.
mistachkin318d38c2015-04-22 01:33:53 +0000130# This setting does not apply to any binaries that require Tcl to operate
131# properly (i.e. the text fixture, etc).
132#
mistachkina819aed2016-02-12 05:19:29 +0000133!IFNDEF FOR_UWP
134FOR_UWP = 0
mistachkin318d38c2015-04-22 01:33:53 +0000135!ENDIF
136
mistachkin5d4d9412016-01-22 03:54:36 +0000137# Set this non-0 to compile binaries suitable for the Windows 10 platform.
mistachkinedcb4eb2016-01-22 01:25:15 +0000138#
139!IFNDEF FOR_WIN10
140FOR_WIN10 = 0
141!ENDIF
142
mistachkin3e786092016-01-23 07:53:04 +0000143# <<mark>>
mistachkin31856a32012-07-27 07:13:25 +0000144# Set this non-0 to skip attempting to look for and/or link with the Tcl
145# runtime library.
146#
mistachkin0ec07442012-10-12 18:06:07 +0000147!IFNDEF NO_TCL
mistachkin31856a32012-07-27 07:13:25 +0000148NO_TCL = 0
mistachkin0ec07442012-10-12 18:06:07 +0000149!ENDIF
mistachkin3e786092016-01-23 07:53:04 +0000150# <</mark>>
mistachkin31856a32012-07-27 07:13:25 +0000151
mistachkin4d60be52011-08-26 05:40:31 +0000152# Set this to non-0 to create and use PDBs.
153#
mistachkin0ec07442012-10-12 18:06:07 +0000154!IFNDEF SYMBOLS
mistachkin4d60be52011-08-26 05:40:31 +0000155SYMBOLS = 1
mistachkin0ec07442012-10-12 18:06:07 +0000156!ENDIF
mistachkin4d60be52011-08-26 05:40:31 +0000157
mistachkin2f7d5d82012-08-22 00:39:34 +0000158# Set this to non-0 to use the SQLite debugging heap subsystem.
159#
mistachkin0ec07442012-10-12 18:06:07 +0000160!IFNDEF MEMDEBUG
mistachkin2f7d5d82012-08-22 00:39:34 +0000161MEMDEBUG = 0
mistachkin0ec07442012-10-12 18:06:07 +0000162!ENDIF
mistachkin2f7d5d82012-08-22 00:39:34 +0000163
164# Set this to non-0 to use the Win32 native heap subsystem.
165#
mistachkin0ec07442012-10-12 18:06:07 +0000166!IFNDEF WIN32HEAP
mistachkin2f7d5d82012-08-22 00:39:34 +0000167WIN32HEAP = 0
mistachkin0ec07442012-10-12 18:06:07 +0000168!ENDIF
mistachkin2f7d5d82012-08-22 00:39:34 +0000169
mistachkinb10f22a2015-04-16 16:27:29 +0000170# Set this to non-0 to enable OSTRACE() macros, which can be useful when
171# debugging.
172#
173!IFNDEF OSTRACE
174OSTRACE = 0
175!ENDIF
176
mistachkinf2d25f22011-08-25 04:09:12 +0000177# Set this to one of the following values to enable various debugging
178# features. Each level includes the debugging options from the previous
179# levels. Currently, the recognized values for DEBUG are:
180#
181# 0 == NDEBUG: Disables assert() and other runtime diagnostics.
mistachkincd54bab2014-12-20 21:14:14 +0000182# 1 == SQLITE_ENABLE_API_ARMOR: extra attempts to detect misuse of the API.
183# 2 == Disables NDEBUG and all optimizations and then enables PDBs.
184# 3 == SQLITE_DEBUG: Enables various diagnostics messages and code.
185# 4 == SQLITE_WIN32_MALLOC_VALIDATE: Validate the Win32 native heap per call.
186# 5 == SQLITE_DEBUG_OS_TRACE: Enables output from the OSTRACE() macros.
187# 6 == SQLITE_ENABLE_IOTRACE: Enables output from the IOTRACE() macros.
mistachkinf2d25f22011-08-25 04:09:12 +0000188#
mistachkin0ec07442012-10-12 18:06:07 +0000189!IFNDEF DEBUG
mistachkinf2d25f22011-08-25 04:09:12 +0000190DEBUG = 0
mistachkin0ec07442012-10-12 18:06:07 +0000191!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000192
mistachkin8bcd3fa2013-08-29 01:03:38 +0000193# Enable use of available compiler optimizations? Normally, this should be
194# non-zero. Setting this to zero, thus disabling all compiler optimizations,
195# can be useful for testing.
196#
197!IFNDEF OPTIMIZATIONS
198OPTIMIZATIONS = 2
199!ENDIF
200
mistachkin5d4d9412016-01-22 03:54:36 +0000201# Set the source code file to be used by executables and libraries when
202# they need the amalgamation.
203#
204!IFNDEF SQLITE3C
205!IF $(SPLIT_AMALGAMATION)!=0
206SQLITE3C = sqlite3-all.c
207!ELSE
208SQLITE3C = sqlite3.c
209!ENDIF
210!ENDIF
211
212# Set the include code file to be used by executables and libraries when
213# they need SQLite.
214#
215!IFNDEF SQLITE3H
216SQLITE3H = sqlite3.h
217!ENDIF
218
mistachkinedcb4eb2016-01-22 01:25:15 +0000219# This is the name to use for the SQLite dynamic link library (DLL).
220#
221!IFNDEF SQLITE3DLL
mistachkinb0c99af2016-02-19 05:07:56 +0000222!IF $(FOR_WIN10)!=0
223SQLITE3DLL = winsqlite3.dll
224!ELSE
mistachkinedcb4eb2016-01-22 01:25:15 +0000225SQLITE3DLL = sqlite3.dll
226!ENDIF
mistachkinb0c99af2016-02-19 05:07:56 +0000227!ENDIF
mistachkinedcb4eb2016-01-22 01:25:15 +0000228
229# This is the name to use for the SQLite import library (LIB).
230#
231!IFNDEF SQLITE3LIB
mistachkinb0c99af2016-02-19 05:07:56 +0000232!IF $(FOR_WIN10)!=0
233SQLITE3LIB = winsqlite3.lib
234!ELSE
mistachkinedcb4eb2016-01-22 01:25:15 +0000235SQLITE3LIB = sqlite3.lib
236!ENDIF
mistachkinb0c99af2016-02-19 05:07:56 +0000237!ENDIF
mistachkinedcb4eb2016-01-22 01:25:15 +0000238
239# This is the name to use for the SQLite shell executable (EXE).
240#
241!IFNDEF SQLITE3EXE
mistachkinb0c99af2016-02-19 05:07:56 +0000242!IF $(FOR_WIN10)!=0
243SQLITE3EXE = winsqlite3shell.exe
244!ELSE
mistachkinedcb4eb2016-01-22 01:25:15 +0000245SQLITE3EXE = sqlite3.exe
246!ENDIF
mistachkinb0c99af2016-02-19 05:07:56 +0000247!ENDIF
mistachkinedcb4eb2016-01-22 01:25:15 +0000248
249# This is the argument used to set the program database (PDB) file for the
250# SQLite shell executable (EXE).
251#
252!IFNDEF SQLITE3EXEPDB
mistachkinb0c99af2016-02-19 05:07:56 +0000253!IF $(FOR_WIN10)!=0
254SQLITE3EXEPDB =
255!ELSE
mistachkinedcb4eb2016-01-22 01:25:15 +0000256SQLITE3EXEPDB = /pdb:sqlite3sh.pdb
257!ENDIF
mistachkinb0c99af2016-02-19 05:07:56 +0000258!ENDIF
mistachkinedcb4eb2016-01-22 01:25:15 +0000259
mistachkin4712c212014-05-09 20:51:17 +0000260# These are the "standard" SQLite compilation options used when compiling for
261# the Windows platform.
262#
263!IFNDEF OPT_FEATURE_FLAGS
264OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS3=1
265OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RTREE=1
266OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_COLUMN_METADATA=1
mistachkin05004782016-03-30 16:23:06 +0000267OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_SESSION=1
268OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_PREUPDATE_HOOK=1
mistachkin4712c212014-05-09 20:51:17 +0000269!ENDIF
270
mistachkinedcb4eb2016-01-22 01:25:15 +0000271# These are the "extended" SQLite compilation options used when compiling for
272# the Windows 10 platform.
273#
274!IFNDEF EXT_FEATURE_FLAGS
275!IF $(FOR_WIN10)!=0
276EXT_FEATURE_FLAGS = $(EXT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS4=1
277EXT_FEATURE_FLAGS = $(EXT_FEATURE_FLAGS) -DSQLITE_SYSTEM_MALLOC=1
278EXT_FEATURE_FLAGS = $(EXT_FEATURE_FLAGS) -DSQLITE_OMIT_LOCALTIME=1
279!ELSE
280EXT_FEATURE_FLAGS =
281!ENDIF
282!ENDIF
283
mistachkin4712c212014-05-09 20:51:17 +0000284###############################################################################
285############################### END OF OPTIONS ################################
286###############################################################################
287
mistachkin55e88d92016-02-08 20:40:57 +0000288# When compiling for the Windows 10 platform, the PLATFORM macro must be set
289# to an appropriate value (e.g. x86, x64, arm, arm64, etc).
290#
291!IF $(FOR_WIN10)!=0
292!IFNDEF PLATFORM
293!ERROR Using the FOR_WIN10 option requires a value for PLATFORM.
294!ENDIF
295!ENDIF
296
mistachkind9b3c542014-05-09 23:31:55 +0000297# This assumes that MSVC is always installed in 32-bit Program Files directory
298# and sets the variable for use in locating other 32-bit installs accordingly.
299#
300PROGRAMFILES_X86 = $(VCINSTALLDIR)\..\..
301PROGRAMFILES_X86 = $(PROGRAMFILES_X86:\\=\)
302
mistachkine37f99c2012-06-30 16:22:05 +0000303# Check for the predefined command macro CC. This should point to the compiler
mistachkinbd58d5f2012-06-30 22:22:34 +0000304# binary for the target platform. If it is not defined, simply define it to
mistachkine37f99c2012-06-30 16:22:05 +0000305# the legacy default value 'cl.exe'.
306#
307!IFNDEF CC
308CC = cl.exe
309!ENDIF
310
mistachkin9aeb9712016-02-26 23:13:16 +0000311# Check for the predefined command macro CSC. This should point to a working
312# C Sharp compiler binary. If it is not defined, simply define it to the
313# legacy default value 'csc.exe'.
314#
315!IFNDEF CSC
316CSC = csc.exe
317!ENDIF
318
mistachkin228aeff2012-06-30 19:24:09 +0000319# Check for the command macro LD. This should point to the linker binary for
mistachkinbd58d5f2012-06-30 22:22:34 +0000320# the target platform. If it is not defined, simply define it to the legacy
mistachkin228aeff2012-06-30 19:24:09 +0000321# default value 'link.exe'.
322#
323!IFNDEF LD
324LD = link.exe
325!ENDIF
326
mistachkin4d9d1f42012-09-03 10:32:32 +0000327# Check for the predefined command macro RC. This should point to the resource
328# compiler binary for the target platform. If it is not defined, simply define
329# it to the legacy default value 'rc.exe'.
330#
331!IFNDEF RC
332RC = rc.exe
333!ENDIF
334
mistachkine48f1ed2016-02-08 20:45:37 +0000335# Check for the MSVC runtime library path macro. Otherwise, this value will
mistachkin4712c212014-05-09 20:51:17 +0000336# default to the 'lib' directory underneath the MSVC installation directory.
337#
338!IFNDEF CRTLIBPATH
339CRTLIBPATH = $(VCINSTALLDIR)\lib
340!ENDIF
341
342CRTLIBPATH = $(CRTLIBPATH:\\=\)
343
mistachkine37f99c2012-06-30 16:22:05 +0000344# Check for the command macro NCC. This should point to the compiler binary
mistachkinbd58d5f2012-06-30 22:22:34 +0000345# for the platform the compilation process is taking place on. If it is not
346# defined, simply define it to have the same value as the CC macro. When
mistachkine37f99c2012-06-30 16:22:05 +0000347# cross-compiling, it is suggested that this macro be modified via the command
348# line (since nmake itself does not provide a built-in method to guess it).
349# For example, to use the x86 compiler when cross-compiling for x64, a command
mistachkinbd58d5f2012-06-30 22:22:34 +0000350# line similar to the following could be used (all on one line):
mistachkine37f99c2012-06-30 16:22:05 +0000351#
mistachkin6f928332012-08-17 11:47:32 +0000352# nmake /f Makefile.msc sqlite3.dll
mistachkin52fd8e12012-08-28 01:44:13 +0000353# XCOMPILE=1 USE_NATIVE_LIBPATHS=1
354#
355# Alternatively, the full path and file name to the compiler binary for the
356# platform the compilation process is taking place may be specified (all on
357# one line):
358#
359# nmake /f Makefile.msc sqlite3.dll
mistachkinbd58d5f2012-06-30 22:22:34 +0000360# "NCC=""%VCINSTALLDIR%\bin\cl.exe"""
361# USE_NATIVE_LIBPATHS=1
mistachkine37f99c2012-06-30 16:22:05 +0000362#
mistachkinfd0ba2a2012-07-27 08:21:45 +0000363!IFDEF NCC
364NCC = $(NCC:\\=\)
mistachkin52fd8e12012-08-28 01:44:13 +0000365!ELSEIF $(XCOMPILE)!=0
mistachkin5fac4202013-12-03 23:33:29 +0000366NCC = "$(VCINSTALLDIR)\bin\$(CC)"
mistachkin52fd8e12012-08-28 01:44:13 +0000367NCC = $(NCC:\\=\)
mistachkinfd0ba2a2012-07-27 08:21:45 +0000368!ELSE
mistachkine37f99c2012-06-30 16:22:05 +0000369NCC = $(CC)
370!ENDIF
371
mistachkine48f1ed2016-02-08 20:45:37 +0000372# Check for the MSVC native runtime library path macro. Otherwise,
mistachkin4712c212014-05-09 20:51:17 +0000373# this value will default to the 'lib' directory underneath the MSVC
mistachkinbd58d5f2012-06-30 22:22:34 +0000374# installation directory.
375#
376!IFNDEF NCRTLIBPATH
377NCRTLIBPATH = $(VCINSTALLDIR)\lib
378!ENDIF
379
mistachkin0b5ae722012-07-27 23:03:47 +0000380NCRTLIBPATH = $(NCRTLIBPATH:\\=\)
381
mistachkine48f1ed2016-02-08 20:45:37 +0000382# Check for the Platform SDK library path macro. Otherwise, this
mistachkinbd58d5f2012-06-30 22:22:34 +0000383# value will default to the 'lib' directory underneath the Windows
384# SDK installation directory (the environment variable used appears
385# to be available when using Visual C++ 2008 or later via the
386# command line).
387#
388!IFNDEF NSDKLIBPATH
389NSDKLIBPATH = $(WINDOWSSDKDIR)\lib
390!ENDIF
391
mistachkin0b5ae722012-07-27 23:03:47 +0000392NSDKLIBPATH = $(NSDKLIBPATH:\\=\)
393
mistachkine48f1ed2016-02-08 20:45:37 +0000394# Check for the UCRT library path macro. Otherwise, this value will
mistachkina6f28892016-02-05 19:40:23 +0000395# default to the version-specific, platform-specific 'lib' directory
396# underneath the Windows SDK installation directory.
397#
398!IFNDEF UCRTLIBPATH
399UCRTLIBPATH = $(WINDOWSSDKDIR)\lib\$(WINDOWSSDKLIBVERSION)\ucrt\$(PLATFORM)
400!ENDIF
401
402UCRTLIBPATH = $(UCRTLIBPATH:\\=\)
403
mistachkinbd58d5f2012-06-30 22:22:34 +0000404# C compiler and options for use in building executables that
shanehb2f20bf2011-06-17 07:07:24 +0000405# will run on the platform that is doing the build.
406#
mistachkin2318d332015-01-12 18:02:52 +0000407!IF $(USE_FULLWARN)!=0
mistachkinf170ea42015-10-16 20:13:57 +0000408BCC = $(NCC) -nologo -W4 $(CCOPTS) $(BCCOPTS)
mistachkin2318d332015-01-12 18:02:52 +0000409!ELSE
mistachkinf170ea42015-10-16 20:13:57 +0000410BCC = $(NCC) -nologo -W3 $(CCOPTS) $(BCCOPTS)
mistachkin2318d332015-01-12 18:02:52 +0000411!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000412
mistachkin0157e012013-09-06 21:41:11 +0000413# Check if assembly code listings should be generated for the source
414# code files to be compiled.
415#
416!IF $(USE_LISTINGS)!=0
417BCC = $(BCC) -FAcs
418!ENDIF
419
mistachkinbd58d5f2012-06-30 22:22:34 +0000420# Check if the native library paths should be used when compiling
421# the command line tools used during the compilation process. If
422# so, set the necessary macro now.
423#
424!IF $(USE_NATIVE_LIBPATHS)!=0
425NLTLIBPATHS = "/LIBPATH:$(NCRTLIBPATH)" "/LIBPATH:$(NSDKLIBPATH)"
mistachkin6bbe3df2015-04-19 06:18:10 +0000426
427!IFDEF NUCRTLIBPATH
428NUCRTLIBPATH = $(NUCRTLIBPATH:\\=\)
429NLTLIBPATHS = $(NLTLIBPATHS) "/LIBPATH:$(NUCRTLIBPATH)"
430!ENDIF
mistachkinbd58d5f2012-06-30 22:22:34 +0000431!ENDIF
432
433# C compiler and options for use in building executables that
shanehb2f20bf2011-06-17 07:07:24 +0000434# will run on the target platform. (BCC and TCC are usually the
435# same unless your are cross-compiling.)
436#
mistachkin2318d332015-01-12 18:02:52 +0000437!IF $(USE_FULLWARN)!=0
mistachkinf170ea42015-10-16 20:13:57 +0000438TCC = $(CC) -nologo -W4 -DINCLUDE_MSVC_H=1 $(CCOPTS) $(TCCOPTS)
mistachkin2318d332015-01-12 18:02:52 +0000439!ELSE
mistachkinf170ea42015-10-16 20:13:57 +0000440TCC = $(CC) -nologo -W3 $(CCOPTS) $(TCCOPTS)
mistachkin2318d332015-01-12 18:02:52 +0000441!ENDIF
442
mistachkin8988aee2016-02-10 21:45:25 +0000443TCC = $(TCC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) -I$(TOP)\src -fp:precise
444RCC = $(RC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) -I$(TOP)\src $(RCOPTS) $(RCCOPTS)
shaneh6e7850c2011-06-17 15:57:07 +0000445
mistachkin44723ce2015-03-21 02:22:37 +0000446# Check if we want to use the "stdcall" calling convention when compiling.
447# This is not supported by the compilers for non-x86 platforms. It should
448# also be noted here that building any target with these "stdcall" options
449# will most likely fail if the Tcl library is also required. This is due
450# to how the Tcl library functions are declared and exported (i.e. without
451# an explicit calling convention, which results in "cdecl").
452#
mistachkinedcb4eb2016-01-22 01:25:15 +0000453!IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
mistachkin44723ce2015-03-21 02:22:37 +0000454!IF "$(PLATFORM)"=="x86"
mistachkin59b9b022015-03-24 21:27:27 +0000455CORE_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_STDCALL=__stdcall
456SHELL_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_STDCALL=__stdcall
mistachkin44723ce2015-03-21 02:22:37 +0000457!ELSE
458!IFNDEF PLATFORM
mistachkin59b9b022015-03-24 21:27:27 +0000459CORE_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_STDCALL=__stdcall
460SHELL_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_STDCALL=__stdcall
mistachkin44723ce2015-03-21 02:22:37 +0000461!ELSE
462CORE_CCONV_OPTS =
463SHELL_CCONV_OPTS =
464!ENDIF
465!ENDIF
466!ELSE
467CORE_CCONV_OPTS =
468SHELL_CCONV_OPTS =
469!ENDIF
470
471# These are additional compiler options used for the core library.
472#
473!IFNDEF CORE_COMPILE_OPTS
mistachkinedcb4eb2016-01-22 01:25:15 +0000474!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
mistachkin44723ce2015-03-21 02:22:37 +0000475CORE_COMPILE_OPTS = $(CORE_CCONV_OPTS) -DSQLITE_API=__declspec(dllexport)
476!ELSE
477CORE_COMPILE_OPTS = $(CORE_CCONV_OPTS)
478!ENDIF
479!ENDIF
480
481# These are the additional targets that the core library should depend on
482# when linking.
483#
484!IFNDEF CORE_LINK_DEP
mistachkin9b88ace2016-02-26 21:01:37 +0000485!IF $(DYNAMIC_SHELL)!=0
mistachkin44723ce2015-03-21 02:22:37 +0000486CORE_LINK_DEP =
mistachkin9b88ace2016-02-26 21:01:37 +0000487!ELSEIF $(FOR_WIN10)==0 || "$(PLATFORM)"=="x86"
mistachkin44723ce2015-03-21 02:22:37 +0000488CORE_LINK_DEP = sqlite3.def
mistachkin9b88ace2016-02-26 21:01:37 +0000489!ELSE
490CORE_LINK_DEP =
mistachkin44723ce2015-03-21 02:22:37 +0000491!ENDIF
492!ENDIF
493
494# These are additional linker options used for the core library.
495#
496!IFNDEF CORE_LINK_OPTS
mistachkin9b88ace2016-02-26 21:01:37 +0000497!IF $(DYNAMIC_SHELL)!=0
mistachkin44723ce2015-03-21 02:22:37 +0000498CORE_LINK_OPTS =
mistachkin9b88ace2016-02-26 21:01:37 +0000499!ELSEIF $(FOR_WIN10)==0 || "$(PLATFORM)"=="x86"
mistachkin44723ce2015-03-21 02:22:37 +0000500CORE_LINK_OPTS = /DEF:sqlite3.def
mistachkin9b88ace2016-02-26 21:01:37 +0000501!ELSE
502CORE_LINK_OPTS =
mistachkin44723ce2015-03-21 02:22:37 +0000503!ENDIF
504!ENDIF
505
506# These are additional compiler options used for the shell executable.
507#
508!IFNDEF SHELL_COMPILE_OPTS
mistachkinedcb4eb2016-01-22 01:25:15 +0000509!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
mistachkin5d4d9412016-01-22 03:54:36 +0000510SHELL_COMPILE_OPTS = $(SHELL_CCONV_OPTS) -DSQLITE_API=__declspec(dllimport)
mistachkin44723ce2015-03-21 02:22:37 +0000511!ELSE
mistachkin5d4d9412016-01-22 03:54:36 +0000512SHELL_COMPILE_OPTS = $(SHELL_CCONV_OPTS)
513!ENDIF
514!ENDIF
515
516# This is the source code that the shell executable should be compiled
517# with.
518#
519!IFNDEF SHELL_CORE_SRC
520!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
521SHELL_CORE_SRC =
522!ELSE
523SHELL_CORE_SRC = $(SQLITE3C)
mistachkin44723ce2015-03-21 02:22:37 +0000524!ENDIF
525!ENDIF
526
527# This is the core library that the shell executable should depend on.
528#
529!IFNDEF SHELL_CORE_DEP
mistachkinedcb4eb2016-01-22 01:25:15 +0000530!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
531SHELL_CORE_DEP = $(SQLITE3DLL)
mistachkin44723ce2015-03-21 02:22:37 +0000532!ELSE
mistachkin5d4d9412016-01-22 03:54:36 +0000533SHELL_CORE_DEP =
mistachkin44723ce2015-03-21 02:22:37 +0000534!ENDIF
535!ENDIF
536
537# This is the core library that the shell executable should link with.
538#
539!IFNDEF SHELL_CORE_LIB
mistachkinedcb4eb2016-01-22 01:25:15 +0000540!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
541SHELL_CORE_LIB = $(SQLITE3LIB)
mistachkin44723ce2015-03-21 02:22:37 +0000542!ELSE
mistachkin5d4d9412016-01-22 03:54:36 +0000543SHELL_CORE_LIB =
mistachkin44723ce2015-03-21 02:22:37 +0000544!ENDIF
545!ENDIF
546
547# These are additional linker options used for the shell executable.
548#
549!IFNDEF SHELL_LINK_OPTS
550SHELL_LINK_OPTS = $(SHELL_CORE_LIB)
551!ENDIF
552
mistachkin0157e012013-09-06 21:41:11 +0000553# Check if assembly code listings should be generated for the source
554# code files to be compiled.
555#
556!IF $(USE_LISTINGS)!=0
557TCC = $(TCC) -FAcs
558!ENDIF
559
mistachkinf39eaf22012-03-20 02:18:42 +0000560# When compiling the library for use in the WinRT environment,
mistachkin46b721a2012-03-23 12:28:21 +0000561# the following compile-time options must be used as well to
mistachkinf39eaf22012-03-20 02:18:42 +0000562# disable use of Win32 APIs that are not available and to enable
563# use of Win32 APIs that are specific to Windows 8 and/or WinRT.
564#
mistachkin46b721a2012-03-23 12:28:21 +0000565!IF $(FOR_WINRT)!=0
mistachkin8d967a92012-06-21 04:21:35 +0000566TCC = $(TCC) -DSQLITE_OS_WINRT=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000567RCC = $(RCC) -DSQLITE_OS_WINRT=1
mistachkin08c1c312012-10-06 03:48:25 +0000568TCC = $(TCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
569RCC = $(RCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
mistachkin8d967a92012-06-21 04:21:35 +0000570!ENDIF
571
mistachkin5d4d9412016-01-22 03:54:36 +0000572# C compiler options for the Windows 10 platform (needs MSVC 2015).
mistachkinedcb4eb2016-01-22 01:25:15 +0000573#
574!IF $(FOR_WIN10)!=0
mistachkin406eeff2016-02-09 18:28:20 +0000575TCC = $(TCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
576BCC = $(BCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
mistachkinedcb4eb2016-01-22 01:25:15 +0000577!ENDIF
578
mistachkin8d967a92012-06-21 04:21:35 +0000579# Also, we need to dynamically link to the correct MSVC runtime
580# when compiling for WinRT (e.g. debug or release) OR if the
581# USE_CRT_DLL option is set to force dynamically linking to the
582# MSVC runtime library.
583#
mistachkina6f28892016-02-05 19:40:23 +0000584!IF $(FOR_WINRT)!=0 || $(USE_CRT_DLL)!=0
mistachkincd54bab2014-12-20 21:14:14 +0000585!IF $(DEBUG)>1
mistachkin8d967a92012-06-21 04:21:35 +0000586TCC = $(TCC) -MDd
mistachkin08c1c312012-10-06 03:48:25 +0000587BCC = $(BCC) -MDd
mistachkin8d967a92012-06-21 04:21:35 +0000588!ELSE
589TCC = $(TCC) -MD
mistachkin08c1c312012-10-06 03:48:25 +0000590BCC = $(BCC) -MD
mistachkin8d967a92012-06-21 04:21:35 +0000591!ENDIF
592!ELSE
mistachkincd54bab2014-12-20 21:14:14 +0000593!IF $(DEBUG)>1
mistachkin8d967a92012-06-21 04:21:35 +0000594TCC = $(TCC) -MTd
mistachkin08c1c312012-10-06 03:48:25 +0000595BCC = $(BCC) -MTd
mistachkin8d967a92012-06-21 04:21:35 +0000596!ELSE
597TCC = $(TCC) -MT
mistachkin08c1c312012-10-06 03:48:25 +0000598BCC = $(BCC) -MT
mistachkin8d967a92012-06-21 04:21:35 +0000599!ENDIF
mistachkin46b721a2012-03-23 12:28:21 +0000600!ENDIF
mistachkinf39eaf22012-03-20 02:18:42 +0000601
mistachkin3e786092016-01-23 07:53:04 +0000602# <<mark>>
mistachkinf39eaf22012-03-20 02:18:42 +0000603# The mksqlite3c.tcl and mksqlite3h.tcl scripts will pull in
shaneh6e7850c2011-06-17 15:57:07 +0000604# any extension header files by default. For non-amalgamation
605# builds, we need to make sure the compiler can find these.
606#
607!IF $(USE_AMALGAMATION)==0
608TCC = $(TCC) -I$(TOP)\ext\fts3
mistachkin4d9d1f42012-09-03 10:32:32 +0000609RCC = $(RCC) -I$(TOP)\ext\fts3
shaneh6e7850c2011-06-17 15:57:07 +0000610TCC = $(TCC) -I$(TOP)\ext\rtree
mistachkin4d9d1f42012-09-03 10:32:32 +0000611RCC = $(RCC) -I$(TOP)\ext\rtree
drh498dcae2013-03-13 11:42:00 +0000612TCC = $(TCC) -I$(TOP)\ext\session
mistachkin38b4daa2013-03-13 19:02:39 +0000613RCC = $(RCC) -I$(TOP)\ext\session
shaneh6e7850c2011-06-17 15:57:07 +0000614!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000615
mistachkinb0427512014-01-30 11:12:52 +0000616# The mksqlite3c.tcl script accepts some options on the command
617# line. When compiling with debugging enabled, some of these
618# options are necessary in order to allow debugging symbols to
619# work correctly with Visual Studio when using the amalgamation.
620#
mistachkin22529172015-04-10 21:16:11 +0000621!IFNDEF MKSQLITE3C_ARGS
mistachkincd54bab2014-12-20 21:14:14 +0000622!IF $(DEBUG)>1
mistachkinb0427512014-01-30 11:12:52 +0000623MKSQLITE3C_ARGS = --linemacros
624!ELSE
625MKSQLITE3C_ARGS =
626!ENDIF
mistachkin22529172015-04-10 21:16:11 +0000627!ENDIF
mistachkin3e786092016-01-23 07:53:04 +0000628# <</mark>>
mistachkinb0427512014-01-30 11:12:52 +0000629
shanehb2f20bf2011-06-17 07:07:24 +0000630# Define -DNDEBUG to compile without debugging (i.e., for production usage)
631# Omitting the define will cause extra debugging code to be inserted and
632# includes extra comments when "EXPLAIN stmt" is used.
633#
mistachkin753c5442011-08-25 02:02:25 +0000634!IF $(DEBUG)==0
shanehb2f20bf2011-06-17 07:07:24 +0000635TCC = $(TCC) -DNDEBUG
mistachkinfec360a2012-04-18 10:29:21 +0000636BCC = $(BCC) -DNDEBUG
mistachkin4d9d1f42012-09-03 10:32:32 +0000637RCC = $(RCC) -DNDEBUG
mistachkin753c5442011-08-25 02:02:25 +0000638!ENDIF
639
mistachkinedcb4eb2016-01-22 01:25:15 +0000640!IF $(DEBUG)>0 || $(API_ARMOR)!=0 || $(FOR_WIN10)!=0
mistachkin13a24f82015-05-13 04:50:30 +0000641TCC = $(TCC) -DSQLITE_ENABLE_API_ARMOR=1
642RCC = $(RCC) -DSQLITE_ENABLE_API_ARMOR=1
mistachkincd54bab2014-12-20 21:14:14 +0000643!ENDIF
644
645!IF $(DEBUG)>2
mistachkin13a24f82015-05-13 04:50:30 +0000646TCC = $(TCC) -DSQLITE_DEBUG=1
647RCC = $(RCC) -DSQLITE_DEBUG=1
mistachkin753c5442011-08-25 02:02:25 +0000648!ENDIF
649
mistachkinb10f22a2015-04-16 16:27:29 +0000650!IF $(DEBUG)>4 || $(OSTRACE)!=0
651TCC = $(TCC) -DSQLITE_FORCE_OS_TRACE=1 -DSQLITE_DEBUG_OS_TRACE=1
652RCC = $(RCC) -DSQLITE_FORCE_OS_TRACE=1 -DSQLITE_DEBUG_OS_TRACE=1
mistachkin753c5442011-08-25 02:02:25 +0000653!ENDIF
654
mistachkincd54bab2014-12-20 21:14:14 +0000655!IF $(DEBUG)>5
mistachkin13a24f82015-05-13 04:50:30 +0000656TCC = $(TCC) -DSQLITE_ENABLE_IOTRACE=1
657RCC = $(RCC) -DSQLITE_ENABLE_IOTRACE=1
mistachkin753c5442011-08-25 02:02:25 +0000658!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000659
mistachkinbd58d5f2012-06-30 22:22:34 +0000660# Prevent warnings about "insecure" MSVC runtime library functions
661# being used.
mistachkin176f1b42011-08-02 23:34:00 +0000662#
663TCC = $(TCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
mistachkinfec360a2012-04-18 10:29:21 +0000664BCC = $(BCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
mistachkin4d9d1f42012-09-03 10:32:32 +0000665RCC = $(RCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
mistachkin176f1b42011-08-02 23:34:00 +0000666
mistachkinbd58d5f2012-06-30 22:22:34 +0000667# Prevent warnings about "deprecated" POSIX functions being used.
668#
669TCC = $(TCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
670BCC = $(BCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
mistachkin4d9d1f42012-09-03 10:32:32 +0000671RCC = $(RCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
mistachkinbd58d5f2012-06-30 22:22:34 +0000672
mistachkin2f7d5d82012-08-22 00:39:34 +0000673# Use the SQLite debugging heap subsystem?
mistachkin1b186a92011-08-24 16:13:57 +0000674#
mistachkin2f7d5d82012-08-22 00:39:34 +0000675!IF $(MEMDEBUG)!=0
676TCC = $(TCC) -DSQLITE_MEMDEBUG=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000677RCC = $(RCC) -DSQLITE_MEMDEBUG=1
mistachkin2f7d5d82012-08-22 00:39:34 +0000678
mistachkin2f7d5d82012-08-22 00:39:34 +0000679# Use native Win32 heap subsystem instead of malloc/free?
680#
681!ELSEIF $(WIN32HEAP)!=0
682TCC = $(TCC) -DSQLITE_WIN32_MALLOC=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000683RCC = $(RCC) -DSQLITE_WIN32_MALLOC=1
mistachkin753c5442011-08-25 02:02:25 +0000684
mistachkin753c5442011-08-25 02:02:25 +0000685# Validate the heap on every call into the native Win32 heap subsystem?
686#
mistachkincd54bab2014-12-20 21:14:14 +0000687!IF $(DEBUG)>3
mistachkin753c5442011-08-25 02:02:25 +0000688TCC = $(TCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000689RCC = $(RCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1
mistachkin753c5442011-08-25 02:02:25 +0000690!ENDIF
mistachkin2f7d5d82012-08-22 00:39:34 +0000691!ENDIF
mistachkin1b186a92011-08-24 16:13:57 +0000692
mistachkin3e786092016-01-23 07:53:04 +0000693# <<mark>>
mistachkin5b0b6fd2011-06-25 01:14:36 +0000694# The locations of the Tcl header and library files. Also, the library that
695# non-stubs enabled programs using Tcl must link against. These variables
696# (TCLINCDIR, TCLLIBDIR, and LIBTCL) may be overridden via the environment
697# prior to running nmake in order to match the actual installed location and
698# version on this machine.
shanehb2f20bf2011-06-17 07:07:24 +0000699#
mistachkine37f99c2012-06-30 16:22:05 +0000700!IFNDEF TCLINCDIR
shanehb2f20bf2011-06-17 07:07:24 +0000701TCLINCDIR = c:\tcl\include
mistachkine37f99c2012-06-30 16:22:05 +0000702!ENDIF
mistachkin5b0b6fd2011-06-25 01:14:36 +0000703
mistachkine37f99c2012-06-30 16:22:05 +0000704!IFNDEF TCLLIBDIR
shanehb2f20bf2011-06-17 07:07:24 +0000705TCLLIBDIR = c:\tcl\lib
mistachkine37f99c2012-06-30 16:22:05 +0000706!ENDIF
mistachkin5b0b6fd2011-06-25 01:14:36 +0000707
mistachkine37f99c2012-06-30 16:22:05 +0000708!IFNDEF LIBTCL
mistachkin5b0b6fd2011-06-25 01:14:36 +0000709LIBTCL = tcl85.lib
mistachkine37f99c2012-06-30 16:22:05 +0000710!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000711
mistachkin5b663502015-10-10 23:39:55 +0000712!IFNDEF LIBTCLSTUB
713LIBTCLSTUB = tclstub85.lib
714!ENDIF
715
mistachkin88739962015-10-14 23:04:08 +0000716!IFNDEF LIBTCLPATH
717LIBTCLPATH = c:\tcl\bin
718!ENDIF
719
mistachkinc756ded2011-10-02 05:23:16 +0000720# The locations of the ICU header and library files. These variables
721# (ICUINCDIR, ICULIBDIR, and LIBICU) may be overridden via the environment
722# prior to running nmake in order to match the actual installed location on
723# this machine.
724#
mistachkine37f99c2012-06-30 16:22:05 +0000725!IFNDEF ICUINCDIR
mistachkinc756ded2011-10-02 05:23:16 +0000726ICUINCDIR = c:\icu\include
mistachkine37f99c2012-06-30 16:22:05 +0000727!ENDIF
mistachkinc756ded2011-10-02 05:23:16 +0000728
mistachkine37f99c2012-06-30 16:22:05 +0000729!IFNDEF ICULIBDIR
mistachkinc756ded2011-10-02 05:23:16 +0000730ICULIBDIR = c:\icu\lib
mistachkine37f99c2012-06-30 16:22:05 +0000731!ENDIF
mistachkinc756ded2011-10-02 05:23:16 +0000732
mistachkine37f99c2012-06-30 16:22:05 +0000733!IFNDEF LIBICU
mistachkinc756ded2011-10-02 05:23:16 +0000734LIBICU = icuuc.lib icuin.lib
mistachkine37f99c2012-06-30 16:22:05 +0000735!ENDIF
mistachkinc756ded2011-10-02 05:23:16 +0000736
shanehb2f20bf2011-06-17 07:07:24 +0000737# This is the command to use for tclsh - normally just "tclsh", but we may
mistachkin5b0b6fd2011-06-25 01:14:36 +0000738# know the specific version we want to use. This variable (TCLSH_CMD) may be
739# overridden via the environment prior to running nmake in order to select a
740# specific Tcl shell to use.
shanehb2f20bf2011-06-17 07:07:24 +0000741#
mistachkine37f99c2012-06-30 16:22:05 +0000742!IFNDEF TCLSH_CMD
shanehb2f20bf2011-06-17 07:07:24 +0000743TCLSH_CMD = tclsh85
mistachkine37f99c2012-06-30 16:22:05 +0000744!ENDIF
mistachkin3e786092016-01-23 07:53:04 +0000745# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +0000746
747# Compiler options needed for programs that use the readline() library.
748#
mistachkin8bcd3fa2013-08-29 01:03:38 +0000749!IFNDEF READLINE_FLAGS
shaneh6e7850c2011-06-17 15:57:07 +0000750READLINE_FLAGS = -DHAVE_READLINE=0
mistachkin8bcd3fa2013-08-29 01:03:38 +0000751!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000752
753# The library that programs using readline() must link against.
754#
mistachkin8bcd3fa2013-08-29 01:03:38 +0000755!IFNDEF LIBREADLINE
shaneh6e7850c2011-06-17 15:57:07 +0000756LIBREADLINE =
mistachkin8bcd3fa2013-08-29 01:03:38 +0000757!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000758
759# Should the database engine be compiled threadsafe
760#
761TCC = $(TCC) -DSQLITE_THREADSAFE=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000762RCC = $(RCC) -DSQLITE_THREADSAFE=1
shanehb2f20bf2011-06-17 07:07:24 +0000763
764# Do threads override each others locks by default (1), or do we test (-1)
765#
766TCC = $(TCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1
mistachkin4d9d1f42012-09-03 10:32:32 +0000767RCC = $(RCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1
shanehb2f20bf2011-06-17 07:07:24 +0000768
769# Any target libraries which libsqlite must be linked against
shaneh6e7850c2011-06-17 15:57:07 +0000770#
mistachkine37f99c2012-06-30 16:22:05 +0000771!IFNDEF TLIBS
shaneh6e7850c2011-06-17 15:57:07 +0000772TLIBS =
mistachkine37f99c2012-06-30 16:22:05 +0000773!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000774
775# Flags controlling use of the in memory btree implementation
776#
777# SQLITE_TEMP_STORE is 0 to force temporary tables to be in a file, 1 to
778# default to file, 2 to default to memory, and 3 to force temporary
779# tables to always be in memory.
780#
shaneh6e7850c2011-06-17 15:57:07 +0000781TCC = $(TCC) -DSQLITE_TEMP_STORE=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000782RCC = $(RCC) -DSQLITE_TEMP_STORE=1
shanehb2f20bf2011-06-17 07:07:24 +0000783
784# Enable/disable loadable extensions, and other optional features
shaneh6e7850c2011-06-17 15:57:07 +0000785# based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*).
786# The same set of OMIT and ENABLE flags should be passed to the
shanehb2f20bf2011-06-17 07:07:24 +0000787# LEMON parser generator and the mkkeywordhash tool as well.
788
mistachkin4712c212014-05-09 20:51:17 +0000789# These are the required SQLite compilation options used when compiling for
790# the Windows platform.
791#
792REQ_FEATURE_FLAGS = $(REQ_FEATURE_FLAGS) -DSQLITE_MAX_TRIGGER_DEPTH=100
shanehb2f20bf2011-06-17 07:07:24 +0000793
mistachkine45e0fb2015-01-21 00:48:46 +0000794# If we are linking to the RPCRT4 library, enable features that need it.
795#
796!IF $(USE_RPCRT4_LIB)!=0
797REQ_FEATURE_FLAGS = $(REQ_FEATURE_FLAGS) -DSQLITE_WIN32_USE_UUID=1
798!ENDIF
799
mistachkin4712c212014-05-09 20:51:17 +0000800# Add the required and optional SQLite compilation options into the command
801# lines used to invoke the MSVC code and resource compilers.
802#
mistachkinedcb4eb2016-01-22 01:25:15 +0000803TCC = $(TCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS)
804RCC = $(RCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS)
shanehb2f20bf2011-06-17 07:07:24 +0000805
mistachkin4712c212014-05-09 20:51:17 +0000806# Add in any optional parameters specified on the commane line, e.g.
807# nmake /f Makefile.msc all "OPTS=-DSQLITE_ENABLE_FOO=1 -DSQLITE_OMIT_FOO=1"
808#
shanehb2f20bf2011-06-17 07:07:24 +0000809TCC = $(TCC) $(OPTS)
mistachkin4d9d1f42012-09-03 10:32:32 +0000810RCC = $(RCC) $(OPTS)
shanehb2f20bf2011-06-17 07:07:24 +0000811
mistachkin8bcd3fa2013-08-29 01:03:38 +0000812# If compiling for debugging, add some defines.
mistachkin4712c212014-05-09 20:51:17 +0000813#
mistachkincd54bab2014-12-20 21:14:14 +0000814!IF $(DEBUG)>1
mistachkin8bcd3fa2013-08-29 01:03:38 +0000815TCC = $(TCC) -D_DEBUG
816BCC = $(BCC) -D_DEBUG
mistachkin4d9d1f42012-09-03 10:32:32 +0000817RCC = $(RCC) -D_DEBUG
mistachkin4d60be52011-08-26 05:40:31 +0000818!ENDIF
819
mistachkin8bcd3fa2013-08-29 01:03:38 +0000820# If optimizations are enabled or disabled (either implicitly or
821# explicitly), add the necessary flags.
mistachkin4712c212014-05-09 20:51:17 +0000822#
mistachkincd54bab2014-12-20 21:14:14 +0000823!IF $(DEBUG)>1 || $(OPTIMIZATIONS)==0
mistachkin8bcd3fa2013-08-29 01:03:38 +0000824TCC = $(TCC) -Od
825BCC = $(BCC) -Od
826!ELSEIF $(OPTIMIZATIONS)>=3
827TCC = $(TCC) -Ox
828BCC = $(BCC) -Ox
829!ELSEIF $(OPTIMIZATIONS)==2
830TCC = $(TCC) -O2
831BCC = $(BCC) -O2
832!ELSEIF $(OPTIMIZATIONS)==1
833TCC = $(TCC) -O1
834BCC = $(BCC) -O1
835!ENDIF
836
837# If symbols are enabled (or compiling for debugging), enable PDBs.
mistachkin4712c212014-05-09 20:51:17 +0000838#
mistachkincd54bab2014-12-20 21:14:14 +0000839!IF $(DEBUG)>1 || $(SYMBOLS)!=0
mistachkin4d60be52011-08-26 05:40:31 +0000840TCC = $(TCC) -Zi
mistachkinfec360a2012-04-18 10:29:21 +0000841BCC = $(BCC) -Zi
mistachkin753c5442011-08-25 02:02:25 +0000842!ENDIF
843
mistachkin3e786092016-01-23 07:53:04 +0000844# <<mark>>
mistachkinc756ded2011-10-02 05:23:16 +0000845# If ICU support is enabled, add the compiler options for it.
mistachkin4712c212014-05-09 20:51:17 +0000846#
mistachkinc756ded2011-10-02 05:23:16 +0000847!IF $(USE_ICU)!=0
848TCC = $(TCC) -DSQLITE_ENABLE_ICU=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000849RCC = $(RCC) -DSQLITE_ENABLE_ICU=1
mistachkinc756ded2011-10-02 05:23:16 +0000850TCC = $(TCC) -I$(TOP)\ext\icu
mistachkin4d9d1f42012-09-03 10:32:32 +0000851RCC = $(RCC) -I$(TOP)\ext\icu
mistachkinc756ded2011-10-02 05:23:16 +0000852TCC = $(TCC) -I$(ICUINCDIR)
mistachkin4d9d1f42012-09-03 10:32:32 +0000853RCC = $(RCC) -I$(ICUINCDIR)
mistachkinc756ded2011-10-02 05:23:16 +0000854!ENDIF
mistachkin3e786092016-01-23 07:53:04 +0000855# <</mark>>
mistachkinc756ded2011-10-02 05:23:16 +0000856
mistachkin4d9d1f42012-09-03 10:32:32 +0000857# Command line prefixes for compiling code, compiling resources,
858# linking, etc.
mistachkin4712c212014-05-09 20:51:17 +0000859#
shanehb2f20bf2011-06-17 07:07:24 +0000860LTCOMPILE = $(TCC) -Fo$@
mistachkin4d9d1f42012-09-03 10:32:32 +0000861LTRCOMPILE = $(RCC) -r
shanehb2f20bf2011-06-17 07:07:24 +0000862LTLIB = lib.exe
shaneh2a0b9ef2011-06-20 20:52:32 +0000863LTLINK = $(TCC) -Fe$@
864
mistachkine45e0fb2015-01-21 00:48:46 +0000865# If requested, link to the RPCRT4 library.
866#
867!IF $(USE_RPCRT4_LIB)!=0
868LTLINK = $(LTLINK) rpcrt4.lib
869!ENDIF
870
shaneh2a0b9ef2011-06-20 20:52:32 +0000871# If a platform was set, force the linker to target that.
872# Note that the vcvars*.bat family of batch files typically
873# set this for you. Otherwise, the linker will attempt
874# to deduce the binary type based on the object files.
mistachkine37f99c2012-06-30 16:22:05 +0000875!IFDEF PLATFORM
mistachkin44723ce2015-03-21 02:22:37 +0000876LTLINKOPTS = /NOLOGO /MACHINE:$(PLATFORM)
877LTLIBOPTS = /NOLOGO /MACHINE:$(PLATFORM)
878!ELSE
879LTLINKOPTS = /NOLOGO
880LTLIBOPTS = /NOLOGO
shaneh2a0b9ef2011-06-20 20:52:32 +0000881!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000882
mistachkina6ff8572012-04-17 21:00:12 +0000883# When compiling for use in the WinRT environment, the following
884# linker option must be used to mark the executable as runnable
885# only in the context of an application container.
886#
887!IF $(FOR_WINRT)!=0
888LTLINKOPTS = $(LTLINKOPTS) /APPCONTAINER
mistachkin318d38c2015-04-22 01:33:53 +0000889!IF "$(VISUALSTUDIOVERSION)"=="12.0" || "$(VISUALSTUDIOVERSION)"=="14.0"
mistachkinf6a23422014-05-05 20:24:34 +0000890!IFNDEF STORELIBPATH
mistachkinda5b1cd2013-07-10 19:39:02 +0000891!IF "$(PLATFORM)"=="x86"
mistachkin4712c212014-05-09 20:51:17 +0000892STORELIBPATH = $(CRTLIBPATH)\store
mistachkinda5b1cd2013-07-10 19:39:02 +0000893!ELSEIF "$(PLATFORM)"=="x64"
mistachkin4712c212014-05-09 20:51:17 +0000894STORELIBPATH = $(CRTLIBPATH)\store\amd64
mistachkin4eaa1292013-07-10 21:33:25 +0000895!ELSEIF "$(PLATFORM)"=="ARM"
mistachkin4712c212014-05-09 20:51:17 +0000896STORELIBPATH = $(CRTLIBPATH)\store\arm
mistachkin4eaa1292013-07-10 21:33:25 +0000897!ELSE
mistachkin4712c212014-05-09 20:51:17 +0000898STORELIBPATH = $(CRTLIBPATH)\store
mistachkinda5b1cd2013-07-10 19:39:02 +0000899!ENDIF
900!ENDIF
mistachkinf6a23422014-05-05 20:24:34 +0000901STORELIBPATH = $(STORELIBPATH:\\=\)
902LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(STORELIBPATH)"
903!ENDIF
mistachkina6ff8572012-04-17 21:00:12 +0000904!ENDIF
905
mistachkind9b3c542014-05-09 23:31:55 +0000906# When compiling for Windows Phone 8.1, an extra library path is
907# required.
908#
909!IF $(USE_WP81_OPTS)!=0
910!IFNDEF WP81LIBPATH
911!IF "$(PLATFORM)"=="x86"
912WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86
913!ELSEIF "$(PLATFORM)"=="ARM"
914WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\ARM
915!ELSE
916WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86
mistachkinc756ded2011-10-02 05:23:16 +0000917!ENDIF
mistachkin31856a32012-07-27 07:13:25 +0000918!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000919!ENDIF
920
mistachkind9b3c542014-05-09 23:31:55 +0000921# When compiling for Windows Phone 8.1, some extra linker options
922# are also required.
923#
924!IF $(USE_WP81_OPTS)!=0
925!IFDEF WP81LIBPATH
926LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(WP81LIBPATH)"
927!ENDIF
928LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE
929LTLINKOPTS = $(LTLINKOPTS) WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelHost.lib
930LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:kernel32.lib /NODEFAULTLIB:ole32.lib
931!ENDIF
932
mistachkina819aed2016-02-12 05:19:29 +0000933# When compiling for UWP or the Windows 10 platform, some extra linker
mistachkin55e88d92016-02-08 20:40:57 +0000934# options are also required.
mistachkin318d38c2015-04-22 01:33:53 +0000935#
mistachkina819aed2016-02-12 05:19:29 +0000936!IF $(FOR_UWP)!=0 || $(FOR_WIN10)!=0
mistachkin318d38c2015-04-22 01:33:53 +0000937LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE /NODEFAULTLIB:kernel32.lib
938LTLINKOPTS = $(LTLINKOPTS) mincore.lib
939!IFDEF PSDKLIBPATH
940LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(PSDKLIBPATH)"
941!ENDIF
942!ENDIF
943
mistachkina6f28892016-02-05 19:40:23 +0000944!IF $(FOR_WIN10)!=0
mistachkin406eeff2016-02-09 18:28:20 +0000945LTLINKOPTS = $(LTLINKOPTS) /guard:cf "/LIBPATH:$(UCRTLIBPATH)"
mistachkina6f28892016-02-05 19:40:23 +0000946!IF $(DEBUG)>1
947LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:libucrtd.lib /DEFAULTLIB:ucrtd.lib
948!ELSE
949LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib
950!ENDIF
951!ENDIF
952
shanehb2f20bf2011-06-17 07:07:24 +0000953# If either debugging or symbols are enabled, enable PDBs.
mistachkin4712c212014-05-09 20:51:17 +0000954#
mistachkincd54bab2014-12-20 21:14:14 +0000955!IF $(DEBUG)>1 || $(SYMBOLS)!=0
mistachkinf170ea42015-10-16 20:13:57 +0000956LDFLAGS = /DEBUG $(LDOPTS)
957!ELSE
958LDFLAGS = $(LDOPTS)
shanehb2f20bf2011-06-17 07:07:24 +0000959!ENDIF
960
mistachkin3e786092016-01-23 07:53:04 +0000961# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +0000962# Start with the Tcl related linker options.
mistachkin4712c212014-05-09 20:51:17 +0000963#
shanehb2f20bf2011-06-17 07:07:24 +0000964!IF $(NO_TCL)==0
965LTLIBPATHS = /LIBPATH:$(TCLLIBDIR)
966LTLIBS = $(LIBTCL)
mistachkin31856a32012-07-27 07:13:25 +0000967!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000968
969# If ICU support is enabled, add the linker options for it.
mistachkin4712c212014-05-09 20:51:17 +0000970#
shanehb2f20bf2011-06-17 07:07:24 +0000971!IF $(USE_ICU)!=0
972LTLIBPATHS = $(LTLIBPATHS) /LIBPATH:$(ICULIBDIR)
973LTLIBS = $(LTLIBS) $(LIBICU)
974!ENDIF
mistachkin3e786092016-01-23 07:53:04 +0000975# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +0000976
shanehb2f20bf2011-06-17 07:07:24 +0000977# You should not have to change anything below this line
978###############################################################################
979
mistachkin3e786092016-01-23 07:53:04 +0000980# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +0000981# Object files for the SQLite library (non-amalgamation).
982#
mistachkinf67feef2013-07-29 19:03:20 +0000983LIBOBJS0 = vdbe.lo parse.lo alter.lo analyze.lo attach.lo auth.lo \
shanehb2f20bf2011-06-17 07:07:24 +0000984 backup.lo bitvec.lo btmutex.lo btree.lo build.lo \
drh1a4a6802015-05-04 18:31:09 +0000985 callback.lo complete.lo ctime.lo date.lo dbstat.lo delete.lo \
shanehb2f20bf2011-06-17 07:07:24 +0000986 expr.lo fault.lo fkey.lo \
drh391d4ba2012-05-28 20:22:16 +0000987 fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo \
988 fts3_porter.lo fts3_snippet.lo fts3_tokenizer.lo fts3_tokenizer1.lo \
drh4d648c72013-04-22 17:07:56 +0000989 fts3_tokenize_vtab.lo fts3_unicode.lo fts3_unicode2.lo fts3_write.lo \
mistachkined52f9f2015-06-26 04:34:36 +0000990 fts5.lo \
shanehb2f20bf2011-06-17 07:07:24 +0000991 func.lo global.lo hash.lo \
drhc2f18ad2016-03-05 15:35:09 +0000992 icu.lo insert.lo legacy.lo loadext.lo \
shanehb2f20bf2011-06-17 07:07:24 +0000993 main.lo malloc.lo mem0.lo mem1.lo mem2.lo mem3.lo mem5.lo \
994 memjournal.lo \
mistachkinf1c6bc52012-06-21 15:09:20 +0000995 mutex.lo mutex_noop.lo mutex_unix.lo mutex_w32.lo \
996 notify.lo opcodes.lo os.lo os_unix.lo os_win.lo \
mistachkinf67feef2013-07-29 19:03:20 +0000997 pager.lo pcache.lo pcache1.lo pragma.lo prepare.lo printf.lo \
drh498dcae2013-03-13 11:42:00 +0000998 random.lo resolve.lo rowset.lo rtree.lo \
drhcb75bff2016-01-14 14:48:17 +0000999 sqlite3session.lo select.lo sqlite3rbu.lo status.lo \
drh38b41492015-06-08 15:08:15 +00001000 table.lo threads.lo tokenize.lo treeview.lo trigger.lo \
shanehb2f20bf2011-06-17 07:07:24 +00001001 update.lo util.lo vacuum.lo \
mistachkinf67feef2013-07-29 19:03:20 +00001002 vdbeapi.lo vdbeaux.lo vdbeblob.lo vdbemem.lo vdbesort.lo \
drh6c1f4ef2015-06-08 14:23:15 +00001003 vdbetrace.lo wal.lo walker.lo where.lo wherecode.lo whereexpr.lo \
1004 utf.lo vtab.lo
mistachkin3e786092016-01-23 07:53:04 +00001005# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001006
1007# Object files for the amalgamation.
1008#
1009LIBOBJS1 = sqlite3.lo
1010
1011# Determine the real value of LIBOBJ based on the 'configure' script
1012#
mistachkin3e786092016-01-23 07:53:04 +00001013# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001014!IF $(USE_AMALGAMATION)==0
1015LIBOBJ = $(LIBOBJS0)
1016!ELSE
mistachkin3e786092016-01-23 07:53:04 +00001017# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001018LIBOBJ = $(LIBOBJS1)
mistachkin3e786092016-01-23 07:53:04 +00001019# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001020!ENDIF
mistachkin3e786092016-01-23 07:53:04 +00001021# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001022
mistachkin08c1c312012-10-06 03:48:25 +00001023# Determine if embedded resource compilation and usage are enabled.
1024#
1025!IF $(USE_RC)!=0
1026LIBRESOBJS = sqlite3res.lo
1027!ELSE
1028LIBRESOBJS =
1029!ENDIF
1030
mistachkin3e786092016-01-23 07:53:04 +00001031# <<mark>>
mistachkinc04c54b2016-02-11 21:28:16 +00001032# Core source code files, part 1.
shanehb2f20bf2011-06-17 07:07:24 +00001033#
mistachkinc04c54b2016-02-11 21:28:16 +00001034SRC00 = \
shanehb2f20bf2011-06-17 07:07:24 +00001035 $(TOP)\src\alter.c \
1036 $(TOP)\src\analyze.c \
1037 $(TOP)\src\attach.c \
1038 $(TOP)\src\auth.c \
1039 $(TOP)\src\backup.c \
1040 $(TOP)\src\bitvec.c \
1041 $(TOP)\src\btmutex.c \
1042 $(TOP)\src\btree.c \
shanehb2f20bf2011-06-17 07:07:24 +00001043 $(TOP)\src\build.c \
1044 $(TOP)\src\callback.c \
1045 $(TOP)\src\complete.c \
1046 $(TOP)\src\ctime.c \
1047 $(TOP)\src\date.c \
drh1a4a6802015-05-04 18:31:09 +00001048 $(TOP)\src\dbstat.c \
shanehb2f20bf2011-06-17 07:07:24 +00001049 $(TOP)\src\delete.c \
1050 $(TOP)\src\expr.c \
1051 $(TOP)\src\fault.c \
1052 $(TOP)\src\fkey.c \
1053 $(TOP)\src\func.c \
1054 $(TOP)\src\global.c \
1055 $(TOP)\src\hash.c \
shanehb2f20bf2011-06-17 07:07:24 +00001056 $(TOP)\src\insert.c \
shanehb2f20bf2011-06-17 07:07:24 +00001057 $(TOP)\src\legacy.c \
1058 $(TOP)\src\loadext.c \
1059 $(TOP)\src\main.c \
1060 $(TOP)\src\malloc.c \
1061 $(TOP)\src\mem0.c \
1062 $(TOP)\src\mem1.c \
1063 $(TOP)\src\mem2.c \
1064 $(TOP)\src\mem3.c \
1065 $(TOP)\src\mem5.c \
1066 $(TOP)\src\memjournal.c \
1067 $(TOP)\src\mutex.c \
shanehb2f20bf2011-06-17 07:07:24 +00001068 $(TOP)\src\mutex_noop.c \
shanehb2f20bf2011-06-17 07:07:24 +00001069 $(TOP)\src\mutex_unix.c \
1070 $(TOP)\src\mutex_w32.c \
1071 $(TOP)\src\notify.c \
1072 $(TOP)\src\os.c \
shanehb2f20bf2011-06-17 07:07:24 +00001073 $(TOP)\src\os_unix.c \
mistachkinc04c54b2016-02-11 21:28:16 +00001074 $(TOP)\src\os_win.c
1075
1076# Core source code files, part 2.
1077#
1078SRC01 = \
shanehb2f20bf2011-06-17 07:07:24 +00001079 $(TOP)\src\pager.c \
shanehb2f20bf2011-06-17 07:07:24 +00001080 $(TOP)\src\pcache.c \
shanehb2f20bf2011-06-17 07:07:24 +00001081 $(TOP)\src\pcache1.c \
1082 $(TOP)\src\pragma.c \
1083 $(TOP)\src\prepare.c \
1084 $(TOP)\src\printf.c \
1085 $(TOP)\src\random.c \
1086 $(TOP)\src\resolve.c \
1087 $(TOP)\src\rowset.c \
1088 $(TOP)\src\select.c \
1089 $(TOP)\src\status.c \
shanehb2f20bf2011-06-17 07:07:24 +00001090 $(TOP)\src\table.c \
drhf51446a2012-07-21 19:40:42 +00001091 $(TOP)\src\threads.c \
shanehb2f20bf2011-06-17 07:07:24 +00001092 $(TOP)\src\tclsqlite.c \
1093 $(TOP)\src\tokenize.c \
drh38b41492015-06-08 15:08:15 +00001094 $(TOP)\src\treeview.c \
shanehb2f20bf2011-06-17 07:07:24 +00001095 $(TOP)\src\trigger.c \
1096 $(TOP)\src\utf.c \
1097 $(TOP)\src\update.c \
1098 $(TOP)\src\util.c \
1099 $(TOP)\src\vacuum.c \
1100 $(TOP)\src\vdbe.c \
shanehb2f20bf2011-06-17 07:07:24 +00001101 $(TOP)\src\vdbeapi.c \
1102 $(TOP)\src\vdbeaux.c \
1103 $(TOP)\src\vdbeblob.c \
1104 $(TOP)\src\vdbemem.c \
mistachkin81c428a2011-08-17 02:19:54 +00001105 $(TOP)\src\vdbesort.c \
shanehb2f20bf2011-06-17 07:07:24 +00001106 $(TOP)\src\vdbetrace.c \
shanehb2f20bf2011-06-17 07:07:24 +00001107 $(TOP)\src\vtab.c \
1108 $(TOP)\src\wal.c \
shanehb2f20bf2011-06-17 07:07:24 +00001109 $(TOP)\src\walker.c \
drhe54df422013-11-12 18:37:25 +00001110 $(TOP)\src\where.c \
drh6f82e852015-06-06 20:12:09 +00001111 $(TOP)\src\wherecode.c \
mistachkinc04c54b2016-02-11 21:28:16 +00001112 $(TOP)\src\whereexpr.c
1113
1114# Shell source code files.
1115#
1116SRC02 = \
1117 $(TOP)\src\shell.c
1118
1119# Core miscellaneous files.
1120#
1121SRC03 = \
1122 $(TOP)\src\parse.y
1123
1124# Core header files, part 1.
1125#
1126SRC04 = \
1127 $(TOP)\src\btree.h \
1128 $(TOP)\src\btreeInt.h \
1129 $(TOP)\src\hash.h \
1130 $(TOP)\src\hwtime.h \
1131 $(TOP)\src\msvc.h \
1132 $(TOP)\src\mutex.h \
1133 $(TOP)\src\os.h \
1134 $(TOP)\src\os_common.h \
1135 $(TOP)\src\os_setup.h \
1136 $(TOP)\src\os_win.h
1137
1138# Core header files, part 2.
1139#
1140SRC05 = \
1141 $(TOP)\src\pager.h \
1142 $(TOP)\src\pcache.h \
1143 $(TOP)\src\pragma.h \
1144 $(TOP)\src\sqlite.h.in \
1145 $(TOP)\src\sqlite3ext.h \
1146 $(TOP)\src\sqliteInt.h \
1147 $(TOP)\src\sqliteLimit.h \
1148 $(TOP)\src\vdbe.h \
1149 $(TOP)\src\vdbeInt.h \
1150 $(TOP)\src\vxworks.h \
1151 $(TOP)\src\wal.h \
drhe54df422013-11-12 18:37:25 +00001152 $(TOP)\src\whereInt.h
shanehb2f20bf2011-06-17 07:07:24 +00001153
mistachkinc04c54b2016-02-11 21:28:16 +00001154# Extension source code files, part 1.
shanehb2f20bf2011-06-17 07:07:24 +00001155#
mistachkinc04c54b2016-02-11 21:28:16 +00001156SRC06 = \
shanehb2f20bf2011-06-17 07:07:24 +00001157 $(TOP)\ext\fts1\fts1.c \
shanehb2f20bf2011-06-17 07:07:24 +00001158 $(TOP)\ext\fts1\fts1_hash.c \
shanehb2f20bf2011-06-17 07:07:24 +00001159 $(TOP)\ext\fts1\fts1_porter.c \
drh62679202015-01-29 18:38:05 +00001160 $(TOP)\ext\fts1\fts1_tokenizer1.c \
shanehb2f20bf2011-06-17 07:07:24 +00001161 $(TOP)\ext\fts2\fts2.c \
shanehb2f20bf2011-06-17 07:07:24 +00001162 $(TOP)\ext\fts2\fts2_hash.c \
shanehb2f20bf2011-06-17 07:07:24 +00001163 $(TOP)\ext\fts2\fts2_icu.c \
1164 $(TOP)\ext\fts2\fts2_porter.c \
shanehb2f20bf2011-06-17 07:07:24 +00001165 $(TOP)\ext\fts2\fts2_tokenizer.c \
1166 $(TOP)\ext\fts2\fts2_tokenizer1.c
mistachkinc04c54b2016-02-11 21:28:16 +00001167
1168# Extension source code files, part 2.
1169#
1170SRC07 = \
shanehb2f20bf2011-06-17 07:07:24 +00001171 $(TOP)\ext\fts3\fts3.c \
shanehb2f20bf2011-06-17 07:07:24 +00001172 $(TOP)\ext\fts3\fts3_aux.c \
1173 $(TOP)\ext\fts3\fts3_expr.c \
1174 $(TOP)\ext\fts3\fts3_hash.c \
shanehb2f20bf2011-06-17 07:07:24 +00001175 $(TOP)\ext\fts3\fts3_icu.c \
1176 $(TOP)\ext\fts3\fts3_porter.c \
1177 $(TOP)\ext\fts3\fts3_snippet.c \
shanehb2f20bf2011-06-17 07:07:24 +00001178 $(TOP)\ext\fts3\fts3_tokenizer.c \
1179 $(TOP)\ext\fts3\fts3_tokenizer1.c \
drh4d648c72013-04-22 17:07:56 +00001180 $(TOP)\ext\fts3\fts3_tokenize_vtab.c \
drh391d4ba2012-05-28 20:22:16 +00001181 $(TOP)\ext\fts3\fts3_unicode.c \
1182 $(TOP)\ext\fts3\fts3_unicode2.c \
drh62679202015-01-29 18:38:05 +00001183 $(TOP)\ext\fts3\fts3_write.c \
drh62679202015-01-29 18:38:05 +00001184 $(TOP)\ext\icu\icu.c \
drhedea9112015-03-24 19:02:13 +00001185 $(TOP)\ext\rtree\rtree.c \
drhdbbd8162015-05-19 23:04:26 +00001186 $(TOP)\ext\session\sqlite3session.c \
drh50065652015-10-08 19:29:18 +00001187 $(TOP)\ext\rbu\sqlite3rbu.c \
1188 $(TOP)\ext\misc\json1.c
shanehb2f20bf2011-06-17 07:07:24 +00001189
mistachkinc04c54b2016-02-11 21:28:16 +00001190# Extension header files, part 1.
1191#
1192SRC08 = \
1193 $(TOP)\ext\fts1\fts1.h \
1194 $(TOP)\ext\fts1\fts1_hash.h \
1195 $(TOP)\ext\fts1\fts1_tokenizer.h \
1196 $(TOP)\ext\fts2\fts2.h \
1197 $(TOP)\ext\fts2\fts2_hash.h \
1198 $(TOP)\ext\fts2\fts2_tokenizer.h
1199
1200# Extension header files, part 2.
1201#
1202SRC09 = \
1203 $(TOP)\ext\fts3\fts3.h \
1204 $(TOP)\ext\fts3\fts3Int.h \
1205 $(TOP)\ext\fts3\fts3_hash.h \
1206 $(TOP)\ext\fts3\fts3_tokenizer.h \
1207 $(TOP)\ext\icu\sqliteicu.h \
1208 $(TOP)\ext\rtree\rtree.h \
mistachkin05004782016-03-30 16:23:06 +00001209 $(TOP)\ext\rbu\sqlite3rbu.h \
1210 $(TOP)\ext\session\sqlite3session.h
shanehb2f20bf2011-06-17 07:07:24 +00001211
1212# Generated source code files
1213#
mistachkinc04c54b2016-02-11 21:28:16 +00001214SRC10 = \
shanehb2f20bf2011-06-17 07:07:24 +00001215 opcodes.c \
mistachkinc04c54b2016-02-11 21:28:16 +00001216 parse.c
1217
1218# Generated header files
1219#
1220SRC11 = \
1221 keywordhash.h \
shanehb2f20bf2011-06-17 07:07:24 +00001222 opcodes.h \
shanehb2f20bf2011-06-17 07:07:24 +00001223 parse.h \
mistachkin5d4d9412016-01-22 03:54:36 +00001224 $(SQLITE3H)
shanehb2f20bf2011-06-17 07:07:24 +00001225
drh62679202015-01-29 18:38:05 +00001226# All source code files.
1227#
mistachkinc04c54b2016-02-11 21:28:16 +00001228SRC = $(SRC00) $(SRC01) $(SRC02) $(SRC03) $(SRC04) $(SRC05) $(SRC06) $(SRC07) $(SRC08) $(SRC09) $(SRC10) $(SRC11)
drh62679202015-01-29 18:38:05 +00001229
shanehb2f20bf2011-06-17 07:07:24 +00001230# Source code to the test files.
1231#
1232TESTSRC = \
1233 $(TOP)\src\test1.c \
1234 $(TOP)\src\test2.c \
1235 $(TOP)\src\test3.c \
1236 $(TOP)\src\test4.c \
1237 $(TOP)\src\test5.c \
1238 $(TOP)\src\test6.c \
1239 $(TOP)\src\test7.c \
1240 $(TOP)\src\test8.c \
1241 $(TOP)\src\test9.c \
1242 $(TOP)\src\test_autoext.c \
1243 $(TOP)\src\test_async.c \
1244 $(TOP)\src\test_backup.c \
drhddebf162016-03-04 02:59:35 +00001245 $(TOP)\src\test_bestindex.c \
drh5de7d962014-12-05 00:17:39 +00001246 $(TOP)\src\test_blob.c \
shanehb2f20bf2011-06-17 07:07:24 +00001247 $(TOP)\src\test_btree.c \
1248 $(TOP)\src\test_config.c \
1249 $(TOP)\src\test_demovfs.c \
1250 $(TOP)\src\test_devsym.c \
mistachkin413c63b2013-01-17 03:18:14 +00001251 $(TOP)\src\test_fs.c \
shanehb2f20bf2011-06-17 07:07:24 +00001252 $(TOP)\src\test_func.c \
shanehb2f20bf2011-06-17 07:07:24 +00001253 $(TOP)\src\test_hexio.c \
1254 $(TOP)\src\test_init.c \
1255 $(TOP)\src\test_intarray.c \
1256 $(TOP)\src\test_journal.c \
1257 $(TOP)\src\test_malloc.c \
1258 $(TOP)\src\test_multiplex.c \
1259 $(TOP)\src\test_mutex.c \
1260 $(TOP)\src\test_onefile.c \
1261 $(TOP)\src\test_osinst.c \
1262 $(TOP)\src\test_pcache.c \
1263 $(TOP)\src\test_quota.c \
1264 $(TOP)\src\test_rtree.c \
1265 $(TOP)\src\test_schema.c \
1266 $(TOP)\src\test_server.c \
1267 $(TOP)\src\test_superlock.c \
1268 $(TOP)\src\test_syscall.c \
shanehb2f20bf2011-06-17 07:07:24 +00001269 $(TOP)\src\test_tclvar.c \
1270 $(TOP)\src\test_thread.c \
1271 $(TOP)\src\test_vfs.c \
mistachkin92af1eb2015-11-30 23:29:07 +00001272 $(TOP)\src\test_windirent.c \
shanehb2f20bf2011-06-17 07:07:24 +00001273 $(TOP)\src\test_wsd.c \
1274 $(TOP)\ext\fts3\fts3_term.c \
mistachkinadb96a62012-01-16 12:33:36 +00001275 $(TOP)\ext\fts3\fts3_test.c \
mistachkin05004782016-03-30 16:23:06 +00001276 $(TOP)\ext\rbu\test_rbu.c \
1277 $(TOP)\ext\session\test_session.c
shanehb2f20bf2011-06-17 07:07:24 +00001278
mistachkinc04c54b2016-02-11 21:28:16 +00001279# Statically linked extensions.
drhe50db1c2013-04-25 14:31:46 +00001280#
drh1fb64af2013-04-25 14:36:28 +00001281TESTEXT = \
drh8416fc72013-04-25 16:42:55 +00001282 $(TOP)\ext\misc\amatch.c \
1283 $(TOP)\ext\misc\closure.c \
drh1728bcb2014-11-10 16:49:56 +00001284 $(TOP)\ext\misc\eval.c \
drh51ed2982014-06-16 12:44:32 +00001285 $(TOP)\ext\misc\fileio.c \
drhe50db1c2013-04-25 14:31:46 +00001286 $(TOP)\ext\misc\fuzzer.c \
mistachkined52f9f2015-06-26 04:34:36 +00001287 $(TOP)\ext\fts5\fts5_tcl.c \
dand3789c02015-08-04 20:29:00 +00001288 $(TOP)\ext\fts5\fts5_test_mi.c \
dan2cfe0492016-01-14 20:05:59 +00001289 $(TOP)\ext\fts5\fts5_test_tok.c \
drh8416fc72013-04-25 16:42:55 +00001290 $(TOP)\ext\misc\ieee754.c \
drhea41dc42013-04-25 19:31:33 +00001291 $(TOP)\ext\misc\nextchar.c \
drhdef33672013-05-28 20:25:54 +00001292 $(TOP)\ext\misc\percentile.c \
drhe50db1c2013-04-25 14:31:46 +00001293 $(TOP)\ext\misc\regexp.c \
drh398f8722015-08-19 13:54:20 +00001294 $(TOP)\ext\misc\series.c \
drhb7045ab2013-04-25 14:59:01 +00001295 $(TOP)\ext\misc\spellfix.c \
drh5f8cdac2013-10-14 21:14:42 +00001296 $(TOP)\ext\misc\totype.c \
drhe50db1c2013-04-25 14:31:46 +00001297 $(TOP)\ext\misc\wholenumber.c
1298
shanehb2f20bf2011-06-17 07:07:24 +00001299# Source code to the library files needed by the test fixture
mistachkinadb96a62012-01-16 12:33:36 +00001300# (non-amalgamation)
shanehb2f20bf2011-06-17 07:07:24 +00001301#
1302TESTSRC2 = \
mistachkinc04c54b2016-02-11 21:28:16 +00001303 $(SRC00) \
1304 $(SRC01) \
1305 $(SRC06) \
1306 $(SRC07) \
1307 $(SRC10) \
mistachkin05004782016-03-30 16:23:06 +00001308 $(TOP)\ext\async\sqlite3async.c
shanehb2f20bf2011-06-17 07:07:24 +00001309
1310# Header files used by all library source files.
1311#
1312HDR = \
1313 $(TOP)\src\btree.h \
1314 $(TOP)\src\btreeInt.h \
1315 $(TOP)\src\hash.h \
1316 $(TOP)\src\hwtime.h \
1317 keywordhash.h \
mistachkin2318d332015-01-12 18:02:52 +00001318 $(TOP)\src\msvc.h \
shanehb2f20bf2011-06-17 07:07:24 +00001319 $(TOP)\src\mutex.h \
1320 opcodes.h \
1321 $(TOP)\src\os.h \
1322 $(TOP)\src\os_common.h \
mistachkinf74b9e02013-11-26 01:00:31 +00001323 $(TOP)\src\os_setup.h \
mistachkin8bc52622013-11-25 09:36:07 +00001324 $(TOP)\src\os_win.h \
shanehb2f20bf2011-06-17 07:07:24 +00001325 $(TOP)\src\pager.h \
1326 $(TOP)\src\pcache.h \
shaneh6e7850c2011-06-17 15:57:07 +00001327 parse.h \
drh67e65e52015-02-02 21:34:54 +00001328 $(TOP)\src\pragma.h \
mistachkin5d4d9412016-01-22 03:54:36 +00001329 $(SQLITE3H) \
shanehb2f20bf2011-06-17 07:07:24 +00001330 $(TOP)\src\sqlite3ext.h \
shaneh6e7850c2011-06-17 15:57:07 +00001331 $(TOP)\src\sqliteInt.h \
shanehb2f20bf2011-06-17 07:07:24 +00001332 $(TOP)\src\sqliteLimit.h \
1333 $(TOP)\src\vdbe.h \
drhe54df422013-11-12 18:37:25 +00001334 $(TOP)\src\vdbeInt.h \
drh8cd5b252015-03-02 22:06:43 +00001335 $(TOP)\src\vxworks.h \
drhe54df422013-11-12 18:37:25 +00001336 $(TOP)\src\whereInt.h
shanehb2f20bf2011-06-17 07:07:24 +00001337
1338# Header files used by extensions
1339#
1340EXTHDR = $(EXTHDR) \
1341 $(TOP)\ext\fts1\fts1.h \
1342 $(TOP)\ext\fts1\fts1_hash.h \
1343 $(TOP)\ext\fts1\fts1_tokenizer.h
1344EXTHDR = $(EXTHDR) \
1345 $(TOP)\ext\fts2\fts2.h \
1346 $(TOP)\ext\fts2\fts2_hash.h \
1347 $(TOP)\ext\fts2\fts2_tokenizer.h
1348EXTHDR = $(EXTHDR) \
1349 $(TOP)\ext\fts3\fts3.h \
1350 $(TOP)\ext\fts3\fts3Int.h \
1351 $(TOP)\ext\fts3\fts3_hash.h \
1352 $(TOP)\ext\fts3\fts3_tokenizer.h
1353EXTHDR = $(EXTHDR) \
1354 $(TOP)\ext\rtree\rtree.h
1355EXTHDR = $(EXTHDR) \
1356 $(TOP)\ext\icu\sqliteicu.h
1357EXTHDR = $(EXTHDR) \
1358 $(TOP)\ext\rtree\sqlite3rtree.h
mistachkinadb96a62012-01-16 12:33:36 +00001359EXTHDR = $(EXTHDR) \
1360 $(TOP)\ext\session\sqlite3session.h
shanehb2f20bf2011-06-17 07:07:24 +00001361
mistachkind4ab1032015-05-11 16:27:33 +00001362# executables needed for testing
drhf4375442015-05-11 12:15:45 +00001363#
1364TESTPROGS = \
1365 testfixture.exe \
mistachkinedcb4eb2016-01-22 01:25:15 +00001366 $(SQLITE3EXE) \
drhf4375442015-05-11 12:15:45 +00001367 sqlite3_analyzer.exe \
1368 sqldiff.exe
1369
drhea93c702015-05-26 18:15:08 +00001370# Databases containing fuzzer test cases
1371#
1372FUZZDATA = \
1373 $(TOP)\test\fuzzdata1.db \
1374 $(TOP)\test\fuzzdata2.db \
drh64ff56f2015-09-23 11:59:50 +00001375 $(TOP)\test\fuzzdata3.db \
1376 $(TOP)\test\fuzzdata4.db
mistachkin3e786092016-01-23 07:53:04 +00001377# <</mark>>
drhea93c702015-05-26 18:15:08 +00001378
mistachkin5d4d9412016-01-22 03:54:36 +00001379# Additional compiler options for the shell. These are only effective
1380# when the shell is not being dynamically linked.
drhd7f2bea2015-09-19 14:32:51 +00001381#
mistachkin5d4d9412016-01-22 03:54:36 +00001382!IF $(DYNAMIC_SHELL)==0 && $(FOR_WIN10)==0
drh74cf74a2016-02-09 17:12:22 +00001383SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_SHELL_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS
mistachkinedcb4eb2016-01-22 01:25:15 +00001384!ENDIF
1385
mistachkin3e786092016-01-23 07:53:04 +00001386# <<mark>>
mistachkin5d4d9412016-01-22 03:54:36 +00001387# Extra compiler options for various test tools.
1388#
1389MPTESTER_COMPILE_OPTS = -DSQLITE_SHELL_JSON1 -DSQLITE_ENABLE_FTS5
mistachkin8381be42015-10-09 14:23:56 +00001390FUZZERSHELL_COMPILE_OPTS = -DSQLITE_ENABLE_JSON1
drh9d4c9822016-01-05 03:39:52 +00001391FUZZCHECK_COMPILE_OPTS = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMSYS5
drhf4375442015-05-11 12:15:45 +00001392
mistachkin5d4d9412016-01-22 03:54:36 +00001393# Standard options to testfixture.
drh905da632015-06-10 18:53:09 +00001394#
1395TESTOPTS = --verbose=file --output=test-out.txt
drhf4375442015-05-11 12:15:45 +00001396
mistachkind5be6f02016-01-27 07:28:33 +00001397# Extra targets for the "all" target that require Tcl.
1398#
1399!IF $(NO_TCL)==0
1400ALL_TCL_TARGETS = libtclsqlite3.lib
1401!ELSE
1402ALL_TCL_TARGETS =
1403!ENDIF
mistachkin3e786092016-01-23 07:53:04 +00001404# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001405
1406# This is the default Makefile target. The objects listed here
1407# are what get build when you type just "make" with no arguments.
1408#
mistachkind5be6f02016-01-27 07:28:33 +00001409all: dll libsqlite3.lib shell $(ALL_TCL_TARGETS)
shanehb2f20bf2011-06-17 07:07:24 +00001410
mistachkina8a18732016-01-22 22:16:50 +00001411# Dynamic link library section.
1412#
mistachkin9b88ace2016-02-26 21:01:37 +00001413dll: $(SQLITE3DLL)
mistachkina8a18732016-01-22 22:16:50 +00001414
1415# Shell executable.
1416#
mistachkin9b88ace2016-02-26 21:01:37 +00001417shell: $(SQLITE3EXE)
shanehb2f20bf2011-06-17 07:07:24 +00001418
mistachkinb0c99af2016-02-19 05:07:56 +00001419# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001420libsqlite3.lib: $(LIBOBJ)
shaneh29ebea82011-06-21 18:12:07 +00001421 $(LTLIB) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001422
1423libtclsqlite3.lib: tclsqlite.lo libsqlite3.lib
mistachkin5b663502015-10-10 23:39:55 +00001424 $(LTLIB) $(LTLIBOPTS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCLSTUB) $(TLIBS)
mistachkin3e786092016-01-23 07:53:04 +00001425# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001426
mistachkin9b88ace2016-02-26 21:01:37 +00001427$(SQLITE3DLL): $(LIBOBJ) $(LIBRESOBJS) $(CORE_LINK_DEP)
mistachkina8a18732016-01-22 22:16:50 +00001428 $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL $(CORE_LINK_OPTS) /OUT:$@ $(LIBOBJ) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001429
mistachkin9aeb9712016-02-26 23:13:16 +00001430# <<block2>>
mistachkin9b88ace2016-02-26 21:01:37 +00001431sqlite3.def: libsqlite3.lib
mistachkina8a18732016-01-22 22:16:50 +00001432 echo EXPORTS > sqlite3.def
1433 dumpbin /all libsqlite3.lib \
mistachkin9b88ace2016-02-26 21:01:37 +00001434 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl include "^\s+1 _?(sqlite3_[^@]*)(?:@\d+)?$$" \1 \
mistachkina8a18732016-01-22 22:16:50 +00001435 | sort >> sqlite3.def
mistachkin9aeb9712016-02-26 23:13:16 +00001436# <</block2>>
drhd62c0f42015-04-09 13:34:29 +00001437
mistachkin5d4d9412016-01-22 03:54:36 +00001438$(SQLITE3EXE): $(TOP)\src\shell.c $(SHELL_CORE_DEP) $(LIBRESOBJS) $(SHELL_CORE_SRC) $(SQLITE3H)
1439 $(LTLINK) $(SHELL_COMPILE_OPTS) $(READLINE_FLAGS) $(TOP)\src\shell.c $(SHELL_CORE_SRC) \
mistachkinedcb4eb2016-01-22 01:25:15 +00001440 /link $(SQLITE3EXEPDB) $(LDFLAGS) $(LTLINKOPTS) $(SHELL_LINK_OPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS)
drh268e72f2015-04-17 14:30:49 +00001441
mistachkin3e786092016-01-23 07:53:04 +00001442# <<mark>>
mistachkin5d4d9412016-01-22 03:54:36 +00001443sqldiff.exe: $(TOP)\tool\sqldiff.c $(SQLITE3C) $(SQLITE3H)
1444 $(LTLINK) $(NO_WARN) $(TOP)\tool\sqldiff.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
mistachkin44723ce2015-03-21 02:22:37 +00001445
drhfd0d93f2016-02-07 00:08:08 +00001446srcck1.exe: $(TOP)\tool\srcck1.c
1447 $(BCC) $(NO_WARN) -Fe$@ $(TOP)\tool\srcck1.c
1448
1449sourcetest: srcck1.exe sqlite3.c
1450 srcck1.exe sqlite3.c
1451
mistachkin5d4d9412016-01-22 03:54:36 +00001452fuzzershell.exe: $(TOP)\tool\fuzzershell.c $(SQLITE3C) $(SQLITE3H)
1453 $(LTLINK) $(NO_WARN) $(FUZZERSHELL_COMPILE_OPTS) $(TOP)\tool\fuzzershell.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drhbc94dbb2013-04-08 14:28:33 +00001454
mistachkin5d4d9412016-01-22 03:54:36 +00001455fuzzcheck.exe: $(TOP)\test\fuzzcheck.c $(SQLITE3C) $(SQLITE3H)
1456 $(LTLINK) $(NO_WARN) $(FUZZCHECK_COMPILE_OPTS) $(TOP)\test\fuzzcheck.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh1573dc32015-05-25 22:29:26 +00001457
mistachkin5d4d9412016-01-22 03:54:36 +00001458mptester.exe: $(TOP)\mptest\mptest.c $(SQLITE3C) $(SQLITE3H)
1459 $(LTLINK) $(NO_WARN) $(MPTESTER_COMPILE_OPTS) $(TOP)\mptest\mptest.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drhbc94dbb2013-04-08 14:28:33 +00001460
mistachkineb48b062015-03-31 17:45:44 +00001461MPTEST1 = mptester mptest.db $(TOP)\mptest\crash01.test --repeat 20
1462MPTEST2 = mptester mptest.db $(TOP)\mptest\multiwrite01.test --repeat 20
mistachkin4d2daba2015-03-31 16:42:16 +00001463
drhfe0ba712015-03-31 13:46:13 +00001464mptest: mptester.exe
mistachkin4d2daba2015-03-31 16:42:16 +00001465 del /Q mptest.db 2>NUL
drhfe0ba712015-03-31 13:46:13 +00001466 $(MPTEST1) --journalmode DELETE
1467 $(MPTEST2) --journalmode WAL
1468 $(MPTEST1) --journalmode WAL
1469 $(MPTEST2) --journalmode PERSIST
1470 $(MPTEST1) --journalmode PERSIST
1471 $(MPTEST2) --journalmode TRUNCATE
1472 $(MPTEST1) --journalmode TRUNCATE
1473 $(MPTEST2) --journalmode DELETE
1474
shanehb2f20bf2011-06-17 07:07:24 +00001475# This target creates a directory named "tsrc" and fills it with
1476# copies of all of the C source code and header files needed to
1477# build on the target system. Some of the C source code and header
1478# files are automatically generated. This target takes care of
1479# all that automatic generation.
1480#
drh50065652015-10-08 19:29:18 +00001481.target_source: $(SRC) $(TOP)\tool\vdbe-compress.tcl fts5.c
mistachkin44723ce2015-03-21 02:22:37 +00001482 -rmdir /Q/S tsrc 2>NUL
shanehb2f20bf2011-06-17 07:07:24 +00001483 -mkdir tsrc
mistachkine2eb2592016-02-11 21:38:05 +00001484 for %i in ($(SRC00)) do copy /Y %i tsrc
1485 for %i in ($(SRC01)) do copy /Y %i tsrc
1486 for %i in ($(SRC02)) do copy /Y %i tsrc
1487 for %i in ($(SRC03)) do copy /Y %i tsrc
1488 for %i in ($(SRC04)) do copy /Y %i tsrc
1489 for %i in ($(SRC05)) do copy /Y %i tsrc
1490 for %i in ($(SRC06)) do copy /Y %i tsrc
1491 for %i in ($(SRC07)) do copy /Y %i tsrc
1492 for %i in ($(SRC08)) do copy /Y %i tsrc
1493 for %i in ($(SRC09)) do copy /Y %i tsrc
1494 for %i in ($(SRC10)) do copy /Y %i tsrc
1495 for %i in ($(SRC11)) do copy /Y %i tsrc
drh50065652015-10-08 19:29:18 +00001496 copy /Y fts5.c tsrc
1497 copy /Y fts5.h tsrc
mistachkin44723ce2015-03-21 02:22:37 +00001498 del /Q tsrc\sqlite.h.in tsrc\parse.y 2>NUL
drh2dc06482013-12-11 00:59:10 +00001499 $(TCLSH_CMD) $(TOP)\tool\vdbe-compress.tcl $(OPTS) < tsrc\vdbe.c > vdbe.new
shanehb2f20bf2011-06-17 07:07:24 +00001500 move vdbe.new tsrc\vdbe.c
1501 echo > .target_source
1502
mistachkin357e42d2015-09-21 23:53:42 +00001503sqlite3.c: .target_source sqlite3ext.h $(TOP)\tool\mksqlite3c.tcl
mistachkinb0427512014-01-30 11:12:52 +00001504 $(TCLSH_CMD) $(TOP)\tool\mksqlite3c.tcl $(MKSQLITE3C_ARGS)
drhe191e2c2013-03-19 15:23:18 +00001505 copy tsrc\shell.c .
drhe191e2c2013-03-19 15:23:18 +00001506 copy $(TOP)\ext\session\sqlite3session.h .
shanehb2f20bf2011-06-17 07:07:24 +00001507
mistachkin48dd9de2012-12-06 04:33:13 +00001508sqlite3-all.c: sqlite3.c $(TOP)\tool\split-sqlite3c.tcl
1509 $(TCLSH_CMD) $(TOP)\tool\split-sqlite3c.tcl
mistachkin3e786092016-01-23 07:53:04 +00001510# <</mark>>
mistachkin76510912013-10-11 23:01:18 +00001511
shanehb2f20bf2011-06-17 07:07:24 +00001512# Rule to build the amalgamation
1513#
mistachkin76510912013-10-11 23:01:18 +00001514sqlite3.lo: $(SQLITE3C)
mistachkin44723ce2015-03-21 02:22:37 +00001515 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(SQLITE3C)
shanehb2f20bf2011-06-17 07:07:24 +00001516
mistachkin3e786092016-01-23 07:53:04 +00001517# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001518# Rules to build the LEMON compiler generator
1519#
drh82415f22015-11-09 19:33:42 +00001520lempar.c: $(TOP)\tool\lempar.c
1521 copy $(TOP)\tool\lempar.c .
shanehb2f20bf2011-06-17 07:07:24 +00001522
1523lemon.exe: $(TOP)\tool\lemon.c lempar.c
mistachkin2318d332015-01-12 18:02:52 +00001524 $(BCC) $(NO_WARN) -Daccess=_access \
mistachkin460cd9c2015-10-14 22:46:37 +00001525 -Fe$@ $(TOP)\tool\lemon.c /link $(LDFLAGS) $(NLTLINKOPTS) $(NLTLIBPATHS)
shanehb2f20bf2011-06-17 07:07:24 +00001526
1527# Rules to build individual *.lo files from generated *.c files. This
1528# applies to:
1529#
1530# parse.lo
1531# opcodes.lo
1532#
1533parse.lo: parse.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001534 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c parse.c
shanehb2f20bf2011-06-17 07:07:24 +00001535
1536opcodes.lo: opcodes.c
mistachkin44723ce2015-03-21 02:22:37 +00001537 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c opcodes.c
mistachkin3e786092016-01-23 07:53:04 +00001538# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001539
mistachkin4d9d1f42012-09-03 10:32:32 +00001540# Rule to build the Win32 resources object file.
1541#
mistachkin08c1c312012-10-06 03:48:25 +00001542!IF $(USE_RC)!=0
mistachkin3e786092016-01-23 07:53:04 +00001543# <<block1>>
mistachkina8a18732016-01-22 22:16:50 +00001544$(LIBRESOBJS): $(TOP)\src\sqlite3.rc $(SQLITE3H)
mistachkin4d9d1f42012-09-03 10:32:32 +00001545 echo #ifndef SQLITE_RESOURCE_VERSION > sqlite3rc.h
mistachkin8ccc6d42012-09-27 21:03:53 +00001546 for /F %%V in ('type "$(TOP)\VERSION"') do ( \
mistachkin4d9d1f42012-09-03 10:32:32 +00001547 echo #define SQLITE_RESOURCE_VERSION %%V \
mistachkin946ef602015-10-10 01:55:57 +00001548 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact . ^, >> sqlite3rc.h \
mistachkin4d9d1f42012-09-03 10:32:32 +00001549 )
1550 echo #endif >> sqlite3rc.h
mistachkin08c1c312012-10-06 03:48:25 +00001551 $(LTRCOMPILE) -fo $(LIBRESOBJS) $(TOP)\src\sqlite3.rc
mistachkin3e786092016-01-23 07:53:04 +00001552# <</block1>>
mistachkin08c1c312012-10-06 03:48:25 +00001553!ENDIF
mistachkin4d9d1f42012-09-03 10:32:32 +00001554
mistachkin3e786092016-01-23 07:53:04 +00001555# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001556# Rules to build individual *.lo files from files in the src directory.
1557#
1558alter.lo: $(TOP)\src\alter.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001559 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\alter.c
shanehb2f20bf2011-06-17 07:07:24 +00001560
1561analyze.lo: $(TOP)\src\analyze.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001562 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\analyze.c
shanehb2f20bf2011-06-17 07:07:24 +00001563
1564attach.lo: $(TOP)\src\attach.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001565 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\attach.c
shanehb2f20bf2011-06-17 07:07:24 +00001566
1567auth.lo: $(TOP)\src\auth.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001568 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\auth.c
shanehb2f20bf2011-06-17 07:07:24 +00001569
1570backup.lo: $(TOP)\src\backup.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001571 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\backup.c
shanehb2f20bf2011-06-17 07:07:24 +00001572
1573bitvec.lo: $(TOP)\src\bitvec.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001574 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\bitvec.c
shanehb2f20bf2011-06-17 07:07:24 +00001575
1576btmutex.lo: $(TOP)\src\btmutex.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001577 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\btmutex.c
shanehb2f20bf2011-06-17 07:07:24 +00001578
1579btree.lo: $(TOP)\src\btree.c $(HDR) $(TOP)\src\pager.h
mistachkin44723ce2015-03-21 02:22:37 +00001580 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\btree.c
shanehb2f20bf2011-06-17 07:07:24 +00001581
1582build.lo: $(TOP)\src\build.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001583 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\build.c
shanehb2f20bf2011-06-17 07:07:24 +00001584
1585callback.lo: $(TOP)\src\callback.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001586 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\callback.c
shanehb2f20bf2011-06-17 07:07:24 +00001587
1588complete.lo: $(TOP)\src\complete.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001589 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\complete.c
shanehb2f20bf2011-06-17 07:07:24 +00001590
1591ctime.lo: $(TOP)\src\ctime.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001592 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\ctime.c
shanehb2f20bf2011-06-17 07:07:24 +00001593
1594date.lo: $(TOP)\src\date.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001595 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\date.c
shanehb2f20bf2011-06-17 07:07:24 +00001596
drh1a4a6802015-05-04 18:31:09 +00001597dbstat.lo: $(TOP)\src\date.c $(HDR)
1598 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\dbstat.c
1599
shanehb2f20bf2011-06-17 07:07:24 +00001600delete.lo: $(TOP)\src\delete.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001601 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\delete.c
shanehb2f20bf2011-06-17 07:07:24 +00001602
1603expr.lo: $(TOP)\src\expr.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001604 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\expr.c
shanehb2f20bf2011-06-17 07:07:24 +00001605
1606fault.lo: $(TOP)\src\fault.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001607 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\fault.c
shanehb2f20bf2011-06-17 07:07:24 +00001608
1609fkey.lo: $(TOP)\src\fkey.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001610 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\fkey.c
shanehb2f20bf2011-06-17 07:07:24 +00001611
1612func.lo: $(TOP)\src\func.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001613 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\func.c
shanehb2f20bf2011-06-17 07:07:24 +00001614
1615global.lo: $(TOP)\src\global.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001616 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\global.c
shanehb2f20bf2011-06-17 07:07:24 +00001617
1618hash.lo: $(TOP)\src\hash.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001619 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\hash.c
shanehb2f20bf2011-06-17 07:07:24 +00001620
1621insert.lo: $(TOP)\src\insert.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001622 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\insert.c
shanehb2f20bf2011-06-17 07:07:24 +00001623
shanehb2f20bf2011-06-17 07:07:24 +00001624legacy.lo: $(TOP)\src\legacy.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001625 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\legacy.c
shanehb2f20bf2011-06-17 07:07:24 +00001626
1627loadext.lo: $(TOP)\src\loadext.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001628 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\loadext.c
shanehb2f20bf2011-06-17 07:07:24 +00001629
1630main.lo: $(TOP)\src\main.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001631 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\main.c
shanehb2f20bf2011-06-17 07:07:24 +00001632
1633malloc.lo: $(TOP)\src\malloc.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001634 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\malloc.c
shanehb2f20bf2011-06-17 07:07:24 +00001635
1636mem0.lo: $(TOP)\src\mem0.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001637 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem0.c
shanehb2f20bf2011-06-17 07:07:24 +00001638
1639mem1.lo: $(TOP)\src\mem1.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001640 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem1.c
shanehb2f20bf2011-06-17 07:07:24 +00001641
1642mem2.lo: $(TOP)\src\mem2.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001643 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem2.c
shanehb2f20bf2011-06-17 07:07:24 +00001644
1645mem3.lo: $(TOP)\src\mem3.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001646 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem3.c
shanehb2f20bf2011-06-17 07:07:24 +00001647
1648mem5.lo: $(TOP)\src\mem5.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001649 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem5.c
shanehb2f20bf2011-06-17 07:07:24 +00001650
1651memjournal.lo: $(TOP)\src\memjournal.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001652 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\memjournal.c
shanehb2f20bf2011-06-17 07:07:24 +00001653
1654mutex.lo: $(TOP)\src\mutex.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001655 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex.c
shanehb2f20bf2011-06-17 07:07:24 +00001656
1657mutex_noop.lo: $(TOP)\src\mutex_noop.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001658 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex_noop.c
shanehb2f20bf2011-06-17 07:07:24 +00001659
shanehb2f20bf2011-06-17 07:07:24 +00001660mutex_unix.lo: $(TOP)\src\mutex_unix.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001661 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex_unix.c
shanehb2f20bf2011-06-17 07:07:24 +00001662
1663mutex_w32.lo: $(TOP)\src\mutex_w32.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001664 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex_w32.c
shanehb2f20bf2011-06-17 07:07:24 +00001665
1666notify.lo: $(TOP)\src\notify.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001667 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\notify.c
shanehb2f20bf2011-06-17 07:07:24 +00001668
1669pager.lo: $(TOP)\src\pager.c $(HDR) $(TOP)\src\pager.h
mistachkin44723ce2015-03-21 02:22:37 +00001670 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pager.c
shanehb2f20bf2011-06-17 07:07:24 +00001671
1672pcache.lo: $(TOP)\src\pcache.c $(HDR) $(TOP)\src\pcache.h
mistachkin44723ce2015-03-21 02:22:37 +00001673 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pcache.c
shanehb2f20bf2011-06-17 07:07:24 +00001674
1675pcache1.lo: $(TOP)\src\pcache1.c $(HDR) $(TOP)\src\pcache.h
mistachkin44723ce2015-03-21 02:22:37 +00001676 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pcache1.c
shanehb2f20bf2011-06-17 07:07:24 +00001677
1678os.lo: $(TOP)\src\os.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001679 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\os.c
shanehb2f20bf2011-06-17 07:07:24 +00001680
1681os_unix.lo: $(TOP)\src\os_unix.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001682 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\os_unix.c
shanehb2f20bf2011-06-17 07:07:24 +00001683
1684os_win.lo: $(TOP)\src\os_win.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001685 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\os_win.c
shanehb2f20bf2011-06-17 07:07:24 +00001686
shanehb2f20bf2011-06-17 07:07:24 +00001687pragma.lo: $(TOP)\src\pragma.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001688 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pragma.c
shanehb2f20bf2011-06-17 07:07:24 +00001689
1690prepare.lo: $(TOP)\src\prepare.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001691 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\prepare.c
shanehb2f20bf2011-06-17 07:07:24 +00001692
1693printf.lo: $(TOP)\src\printf.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001694 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\printf.c
shanehb2f20bf2011-06-17 07:07:24 +00001695
1696random.lo: $(TOP)\src\random.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001697 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\random.c
shanehb2f20bf2011-06-17 07:07:24 +00001698
1699resolve.lo: $(TOP)\src\resolve.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001700 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\resolve.c
shanehb2f20bf2011-06-17 07:07:24 +00001701
1702rowset.lo: $(TOP)\src\rowset.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001703 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\rowset.c
shanehb2f20bf2011-06-17 07:07:24 +00001704
1705select.lo: $(TOP)\src\select.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001706 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\select.c
shanehb2f20bf2011-06-17 07:07:24 +00001707
1708status.lo: $(TOP)\src\status.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001709 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\status.c
shanehb2f20bf2011-06-17 07:07:24 +00001710
1711table.lo: $(TOP)\src\table.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001712 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\table.c
shanehb2f20bf2011-06-17 07:07:24 +00001713
drhf51446a2012-07-21 19:40:42 +00001714threads.lo: $(TOP)\src\threads.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001715 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\threads.c
drhf51446a2012-07-21 19:40:42 +00001716
shanehb2f20bf2011-06-17 07:07:24 +00001717tokenize.lo: $(TOP)\src\tokenize.c keywordhash.h $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001718 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\tokenize.c
shanehb2f20bf2011-06-17 07:07:24 +00001719
drh38b41492015-06-08 15:08:15 +00001720treeview.lo: $(TOP)\src\treeview.c $(HDR)
1721 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\treeview.c
1722
shanehb2f20bf2011-06-17 07:07:24 +00001723trigger.lo: $(TOP)\src\trigger.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001724 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\trigger.c
shanehb2f20bf2011-06-17 07:07:24 +00001725
1726update.lo: $(TOP)\src\update.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001727 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\update.c
shanehb2f20bf2011-06-17 07:07:24 +00001728
1729utf.lo: $(TOP)\src\utf.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001730 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\utf.c
shanehb2f20bf2011-06-17 07:07:24 +00001731
1732util.lo: $(TOP)\src\util.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001733 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\util.c
shanehb2f20bf2011-06-17 07:07:24 +00001734
1735vacuum.lo: $(TOP)\src\vacuum.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001736 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vacuum.c
shanehb2f20bf2011-06-17 07:07:24 +00001737
1738vdbe.lo: $(TOP)\src\vdbe.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001739 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbe.c
shanehb2f20bf2011-06-17 07:07:24 +00001740
1741vdbeapi.lo: $(TOP)\src\vdbeapi.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001742 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbeapi.c
shanehb2f20bf2011-06-17 07:07:24 +00001743
1744vdbeaux.lo: $(TOP)\src\vdbeaux.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001745 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbeaux.c
shanehb2f20bf2011-06-17 07:07:24 +00001746
1747vdbeblob.lo: $(TOP)\src\vdbeblob.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001748 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbeblob.c
shanehb2f20bf2011-06-17 07:07:24 +00001749
1750vdbemem.lo: $(TOP)\src\vdbemem.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001751 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbemem.c
shanehb2f20bf2011-06-17 07:07:24 +00001752
mistachkin81c428a2011-08-17 02:19:54 +00001753vdbesort.lo: $(TOP)\src\vdbesort.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001754 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbesort.c
mistachkin81c428a2011-08-17 02:19:54 +00001755
shanehb2f20bf2011-06-17 07:07:24 +00001756vdbetrace.lo: $(TOP)\src\vdbetrace.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001757 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbetrace.c
shanehb2f20bf2011-06-17 07:07:24 +00001758
1759vtab.lo: $(TOP)\src\vtab.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001760 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vtab.c
shanehb2f20bf2011-06-17 07:07:24 +00001761
1762wal.lo: $(TOP)\src\wal.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001763 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\wal.c
shanehb2f20bf2011-06-17 07:07:24 +00001764
1765walker.lo: $(TOP)\src\walker.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001766 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\walker.c
shanehb2f20bf2011-06-17 07:07:24 +00001767
1768where.lo: $(TOP)\src\where.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001769 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\where.c
shanehb2f20bf2011-06-17 07:07:24 +00001770
drh6f82e852015-06-06 20:12:09 +00001771wherecode.lo: $(TOP)\src\wherecode.c $(HDR)
1772 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\wherecode.c
1773
drh6c1f4ef2015-06-08 14:23:15 +00001774whereexpr.lo: $(TOP)\src\whereexpr.c $(HDR)
1775 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\whereexpr.c
1776
shanehb2f20bf2011-06-17 07:07:24 +00001777tclsqlite.lo: $(TOP)\src\tclsqlite.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001778 $(LTCOMPILE) $(NO_WARN) -DUSE_TCL_STUBS=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c
shanehb2f20bf2011-06-17 07:07:24 +00001779
1780tclsqlite-shell.lo: $(TOP)\src\tclsqlite.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001781 $(LTCOMPILE) $(NO_WARN) -DTCLSH=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c
shanehb2f20bf2011-06-17 07:07:24 +00001782
mistachkin5d4d9412016-01-22 03:54:36 +00001783tclsqlite3.exe: tclsqlite-shell.lo $(SQLITE3C) $(SQLITE3H) $(LIBRESOBJS)
mistachkin78e3f612015-10-14 20:01:12 +00001784 $(LTLINK) $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /OUT:$@ tclsqlite-shell.lo $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001785
1786# Rules to build opcodes.c and opcodes.h
1787#
drh7651e0a2015-10-07 12:11:36 +00001788opcodes.c: opcodes.h $(TOP)\tool\mkopcodec.tcl
1789 $(TCLSH_CMD) $(TOP)\tool\mkopcodec.tcl opcodes.h > opcodes.c
shanehb2f20bf2011-06-17 07:07:24 +00001790
drhb15393b2015-10-07 02:52:09 +00001791opcodes.h: parse.h $(TOP)\src\vdbe.c $(TOP)\tool\mkopcodeh.tcl
mistachkin946ef602015-10-10 01:55:57 +00001792 type parse.h $(TOP)\src\vdbe.c | $(TCLSH_CMD) $(TOP)\tool\mkopcodeh.tcl > opcodes.h
shanehb2f20bf2011-06-17 07:07:24 +00001793
1794# Rules to build parse.c and parse.h - the outputs of lemon.
1795#
1796parse.h: parse.c
1797
drh60a15a42015-10-07 12:21:14 +00001798parse.c: $(TOP)\src\parse.y lemon.exe $(TOP)\tool\addopcodes.tcl
mistachkin44723ce2015-03-21 02:22:37 +00001799 del /Q parse.y parse.h parse.h.temp 2>NUL
shanehb2f20bf2011-06-17 07:07:24 +00001800 copy $(TOP)\src\parse.y .
mistachkinedcb4eb2016-01-22 01:25:15 +00001801 .\lemon.exe $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) $(OPTS) parse.y
shanehb2f20bf2011-06-17 07:07:24 +00001802 move parse.h parse.h.temp
drh60a15a42015-10-07 12:21:14 +00001803 $(TCLSH_CMD) $(TOP)\tool\addopcodes.tcl parse.h.temp > parse.h
shanehb2f20bf2011-06-17 07:07:24 +00001804
mistachkin5d4d9412016-01-22 03:54:36 +00001805$(SQLITE3H): $(TOP)\src\sqlite.h.in $(TOP)\manifest.uuid $(TOP)\VERSION
1806 $(TCLSH_CMD) $(TOP)\tool\mksqlite3h.tcl $(TOP:\=/) > $(SQLITE3H)
shanehb2f20bf2011-06-17 07:07:24 +00001807
mistachkin9b88ace2016-02-26 21:01:37 +00001808sqlite3ext.h: .target_source
mistachkinc978f2d2015-09-21 23:49:35 +00001809 copy tsrc\sqlite3ext.h .
1810
shanehb2f20bf2011-06-17 07:07:24 +00001811mkkeywordhash.exe: $(TOP)\tool\mkkeywordhash.c
mistachkinedcb4eb2016-01-22 01:25:15 +00001812 $(BCC) $(NO_WARN) -Fe$@ $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) $(OPTS) \
mistachkin460cd9c2015-10-14 22:46:37 +00001813 $(TOP)\tool\mkkeywordhash.c /link $(LDFLAGS) $(NLTLINKOPTS) $(NLTLIBPATHS)
shanehb2f20bf2011-06-17 07:07:24 +00001814
1815keywordhash.h: $(TOP)\tool\mkkeywordhash.c mkkeywordhash.exe
mistachkin5b0b6fd2011-06-25 01:14:36 +00001816 .\mkkeywordhash.exe > keywordhash.h
shanehb2f20bf2011-06-17 07:07:24 +00001817
1818
1819
1820# Rules to build the extension objects.
1821#
1822icu.lo: $(TOP)\ext\icu\icu.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001823 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\icu\icu.c
shanehb2f20bf2011-06-17 07:07:24 +00001824
1825fts2.lo: $(TOP)\ext\fts2\fts2.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001826 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2.c
shanehb2f20bf2011-06-17 07:07:24 +00001827
1828fts2_hash.lo: $(TOP)\ext\fts2\fts2_hash.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001829 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_hash.c
shanehb2f20bf2011-06-17 07:07:24 +00001830
1831fts2_icu.lo: $(TOP)\ext\fts2\fts2_icu.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001832 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_icu.c
shanehb2f20bf2011-06-17 07:07:24 +00001833
1834fts2_porter.lo: $(TOP)\ext\fts2\fts2_porter.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001835 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_porter.c
shanehb2f20bf2011-06-17 07:07:24 +00001836
1837fts2_tokenizer.lo: $(TOP)\ext\fts2\fts2_tokenizer.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001838 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_tokenizer.c
shanehb2f20bf2011-06-17 07:07:24 +00001839
1840fts2_tokenizer1.lo: $(TOP)\ext\fts2\fts2_tokenizer1.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001841 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_tokenizer1.c
shanehb2f20bf2011-06-17 07:07:24 +00001842
1843fts3.lo: $(TOP)\ext\fts3\fts3.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001844 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3.c
shanehb2f20bf2011-06-17 07:07:24 +00001845
1846fts3_aux.lo: $(TOP)\ext\fts3\fts3_aux.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001847 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_aux.c
shanehb2f20bf2011-06-17 07:07:24 +00001848
1849fts3_expr.lo: $(TOP)\ext\fts3\fts3_expr.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001850 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_expr.c
shanehb2f20bf2011-06-17 07:07:24 +00001851
1852fts3_hash.lo: $(TOP)\ext\fts3\fts3_hash.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001853 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_hash.c
shanehb2f20bf2011-06-17 07:07:24 +00001854
1855fts3_icu.lo: $(TOP)\ext\fts3\fts3_icu.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001856 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_icu.c
shanehb2f20bf2011-06-17 07:07:24 +00001857
1858fts3_snippet.lo: $(TOP)\ext\fts3\fts3_snippet.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001859 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_snippet.c
shanehb2f20bf2011-06-17 07:07:24 +00001860
1861fts3_porter.lo: $(TOP)\ext\fts3\fts3_porter.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001862 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_porter.c
shanehb2f20bf2011-06-17 07:07:24 +00001863
1864fts3_tokenizer.lo: $(TOP)\ext\fts3\fts3_tokenizer.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001865 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenizer.c
shanehb2f20bf2011-06-17 07:07:24 +00001866
1867fts3_tokenizer1.lo: $(TOP)\ext\fts3\fts3_tokenizer1.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001868 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenizer1.c
shanehb2f20bf2011-06-17 07:07:24 +00001869
drh4d648c72013-04-22 17:07:56 +00001870fts3_tokenize_vtab.lo: $(TOP)\ext\fts3\fts3_tokenize_vtab.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001871 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenize_vtab.c
drh4d648c72013-04-22 17:07:56 +00001872
drh391d4ba2012-05-28 20:22:16 +00001873fts3_unicode.lo: $(TOP)\ext\fts3\fts3_unicode.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001874 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_unicode.c
drh391d4ba2012-05-28 20:22:16 +00001875
1876fts3_unicode2.lo: $(TOP)\ext\fts3\fts3_unicode2.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001877 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_unicode2.c
drh391d4ba2012-05-28 20:22:16 +00001878
shanehb2f20bf2011-06-17 07:07:24 +00001879fts3_write.lo: $(TOP)\ext\fts3\fts3_write.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001880 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_write.c
shanehb2f20bf2011-06-17 07:07:24 +00001881
1882rtree.lo: $(TOP)\ext\rtree\rtree.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001883 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\rtree\rtree.c
shanehb2f20bf2011-06-17 07:07:24 +00001884
mistachkin4f2c8222016-04-11 22:23:04 +00001885sqlite3session.lo: $(TOP)\ext\session\sqlite3session.c $(HDR) $(EXTHDR)
mistachkin05004782016-03-30 16:23:06 +00001886 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\session\sqlite3session.c
drh498dcae2013-03-13 11:42:00 +00001887
mistachkined52f9f2015-06-26 04:34:36 +00001888# FTS5 things
1889#
1890FTS5_SRC = \
1891 $(TOP)\ext\fts5\fts5.h \
1892 $(TOP)\ext\fts5\fts5Int.h \
1893 $(TOP)\ext\fts5\fts5_aux.c \
1894 $(TOP)\ext\fts5\fts5_buffer.c \
1895 $(TOP)\ext\fts5\fts5_main.c \
1896 $(TOP)\ext\fts5\fts5_config.c \
1897 $(TOP)\ext\fts5\fts5_expr.c \
1898 $(TOP)\ext\fts5\fts5_hash.c \
1899 $(TOP)\ext\fts5\fts5_index.c \
1900 fts5parse.c fts5parse.h \
1901 $(TOP)\ext\fts5\fts5_storage.c \
1902 $(TOP)\ext\fts5\fts5_tokenize.c \
1903 $(TOP)\ext\fts5\fts5_unicode2.c \
1904 $(TOP)\ext\fts5\fts5_varint.c \
1905 $(TOP)\ext\fts5\fts5_vocab.c
1906
1907fts5parse.c: $(TOP)\ext\fts5\fts5parse.y lemon.exe
1908 copy $(TOP)\ext\fts5\fts5parse.y .
1909 del /Q fts5parse.h 2>NUL
mistachkinedcb4eb2016-01-22 01:25:15 +00001910 .\lemon.exe $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) $(OPTS) fts5parse.y
mistachkined52f9f2015-06-26 04:34:36 +00001911
mistachkin9b88ace2016-02-26 21:01:37 +00001912fts5parse.h: fts5parse.c
mistachkined52f9f2015-06-26 04:34:36 +00001913
mistachkin9b88ace2016-02-26 21:01:37 +00001914fts5.c: $(FTS5_SRC)
mistachkined52f9f2015-06-26 04:34:36 +00001915 $(TCLSH_CMD) $(TOP)\ext\fts5\tool\mkfts5c.tcl
dana153bbc2015-07-02 20:12:34 +00001916 copy $(TOP)\ext\fts5\fts5.h .
mistachkined52f9f2015-06-26 04:34:36 +00001917
1918fts5.lo: fts5.c $(HDR) $(EXTHDR)
mistachkin95ae9582015-06-26 20:45:43 +00001919 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c fts5.c
1920
1921fts5_ext.lo: fts5.c $(HDR) $(EXTHDR)
mistachkinae6ca8e2015-07-02 16:50:43 +00001922 $(LTCOMPILE) $(NO_WARN) -c fts5.c
shanehb2f20bf2011-06-17 07:07:24 +00001923
mistachkin95ae9582015-06-26 20:45:43 +00001924fts5.dll: fts5_ext.lo
1925 $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /OUT:$@ fts5_ext.lo
shanehb2f20bf2011-06-17 07:07:24 +00001926
mistachkin83a22532016-01-14 18:01:16 +00001927sqlite3rbu.lo: $(TOP)\ext\rbu\sqlite3rbu.c $(HDR) $(EXTHDR)
1928 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\rbu\sqlite3rbu.c
drh76473772016-01-14 13:22:24 +00001929
shanehb2f20bf2011-06-17 07:07:24 +00001930# Rules to build the 'testfixture' application.
1931#
1932# If using the amalgamation, use sqlite3.c directly to build the test
1933# fixture. Otherwise link against libsqlite3.lib. (This distinction is
1934# necessary because the test fixture requires non-API symbols which are
1935# hidden when the library is built via the amalgamation).
1936#
1937TESTFIXTURE_FLAGS = -DTCLSH=1 -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
mistachkin27b2f052015-01-12 19:49:46 +00001938TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_SERVER=1 -DSQLITE_PRIVATE=""
1939TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_CORE $(NO_WARN)
drhdbc49162016-03-02 03:28:07 +00001940TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_SERIES_CONSTRAINT_VERIFY=1
drh9878fef2016-03-04 03:43:10 +00001941TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_DEFAULT_PAGE_SIZE=1024
shanehb2f20bf2011-06-17 07:07:24 +00001942
mistachkinc04c54b2016-02-11 21:28:16 +00001943TESTFIXTURE_SRC0 = $(TESTEXT) $(TESTSRC2)
mistachkin05004782016-03-30 16:23:06 +00001944TESTFIXTURE_SRC1 = $(TESTEXT) $(SQLITE3C)
shanehb2f20bf2011-06-17 07:07:24 +00001945!IF $(USE_AMALGAMATION)==0
1946TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC0)
1947!ELSE
1948TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC1)
1949!ENDIF
1950
mistachkin5d4d9412016-01-22 03:54:36 +00001951testfixture.exe: $(TESTFIXTURE_SRC) $(SQLITE3H) $(LIBRESOBJS) $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001952 $(LTLINK) -DSQLITE_NO_SYNC=1 $(TESTFIXTURE_FLAGS) \
shanehb2f20bf2011-06-17 07:07:24 +00001953 -DBUILD_sqlite -I$(TCLINCDIR) \
shaneh2a0b9ef2011-06-20 20:52:32 +00001954 $(TESTFIXTURE_SRC) \
mistachkin78e3f612015-10-14 20:01:12 +00001955 /link $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001956
mistachkin9b88ace2016-02-26 21:01:37 +00001957extensiontest: testfixture.exe testloadext.dll
mistachkin88739962015-10-14 23:04:08 +00001958 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00001959 .\testfixture.exe $(TOP)\test\loadext.test $(TESTOPTS)
mistachkin1925a2e2014-02-24 21:20:25 +00001960
drhf4375442015-05-11 12:15:45 +00001961fulltest: $(TESTPROGS) fuzztest
mistachkin88739962015-10-14 23:04:08 +00001962 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00001963 .\testfixture.exe $(TOP)\test\all.test $(TESTOPTS)
shanehb2f20bf2011-06-17 07:07:24 +00001964
drhea93c702015-05-26 18:15:08 +00001965soaktest: $(TESTPROGS)
mistachkin88739962015-10-14 23:04:08 +00001966 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00001967 .\testfixture.exe $(TOP)\test\all.test -soak=1 $(TESTOPTS)
shanehb2f20bf2011-06-17 07:07:24 +00001968
drhf4375442015-05-11 12:15:45 +00001969fulltestonly: $(TESTPROGS) fuzztest
mistachkin88739962015-10-14 23:04:08 +00001970 @set PATH=$(LIBTCLPATH);$(PATH)
mistachkinc60941f2012-09-13 01:51:02 +00001971 .\testfixture.exe $(TOP)\test\full.test
1972
mistachkinedcb4eb2016-01-22 01:25:15 +00001973queryplantest: testfixture.exe shell
mistachkin88739962015-10-14 23:04:08 +00001974 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00001975 .\testfixture.exe $(TOP)\test\permutations.test queryplanner $(TESTOPTS)
mistachkin036acf32013-07-20 00:34:31 +00001976
drhea93c702015-05-26 18:15:08 +00001977fuzztest: fuzzcheck.exe
1978 .\fuzzcheck.exe $(FUZZDATA)
drhf3320712015-04-25 13:39:29 +00001979
drha523e312015-07-24 17:26:13 +00001980fastfuzztest: fuzzcheck.exe
drh53e66c32015-07-24 15:49:23 +00001981 .\fuzzcheck.exe --limit-mem 100M $(FUZZDATA)
shanehb2f20bf2011-06-17 07:07:24 +00001982
drh905da632015-06-10 18:53:09 +00001983# Minimal testing that runs in less than 3 minutes (on a fast machine)
1984#
drhfd0d93f2016-02-07 00:08:08 +00001985quicktest: testfixture.exe sourcetest
mistachkin88739962015-10-14 23:04:08 +00001986 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00001987 .\testfixture.exe $(TOP)\test\extraquick.test $(TESTOPTS)
1988
1989# This is the common case. Run many tests that do not take too long,
1990# including fuzzcheck, sqlite3_analyzer, and sqldiff tests.
1991#
drhfd0d93f2016-02-07 00:08:08 +00001992test: $(TESTPROGS) sourcetest fastfuzztest
mistachkin88739962015-10-14 23:04:08 +00001993 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00001994 .\testfixture.exe $(TOP)\test\veryquick.test $(TESTOPTS)
shanehb2f20bf2011-06-17 07:07:24 +00001995
drhea93c702015-05-26 18:15:08 +00001996smoketest: $(TESTPROGS)
mistachkin88739962015-10-14 23:04:08 +00001997 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00001998 .\testfixture.exe $(TOP)\test\main.test $(TESTOPTS)
mistachkin00eb70d2015-04-04 00:02:07 +00001999
mistachkin9b88ace2016-02-26 21:01:37 +00002000sqlite3_analyzer.c: $(SQLITE3C) $(SQLITE3H) $(TOP)\src\tclsqlite.c $(TOP)\tool\spaceanal.tcl
mistachkind4ab1032015-05-11 16:27:33 +00002001 echo #define TCLSH 2 > $@
2002 echo #define SQLITE_ENABLE_DBSTAT_VTAB 1 >> $@
2003 copy $@ + $(SQLITE3C) + $(TOP)\src\tclsqlite.c $@
mistachkin9a55e312011-09-22 00:06:44 +00002004 echo static const char *tclsh_main_loop(void){ >> $@
2005 echo static const char *zMainloop = >> $@
drh48cc9a32015-10-07 12:36:42 +00002006 $(TCLSH_CMD) $(TOP)\tool\tostr.tcl $(TOP)\tool\spaceanal.tcl >> $@
mistachkin9a55e312011-09-22 00:06:44 +00002007 echo ; return zMainloop; } >> $@
shanehb2f20bf2011-06-17 07:07:24 +00002008
mistachkin08c1c312012-10-06 03:48:25 +00002009sqlite3_analyzer.exe: sqlite3_analyzer.c $(LIBRESOBJS)
mistachkind4ab1032015-05-11 16:27:33 +00002010 $(LTLINK) $(NO_WARN) -DBUILD_sqlite -I$(TCLINCDIR) sqlite3_analyzer.c \
mistachkin78e3f612015-10-14 20:01:12 +00002011 /link $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00002012
mistachkin1925a2e2014-02-24 21:20:25 +00002013testloadext.lo: $(TOP)\src\test_loadext.c
mistachkin44723ce2015-03-21 02:22:37 +00002014 $(LTCOMPILE) $(NO_WARN) -c $(TOP)\src\test_loadext.c
mistachkin1925a2e2014-02-24 21:20:25 +00002015
mistachkin9b88ace2016-02-26 21:01:37 +00002016testloadext.dll: testloadext.lo
mistachkin1925a2e2014-02-24 21:20:25 +00002017 $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /OUT:$@ testloadext.lo
2018
mistachkin5d4d9412016-01-22 03:54:36 +00002019showdb.exe: $(TOP)\tool\showdb.c $(SQLITE3C) $(SQLITE3H)
mistachkin44723ce2015-03-21 02:22:37 +00002020 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
mistachkin78e3f612015-10-14 20:01:12 +00002021 $(TOP)\tool\showdb.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh9ac3c1e2013-11-07 18:37:31 +00002022
mistachkin5d4d9412016-01-22 03:54:36 +00002023showstat4.exe: $(TOP)\tool\showstat4.c $(SQLITE3C) $(SQLITE3H)
mistachkin44723ce2015-03-21 02:22:37 +00002024 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
mistachkin78e3f612015-10-14 20:01:12 +00002025 $(TOP)\tool\showstat4.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh4bb77ec2014-06-30 11:14:26 +00002026
mistachkin5d4d9412016-01-22 03:54:36 +00002027showjournal.exe: $(TOP)\tool\showjournal.c $(SQLITE3C) $(SQLITE3H)
mistachkin44723ce2015-03-21 02:22:37 +00002028 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
mistachkin78e3f612015-10-14 20:01:12 +00002029 $(TOP)\tool\showjournal.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh4bb77ec2014-06-30 11:14:26 +00002030
mistachkin5d4d9412016-01-22 03:54:36 +00002031showwal.exe: $(TOP)\tool\showwal.c $(SQLITE3C) $(SQLITE3H)
mistachkin44723ce2015-03-21 02:22:37 +00002032 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
mistachkin78e3f612015-10-14 20:01:12 +00002033 $(TOP)\tool\showwal.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh4bb77ec2014-06-30 11:14:26 +00002034
drh9f674f22014-08-18 20:23:29 +00002035changeset.exe: $(TOP)\ext\session\changeset.c $(SQLITE3C)
mistachkin05004782016-03-30 16:23:06 +00002036 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
2037 $(TOP)\ext\session\changeset.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh9f674f22014-08-18 20:23:29 +00002038
mistachkin5d4d9412016-01-22 03:54:36 +00002039fts3view.exe: $(TOP)\ext\fts3\tool\fts3view.c $(SQLITE3C) $(SQLITE3H)
mistachkin44723ce2015-03-21 02:22:37 +00002040 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
mistachkin78e3f612015-10-14 20:01:12 +00002041 $(TOP)\ext\fts3\tool\fts3view.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
mistachkinde545272014-07-07 17:57:50 +00002042
mistachkin5d4d9412016-01-22 03:54:36 +00002043rollback-test.exe: $(TOP)\tool\rollback-test.c $(SQLITE3C) $(SQLITE3H)
mistachkin44723ce2015-03-21 02:22:37 +00002044 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
mistachkin78e3f612015-10-14 20:01:12 +00002045 $(TOP)\tool\rollback-test.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh4bb77ec2014-06-30 11:14:26 +00002046
mistachkin5d4d9412016-01-22 03:54:36 +00002047LogEst.exe: $(TOP)\tool\logest.c $(SQLITE3H)
mistachkin78e3f612015-10-14 20:01:12 +00002048 $(LTLINK) $(NO_WARN) -Fe$@ $(TOP)\tool\LogEst.c /link $(LDFLAGS) $(LTLINKOPTS)
drh267a13f2014-06-18 18:10:12 +00002049
mistachkin5d4d9412016-01-22 03:54:36 +00002050wordcount.exe: $(TOP)\test\wordcount.c $(SQLITE3C) $(SQLITE3H)
mistachkin44723ce2015-03-21 02:22:37 +00002051 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
mistachkin78e3f612015-10-14 20:01:12 +00002052 $(TOP)\test\wordcount.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh9ac3c1e2013-11-07 18:37:31 +00002053
mistachkin5d4d9412016-01-22 03:54:36 +00002054speedtest1.exe: $(TOP)\test\speedtest1.c $(SQLITE3C) $(SQLITE3H)
mistachkin44723ce2015-03-21 02:22:37 +00002055 $(LTLINK) $(NO_WARN) -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
mistachkin78e3f612015-10-14 20:01:12 +00002056 $(TOP)\test\speedtest1.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
mistachkinb482a442012-02-11 22:19:26 +00002057
mistachkin9b88ace2016-02-26 21:01:37 +00002058rbu.exe: $(TOP)\ext\rbu\rbu.c $(TOP)\ext\rbu\sqlite3rbu.c $(SQLITE3C) $(SQLITE3H)
mistachkin5d4d9412016-01-22 03:54:36 +00002059 $(LTLINK) $(NO_WARN) -DSQLITE_ENABLE_RBU -Fe$@ \
2060 $(TOP)\ext\rbu\rbu.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
mistachkin9b88ace2016-02-26 21:01:37 +00002061
2062moreclean: clean
2063 del /Q $(SQLITE3C) $(SQLITE3H) 2>NUL
mistachkin3e786092016-01-23 07:53:04 +00002064# <</mark>>
drh76473772016-01-14 13:22:24 +00002065
shaneh6e7850c2011-06-17 15:57:07 +00002066clean:
mistachkin8dd3ff12015-05-16 03:41:41 +00002067 del /Q *.exp *.lo *.ilk *.lib *.obj *.ncb *.pdb *.sdf *.suo 2>NUL
mistachkin56362a52016-02-19 19:03:04 +00002068 del /Q *.bsc *.def *.cod *.da *.bb *.bbg *.vc gmon.out 2>NUL
mistachkinfe41a982016-02-27 00:21:44 +00002069 del /Q $(SQLITE3EXE) $(SQLITE3DLL) Replace.exe 2>NUL
mistachkin3e786092016-01-23 07:53:04 +00002070# <<mark>>
mistachkin9b88ace2016-02-26 21:01:37 +00002071 del /Q sqlite3.c sqlite3.h 2>NUL
2072 del /Q opcodes.c opcodes.h 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002073 del /Q lemon.* lempar.c parse.* 2>NUL
2074 del /Q mkkeywordhash.* keywordhash.h 2>NUL
2075 del /Q notasharedlib.* 2>NUL
2076 -rmdir /Q/S .deps 2>NUL
2077 -rmdir /Q/S .libs 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002078 -rmdir /Q/S tsrc 2>NUL
2079 del /Q .target_source 2>NUL
mistachkin44723ce2015-03-21 02:22:37 +00002080 del /Q tclsqlite3.exe 2>NUL
2081 del /Q testloadext.dll 2>NUL
2082 del /Q testfixture.exe test.db 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002083 del /Q LogEst.exe fts3view.exe rollback-test.exe showdb.exe 2>NUL
drhedea9112015-03-24 19:02:13 +00002084 del /Q changeset.exe 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002085 del /Q showjournal.exe showstat4.exe showwal.exe speedtest1.exe 2>NUL
mistachkin27b69972016-02-07 20:39:27 +00002086 del /Q mptester.exe wordcount.exe rbu.exe srcck1.exe 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002087 del /Q sqlite3.c sqlite3-*.c 2>NUL
2088 del /Q sqlite3rc.h 2>NUL
mistachkin27799892016-03-31 22:53:37 +00002089 del /Q shell.c sqlite3ext.h sqlite3session.h 2>NUL
mistachkin44723ce2015-03-21 02:22:37 +00002090 del /Q sqlite3_analyzer.exe sqlite3_analyzer.c 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002091 del /Q sqlite-*-output.vsix 2>NUL
mistachkin7a94e6b2015-05-26 03:24:33 +00002092 del /Q fuzzershell.exe fuzzcheck.exe sqldiff.exe 2>NUL
mistachkinbc50bb72015-07-14 21:56:53 +00002093 del /Q fts5.* fts5parse.* 2>NUL
mistachkin3e786092016-01-23 07:53:04 +00002094# <</mark>>