blob: 8e54f53576a7e89f8f4bdd12024e5e577cb693e5 [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
mistachkin12b35ea2016-05-03 19:40:54 +0000201# Set this to non-0 to enable support for the session extension.
202#
203!IFNDEF SESSION
204SESSION = 0
205!ENDIF
206
mistachkin5d4d9412016-01-22 03:54:36 +0000207# Set the source code file to be used by executables and libraries when
208# they need the amalgamation.
209#
210!IFNDEF SQLITE3C
211!IF $(SPLIT_AMALGAMATION)!=0
212SQLITE3C = sqlite3-all.c
213!ELSE
214SQLITE3C = sqlite3.c
215!ENDIF
216!ENDIF
217
218# Set the include code file to be used by executables and libraries when
219# they need SQLite.
220#
221!IFNDEF SQLITE3H
222SQLITE3H = sqlite3.h
223!ENDIF
224
mistachkinedcb4eb2016-01-22 01:25:15 +0000225# This is the name to use for the SQLite dynamic link library (DLL).
226#
227!IFNDEF SQLITE3DLL
mistachkinb0c99af2016-02-19 05:07:56 +0000228!IF $(FOR_WIN10)!=0
229SQLITE3DLL = winsqlite3.dll
230!ELSE
mistachkinedcb4eb2016-01-22 01:25:15 +0000231SQLITE3DLL = sqlite3.dll
232!ENDIF
mistachkinb0c99af2016-02-19 05:07:56 +0000233!ENDIF
mistachkinedcb4eb2016-01-22 01:25:15 +0000234
235# This is the name to use for the SQLite import library (LIB).
236#
237!IFNDEF SQLITE3LIB
mistachkinb0c99af2016-02-19 05:07:56 +0000238!IF $(FOR_WIN10)!=0
239SQLITE3LIB = winsqlite3.lib
240!ELSE
mistachkinedcb4eb2016-01-22 01:25:15 +0000241SQLITE3LIB = sqlite3.lib
242!ENDIF
mistachkinb0c99af2016-02-19 05:07:56 +0000243!ENDIF
mistachkinedcb4eb2016-01-22 01:25:15 +0000244
245# This is the name to use for the SQLite shell executable (EXE).
246#
247!IFNDEF SQLITE3EXE
mistachkinb0c99af2016-02-19 05:07:56 +0000248!IF $(FOR_WIN10)!=0
249SQLITE3EXE = winsqlite3shell.exe
250!ELSE
mistachkinedcb4eb2016-01-22 01:25:15 +0000251SQLITE3EXE = sqlite3.exe
252!ENDIF
mistachkinb0c99af2016-02-19 05:07:56 +0000253!ENDIF
mistachkinedcb4eb2016-01-22 01:25:15 +0000254
255# This is the argument used to set the program database (PDB) file for the
256# SQLite shell executable (EXE).
257#
258!IFNDEF SQLITE3EXEPDB
mistachkinb0c99af2016-02-19 05:07:56 +0000259!IF $(FOR_WIN10)!=0
260SQLITE3EXEPDB =
261!ELSE
mistachkinedcb4eb2016-01-22 01:25:15 +0000262SQLITE3EXEPDB = /pdb:sqlite3sh.pdb
263!ENDIF
mistachkinb0c99af2016-02-19 05:07:56 +0000264!ENDIF
mistachkinedcb4eb2016-01-22 01:25:15 +0000265
mistachkin4712c212014-05-09 20:51:17 +0000266# These are the "standard" SQLite compilation options used when compiling for
267# the Windows platform.
268#
269!IFNDEF OPT_FEATURE_FLAGS
270OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS3=1
271OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RTREE=1
272OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_COLUMN_METADATA=1
drh5e18d402016-05-03 13:14:18 +0000273!ENDIF
274
mistachkin12b35ea2016-05-03 19:40:54 +0000275# Should the session extension be enabled? If so, add compilation options
276# to enable it.
drh5e18d402016-05-03 13:14:18 +0000277#
drh5e18d402016-05-03 13:14:18 +0000278!IF $(SESSION)!=0
mistachkin05004782016-03-30 16:23:06 +0000279OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_SESSION=1
280OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_PREUPDATE_HOOK=1
mistachkin4712c212014-05-09 20:51:17 +0000281!ENDIF
282
mistachkinedcb4eb2016-01-22 01:25:15 +0000283# These are the "extended" SQLite compilation options used when compiling for
284# the Windows 10 platform.
285#
286!IFNDEF EXT_FEATURE_FLAGS
287!IF $(FOR_WIN10)!=0
288EXT_FEATURE_FLAGS = $(EXT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS4=1
289EXT_FEATURE_FLAGS = $(EXT_FEATURE_FLAGS) -DSQLITE_SYSTEM_MALLOC=1
290EXT_FEATURE_FLAGS = $(EXT_FEATURE_FLAGS) -DSQLITE_OMIT_LOCALTIME=1
291!ELSE
292EXT_FEATURE_FLAGS =
293!ENDIF
294!ENDIF
295
mistachkin4712c212014-05-09 20:51:17 +0000296###############################################################################
297############################### END OF OPTIONS ################################
298###############################################################################
299
mistachkin55e88d92016-02-08 20:40:57 +0000300# When compiling for the Windows 10 platform, the PLATFORM macro must be set
301# to an appropriate value (e.g. x86, x64, arm, arm64, etc).
302#
303!IF $(FOR_WIN10)!=0
304!IFNDEF PLATFORM
305!ERROR Using the FOR_WIN10 option requires a value for PLATFORM.
306!ENDIF
307!ENDIF
308
mistachkind9b3c542014-05-09 23:31:55 +0000309# This assumes that MSVC is always installed in 32-bit Program Files directory
310# and sets the variable for use in locating other 32-bit installs accordingly.
311#
312PROGRAMFILES_X86 = $(VCINSTALLDIR)\..\..
313PROGRAMFILES_X86 = $(PROGRAMFILES_X86:\\=\)
314
mistachkine37f99c2012-06-30 16:22:05 +0000315# Check for the predefined command macro CC. This should point to the compiler
mistachkinbd58d5f2012-06-30 22:22:34 +0000316# binary for the target platform. If it is not defined, simply define it to
mistachkine37f99c2012-06-30 16:22:05 +0000317# the legacy default value 'cl.exe'.
318#
319!IFNDEF CC
320CC = cl.exe
321!ENDIF
322
mistachkin9aeb9712016-02-26 23:13:16 +0000323# Check for the predefined command macro CSC. This should point to a working
324# C Sharp compiler binary. If it is not defined, simply define it to the
325# legacy default value 'csc.exe'.
326#
327!IFNDEF CSC
328CSC = csc.exe
329!ENDIF
330
mistachkin228aeff2012-06-30 19:24:09 +0000331# Check for the command macro LD. This should point to the linker binary for
mistachkinbd58d5f2012-06-30 22:22:34 +0000332# the target platform. If it is not defined, simply define it to the legacy
mistachkin228aeff2012-06-30 19:24:09 +0000333# default value 'link.exe'.
334#
335!IFNDEF LD
336LD = link.exe
337!ENDIF
338
mistachkin4d9d1f42012-09-03 10:32:32 +0000339# Check for the predefined command macro RC. This should point to the resource
340# compiler binary for the target platform. If it is not defined, simply define
341# it to the legacy default value 'rc.exe'.
342#
343!IFNDEF RC
344RC = rc.exe
345!ENDIF
346
mistachkine48f1ed2016-02-08 20:45:37 +0000347# Check for the MSVC runtime library path macro. Otherwise, this value will
mistachkin4712c212014-05-09 20:51:17 +0000348# default to the 'lib' directory underneath the MSVC installation directory.
349#
350!IFNDEF CRTLIBPATH
351CRTLIBPATH = $(VCINSTALLDIR)\lib
352!ENDIF
353
354CRTLIBPATH = $(CRTLIBPATH:\\=\)
355
mistachkine37f99c2012-06-30 16:22:05 +0000356# Check for the command macro NCC. This should point to the compiler binary
mistachkinbd58d5f2012-06-30 22:22:34 +0000357# for the platform the compilation process is taking place on. If it is not
358# defined, simply define it to have the same value as the CC macro. When
mistachkine37f99c2012-06-30 16:22:05 +0000359# cross-compiling, it is suggested that this macro be modified via the command
360# line (since nmake itself does not provide a built-in method to guess it).
361# For example, to use the x86 compiler when cross-compiling for x64, a command
mistachkinbd58d5f2012-06-30 22:22:34 +0000362# line similar to the following could be used (all on one line):
mistachkine37f99c2012-06-30 16:22:05 +0000363#
mistachkin6f928332012-08-17 11:47:32 +0000364# nmake /f Makefile.msc sqlite3.dll
mistachkin52fd8e12012-08-28 01:44:13 +0000365# XCOMPILE=1 USE_NATIVE_LIBPATHS=1
366#
367# Alternatively, the full path and file name to the compiler binary for the
368# platform the compilation process is taking place may be specified (all on
369# one line):
370#
371# nmake /f Makefile.msc sqlite3.dll
mistachkinbd58d5f2012-06-30 22:22:34 +0000372# "NCC=""%VCINSTALLDIR%\bin\cl.exe"""
373# USE_NATIVE_LIBPATHS=1
mistachkine37f99c2012-06-30 16:22:05 +0000374#
mistachkinfd0ba2a2012-07-27 08:21:45 +0000375!IFDEF NCC
376NCC = $(NCC:\\=\)
mistachkin52fd8e12012-08-28 01:44:13 +0000377!ELSEIF $(XCOMPILE)!=0
mistachkin5fac4202013-12-03 23:33:29 +0000378NCC = "$(VCINSTALLDIR)\bin\$(CC)"
mistachkin52fd8e12012-08-28 01:44:13 +0000379NCC = $(NCC:\\=\)
mistachkinfd0ba2a2012-07-27 08:21:45 +0000380!ELSE
mistachkine37f99c2012-06-30 16:22:05 +0000381NCC = $(CC)
382!ENDIF
383
mistachkine48f1ed2016-02-08 20:45:37 +0000384# Check for the MSVC native runtime library path macro. Otherwise,
mistachkin4712c212014-05-09 20:51:17 +0000385# this value will default to the 'lib' directory underneath the MSVC
mistachkinbd58d5f2012-06-30 22:22:34 +0000386# installation directory.
387#
388!IFNDEF NCRTLIBPATH
389NCRTLIBPATH = $(VCINSTALLDIR)\lib
390!ENDIF
391
mistachkin0b5ae722012-07-27 23:03:47 +0000392NCRTLIBPATH = $(NCRTLIBPATH:\\=\)
393
mistachkine48f1ed2016-02-08 20:45:37 +0000394# Check for the Platform SDK library path macro. Otherwise, this
mistachkinbd58d5f2012-06-30 22:22:34 +0000395# value will default to the 'lib' directory underneath the Windows
396# SDK installation directory (the environment variable used appears
397# to be available when using Visual C++ 2008 or later via the
398# command line).
399#
400!IFNDEF NSDKLIBPATH
401NSDKLIBPATH = $(WINDOWSSDKDIR)\lib
402!ENDIF
403
mistachkin0b5ae722012-07-27 23:03:47 +0000404NSDKLIBPATH = $(NSDKLIBPATH:\\=\)
405
mistachkine48f1ed2016-02-08 20:45:37 +0000406# Check for the UCRT library path macro. Otherwise, this value will
mistachkina6f28892016-02-05 19:40:23 +0000407# default to the version-specific, platform-specific 'lib' directory
408# underneath the Windows SDK installation directory.
409#
410!IFNDEF UCRTLIBPATH
411UCRTLIBPATH = $(WINDOWSSDKDIR)\lib\$(WINDOWSSDKLIBVERSION)\ucrt\$(PLATFORM)
412!ENDIF
413
414UCRTLIBPATH = $(UCRTLIBPATH:\\=\)
415
mistachkinbd58d5f2012-06-30 22:22:34 +0000416# C compiler and options for use in building executables that
shanehb2f20bf2011-06-17 07:07:24 +0000417# will run on the platform that is doing the build.
418#
mistachkin2318d332015-01-12 18:02:52 +0000419!IF $(USE_FULLWARN)!=0
mistachkinf170ea42015-10-16 20:13:57 +0000420BCC = $(NCC) -nologo -W4 $(CCOPTS) $(BCCOPTS)
mistachkin2318d332015-01-12 18:02:52 +0000421!ELSE
mistachkinf170ea42015-10-16 20:13:57 +0000422BCC = $(NCC) -nologo -W3 $(CCOPTS) $(BCCOPTS)
mistachkin2318d332015-01-12 18:02:52 +0000423!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000424
mistachkin0157e012013-09-06 21:41:11 +0000425# Check if assembly code listings should be generated for the source
426# code files to be compiled.
427#
428!IF $(USE_LISTINGS)!=0
429BCC = $(BCC) -FAcs
430!ENDIF
431
mistachkinbd58d5f2012-06-30 22:22:34 +0000432# Check if the native library paths should be used when compiling
433# the command line tools used during the compilation process. If
434# so, set the necessary macro now.
435#
436!IF $(USE_NATIVE_LIBPATHS)!=0
437NLTLIBPATHS = "/LIBPATH:$(NCRTLIBPATH)" "/LIBPATH:$(NSDKLIBPATH)"
mistachkin6bbe3df2015-04-19 06:18:10 +0000438
439!IFDEF NUCRTLIBPATH
440NUCRTLIBPATH = $(NUCRTLIBPATH:\\=\)
441NLTLIBPATHS = $(NLTLIBPATHS) "/LIBPATH:$(NUCRTLIBPATH)"
442!ENDIF
mistachkinbd58d5f2012-06-30 22:22:34 +0000443!ENDIF
444
445# C compiler and options for use in building executables that
shanehb2f20bf2011-06-17 07:07:24 +0000446# will run on the target platform. (BCC and TCC are usually the
447# same unless your are cross-compiling.)
448#
mistachkin2318d332015-01-12 18:02:52 +0000449!IF $(USE_FULLWARN)!=0
mistachkinf170ea42015-10-16 20:13:57 +0000450TCC = $(CC) -nologo -W4 -DINCLUDE_MSVC_H=1 $(CCOPTS) $(TCCOPTS)
mistachkin2318d332015-01-12 18:02:52 +0000451!ELSE
mistachkinf170ea42015-10-16 20:13:57 +0000452TCC = $(CC) -nologo -W3 $(CCOPTS) $(TCCOPTS)
mistachkin2318d332015-01-12 18:02:52 +0000453!ENDIF
454
mistachkin8988aee2016-02-10 21:45:25 +0000455TCC = $(TCC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) -I$(TOP)\src -fp:precise
456RCC = $(RC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) -I$(TOP)\src $(RCOPTS) $(RCCOPTS)
shaneh6e7850c2011-06-17 15:57:07 +0000457
mistachkin44723ce2015-03-21 02:22:37 +0000458# Check if we want to use the "stdcall" calling convention when compiling.
459# This is not supported by the compilers for non-x86 platforms. It should
460# also be noted here that building any target with these "stdcall" options
461# will most likely fail if the Tcl library is also required. This is due
462# to how the Tcl library functions are declared and exported (i.e. without
463# an explicit calling convention, which results in "cdecl").
464#
mistachkinedcb4eb2016-01-22 01:25:15 +0000465!IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
mistachkin44723ce2015-03-21 02:22:37 +0000466!IF "$(PLATFORM)"=="x86"
mistachkin59b9b022015-03-24 21:27:27 +0000467CORE_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_STDCALL=__stdcall
468SHELL_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_STDCALL=__stdcall
mistachkin44723ce2015-03-21 02:22:37 +0000469!ELSE
470!IFNDEF PLATFORM
mistachkin59b9b022015-03-24 21:27:27 +0000471CORE_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_STDCALL=__stdcall
472SHELL_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_STDCALL=__stdcall
mistachkin44723ce2015-03-21 02:22:37 +0000473!ELSE
474CORE_CCONV_OPTS =
475SHELL_CCONV_OPTS =
476!ENDIF
477!ENDIF
478!ELSE
479CORE_CCONV_OPTS =
480SHELL_CCONV_OPTS =
481!ENDIF
482
483# These are additional compiler options used for the core library.
484#
485!IFNDEF CORE_COMPILE_OPTS
mistachkinedcb4eb2016-01-22 01:25:15 +0000486!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
mistachkin44723ce2015-03-21 02:22:37 +0000487CORE_COMPILE_OPTS = $(CORE_CCONV_OPTS) -DSQLITE_API=__declspec(dllexport)
488!ELSE
489CORE_COMPILE_OPTS = $(CORE_CCONV_OPTS)
490!ENDIF
491!ENDIF
492
493# These are the additional targets that the core library should depend on
494# when linking.
495#
496!IFNDEF CORE_LINK_DEP
mistachkin9b88ace2016-02-26 21:01:37 +0000497!IF $(DYNAMIC_SHELL)!=0
mistachkin44723ce2015-03-21 02:22:37 +0000498CORE_LINK_DEP =
mistachkin9b88ace2016-02-26 21:01:37 +0000499!ELSEIF $(FOR_WIN10)==0 || "$(PLATFORM)"=="x86"
mistachkin44723ce2015-03-21 02:22:37 +0000500CORE_LINK_DEP = sqlite3.def
mistachkin9b88ace2016-02-26 21:01:37 +0000501!ELSE
502CORE_LINK_DEP =
mistachkin44723ce2015-03-21 02:22:37 +0000503!ENDIF
504!ENDIF
505
506# These are additional linker options used for the core library.
507#
508!IFNDEF CORE_LINK_OPTS
mistachkin9b88ace2016-02-26 21:01:37 +0000509!IF $(DYNAMIC_SHELL)!=0
mistachkin44723ce2015-03-21 02:22:37 +0000510CORE_LINK_OPTS =
mistachkin9b88ace2016-02-26 21:01:37 +0000511!ELSEIF $(FOR_WIN10)==0 || "$(PLATFORM)"=="x86"
mistachkin44723ce2015-03-21 02:22:37 +0000512CORE_LINK_OPTS = /DEF:sqlite3.def
mistachkin9b88ace2016-02-26 21:01:37 +0000513!ELSE
514CORE_LINK_OPTS =
mistachkin44723ce2015-03-21 02:22:37 +0000515!ENDIF
516!ENDIF
517
518# These are additional compiler options used for the shell executable.
519#
520!IFNDEF SHELL_COMPILE_OPTS
mistachkinedcb4eb2016-01-22 01:25:15 +0000521!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
mistachkin5d4d9412016-01-22 03:54:36 +0000522SHELL_COMPILE_OPTS = $(SHELL_CCONV_OPTS) -DSQLITE_API=__declspec(dllimport)
mistachkin44723ce2015-03-21 02:22:37 +0000523!ELSE
mistachkin5d4d9412016-01-22 03:54:36 +0000524SHELL_COMPILE_OPTS = $(SHELL_CCONV_OPTS)
525!ENDIF
526!ENDIF
527
528# This is the source code that the shell executable should be compiled
529# with.
530#
531!IFNDEF SHELL_CORE_SRC
532!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
533SHELL_CORE_SRC =
534!ELSE
535SHELL_CORE_SRC = $(SQLITE3C)
mistachkin44723ce2015-03-21 02:22:37 +0000536!ENDIF
537!ENDIF
538
539# This is the core library that the shell executable should depend on.
540#
541!IFNDEF SHELL_CORE_DEP
mistachkinedcb4eb2016-01-22 01:25:15 +0000542!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
543SHELL_CORE_DEP = $(SQLITE3DLL)
mistachkin44723ce2015-03-21 02:22:37 +0000544!ELSE
mistachkin5d4d9412016-01-22 03:54:36 +0000545SHELL_CORE_DEP =
mistachkin44723ce2015-03-21 02:22:37 +0000546!ENDIF
547!ENDIF
548
549# This is the core library that the shell executable should link with.
550#
551!IFNDEF SHELL_CORE_LIB
mistachkinedcb4eb2016-01-22 01:25:15 +0000552!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
553SHELL_CORE_LIB = $(SQLITE3LIB)
mistachkin44723ce2015-03-21 02:22:37 +0000554!ELSE
mistachkin5d4d9412016-01-22 03:54:36 +0000555SHELL_CORE_LIB =
mistachkin44723ce2015-03-21 02:22:37 +0000556!ENDIF
557!ENDIF
558
559# These are additional linker options used for the shell executable.
560#
561!IFNDEF SHELL_LINK_OPTS
562SHELL_LINK_OPTS = $(SHELL_CORE_LIB)
563!ENDIF
564
mistachkin0157e012013-09-06 21:41:11 +0000565# Check if assembly code listings should be generated for the source
566# code files to be compiled.
567#
568!IF $(USE_LISTINGS)!=0
569TCC = $(TCC) -FAcs
570!ENDIF
571
mistachkinf39eaf22012-03-20 02:18:42 +0000572# When compiling the library for use in the WinRT environment,
mistachkin46b721a2012-03-23 12:28:21 +0000573# the following compile-time options must be used as well to
mistachkinf39eaf22012-03-20 02:18:42 +0000574# disable use of Win32 APIs that are not available and to enable
575# use of Win32 APIs that are specific to Windows 8 and/or WinRT.
576#
mistachkin46b721a2012-03-23 12:28:21 +0000577!IF $(FOR_WINRT)!=0
mistachkin8d967a92012-06-21 04:21:35 +0000578TCC = $(TCC) -DSQLITE_OS_WINRT=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000579RCC = $(RCC) -DSQLITE_OS_WINRT=1
mistachkin08c1c312012-10-06 03:48:25 +0000580TCC = $(TCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
581RCC = $(RCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
mistachkin8d967a92012-06-21 04:21:35 +0000582!ENDIF
583
mistachkin5d4d9412016-01-22 03:54:36 +0000584# C compiler options for the Windows 10 platform (needs MSVC 2015).
mistachkinedcb4eb2016-01-22 01:25:15 +0000585#
586!IF $(FOR_WIN10)!=0
mistachkin406eeff2016-02-09 18:28:20 +0000587TCC = $(TCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
588BCC = $(BCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
mistachkinedcb4eb2016-01-22 01:25:15 +0000589!ENDIF
590
mistachkin8d967a92012-06-21 04:21:35 +0000591# Also, we need to dynamically link to the correct MSVC runtime
592# when compiling for WinRT (e.g. debug or release) OR if the
593# USE_CRT_DLL option is set to force dynamically linking to the
594# MSVC runtime library.
595#
mistachkina6f28892016-02-05 19:40:23 +0000596!IF $(FOR_WINRT)!=0 || $(USE_CRT_DLL)!=0
mistachkincd54bab2014-12-20 21:14:14 +0000597!IF $(DEBUG)>1
mistachkin8d967a92012-06-21 04:21:35 +0000598TCC = $(TCC) -MDd
mistachkin08c1c312012-10-06 03:48:25 +0000599BCC = $(BCC) -MDd
mistachkin8d967a92012-06-21 04:21:35 +0000600!ELSE
601TCC = $(TCC) -MD
mistachkin08c1c312012-10-06 03:48:25 +0000602BCC = $(BCC) -MD
mistachkin8d967a92012-06-21 04:21:35 +0000603!ENDIF
604!ELSE
mistachkincd54bab2014-12-20 21:14:14 +0000605!IF $(DEBUG)>1
mistachkin8d967a92012-06-21 04:21:35 +0000606TCC = $(TCC) -MTd
mistachkin08c1c312012-10-06 03:48:25 +0000607BCC = $(BCC) -MTd
mistachkin8d967a92012-06-21 04:21:35 +0000608!ELSE
609TCC = $(TCC) -MT
mistachkin08c1c312012-10-06 03:48:25 +0000610BCC = $(BCC) -MT
mistachkin8d967a92012-06-21 04:21:35 +0000611!ENDIF
mistachkin46b721a2012-03-23 12:28:21 +0000612!ENDIF
mistachkinf39eaf22012-03-20 02:18:42 +0000613
mistachkin3e786092016-01-23 07:53:04 +0000614# <<mark>>
mistachkinf39eaf22012-03-20 02:18:42 +0000615# The mksqlite3c.tcl and mksqlite3h.tcl scripts will pull in
shaneh6e7850c2011-06-17 15:57:07 +0000616# any extension header files by default. For non-amalgamation
617# builds, we need to make sure the compiler can find these.
618#
619!IF $(USE_AMALGAMATION)==0
620TCC = $(TCC) -I$(TOP)\ext\fts3
mistachkin4d9d1f42012-09-03 10:32:32 +0000621RCC = $(RCC) -I$(TOP)\ext\fts3
shaneh6e7850c2011-06-17 15:57:07 +0000622TCC = $(TCC) -I$(TOP)\ext\rtree
mistachkin4d9d1f42012-09-03 10:32:32 +0000623RCC = $(RCC) -I$(TOP)\ext\rtree
drh498dcae2013-03-13 11:42:00 +0000624TCC = $(TCC) -I$(TOP)\ext\session
mistachkin38b4daa2013-03-13 19:02:39 +0000625RCC = $(RCC) -I$(TOP)\ext\session
shaneh6e7850c2011-06-17 15:57:07 +0000626!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000627
mistachkinb0427512014-01-30 11:12:52 +0000628# The mksqlite3c.tcl script accepts some options on the command
629# line. When compiling with debugging enabled, some of these
630# options are necessary in order to allow debugging symbols to
631# work correctly with Visual Studio when using the amalgamation.
632#
mistachkin22529172015-04-10 21:16:11 +0000633!IFNDEF MKSQLITE3C_ARGS
mistachkincd54bab2014-12-20 21:14:14 +0000634!IF $(DEBUG)>1
mistachkinb0427512014-01-30 11:12:52 +0000635MKSQLITE3C_ARGS = --linemacros
636!ELSE
637MKSQLITE3C_ARGS =
638!ENDIF
mistachkin22529172015-04-10 21:16:11 +0000639!ENDIF
mistachkin3e786092016-01-23 07:53:04 +0000640# <</mark>>
mistachkinb0427512014-01-30 11:12:52 +0000641
shanehb2f20bf2011-06-17 07:07:24 +0000642# Define -DNDEBUG to compile without debugging (i.e., for production usage)
643# Omitting the define will cause extra debugging code to be inserted and
644# includes extra comments when "EXPLAIN stmt" is used.
645#
mistachkin753c5442011-08-25 02:02:25 +0000646!IF $(DEBUG)==0
shanehb2f20bf2011-06-17 07:07:24 +0000647TCC = $(TCC) -DNDEBUG
mistachkinfec360a2012-04-18 10:29:21 +0000648BCC = $(BCC) -DNDEBUG
mistachkin4d9d1f42012-09-03 10:32:32 +0000649RCC = $(RCC) -DNDEBUG
mistachkin753c5442011-08-25 02:02:25 +0000650!ENDIF
651
mistachkinedcb4eb2016-01-22 01:25:15 +0000652!IF $(DEBUG)>0 || $(API_ARMOR)!=0 || $(FOR_WIN10)!=0
mistachkin13a24f82015-05-13 04:50:30 +0000653TCC = $(TCC) -DSQLITE_ENABLE_API_ARMOR=1
654RCC = $(RCC) -DSQLITE_ENABLE_API_ARMOR=1
mistachkincd54bab2014-12-20 21:14:14 +0000655!ENDIF
656
657!IF $(DEBUG)>2
mistachkin13a24f82015-05-13 04:50:30 +0000658TCC = $(TCC) -DSQLITE_DEBUG=1
659RCC = $(RCC) -DSQLITE_DEBUG=1
mistachkin753c5442011-08-25 02:02:25 +0000660!ENDIF
661
mistachkinb10f22a2015-04-16 16:27:29 +0000662!IF $(DEBUG)>4 || $(OSTRACE)!=0
663TCC = $(TCC) -DSQLITE_FORCE_OS_TRACE=1 -DSQLITE_DEBUG_OS_TRACE=1
664RCC = $(RCC) -DSQLITE_FORCE_OS_TRACE=1 -DSQLITE_DEBUG_OS_TRACE=1
mistachkin753c5442011-08-25 02:02:25 +0000665!ENDIF
666
mistachkincd54bab2014-12-20 21:14:14 +0000667!IF $(DEBUG)>5
mistachkin13a24f82015-05-13 04:50:30 +0000668TCC = $(TCC) -DSQLITE_ENABLE_IOTRACE=1
669RCC = $(RCC) -DSQLITE_ENABLE_IOTRACE=1
mistachkin753c5442011-08-25 02:02:25 +0000670!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000671
mistachkinbd58d5f2012-06-30 22:22:34 +0000672# Prevent warnings about "insecure" MSVC runtime library functions
673# being used.
mistachkin176f1b42011-08-02 23:34:00 +0000674#
675TCC = $(TCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
mistachkinfec360a2012-04-18 10:29:21 +0000676BCC = $(BCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
mistachkin4d9d1f42012-09-03 10:32:32 +0000677RCC = $(RCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
mistachkin176f1b42011-08-02 23:34:00 +0000678
mistachkinbd58d5f2012-06-30 22:22:34 +0000679# Prevent warnings about "deprecated" POSIX functions being used.
680#
681TCC = $(TCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
682BCC = $(BCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
mistachkin4d9d1f42012-09-03 10:32:32 +0000683RCC = $(RCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
mistachkinbd58d5f2012-06-30 22:22:34 +0000684
mistachkin2f7d5d82012-08-22 00:39:34 +0000685# Use the SQLite debugging heap subsystem?
mistachkin1b186a92011-08-24 16:13:57 +0000686#
mistachkin2f7d5d82012-08-22 00:39:34 +0000687!IF $(MEMDEBUG)!=0
688TCC = $(TCC) -DSQLITE_MEMDEBUG=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000689RCC = $(RCC) -DSQLITE_MEMDEBUG=1
mistachkin2f7d5d82012-08-22 00:39:34 +0000690
mistachkin2f7d5d82012-08-22 00:39:34 +0000691# Use native Win32 heap subsystem instead of malloc/free?
692#
693!ELSEIF $(WIN32HEAP)!=0
694TCC = $(TCC) -DSQLITE_WIN32_MALLOC=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000695RCC = $(RCC) -DSQLITE_WIN32_MALLOC=1
mistachkin753c5442011-08-25 02:02:25 +0000696
mistachkin753c5442011-08-25 02:02:25 +0000697# Validate the heap on every call into the native Win32 heap subsystem?
698#
mistachkincd54bab2014-12-20 21:14:14 +0000699!IF $(DEBUG)>3
mistachkin753c5442011-08-25 02:02:25 +0000700TCC = $(TCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000701RCC = $(RCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1
mistachkin753c5442011-08-25 02:02:25 +0000702!ENDIF
mistachkin2f7d5d82012-08-22 00:39:34 +0000703!ENDIF
mistachkin1b186a92011-08-24 16:13:57 +0000704
mistachkin3e786092016-01-23 07:53:04 +0000705# <<mark>>
mistachkin5b0b6fd2011-06-25 01:14:36 +0000706# The locations of the Tcl header and library files. Also, the library that
707# non-stubs enabled programs using Tcl must link against. These variables
708# (TCLINCDIR, TCLLIBDIR, and LIBTCL) may be overridden via the environment
709# prior to running nmake in order to match the actual installed location and
710# version on this machine.
shanehb2f20bf2011-06-17 07:07:24 +0000711#
mistachkine37f99c2012-06-30 16:22:05 +0000712!IFNDEF TCLINCDIR
shanehb2f20bf2011-06-17 07:07:24 +0000713TCLINCDIR = c:\tcl\include
mistachkine37f99c2012-06-30 16:22:05 +0000714!ENDIF
mistachkin5b0b6fd2011-06-25 01:14:36 +0000715
mistachkine37f99c2012-06-30 16:22:05 +0000716!IFNDEF TCLLIBDIR
shanehb2f20bf2011-06-17 07:07:24 +0000717TCLLIBDIR = c:\tcl\lib
mistachkine37f99c2012-06-30 16:22:05 +0000718!ENDIF
mistachkin5b0b6fd2011-06-25 01:14:36 +0000719
mistachkine37f99c2012-06-30 16:22:05 +0000720!IFNDEF LIBTCL
mistachkin5b0b6fd2011-06-25 01:14:36 +0000721LIBTCL = tcl85.lib
mistachkine37f99c2012-06-30 16:22:05 +0000722!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000723
mistachkin5b663502015-10-10 23:39:55 +0000724!IFNDEF LIBTCLSTUB
725LIBTCLSTUB = tclstub85.lib
726!ENDIF
727
mistachkin88739962015-10-14 23:04:08 +0000728!IFNDEF LIBTCLPATH
729LIBTCLPATH = c:\tcl\bin
730!ENDIF
731
mistachkinc756ded2011-10-02 05:23:16 +0000732# The locations of the ICU header and library files. These variables
733# (ICUINCDIR, ICULIBDIR, and LIBICU) may be overridden via the environment
734# prior to running nmake in order to match the actual installed location on
735# this machine.
736#
mistachkine37f99c2012-06-30 16:22:05 +0000737!IFNDEF ICUINCDIR
mistachkinc756ded2011-10-02 05:23:16 +0000738ICUINCDIR = c:\icu\include
mistachkine37f99c2012-06-30 16:22:05 +0000739!ENDIF
mistachkinc756ded2011-10-02 05:23:16 +0000740
mistachkine37f99c2012-06-30 16:22:05 +0000741!IFNDEF ICULIBDIR
mistachkinc756ded2011-10-02 05:23:16 +0000742ICULIBDIR = c:\icu\lib
mistachkine37f99c2012-06-30 16:22:05 +0000743!ENDIF
mistachkinc756ded2011-10-02 05:23:16 +0000744
mistachkine37f99c2012-06-30 16:22:05 +0000745!IFNDEF LIBICU
mistachkinc756ded2011-10-02 05:23:16 +0000746LIBICU = icuuc.lib icuin.lib
mistachkine37f99c2012-06-30 16:22:05 +0000747!ENDIF
mistachkinc756ded2011-10-02 05:23:16 +0000748
shanehb2f20bf2011-06-17 07:07:24 +0000749# This is the command to use for tclsh - normally just "tclsh", but we may
mistachkin5b0b6fd2011-06-25 01:14:36 +0000750# know the specific version we want to use. This variable (TCLSH_CMD) may be
751# overridden via the environment prior to running nmake in order to select a
752# specific Tcl shell to use.
shanehb2f20bf2011-06-17 07:07:24 +0000753#
mistachkine37f99c2012-06-30 16:22:05 +0000754!IFNDEF TCLSH_CMD
shanehb2f20bf2011-06-17 07:07:24 +0000755TCLSH_CMD = tclsh85
mistachkine37f99c2012-06-30 16:22:05 +0000756!ENDIF
mistachkin3e786092016-01-23 07:53:04 +0000757# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +0000758
759# Compiler options needed for programs that use the readline() library.
760#
mistachkin8bcd3fa2013-08-29 01:03:38 +0000761!IFNDEF READLINE_FLAGS
shaneh6e7850c2011-06-17 15:57:07 +0000762READLINE_FLAGS = -DHAVE_READLINE=0
mistachkin8bcd3fa2013-08-29 01:03:38 +0000763!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000764
765# The library that programs using readline() must link against.
766#
mistachkin8bcd3fa2013-08-29 01:03:38 +0000767!IFNDEF LIBREADLINE
shaneh6e7850c2011-06-17 15:57:07 +0000768LIBREADLINE =
mistachkin8bcd3fa2013-08-29 01:03:38 +0000769!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000770
771# Should the database engine be compiled threadsafe
772#
773TCC = $(TCC) -DSQLITE_THREADSAFE=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000774RCC = $(RCC) -DSQLITE_THREADSAFE=1
shanehb2f20bf2011-06-17 07:07:24 +0000775
776# Do threads override each others locks by default (1), or do we test (-1)
777#
778TCC = $(TCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1
mistachkin4d9d1f42012-09-03 10:32:32 +0000779RCC = $(RCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1
shanehb2f20bf2011-06-17 07:07:24 +0000780
781# Any target libraries which libsqlite must be linked against
shaneh6e7850c2011-06-17 15:57:07 +0000782#
mistachkine37f99c2012-06-30 16:22:05 +0000783!IFNDEF TLIBS
shaneh6e7850c2011-06-17 15:57:07 +0000784TLIBS =
mistachkine37f99c2012-06-30 16:22:05 +0000785!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000786
787# Flags controlling use of the in memory btree implementation
788#
789# SQLITE_TEMP_STORE is 0 to force temporary tables to be in a file, 1 to
790# default to file, 2 to default to memory, and 3 to force temporary
791# tables to always be in memory.
792#
shaneh6e7850c2011-06-17 15:57:07 +0000793TCC = $(TCC) -DSQLITE_TEMP_STORE=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000794RCC = $(RCC) -DSQLITE_TEMP_STORE=1
shanehb2f20bf2011-06-17 07:07:24 +0000795
796# Enable/disable loadable extensions, and other optional features
shaneh6e7850c2011-06-17 15:57:07 +0000797# based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*).
798# The same set of OMIT and ENABLE flags should be passed to the
shanehb2f20bf2011-06-17 07:07:24 +0000799# LEMON parser generator and the mkkeywordhash tool as well.
800
mistachkin4712c212014-05-09 20:51:17 +0000801# These are the required SQLite compilation options used when compiling for
802# the Windows platform.
803#
804REQ_FEATURE_FLAGS = $(REQ_FEATURE_FLAGS) -DSQLITE_MAX_TRIGGER_DEPTH=100
shanehb2f20bf2011-06-17 07:07:24 +0000805
mistachkine45e0fb2015-01-21 00:48:46 +0000806# If we are linking to the RPCRT4 library, enable features that need it.
807#
808!IF $(USE_RPCRT4_LIB)!=0
809REQ_FEATURE_FLAGS = $(REQ_FEATURE_FLAGS) -DSQLITE_WIN32_USE_UUID=1
810!ENDIF
811
mistachkin4712c212014-05-09 20:51:17 +0000812# Add the required and optional SQLite compilation options into the command
813# lines used to invoke the MSVC code and resource compilers.
814#
mistachkinedcb4eb2016-01-22 01:25:15 +0000815TCC = $(TCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS)
816RCC = $(RCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS)
shanehb2f20bf2011-06-17 07:07:24 +0000817
mistachkin4712c212014-05-09 20:51:17 +0000818# Add in any optional parameters specified on the commane line, e.g.
819# nmake /f Makefile.msc all "OPTS=-DSQLITE_ENABLE_FOO=1 -DSQLITE_OMIT_FOO=1"
820#
shanehb2f20bf2011-06-17 07:07:24 +0000821TCC = $(TCC) $(OPTS)
mistachkin4d9d1f42012-09-03 10:32:32 +0000822RCC = $(RCC) $(OPTS)
shanehb2f20bf2011-06-17 07:07:24 +0000823
mistachkin8bcd3fa2013-08-29 01:03:38 +0000824# If compiling for debugging, add some defines.
mistachkin4712c212014-05-09 20:51:17 +0000825#
mistachkincd54bab2014-12-20 21:14:14 +0000826!IF $(DEBUG)>1
mistachkin8bcd3fa2013-08-29 01:03:38 +0000827TCC = $(TCC) -D_DEBUG
828BCC = $(BCC) -D_DEBUG
mistachkin4d9d1f42012-09-03 10:32:32 +0000829RCC = $(RCC) -D_DEBUG
mistachkin4d60be52011-08-26 05:40:31 +0000830!ENDIF
831
mistachkin8bcd3fa2013-08-29 01:03:38 +0000832# If optimizations are enabled or disabled (either implicitly or
833# explicitly), add the necessary flags.
mistachkin4712c212014-05-09 20:51:17 +0000834#
mistachkincd54bab2014-12-20 21:14:14 +0000835!IF $(DEBUG)>1 || $(OPTIMIZATIONS)==0
mistachkin8bcd3fa2013-08-29 01:03:38 +0000836TCC = $(TCC) -Od
837BCC = $(BCC) -Od
838!ELSEIF $(OPTIMIZATIONS)>=3
839TCC = $(TCC) -Ox
840BCC = $(BCC) -Ox
841!ELSEIF $(OPTIMIZATIONS)==2
842TCC = $(TCC) -O2
843BCC = $(BCC) -O2
844!ELSEIF $(OPTIMIZATIONS)==1
845TCC = $(TCC) -O1
846BCC = $(BCC) -O1
847!ENDIF
848
849# If symbols are enabled (or compiling for debugging), enable PDBs.
mistachkin4712c212014-05-09 20:51:17 +0000850#
mistachkincd54bab2014-12-20 21:14:14 +0000851!IF $(DEBUG)>1 || $(SYMBOLS)!=0
mistachkin4d60be52011-08-26 05:40:31 +0000852TCC = $(TCC) -Zi
mistachkinfec360a2012-04-18 10:29:21 +0000853BCC = $(BCC) -Zi
mistachkin753c5442011-08-25 02:02:25 +0000854!ENDIF
855
mistachkin3e786092016-01-23 07:53:04 +0000856# <<mark>>
mistachkinc756ded2011-10-02 05:23:16 +0000857# If ICU support is enabled, add the compiler options for it.
mistachkin4712c212014-05-09 20:51:17 +0000858#
mistachkinc756ded2011-10-02 05:23:16 +0000859!IF $(USE_ICU)!=0
860TCC = $(TCC) -DSQLITE_ENABLE_ICU=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000861RCC = $(RCC) -DSQLITE_ENABLE_ICU=1
mistachkinc756ded2011-10-02 05:23:16 +0000862TCC = $(TCC) -I$(TOP)\ext\icu
mistachkin4d9d1f42012-09-03 10:32:32 +0000863RCC = $(RCC) -I$(TOP)\ext\icu
mistachkinc756ded2011-10-02 05:23:16 +0000864TCC = $(TCC) -I$(ICUINCDIR)
mistachkin4d9d1f42012-09-03 10:32:32 +0000865RCC = $(RCC) -I$(ICUINCDIR)
mistachkinc756ded2011-10-02 05:23:16 +0000866!ENDIF
mistachkin3e786092016-01-23 07:53:04 +0000867# <</mark>>
mistachkinc756ded2011-10-02 05:23:16 +0000868
mistachkin4d9d1f42012-09-03 10:32:32 +0000869# Command line prefixes for compiling code, compiling resources,
870# linking, etc.
mistachkin4712c212014-05-09 20:51:17 +0000871#
shanehb2f20bf2011-06-17 07:07:24 +0000872LTCOMPILE = $(TCC) -Fo$@
mistachkin4d9d1f42012-09-03 10:32:32 +0000873LTRCOMPILE = $(RCC) -r
shanehb2f20bf2011-06-17 07:07:24 +0000874LTLIB = lib.exe
shaneh2a0b9ef2011-06-20 20:52:32 +0000875LTLINK = $(TCC) -Fe$@
876
mistachkine45e0fb2015-01-21 00:48:46 +0000877# If requested, link to the RPCRT4 library.
878#
879!IF $(USE_RPCRT4_LIB)!=0
880LTLINK = $(LTLINK) rpcrt4.lib
881!ENDIF
882
shaneh2a0b9ef2011-06-20 20:52:32 +0000883# If a platform was set, force the linker to target that.
884# Note that the vcvars*.bat family of batch files typically
885# set this for you. Otherwise, the linker will attempt
886# to deduce the binary type based on the object files.
mistachkine37f99c2012-06-30 16:22:05 +0000887!IFDEF PLATFORM
mistachkin44723ce2015-03-21 02:22:37 +0000888LTLINKOPTS = /NOLOGO /MACHINE:$(PLATFORM)
889LTLIBOPTS = /NOLOGO /MACHINE:$(PLATFORM)
890!ELSE
891LTLINKOPTS = /NOLOGO
892LTLIBOPTS = /NOLOGO
shaneh2a0b9ef2011-06-20 20:52:32 +0000893!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000894
mistachkina6ff8572012-04-17 21:00:12 +0000895# When compiling for use in the WinRT environment, the following
896# linker option must be used to mark the executable as runnable
897# only in the context of an application container.
898#
899!IF $(FOR_WINRT)!=0
900LTLINKOPTS = $(LTLINKOPTS) /APPCONTAINER
mistachkin318d38c2015-04-22 01:33:53 +0000901!IF "$(VISUALSTUDIOVERSION)"=="12.0" || "$(VISUALSTUDIOVERSION)"=="14.0"
mistachkinf6a23422014-05-05 20:24:34 +0000902!IFNDEF STORELIBPATH
mistachkinda5b1cd2013-07-10 19:39:02 +0000903!IF "$(PLATFORM)"=="x86"
mistachkin4712c212014-05-09 20:51:17 +0000904STORELIBPATH = $(CRTLIBPATH)\store
mistachkinda5b1cd2013-07-10 19:39:02 +0000905!ELSEIF "$(PLATFORM)"=="x64"
mistachkin4712c212014-05-09 20:51:17 +0000906STORELIBPATH = $(CRTLIBPATH)\store\amd64
mistachkin4eaa1292013-07-10 21:33:25 +0000907!ELSEIF "$(PLATFORM)"=="ARM"
mistachkin4712c212014-05-09 20:51:17 +0000908STORELIBPATH = $(CRTLIBPATH)\store\arm
mistachkin4eaa1292013-07-10 21:33:25 +0000909!ELSE
mistachkin4712c212014-05-09 20:51:17 +0000910STORELIBPATH = $(CRTLIBPATH)\store
mistachkinda5b1cd2013-07-10 19:39:02 +0000911!ENDIF
912!ENDIF
mistachkinf6a23422014-05-05 20:24:34 +0000913STORELIBPATH = $(STORELIBPATH:\\=\)
914LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(STORELIBPATH)"
915!ENDIF
mistachkina6ff8572012-04-17 21:00:12 +0000916!ENDIF
917
mistachkind9b3c542014-05-09 23:31:55 +0000918# When compiling for Windows Phone 8.1, an extra library path is
919# required.
920#
921!IF $(USE_WP81_OPTS)!=0
922!IFNDEF WP81LIBPATH
923!IF "$(PLATFORM)"=="x86"
924WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86
925!ELSEIF "$(PLATFORM)"=="ARM"
926WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\ARM
927!ELSE
928WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86
mistachkinc756ded2011-10-02 05:23:16 +0000929!ENDIF
mistachkin31856a32012-07-27 07:13:25 +0000930!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000931!ENDIF
932
mistachkind9b3c542014-05-09 23:31:55 +0000933# When compiling for Windows Phone 8.1, some extra linker options
934# are also required.
935#
936!IF $(USE_WP81_OPTS)!=0
937!IFDEF WP81LIBPATH
938LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(WP81LIBPATH)"
939!ENDIF
940LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE
941LTLINKOPTS = $(LTLINKOPTS) WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelHost.lib
942LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:kernel32.lib /NODEFAULTLIB:ole32.lib
943!ENDIF
944
mistachkina819aed2016-02-12 05:19:29 +0000945# When compiling for UWP or the Windows 10 platform, some extra linker
mistachkin55e88d92016-02-08 20:40:57 +0000946# options are also required.
mistachkin318d38c2015-04-22 01:33:53 +0000947#
mistachkina819aed2016-02-12 05:19:29 +0000948!IF $(FOR_UWP)!=0 || $(FOR_WIN10)!=0
mistachkin318d38c2015-04-22 01:33:53 +0000949LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE /NODEFAULTLIB:kernel32.lib
950LTLINKOPTS = $(LTLINKOPTS) mincore.lib
951!IFDEF PSDKLIBPATH
952LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(PSDKLIBPATH)"
953!ENDIF
954!ENDIF
955
mistachkina6f28892016-02-05 19:40:23 +0000956!IF $(FOR_WIN10)!=0
mistachkin406eeff2016-02-09 18:28:20 +0000957LTLINKOPTS = $(LTLINKOPTS) /guard:cf "/LIBPATH:$(UCRTLIBPATH)"
mistachkina6f28892016-02-05 19:40:23 +0000958!IF $(DEBUG)>1
959LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:libucrtd.lib /DEFAULTLIB:ucrtd.lib
960!ELSE
961LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib
962!ENDIF
963!ENDIF
964
shanehb2f20bf2011-06-17 07:07:24 +0000965# If either debugging or symbols are enabled, enable PDBs.
mistachkin4712c212014-05-09 20:51:17 +0000966#
mistachkincd54bab2014-12-20 21:14:14 +0000967!IF $(DEBUG)>1 || $(SYMBOLS)!=0
mistachkinf170ea42015-10-16 20:13:57 +0000968LDFLAGS = /DEBUG $(LDOPTS)
969!ELSE
970LDFLAGS = $(LDOPTS)
shanehb2f20bf2011-06-17 07:07:24 +0000971!ENDIF
972
mistachkin3e786092016-01-23 07:53:04 +0000973# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +0000974# Start with the Tcl related linker options.
mistachkin4712c212014-05-09 20:51:17 +0000975#
shanehb2f20bf2011-06-17 07:07:24 +0000976!IF $(NO_TCL)==0
977LTLIBPATHS = /LIBPATH:$(TCLLIBDIR)
978LTLIBS = $(LIBTCL)
mistachkin31856a32012-07-27 07:13:25 +0000979!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000980
981# If ICU support is enabled, add the linker options for it.
mistachkin4712c212014-05-09 20:51:17 +0000982#
shanehb2f20bf2011-06-17 07:07:24 +0000983!IF $(USE_ICU)!=0
984LTLIBPATHS = $(LTLIBPATHS) /LIBPATH:$(ICULIBDIR)
985LTLIBS = $(LTLIBS) $(LIBICU)
986!ENDIF
mistachkin3e786092016-01-23 07:53:04 +0000987# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +0000988
shanehb2f20bf2011-06-17 07:07:24 +0000989# You should not have to change anything below this line
990###############################################################################
991
mistachkin3e786092016-01-23 07:53:04 +0000992# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +0000993# Object files for the SQLite library (non-amalgamation).
994#
mistachkinf67feef2013-07-29 19:03:20 +0000995LIBOBJS0 = vdbe.lo parse.lo alter.lo analyze.lo attach.lo auth.lo \
shanehb2f20bf2011-06-17 07:07:24 +0000996 backup.lo bitvec.lo btmutex.lo btree.lo build.lo \
drh1a4a6802015-05-04 18:31:09 +0000997 callback.lo complete.lo ctime.lo date.lo dbstat.lo delete.lo \
shanehb2f20bf2011-06-17 07:07:24 +0000998 expr.lo fault.lo fkey.lo \
drh391d4ba2012-05-28 20:22:16 +0000999 fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo \
1000 fts3_porter.lo fts3_snippet.lo fts3_tokenizer.lo fts3_tokenizer1.lo \
drh4d648c72013-04-22 17:07:56 +00001001 fts3_tokenize_vtab.lo fts3_unicode.lo fts3_unicode2.lo fts3_write.lo \
mistachkined52f9f2015-06-26 04:34:36 +00001002 fts5.lo \
shanehb2f20bf2011-06-17 07:07:24 +00001003 func.lo global.lo hash.lo \
drhc2f18ad2016-03-05 15:35:09 +00001004 icu.lo insert.lo legacy.lo loadext.lo \
shanehb2f20bf2011-06-17 07:07:24 +00001005 main.lo malloc.lo mem0.lo mem1.lo mem2.lo mem3.lo mem5.lo \
1006 memjournal.lo \
mistachkinf1c6bc52012-06-21 15:09:20 +00001007 mutex.lo mutex_noop.lo mutex_unix.lo mutex_w32.lo \
1008 notify.lo opcodes.lo os.lo os_unix.lo os_win.lo \
mistachkinf67feef2013-07-29 19:03:20 +00001009 pager.lo pcache.lo pcache1.lo pragma.lo prepare.lo printf.lo \
drh498dcae2013-03-13 11:42:00 +00001010 random.lo resolve.lo rowset.lo rtree.lo \
drhcb75bff2016-01-14 14:48:17 +00001011 sqlite3session.lo select.lo sqlite3rbu.lo status.lo \
drh38b41492015-06-08 15:08:15 +00001012 table.lo threads.lo tokenize.lo treeview.lo trigger.lo \
shanehb2f20bf2011-06-17 07:07:24 +00001013 update.lo util.lo vacuum.lo \
mistachkinf67feef2013-07-29 19:03:20 +00001014 vdbeapi.lo vdbeaux.lo vdbeblob.lo vdbemem.lo vdbesort.lo \
drh6c1f4ef2015-06-08 14:23:15 +00001015 vdbetrace.lo wal.lo walker.lo where.lo wherecode.lo whereexpr.lo \
1016 utf.lo vtab.lo
mistachkin3e786092016-01-23 07:53:04 +00001017# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001018
1019# Object files for the amalgamation.
1020#
1021LIBOBJS1 = sqlite3.lo
1022
1023# Determine the real value of LIBOBJ based on the 'configure' script
1024#
mistachkin3e786092016-01-23 07:53:04 +00001025# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001026!IF $(USE_AMALGAMATION)==0
1027LIBOBJ = $(LIBOBJS0)
1028!ELSE
mistachkin3e786092016-01-23 07:53:04 +00001029# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001030LIBOBJ = $(LIBOBJS1)
mistachkin3e786092016-01-23 07:53:04 +00001031# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001032!ENDIF
mistachkin3e786092016-01-23 07:53:04 +00001033# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001034
mistachkin08c1c312012-10-06 03:48:25 +00001035# Determine if embedded resource compilation and usage are enabled.
1036#
1037!IF $(USE_RC)!=0
1038LIBRESOBJS = sqlite3res.lo
1039!ELSE
1040LIBRESOBJS =
1041!ENDIF
1042
mistachkin3e786092016-01-23 07:53:04 +00001043# <<mark>>
mistachkinc04c54b2016-02-11 21:28:16 +00001044# Core source code files, part 1.
shanehb2f20bf2011-06-17 07:07:24 +00001045#
mistachkinc04c54b2016-02-11 21:28:16 +00001046SRC00 = \
shanehb2f20bf2011-06-17 07:07:24 +00001047 $(TOP)\src\alter.c \
1048 $(TOP)\src\analyze.c \
1049 $(TOP)\src\attach.c \
1050 $(TOP)\src\auth.c \
1051 $(TOP)\src\backup.c \
1052 $(TOP)\src\bitvec.c \
1053 $(TOP)\src\btmutex.c \
1054 $(TOP)\src\btree.c \
shanehb2f20bf2011-06-17 07:07:24 +00001055 $(TOP)\src\build.c \
1056 $(TOP)\src\callback.c \
1057 $(TOP)\src\complete.c \
1058 $(TOP)\src\ctime.c \
1059 $(TOP)\src\date.c \
drh1a4a6802015-05-04 18:31:09 +00001060 $(TOP)\src\dbstat.c \
shanehb2f20bf2011-06-17 07:07:24 +00001061 $(TOP)\src\delete.c \
1062 $(TOP)\src\expr.c \
1063 $(TOP)\src\fault.c \
1064 $(TOP)\src\fkey.c \
1065 $(TOP)\src\func.c \
1066 $(TOP)\src\global.c \
1067 $(TOP)\src\hash.c \
shanehb2f20bf2011-06-17 07:07:24 +00001068 $(TOP)\src\insert.c \
shanehb2f20bf2011-06-17 07:07:24 +00001069 $(TOP)\src\legacy.c \
1070 $(TOP)\src\loadext.c \
1071 $(TOP)\src\main.c \
1072 $(TOP)\src\malloc.c \
1073 $(TOP)\src\mem0.c \
1074 $(TOP)\src\mem1.c \
1075 $(TOP)\src\mem2.c \
1076 $(TOP)\src\mem3.c \
1077 $(TOP)\src\mem5.c \
1078 $(TOP)\src\memjournal.c \
1079 $(TOP)\src\mutex.c \
shanehb2f20bf2011-06-17 07:07:24 +00001080 $(TOP)\src\mutex_noop.c \
shanehb2f20bf2011-06-17 07:07:24 +00001081 $(TOP)\src\mutex_unix.c \
1082 $(TOP)\src\mutex_w32.c \
1083 $(TOP)\src\notify.c \
1084 $(TOP)\src\os.c \
shanehb2f20bf2011-06-17 07:07:24 +00001085 $(TOP)\src\os_unix.c \
mistachkinc04c54b2016-02-11 21:28:16 +00001086 $(TOP)\src\os_win.c
1087
1088# Core source code files, part 2.
1089#
1090SRC01 = \
shanehb2f20bf2011-06-17 07:07:24 +00001091 $(TOP)\src\pager.c \
shanehb2f20bf2011-06-17 07:07:24 +00001092 $(TOP)\src\pcache.c \
shanehb2f20bf2011-06-17 07:07:24 +00001093 $(TOP)\src\pcache1.c \
1094 $(TOP)\src\pragma.c \
1095 $(TOP)\src\prepare.c \
1096 $(TOP)\src\printf.c \
1097 $(TOP)\src\random.c \
1098 $(TOP)\src\resolve.c \
1099 $(TOP)\src\rowset.c \
1100 $(TOP)\src\select.c \
1101 $(TOP)\src\status.c \
shanehb2f20bf2011-06-17 07:07:24 +00001102 $(TOP)\src\table.c \
drhf51446a2012-07-21 19:40:42 +00001103 $(TOP)\src\threads.c \
shanehb2f20bf2011-06-17 07:07:24 +00001104 $(TOP)\src\tclsqlite.c \
1105 $(TOP)\src\tokenize.c \
drh38b41492015-06-08 15:08:15 +00001106 $(TOP)\src\treeview.c \
shanehb2f20bf2011-06-17 07:07:24 +00001107 $(TOP)\src\trigger.c \
1108 $(TOP)\src\utf.c \
1109 $(TOP)\src\update.c \
1110 $(TOP)\src\util.c \
1111 $(TOP)\src\vacuum.c \
1112 $(TOP)\src\vdbe.c \
shanehb2f20bf2011-06-17 07:07:24 +00001113 $(TOP)\src\vdbeapi.c \
1114 $(TOP)\src\vdbeaux.c \
1115 $(TOP)\src\vdbeblob.c \
1116 $(TOP)\src\vdbemem.c \
mistachkin81c428a2011-08-17 02:19:54 +00001117 $(TOP)\src\vdbesort.c \
shanehb2f20bf2011-06-17 07:07:24 +00001118 $(TOP)\src\vdbetrace.c \
shanehb2f20bf2011-06-17 07:07:24 +00001119 $(TOP)\src\vtab.c \
1120 $(TOP)\src\wal.c \
shanehb2f20bf2011-06-17 07:07:24 +00001121 $(TOP)\src\walker.c \
drhe54df422013-11-12 18:37:25 +00001122 $(TOP)\src\where.c \
drh6f82e852015-06-06 20:12:09 +00001123 $(TOP)\src\wherecode.c \
mistachkinc04c54b2016-02-11 21:28:16 +00001124 $(TOP)\src\whereexpr.c
1125
1126# Shell source code files.
1127#
1128SRC02 = \
1129 $(TOP)\src\shell.c
1130
1131# Core miscellaneous files.
1132#
1133SRC03 = \
1134 $(TOP)\src\parse.y
1135
1136# Core header files, part 1.
1137#
1138SRC04 = \
1139 $(TOP)\src\btree.h \
1140 $(TOP)\src\btreeInt.h \
1141 $(TOP)\src\hash.h \
1142 $(TOP)\src\hwtime.h \
1143 $(TOP)\src\msvc.h \
1144 $(TOP)\src\mutex.h \
1145 $(TOP)\src\os.h \
1146 $(TOP)\src\os_common.h \
1147 $(TOP)\src\os_setup.h \
1148 $(TOP)\src\os_win.h
1149
1150# Core header files, part 2.
1151#
1152SRC05 = \
1153 $(TOP)\src\pager.h \
1154 $(TOP)\src\pcache.h \
1155 $(TOP)\src\pragma.h \
1156 $(TOP)\src\sqlite.h.in \
1157 $(TOP)\src\sqlite3ext.h \
1158 $(TOP)\src\sqliteInt.h \
1159 $(TOP)\src\sqliteLimit.h \
1160 $(TOP)\src\vdbe.h \
1161 $(TOP)\src\vdbeInt.h \
1162 $(TOP)\src\vxworks.h \
1163 $(TOP)\src\wal.h \
drhe54df422013-11-12 18:37:25 +00001164 $(TOP)\src\whereInt.h
shanehb2f20bf2011-06-17 07:07:24 +00001165
mistachkinc04c54b2016-02-11 21:28:16 +00001166# Extension source code files, part 1.
shanehb2f20bf2011-06-17 07:07:24 +00001167#
mistachkinc04c54b2016-02-11 21:28:16 +00001168SRC06 = \
shanehb2f20bf2011-06-17 07:07:24 +00001169 $(TOP)\ext\fts1\fts1.c \
shanehb2f20bf2011-06-17 07:07:24 +00001170 $(TOP)\ext\fts1\fts1_hash.c \
shanehb2f20bf2011-06-17 07:07:24 +00001171 $(TOP)\ext\fts1\fts1_porter.c \
drh62679202015-01-29 18:38:05 +00001172 $(TOP)\ext\fts1\fts1_tokenizer1.c \
shanehb2f20bf2011-06-17 07:07:24 +00001173 $(TOP)\ext\fts2\fts2.c \
shanehb2f20bf2011-06-17 07:07:24 +00001174 $(TOP)\ext\fts2\fts2_hash.c \
shanehb2f20bf2011-06-17 07:07:24 +00001175 $(TOP)\ext\fts2\fts2_icu.c \
1176 $(TOP)\ext\fts2\fts2_porter.c \
shanehb2f20bf2011-06-17 07:07:24 +00001177 $(TOP)\ext\fts2\fts2_tokenizer.c \
1178 $(TOP)\ext\fts2\fts2_tokenizer1.c
mistachkinc04c54b2016-02-11 21:28:16 +00001179
1180# Extension source code files, part 2.
1181#
1182SRC07 = \
shanehb2f20bf2011-06-17 07:07:24 +00001183 $(TOP)\ext\fts3\fts3.c \
shanehb2f20bf2011-06-17 07:07:24 +00001184 $(TOP)\ext\fts3\fts3_aux.c \
1185 $(TOP)\ext\fts3\fts3_expr.c \
1186 $(TOP)\ext\fts3\fts3_hash.c \
shanehb2f20bf2011-06-17 07:07:24 +00001187 $(TOP)\ext\fts3\fts3_icu.c \
1188 $(TOP)\ext\fts3\fts3_porter.c \
1189 $(TOP)\ext\fts3\fts3_snippet.c \
shanehb2f20bf2011-06-17 07:07:24 +00001190 $(TOP)\ext\fts3\fts3_tokenizer.c \
1191 $(TOP)\ext\fts3\fts3_tokenizer1.c \
drh4d648c72013-04-22 17:07:56 +00001192 $(TOP)\ext\fts3\fts3_tokenize_vtab.c \
drh391d4ba2012-05-28 20:22:16 +00001193 $(TOP)\ext\fts3\fts3_unicode.c \
1194 $(TOP)\ext\fts3\fts3_unicode2.c \
drh62679202015-01-29 18:38:05 +00001195 $(TOP)\ext\fts3\fts3_write.c \
drh62679202015-01-29 18:38:05 +00001196 $(TOP)\ext\icu\icu.c \
drhedea9112015-03-24 19:02:13 +00001197 $(TOP)\ext\rtree\rtree.c \
drhdbbd8162015-05-19 23:04:26 +00001198 $(TOP)\ext\session\sqlite3session.c \
drh50065652015-10-08 19:29:18 +00001199 $(TOP)\ext\rbu\sqlite3rbu.c \
1200 $(TOP)\ext\misc\json1.c
shanehb2f20bf2011-06-17 07:07:24 +00001201
mistachkinc04c54b2016-02-11 21:28:16 +00001202# Extension header files, part 1.
1203#
1204SRC08 = \
1205 $(TOP)\ext\fts1\fts1.h \
1206 $(TOP)\ext\fts1\fts1_hash.h \
1207 $(TOP)\ext\fts1\fts1_tokenizer.h \
1208 $(TOP)\ext\fts2\fts2.h \
1209 $(TOP)\ext\fts2\fts2_hash.h \
1210 $(TOP)\ext\fts2\fts2_tokenizer.h
1211
1212# Extension header files, part 2.
1213#
1214SRC09 = \
1215 $(TOP)\ext\fts3\fts3.h \
1216 $(TOP)\ext\fts3\fts3Int.h \
1217 $(TOP)\ext\fts3\fts3_hash.h \
1218 $(TOP)\ext\fts3\fts3_tokenizer.h \
1219 $(TOP)\ext\icu\sqliteicu.h \
1220 $(TOP)\ext\rtree\rtree.h \
mistachkin05004782016-03-30 16:23:06 +00001221 $(TOP)\ext\rbu\sqlite3rbu.h \
1222 $(TOP)\ext\session\sqlite3session.h
shanehb2f20bf2011-06-17 07:07:24 +00001223
1224# Generated source code files
1225#
mistachkinc04c54b2016-02-11 21:28:16 +00001226SRC10 = \
shanehb2f20bf2011-06-17 07:07:24 +00001227 opcodes.c \
mistachkinc04c54b2016-02-11 21:28:16 +00001228 parse.c
1229
1230# Generated header files
1231#
1232SRC11 = \
1233 keywordhash.h \
shanehb2f20bf2011-06-17 07:07:24 +00001234 opcodes.h \
shanehb2f20bf2011-06-17 07:07:24 +00001235 parse.h \
mistachkin5d4d9412016-01-22 03:54:36 +00001236 $(SQLITE3H)
shanehb2f20bf2011-06-17 07:07:24 +00001237
drh62679202015-01-29 18:38:05 +00001238# All source code files.
1239#
mistachkinc04c54b2016-02-11 21:28:16 +00001240SRC = $(SRC00) $(SRC01) $(SRC02) $(SRC03) $(SRC04) $(SRC05) $(SRC06) $(SRC07) $(SRC08) $(SRC09) $(SRC10) $(SRC11)
drh62679202015-01-29 18:38:05 +00001241
shanehb2f20bf2011-06-17 07:07:24 +00001242# Source code to the test files.
1243#
1244TESTSRC = \
1245 $(TOP)\src\test1.c \
1246 $(TOP)\src\test2.c \
1247 $(TOP)\src\test3.c \
1248 $(TOP)\src\test4.c \
1249 $(TOP)\src\test5.c \
1250 $(TOP)\src\test6.c \
1251 $(TOP)\src\test7.c \
1252 $(TOP)\src\test8.c \
1253 $(TOP)\src\test9.c \
1254 $(TOP)\src\test_autoext.c \
1255 $(TOP)\src\test_async.c \
1256 $(TOP)\src\test_backup.c \
drhddebf162016-03-04 02:59:35 +00001257 $(TOP)\src\test_bestindex.c \
drh5de7d962014-12-05 00:17:39 +00001258 $(TOP)\src\test_blob.c \
shanehb2f20bf2011-06-17 07:07:24 +00001259 $(TOP)\src\test_btree.c \
1260 $(TOP)\src\test_config.c \
1261 $(TOP)\src\test_demovfs.c \
1262 $(TOP)\src\test_devsym.c \
mistachkin413c63b2013-01-17 03:18:14 +00001263 $(TOP)\src\test_fs.c \
shanehb2f20bf2011-06-17 07:07:24 +00001264 $(TOP)\src\test_func.c \
shanehb2f20bf2011-06-17 07:07:24 +00001265 $(TOP)\src\test_hexio.c \
1266 $(TOP)\src\test_init.c \
1267 $(TOP)\src\test_intarray.c \
1268 $(TOP)\src\test_journal.c \
1269 $(TOP)\src\test_malloc.c \
1270 $(TOP)\src\test_multiplex.c \
1271 $(TOP)\src\test_mutex.c \
1272 $(TOP)\src\test_onefile.c \
1273 $(TOP)\src\test_osinst.c \
1274 $(TOP)\src\test_pcache.c \
1275 $(TOP)\src\test_quota.c \
1276 $(TOP)\src\test_rtree.c \
1277 $(TOP)\src\test_schema.c \
1278 $(TOP)\src\test_server.c \
1279 $(TOP)\src\test_superlock.c \
1280 $(TOP)\src\test_syscall.c \
shanehb2f20bf2011-06-17 07:07:24 +00001281 $(TOP)\src\test_tclvar.c \
1282 $(TOP)\src\test_thread.c \
1283 $(TOP)\src\test_vfs.c \
mistachkin92af1eb2015-11-30 23:29:07 +00001284 $(TOP)\src\test_windirent.c \
shanehb2f20bf2011-06-17 07:07:24 +00001285 $(TOP)\src\test_wsd.c \
1286 $(TOP)\ext\fts3\fts3_term.c \
mistachkinadb96a62012-01-16 12:33:36 +00001287 $(TOP)\ext\fts3\fts3_test.c \
mistachkin05004782016-03-30 16:23:06 +00001288 $(TOP)\ext\rbu\test_rbu.c \
1289 $(TOP)\ext\session\test_session.c
shanehb2f20bf2011-06-17 07:07:24 +00001290
mistachkinc04c54b2016-02-11 21:28:16 +00001291# Statically linked extensions.
drhe50db1c2013-04-25 14:31:46 +00001292#
drh1fb64af2013-04-25 14:36:28 +00001293TESTEXT = \
drh8416fc72013-04-25 16:42:55 +00001294 $(TOP)\ext\misc\amatch.c \
drh2e3f87a2016-07-03 02:35:47 +00001295 $(TOP)\ext\misc\carray.c \
drh8416fc72013-04-25 16:42:55 +00001296 $(TOP)\ext\misc\closure.c \
drh35db31b2016-06-02 23:13:21 +00001297 $(TOP)\ext\misc\csv.c \
drh1728bcb2014-11-10 16:49:56 +00001298 $(TOP)\ext\misc\eval.c \
drh51ed2982014-06-16 12:44:32 +00001299 $(TOP)\ext\misc\fileio.c \
drhe50db1c2013-04-25 14:31:46 +00001300 $(TOP)\ext\misc\fuzzer.c \
mistachkined52f9f2015-06-26 04:34:36 +00001301 $(TOP)\ext\fts5\fts5_tcl.c \
dand3789c02015-08-04 20:29:00 +00001302 $(TOP)\ext\fts5\fts5_test_mi.c \
dan2cfe0492016-01-14 20:05:59 +00001303 $(TOP)\ext\fts5\fts5_test_tok.c \
drh8416fc72013-04-25 16:42:55 +00001304 $(TOP)\ext\misc\ieee754.c \
drhea41dc42013-04-25 19:31:33 +00001305 $(TOP)\ext\misc\nextchar.c \
drhdef33672013-05-28 20:25:54 +00001306 $(TOP)\ext\misc\percentile.c \
drhe50db1c2013-04-25 14:31:46 +00001307 $(TOP)\ext\misc\regexp.c \
drh398f8722015-08-19 13:54:20 +00001308 $(TOP)\ext\misc\series.c \
drhb7045ab2013-04-25 14:59:01 +00001309 $(TOP)\ext\misc\spellfix.c \
drh5f8cdac2013-10-14 21:14:42 +00001310 $(TOP)\ext\misc\totype.c \
drhe50db1c2013-04-25 14:31:46 +00001311 $(TOP)\ext\misc\wholenumber.c
1312
shanehb2f20bf2011-06-17 07:07:24 +00001313# Source code to the library files needed by the test fixture
mistachkinadb96a62012-01-16 12:33:36 +00001314# (non-amalgamation)
shanehb2f20bf2011-06-17 07:07:24 +00001315#
1316TESTSRC2 = \
mistachkinc04c54b2016-02-11 21:28:16 +00001317 $(SRC00) \
1318 $(SRC01) \
1319 $(SRC06) \
1320 $(SRC07) \
1321 $(SRC10) \
mistachkin05004782016-03-30 16:23:06 +00001322 $(TOP)\ext\async\sqlite3async.c
shanehb2f20bf2011-06-17 07:07:24 +00001323
1324# Header files used by all library source files.
1325#
1326HDR = \
1327 $(TOP)\src\btree.h \
1328 $(TOP)\src\btreeInt.h \
1329 $(TOP)\src\hash.h \
1330 $(TOP)\src\hwtime.h \
1331 keywordhash.h \
mistachkin2318d332015-01-12 18:02:52 +00001332 $(TOP)\src\msvc.h \
shanehb2f20bf2011-06-17 07:07:24 +00001333 $(TOP)\src\mutex.h \
1334 opcodes.h \
1335 $(TOP)\src\os.h \
1336 $(TOP)\src\os_common.h \
mistachkinf74b9e02013-11-26 01:00:31 +00001337 $(TOP)\src\os_setup.h \
mistachkin8bc52622013-11-25 09:36:07 +00001338 $(TOP)\src\os_win.h \
shanehb2f20bf2011-06-17 07:07:24 +00001339 $(TOP)\src\pager.h \
1340 $(TOP)\src\pcache.h \
shaneh6e7850c2011-06-17 15:57:07 +00001341 parse.h \
drh67e65e52015-02-02 21:34:54 +00001342 $(TOP)\src\pragma.h \
mistachkin5d4d9412016-01-22 03:54:36 +00001343 $(SQLITE3H) \
shanehb2f20bf2011-06-17 07:07:24 +00001344 $(TOP)\src\sqlite3ext.h \
shaneh6e7850c2011-06-17 15:57:07 +00001345 $(TOP)\src\sqliteInt.h \
shanehb2f20bf2011-06-17 07:07:24 +00001346 $(TOP)\src\sqliteLimit.h \
1347 $(TOP)\src\vdbe.h \
drhe54df422013-11-12 18:37:25 +00001348 $(TOP)\src\vdbeInt.h \
drh8cd5b252015-03-02 22:06:43 +00001349 $(TOP)\src\vxworks.h \
drhe54df422013-11-12 18:37:25 +00001350 $(TOP)\src\whereInt.h
shanehb2f20bf2011-06-17 07:07:24 +00001351
1352# Header files used by extensions
1353#
1354EXTHDR = $(EXTHDR) \
1355 $(TOP)\ext\fts1\fts1.h \
1356 $(TOP)\ext\fts1\fts1_hash.h \
1357 $(TOP)\ext\fts1\fts1_tokenizer.h
1358EXTHDR = $(EXTHDR) \
1359 $(TOP)\ext\fts2\fts2.h \
1360 $(TOP)\ext\fts2\fts2_hash.h \
1361 $(TOP)\ext\fts2\fts2_tokenizer.h
1362EXTHDR = $(EXTHDR) \
1363 $(TOP)\ext\fts3\fts3.h \
1364 $(TOP)\ext\fts3\fts3Int.h \
1365 $(TOP)\ext\fts3\fts3_hash.h \
1366 $(TOP)\ext\fts3\fts3_tokenizer.h
1367EXTHDR = $(EXTHDR) \
1368 $(TOP)\ext\rtree\rtree.h
1369EXTHDR = $(EXTHDR) \
1370 $(TOP)\ext\icu\sqliteicu.h
1371EXTHDR = $(EXTHDR) \
1372 $(TOP)\ext\rtree\sqlite3rtree.h
mistachkinadb96a62012-01-16 12:33:36 +00001373EXTHDR = $(EXTHDR) \
1374 $(TOP)\ext\session\sqlite3session.h
shanehb2f20bf2011-06-17 07:07:24 +00001375
mistachkind4ab1032015-05-11 16:27:33 +00001376# executables needed for testing
drhf4375442015-05-11 12:15:45 +00001377#
1378TESTPROGS = \
1379 testfixture.exe \
mistachkinedcb4eb2016-01-22 01:25:15 +00001380 $(SQLITE3EXE) \
drhf4375442015-05-11 12:15:45 +00001381 sqlite3_analyzer.exe \
drh290fcaa2016-06-08 01:03:05 +00001382 sqldiff.exe \
1383 dbhash.exe
drhf4375442015-05-11 12:15:45 +00001384
drhea93c702015-05-26 18:15:08 +00001385# Databases containing fuzzer test cases
1386#
1387FUZZDATA = \
1388 $(TOP)\test\fuzzdata1.db \
1389 $(TOP)\test\fuzzdata2.db \
drh64ff56f2015-09-23 11:59:50 +00001390 $(TOP)\test\fuzzdata3.db \
1391 $(TOP)\test\fuzzdata4.db
mistachkin3e786092016-01-23 07:53:04 +00001392# <</mark>>
drhea93c702015-05-26 18:15:08 +00001393
mistachkin5d4d9412016-01-22 03:54:36 +00001394# Additional compiler options for the shell. These are only effective
1395# when the shell is not being dynamically linked.
drhd7f2bea2015-09-19 14:32:51 +00001396#
mistachkin5d4d9412016-01-22 03:54:36 +00001397!IF $(DYNAMIC_SHELL)==0 && $(FOR_WIN10)==0
drhc5b67422016-08-04 01:47:01 +00001398SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_SHELL_JSON1 -DSQLITE_ENABLE_FTS4
1399# SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_FTS5
1400SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_EXPLAIN_COMMENTS
1401SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
mistachkinedcb4eb2016-01-22 01:25:15 +00001402!ENDIF
1403
mistachkin3e786092016-01-23 07:53:04 +00001404# <<mark>>
mistachkin5d4d9412016-01-22 03:54:36 +00001405# Extra compiler options for various test tools.
1406#
1407MPTESTER_COMPILE_OPTS = -DSQLITE_SHELL_JSON1 -DSQLITE_ENABLE_FTS5
mistachkin8381be42015-10-09 14:23:56 +00001408FUZZERSHELL_COMPILE_OPTS = -DSQLITE_ENABLE_JSON1
drh9d4c9822016-01-05 03:39:52 +00001409FUZZCHECK_COMPILE_OPTS = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMSYS5
drhf4375442015-05-11 12:15:45 +00001410
mistachkin5d4d9412016-01-22 03:54:36 +00001411# Standard options to testfixture.
drh905da632015-06-10 18:53:09 +00001412#
1413TESTOPTS = --verbose=file --output=test-out.txt
drhf4375442015-05-11 12:15:45 +00001414
mistachkind5be6f02016-01-27 07:28:33 +00001415# Extra targets for the "all" target that require Tcl.
1416#
1417!IF $(NO_TCL)==0
1418ALL_TCL_TARGETS = libtclsqlite3.lib
1419!ELSE
1420ALL_TCL_TARGETS =
1421!ENDIF
mistachkin3e786092016-01-23 07:53:04 +00001422# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001423
1424# This is the default Makefile target. The objects listed here
1425# are what get build when you type just "make" with no arguments.
1426#
mistachkind5be6f02016-01-27 07:28:33 +00001427all: dll libsqlite3.lib shell $(ALL_TCL_TARGETS)
shanehb2f20bf2011-06-17 07:07:24 +00001428
mistachkina8a18732016-01-22 22:16:50 +00001429# Dynamic link library section.
1430#
mistachkin9b88ace2016-02-26 21:01:37 +00001431dll: $(SQLITE3DLL)
mistachkina8a18732016-01-22 22:16:50 +00001432
1433# Shell executable.
1434#
mistachkin9b88ace2016-02-26 21:01:37 +00001435shell: $(SQLITE3EXE)
shanehb2f20bf2011-06-17 07:07:24 +00001436
mistachkinb0c99af2016-02-19 05:07:56 +00001437# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001438libsqlite3.lib: $(LIBOBJ)
shaneh29ebea82011-06-21 18:12:07 +00001439 $(LTLIB) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001440
1441libtclsqlite3.lib: tclsqlite.lo libsqlite3.lib
mistachkin5b663502015-10-10 23:39:55 +00001442 $(LTLIB) $(LTLIBOPTS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCLSTUB) $(TLIBS)
mistachkin3e786092016-01-23 07:53:04 +00001443# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001444
mistachkin9b88ace2016-02-26 21:01:37 +00001445$(SQLITE3DLL): $(LIBOBJ) $(LIBRESOBJS) $(CORE_LINK_DEP)
mistachkina8a18732016-01-22 22:16:50 +00001446 $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL $(CORE_LINK_OPTS) /OUT:$@ $(LIBOBJ) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001447
mistachkin9aeb9712016-02-26 23:13:16 +00001448# <<block2>>
mistachkin9b88ace2016-02-26 21:01:37 +00001449sqlite3.def: libsqlite3.lib
mistachkina8a18732016-01-22 22:16:50 +00001450 echo EXPORTS > sqlite3.def
1451 dumpbin /all libsqlite3.lib \
mistachkin9b88ace2016-02-26 21:01:37 +00001452 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl include "^\s+1 _?(sqlite3_[^@]*)(?:@\d+)?$$" \1 \
mistachkina8a18732016-01-22 22:16:50 +00001453 | sort >> sqlite3.def
mistachkin9aeb9712016-02-26 23:13:16 +00001454# <</block2>>
drhd62c0f42015-04-09 13:34:29 +00001455
mistachkin5d4d9412016-01-22 03:54:36 +00001456$(SQLITE3EXE): $(TOP)\src\shell.c $(SHELL_CORE_DEP) $(LIBRESOBJS) $(SHELL_CORE_SRC) $(SQLITE3H)
1457 $(LTLINK) $(SHELL_COMPILE_OPTS) $(READLINE_FLAGS) $(TOP)\src\shell.c $(SHELL_CORE_SRC) \
mistachkinedcb4eb2016-01-22 01:25:15 +00001458 /link $(SQLITE3EXEPDB) $(LDFLAGS) $(LTLINKOPTS) $(SHELL_LINK_OPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS)
drh268e72f2015-04-17 14:30:49 +00001459
mistachkin3e786092016-01-23 07:53:04 +00001460# <<mark>>
mistachkin5d4d9412016-01-22 03:54:36 +00001461sqldiff.exe: $(TOP)\tool\sqldiff.c $(SQLITE3C) $(SQLITE3H)
1462 $(LTLINK) $(NO_WARN) $(TOP)\tool\sqldiff.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
mistachkin44723ce2015-03-21 02:22:37 +00001463
drh290fcaa2016-06-08 01:03:05 +00001464dbhash.exe: $(TOP)\tool\dbhash.c $(SQLITE3C) $(SQLITE3H)
1465 $(LTLINK) $(NO_WARN) $(TOP)\tool\dbhash.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
1466
drhda110bf2016-05-05 17:15:23 +00001467scrub.exe: $(TOP)\ext\misc\scrub.c $(SQLITE3C) $(SQLITE3H)
1468 $(LTLINK) $(NO_WARN) $(TOP)\ext\misc\scrub.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
1469
drhfd0d93f2016-02-07 00:08:08 +00001470srcck1.exe: $(TOP)\tool\srcck1.c
1471 $(BCC) $(NO_WARN) -Fe$@ $(TOP)\tool\srcck1.c
1472
1473sourcetest: srcck1.exe sqlite3.c
1474 srcck1.exe sqlite3.c
1475
mistachkin5d4d9412016-01-22 03:54:36 +00001476fuzzershell.exe: $(TOP)\tool\fuzzershell.c $(SQLITE3C) $(SQLITE3H)
1477 $(LTLINK) $(NO_WARN) $(FUZZERSHELL_COMPILE_OPTS) $(TOP)\tool\fuzzershell.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drhbc94dbb2013-04-08 14:28:33 +00001478
mistachkin5d4d9412016-01-22 03:54:36 +00001479fuzzcheck.exe: $(TOP)\test\fuzzcheck.c $(SQLITE3C) $(SQLITE3H)
1480 $(LTLINK) $(NO_WARN) $(FUZZCHECK_COMPILE_OPTS) $(TOP)\test\fuzzcheck.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh1573dc32015-05-25 22:29:26 +00001481
mistachkin5d4d9412016-01-22 03:54:36 +00001482mptester.exe: $(TOP)\mptest\mptest.c $(SQLITE3C) $(SQLITE3H)
1483 $(LTLINK) $(NO_WARN) $(MPTESTER_COMPILE_OPTS) $(TOP)\mptest\mptest.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drhbc94dbb2013-04-08 14:28:33 +00001484
mistachkineb48b062015-03-31 17:45:44 +00001485MPTEST1 = mptester mptest.db $(TOP)\mptest\crash01.test --repeat 20
1486MPTEST2 = mptester mptest.db $(TOP)\mptest\multiwrite01.test --repeat 20
mistachkin4d2daba2015-03-31 16:42:16 +00001487
drhfe0ba712015-03-31 13:46:13 +00001488mptest: mptester.exe
mistachkin4d2daba2015-03-31 16:42:16 +00001489 del /Q mptest.db 2>NUL
drhfe0ba712015-03-31 13:46:13 +00001490 $(MPTEST1) --journalmode DELETE
1491 $(MPTEST2) --journalmode WAL
1492 $(MPTEST1) --journalmode WAL
1493 $(MPTEST2) --journalmode PERSIST
1494 $(MPTEST1) --journalmode PERSIST
1495 $(MPTEST2) --journalmode TRUNCATE
1496 $(MPTEST1) --journalmode TRUNCATE
1497 $(MPTEST2) --journalmode DELETE
1498
shanehb2f20bf2011-06-17 07:07:24 +00001499# This target creates a directory named "tsrc" and fills it with
1500# copies of all of the C source code and header files needed to
1501# build on the target system. Some of the C source code and header
1502# files are automatically generated. This target takes care of
1503# all that automatic generation.
1504#
drh50065652015-10-08 19:29:18 +00001505.target_source: $(SRC) $(TOP)\tool\vdbe-compress.tcl fts5.c
mistachkin44723ce2015-03-21 02:22:37 +00001506 -rmdir /Q/S tsrc 2>NUL
shanehb2f20bf2011-06-17 07:07:24 +00001507 -mkdir tsrc
mistachkine2eb2592016-02-11 21:38:05 +00001508 for %i in ($(SRC00)) do copy /Y %i tsrc
1509 for %i in ($(SRC01)) do copy /Y %i tsrc
1510 for %i in ($(SRC02)) do copy /Y %i tsrc
1511 for %i in ($(SRC03)) do copy /Y %i tsrc
1512 for %i in ($(SRC04)) do copy /Y %i tsrc
1513 for %i in ($(SRC05)) do copy /Y %i tsrc
1514 for %i in ($(SRC06)) do copy /Y %i tsrc
1515 for %i in ($(SRC07)) do copy /Y %i tsrc
1516 for %i in ($(SRC08)) do copy /Y %i tsrc
1517 for %i in ($(SRC09)) do copy /Y %i tsrc
1518 for %i in ($(SRC10)) do copy /Y %i tsrc
1519 for %i in ($(SRC11)) do copy /Y %i tsrc
drh50065652015-10-08 19:29:18 +00001520 copy /Y fts5.c tsrc
1521 copy /Y fts5.h tsrc
mistachkin44723ce2015-03-21 02:22:37 +00001522 del /Q tsrc\sqlite.h.in tsrc\parse.y 2>NUL
drh2dc06482013-12-11 00:59:10 +00001523 $(TCLSH_CMD) $(TOP)\tool\vdbe-compress.tcl $(OPTS) < tsrc\vdbe.c > vdbe.new
shanehb2f20bf2011-06-17 07:07:24 +00001524 move vdbe.new tsrc\vdbe.c
1525 echo > .target_source
1526
mistachkin357e42d2015-09-21 23:53:42 +00001527sqlite3.c: .target_source sqlite3ext.h $(TOP)\tool\mksqlite3c.tcl
mistachkinb0427512014-01-30 11:12:52 +00001528 $(TCLSH_CMD) $(TOP)\tool\mksqlite3c.tcl $(MKSQLITE3C_ARGS)
drhe191e2c2013-03-19 15:23:18 +00001529 copy tsrc\shell.c .
drhe191e2c2013-03-19 15:23:18 +00001530 copy $(TOP)\ext\session\sqlite3session.h .
shanehb2f20bf2011-06-17 07:07:24 +00001531
mistachkin48dd9de2012-12-06 04:33:13 +00001532sqlite3-all.c: sqlite3.c $(TOP)\tool\split-sqlite3c.tcl
1533 $(TCLSH_CMD) $(TOP)\tool\split-sqlite3c.tcl
mistachkin3e786092016-01-23 07:53:04 +00001534# <</mark>>
mistachkin76510912013-10-11 23:01:18 +00001535
shanehb2f20bf2011-06-17 07:07:24 +00001536# Rule to build the amalgamation
1537#
mistachkin76510912013-10-11 23:01:18 +00001538sqlite3.lo: $(SQLITE3C)
mistachkin44723ce2015-03-21 02:22:37 +00001539 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(SQLITE3C)
shanehb2f20bf2011-06-17 07:07:24 +00001540
mistachkin3e786092016-01-23 07:53:04 +00001541# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001542# Rules to build the LEMON compiler generator
1543#
drh82415f22015-11-09 19:33:42 +00001544lempar.c: $(TOP)\tool\lempar.c
1545 copy $(TOP)\tool\lempar.c .
shanehb2f20bf2011-06-17 07:07:24 +00001546
1547lemon.exe: $(TOP)\tool\lemon.c lempar.c
mistachkin2318d332015-01-12 18:02:52 +00001548 $(BCC) $(NO_WARN) -Daccess=_access \
mistachkin460cd9c2015-10-14 22:46:37 +00001549 -Fe$@ $(TOP)\tool\lemon.c /link $(LDFLAGS) $(NLTLINKOPTS) $(NLTLIBPATHS)
shanehb2f20bf2011-06-17 07:07:24 +00001550
1551# Rules to build individual *.lo files from generated *.c files. This
1552# applies to:
1553#
1554# parse.lo
1555# opcodes.lo
1556#
1557parse.lo: parse.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001558 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c parse.c
shanehb2f20bf2011-06-17 07:07:24 +00001559
1560opcodes.lo: opcodes.c
mistachkin44723ce2015-03-21 02:22:37 +00001561 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c opcodes.c
mistachkin3e786092016-01-23 07:53:04 +00001562# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001563
mistachkin4d9d1f42012-09-03 10:32:32 +00001564# Rule to build the Win32 resources object file.
1565#
mistachkin08c1c312012-10-06 03:48:25 +00001566!IF $(USE_RC)!=0
mistachkin3e786092016-01-23 07:53:04 +00001567# <<block1>>
mistachkina8a18732016-01-22 22:16:50 +00001568$(LIBRESOBJS): $(TOP)\src\sqlite3.rc $(SQLITE3H)
mistachkin4d9d1f42012-09-03 10:32:32 +00001569 echo #ifndef SQLITE_RESOURCE_VERSION > sqlite3rc.h
mistachkin8ccc6d42012-09-27 21:03:53 +00001570 for /F %%V in ('type "$(TOP)\VERSION"') do ( \
mistachkin4d9d1f42012-09-03 10:32:32 +00001571 echo #define SQLITE_RESOURCE_VERSION %%V \
mistachkin946ef602015-10-10 01:55:57 +00001572 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact . ^, >> sqlite3rc.h \
mistachkin4d9d1f42012-09-03 10:32:32 +00001573 )
1574 echo #endif >> sqlite3rc.h
mistachkin08c1c312012-10-06 03:48:25 +00001575 $(LTRCOMPILE) -fo $(LIBRESOBJS) $(TOP)\src\sqlite3.rc
mistachkin3e786092016-01-23 07:53:04 +00001576# <</block1>>
mistachkin08c1c312012-10-06 03:48:25 +00001577!ENDIF
mistachkin4d9d1f42012-09-03 10:32:32 +00001578
mistachkin3e786092016-01-23 07:53:04 +00001579# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001580# Rules to build individual *.lo files from files in the src directory.
1581#
1582alter.lo: $(TOP)\src\alter.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001583 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\alter.c
shanehb2f20bf2011-06-17 07:07:24 +00001584
1585analyze.lo: $(TOP)\src\analyze.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001586 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\analyze.c
shanehb2f20bf2011-06-17 07:07:24 +00001587
1588attach.lo: $(TOP)\src\attach.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001589 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\attach.c
shanehb2f20bf2011-06-17 07:07:24 +00001590
1591auth.lo: $(TOP)\src\auth.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001592 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\auth.c
shanehb2f20bf2011-06-17 07:07:24 +00001593
1594backup.lo: $(TOP)\src\backup.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001595 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\backup.c
shanehb2f20bf2011-06-17 07:07:24 +00001596
1597bitvec.lo: $(TOP)\src\bitvec.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001598 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\bitvec.c
shanehb2f20bf2011-06-17 07:07:24 +00001599
1600btmutex.lo: $(TOP)\src\btmutex.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001601 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\btmutex.c
shanehb2f20bf2011-06-17 07:07:24 +00001602
1603btree.lo: $(TOP)\src\btree.c $(HDR) $(TOP)\src\pager.h
mistachkin44723ce2015-03-21 02:22:37 +00001604 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\btree.c
shanehb2f20bf2011-06-17 07:07:24 +00001605
1606build.lo: $(TOP)\src\build.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001607 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\build.c
shanehb2f20bf2011-06-17 07:07:24 +00001608
1609callback.lo: $(TOP)\src\callback.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001610 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\callback.c
shanehb2f20bf2011-06-17 07:07:24 +00001611
1612complete.lo: $(TOP)\src\complete.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001613 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\complete.c
shanehb2f20bf2011-06-17 07:07:24 +00001614
1615ctime.lo: $(TOP)\src\ctime.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001616 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\ctime.c
shanehb2f20bf2011-06-17 07:07:24 +00001617
1618date.lo: $(TOP)\src\date.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001619 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\date.c
shanehb2f20bf2011-06-17 07:07:24 +00001620
drh1a4a6802015-05-04 18:31:09 +00001621dbstat.lo: $(TOP)\src\date.c $(HDR)
1622 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\dbstat.c
1623
shanehb2f20bf2011-06-17 07:07:24 +00001624delete.lo: $(TOP)\src\delete.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001625 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\delete.c
shanehb2f20bf2011-06-17 07:07:24 +00001626
1627expr.lo: $(TOP)\src\expr.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001628 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\expr.c
shanehb2f20bf2011-06-17 07:07:24 +00001629
1630fault.lo: $(TOP)\src\fault.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001631 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\fault.c
shanehb2f20bf2011-06-17 07:07:24 +00001632
1633fkey.lo: $(TOP)\src\fkey.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001634 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\fkey.c
shanehb2f20bf2011-06-17 07:07:24 +00001635
1636func.lo: $(TOP)\src\func.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001637 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\func.c
shanehb2f20bf2011-06-17 07:07:24 +00001638
1639global.lo: $(TOP)\src\global.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001640 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\global.c
shanehb2f20bf2011-06-17 07:07:24 +00001641
1642hash.lo: $(TOP)\src\hash.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001643 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\hash.c
shanehb2f20bf2011-06-17 07:07:24 +00001644
1645insert.lo: $(TOP)\src\insert.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001646 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\insert.c
shanehb2f20bf2011-06-17 07:07:24 +00001647
shanehb2f20bf2011-06-17 07:07:24 +00001648legacy.lo: $(TOP)\src\legacy.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001649 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\legacy.c
shanehb2f20bf2011-06-17 07:07:24 +00001650
1651loadext.lo: $(TOP)\src\loadext.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001652 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\loadext.c
shanehb2f20bf2011-06-17 07:07:24 +00001653
1654main.lo: $(TOP)\src\main.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001655 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\main.c
shanehb2f20bf2011-06-17 07:07:24 +00001656
1657malloc.lo: $(TOP)\src\malloc.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001658 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\malloc.c
shanehb2f20bf2011-06-17 07:07:24 +00001659
1660mem0.lo: $(TOP)\src\mem0.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001661 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem0.c
shanehb2f20bf2011-06-17 07:07:24 +00001662
1663mem1.lo: $(TOP)\src\mem1.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001664 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem1.c
shanehb2f20bf2011-06-17 07:07:24 +00001665
1666mem2.lo: $(TOP)\src\mem2.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001667 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem2.c
shanehb2f20bf2011-06-17 07:07:24 +00001668
1669mem3.lo: $(TOP)\src\mem3.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001670 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem3.c
shanehb2f20bf2011-06-17 07:07:24 +00001671
1672mem5.lo: $(TOP)\src\mem5.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001673 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem5.c
shanehb2f20bf2011-06-17 07:07:24 +00001674
1675memjournal.lo: $(TOP)\src\memjournal.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001676 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\memjournal.c
shanehb2f20bf2011-06-17 07:07:24 +00001677
1678mutex.lo: $(TOP)\src\mutex.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001679 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex.c
shanehb2f20bf2011-06-17 07:07:24 +00001680
1681mutex_noop.lo: $(TOP)\src\mutex_noop.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001682 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex_noop.c
shanehb2f20bf2011-06-17 07:07:24 +00001683
shanehb2f20bf2011-06-17 07:07:24 +00001684mutex_unix.lo: $(TOP)\src\mutex_unix.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001685 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex_unix.c
shanehb2f20bf2011-06-17 07:07:24 +00001686
1687mutex_w32.lo: $(TOP)\src\mutex_w32.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001688 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex_w32.c
shanehb2f20bf2011-06-17 07:07:24 +00001689
1690notify.lo: $(TOP)\src\notify.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001691 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\notify.c
shanehb2f20bf2011-06-17 07:07:24 +00001692
1693pager.lo: $(TOP)\src\pager.c $(HDR) $(TOP)\src\pager.h
mistachkin44723ce2015-03-21 02:22:37 +00001694 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pager.c
shanehb2f20bf2011-06-17 07:07:24 +00001695
1696pcache.lo: $(TOP)\src\pcache.c $(HDR) $(TOP)\src\pcache.h
mistachkin44723ce2015-03-21 02:22:37 +00001697 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pcache.c
shanehb2f20bf2011-06-17 07:07:24 +00001698
1699pcache1.lo: $(TOP)\src\pcache1.c $(HDR) $(TOP)\src\pcache.h
mistachkin44723ce2015-03-21 02:22:37 +00001700 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pcache1.c
shanehb2f20bf2011-06-17 07:07:24 +00001701
1702os.lo: $(TOP)\src\os.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001703 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\os.c
shanehb2f20bf2011-06-17 07:07:24 +00001704
1705os_unix.lo: $(TOP)\src\os_unix.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001706 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\os_unix.c
shanehb2f20bf2011-06-17 07:07:24 +00001707
1708os_win.lo: $(TOP)\src\os_win.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001709 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\os_win.c
shanehb2f20bf2011-06-17 07:07:24 +00001710
shanehb2f20bf2011-06-17 07:07:24 +00001711pragma.lo: $(TOP)\src\pragma.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001712 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pragma.c
shanehb2f20bf2011-06-17 07:07:24 +00001713
1714prepare.lo: $(TOP)\src\prepare.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001715 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\prepare.c
shanehb2f20bf2011-06-17 07:07:24 +00001716
1717printf.lo: $(TOP)\src\printf.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001718 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\printf.c
shanehb2f20bf2011-06-17 07:07:24 +00001719
1720random.lo: $(TOP)\src\random.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001721 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\random.c
shanehb2f20bf2011-06-17 07:07:24 +00001722
1723resolve.lo: $(TOP)\src\resolve.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001724 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\resolve.c
shanehb2f20bf2011-06-17 07:07:24 +00001725
1726rowset.lo: $(TOP)\src\rowset.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001727 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\rowset.c
shanehb2f20bf2011-06-17 07:07:24 +00001728
1729select.lo: $(TOP)\src\select.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001730 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\select.c
shanehb2f20bf2011-06-17 07:07:24 +00001731
1732status.lo: $(TOP)\src\status.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001733 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\status.c
shanehb2f20bf2011-06-17 07:07:24 +00001734
1735table.lo: $(TOP)\src\table.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001736 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\table.c
shanehb2f20bf2011-06-17 07:07:24 +00001737
drhf51446a2012-07-21 19:40:42 +00001738threads.lo: $(TOP)\src\threads.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001739 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\threads.c
drhf51446a2012-07-21 19:40:42 +00001740
shanehb2f20bf2011-06-17 07:07:24 +00001741tokenize.lo: $(TOP)\src\tokenize.c keywordhash.h $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001742 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\tokenize.c
shanehb2f20bf2011-06-17 07:07:24 +00001743
drh38b41492015-06-08 15:08:15 +00001744treeview.lo: $(TOP)\src\treeview.c $(HDR)
1745 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\treeview.c
1746
shanehb2f20bf2011-06-17 07:07:24 +00001747trigger.lo: $(TOP)\src\trigger.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001748 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\trigger.c
shanehb2f20bf2011-06-17 07:07:24 +00001749
1750update.lo: $(TOP)\src\update.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001751 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\update.c
shanehb2f20bf2011-06-17 07:07:24 +00001752
1753utf.lo: $(TOP)\src\utf.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001754 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\utf.c
shanehb2f20bf2011-06-17 07:07:24 +00001755
1756util.lo: $(TOP)\src\util.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001757 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\util.c
shanehb2f20bf2011-06-17 07:07:24 +00001758
1759vacuum.lo: $(TOP)\src\vacuum.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001760 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vacuum.c
shanehb2f20bf2011-06-17 07:07:24 +00001761
1762vdbe.lo: $(TOP)\src\vdbe.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001763 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbe.c
shanehb2f20bf2011-06-17 07:07:24 +00001764
1765vdbeapi.lo: $(TOP)\src\vdbeapi.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001766 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbeapi.c
shanehb2f20bf2011-06-17 07:07:24 +00001767
1768vdbeaux.lo: $(TOP)\src\vdbeaux.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001769 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbeaux.c
shanehb2f20bf2011-06-17 07:07:24 +00001770
1771vdbeblob.lo: $(TOP)\src\vdbeblob.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001772 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbeblob.c
shanehb2f20bf2011-06-17 07:07:24 +00001773
1774vdbemem.lo: $(TOP)\src\vdbemem.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001775 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbemem.c
shanehb2f20bf2011-06-17 07:07:24 +00001776
mistachkin81c428a2011-08-17 02:19:54 +00001777vdbesort.lo: $(TOP)\src\vdbesort.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001778 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbesort.c
mistachkin81c428a2011-08-17 02:19:54 +00001779
shanehb2f20bf2011-06-17 07:07:24 +00001780vdbetrace.lo: $(TOP)\src\vdbetrace.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001781 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbetrace.c
shanehb2f20bf2011-06-17 07:07:24 +00001782
1783vtab.lo: $(TOP)\src\vtab.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001784 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vtab.c
shanehb2f20bf2011-06-17 07:07:24 +00001785
1786wal.lo: $(TOP)\src\wal.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001787 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\wal.c
shanehb2f20bf2011-06-17 07:07:24 +00001788
1789walker.lo: $(TOP)\src\walker.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001790 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\walker.c
shanehb2f20bf2011-06-17 07:07:24 +00001791
1792where.lo: $(TOP)\src\where.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001793 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\where.c
shanehb2f20bf2011-06-17 07:07:24 +00001794
drh6f82e852015-06-06 20:12:09 +00001795wherecode.lo: $(TOP)\src\wherecode.c $(HDR)
1796 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\wherecode.c
1797
drh6c1f4ef2015-06-08 14:23:15 +00001798whereexpr.lo: $(TOP)\src\whereexpr.c $(HDR)
1799 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\whereexpr.c
1800
shanehb2f20bf2011-06-17 07:07:24 +00001801tclsqlite.lo: $(TOP)\src\tclsqlite.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001802 $(LTCOMPILE) $(NO_WARN) -DUSE_TCL_STUBS=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c
shanehb2f20bf2011-06-17 07:07:24 +00001803
1804tclsqlite-shell.lo: $(TOP)\src\tclsqlite.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001805 $(LTCOMPILE) $(NO_WARN) -DTCLSH=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c
shanehb2f20bf2011-06-17 07:07:24 +00001806
mistachkin5d4d9412016-01-22 03:54:36 +00001807tclsqlite3.exe: tclsqlite-shell.lo $(SQLITE3C) $(SQLITE3H) $(LIBRESOBJS)
mistachkin78e3f612015-10-14 20:01:12 +00001808 $(LTLINK) $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /OUT:$@ tclsqlite-shell.lo $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001809
1810# Rules to build opcodes.c and opcodes.h
1811#
drh7651e0a2015-10-07 12:11:36 +00001812opcodes.c: opcodes.h $(TOP)\tool\mkopcodec.tcl
1813 $(TCLSH_CMD) $(TOP)\tool\mkopcodec.tcl opcodes.h > opcodes.c
shanehb2f20bf2011-06-17 07:07:24 +00001814
drhb15393b2015-10-07 02:52:09 +00001815opcodes.h: parse.h $(TOP)\src\vdbe.c $(TOP)\tool\mkopcodeh.tcl
mistachkin946ef602015-10-10 01:55:57 +00001816 type parse.h $(TOP)\src\vdbe.c | $(TCLSH_CMD) $(TOP)\tool\mkopcodeh.tcl > opcodes.h
shanehb2f20bf2011-06-17 07:07:24 +00001817
1818# Rules to build parse.c and parse.h - the outputs of lemon.
1819#
1820parse.h: parse.c
1821
drh60a15a42015-10-07 12:21:14 +00001822parse.c: $(TOP)\src\parse.y lemon.exe $(TOP)\tool\addopcodes.tcl
mistachkin44723ce2015-03-21 02:22:37 +00001823 del /Q parse.y parse.h parse.h.temp 2>NUL
shanehb2f20bf2011-06-17 07:07:24 +00001824 copy $(TOP)\src\parse.y .
mistachkinedcb4eb2016-01-22 01:25:15 +00001825 .\lemon.exe $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) $(OPTS) parse.y
shanehb2f20bf2011-06-17 07:07:24 +00001826 move parse.h parse.h.temp
drh60a15a42015-10-07 12:21:14 +00001827 $(TCLSH_CMD) $(TOP)\tool\addopcodes.tcl parse.h.temp > parse.h
shanehb2f20bf2011-06-17 07:07:24 +00001828
mistachkin5d4d9412016-01-22 03:54:36 +00001829$(SQLITE3H): $(TOP)\src\sqlite.h.in $(TOP)\manifest.uuid $(TOP)\VERSION
1830 $(TCLSH_CMD) $(TOP)\tool\mksqlite3h.tcl $(TOP:\=/) > $(SQLITE3H)
shanehb2f20bf2011-06-17 07:07:24 +00001831
mistachkin9b88ace2016-02-26 21:01:37 +00001832sqlite3ext.h: .target_source
mistachkinc978f2d2015-09-21 23:49:35 +00001833 copy tsrc\sqlite3ext.h .
1834
shanehb2f20bf2011-06-17 07:07:24 +00001835mkkeywordhash.exe: $(TOP)\tool\mkkeywordhash.c
mistachkinedcb4eb2016-01-22 01:25:15 +00001836 $(BCC) $(NO_WARN) -Fe$@ $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) $(OPTS) \
mistachkin460cd9c2015-10-14 22:46:37 +00001837 $(TOP)\tool\mkkeywordhash.c /link $(LDFLAGS) $(NLTLINKOPTS) $(NLTLIBPATHS)
shanehb2f20bf2011-06-17 07:07:24 +00001838
1839keywordhash.h: $(TOP)\tool\mkkeywordhash.c mkkeywordhash.exe
mistachkin5b0b6fd2011-06-25 01:14:36 +00001840 .\mkkeywordhash.exe > keywordhash.h
shanehb2f20bf2011-06-17 07:07:24 +00001841
1842
1843
1844# Rules to build the extension objects.
1845#
1846icu.lo: $(TOP)\ext\icu\icu.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001847 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\icu\icu.c
shanehb2f20bf2011-06-17 07:07:24 +00001848
1849fts2.lo: $(TOP)\ext\fts2\fts2.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001850 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2.c
shanehb2f20bf2011-06-17 07:07:24 +00001851
1852fts2_hash.lo: $(TOP)\ext\fts2\fts2_hash.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001853 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_hash.c
shanehb2f20bf2011-06-17 07:07:24 +00001854
1855fts2_icu.lo: $(TOP)\ext\fts2\fts2_icu.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001856 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_icu.c
shanehb2f20bf2011-06-17 07:07:24 +00001857
1858fts2_porter.lo: $(TOP)\ext\fts2\fts2_porter.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001859 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_porter.c
shanehb2f20bf2011-06-17 07:07:24 +00001860
1861fts2_tokenizer.lo: $(TOP)\ext\fts2\fts2_tokenizer.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001862 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_tokenizer.c
shanehb2f20bf2011-06-17 07:07:24 +00001863
1864fts2_tokenizer1.lo: $(TOP)\ext\fts2\fts2_tokenizer1.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001865 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_tokenizer1.c
shanehb2f20bf2011-06-17 07:07:24 +00001866
1867fts3.lo: $(TOP)\ext\fts3\fts3.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001868 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3.c
shanehb2f20bf2011-06-17 07:07:24 +00001869
1870fts3_aux.lo: $(TOP)\ext\fts3\fts3_aux.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001871 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_aux.c
shanehb2f20bf2011-06-17 07:07:24 +00001872
1873fts3_expr.lo: $(TOP)\ext\fts3\fts3_expr.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001874 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_expr.c
shanehb2f20bf2011-06-17 07:07:24 +00001875
1876fts3_hash.lo: $(TOP)\ext\fts3\fts3_hash.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001877 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_hash.c
shanehb2f20bf2011-06-17 07:07:24 +00001878
1879fts3_icu.lo: $(TOP)\ext\fts3\fts3_icu.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001880 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_icu.c
shanehb2f20bf2011-06-17 07:07:24 +00001881
1882fts3_snippet.lo: $(TOP)\ext\fts3\fts3_snippet.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001883 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_snippet.c
shanehb2f20bf2011-06-17 07:07:24 +00001884
1885fts3_porter.lo: $(TOP)\ext\fts3\fts3_porter.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001886 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_porter.c
shanehb2f20bf2011-06-17 07:07:24 +00001887
1888fts3_tokenizer.lo: $(TOP)\ext\fts3\fts3_tokenizer.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001889 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenizer.c
shanehb2f20bf2011-06-17 07:07:24 +00001890
1891fts3_tokenizer1.lo: $(TOP)\ext\fts3\fts3_tokenizer1.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001892 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenizer1.c
shanehb2f20bf2011-06-17 07:07:24 +00001893
drh4d648c72013-04-22 17:07:56 +00001894fts3_tokenize_vtab.lo: $(TOP)\ext\fts3\fts3_tokenize_vtab.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001895 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenize_vtab.c
drh4d648c72013-04-22 17:07:56 +00001896
drh391d4ba2012-05-28 20:22:16 +00001897fts3_unicode.lo: $(TOP)\ext\fts3\fts3_unicode.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001898 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_unicode.c
drh391d4ba2012-05-28 20:22:16 +00001899
1900fts3_unicode2.lo: $(TOP)\ext\fts3\fts3_unicode2.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001901 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_unicode2.c
drh391d4ba2012-05-28 20:22:16 +00001902
shanehb2f20bf2011-06-17 07:07:24 +00001903fts3_write.lo: $(TOP)\ext\fts3\fts3_write.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001904 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_write.c
shanehb2f20bf2011-06-17 07:07:24 +00001905
1906rtree.lo: $(TOP)\ext\rtree\rtree.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001907 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\rtree\rtree.c
shanehb2f20bf2011-06-17 07:07:24 +00001908
mistachkin4f2c8222016-04-11 22:23:04 +00001909sqlite3session.lo: $(TOP)\ext\session\sqlite3session.c $(HDR) $(EXTHDR)
mistachkin05004782016-03-30 16:23:06 +00001910 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\session\sqlite3session.c
drh498dcae2013-03-13 11:42:00 +00001911
mistachkined52f9f2015-06-26 04:34:36 +00001912# FTS5 things
1913#
1914FTS5_SRC = \
1915 $(TOP)\ext\fts5\fts5.h \
1916 $(TOP)\ext\fts5\fts5Int.h \
1917 $(TOP)\ext\fts5\fts5_aux.c \
1918 $(TOP)\ext\fts5\fts5_buffer.c \
1919 $(TOP)\ext\fts5\fts5_main.c \
1920 $(TOP)\ext\fts5\fts5_config.c \
1921 $(TOP)\ext\fts5\fts5_expr.c \
1922 $(TOP)\ext\fts5\fts5_hash.c \
1923 $(TOP)\ext\fts5\fts5_index.c \
1924 fts5parse.c fts5parse.h \
1925 $(TOP)\ext\fts5\fts5_storage.c \
1926 $(TOP)\ext\fts5\fts5_tokenize.c \
1927 $(TOP)\ext\fts5\fts5_unicode2.c \
1928 $(TOP)\ext\fts5\fts5_varint.c \
1929 $(TOP)\ext\fts5\fts5_vocab.c
1930
1931fts5parse.c: $(TOP)\ext\fts5\fts5parse.y lemon.exe
1932 copy $(TOP)\ext\fts5\fts5parse.y .
1933 del /Q fts5parse.h 2>NUL
mistachkinedcb4eb2016-01-22 01:25:15 +00001934 .\lemon.exe $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) $(OPTS) fts5parse.y
mistachkined52f9f2015-06-26 04:34:36 +00001935
mistachkin9b88ace2016-02-26 21:01:37 +00001936fts5parse.h: fts5parse.c
mistachkined52f9f2015-06-26 04:34:36 +00001937
mistachkin9b88ace2016-02-26 21:01:37 +00001938fts5.c: $(FTS5_SRC)
mistachkined52f9f2015-06-26 04:34:36 +00001939 $(TCLSH_CMD) $(TOP)\ext\fts5\tool\mkfts5c.tcl
dana153bbc2015-07-02 20:12:34 +00001940 copy $(TOP)\ext\fts5\fts5.h .
mistachkined52f9f2015-06-26 04:34:36 +00001941
1942fts5.lo: fts5.c $(HDR) $(EXTHDR)
mistachkin95ae9582015-06-26 20:45:43 +00001943 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c fts5.c
1944
1945fts5_ext.lo: fts5.c $(HDR) $(EXTHDR)
mistachkinae6ca8e2015-07-02 16:50:43 +00001946 $(LTCOMPILE) $(NO_WARN) -c fts5.c
shanehb2f20bf2011-06-17 07:07:24 +00001947
mistachkin95ae9582015-06-26 20:45:43 +00001948fts5.dll: fts5_ext.lo
1949 $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /OUT:$@ fts5_ext.lo
shanehb2f20bf2011-06-17 07:07:24 +00001950
mistachkin83a22532016-01-14 18:01:16 +00001951sqlite3rbu.lo: $(TOP)\ext\rbu\sqlite3rbu.c $(HDR) $(EXTHDR)
1952 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\rbu\sqlite3rbu.c
drh76473772016-01-14 13:22:24 +00001953
shanehb2f20bf2011-06-17 07:07:24 +00001954# Rules to build the 'testfixture' application.
1955#
1956# If using the amalgamation, use sqlite3.c directly to build the test
1957# fixture. Otherwise link against libsqlite3.lib. (This distinction is
1958# necessary because the test fixture requires non-API symbols which are
1959# hidden when the library is built via the amalgamation).
1960#
1961TESTFIXTURE_FLAGS = -DTCLSH=1 -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
mistachkin27b2f052015-01-12 19:49:46 +00001962TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_SERVER=1 -DSQLITE_PRIVATE=""
1963TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_CORE $(NO_WARN)
drhdbc49162016-03-02 03:28:07 +00001964TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_SERIES_CONSTRAINT_VERIFY=1
drh9878fef2016-03-04 03:43:10 +00001965TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_DEFAULT_PAGE_SIZE=1024
shanehb2f20bf2011-06-17 07:07:24 +00001966
mistachkinc04c54b2016-02-11 21:28:16 +00001967TESTFIXTURE_SRC0 = $(TESTEXT) $(TESTSRC2)
mistachkin05004782016-03-30 16:23:06 +00001968TESTFIXTURE_SRC1 = $(TESTEXT) $(SQLITE3C)
shanehb2f20bf2011-06-17 07:07:24 +00001969!IF $(USE_AMALGAMATION)==0
1970TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC0)
1971!ELSE
1972TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC1)
1973!ENDIF
1974
mistachkin5d4d9412016-01-22 03:54:36 +00001975testfixture.exe: $(TESTFIXTURE_SRC) $(SQLITE3H) $(LIBRESOBJS) $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001976 $(LTLINK) -DSQLITE_NO_SYNC=1 $(TESTFIXTURE_FLAGS) \
shanehb2f20bf2011-06-17 07:07:24 +00001977 -DBUILD_sqlite -I$(TCLINCDIR) \
shaneh2a0b9ef2011-06-20 20:52:32 +00001978 $(TESTFIXTURE_SRC) \
mistachkin78e3f612015-10-14 20:01:12 +00001979 /link $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001980
mistachkin9b88ace2016-02-26 21:01:37 +00001981extensiontest: testfixture.exe testloadext.dll
mistachkin88739962015-10-14 23:04:08 +00001982 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00001983 .\testfixture.exe $(TOP)\test\loadext.test $(TESTOPTS)
mistachkin1925a2e2014-02-24 21:20:25 +00001984
drhf4375442015-05-11 12:15:45 +00001985fulltest: $(TESTPROGS) fuzztest
mistachkin88739962015-10-14 23:04:08 +00001986 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00001987 .\testfixture.exe $(TOP)\test\all.test $(TESTOPTS)
shanehb2f20bf2011-06-17 07:07:24 +00001988
drhea93c702015-05-26 18:15:08 +00001989soaktest: $(TESTPROGS)
mistachkin88739962015-10-14 23:04:08 +00001990 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00001991 .\testfixture.exe $(TOP)\test\all.test -soak=1 $(TESTOPTS)
shanehb2f20bf2011-06-17 07:07:24 +00001992
drhf4375442015-05-11 12:15:45 +00001993fulltestonly: $(TESTPROGS) fuzztest
mistachkin88739962015-10-14 23:04:08 +00001994 @set PATH=$(LIBTCLPATH);$(PATH)
mistachkinc60941f2012-09-13 01:51:02 +00001995 .\testfixture.exe $(TOP)\test\full.test
1996
mistachkinedcb4eb2016-01-22 01:25:15 +00001997queryplantest: testfixture.exe shell
mistachkin88739962015-10-14 23:04:08 +00001998 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00001999 .\testfixture.exe $(TOP)\test\permutations.test queryplanner $(TESTOPTS)
mistachkin036acf32013-07-20 00:34:31 +00002000
drhea93c702015-05-26 18:15:08 +00002001fuzztest: fuzzcheck.exe
2002 .\fuzzcheck.exe $(FUZZDATA)
drhf3320712015-04-25 13:39:29 +00002003
drha523e312015-07-24 17:26:13 +00002004fastfuzztest: fuzzcheck.exe
drh53e66c32015-07-24 15:49:23 +00002005 .\fuzzcheck.exe --limit-mem 100M $(FUZZDATA)
shanehb2f20bf2011-06-17 07:07:24 +00002006
drh905da632015-06-10 18:53:09 +00002007# Minimal testing that runs in less than 3 minutes (on a fast machine)
2008#
drhfd0d93f2016-02-07 00:08:08 +00002009quicktest: testfixture.exe sourcetest
mistachkin88739962015-10-14 23:04:08 +00002010 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00002011 .\testfixture.exe $(TOP)\test\extraquick.test $(TESTOPTS)
2012
2013# This is the common case. Run many tests that do not take too long,
2014# including fuzzcheck, sqlite3_analyzer, and sqldiff tests.
2015#
drhfd0d93f2016-02-07 00:08:08 +00002016test: $(TESTPROGS) sourcetest fastfuzztest
mistachkin88739962015-10-14 23:04:08 +00002017 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00002018 .\testfixture.exe $(TOP)\test\veryquick.test $(TESTOPTS)
shanehb2f20bf2011-06-17 07:07:24 +00002019
drhea93c702015-05-26 18:15:08 +00002020smoketest: $(TESTPROGS)
mistachkin88739962015-10-14 23:04:08 +00002021 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00002022 .\testfixture.exe $(TOP)\test\main.test $(TESTOPTS)
mistachkin00eb70d2015-04-04 00:02:07 +00002023
mistachkin9b88ace2016-02-26 21:01:37 +00002024sqlite3_analyzer.c: $(SQLITE3C) $(SQLITE3H) $(TOP)\src\tclsqlite.c $(TOP)\tool\spaceanal.tcl
mistachkind4ab1032015-05-11 16:27:33 +00002025 echo #define TCLSH 2 > $@
2026 echo #define SQLITE_ENABLE_DBSTAT_VTAB 1 >> $@
2027 copy $@ + $(SQLITE3C) + $(TOP)\src\tclsqlite.c $@
mistachkin9a55e312011-09-22 00:06:44 +00002028 echo static const char *tclsh_main_loop(void){ >> $@
2029 echo static const char *zMainloop = >> $@
drh48cc9a32015-10-07 12:36:42 +00002030 $(TCLSH_CMD) $(TOP)\tool\tostr.tcl $(TOP)\tool\spaceanal.tcl >> $@
mistachkin9a55e312011-09-22 00:06:44 +00002031 echo ; return zMainloop; } >> $@
shanehb2f20bf2011-06-17 07:07:24 +00002032
mistachkin08c1c312012-10-06 03:48:25 +00002033sqlite3_analyzer.exe: sqlite3_analyzer.c $(LIBRESOBJS)
mistachkind4ab1032015-05-11 16:27:33 +00002034 $(LTLINK) $(NO_WARN) -DBUILD_sqlite -I$(TCLINCDIR) sqlite3_analyzer.c \
mistachkin78e3f612015-10-14 20:01:12 +00002035 /link $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00002036
mistachkin1925a2e2014-02-24 21:20:25 +00002037testloadext.lo: $(TOP)\src\test_loadext.c
mistachkin44723ce2015-03-21 02:22:37 +00002038 $(LTCOMPILE) $(NO_WARN) -c $(TOP)\src\test_loadext.c
mistachkin1925a2e2014-02-24 21:20:25 +00002039
mistachkin9b88ace2016-02-26 21:01:37 +00002040testloadext.dll: testloadext.lo
mistachkin1925a2e2014-02-24 21:20:25 +00002041 $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /OUT:$@ testloadext.lo
2042
mistachkin5d4d9412016-01-22 03:54:36 +00002043showdb.exe: $(TOP)\tool\showdb.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\showdb.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh9ac3c1e2013-11-07 18:37:31 +00002046
mistachkin5d4d9412016-01-22 03:54:36 +00002047showstat4.exe: $(TOP)\tool\showstat4.c $(SQLITE3C) $(SQLITE3H)
mistachkin44723ce2015-03-21 02:22:37 +00002048 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
mistachkin78e3f612015-10-14 20:01:12 +00002049 $(TOP)\tool\showstat4.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh4bb77ec2014-06-30 11:14:26 +00002050
mistachkin5d4d9412016-01-22 03:54:36 +00002051showjournal.exe: $(TOP)\tool\showjournal.c $(SQLITE3C) $(SQLITE3H)
mistachkin44723ce2015-03-21 02:22:37 +00002052 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
mistachkin78e3f612015-10-14 20:01:12 +00002053 $(TOP)\tool\showjournal.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh4bb77ec2014-06-30 11:14:26 +00002054
mistachkin5d4d9412016-01-22 03:54:36 +00002055showwal.exe: $(TOP)\tool\showwal.c $(SQLITE3C) $(SQLITE3H)
mistachkin44723ce2015-03-21 02:22:37 +00002056 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
mistachkin78e3f612015-10-14 20:01:12 +00002057 $(TOP)\tool\showwal.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh4bb77ec2014-06-30 11:14:26 +00002058
drh9f674f22014-08-18 20:23:29 +00002059changeset.exe: $(TOP)\ext\session\changeset.c $(SQLITE3C)
mistachkin05004782016-03-30 16:23:06 +00002060 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
2061 $(TOP)\ext\session\changeset.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh9f674f22014-08-18 20:23:29 +00002062
mistachkin5d4d9412016-01-22 03:54:36 +00002063fts3view.exe: $(TOP)\ext\fts3\tool\fts3view.c $(SQLITE3C) $(SQLITE3H)
mistachkin44723ce2015-03-21 02:22:37 +00002064 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
mistachkin78e3f612015-10-14 20:01:12 +00002065 $(TOP)\ext\fts3\tool\fts3view.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
mistachkinde545272014-07-07 17:57:50 +00002066
mistachkin5d4d9412016-01-22 03:54:36 +00002067rollback-test.exe: $(TOP)\tool\rollback-test.c $(SQLITE3C) $(SQLITE3H)
mistachkin44723ce2015-03-21 02:22:37 +00002068 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
mistachkin78e3f612015-10-14 20:01:12 +00002069 $(TOP)\tool\rollback-test.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh4bb77ec2014-06-30 11:14:26 +00002070
mistachkin5d4d9412016-01-22 03:54:36 +00002071LogEst.exe: $(TOP)\tool\logest.c $(SQLITE3H)
mistachkin78e3f612015-10-14 20:01:12 +00002072 $(LTLINK) $(NO_WARN) -Fe$@ $(TOP)\tool\LogEst.c /link $(LDFLAGS) $(LTLINKOPTS)
drh267a13f2014-06-18 18:10:12 +00002073
mistachkin5d4d9412016-01-22 03:54:36 +00002074wordcount.exe: $(TOP)\test\wordcount.c $(SQLITE3C) $(SQLITE3H)
mistachkin44723ce2015-03-21 02:22:37 +00002075 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
mistachkin78e3f612015-10-14 20:01:12 +00002076 $(TOP)\test\wordcount.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh9ac3c1e2013-11-07 18:37:31 +00002077
mistachkin5d4d9412016-01-22 03:54:36 +00002078speedtest1.exe: $(TOP)\test\speedtest1.c $(SQLITE3C) $(SQLITE3H)
mistachkin44723ce2015-03-21 02:22:37 +00002079 $(LTLINK) $(NO_WARN) -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
mistachkin78e3f612015-10-14 20:01:12 +00002080 $(TOP)\test\speedtest1.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
mistachkinb482a442012-02-11 22:19:26 +00002081
mistachkin9b88ace2016-02-26 21:01:37 +00002082rbu.exe: $(TOP)\ext\rbu\rbu.c $(TOP)\ext\rbu\sqlite3rbu.c $(SQLITE3C) $(SQLITE3H)
mistachkin5d4d9412016-01-22 03:54:36 +00002083 $(LTLINK) $(NO_WARN) -DSQLITE_ENABLE_RBU -Fe$@ \
2084 $(TOP)\ext\rbu\rbu.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
mistachkin9b88ace2016-02-26 21:01:37 +00002085
2086moreclean: clean
2087 del /Q $(SQLITE3C) $(SQLITE3H) 2>NUL
mistachkin3e786092016-01-23 07:53:04 +00002088# <</mark>>
drh76473772016-01-14 13:22:24 +00002089
shaneh6e7850c2011-06-17 15:57:07 +00002090clean:
mistachkin8dd3ff12015-05-16 03:41:41 +00002091 del /Q *.exp *.lo *.ilk *.lib *.obj *.ncb *.pdb *.sdf *.suo 2>NUL
mistachkin56362a52016-02-19 19:03:04 +00002092 del /Q *.bsc *.def *.cod *.da *.bb *.bbg *.vc gmon.out 2>NUL
mistachkinfe41a982016-02-27 00:21:44 +00002093 del /Q $(SQLITE3EXE) $(SQLITE3DLL) Replace.exe 2>NUL
mistachkin3e786092016-01-23 07:53:04 +00002094# <<mark>>
mistachkin9b88ace2016-02-26 21:01:37 +00002095 del /Q sqlite3.c sqlite3.h 2>NUL
2096 del /Q opcodes.c opcodes.h 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002097 del /Q lemon.* lempar.c parse.* 2>NUL
2098 del /Q mkkeywordhash.* keywordhash.h 2>NUL
2099 del /Q notasharedlib.* 2>NUL
2100 -rmdir /Q/S .deps 2>NUL
2101 -rmdir /Q/S .libs 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002102 -rmdir /Q/S tsrc 2>NUL
2103 del /Q .target_source 2>NUL
mistachkin44723ce2015-03-21 02:22:37 +00002104 del /Q tclsqlite3.exe 2>NUL
2105 del /Q testloadext.dll 2>NUL
2106 del /Q testfixture.exe test.db 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002107 del /Q LogEst.exe fts3view.exe rollback-test.exe showdb.exe 2>NUL
drhedea9112015-03-24 19:02:13 +00002108 del /Q changeset.exe 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002109 del /Q showjournal.exe showstat4.exe showwal.exe speedtest1.exe 2>NUL
mistachkin27b69972016-02-07 20:39:27 +00002110 del /Q mptester.exe wordcount.exe rbu.exe srcck1.exe 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002111 del /Q sqlite3.c sqlite3-*.c 2>NUL
2112 del /Q sqlite3rc.h 2>NUL
mistachkin27799892016-03-31 22:53:37 +00002113 del /Q shell.c sqlite3ext.h sqlite3session.h 2>NUL
mistachkin44723ce2015-03-21 02:22:37 +00002114 del /Q sqlite3_analyzer.exe sqlite3_analyzer.c 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002115 del /Q sqlite-*-output.vsix 2>NUL
drh290fcaa2016-06-08 01:03:05 +00002116 del /Q fuzzershell.exe fuzzcheck.exe sqldiff.exe dbhash.exe 2>NUL
mistachkinbc50bb72015-07-14 21:56:53 +00002117 del /Q fts5.* fts5parse.* 2>NUL
mistachkin3e786092016-01-23 07:53:04 +00002118# <</mark>>