blob: da94288c85547af9fbddca8d5a3baadd7e85f284 [file] [log] [blame]
shanehb2f20bf2011-06-17 07:07:24 +00001#
shaneh603e4262011-06-17 18:52:07 +00002# nmake Makefile for SQLite
shanehb2f20bf2011-06-17 07:07:24 +00003#
mistachkin4712c212014-05-09 20:51:17 +00004###############################################################################
5############################## START OF OPTIONS ###############################
6###############################################################################
shanehb2f20bf2011-06-17 07:07:24 +00007
8# The toplevel directory of the source tree. This is the directory
9# that contains this "Makefile.msc".
10#
11TOP = .
12
mistachkin3e786092016-01-23 07:53:04 +000013# <<mark>>
shaneh6e7850c2011-06-17 15:57:07 +000014# Set this non-0 to create and use the SQLite amalgamation file.
15#
mistachkin0ec07442012-10-12 18:06:07 +000016!IFNDEF USE_AMALGAMATION
shaneh6e7850c2011-06-17 15:57:07 +000017USE_AMALGAMATION = 1
mistachkin0ec07442012-10-12 18:06:07 +000018!ENDIF
mistachkin3e786092016-01-23 07:53:04 +000019# <</mark>>
shaneh6e7850c2011-06-17 15:57:07 +000020
mistachkin2318d332015-01-12 18:02:52 +000021# Set this non-0 to enable full warnings (-W4, etc) when compiling.
22#
23!IFNDEF USE_FULLWARN
mistachkinb1ed7172017-04-14 14:50:34 +000024USE_FULLWARN = 1
mistachkin2318d332015-01-12 18:02:52 +000025!ENDIF
26
mistachkin8c5e8fe2017-02-01 22:32:49 +000027# Set this non-0 to enable treating warnings as errors (-WX, etc) when
28# compiling.
29#
30!IFNDEF USE_FATAL_WARN
31USE_FATAL_WARN = 0
32!ENDIF
33
mistachkin24b6b812016-08-24 18:21:58 +000034# Set this non-0 to enable full runtime error checks (-RTC1, etc). This
35# has no effect if (any) optimizations are enabled.
36#
37!IFNDEF USE_RUNTIME_CHECKS
38USE_RUNTIME_CHECKS = 0
39!ENDIF
40
mistachkin4ef916e2016-08-24 19:58:46 +000041# Set this non-0 to create a SQLite amalgamation file that excludes the
42# various built-in extensions.
43#
44!IFNDEF MINIMAL_AMALGAMATION
45MINIMAL_AMALGAMATION = 0
46!ENDIF
47
mistachkin44723ce2015-03-21 02:22:37 +000048# Set this non-0 to use "stdcall" calling convention for the core library
49# and shell executable.
50#
51!IFNDEF USE_STDCALL
52USE_STDCALL = 0
53!ENDIF
54
55# Set this non-0 to have the shell executable link against the core dynamic
56# link library.
57#
58!IFNDEF DYNAMIC_SHELL
59DYNAMIC_SHELL = 0
60!ENDIF
61
mistachkin13a24f82015-05-13 04:50:30 +000062# Set this non-0 to enable extra code that attempts to detect misuse of the
63# SQLite API.
64#
65!IFNDEF API_ARMOR
66API_ARMOR = 0
67!ENDIF
68
mistachkin2318d332015-01-12 18:02:52 +000069# If necessary, create a list of harmless compiler warnings to disable when
mistachkin44723ce2015-03-21 02:22:37 +000070# compiling the various tools. For the SQLite source code itself, warnings,
mistachkin2318d332015-01-12 18:02:52 +000071# if any, will be disabled from within it.
72#
73!IFNDEF NO_WARN
74!IF $(USE_FULLWARN)!=0
mistachkin22529172015-04-10 21:16:11 +000075NO_WARN = -wd4054 -wd4055 -wd4100 -wd4127 -wd4130 -wd4152 -wd4189 -wd4206
mistachkinb9becaa2015-12-16 23:30:30 +000076NO_WARN = $(NO_WARN) -wd4210 -wd4232 -wd4305 -wd4306 -wd4702 -wd4706
mistachkin2318d332015-01-12 18:02:52 +000077!ENDIF
78!ENDIF
79
mistachkina5e2b502014-05-12 22:36:50 +000080# Set this non-0 to use the library paths and other options necessary for
81# Windows Phone 8.1.
mistachkind9b3c542014-05-09 23:31:55 +000082#
83!IFNDEF USE_WP81_OPTS
84USE_WP81_OPTS = 0
85!ENDIF
86
mistachkin76510912013-10-11 23:01:18 +000087# Set this non-0 to split the SQLite amalgamation file into chunks to
88# be used for debugging with Visual Studio.
89#
90!IFNDEF SPLIT_AMALGAMATION
mistachkin0aedc6b2013-10-11 23:02:13 +000091SPLIT_AMALGAMATION = 0
mistachkin76510912013-10-11 23:01:18 +000092!ENDIF
93
mistachkin3e786092016-01-23 07:53:04 +000094# <<mark>>
mistachkinc756ded2011-10-02 05:23:16 +000095# Set this non-0 to use the International Components for Unicode (ICU).
96#
mistachkin0ec07442012-10-12 18:06:07 +000097!IFNDEF USE_ICU
mistachkinc756ded2011-10-02 05:23:16 +000098USE_ICU = 0
mistachkin0ec07442012-10-12 18:06:07 +000099!ENDIF
mistachkin3e786092016-01-23 07:53:04 +0000100# <</mark>>
mistachkinc756ded2011-10-02 05:23:16 +0000101
mistachkin8d967a92012-06-21 04:21:35 +0000102# Set this non-0 to dynamically link to the MSVC runtime library.
103#
mistachkin0ec07442012-10-12 18:06:07 +0000104!IFNDEF USE_CRT_DLL
mistachkin8d967a92012-06-21 04:21:35 +0000105USE_CRT_DLL = 0
mistachkin0ec07442012-10-12 18:06:07 +0000106!ENDIF
mistachkin8d967a92012-06-21 04:21:35 +0000107
mistachkine45e0fb2015-01-21 00:48:46 +0000108# Set this non-0 to link to the RPCRT4 library.
109#
110!IFNDEF USE_RPCRT4_LIB
111USE_RPCRT4_LIB = 0
112!ENDIF
113
mistachkin0157e012013-09-06 21:41:11 +0000114# Set this non-0 to generate assembly code listings for the source code
115# files.
116#
117!IFNDEF USE_LISTINGS
118USE_LISTINGS = 0
119!ENDIF
120
mistachkin52fd8e12012-08-28 01:44:13 +0000121# Set this non-0 to attempt setting the native compiler automatically
122# for cross-compiling the command line tools needed during the compilation
123# process.
124#
mistachkin0ec07442012-10-12 18:06:07 +0000125!IFNDEF XCOMPILE
mistachkin52fd8e12012-08-28 01:44:13 +0000126XCOMPILE = 0
mistachkin0ec07442012-10-12 18:06:07 +0000127!ENDIF
mistachkin52fd8e12012-08-28 01:44:13 +0000128
mistachkinbd58d5f2012-06-30 22:22:34 +0000129# Set this non-0 to use the native libraries paths for cross-compiling
130# the command line tools needed during the compilation process.
131#
mistachkin0ec07442012-10-12 18:06:07 +0000132!IFNDEF USE_NATIVE_LIBPATHS
mistachkinbd58d5f2012-06-30 22:22:34 +0000133USE_NATIVE_LIBPATHS = 0
mistachkin0ec07442012-10-12 18:06:07 +0000134!ENDIF
mistachkinbd58d5f2012-06-30 22:22:34 +0000135
mistachkin08c1c312012-10-06 03:48:25 +0000136# Set this 0 to skip the compiling and embedding of version resources.
137#
mistachkin0ec07442012-10-12 18:06:07 +0000138!IFNDEF USE_RC
mistachkin08c1c312012-10-06 03:48:25 +0000139USE_RC = 1
mistachkin0ec07442012-10-12 18:06:07 +0000140!ENDIF
mistachkin08c1c312012-10-06 03:48:25 +0000141
mistachkin46b721a2012-03-23 12:28:21 +0000142# Set this non-0 to compile binaries suitable for the WinRT environment.
143# This setting does not apply to any binaries that require Tcl to operate
144# properly (i.e. the text fixture, etc).
145#
mistachkin0ec07442012-10-12 18:06:07 +0000146!IFNDEF FOR_WINRT
mistachkin46b721a2012-03-23 12:28:21 +0000147FOR_WINRT = 0
mistachkin0ec07442012-10-12 18:06:07 +0000148!ENDIF
mistachkin46b721a2012-03-23 12:28:21 +0000149
mistachkina819aed2016-02-12 05:19:29 +0000150# Set this non-0 to compile binaries suitable for the UWP environment.
mistachkin318d38c2015-04-22 01:33:53 +0000151# This setting does not apply to any binaries that require Tcl to operate
152# properly (i.e. the text fixture, etc).
153#
mistachkina819aed2016-02-12 05:19:29 +0000154!IFNDEF FOR_UWP
155FOR_UWP = 0
mistachkin318d38c2015-04-22 01:33:53 +0000156!ENDIF
157
mistachkin5d4d9412016-01-22 03:54:36 +0000158# Set this non-0 to compile binaries suitable for the Windows 10 platform.
mistachkinedcb4eb2016-01-22 01:25:15 +0000159#
160!IFNDEF FOR_WIN10
161FOR_WIN10 = 0
162!ENDIF
163
mistachkin3e786092016-01-23 07:53:04 +0000164# <<mark>>
mistachkin31856a32012-07-27 07:13:25 +0000165# Set this non-0 to skip attempting to look for and/or link with the Tcl
166# runtime library.
167#
mistachkin0ec07442012-10-12 18:06:07 +0000168!IFNDEF NO_TCL
mistachkin31856a32012-07-27 07:13:25 +0000169NO_TCL = 0
mistachkin0ec07442012-10-12 18:06:07 +0000170!ENDIF
mistachkin3e786092016-01-23 07:53:04 +0000171# <</mark>>
mistachkin31856a32012-07-27 07:13:25 +0000172
mistachkin4d60be52011-08-26 05:40:31 +0000173# Set this to non-0 to create and use PDBs.
174#
mistachkin0ec07442012-10-12 18:06:07 +0000175!IFNDEF SYMBOLS
mistachkin4d60be52011-08-26 05:40:31 +0000176SYMBOLS = 1
mistachkin0ec07442012-10-12 18:06:07 +0000177!ENDIF
mistachkin4d60be52011-08-26 05:40:31 +0000178
mistachkin2f7d5d82012-08-22 00:39:34 +0000179# Set this to non-0 to use the SQLite debugging heap subsystem.
180#
mistachkin0ec07442012-10-12 18:06:07 +0000181!IFNDEF MEMDEBUG
mistachkin2f7d5d82012-08-22 00:39:34 +0000182MEMDEBUG = 0
mistachkin0ec07442012-10-12 18:06:07 +0000183!ENDIF
mistachkin2f7d5d82012-08-22 00:39:34 +0000184
185# Set this to non-0 to use the Win32 native heap subsystem.
186#
mistachkin0ec07442012-10-12 18:06:07 +0000187!IFNDEF WIN32HEAP
mistachkin2f7d5d82012-08-22 00:39:34 +0000188WIN32HEAP = 0
mistachkin0ec07442012-10-12 18:06:07 +0000189!ENDIF
mistachkin2f7d5d82012-08-22 00:39:34 +0000190
mistachkinb10f22a2015-04-16 16:27:29 +0000191# Set this to non-0 to enable OSTRACE() macros, which can be useful when
192# debugging.
193#
194!IFNDEF OSTRACE
195OSTRACE = 0
196!ENDIF
197
mistachkinf2d25f22011-08-25 04:09:12 +0000198# Set this to one of the following values to enable various debugging
199# features. Each level includes the debugging options from the previous
200# levels. Currently, the recognized values for DEBUG are:
201#
202# 0 == NDEBUG: Disables assert() and other runtime diagnostics.
mistachkincd54bab2014-12-20 21:14:14 +0000203# 1 == SQLITE_ENABLE_API_ARMOR: extra attempts to detect misuse of the API.
204# 2 == Disables NDEBUG and all optimizations and then enables PDBs.
205# 3 == SQLITE_DEBUG: Enables various diagnostics messages and code.
206# 4 == SQLITE_WIN32_MALLOC_VALIDATE: Validate the Win32 native heap per call.
207# 5 == SQLITE_DEBUG_OS_TRACE: Enables output from the OSTRACE() macros.
208# 6 == SQLITE_ENABLE_IOTRACE: Enables output from the IOTRACE() macros.
mistachkinf2d25f22011-08-25 04:09:12 +0000209#
mistachkin0ec07442012-10-12 18:06:07 +0000210!IFNDEF DEBUG
mistachkinf2d25f22011-08-25 04:09:12 +0000211DEBUG = 0
mistachkin0ec07442012-10-12 18:06:07 +0000212!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000213
mistachkin8bcd3fa2013-08-29 01:03:38 +0000214# Enable use of available compiler optimizations? Normally, this should be
215# non-zero. Setting this to zero, thus disabling all compiler optimizations,
216# can be useful for testing.
217#
218!IFNDEF OPTIMIZATIONS
219OPTIMIZATIONS = 2
220!ENDIF
221
mistachkin12b35ea2016-05-03 19:40:54 +0000222# Set this to non-0 to enable support for the session extension.
223#
224!IFNDEF SESSION
225SESSION = 0
226!ENDIF
227
mistachkin5d4d9412016-01-22 03:54:36 +0000228# Set the source code file to be used by executables and libraries when
229# they need the amalgamation.
230#
231!IFNDEF SQLITE3C
232!IF $(SPLIT_AMALGAMATION)!=0
233SQLITE3C = sqlite3-all.c
234!ELSE
235SQLITE3C = sqlite3.c
236!ENDIF
237!ENDIF
238
239# Set the include code file to be used by executables and libraries when
240# they need SQLite.
241#
242!IFNDEF SQLITE3H
243SQLITE3H = sqlite3.h
244!ENDIF
245
mistachkinedcb4eb2016-01-22 01:25:15 +0000246# This is the name to use for the SQLite dynamic link library (DLL).
247#
248!IFNDEF SQLITE3DLL
mistachkinb0c99af2016-02-19 05:07:56 +0000249!IF $(FOR_WIN10)!=0
250SQLITE3DLL = winsqlite3.dll
251!ELSE
mistachkinedcb4eb2016-01-22 01:25:15 +0000252SQLITE3DLL = sqlite3.dll
253!ENDIF
mistachkinb0c99af2016-02-19 05:07:56 +0000254!ENDIF
mistachkinedcb4eb2016-01-22 01:25:15 +0000255
256# This is the name to use for the SQLite import library (LIB).
257#
258!IFNDEF SQLITE3LIB
mistachkinb0c99af2016-02-19 05:07:56 +0000259!IF $(FOR_WIN10)!=0
260SQLITE3LIB = winsqlite3.lib
261!ELSE
mistachkinedcb4eb2016-01-22 01:25:15 +0000262SQLITE3LIB = sqlite3.lib
263!ENDIF
mistachkinb0c99af2016-02-19 05:07:56 +0000264!ENDIF
mistachkinedcb4eb2016-01-22 01:25:15 +0000265
266# This is the name to use for the SQLite shell executable (EXE).
267#
268!IFNDEF SQLITE3EXE
mistachkinb0c99af2016-02-19 05:07:56 +0000269!IF $(FOR_WIN10)!=0
270SQLITE3EXE = winsqlite3shell.exe
271!ELSE
mistachkinedcb4eb2016-01-22 01:25:15 +0000272SQLITE3EXE = sqlite3.exe
273!ENDIF
mistachkinb0c99af2016-02-19 05:07:56 +0000274!ENDIF
mistachkinedcb4eb2016-01-22 01:25:15 +0000275
276# This is the argument used to set the program database (PDB) file for the
277# SQLite shell executable (EXE).
278#
279!IFNDEF SQLITE3EXEPDB
mistachkinb0c99af2016-02-19 05:07:56 +0000280!IF $(FOR_WIN10)!=0
281SQLITE3EXEPDB =
282!ELSE
mistachkinedcb4eb2016-01-22 01:25:15 +0000283SQLITE3EXEPDB = /pdb:sqlite3sh.pdb
284!ENDIF
mistachkinb0c99af2016-02-19 05:07:56 +0000285!ENDIF
mistachkinedcb4eb2016-01-22 01:25:15 +0000286
mistachkincc0164b2016-09-05 20:46:02 +0000287# <<mark>>
mistachkin4ef916e2016-08-24 19:58:46 +0000288# These are the names of the customized Tcl header files used by various parts
289# of this makefile when the stdcall calling convention is in use. It is not
290# used for any other purpose.
291#
292!IFNDEF SQLITETCLH
293SQLITETCLH = sqlite_tcl.h
294!ENDIF
295
296!IFNDEF SQLITETCLDECLSH
297SQLITETCLDECLSH = sqlite_tclDecls.h
298!ENDIF
299
300# These are the additional targets that the targets that integrate with the
301# Tcl library should depend on when compiling, etc.
302#
303!IFNDEF SQLITE_TCL_DEP
304!IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
305SQLITE_TCL_DEP = $(SQLITETCLDECLSH) $(SQLITETCLH)
306!ELSE
307SQLITE_TCL_DEP =
308!ENDIF
309!ENDIF
mistachkincc0164b2016-09-05 20:46:02 +0000310# <</mark>>
mistachkin4ef916e2016-08-24 19:58:46 +0000311
mistachkin4712c212014-05-09 20:51:17 +0000312# These are the "standard" SQLite compilation options used when compiling for
313# the Windows platform.
314#
315!IFNDEF OPT_FEATURE_FLAGS
mistachkin4ef916e2016-08-24 19:58:46 +0000316!IF $(MINIMAL_AMALGAMATION)==0
mistachkin4712c212014-05-09 20:51:17 +0000317OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS3=1
318OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RTREE=1
mistachkin4ef916e2016-08-24 19:58:46 +0000319!ENDIF
mistachkin4712c212014-05-09 20:51:17 +0000320OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_COLUMN_METADATA=1
drh5e18d402016-05-03 13:14:18 +0000321!ENDIF
322
mistachkin12b35ea2016-05-03 19:40:54 +0000323# Should the session extension be enabled? If so, add compilation options
324# to enable it.
drh5e18d402016-05-03 13:14:18 +0000325#
drh5e18d402016-05-03 13:14:18 +0000326!IF $(SESSION)!=0
mistachkin05004782016-03-30 16:23:06 +0000327OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_SESSION=1
328OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_PREUPDATE_HOOK=1
mistachkin4712c212014-05-09 20:51:17 +0000329!ENDIF
330
mistachkinedcb4eb2016-01-22 01:25:15 +0000331# These are the "extended" SQLite compilation options used when compiling for
332# the Windows 10 platform.
333#
334!IFNDEF EXT_FEATURE_FLAGS
335!IF $(FOR_WIN10)!=0
336EXT_FEATURE_FLAGS = $(EXT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS4=1
337EXT_FEATURE_FLAGS = $(EXT_FEATURE_FLAGS) -DSQLITE_SYSTEM_MALLOC=1
338EXT_FEATURE_FLAGS = $(EXT_FEATURE_FLAGS) -DSQLITE_OMIT_LOCALTIME=1
339!ELSE
340EXT_FEATURE_FLAGS =
341!ENDIF
342!ENDIF
343
mistachkin4712c212014-05-09 20:51:17 +0000344###############################################################################
345############################### END OF OPTIONS ################################
346###############################################################################
347
mistachkin55e88d92016-02-08 20:40:57 +0000348# When compiling for the Windows 10 platform, the PLATFORM macro must be set
349# to an appropriate value (e.g. x86, x64, arm, arm64, etc).
350#
351!IF $(FOR_WIN10)!=0
352!IFNDEF PLATFORM
353!ERROR Using the FOR_WIN10 option requires a value for PLATFORM.
354!ENDIF
355!ENDIF
356
mistachkind9b3c542014-05-09 23:31:55 +0000357# This assumes that MSVC is always installed in 32-bit Program Files directory
358# and sets the variable for use in locating other 32-bit installs accordingly.
359#
360PROGRAMFILES_X86 = $(VCINSTALLDIR)\..\..
361PROGRAMFILES_X86 = $(PROGRAMFILES_X86:\\=\)
362
mistachkine37f99c2012-06-30 16:22:05 +0000363# Check for the predefined command macro CC. This should point to the compiler
mistachkinbd58d5f2012-06-30 22:22:34 +0000364# binary for the target platform. If it is not defined, simply define it to
mistachkine37f99c2012-06-30 16:22:05 +0000365# the legacy default value 'cl.exe'.
366#
367!IFNDEF CC
368CC = cl.exe
369!ENDIF
370
mistachkin9aeb9712016-02-26 23:13:16 +0000371# Check for the predefined command macro CSC. This should point to a working
372# C Sharp compiler binary. If it is not defined, simply define it to the
373# legacy default value 'csc.exe'.
374#
375!IFNDEF CSC
376CSC = csc.exe
377!ENDIF
378
mistachkin228aeff2012-06-30 19:24:09 +0000379# Check for the command macro LD. This should point to the linker binary for
mistachkinbd58d5f2012-06-30 22:22:34 +0000380# the target platform. If it is not defined, simply define it to the legacy
mistachkin228aeff2012-06-30 19:24:09 +0000381# default value 'link.exe'.
382#
383!IFNDEF LD
384LD = link.exe
385!ENDIF
386
mistachkin4d9d1f42012-09-03 10:32:32 +0000387# Check for the predefined command macro RC. This should point to the resource
388# compiler binary for the target platform. If it is not defined, simply define
389# it to the legacy default value 'rc.exe'.
390#
391!IFNDEF RC
392RC = rc.exe
393!ENDIF
394
mistachkine48f1ed2016-02-08 20:45:37 +0000395# Check for the MSVC runtime library path macro. Otherwise, this value will
mistachkin4712c212014-05-09 20:51:17 +0000396# default to the 'lib' directory underneath the MSVC installation directory.
397#
398!IFNDEF CRTLIBPATH
399CRTLIBPATH = $(VCINSTALLDIR)\lib
400!ENDIF
401
402CRTLIBPATH = $(CRTLIBPATH:\\=\)
403
mistachkine37f99c2012-06-30 16:22:05 +0000404# Check for the command macro NCC. This should point to the compiler binary
mistachkinbd58d5f2012-06-30 22:22:34 +0000405# for the platform the compilation process is taking place on. If it is not
406# defined, simply define it to have the same value as the CC macro. When
mistachkine37f99c2012-06-30 16:22:05 +0000407# cross-compiling, it is suggested that this macro be modified via the command
408# line (since nmake itself does not provide a built-in method to guess it).
409# For example, to use the x86 compiler when cross-compiling for x64, a command
mistachkinbd58d5f2012-06-30 22:22:34 +0000410# line similar to the following could be used (all on one line):
mistachkine37f99c2012-06-30 16:22:05 +0000411#
mistachkin6f928332012-08-17 11:47:32 +0000412# nmake /f Makefile.msc sqlite3.dll
mistachkin52fd8e12012-08-28 01:44:13 +0000413# XCOMPILE=1 USE_NATIVE_LIBPATHS=1
414#
415# Alternatively, the full path and file name to the compiler binary for the
416# platform the compilation process is taking place may be specified (all on
417# one line):
418#
419# nmake /f Makefile.msc sqlite3.dll
mistachkinbd58d5f2012-06-30 22:22:34 +0000420# "NCC=""%VCINSTALLDIR%\bin\cl.exe"""
421# USE_NATIVE_LIBPATHS=1
mistachkine37f99c2012-06-30 16:22:05 +0000422#
mistachkinfd0ba2a2012-07-27 08:21:45 +0000423!IFDEF NCC
424NCC = $(NCC:\\=\)
mistachkin52fd8e12012-08-28 01:44:13 +0000425!ELSEIF $(XCOMPILE)!=0
mistachkin5fac4202013-12-03 23:33:29 +0000426NCC = "$(VCINSTALLDIR)\bin\$(CC)"
mistachkin52fd8e12012-08-28 01:44:13 +0000427NCC = $(NCC:\\=\)
mistachkinfd0ba2a2012-07-27 08:21:45 +0000428!ELSE
mistachkine37f99c2012-06-30 16:22:05 +0000429NCC = $(CC)
430!ENDIF
431
mistachkine48f1ed2016-02-08 20:45:37 +0000432# Check for the MSVC native runtime library path macro. Otherwise,
mistachkin4712c212014-05-09 20:51:17 +0000433# this value will default to the 'lib' directory underneath the MSVC
mistachkinbd58d5f2012-06-30 22:22:34 +0000434# installation directory.
435#
436!IFNDEF NCRTLIBPATH
437NCRTLIBPATH = $(VCINSTALLDIR)\lib
438!ENDIF
439
mistachkin0b5ae722012-07-27 23:03:47 +0000440NCRTLIBPATH = $(NCRTLIBPATH:\\=\)
441
mistachkine48f1ed2016-02-08 20:45:37 +0000442# Check for the Platform SDK library path macro. Otherwise, this
mistachkinbd58d5f2012-06-30 22:22:34 +0000443# value will default to the 'lib' directory underneath the Windows
444# SDK installation directory (the environment variable used appears
445# to be available when using Visual C++ 2008 or later via the
446# command line).
447#
448!IFNDEF NSDKLIBPATH
449NSDKLIBPATH = $(WINDOWSSDKDIR)\lib
450!ENDIF
451
mistachkin0b5ae722012-07-27 23:03:47 +0000452NSDKLIBPATH = $(NSDKLIBPATH:\\=\)
453
mistachkine48f1ed2016-02-08 20:45:37 +0000454# Check for the UCRT library path macro. Otherwise, this value will
mistachkina6f28892016-02-05 19:40:23 +0000455# default to the version-specific, platform-specific 'lib' directory
456# underneath the Windows SDK installation directory.
457#
458!IFNDEF UCRTLIBPATH
459UCRTLIBPATH = $(WINDOWSSDKDIR)\lib\$(WINDOWSSDKLIBVERSION)\ucrt\$(PLATFORM)
460!ENDIF
461
462UCRTLIBPATH = $(UCRTLIBPATH:\\=\)
463
mistachkinbd58d5f2012-06-30 22:22:34 +0000464# C compiler and options for use in building executables that
shanehb2f20bf2011-06-17 07:07:24 +0000465# will run on the platform that is doing the build.
466#
mistachkin2318d332015-01-12 18:02:52 +0000467!IF $(USE_FULLWARN)!=0
mistachkinf170ea42015-10-16 20:13:57 +0000468BCC = $(NCC) -nologo -W4 $(CCOPTS) $(BCCOPTS)
mistachkin2318d332015-01-12 18:02:52 +0000469!ELSE
mistachkinf170ea42015-10-16 20:13:57 +0000470BCC = $(NCC) -nologo -W3 $(CCOPTS) $(BCCOPTS)
mistachkin2318d332015-01-12 18:02:52 +0000471!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000472
mistachkin0157e012013-09-06 21:41:11 +0000473# Check if assembly code listings should be generated for the source
474# code files to be compiled.
475#
476!IF $(USE_LISTINGS)!=0
477BCC = $(BCC) -FAcs
478!ENDIF
479
mistachkinbd58d5f2012-06-30 22:22:34 +0000480# Check if the native library paths should be used when compiling
481# the command line tools used during the compilation process. If
482# so, set the necessary macro now.
483#
484!IF $(USE_NATIVE_LIBPATHS)!=0
485NLTLIBPATHS = "/LIBPATH:$(NCRTLIBPATH)" "/LIBPATH:$(NSDKLIBPATH)"
mistachkin6bbe3df2015-04-19 06:18:10 +0000486
487!IFDEF NUCRTLIBPATH
488NUCRTLIBPATH = $(NUCRTLIBPATH:\\=\)
489NLTLIBPATHS = $(NLTLIBPATHS) "/LIBPATH:$(NUCRTLIBPATH)"
490!ENDIF
mistachkinbd58d5f2012-06-30 22:22:34 +0000491!ENDIF
492
493# C compiler and options for use in building executables that
shanehb2f20bf2011-06-17 07:07:24 +0000494# will run on the target platform. (BCC and TCC are usually the
495# same unless your are cross-compiling.)
496#
mistachkin2318d332015-01-12 18:02:52 +0000497!IF $(USE_FULLWARN)!=0
mistachkinf170ea42015-10-16 20:13:57 +0000498TCC = $(CC) -nologo -W4 -DINCLUDE_MSVC_H=1 $(CCOPTS) $(TCCOPTS)
mistachkin2318d332015-01-12 18:02:52 +0000499!ELSE
mistachkinf170ea42015-10-16 20:13:57 +0000500TCC = $(CC) -nologo -W3 $(CCOPTS) $(TCCOPTS)
mistachkin2318d332015-01-12 18:02:52 +0000501!ENDIF
502
mistachkin8c5e8fe2017-02-01 22:32:49 +0000503# Check if warnings should be treated as errors when compiling.
504#
505!IF $(USE_FATAL_WARN)!=0
506TCC = $(TCC) -WX
507!ENDIF
508
mistachkin8988aee2016-02-10 21:45:25 +0000509TCC = $(TCC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) -I$(TOP)\src -fp:precise
510RCC = $(RC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) -I$(TOP)\src $(RCOPTS) $(RCCOPTS)
shaneh6e7850c2011-06-17 15:57:07 +0000511
mistachkin44723ce2015-03-21 02:22:37 +0000512# Check if we want to use the "stdcall" calling convention when compiling.
513# This is not supported by the compilers for non-x86 platforms. It should
514# also be noted here that building any target with these "stdcall" options
515# will most likely fail if the Tcl library is also required. This is due
516# to how the Tcl library functions are declared and exported (i.e. without
517# an explicit calling convention, which results in "cdecl").
518#
mistachkinedcb4eb2016-01-22 01:25:15 +0000519!IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
mistachkin44723ce2015-03-21 02:22:37 +0000520!IF "$(PLATFORM)"=="x86"
mistachkin69def7f2016-07-28 04:14:37 +0000521CORE_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
522SHELL_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
mistachkinf27a80c2016-07-28 16:09:52 +0000523# <<mark>>
mistachkin52b1dbb2016-07-28 14:37:04 +0000524TEST_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall -DINCLUDE_SQLITE_TCL_H=1 -DSQLITE_TCLAPI=__cdecl
mistachkinf27a80c2016-07-28 16:09:52 +0000525# <</mark>>
mistachkin44723ce2015-03-21 02:22:37 +0000526!ELSE
527!IFNDEF PLATFORM
mistachkin69def7f2016-07-28 04:14:37 +0000528CORE_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
529SHELL_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
mistachkinf27a80c2016-07-28 16:09:52 +0000530# <<mark>>
mistachkin52b1dbb2016-07-28 14:37:04 +0000531TEST_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall -DINCLUDE_SQLITE_TCL_H=1 -DSQLITE_TCLAPI=__cdecl
mistachkinf27a80c2016-07-28 16:09:52 +0000532# <</mark>>
mistachkin44723ce2015-03-21 02:22:37 +0000533!ELSE
534CORE_CCONV_OPTS =
535SHELL_CCONV_OPTS =
mistachkinf27a80c2016-07-28 16:09:52 +0000536# <<mark>>
mistachkin69def7f2016-07-28 04:14:37 +0000537TEST_CCONV_OPTS =
mistachkinf27a80c2016-07-28 16:09:52 +0000538# <</mark>>
mistachkin44723ce2015-03-21 02:22:37 +0000539!ENDIF
540!ENDIF
541!ELSE
542CORE_CCONV_OPTS =
543SHELL_CCONV_OPTS =
mistachkinf27a80c2016-07-28 16:09:52 +0000544# <<mark>>
mistachkin69def7f2016-07-28 04:14:37 +0000545TEST_CCONV_OPTS =
mistachkinf27a80c2016-07-28 16:09:52 +0000546# <</mark>>
mistachkin44723ce2015-03-21 02:22:37 +0000547!ENDIF
548
549# These are additional compiler options used for the core library.
550#
551!IFNDEF CORE_COMPILE_OPTS
mistachkinedcb4eb2016-01-22 01:25:15 +0000552!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
mistachkin44723ce2015-03-21 02:22:37 +0000553CORE_COMPILE_OPTS = $(CORE_CCONV_OPTS) -DSQLITE_API=__declspec(dllexport)
554!ELSE
555CORE_COMPILE_OPTS = $(CORE_CCONV_OPTS)
556!ENDIF
557!ENDIF
558
559# These are the additional targets that the core library should depend on
560# when linking.
561#
562!IFNDEF CORE_LINK_DEP
mistachkin9b88ace2016-02-26 21:01:37 +0000563!IF $(DYNAMIC_SHELL)!=0
mistachkin44723ce2015-03-21 02:22:37 +0000564CORE_LINK_DEP =
mistachkin9b88ace2016-02-26 21:01:37 +0000565!ELSEIF $(FOR_WIN10)==0 || "$(PLATFORM)"=="x86"
mistachkin44723ce2015-03-21 02:22:37 +0000566CORE_LINK_DEP = sqlite3.def
mistachkin9b88ace2016-02-26 21:01:37 +0000567!ELSE
568CORE_LINK_DEP =
mistachkin44723ce2015-03-21 02:22:37 +0000569!ENDIF
570!ENDIF
571
572# These are additional linker options used for the core library.
573#
574!IFNDEF CORE_LINK_OPTS
mistachkin9b88ace2016-02-26 21:01:37 +0000575!IF $(DYNAMIC_SHELL)!=0
mistachkin44723ce2015-03-21 02:22:37 +0000576CORE_LINK_OPTS =
mistachkin9b88ace2016-02-26 21:01:37 +0000577!ELSEIF $(FOR_WIN10)==0 || "$(PLATFORM)"=="x86"
mistachkin44723ce2015-03-21 02:22:37 +0000578CORE_LINK_OPTS = /DEF:sqlite3.def
mistachkin9b88ace2016-02-26 21:01:37 +0000579!ELSE
580CORE_LINK_OPTS =
mistachkin44723ce2015-03-21 02:22:37 +0000581!ENDIF
582!ENDIF
583
584# These are additional compiler options used for the shell executable.
585#
586!IFNDEF SHELL_COMPILE_OPTS
mistachkinedcb4eb2016-01-22 01:25:15 +0000587!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
mistachkin5d4d9412016-01-22 03:54:36 +0000588SHELL_COMPILE_OPTS = $(SHELL_CCONV_OPTS) -DSQLITE_API=__declspec(dllimport)
mistachkin44723ce2015-03-21 02:22:37 +0000589!ELSE
mistachkin5d4d9412016-01-22 03:54:36 +0000590SHELL_COMPILE_OPTS = $(SHELL_CCONV_OPTS)
591!ENDIF
592!ENDIF
593
594# This is the source code that the shell executable should be compiled
595# with.
596#
597!IFNDEF SHELL_CORE_SRC
598!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
599SHELL_CORE_SRC =
600!ELSE
601SHELL_CORE_SRC = $(SQLITE3C)
mistachkin44723ce2015-03-21 02:22:37 +0000602!ENDIF
603!ENDIF
604
605# This is the core library that the shell executable should depend on.
606#
607!IFNDEF SHELL_CORE_DEP
mistachkinedcb4eb2016-01-22 01:25:15 +0000608!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
609SHELL_CORE_DEP = $(SQLITE3DLL)
mistachkin44723ce2015-03-21 02:22:37 +0000610!ELSE
mistachkin5d4d9412016-01-22 03:54:36 +0000611SHELL_CORE_DEP =
mistachkin44723ce2015-03-21 02:22:37 +0000612!ENDIF
613!ENDIF
614
615# This is the core library that the shell executable should link with.
616#
617!IFNDEF SHELL_CORE_LIB
mistachkinedcb4eb2016-01-22 01:25:15 +0000618!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
619SHELL_CORE_LIB = $(SQLITE3LIB)
mistachkin44723ce2015-03-21 02:22:37 +0000620!ELSE
mistachkin5d4d9412016-01-22 03:54:36 +0000621SHELL_CORE_LIB =
mistachkin44723ce2015-03-21 02:22:37 +0000622!ENDIF
623!ENDIF
624
625# These are additional linker options used for the shell executable.
626#
627!IFNDEF SHELL_LINK_OPTS
628SHELL_LINK_OPTS = $(SHELL_CORE_LIB)
629!ENDIF
630
mistachkin0157e012013-09-06 21:41:11 +0000631# Check if assembly code listings should be generated for the source
632# code files to be compiled.
633#
634!IF $(USE_LISTINGS)!=0
635TCC = $(TCC) -FAcs
636!ENDIF
637
mistachkinf39eaf22012-03-20 02:18:42 +0000638# When compiling the library for use in the WinRT environment,
mistachkin46b721a2012-03-23 12:28:21 +0000639# the following compile-time options must be used as well to
mistachkinf39eaf22012-03-20 02:18:42 +0000640# disable use of Win32 APIs that are not available and to enable
641# use of Win32 APIs that are specific to Windows 8 and/or WinRT.
642#
mistachkin46b721a2012-03-23 12:28:21 +0000643!IF $(FOR_WINRT)!=0
mistachkin8d967a92012-06-21 04:21:35 +0000644TCC = $(TCC) -DSQLITE_OS_WINRT=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000645RCC = $(RCC) -DSQLITE_OS_WINRT=1
mistachkin08c1c312012-10-06 03:48:25 +0000646TCC = $(TCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
647RCC = $(RCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
mistachkin8d967a92012-06-21 04:21:35 +0000648!ENDIF
649
mistachkin5d4d9412016-01-22 03:54:36 +0000650# C compiler options for the Windows 10 platform (needs MSVC 2015).
mistachkinedcb4eb2016-01-22 01:25:15 +0000651#
652!IF $(FOR_WIN10)!=0
mistachkin406eeff2016-02-09 18:28:20 +0000653TCC = $(TCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
654BCC = $(BCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
mistachkinedcb4eb2016-01-22 01:25:15 +0000655!ENDIF
656
mistachkin8d967a92012-06-21 04:21:35 +0000657# Also, we need to dynamically link to the correct MSVC runtime
658# when compiling for WinRT (e.g. debug or release) OR if the
659# USE_CRT_DLL option is set to force dynamically linking to the
660# MSVC runtime library.
661#
mistachkina6f28892016-02-05 19:40:23 +0000662!IF $(FOR_WINRT)!=0 || $(USE_CRT_DLL)!=0
mistachkincd54bab2014-12-20 21:14:14 +0000663!IF $(DEBUG)>1
mistachkin8d967a92012-06-21 04:21:35 +0000664TCC = $(TCC) -MDd
mistachkin08c1c312012-10-06 03:48:25 +0000665BCC = $(BCC) -MDd
mistachkin8d967a92012-06-21 04:21:35 +0000666!ELSE
667TCC = $(TCC) -MD
mistachkin08c1c312012-10-06 03:48:25 +0000668BCC = $(BCC) -MD
mistachkin8d967a92012-06-21 04:21:35 +0000669!ENDIF
670!ELSE
mistachkincd54bab2014-12-20 21:14:14 +0000671!IF $(DEBUG)>1
mistachkin8d967a92012-06-21 04:21:35 +0000672TCC = $(TCC) -MTd
mistachkin08c1c312012-10-06 03:48:25 +0000673BCC = $(BCC) -MTd
mistachkin8d967a92012-06-21 04:21:35 +0000674!ELSE
675TCC = $(TCC) -MT
mistachkin08c1c312012-10-06 03:48:25 +0000676BCC = $(BCC) -MT
mistachkin8d967a92012-06-21 04:21:35 +0000677!ENDIF
mistachkin46b721a2012-03-23 12:28:21 +0000678!ENDIF
mistachkinf39eaf22012-03-20 02:18:42 +0000679
mistachkin3e786092016-01-23 07:53:04 +0000680# <<mark>>
mistachkinf39eaf22012-03-20 02:18:42 +0000681# The mksqlite3c.tcl and mksqlite3h.tcl scripts will pull in
shaneh6e7850c2011-06-17 15:57:07 +0000682# any extension header files by default. For non-amalgamation
683# builds, we need to make sure the compiler can find these.
684#
685!IF $(USE_AMALGAMATION)==0
686TCC = $(TCC) -I$(TOP)\ext\fts3
mistachkin4d9d1f42012-09-03 10:32:32 +0000687RCC = $(RCC) -I$(TOP)\ext\fts3
shaneh6e7850c2011-06-17 15:57:07 +0000688TCC = $(TCC) -I$(TOP)\ext\rtree
mistachkin4d9d1f42012-09-03 10:32:32 +0000689RCC = $(RCC) -I$(TOP)\ext\rtree
drh498dcae2013-03-13 11:42:00 +0000690TCC = $(TCC) -I$(TOP)\ext\session
mistachkin38b4daa2013-03-13 19:02:39 +0000691RCC = $(RCC) -I$(TOP)\ext\session
shaneh6e7850c2011-06-17 15:57:07 +0000692!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000693
mistachkinb0427512014-01-30 11:12:52 +0000694# The mksqlite3c.tcl script accepts some options on the command
695# line. When compiling with debugging enabled, some of these
696# options are necessary in order to allow debugging symbols to
697# work correctly with Visual Studio when using the amalgamation.
698#
mistachkin4ef916e2016-08-24 19:58:46 +0000699!IFNDEF MKSQLITE3C_TOOL
700!IF $(MINIMAL_AMALGAMATION)!=0
701MKSQLITE3C_TOOL = $(TOP)\tool\mksqlite3c-noext.tcl
702!ELSE
703MKSQLITE3C_TOOL = $(TOP)\tool\mksqlite3c.tcl
704!ENDIF
705!ENDIF
706
mistachkin22529172015-04-10 21:16:11 +0000707!IFNDEF MKSQLITE3C_ARGS
mistachkincd54bab2014-12-20 21:14:14 +0000708!IF $(DEBUG)>1
mistachkinb0427512014-01-30 11:12:52 +0000709MKSQLITE3C_ARGS = --linemacros
710!ELSE
711MKSQLITE3C_ARGS =
712!ENDIF
mistachkin4ef916e2016-08-24 19:58:46 +0000713!IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
714MKSQLITE3C_ARGS = $(MKSQLITE3C_ARGS) --useapicall
715!ENDIF
716!ENDIF
717
718# The mksqlite3h.tcl script accepts some options on the command line.
719# When compiling with stdcall support, some of these options are
720# necessary.
721#
722!IFNDEF MKSQLITE3H_ARGS
723!IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
724MKSQLITE3H_ARGS = --useapicall
725!ELSE
726MKSQLITE3H_ARGS =
727!ENDIF
mistachkin22529172015-04-10 21:16:11 +0000728!ENDIF
mistachkin3e786092016-01-23 07:53:04 +0000729# <</mark>>
mistachkinb0427512014-01-30 11:12:52 +0000730
shanehb2f20bf2011-06-17 07:07:24 +0000731# Define -DNDEBUG to compile without debugging (i.e., for production usage)
732# Omitting the define will cause extra debugging code to be inserted and
733# includes extra comments when "EXPLAIN stmt" is used.
734#
mistachkin753c5442011-08-25 02:02:25 +0000735!IF $(DEBUG)==0
shanehb2f20bf2011-06-17 07:07:24 +0000736TCC = $(TCC) -DNDEBUG
mistachkinfec360a2012-04-18 10:29:21 +0000737BCC = $(BCC) -DNDEBUG
mistachkin4d9d1f42012-09-03 10:32:32 +0000738RCC = $(RCC) -DNDEBUG
mistachkin753c5442011-08-25 02:02:25 +0000739!ENDIF
740
mistachkinedcb4eb2016-01-22 01:25:15 +0000741!IF $(DEBUG)>0 || $(API_ARMOR)!=0 || $(FOR_WIN10)!=0
mistachkin13a24f82015-05-13 04:50:30 +0000742TCC = $(TCC) -DSQLITE_ENABLE_API_ARMOR=1
743RCC = $(RCC) -DSQLITE_ENABLE_API_ARMOR=1
mistachkincd54bab2014-12-20 21:14:14 +0000744!ENDIF
745
746!IF $(DEBUG)>2
mistachkin13a24f82015-05-13 04:50:30 +0000747TCC = $(TCC) -DSQLITE_DEBUG=1
748RCC = $(RCC) -DSQLITE_DEBUG=1
mistachkinb3d3bea2017-03-29 23:22:18 +0000749!IF $(DYNAMIC_SHELL)==0
750TCC = $(TCC) -DSQLITE_ENABLE_WHERETRACE -DSQLITE_ENABLE_SELECTTRACE
751RCC = $(RCC) -DSQLITE_ENABLE_WHERETRACE -DSQLITE_ENABLE_SELECTTRACE
752!ENDIF
mistachkin753c5442011-08-25 02:02:25 +0000753!ENDIF
754
mistachkinb10f22a2015-04-16 16:27:29 +0000755!IF $(DEBUG)>4 || $(OSTRACE)!=0
756TCC = $(TCC) -DSQLITE_FORCE_OS_TRACE=1 -DSQLITE_DEBUG_OS_TRACE=1
757RCC = $(RCC) -DSQLITE_FORCE_OS_TRACE=1 -DSQLITE_DEBUG_OS_TRACE=1
mistachkin753c5442011-08-25 02:02:25 +0000758!ENDIF
759
mistachkincd54bab2014-12-20 21:14:14 +0000760!IF $(DEBUG)>5
mistachkin13a24f82015-05-13 04:50:30 +0000761TCC = $(TCC) -DSQLITE_ENABLE_IOTRACE=1
762RCC = $(RCC) -DSQLITE_ENABLE_IOTRACE=1
mistachkin753c5442011-08-25 02:02:25 +0000763!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000764
mistachkinbd58d5f2012-06-30 22:22:34 +0000765# Prevent warnings about "insecure" MSVC runtime library functions
766# being used.
mistachkin176f1b42011-08-02 23:34:00 +0000767#
768TCC = $(TCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
mistachkinfec360a2012-04-18 10:29:21 +0000769BCC = $(BCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
mistachkin4d9d1f42012-09-03 10:32:32 +0000770RCC = $(RCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
mistachkin176f1b42011-08-02 23:34:00 +0000771
mistachkinbd58d5f2012-06-30 22:22:34 +0000772# Prevent warnings about "deprecated" POSIX functions being used.
773#
774TCC = $(TCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
775BCC = $(BCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
mistachkin4d9d1f42012-09-03 10:32:32 +0000776RCC = $(RCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
mistachkinbd58d5f2012-06-30 22:22:34 +0000777
mistachkin2f7d5d82012-08-22 00:39:34 +0000778# Use the SQLite debugging heap subsystem?
mistachkin1b186a92011-08-24 16:13:57 +0000779#
mistachkin2f7d5d82012-08-22 00:39:34 +0000780!IF $(MEMDEBUG)!=0
781TCC = $(TCC) -DSQLITE_MEMDEBUG=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000782RCC = $(RCC) -DSQLITE_MEMDEBUG=1
mistachkin2f7d5d82012-08-22 00:39:34 +0000783
mistachkin2f7d5d82012-08-22 00:39:34 +0000784# Use native Win32 heap subsystem instead of malloc/free?
785#
786!ELSEIF $(WIN32HEAP)!=0
787TCC = $(TCC) -DSQLITE_WIN32_MALLOC=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000788RCC = $(RCC) -DSQLITE_WIN32_MALLOC=1
mistachkin753c5442011-08-25 02:02:25 +0000789
mistachkin753c5442011-08-25 02:02:25 +0000790# Validate the heap on every call into the native Win32 heap subsystem?
791#
mistachkincd54bab2014-12-20 21:14:14 +0000792!IF $(DEBUG)>3
mistachkin753c5442011-08-25 02:02:25 +0000793TCC = $(TCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000794RCC = $(RCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1
mistachkin753c5442011-08-25 02:02:25 +0000795!ENDIF
mistachkin2f7d5d82012-08-22 00:39:34 +0000796!ENDIF
mistachkin1b186a92011-08-24 16:13:57 +0000797
mistachkin3e786092016-01-23 07:53:04 +0000798# <<mark>>
mistachkin5b0b6fd2011-06-25 01:14:36 +0000799# The locations of the Tcl header and library files. Also, the library that
800# non-stubs enabled programs using Tcl must link against. These variables
801# (TCLINCDIR, TCLLIBDIR, and LIBTCL) may be overridden via the environment
802# prior to running nmake in order to match the actual installed location and
803# version on this machine.
shanehb2f20bf2011-06-17 07:07:24 +0000804#
mistachkine37f99c2012-06-30 16:22:05 +0000805!IFNDEF TCLINCDIR
shanehb2f20bf2011-06-17 07:07:24 +0000806TCLINCDIR = c:\tcl\include
mistachkine37f99c2012-06-30 16:22:05 +0000807!ENDIF
mistachkin5b0b6fd2011-06-25 01:14:36 +0000808
mistachkine37f99c2012-06-30 16:22:05 +0000809!IFNDEF TCLLIBDIR
shanehb2f20bf2011-06-17 07:07:24 +0000810TCLLIBDIR = c:\tcl\lib
mistachkine37f99c2012-06-30 16:22:05 +0000811!ENDIF
mistachkin5b0b6fd2011-06-25 01:14:36 +0000812
mistachkine37f99c2012-06-30 16:22:05 +0000813!IFNDEF LIBTCL
drh506a1402016-11-02 19:49:22 +0000814LIBTCL = tcl86.lib
mistachkine37f99c2012-06-30 16:22:05 +0000815!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000816
mistachkin5b663502015-10-10 23:39:55 +0000817!IFNDEF LIBTCLSTUB
drh506a1402016-11-02 19:49:22 +0000818LIBTCLSTUB = tclstub86.lib
mistachkin5b663502015-10-10 23:39:55 +0000819!ENDIF
820
mistachkin88739962015-10-14 23:04:08 +0000821!IFNDEF LIBTCLPATH
822LIBTCLPATH = c:\tcl\bin
823!ENDIF
824
mistachkinc756ded2011-10-02 05:23:16 +0000825# The locations of the ICU header and library files. These variables
826# (ICUINCDIR, ICULIBDIR, and LIBICU) may be overridden via the environment
827# prior to running nmake in order to match the actual installed location on
828# this machine.
829#
mistachkine37f99c2012-06-30 16:22:05 +0000830!IFNDEF ICUINCDIR
mistachkinc756ded2011-10-02 05:23:16 +0000831ICUINCDIR = c:\icu\include
mistachkine37f99c2012-06-30 16:22:05 +0000832!ENDIF
mistachkinc756ded2011-10-02 05:23:16 +0000833
mistachkine37f99c2012-06-30 16:22:05 +0000834!IFNDEF ICULIBDIR
mistachkinc756ded2011-10-02 05:23:16 +0000835ICULIBDIR = c:\icu\lib
mistachkine37f99c2012-06-30 16:22:05 +0000836!ENDIF
mistachkinc756ded2011-10-02 05:23:16 +0000837
mistachkine37f99c2012-06-30 16:22:05 +0000838!IFNDEF LIBICU
mistachkinc756ded2011-10-02 05:23:16 +0000839LIBICU = icuuc.lib icuin.lib
mistachkine37f99c2012-06-30 16:22:05 +0000840!ENDIF
mistachkinc756ded2011-10-02 05:23:16 +0000841
shanehb2f20bf2011-06-17 07:07:24 +0000842# This is the command to use for tclsh - normally just "tclsh", but we may
mistachkin5b0b6fd2011-06-25 01:14:36 +0000843# know the specific version we want to use. This variable (TCLSH_CMD) may be
844# overridden via the environment prior to running nmake in order to select a
845# specific Tcl shell to use.
shanehb2f20bf2011-06-17 07:07:24 +0000846#
mistachkine37f99c2012-06-30 16:22:05 +0000847!IFNDEF TCLSH_CMD
drh506a1402016-11-02 19:49:22 +0000848TCLSH_CMD = tclsh
mistachkine37f99c2012-06-30 16:22:05 +0000849!ENDIF
mistachkin3e786092016-01-23 07:53:04 +0000850# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +0000851
852# Compiler options needed for programs that use the readline() library.
853#
mistachkin8bcd3fa2013-08-29 01:03:38 +0000854!IFNDEF READLINE_FLAGS
shaneh6e7850c2011-06-17 15:57:07 +0000855READLINE_FLAGS = -DHAVE_READLINE=0
mistachkin8bcd3fa2013-08-29 01:03:38 +0000856!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000857
858# The library that programs using readline() must link against.
859#
mistachkin8bcd3fa2013-08-29 01:03:38 +0000860!IFNDEF LIBREADLINE
shaneh6e7850c2011-06-17 15:57:07 +0000861LIBREADLINE =
mistachkin8bcd3fa2013-08-29 01:03:38 +0000862!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000863
864# Should the database engine be compiled threadsafe
865#
866TCC = $(TCC) -DSQLITE_THREADSAFE=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000867RCC = $(RCC) -DSQLITE_THREADSAFE=1
shanehb2f20bf2011-06-17 07:07:24 +0000868
869# Do threads override each others locks by default (1), or do we test (-1)
870#
871TCC = $(TCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1
mistachkin4d9d1f42012-09-03 10:32:32 +0000872RCC = $(RCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1
shanehb2f20bf2011-06-17 07:07:24 +0000873
874# Any target libraries which libsqlite must be linked against
shaneh6e7850c2011-06-17 15:57:07 +0000875#
mistachkine37f99c2012-06-30 16:22:05 +0000876!IFNDEF TLIBS
shaneh6e7850c2011-06-17 15:57:07 +0000877TLIBS =
mistachkine37f99c2012-06-30 16:22:05 +0000878!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000879
880# Flags controlling use of the in memory btree implementation
881#
882# SQLITE_TEMP_STORE is 0 to force temporary tables to be in a file, 1 to
883# default to file, 2 to default to memory, and 3 to force temporary
884# tables to always be in memory.
885#
shaneh6e7850c2011-06-17 15:57:07 +0000886TCC = $(TCC) -DSQLITE_TEMP_STORE=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000887RCC = $(RCC) -DSQLITE_TEMP_STORE=1
shanehb2f20bf2011-06-17 07:07:24 +0000888
889# Enable/disable loadable extensions, and other optional features
shaneh6e7850c2011-06-17 15:57:07 +0000890# based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*).
891# The same set of OMIT and ENABLE flags should be passed to the
shanehb2f20bf2011-06-17 07:07:24 +0000892# LEMON parser generator and the mkkeywordhash tool as well.
893
mistachkin4712c212014-05-09 20:51:17 +0000894# These are the required SQLite compilation options used when compiling for
895# the Windows platform.
896#
897REQ_FEATURE_FLAGS = $(REQ_FEATURE_FLAGS) -DSQLITE_MAX_TRIGGER_DEPTH=100
shanehb2f20bf2011-06-17 07:07:24 +0000898
mistachkine45e0fb2015-01-21 00:48:46 +0000899# If we are linking to the RPCRT4 library, enable features that need it.
900#
901!IF $(USE_RPCRT4_LIB)!=0
902REQ_FEATURE_FLAGS = $(REQ_FEATURE_FLAGS) -DSQLITE_WIN32_USE_UUID=1
903!ENDIF
904
mistachkin4712c212014-05-09 20:51:17 +0000905# Add the required and optional SQLite compilation options into the command
906# lines used to invoke the MSVC code and resource compilers.
907#
mistachkinedcb4eb2016-01-22 01:25:15 +0000908TCC = $(TCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS)
909RCC = $(RCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS)
shanehb2f20bf2011-06-17 07:07:24 +0000910
mistachkin4712c212014-05-09 20:51:17 +0000911# Add in any optional parameters specified on the commane line, e.g.
912# nmake /f Makefile.msc all "OPTS=-DSQLITE_ENABLE_FOO=1 -DSQLITE_OMIT_FOO=1"
913#
shanehb2f20bf2011-06-17 07:07:24 +0000914TCC = $(TCC) $(OPTS)
mistachkin4d9d1f42012-09-03 10:32:32 +0000915RCC = $(RCC) $(OPTS)
shanehb2f20bf2011-06-17 07:07:24 +0000916
mistachkin8bcd3fa2013-08-29 01:03:38 +0000917# If compiling for debugging, add some defines.
mistachkin4712c212014-05-09 20:51:17 +0000918#
mistachkincd54bab2014-12-20 21:14:14 +0000919!IF $(DEBUG)>1
mistachkin8bcd3fa2013-08-29 01:03:38 +0000920TCC = $(TCC) -D_DEBUG
921BCC = $(BCC) -D_DEBUG
mistachkin4d9d1f42012-09-03 10:32:32 +0000922RCC = $(RCC) -D_DEBUG
mistachkin4d60be52011-08-26 05:40:31 +0000923!ENDIF
924
mistachkin8bcd3fa2013-08-29 01:03:38 +0000925# If optimizations are enabled or disabled (either implicitly or
926# explicitly), add the necessary flags.
mistachkin4712c212014-05-09 20:51:17 +0000927#
mistachkincd54bab2014-12-20 21:14:14 +0000928!IF $(DEBUG)>1 || $(OPTIMIZATIONS)==0
mistachkin8bcd3fa2013-08-29 01:03:38 +0000929TCC = $(TCC) -Od
930BCC = $(BCC) -Od
mistachkin24b6b812016-08-24 18:21:58 +0000931!IF $(USE_RUNTIME_CHECKS)!=0
932TCC = $(TCC) -RTC1
933BCC = $(BCC) -RTC1
934!ENDIF
mistachkin8bcd3fa2013-08-29 01:03:38 +0000935!ELSEIF $(OPTIMIZATIONS)>=3
936TCC = $(TCC) -Ox
937BCC = $(BCC) -Ox
938!ELSEIF $(OPTIMIZATIONS)==2
939TCC = $(TCC) -O2
940BCC = $(BCC) -O2
941!ELSEIF $(OPTIMIZATIONS)==1
942TCC = $(TCC) -O1
943BCC = $(BCC) -O1
944!ENDIF
945
946# If symbols are enabled (or compiling for debugging), enable PDBs.
mistachkin4712c212014-05-09 20:51:17 +0000947#
mistachkincd54bab2014-12-20 21:14:14 +0000948!IF $(DEBUG)>1 || $(SYMBOLS)!=0
mistachkin4d60be52011-08-26 05:40:31 +0000949TCC = $(TCC) -Zi
mistachkinfec360a2012-04-18 10:29:21 +0000950BCC = $(BCC) -Zi
mistachkin753c5442011-08-25 02:02:25 +0000951!ENDIF
952
mistachkin3e786092016-01-23 07:53:04 +0000953# <<mark>>
mistachkinc756ded2011-10-02 05:23:16 +0000954# If ICU support is enabled, add the compiler options for it.
mistachkin4712c212014-05-09 20:51:17 +0000955#
mistachkinc756ded2011-10-02 05:23:16 +0000956!IF $(USE_ICU)!=0
957TCC = $(TCC) -DSQLITE_ENABLE_ICU=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000958RCC = $(RCC) -DSQLITE_ENABLE_ICU=1
mistachkinc756ded2011-10-02 05:23:16 +0000959TCC = $(TCC) -I$(TOP)\ext\icu
mistachkin4d9d1f42012-09-03 10:32:32 +0000960RCC = $(RCC) -I$(TOP)\ext\icu
mistachkinc756ded2011-10-02 05:23:16 +0000961TCC = $(TCC) -I$(ICUINCDIR)
mistachkin4d9d1f42012-09-03 10:32:32 +0000962RCC = $(RCC) -I$(ICUINCDIR)
mistachkinc756ded2011-10-02 05:23:16 +0000963!ENDIF
mistachkin3e786092016-01-23 07:53:04 +0000964# <</mark>>
mistachkinc756ded2011-10-02 05:23:16 +0000965
mistachkin4d9d1f42012-09-03 10:32:32 +0000966# Command line prefixes for compiling code, compiling resources,
967# linking, etc.
mistachkin4712c212014-05-09 20:51:17 +0000968#
shanehb2f20bf2011-06-17 07:07:24 +0000969LTCOMPILE = $(TCC) -Fo$@
mistachkin4d9d1f42012-09-03 10:32:32 +0000970LTRCOMPILE = $(RCC) -r
shanehb2f20bf2011-06-17 07:07:24 +0000971LTLIB = lib.exe
shaneh2a0b9ef2011-06-20 20:52:32 +0000972LTLINK = $(TCC) -Fe$@
973
mistachkine45e0fb2015-01-21 00:48:46 +0000974# If requested, link to the RPCRT4 library.
975#
976!IF $(USE_RPCRT4_LIB)!=0
977LTLINK = $(LTLINK) rpcrt4.lib
978!ENDIF
979
shaneh2a0b9ef2011-06-20 20:52:32 +0000980# If a platform was set, force the linker to target that.
981# Note that the vcvars*.bat family of batch files typically
982# set this for you. Otherwise, the linker will attempt
983# to deduce the binary type based on the object files.
mistachkine37f99c2012-06-30 16:22:05 +0000984!IFDEF PLATFORM
mistachkin44723ce2015-03-21 02:22:37 +0000985LTLINKOPTS = /NOLOGO /MACHINE:$(PLATFORM)
986LTLIBOPTS = /NOLOGO /MACHINE:$(PLATFORM)
987!ELSE
988LTLINKOPTS = /NOLOGO
989LTLIBOPTS = /NOLOGO
shaneh2a0b9ef2011-06-20 20:52:32 +0000990!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000991
mistachkina6ff8572012-04-17 21:00:12 +0000992# When compiling for use in the WinRT environment, the following
993# linker option must be used to mark the executable as runnable
994# only in the context of an application container.
995#
996!IF $(FOR_WINRT)!=0
997LTLINKOPTS = $(LTLINKOPTS) /APPCONTAINER
mistachkin318d38c2015-04-22 01:33:53 +0000998!IF "$(VISUALSTUDIOVERSION)"=="12.0" || "$(VISUALSTUDIOVERSION)"=="14.0"
mistachkinf6a23422014-05-05 20:24:34 +0000999!IFNDEF STORELIBPATH
mistachkinda5b1cd2013-07-10 19:39:02 +00001000!IF "$(PLATFORM)"=="x86"
mistachkin4712c212014-05-09 20:51:17 +00001001STORELIBPATH = $(CRTLIBPATH)\store
mistachkinda5b1cd2013-07-10 19:39:02 +00001002!ELSEIF "$(PLATFORM)"=="x64"
mistachkin4712c212014-05-09 20:51:17 +00001003STORELIBPATH = $(CRTLIBPATH)\store\amd64
mistachkin4eaa1292013-07-10 21:33:25 +00001004!ELSEIF "$(PLATFORM)"=="ARM"
mistachkin4712c212014-05-09 20:51:17 +00001005STORELIBPATH = $(CRTLIBPATH)\store\arm
mistachkin4eaa1292013-07-10 21:33:25 +00001006!ELSE
mistachkin4712c212014-05-09 20:51:17 +00001007STORELIBPATH = $(CRTLIBPATH)\store
mistachkinda5b1cd2013-07-10 19:39:02 +00001008!ENDIF
1009!ENDIF
mistachkinf6a23422014-05-05 20:24:34 +00001010STORELIBPATH = $(STORELIBPATH:\\=\)
1011LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(STORELIBPATH)"
1012!ENDIF
mistachkina6ff8572012-04-17 21:00:12 +00001013!ENDIF
1014
mistachkind9b3c542014-05-09 23:31:55 +00001015# When compiling for Windows Phone 8.1, an extra library path is
1016# required.
1017#
1018!IF $(USE_WP81_OPTS)!=0
1019!IFNDEF WP81LIBPATH
1020!IF "$(PLATFORM)"=="x86"
1021WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86
1022!ELSEIF "$(PLATFORM)"=="ARM"
1023WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\ARM
1024!ELSE
1025WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86
mistachkinc756ded2011-10-02 05:23:16 +00001026!ENDIF
mistachkin31856a32012-07-27 07:13:25 +00001027!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +00001028!ENDIF
1029
mistachkind9b3c542014-05-09 23:31:55 +00001030# When compiling for Windows Phone 8.1, some extra linker options
1031# are also required.
1032#
1033!IF $(USE_WP81_OPTS)!=0
1034!IFDEF WP81LIBPATH
1035LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(WP81LIBPATH)"
1036!ENDIF
1037LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE
1038LTLINKOPTS = $(LTLINKOPTS) WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelHost.lib
1039LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:kernel32.lib /NODEFAULTLIB:ole32.lib
1040!ENDIF
1041
mistachkina819aed2016-02-12 05:19:29 +00001042# When compiling for UWP or the Windows 10 platform, some extra linker
mistachkin55e88d92016-02-08 20:40:57 +00001043# options are also required.
mistachkin318d38c2015-04-22 01:33:53 +00001044#
mistachkina819aed2016-02-12 05:19:29 +00001045!IF $(FOR_UWP)!=0 || $(FOR_WIN10)!=0
mistachkin318d38c2015-04-22 01:33:53 +00001046LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE /NODEFAULTLIB:kernel32.lib
1047LTLINKOPTS = $(LTLINKOPTS) mincore.lib
1048!IFDEF PSDKLIBPATH
1049LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(PSDKLIBPATH)"
1050!ENDIF
1051!ENDIF
1052
mistachkina6f28892016-02-05 19:40:23 +00001053!IF $(FOR_WIN10)!=0
mistachkin406eeff2016-02-09 18:28:20 +00001054LTLINKOPTS = $(LTLINKOPTS) /guard:cf "/LIBPATH:$(UCRTLIBPATH)"
mistachkina6f28892016-02-05 19:40:23 +00001055!IF $(DEBUG)>1
1056LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:libucrtd.lib /DEFAULTLIB:ucrtd.lib
1057!ELSE
1058LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib
1059!ENDIF
1060!ENDIF
1061
shanehb2f20bf2011-06-17 07:07:24 +00001062# If either debugging or symbols are enabled, enable PDBs.
mistachkin4712c212014-05-09 20:51:17 +00001063#
mistachkincd54bab2014-12-20 21:14:14 +00001064!IF $(DEBUG)>1 || $(SYMBOLS)!=0
mistachkinf170ea42015-10-16 20:13:57 +00001065LDFLAGS = /DEBUG $(LDOPTS)
1066!ELSE
1067LDFLAGS = $(LDOPTS)
shanehb2f20bf2011-06-17 07:07:24 +00001068!ENDIF
1069
mistachkin3e786092016-01-23 07:53:04 +00001070# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001071# Start with the Tcl related linker options.
mistachkin4712c212014-05-09 20:51:17 +00001072#
shanehb2f20bf2011-06-17 07:07:24 +00001073!IF $(NO_TCL)==0
1074LTLIBPATHS = /LIBPATH:$(TCLLIBDIR)
1075LTLIBS = $(LIBTCL)
mistachkin31856a32012-07-27 07:13:25 +00001076!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +00001077
1078# If ICU support is enabled, add the linker options for it.
mistachkin4712c212014-05-09 20:51:17 +00001079#
shanehb2f20bf2011-06-17 07:07:24 +00001080!IF $(USE_ICU)!=0
1081LTLIBPATHS = $(LTLIBPATHS) /LIBPATH:$(ICULIBDIR)
1082LTLIBS = $(LTLIBS) $(LIBICU)
1083!ENDIF
mistachkin3e786092016-01-23 07:53:04 +00001084# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001085
shanehb2f20bf2011-06-17 07:07:24 +00001086# You should not have to change anything below this line
1087###############################################################################
1088
mistachkin3e786092016-01-23 07:53:04 +00001089# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001090# Object files for the SQLite library (non-amalgamation).
1091#
mistachkinf67feef2013-07-29 19:03:20 +00001092LIBOBJS0 = vdbe.lo parse.lo alter.lo analyze.lo attach.lo auth.lo \
shanehb2f20bf2011-06-17 07:07:24 +00001093 backup.lo bitvec.lo btmutex.lo btree.lo build.lo \
drh1a4a6802015-05-04 18:31:09 +00001094 callback.lo complete.lo ctime.lo date.lo dbstat.lo delete.lo \
shanehb2f20bf2011-06-17 07:07:24 +00001095 expr.lo fault.lo fkey.lo \
drh391d4ba2012-05-28 20:22:16 +00001096 fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo \
1097 fts3_porter.lo fts3_snippet.lo fts3_tokenizer.lo fts3_tokenizer1.lo \
drh4d648c72013-04-22 17:07:56 +00001098 fts3_tokenize_vtab.lo fts3_unicode.lo fts3_unicode2.lo fts3_write.lo \
mistachkined52f9f2015-06-26 04:34:36 +00001099 fts5.lo \
shanehb2f20bf2011-06-17 07:07:24 +00001100 func.lo global.lo hash.lo \
drhc2f18ad2016-03-05 15:35:09 +00001101 icu.lo insert.lo legacy.lo loadext.lo \
shanehb2f20bf2011-06-17 07:07:24 +00001102 main.lo malloc.lo mem0.lo mem1.lo mem2.lo mem3.lo mem5.lo \
1103 memjournal.lo \
mistachkinf1c6bc52012-06-21 15:09:20 +00001104 mutex.lo mutex_noop.lo mutex_unix.lo mutex_w32.lo \
1105 notify.lo opcodes.lo os.lo os_unix.lo os_win.lo \
mistachkinf67feef2013-07-29 19:03:20 +00001106 pager.lo pcache.lo pcache1.lo pragma.lo prepare.lo printf.lo \
drh498dcae2013-03-13 11:42:00 +00001107 random.lo resolve.lo rowset.lo rtree.lo \
drhcb75bff2016-01-14 14:48:17 +00001108 sqlite3session.lo select.lo sqlite3rbu.lo status.lo \
drh38b41492015-06-08 15:08:15 +00001109 table.lo threads.lo tokenize.lo treeview.lo trigger.lo \
shanehb2f20bf2011-06-17 07:07:24 +00001110 update.lo util.lo vacuum.lo \
mistachkinf67feef2013-07-29 19:03:20 +00001111 vdbeapi.lo vdbeaux.lo vdbeblob.lo vdbemem.lo vdbesort.lo \
drh6c1f4ef2015-06-08 14:23:15 +00001112 vdbetrace.lo wal.lo walker.lo where.lo wherecode.lo whereexpr.lo \
1113 utf.lo vtab.lo
mistachkin3e786092016-01-23 07:53:04 +00001114# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001115
1116# Object files for the amalgamation.
1117#
1118LIBOBJS1 = sqlite3.lo
1119
1120# Determine the real value of LIBOBJ based on the 'configure' script
1121#
mistachkin3e786092016-01-23 07:53:04 +00001122# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001123!IF $(USE_AMALGAMATION)==0
1124LIBOBJ = $(LIBOBJS0)
1125!ELSE
mistachkin3e786092016-01-23 07:53:04 +00001126# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001127LIBOBJ = $(LIBOBJS1)
mistachkin3e786092016-01-23 07:53:04 +00001128# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001129!ENDIF
mistachkin3e786092016-01-23 07:53:04 +00001130# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001131
mistachkin08c1c312012-10-06 03:48:25 +00001132# Determine if embedded resource compilation and usage are enabled.
1133#
1134!IF $(USE_RC)!=0
1135LIBRESOBJS = sqlite3res.lo
1136!ELSE
1137LIBRESOBJS =
1138!ENDIF
1139
mistachkin3e786092016-01-23 07:53:04 +00001140# <<mark>>
mistachkinc04c54b2016-02-11 21:28:16 +00001141# Core source code files, part 1.
shanehb2f20bf2011-06-17 07:07:24 +00001142#
mistachkinc04c54b2016-02-11 21:28:16 +00001143SRC00 = \
shanehb2f20bf2011-06-17 07:07:24 +00001144 $(TOP)\src\alter.c \
1145 $(TOP)\src\analyze.c \
1146 $(TOP)\src\attach.c \
1147 $(TOP)\src\auth.c \
1148 $(TOP)\src\backup.c \
1149 $(TOP)\src\bitvec.c \
1150 $(TOP)\src\btmutex.c \
1151 $(TOP)\src\btree.c \
shanehb2f20bf2011-06-17 07:07:24 +00001152 $(TOP)\src\build.c \
1153 $(TOP)\src\callback.c \
1154 $(TOP)\src\complete.c \
1155 $(TOP)\src\ctime.c \
1156 $(TOP)\src\date.c \
drh1a4a6802015-05-04 18:31:09 +00001157 $(TOP)\src\dbstat.c \
shanehb2f20bf2011-06-17 07:07:24 +00001158 $(TOP)\src\delete.c \
1159 $(TOP)\src\expr.c \
1160 $(TOP)\src\fault.c \
1161 $(TOP)\src\fkey.c \
1162 $(TOP)\src\func.c \
1163 $(TOP)\src\global.c \
1164 $(TOP)\src\hash.c \
shanehb2f20bf2011-06-17 07:07:24 +00001165 $(TOP)\src\insert.c \
shanehb2f20bf2011-06-17 07:07:24 +00001166 $(TOP)\src\legacy.c \
1167 $(TOP)\src\loadext.c \
1168 $(TOP)\src\main.c \
1169 $(TOP)\src\malloc.c \
1170 $(TOP)\src\mem0.c \
1171 $(TOP)\src\mem1.c \
1172 $(TOP)\src\mem2.c \
1173 $(TOP)\src\mem3.c \
1174 $(TOP)\src\mem5.c \
1175 $(TOP)\src\memjournal.c \
1176 $(TOP)\src\mutex.c \
shanehb2f20bf2011-06-17 07:07:24 +00001177 $(TOP)\src\mutex_noop.c \
shanehb2f20bf2011-06-17 07:07:24 +00001178 $(TOP)\src\mutex_unix.c \
1179 $(TOP)\src\mutex_w32.c \
1180 $(TOP)\src\notify.c \
1181 $(TOP)\src\os.c \
shanehb2f20bf2011-06-17 07:07:24 +00001182 $(TOP)\src\os_unix.c \
mistachkinc04c54b2016-02-11 21:28:16 +00001183 $(TOP)\src\os_win.c
1184
1185# Core source code files, part 2.
1186#
1187SRC01 = \
shanehb2f20bf2011-06-17 07:07:24 +00001188 $(TOP)\src\pager.c \
shanehb2f20bf2011-06-17 07:07:24 +00001189 $(TOP)\src\pcache.c \
shanehb2f20bf2011-06-17 07:07:24 +00001190 $(TOP)\src\pcache1.c \
1191 $(TOP)\src\pragma.c \
1192 $(TOP)\src\prepare.c \
1193 $(TOP)\src\printf.c \
1194 $(TOP)\src\random.c \
1195 $(TOP)\src\resolve.c \
1196 $(TOP)\src\rowset.c \
1197 $(TOP)\src\select.c \
1198 $(TOP)\src\status.c \
shanehb2f20bf2011-06-17 07:07:24 +00001199 $(TOP)\src\table.c \
drhf51446a2012-07-21 19:40:42 +00001200 $(TOP)\src\threads.c \
shanehb2f20bf2011-06-17 07:07:24 +00001201 $(TOP)\src\tclsqlite.c \
1202 $(TOP)\src\tokenize.c \
drh38b41492015-06-08 15:08:15 +00001203 $(TOP)\src\treeview.c \
shanehb2f20bf2011-06-17 07:07:24 +00001204 $(TOP)\src\trigger.c \
1205 $(TOP)\src\utf.c \
1206 $(TOP)\src\update.c \
1207 $(TOP)\src\util.c \
1208 $(TOP)\src\vacuum.c \
1209 $(TOP)\src\vdbe.c \
shanehb2f20bf2011-06-17 07:07:24 +00001210 $(TOP)\src\vdbeapi.c \
1211 $(TOP)\src\vdbeaux.c \
1212 $(TOP)\src\vdbeblob.c \
1213 $(TOP)\src\vdbemem.c \
mistachkin81c428a2011-08-17 02:19:54 +00001214 $(TOP)\src\vdbesort.c \
shanehb2f20bf2011-06-17 07:07:24 +00001215 $(TOP)\src\vdbetrace.c \
shanehb2f20bf2011-06-17 07:07:24 +00001216 $(TOP)\src\vtab.c \
1217 $(TOP)\src\wal.c \
shanehb2f20bf2011-06-17 07:07:24 +00001218 $(TOP)\src\walker.c \
drhe54df422013-11-12 18:37:25 +00001219 $(TOP)\src\where.c \
drh6f82e852015-06-06 20:12:09 +00001220 $(TOP)\src\wherecode.c \
mistachkinc04c54b2016-02-11 21:28:16 +00001221 $(TOP)\src\whereexpr.c
1222
1223# Shell source code files.
1224#
1225SRC02 = \
1226 $(TOP)\src\shell.c
1227
1228# Core miscellaneous files.
1229#
1230SRC03 = \
1231 $(TOP)\src\parse.y
1232
1233# Core header files, part 1.
1234#
1235SRC04 = \
1236 $(TOP)\src\btree.h \
1237 $(TOP)\src\btreeInt.h \
1238 $(TOP)\src\hash.h \
1239 $(TOP)\src\hwtime.h \
1240 $(TOP)\src\msvc.h \
1241 $(TOP)\src\mutex.h \
1242 $(TOP)\src\os.h \
1243 $(TOP)\src\os_common.h \
1244 $(TOP)\src\os_setup.h \
1245 $(TOP)\src\os_win.h
1246
1247# Core header files, part 2.
1248#
1249SRC05 = \
1250 $(TOP)\src\pager.h \
1251 $(TOP)\src\pcache.h \
1252 $(TOP)\src\pragma.h \
1253 $(TOP)\src\sqlite.h.in \
1254 $(TOP)\src\sqlite3ext.h \
1255 $(TOP)\src\sqliteInt.h \
1256 $(TOP)\src\sqliteLimit.h \
1257 $(TOP)\src\vdbe.h \
1258 $(TOP)\src\vdbeInt.h \
1259 $(TOP)\src\vxworks.h \
1260 $(TOP)\src\wal.h \
drhe54df422013-11-12 18:37:25 +00001261 $(TOP)\src\whereInt.h
shanehb2f20bf2011-06-17 07:07:24 +00001262
mistachkinc04c54b2016-02-11 21:28:16 +00001263# Extension source code files, part 1.
shanehb2f20bf2011-06-17 07:07:24 +00001264#
mistachkinc04c54b2016-02-11 21:28:16 +00001265SRC06 = \
shanehb2f20bf2011-06-17 07:07:24 +00001266 $(TOP)\ext\fts1\fts1.c \
shanehb2f20bf2011-06-17 07:07:24 +00001267 $(TOP)\ext\fts1\fts1_hash.c \
shanehb2f20bf2011-06-17 07:07:24 +00001268 $(TOP)\ext\fts1\fts1_porter.c \
drh62679202015-01-29 18:38:05 +00001269 $(TOP)\ext\fts1\fts1_tokenizer1.c \
shanehb2f20bf2011-06-17 07:07:24 +00001270 $(TOP)\ext\fts2\fts2.c \
shanehb2f20bf2011-06-17 07:07:24 +00001271 $(TOP)\ext\fts2\fts2_hash.c \
shanehb2f20bf2011-06-17 07:07:24 +00001272 $(TOP)\ext\fts2\fts2_icu.c \
1273 $(TOP)\ext\fts2\fts2_porter.c \
shanehb2f20bf2011-06-17 07:07:24 +00001274 $(TOP)\ext\fts2\fts2_tokenizer.c \
1275 $(TOP)\ext\fts2\fts2_tokenizer1.c
mistachkinc04c54b2016-02-11 21:28:16 +00001276
1277# Extension source code files, part 2.
1278#
1279SRC07 = \
shanehb2f20bf2011-06-17 07:07:24 +00001280 $(TOP)\ext\fts3\fts3.c \
shanehb2f20bf2011-06-17 07:07:24 +00001281 $(TOP)\ext\fts3\fts3_aux.c \
1282 $(TOP)\ext\fts3\fts3_expr.c \
1283 $(TOP)\ext\fts3\fts3_hash.c \
shanehb2f20bf2011-06-17 07:07:24 +00001284 $(TOP)\ext\fts3\fts3_icu.c \
1285 $(TOP)\ext\fts3\fts3_porter.c \
1286 $(TOP)\ext\fts3\fts3_snippet.c \
shanehb2f20bf2011-06-17 07:07:24 +00001287 $(TOP)\ext\fts3\fts3_tokenizer.c \
1288 $(TOP)\ext\fts3\fts3_tokenizer1.c \
drh4d648c72013-04-22 17:07:56 +00001289 $(TOP)\ext\fts3\fts3_tokenize_vtab.c \
drh391d4ba2012-05-28 20:22:16 +00001290 $(TOP)\ext\fts3\fts3_unicode.c \
1291 $(TOP)\ext\fts3\fts3_unicode2.c \
drh62679202015-01-29 18:38:05 +00001292 $(TOP)\ext\fts3\fts3_write.c \
drh62679202015-01-29 18:38:05 +00001293 $(TOP)\ext\icu\icu.c \
drhedea9112015-03-24 19:02:13 +00001294 $(TOP)\ext\rtree\rtree.c \
drhdbbd8162015-05-19 23:04:26 +00001295 $(TOP)\ext\session\sqlite3session.c \
drh50065652015-10-08 19:29:18 +00001296 $(TOP)\ext\rbu\sqlite3rbu.c \
drhf00f5302017-06-28 15:47:29 +00001297 $(TOP)\ext\misc\json1.c \
drhc6603af2017-06-29 14:33:51 +00001298 $(TOP)\ext\misc\stmt.c
shanehb2f20bf2011-06-17 07:07:24 +00001299
mistachkinc04c54b2016-02-11 21:28:16 +00001300# Extension header files, part 1.
1301#
1302SRC08 = \
1303 $(TOP)\ext\fts1\fts1.h \
1304 $(TOP)\ext\fts1\fts1_hash.h \
1305 $(TOP)\ext\fts1\fts1_tokenizer.h \
1306 $(TOP)\ext\fts2\fts2.h \
1307 $(TOP)\ext\fts2\fts2_hash.h \
1308 $(TOP)\ext\fts2\fts2_tokenizer.h
1309
1310# Extension header files, part 2.
1311#
1312SRC09 = \
1313 $(TOP)\ext\fts3\fts3.h \
1314 $(TOP)\ext\fts3\fts3Int.h \
1315 $(TOP)\ext\fts3\fts3_hash.h \
1316 $(TOP)\ext\fts3\fts3_tokenizer.h \
1317 $(TOP)\ext\icu\sqliteicu.h \
1318 $(TOP)\ext\rtree\rtree.h \
mistachkin05004782016-03-30 16:23:06 +00001319 $(TOP)\ext\rbu\sqlite3rbu.h \
1320 $(TOP)\ext\session\sqlite3session.h
shanehb2f20bf2011-06-17 07:07:24 +00001321
1322# Generated source code files
1323#
mistachkinc04c54b2016-02-11 21:28:16 +00001324SRC10 = \
shanehb2f20bf2011-06-17 07:07:24 +00001325 opcodes.c \
mistachkinc04c54b2016-02-11 21:28:16 +00001326 parse.c
1327
1328# Generated header files
1329#
1330SRC11 = \
1331 keywordhash.h \
shanehb2f20bf2011-06-17 07:07:24 +00001332 opcodes.h \
shanehb2f20bf2011-06-17 07:07:24 +00001333 parse.h \
mistachkin5d4d9412016-01-22 03:54:36 +00001334 $(SQLITE3H)
shanehb2f20bf2011-06-17 07:07:24 +00001335
mistachkin52b1dbb2016-07-28 14:37:04 +00001336# Generated Tcl header files
1337#
mistachkin4ef916e2016-08-24 19:58:46 +00001338!IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
mistachkin52b1dbb2016-07-28 14:37:04 +00001339SRC12 = \
mistachkin4ef916e2016-08-24 19:58:46 +00001340 $(SQLITETCLH) \
1341 $(SQLITETCLDECLSH)
1342!ELSE
1343SRC12 =
1344!ENDIF
mistachkin52b1dbb2016-07-28 14:37:04 +00001345
drh62679202015-01-29 18:38:05 +00001346# All source code files.
1347#
mistachkinc04c54b2016-02-11 21:28:16 +00001348SRC = $(SRC00) $(SRC01) $(SRC02) $(SRC03) $(SRC04) $(SRC05) $(SRC06) $(SRC07) $(SRC08) $(SRC09) $(SRC10) $(SRC11)
drh62679202015-01-29 18:38:05 +00001349
shanehb2f20bf2011-06-17 07:07:24 +00001350# Source code to the test files.
1351#
1352TESTSRC = \
1353 $(TOP)\src\test1.c \
1354 $(TOP)\src\test2.c \
1355 $(TOP)\src\test3.c \
1356 $(TOP)\src\test4.c \
1357 $(TOP)\src\test5.c \
1358 $(TOP)\src\test6.c \
1359 $(TOP)\src\test7.c \
1360 $(TOP)\src\test8.c \
1361 $(TOP)\src\test9.c \
1362 $(TOP)\src\test_autoext.c \
1363 $(TOP)\src\test_async.c \
1364 $(TOP)\src\test_backup.c \
drhddebf162016-03-04 02:59:35 +00001365 $(TOP)\src\test_bestindex.c \
drh5de7d962014-12-05 00:17:39 +00001366 $(TOP)\src\test_blob.c \
shanehb2f20bf2011-06-17 07:07:24 +00001367 $(TOP)\src\test_btree.c \
1368 $(TOP)\src\test_config.c \
dan000f95b2016-09-09 20:00:40 +00001369 $(TOP)\src\test_delete.c \
shanehb2f20bf2011-06-17 07:07:24 +00001370 $(TOP)\src\test_demovfs.c \
1371 $(TOP)\src\test_devsym.c \
mistachkin413c63b2013-01-17 03:18:14 +00001372 $(TOP)\src\test_fs.c \
shanehb2f20bf2011-06-17 07:07:24 +00001373 $(TOP)\src\test_func.c \
shanehb2f20bf2011-06-17 07:07:24 +00001374 $(TOP)\src\test_hexio.c \
1375 $(TOP)\src\test_init.c \
1376 $(TOP)\src\test_intarray.c \
1377 $(TOP)\src\test_journal.c \
1378 $(TOP)\src\test_malloc.c \
1379 $(TOP)\src\test_multiplex.c \
1380 $(TOP)\src\test_mutex.c \
1381 $(TOP)\src\test_onefile.c \
1382 $(TOP)\src\test_osinst.c \
1383 $(TOP)\src\test_pcache.c \
1384 $(TOP)\src\test_quota.c \
1385 $(TOP)\src\test_rtree.c \
1386 $(TOP)\src\test_schema.c \
1387 $(TOP)\src\test_server.c \
1388 $(TOP)\src\test_superlock.c \
1389 $(TOP)\src\test_syscall.c \
shanehb2f20bf2011-06-17 07:07:24 +00001390 $(TOP)\src\test_tclvar.c \
1391 $(TOP)\src\test_thread.c \
1392 $(TOP)\src\test_vfs.c \
mistachkin92af1eb2015-11-30 23:29:07 +00001393 $(TOP)\src\test_windirent.c \
shanehb2f20bf2011-06-17 07:07:24 +00001394 $(TOP)\src\test_wsd.c \
1395 $(TOP)\ext\fts3\fts3_term.c \
mistachkinadb96a62012-01-16 12:33:36 +00001396 $(TOP)\ext\fts3\fts3_test.c \
mistachkin05004782016-03-30 16:23:06 +00001397 $(TOP)\ext\rbu\test_rbu.c \
1398 $(TOP)\ext\session\test_session.c
shanehb2f20bf2011-06-17 07:07:24 +00001399
mistachkinc04c54b2016-02-11 21:28:16 +00001400# Statically linked extensions.
drhe50db1c2013-04-25 14:31:46 +00001401#
drh1fb64af2013-04-25 14:36:28 +00001402TESTEXT = \
drh8416fc72013-04-25 16:42:55 +00001403 $(TOP)\ext\misc\amatch.c \
drh2e3f87a2016-07-03 02:35:47 +00001404 $(TOP)\ext\misc\carray.c \
drh8416fc72013-04-25 16:42:55 +00001405 $(TOP)\ext\misc\closure.c \
drh35db31b2016-06-02 23:13:21 +00001406 $(TOP)\ext\misc\csv.c \
drh1728bcb2014-11-10 16:49:56 +00001407 $(TOP)\ext\misc\eval.c \
drh51ed2982014-06-16 12:44:32 +00001408 $(TOP)\ext\misc\fileio.c \
drhe50db1c2013-04-25 14:31:46 +00001409 $(TOP)\ext\misc\fuzzer.c \
mistachkined52f9f2015-06-26 04:34:36 +00001410 $(TOP)\ext\fts5\fts5_tcl.c \
dand3789c02015-08-04 20:29:00 +00001411 $(TOP)\ext\fts5\fts5_test_mi.c \
dan2cfe0492016-01-14 20:05:59 +00001412 $(TOP)\ext\fts5\fts5_test_tok.c \
drh8416fc72013-04-25 16:42:55 +00001413 $(TOP)\ext\misc\ieee754.c \
drhea41dc42013-04-25 19:31:33 +00001414 $(TOP)\ext\misc\nextchar.c \
drhdef33672013-05-28 20:25:54 +00001415 $(TOP)\ext\misc\percentile.c \
drhe50db1c2013-04-25 14:31:46 +00001416 $(TOP)\ext\misc\regexp.c \
drh6bada272016-08-09 21:08:42 +00001417 $(TOP)\ext\misc\remember.c \
drh398f8722015-08-19 13:54:20 +00001418 $(TOP)\ext\misc\series.c \
drhb7045ab2013-04-25 14:59:01 +00001419 $(TOP)\ext\misc\spellfix.c \
drh5f8cdac2013-10-14 21:14:42 +00001420 $(TOP)\ext\misc\totype.c \
drh3935ce82017-07-18 20:28:34 +00001421 $(TOP)\ext\misc\unionvtab.c \
drhe50db1c2013-04-25 14:31:46 +00001422 $(TOP)\ext\misc\wholenumber.c
1423
shanehb2f20bf2011-06-17 07:07:24 +00001424# Source code to the library files needed by the test fixture
mistachkinadb96a62012-01-16 12:33:36 +00001425# (non-amalgamation)
shanehb2f20bf2011-06-17 07:07:24 +00001426#
1427TESTSRC2 = \
mistachkinc04c54b2016-02-11 21:28:16 +00001428 $(SRC00) \
1429 $(SRC01) \
1430 $(SRC06) \
1431 $(SRC07) \
1432 $(SRC10) \
mistachkin05004782016-03-30 16:23:06 +00001433 $(TOP)\ext\async\sqlite3async.c
shanehb2f20bf2011-06-17 07:07:24 +00001434
1435# Header files used by all library source files.
1436#
1437HDR = \
1438 $(TOP)\src\btree.h \
1439 $(TOP)\src\btreeInt.h \
1440 $(TOP)\src\hash.h \
1441 $(TOP)\src\hwtime.h \
1442 keywordhash.h \
mistachkin2318d332015-01-12 18:02:52 +00001443 $(TOP)\src\msvc.h \
shanehb2f20bf2011-06-17 07:07:24 +00001444 $(TOP)\src\mutex.h \
1445 opcodes.h \
1446 $(TOP)\src\os.h \
1447 $(TOP)\src\os_common.h \
mistachkinf74b9e02013-11-26 01:00:31 +00001448 $(TOP)\src\os_setup.h \
mistachkin8bc52622013-11-25 09:36:07 +00001449 $(TOP)\src\os_win.h \
shanehb2f20bf2011-06-17 07:07:24 +00001450 $(TOP)\src\pager.h \
1451 $(TOP)\src\pcache.h \
shaneh6e7850c2011-06-17 15:57:07 +00001452 parse.h \
drh67e65e52015-02-02 21:34:54 +00001453 $(TOP)\src\pragma.h \
mistachkin5d4d9412016-01-22 03:54:36 +00001454 $(SQLITE3H) \
mistachkine37f7392016-07-28 19:28:35 +00001455 sqlite3ext.h \
shaneh6e7850c2011-06-17 15:57:07 +00001456 $(TOP)\src\sqliteInt.h \
shanehb2f20bf2011-06-17 07:07:24 +00001457 $(TOP)\src\sqliteLimit.h \
1458 $(TOP)\src\vdbe.h \
drhe54df422013-11-12 18:37:25 +00001459 $(TOP)\src\vdbeInt.h \
drh8cd5b252015-03-02 22:06:43 +00001460 $(TOP)\src\vxworks.h \
drhe54df422013-11-12 18:37:25 +00001461 $(TOP)\src\whereInt.h
shanehb2f20bf2011-06-17 07:07:24 +00001462
1463# Header files used by extensions
1464#
1465EXTHDR = $(EXTHDR) \
1466 $(TOP)\ext\fts1\fts1.h \
1467 $(TOP)\ext\fts1\fts1_hash.h \
1468 $(TOP)\ext\fts1\fts1_tokenizer.h
1469EXTHDR = $(EXTHDR) \
1470 $(TOP)\ext\fts2\fts2.h \
1471 $(TOP)\ext\fts2\fts2_hash.h \
1472 $(TOP)\ext\fts2\fts2_tokenizer.h
1473EXTHDR = $(EXTHDR) \
1474 $(TOP)\ext\fts3\fts3.h \
1475 $(TOP)\ext\fts3\fts3Int.h \
1476 $(TOP)\ext\fts3\fts3_hash.h \
1477 $(TOP)\ext\fts3\fts3_tokenizer.h
1478EXTHDR = $(EXTHDR) \
1479 $(TOP)\ext\rtree\rtree.h
1480EXTHDR = $(EXTHDR) \
1481 $(TOP)\ext\icu\sqliteicu.h
1482EXTHDR = $(EXTHDR) \
1483 $(TOP)\ext\rtree\sqlite3rtree.h
mistachkinadb96a62012-01-16 12:33:36 +00001484EXTHDR = $(EXTHDR) \
1485 $(TOP)\ext\session\sqlite3session.h
shanehb2f20bf2011-06-17 07:07:24 +00001486
mistachkind4ab1032015-05-11 16:27:33 +00001487# executables needed for testing
drhf4375442015-05-11 12:15:45 +00001488#
1489TESTPROGS = \
1490 testfixture.exe \
mistachkinedcb4eb2016-01-22 01:25:15 +00001491 $(SQLITE3EXE) \
drhf4375442015-05-11 12:15:45 +00001492 sqlite3_analyzer.exe \
drh290fcaa2016-06-08 01:03:05 +00001493 sqldiff.exe \
1494 dbhash.exe
drhf4375442015-05-11 12:15:45 +00001495
drhea93c702015-05-26 18:15:08 +00001496# Databases containing fuzzer test cases
1497#
1498FUZZDATA = \
1499 $(TOP)\test\fuzzdata1.db \
1500 $(TOP)\test\fuzzdata2.db \
drh64ff56f2015-09-23 11:59:50 +00001501 $(TOP)\test\fuzzdata3.db \
drh362b66f2016-11-14 18:27:41 +00001502 $(TOP)\test\fuzzdata4.db \
1503 $(TOP)\test\fuzzdata5.db
mistachkin3e786092016-01-23 07:53:04 +00001504# <</mark>>
drhea93c702015-05-26 18:15:08 +00001505
mistachkin5d4d9412016-01-22 03:54:36 +00001506# Additional compiler options for the shell. These are only effective
1507# when the shell is not being dynamically linked.
drhd7f2bea2015-09-19 14:32:51 +00001508#
mistachkin5d4d9412016-01-22 03:54:36 +00001509!IF $(DYNAMIC_SHELL)==0 && $(FOR_WIN10)==0
drhc6603af2017-06-29 14:33:51 +00001510SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_SHELL_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_STMTVTAB
mistachkinedcb4eb2016-01-22 01:25:15 +00001511!ENDIF
1512
mistachkin3e786092016-01-23 07:53:04 +00001513# <<mark>>
mistachkin5d4d9412016-01-22 03:54:36 +00001514# Extra compiler options for various test tools.
1515#
1516MPTESTER_COMPILE_OPTS = -DSQLITE_SHELL_JSON1 -DSQLITE_ENABLE_FTS5
mistachkin8381be42015-10-09 14:23:56 +00001517FUZZERSHELL_COMPILE_OPTS = -DSQLITE_ENABLE_JSON1
drha6bf20b2017-03-10 17:03:11 +00001518FUZZCHECK_COMPILE_OPTS = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMSYS5 -DSQLITE_OSS_FUZZ -DSQLITE_MAX_MEMORY=50000000
drh362b66f2016-11-14 18:27:41 +00001519FUZZCHECK_SRC = $(TOP)\test\fuzzcheck.c $(TOP)\test\ossfuzz.c
1520OSSSHELL_SRC = $(TOP)\test\ossshell.c $(TOP)\test\ossfuzz.c
mistachkin953fbd12017-02-07 21:09:34 +00001521DBFUZZ_COMPILE_OPTS = -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION
1522KV_COMPILE_OPTS = -DSQLITE_THREADSAFE=0 -DSQLITE_DIRECT_OVERFLOW_READ
1523DBSELFTEST_COMPILE_OPTS = -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5
1524ST_COMPILE_OPTS = -DSQLITE_THREADSAFE=0
drhf4375442015-05-11 12:15:45 +00001525
mistachkin5d4d9412016-01-22 03:54:36 +00001526# Standard options to testfixture.
drh905da632015-06-10 18:53:09 +00001527#
1528TESTOPTS = --verbose=file --output=test-out.txt
drhf4375442015-05-11 12:15:45 +00001529
mistachkind5be6f02016-01-27 07:28:33 +00001530# Extra targets for the "all" target that require Tcl.
1531#
1532!IF $(NO_TCL)==0
1533ALL_TCL_TARGETS = libtclsqlite3.lib
1534!ELSE
1535ALL_TCL_TARGETS =
1536!ENDIF
mistachkin3e786092016-01-23 07:53:04 +00001537# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001538
1539# This is the default Makefile target. The objects listed here
1540# are what get build when you type just "make" with no arguments.
1541#
mistachkind5be6f02016-01-27 07:28:33 +00001542all: dll libsqlite3.lib shell $(ALL_TCL_TARGETS)
shanehb2f20bf2011-06-17 07:07:24 +00001543
mistachkina8a18732016-01-22 22:16:50 +00001544# Dynamic link library section.
1545#
mistachkin9b88ace2016-02-26 21:01:37 +00001546dll: $(SQLITE3DLL)
mistachkina8a18732016-01-22 22:16:50 +00001547
1548# Shell executable.
1549#
mistachkin9b88ace2016-02-26 21:01:37 +00001550shell: $(SQLITE3EXE)
shanehb2f20bf2011-06-17 07:07:24 +00001551
mistachkinb0c99af2016-02-19 05:07:56 +00001552# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001553libsqlite3.lib: $(LIBOBJ)
shaneh29ebea82011-06-21 18:12:07 +00001554 $(LTLIB) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001555
1556libtclsqlite3.lib: tclsqlite.lo libsqlite3.lib
mistachkin5b663502015-10-10 23:39:55 +00001557 $(LTLIB) $(LTLIBOPTS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCLSTUB) $(TLIBS)
mistachkin3e786092016-01-23 07:53:04 +00001558# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001559
mistachkin9b88ace2016-02-26 21:01:37 +00001560$(SQLITE3DLL): $(LIBOBJ) $(LIBRESOBJS) $(CORE_LINK_DEP)
mistachkina8a18732016-01-22 22:16:50 +00001561 $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL $(CORE_LINK_OPTS) /OUT:$@ $(LIBOBJ) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001562
mistachkin9aeb9712016-02-26 23:13:16 +00001563# <<block2>>
mistachkin9b88ace2016-02-26 21:01:37 +00001564sqlite3.def: libsqlite3.lib
mistachkina8a18732016-01-22 22:16:50 +00001565 echo EXPORTS > sqlite3.def
1566 dumpbin /all libsqlite3.lib \
mistachkinc8d3e832017-05-12 14:05:11 +00001567 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl include "^\s+1 _?(sqlite3(?:session|changeset|changegroup)?_[^@]*)(?:@\d+)?$$" \1 \
mistachkina8a18732016-01-22 22:16:50 +00001568 | sort >> sqlite3.def
mistachkin9aeb9712016-02-26 23:13:16 +00001569# <</block2>>
drhd62c0f42015-04-09 13:34:29 +00001570
mistachkin5d4d9412016-01-22 03:54:36 +00001571$(SQLITE3EXE): $(TOP)\src\shell.c $(SHELL_CORE_DEP) $(LIBRESOBJS) $(SHELL_CORE_SRC) $(SQLITE3H)
1572 $(LTLINK) $(SHELL_COMPILE_OPTS) $(READLINE_FLAGS) $(TOP)\src\shell.c $(SHELL_CORE_SRC) \
mistachkinedcb4eb2016-01-22 01:25:15 +00001573 /link $(SQLITE3EXEPDB) $(LDFLAGS) $(LTLINKOPTS) $(SHELL_LINK_OPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS)
drh268e72f2015-04-17 14:30:49 +00001574
mistachkin3e786092016-01-23 07:53:04 +00001575# <<mark>>
mistachkin5d4d9412016-01-22 03:54:36 +00001576sqldiff.exe: $(TOP)\tool\sqldiff.c $(SQLITE3C) $(SQLITE3H)
1577 $(LTLINK) $(NO_WARN) $(TOP)\tool\sqldiff.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
mistachkin44723ce2015-03-21 02:22:37 +00001578
drh290fcaa2016-06-08 01:03:05 +00001579dbhash.exe: $(TOP)\tool\dbhash.c $(SQLITE3C) $(SQLITE3H)
1580 $(LTLINK) $(NO_WARN) $(TOP)\tool\dbhash.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
1581
drhda110bf2016-05-05 17:15:23 +00001582scrub.exe: $(TOP)\ext\misc\scrub.c $(SQLITE3C) $(SQLITE3H)
1583 $(LTLINK) $(NO_WARN) $(TOP)\ext\misc\scrub.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
1584
drhfd0d93f2016-02-07 00:08:08 +00001585srcck1.exe: $(TOP)\tool\srcck1.c
1586 $(BCC) $(NO_WARN) -Fe$@ $(TOP)\tool\srcck1.c
1587
1588sourcetest: srcck1.exe sqlite3.c
1589 srcck1.exe sqlite3.c
1590
mistachkin5d4d9412016-01-22 03:54:36 +00001591fuzzershell.exe: $(TOP)\tool\fuzzershell.c $(SQLITE3C) $(SQLITE3H)
1592 $(LTLINK) $(NO_WARN) $(FUZZERSHELL_COMPILE_OPTS) $(TOP)\tool\fuzzershell.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drhbc94dbb2013-04-08 14:28:33 +00001593
mistachkin953fbd12017-02-07 21:09:34 +00001594dbfuzz.exe: $(TOP)\test\dbfuzz.c $(SQLITE3C) $(SQLITE3H)
1595 $(LTLINK) $(NO_WARN) $(DBFUZZ_COMPILE_OPTS) $(TOP)\test\dbfuzz.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
1596
drh362b66f2016-11-14 18:27:41 +00001597fuzzcheck.exe: $(FUZZCHECK_SRC) $(SQLITE3C) $(SQLITE3H)
1598 $(LTLINK) $(NO_WARN) $(FUZZCHECK_COMPILE_OPTS) $(FUZZCHECK_SRC) $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
1599
1600ossshell.exe: $(OSSSHELL_SRC) $(SQLITE3C) $(SQLITE3H)
1601 $(LTLINK) $(NO_WARN) $(FUZZCHECK_COMPILE_OPTS) $(OSSSHELL_SRC) $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh1573dc32015-05-25 22:29:26 +00001602
mistachkin5d4d9412016-01-22 03:54:36 +00001603mptester.exe: $(TOP)\mptest\mptest.c $(SQLITE3C) $(SQLITE3H)
1604 $(LTLINK) $(NO_WARN) $(MPTESTER_COMPILE_OPTS) $(TOP)\mptest\mptest.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drhbc94dbb2013-04-08 14:28:33 +00001605
mistachkineb48b062015-03-31 17:45:44 +00001606MPTEST1 = mptester mptest.db $(TOP)\mptest\crash01.test --repeat 20
1607MPTEST2 = mptester mptest.db $(TOP)\mptest\multiwrite01.test --repeat 20
mistachkin4d2daba2015-03-31 16:42:16 +00001608
drhfe0ba712015-03-31 13:46:13 +00001609mptest: mptester.exe
mistachkin4d2daba2015-03-31 16:42:16 +00001610 del /Q mptest.db 2>NUL
drhfe0ba712015-03-31 13:46:13 +00001611 $(MPTEST1) --journalmode DELETE
1612 $(MPTEST2) --journalmode WAL
1613 $(MPTEST1) --journalmode WAL
1614 $(MPTEST2) --journalmode PERSIST
1615 $(MPTEST1) --journalmode PERSIST
1616 $(MPTEST2) --journalmode TRUNCATE
1617 $(MPTEST1) --journalmode TRUNCATE
1618 $(MPTEST2) --journalmode DELETE
1619
shanehb2f20bf2011-06-17 07:07:24 +00001620# This target creates a directory named "tsrc" and fills it with
1621# copies of all of the C source code and header files needed to
1622# build on the target system. Some of the C source code and header
1623# files are automatically generated. This target takes care of
1624# all that automatic generation.
1625#
mistachkin4ef916e2016-08-24 19:58:46 +00001626.target_source: $(SRC) $(TOP)\tool\vdbe-compress.tcl fts5.c $(SQLITE_TCL_DEP)
mistachkin44723ce2015-03-21 02:22:37 +00001627 -rmdir /Q/S tsrc 2>NUL
shanehb2f20bf2011-06-17 07:07:24 +00001628 -mkdir tsrc
mistachkine2eb2592016-02-11 21:38:05 +00001629 for %i in ($(SRC00)) do copy /Y %i tsrc
1630 for %i in ($(SRC01)) do copy /Y %i tsrc
1631 for %i in ($(SRC02)) do copy /Y %i tsrc
1632 for %i in ($(SRC03)) do copy /Y %i tsrc
1633 for %i in ($(SRC04)) do copy /Y %i tsrc
1634 for %i in ($(SRC05)) do copy /Y %i tsrc
1635 for %i in ($(SRC06)) do copy /Y %i tsrc
1636 for %i in ($(SRC07)) do copy /Y %i tsrc
1637 for %i in ($(SRC08)) do copy /Y %i tsrc
1638 for %i in ($(SRC09)) do copy /Y %i tsrc
1639 for %i in ($(SRC10)) do copy /Y %i tsrc
1640 for %i in ($(SRC11)) do copy /Y %i tsrc
mistachkin52b1dbb2016-07-28 14:37:04 +00001641 for %i in ($(SRC12)) do copy /Y %i tsrc
drh50065652015-10-08 19:29:18 +00001642 copy /Y fts5.c tsrc
1643 copy /Y fts5.h tsrc
mistachkin44723ce2015-03-21 02:22:37 +00001644 del /Q tsrc\sqlite.h.in tsrc\parse.y 2>NUL
drh2dc06482013-12-11 00:59:10 +00001645 $(TCLSH_CMD) $(TOP)\tool\vdbe-compress.tcl $(OPTS) < tsrc\vdbe.c > vdbe.new
shanehb2f20bf2011-06-17 07:07:24 +00001646 move vdbe.new tsrc\vdbe.c
1647 echo > .target_source
1648
mistachkin4ef916e2016-08-24 19:58:46 +00001649sqlite3.c: .target_source sqlite3ext.h $(MKSQLITE3C_TOOL)
1650 $(TCLSH_CMD) $(MKSQLITE3C_TOOL) $(MKSQLITE3C_ARGS)
drhe191e2c2013-03-19 15:23:18 +00001651 copy tsrc\shell.c .
drhe191e2c2013-03-19 15:23:18 +00001652 copy $(TOP)\ext\session\sqlite3session.h .
shanehb2f20bf2011-06-17 07:07:24 +00001653
mistachkin48dd9de2012-12-06 04:33:13 +00001654sqlite3-all.c: sqlite3.c $(TOP)\tool\split-sqlite3c.tcl
1655 $(TCLSH_CMD) $(TOP)\tool\split-sqlite3c.tcl
mistachkin3e786092016-01-23 07:53:04 +00001656# <</mark>>
mistachkin76510912013-10-11 23:01:18 +00001657
shanehb2f20bf2011-06-17 07:07:24 +00001658# Rule to build the amalgamation
1659#
mistachkin76510912013-10-11 23:01:18 +00001660sqlite3.lo: $(SQLITE3C)
mistachkin44723ce2015-03-21 02:22:37 +00001661 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(SQLITE3C)
shanehb2f20bf2011-06-17 07:07:24 +00001662
mistachkin3e786092016-01-23 07:53:04 +00001663# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001664# Rules to build the LEMON compiler generator
1665#
drh82415f22015-11-09 19:33:42 +00001666lempar.c: $(TOP)\tool\lempar.c
1667 copy $(TOP)\tool\lempar.c .
shanehb2f20bf2011-06-17 07:07:24 +00001668
1669lemon.exe: $(TOP)\tool\lemon.c lempar.c
mistachkin2318d332015-01-12 18:02:52 +00001670 $(BCC) $(NO_WARN) -Daccess=_access \
mistachkin460cd9c2015-10-14 22:46:37 +00001671 -Fe$@ $(TOP)\tool\lemon.c /link $(LDFLAGS) $(NLTLINKOPTS) $(NLTLIBPATHS)
shanehb2f20bf2011-06-17 07:07:24 +00001672
1673# Rules to build individual *.lo files from generated *.c files. This
1674# applies to:
1675#
1676# parse.lo
1677# opcodes.lo
1678#
1679parse.lo: parse.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001680 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c parse.c
shanehb2f20bf2011-06-17 07:07:24 +00001681
1682opcodes.lo: opcodes.c
mistachkin44723ce2015-03-21 02:22:37 +00001683 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c opcodes.c
mistachkin3e786092016-01-23 07:53:04 +00001684# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001685
mistachkin4d9d1f42012-09-03 10:32:32 +00001686# Rule to build the Win32 resources object file.
1687#
mistachkin08c1c312012-10-06 03:48:25 +00001688!IF $(USE_RC)!=0
mistachkin3e786092016-01-23 07:53:04 +00001689# <<block1>>
mistachkina8a18732016-01-22 22:16:50 +00001690$(LIBRESOBJS): $(TOP)\src\sqlite3.rc $(SQLITE3H)
mistachkin4d9d1f42012-09-03 10:32:32 +00001691 echo #ifndef SQLITE_RESOURCE_VERSION > sqlite3rc.h
mistachkin8ccc6d42012-09-27 21:03:53 +00001692 for /F %%V in ('type "$(TOP)\VERSION"') do ( \
mistachkin4d9d1f42012-09-03 10:32:32 +00001693 echo #define SQLITE_RESOURCE_VERSION %%V \
mistachkin946ef602015-10-10 01:55:57 +00001694 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact . ^, >> sqlite3rc.h \
mistachkin4d9d1f42012-09-03 10:32:32 +00001695 )
1696 echo #endif >> sqlite3rc.h
mistachkin08c1c312012-10-06 03:48:25 +00001697 $(LTRCOMPILE) -fo $(LIBRESOBJS) $(TOP)\src\sqlite3.rc
mistachkin3e786092016-01-23 07:53:04 +00001698# <</block1>>
mistachkin08c1c312012-10-06 03:48:25 +00001699!ENDIF
mistachkin4d9d1f42012-09-03 10:32:32 +00001700
mistachkin3e786092016-01-23 07:53:04 +00001701# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001702# Rules to build individual *.lo files from files in the src directory.
1703#
1704alter.lo: $(TOP)\src\alter.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001705 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\alter.c
shanehb2f20bf2011-06-17 07:07:24 +00001706
1707analyze.lo: $(TOP)\src\analyze.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001708 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\analyze.c
shanehb2f20bf2011-06-17 07:07:24 +00001709
1710attach.lo: $(TOP)\src\attach.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001711 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\attach.c
shanehb2f20bf2011-06-17 07:07:24 +00001712
1713auth.lo: $(TOP)\src\auth.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001714 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\auth.c
shanehb2f20bf2011-06-17 07:07:24 +00001715
1716backup.lo: $(TOP)\src\backup.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001717 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\backup.c
shanehb2f20bf2011-06-17 07:07:24 +00001718
1719bitvec.lo: $(TOP)\src\bitvec.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001720 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\bitvec.c
shanehb2f20bf2011-06-17 07:07:24 +00001721
1722btmutex.lo: $(TOP)\src\btmutex.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001723 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\btmutex.c
shanehb2f20bf2011-06-17 07:07:24 +00001724
1725btree.lo: $(TOP)\src\btree.c $(HDR) $(TOP)\src\pager.h
mistachkin44723ce2015-03-21 02:22:37 +00001726 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\btree.c
shanehb2f20bf2011-06-17 07:07:24 +00001727
1728build.lo: $(TOP)\src\build.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001729 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\build.c
shanehb2f20bf2011-06-17 07:07:24 +00001730
1731callback.lo: $(TOP)\src\callback.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001732 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\callback.c
shanehb2f20bf2011-06-17 07:07:24 +00001733
1734complete.lo: $(TOP)\src\complete.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001735 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\complete.c
shanehb2f20bf2011-06-17 07:07:24 +00001736
1737ctime.lo: $(TOP)\src\ctime.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001738 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\ctime.c
shanehb2f20bf2011-06-17 07:07:24 +00001739
1740date.lo: $(TOP)\src\date.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001741 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\date.c
shanehb2f20bf2011-06-17 07:07:24 +00001742
drh1a4a6802015-05-04 18:31:09 +00001743dbstat.lo: $(TOP)\src\date.c $(HDR)
1744 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\dbstat.c
1745
shanehb2f20bf2011-06-17 07:07:24 +00001746delete.lo: $(TOP)\src\delete.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001747 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\delete.c
shanehb2f20bf2011-06-17 07:07:24 +00001748
1749expr.lo: $(TOP)\src\expr.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001750 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\expr.c
shanehb2f20bf2011-06-17 07:07:24 +00001751
1752fault.lo: $(TOP)\src\fault.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001753 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\fault.c
shanehb2f20bf2011-06-17 07:07:24 +00001754
1755fkey.lo: $(TOP)\src\fkey.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001756 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\fkey.c
shanehb2f20bf2011-06-17 07:07:24 +00001757
1758func.lo: $(TOP)\src\func.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001759 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\func.c
shanehb2f20bf2011-06-17 07:07:24 +00001760
1761global.lo: $(TOP)\src\global.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001762 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\global.c
shanehb2f20bf2011-06-17 07:07:24 +00001763
1764hash.lo: $(TOP)\src\hash.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001765 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\hash.c
shanehb2f20bf2011-06-17 07:07:24 +00001766
1767insert.lo: $(TOP)\src\insert.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001768 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\insert.c
shanehb2f20bf2011-06-17 07:07:24 +00001769
shanehb2f20bf2011-06-17 07:07:24 +00001770legacy.lo: $(TOP)\src\legacy.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001771 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\legacy.c
shanehb2f20bf2011-06-17 07:07:24 +00001772
1773loadext.lo: $(TOP)\src\loadext.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001774 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\loadext.c
shanehb2f20bf2011-06-17 07:07:24 +00001775
1776main.lo: $(TOP)\src\main.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001777 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\main.c
shanehb2f20bf2011-06-17 07:07:24 +00001778
1779malloc.lo: $(TOP)\src\malloc.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001780 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\malloc.c
shanehb2f20bf2011-06-17 07:07:24 +00001781
1782mem0.lo: $(TOP)\src\mem0.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001783 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem0.c
shanehb2f20bf2011-06-17 07:07:24 +00001784
1785mem1.lo: $(TOP)\src\mem1.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001786 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem1.c
shanehb2f20bf2011-06-17 07:07:24 +00001787
1788mem2.lo: $(TOP)\src\mem2.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001789 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem2.c
shanehb2f20bf2011-06-17 07:07:24 +00001790
1791mem3.lo: $(TOP)\src\mem3.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001792 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem3.c
shanehb2f20bf2011-06-17 07:07:24 +00001793
1794mem5.lo: $(TOP)\src\mem5.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001795 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem5.c
shanehb2f20bf2011-06-17 07:07:24 +00001796
1797memjournal.lo: $(TOP)\src\memjournal.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001798 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\memjournal.c
shanehb2f20bf2011-06-17 07:07:24 +00001799
1800mutex.lo: $(TOP)\src\mutex.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001801 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex.c
shanehb2f20bf2011-06-17 07:07:24 +00001802
1803mutex_noop.lo: $(TOP)\src\mutex_noop.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001804 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex_noop.c
shanehb2f20bf2011-06-17 07:07:24 +00001805
shanehb2f20bf2011-06-17 07:07:24 +00001806mutex_unix.lo: $(TOP)\src\mutex_unix.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001807 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex_unix.c
shanehb2f20bf2011-06-17 07:07:24 +00001808
1809mutex_w32.lo: $(TOP)\src\mutex_w32.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001810 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex_w32.c
shanehb2f20bf2011-06-17 07:07:24 +00001811
1812notify.lo: $(TOP)\src\notify.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001813 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\notify.c
shanehb2f20bf2011-06-17 07:07:24 +00001814
1815pager.lo: $(TOP)\src\pager.c $(HDR) $(TOP)\src\pager.h
mistachkin44723ce2015-03-21 02:22:37 +00001816 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pager.c
shanehb2f20bf2011-06-17 07:07:24 +00001817
1818pcache.lo: $(TOP)\src\pcache.c $(HDR) $(TOP)\src\pcache.h
mistachkin44723ce2015-03-21 02:22:37 +00001819 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pcache.c
shanehb2f20bf2011-06-17 07:07:24 +00001820
1821pcache1.lo: $(TOP)\src\pcache1.c $(HDR) $(TOP)\src\pcache.h
mistachkin44723ce2015-03-21 02:22:37 +00001822 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pcache1.c
shanehb2f20bf2011-06-17 07:07:24 +00001823
1824os.lo: $(TOP)\src\os.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001825 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\os.c
shanehb2f20bf2011-06-17 07:07:24 +00001826
1827os_unix.lo: $(TOP)\src\os_unix.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001828 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\os_unix.c
shanehb2f20bf2011-06-17 07:07:24 +00001829
1830os_win.lo: $(TOP)\src\os_win.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001831 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\os_win.c
shanehb2f20bf2011-06-17 07:07:24 +00001832
shanehb2f20bf2011-06-17 07:07:24 +00001833pragma.lo: $(TOP)\src\pragma.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001834 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pragma.c
shanehb2f20bf2011-06-17 07:07:24 +00001835
1836prepare.lo: $(TOP)\src\prepare.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001837 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\prepare.c
shanehb2f20bf2011-06-17 07:07:24 +00001838
1839printf.lo: $(TOP)\src\printf.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001840 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\printf.c
shanehb2f20bf2011-06-17 07:07:24 +00001841
1842random.lo: $(TOP)\src\random.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001843 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\random.c
shanehb2f20bf2011-06-17 07:07:24 +00001844
1845resolve.lo: $(TOP)\src\resolve.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001846 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\resolve.c
shanehb2f20bf2011-06-17 07:07:24 +00001847
1848rowset.lo: $(TOP)\src\rowset.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001849 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\rowset.c
shanehb2f20bf2011-06-17 07:07:24 +00001850
1851select.lo: $(TOP)\src\select.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001852 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\select.c
shanehb2f20bf2011-06-17 07:07:24 +00001853
1854status.lo: $(TOP)\src\status.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001855 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\status.c
shanehb2f20bf2011-06-17 07:07:24 +00001856
1857table.lo: $(TOP)\src\table.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001858 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\table.c
shanehb2f20bf2011-06-17 07:07:24 +00001859
drhf51446a2012-07-21 19:40:42 +00001860threads.lo: $(TOP)\src\threads.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001861 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\threads.c
drhf51446a2012-07-21 19:40:42 +00001862
shanehb2f20bf2011-06-17 07:07:24 +00001863tokenize.lo: $(TOP)\src\tokenize.c keywordhash.h $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001864 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\tokenize.c
shanehb2f20bf2011-06-17 07:07:24 +00001865
drh38b41492015-06-08 15:08:15 +00001866treeview.lo: $(TOP)\src\treeview.c $(HDR)
1867 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\treeview.c
1868
shanehb2f20bf2011-06-17 07:07:24 +00001869trigger.lo: $(TOP)\src\trigger.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001870 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\trigger.c
shanehb2f20bf2011-06-17 07:07:24 +00001871
1872update.lo: $(TOP)\src\update.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001873 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\update.c
shanehb2f20bf2011-06-17 07:07:24 +00001874
1875utf.lo: $(TOP)\src\utf.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001876 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\utf.c
shanehb2f20bf2011-06-17 07:07:24 +00001877
1878util.lo: $(TOP)\src\util.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001879 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\util.c
shanehb2f20bf2011-06-17 07:07:24 +00001880
1881vacuum.lo: $(TOP)\src\vacuum.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001882 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vacuum.c
shanehb2f20bf2011-06-17 07:07:24 +00001883
1884vdbe.lo: $(TOP)\src\vdbe.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001885 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbe.c
shanehb2f20bf2011-06-17 07:07:24 +00001886
1887vdbeapi.lo: $(TOP)\src\vdbeapi.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001888 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbeapi.c
shanehb2f20bf2011-06-17 07:07:24 +00001889
1890vdbeaux.lo: $(TOP)\src\vdbeaux.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001891 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbeaux.c
shanehb2f20bf2011-06-17 07:07:24 +00001892
1893vdbeblob.lo: $(TOP)\src\vdbeblob.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001894 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbeblob.c
shanehb2f20bf2011-06-17 07:07:24 +00001895
1896vdbemem.lo: $(TOP)\src\vdbemem.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001897 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbemem.c
shanehb2f20bf2011-06-17 07:07:24 +00001898
mistachkin81c428a2011-08-17 02:19:54 +00001899vdbesort.lo: $(TOP)\src\vdbesort.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001900 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbesort.c
mistachkin81c428a2011-08-17 02:19:54 +00001901
shanehb2f20bf2011-06-17 07:07:24 +00001902vdbetrace.lo: $(TOP)\src\vdbetrace.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001903 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbetrace.c
shanehb2f20bf2011-06-17 07:07:24 +00001904
1905vtab.lo: $(TOP)\src\vtab.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001906 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vtab.c
shanehb2f20bf2011-06-17 07:07:24 +00001907
1908wal.lo: $(TOP)\src\wal.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001909 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\wal.c
shanehb2f20bf2011-06-17 07:07:24 +00001910
1911walker.lo: $(TOP)\src\walker.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001912 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\walker.c
shanehb2f20bf2011-06-17 07:07:24 +00001913
1914where.lo: $(TOP)\src\where.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001915 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\where.c
shanehb2f20bf2011-06-17 07:07:24 +00001916
drh6f82e852015-06-06 20:12:09 +00001917wherecode.lo: $(TOP)\src\wherecode.c $(HDR)
1918 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\wherecode.c
1919
drh6c1f4ef2015-06-08 14:23:15 +00001920whereexpr.lo: $(TOP)\src\whereexpr.c $(HDR)
1921 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\whereexpr.c
1922
mistachkin4ef916e2016-08-24 19:58:46 +00001923tclsqlite.lo: $(TOP)\src\tclsqlite.c $(HDR) $(SQLITE_TCL_DEP)
mistachkin44723ce2015-03-21 02:22:37 +00001924 $(LTCOMPILE) $(NO_WARN) -DUSE_TCL_STUBS=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c
shanehb2f20bf2011-06-17 07:07:24 +00001925
mistachkin4ef916e2016-08-24 19:58:46 +00001926tclsqlite-shell.lo: $(TOP)\src\tclsqlite.c $(HDR) $(SQLITE_TCL_DEP)
mistachkin44723ce2015-03-21 02:22:37 +00001927 $(LTCOMPILE) $(NO_WARN) -DTCLSH=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c
shanehb2f20bf2011-06-17 07:07:24 +00001928
mistachkin5d4d9412016-01-22 03:54:36 +00001929tclsqlite3.exe: tclsqlite-shell.lo $(SQLITE3C) $(SQLITE3H) $(LIBRESOBJS)
mistachkin78e3f612015-10-14 20:01:12 +00001930 $(LTLINK) $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /OUT:$@ tclsqlite-shell.lo $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001931
1932# Rules to build opcodes.c and opcodes.h
1933#
drh7651e0a2015-10-07 12:11:36 +00001934opcodes.c: opcodes.h $(TOP)\tool\mkopcodec.tcl
1935 $(TCLSH_CMD) $(TOP)\tool\mkopcodec.tcl opcodes.h > opcodes.c
shanehb2f20bf2011-06-17 07:07:24 +00001936
drhb15393b2015-10-07 02:52:09 +00001937opcodes.h: parse.h $(TOP)\src\vdbe.c $(TOP)\tool\mkopcodeh.tcl
mistachkin946ef602015-10-10 01:55:57 +00001938 type parse.h $(TOP)\src\vdbe.c | $(TCLSH_CMD) $(TOP)\tool\mkopcodeh.tcl > opcodes.h
shanehb2f20bf2011-06-17 07:07:24 +00001939
1940# Rules to build parse.c and parse.h - the outputs of lemon.
1941#
1942parse.h: parse.c
1943
drh60a15a42015-10-07 12:21:14 +00001944parse.c: $(TOP)\src\parse.y lemon.exe $(TOP)\tool\addopcodes.tcl
mistachkin44723ce2015-03-21 02:22:37 +00001945 del /Q parse.y parse.h parse.h.temp 2>NUL
shanehb2f20bf2011-06-17 07:07:24 +00001946 copy $(TOP)\src\parse.y .
mistachkinedcb4eb2016-01-22 01:25:15 +00001947 .\lemon.exe $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) $(OPTS) parse.y
shanehb2f20bf2011-06-17 07:07:24 +00001948 move parse.h parse.h.temp
drh60a15a42015-10-07 12:21:14 +00001949 $(TCLSH_CMD) $(TOP)\tool\addopcodes.tcl parse.h.temp > parse.h
shanehb2f20bf2011-06-17 07:07:24 +00001950
mistachkin5d4d9412016-01-22 03:54:36 +00001951$(SQLITE3H): $(TOP)\src\sqlite.h.in $(TOP)\manifest.uuid $(TOP)\VERSION
mistachkin4ef916e2016-08-24 19:58:46 +00001952 $(TCLSH_CMD) $(TOP)\tool\mksqlite3h.tcl $(TOP:\=/) > $(SQLITE3H) $(MKSQLITE3H_ARGS)
shanehb2f20bf2011-06-17 07:07:24 +00001953
mistachkin9b88ace2016-02-26 21:01:37 +00001954sqlite3ext.h: .target_source
mistachkin4ef916e2016-08-24 19:58:46 +00001955!IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
mistachkinc0bebc12016-07-28 18:49:20 +00001956 type tsrc\sqlite3ext.h | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "\(\*\)" "(SQLITE_CALLBACK *)" \
1957 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "\(\*" "(SQLITE_APICALL *" > sqlite3ext.h
mistachkine37f7392016-07-28 19:28:35 +00001958 copy /Y sqlite3ext.h tsrc\sqlite3ext.h
mistachkin4ef916e2016-08-24 19:58:46 +00001959!ELSE
1960 copy /Y tsrc\sqlite3ext.h sqlite3ext.h
1961!ENDIF
mistachkinc978f2d2015-09-21 23:49:35 +00001962
shanehb2f20bf2011-06-17 07:07:24 +00001963mkkeywordhash.exe: $(TOP)\tool\mkkeywordhash.c
mistachkinedcb4eb2016-01-22 01:25:15 +00001964 $(BCC) $(NO_WARN) -Fe$@ $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) $(OPTS) \
mistachkin460cd9c2015-10-14 22:46:37 +00001965 $(TOP)\tool\mkkeywordhash.c /link $(LDFLAGS) $(NLTLINKOPTS) $(NLTLIBPATHS)
shanehb2f20bf2011-06-17 07:07:24 +00001966
1967keywordhash.h: $(TOP)\tool\mkkeywordhash.c mkkeywordhash.exe
mistachkin5b0b6fd2011-06-25 01:14:36 +00001968 .\mkkeywordhash.exe > keywordhash.h
shanehb2f20bf2011-06-17 07:07:24 +00001969
1970
1971
1972# Rules to build the extension objects.
1973#
1974icu.lo: $(TOP)\ext\icu\icu.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001975 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\icu\icu.c
shanehb2f20bf2011-06-17 07:07:24 +00001976
1977fts2.lo: $(TOP)\ext\fts2\fts2.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001978 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2.c
shanehb2f20bf2011-06-17 07:07:24 +00001979
1980fts2_hash.lo: $(TOP)\ext\fts2\fts2_hash.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001981 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_hash.c
shanehb2f20bf2011-06-17 07:07:24 +00001982
1983fts2_icu.lo: $(TOP)\ext\fts2\fts2_icu.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001984 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_icu.c
shanehb2f20bf2011-06-17 07:07:24 +00001985
1986fts2_porter.lo: $(TOP)\ext\fts2\fts2_porter.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001987 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_porter.c
shanehb2f20bf2011-06-17 07:07:24 +00001988
1989fts2_tokenizer.lo: $(TOP)\ext\fts2\fts2_tokenizer.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001990 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_tokenizer.c
shanehb2f20bf2011-06-17 07:07:24 +00001991
1992fts2_tokenizer1.lo: $(TOP)\ext\fts2\fts2_tokenizer1.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001993 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_tokenizer1.c
shanehb2f20bf2011-06-17 07:07:24 +00001994
1995fts3.lo: $(TOP)\ext\fts3\fts3.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001996 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3.c
shanehb2f20bf2011-06-17 07:07:24 +00001997
1998fts3_aux.lo: $(TOP)\ext\fts3\fts3_aux.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001999 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_aux.c
shanehb2f20bf2011-06-17 07:07:24 +00002000
2001fts3_expr.lo: $(TOP)\ext\fts3\fts3_expr.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002002 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_expr.c
shanehb2f20bf2011-06-17 07:07:24 +00002003
2004fts3_hash.lo: $(TOP)\ext\fts3\fts3_hash.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002005 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_hash.c
shanehb2f20bf2011-06-17 07:07:24 +00002006
2007fts3_icu.lo: $(TOP)\ext\fts3\fts3_icu.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002008 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_icu.c
shanehb2f20bf2011-06-17 07:07:24 +00002009
2010fts3_snippet.lo: $(TOP)\ext\fts3\fts3_snippet.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002011 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_snippet.c
shanehb2f20bf2011-06-17 07:07:24 +00002012
2013fts3_porter.lo: $(TOP)\ext\fts3\fts3_porter.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002014 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_porter.c
shanehb2f20bf2011-06-17 07:07:24 +00002015
2016fts3_tokenizer.lo: $(TOP)\ext\fts3\fts3_tokenizer.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002017 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenizer.c
shanehb2f20bf2011-06-17 07:07:24 +00002018
2019fts3_tokenizer1.lo: $(TOP)\ext\fts3\fts3_tokenizer1.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002020 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenizer1.c
shanehb2f20bf2011-06-17 07:07:24 +00002021
drh4d648c72013-04-22 17:07:56 +00002022fts3_tokenize_vtab.lo: $(TOP)\ext\fts3\fts3_tokenize_vtab.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002023 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenize_vtab.c
drh4d648c72013-04-22 17:07:56 +00002024
drh391d4ba2012-05-28 20:22:16 +00002025fts3_unicode.lo: $(TOP)\ext\fts3\fts3_unicode.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002026 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_unicode.c
drh391d4ba2012-05-28 20:22:16 +00002027
2028fts3_unicode2.lo: $(TOP)\ext\fts3\fts3_unicode2.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002029 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_unicode2.c
drh391d4ba2012-05-28 20:22:16 +00002030
shanehb2f20bf2011-06-17 07:07:24 +00002031fts3_write.lo: $(TOP)\ext\fts3\fts3_write.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002032 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_write.c
shanehb2f20bf2011-06-17 07:07:24 +00002033
2034rtree.lo: $(TOP)\ext\rtree\rtree.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002035 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\rtree\rtree.c
shanehb2f20bf2011-06-17 07:07:24 +00002036
mistachkin4f2c8222016-04-11 22:23:04 +00002037sqlite3session.lo: $(TOP)\ext\session\sqlite3session.c $(HDR) $(EXTHDR)
mistachkin05004782016-03-30 16:23:06 +00002038 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\session\sqlite3session.c
drh498dcae2013-03-13 11:42:00 +00002039
mistachkined52f9f2015-06-26 04:34:36 +00002040# FTS5 things
2041#
2042FTS5_SRC = \
2043 $(TOP)\ext\fts5\fts5.h \
2044 $(TOP)\ext\fts5\fts5Int.h \
2045 $(TOP)\ext\fts5\fts5_aux.c \
2046 $(TOP)\ext\fts5\fts5_buffer.c \
2047 $(TOP)\ext\fts5\fts5_main.c \
2048 $(TOP)\ext\fts5\fts5_config.c \
2049 $(TOP)\ext\fts5\fts5_expr.c \
2050 $(TOP)\ext\fts5\fts5_hash.c \
2051 $(TOP)\ext\fts5\fts5_index.c \
2052 fts5parse.c fts5parse.h \
2053 $(TOP)\ext\fts5\fts5_storage.c \
2054 $(TOP)\ext\fts5\fts5_tokenize.c \
2055 $(TOP)\ext\fts5\fts5_unicode2.c \
2056 $(TOP)\ext\fts5\fts5_varint.c \
2057 $(TOP)\ext\fts5\fts5_vocab.c
2058
2059fts5parse.c: $(TOP)\ext\fts5\fts5parse.y lemon.exe
2060 copy $(TOP)\ext\fts5\fts5parse.y .
2061 del /Q fts5parse.h 2>NUL
mistachkinedcb4eb2016-01-22 01:25:15 +00002062 .\lemon.exe $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) $(OPTS) fts5parse.y
mistachkined52f9f2015-06-26 04:34:36 +00002063
mistachkin9b88ace2016-02-26 21:01:37 +00002064fts5parse.h: fts5parse.c
mistachkined52f9f2015-06-26 04:34:36 +00002065
mistachkin9b88ace2016-02-26 21:01:37 +00002066fts5.c: $(FTS5_SRC)
mistachkined52f9f2015-06-26 04:34:36 +00002067 $(TCLSH_CMD) $(TOP)\ext\fts5\tool\mkfts5c.tcl
dana153bbc2015-07-02 20:12:34 +00002068 copy $(TOP)\ext\fts5\fts5.h .
mistachkined52f9f2015-06-26 04:34:36 +00002069
2070fts5.lo: fts5.c $(HDR) $(EXTHDR)
mistachkin95ae9582015-06-26 20:45:43 +00002071 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c fts5.c
2072
2073fts5_ext.lo: fts5.c $(HDR) $(EXTHDR)
mistachkinae6ca8e2015-07-02 16:50:43 +00002074 $(LTCOMPILE) $(NO_WARN) -c fts5.c
shanehb2f20bf2011-06-17 07:07:24 +00002075
mistachkin95ae9582015-06-26 20:45:43 +00002076fts5.dll: fts5_ext.lo
2077 $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /OUT:$@ fts5_ext.lo
shanehb2f20bf2011-06-17 07:07:24 +00002078
mistachkin83a22532016-01-14 18:01:16 +00002079sqlite3rbu.lo: $(TOP)\ext\rbu\sqlite3rbu.c $(HDR) $(EXTHDR)
2080 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\rbu\sqlite3rbu.c
drh76473772016-01-14 13:22:24 +00002081
shanehb2f20bf2011-06-17 07:07:24 +00002082# Rules to build the 'testfixture' application.
2083#
2084# If using the amalgamation, use sqlite3.c directly to build the test
2085# fixture. Otherwise link against libsqlite3.lib. (This distinction is
2086# necessary because the test fixture requires non-API symbols which are
2087# hidden when the library is built via the amalgamation).
2088#
2089TESTFIXTURE_FLAGS = -DTCLSH=1 -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
mistachkin27b2f052015-01-12 19:49:46 +00002090TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_SERVER=1 -DSQLITE_PRIVATE=""
2091TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_CORE $(NO_WARN)
drhdbc49162016-03-02 03:28:07 +00002092TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_SERIES_CONSTRAINT_VERIFY=1
drh9878fef2016-03-04 03:43:10 +00002093TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_DEFAULT_PAGE_SIZE=1024
drhc6603af2017-06-29 14:33:51 +00002094TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_ENABLE_STMTVTAB
mistachkin69def7f2016-07-28 04:14:37 +00002095TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) $(TEST_CCONV_OPTS)
shanehb2f20bf2011-06-17 07:07:24 +00002096
mistachkinc04c54b2016-02-11 21:28:16 +00002097TESTFIXTURE_SRC0 = $(TESTEXT) $(TESTSRC2)
mistachkin05004782016-03-30 16:23:06 +00002098TESTFIXTURE_SRC1 = $(TESTEXT) $(SQLITE3C)
shanehb2f20bf2011-06-17 07:07:24 +00002099!IF $(USE_AMALGAMATION)==0
2100TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC0)
2101!ELSE
2102TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC1)
2103!ENDIF
2104
mistachkin4ef916e2016-08-24 19:58:46 +00002105!IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
mistachkin52b1dbb2016-07-28 14:37:04 +00002106sqlite_tclDecls.h:
mistachkin4ef916e2016-08-24 19:58:46 +00002107 echo #ifndef SQLITE_TCLAPI > $(SQLITETCLDECLSH)
2108 echo # define SQLITE_TCLAPI >> $(SQLITETCLDECLSH)
2109 echo #endif >> $(SQLITETCLDECLSH)
mistachkinf27a80c2016-07-28 16:09:52 +00002110 type "$(TCLINCDIR)\tclDecls.h" \
mistachkina121cc72016-07-28 18:06:52 +00002111 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "^(EXTERN(?: CONST\d+?)?\s+?[^\(]*?\s+?)Tcl_" "\1 SQLITE_TCLAPI Tcl_" \
mistachkinf27a80c2016-07-28 16:09:52 +00002112 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "^(EXTERN\s+?(?:void|VOID)\s+?)TclFreeObj" "\1 SQLITE_TCLAPI TclFreeObj" \
2113 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "\(\*tcl_" "(SQLITE_TCLAPI *tcl_" \
mistachkin7c60b262016-07-28 18:18:53 +00002114 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "\(\*tclFreeObj" "(SQLITE_TCLAPI *tclFreeObj" \
mistachkin4ef916e2016-08-24 19:58:46 +00002115 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "\(\*" "(SQLITE_TCLAPI *" >> $(SQLITETCLDECLSH)
mistachkin52b1dbb2016-07-28 14:37:04 +00002116
mistachkin4ef916e2016-08-24 19:58:46 +00002117sqlite_tcl.h:
mistachkinf27a80c2016-07-28 16:09:52 +00002118 type "$(TCLINCDIR)\tcl.h" | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact tclDecls.h sqlite_tclDecls.h \
2119 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "typedef (.*?)\(Tcl_" "typedef \1 (SQLITE_TCLAPI Tcl_" \
2120 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact "void (*freeProc)" "void (SQLITE_TCLAPI *freeProc)" \
2121 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact "Tcl_HashEntry *(*findProc)" "Tcl_HashEntry *(SQLITE_TCLAPI *findProc)" \
mistachkin4ef916e2016-08-24 19:58:46 +00002122 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact "Tcl_HashEntry *(*createProc)" "Tcl_HashEntry *(SQLITE_TCLAPI *createProc)" >> $(SQLITETCLH)
2123!ENDIF
mistachkin52b1dbb2016-07-28 14:37:04 +00002124
mistachkin4ef916e2016-08-24 19:58:46 +00002125testfixture.exe: $(TESTFIXTURE_SRC) $(SQLITE3H) $(LIBRESOBJS) $(HDR) $(SQLITE_TCL_DEP)
shaneh6e7850c2011-06-17 15:57:07 +00002126 $(LTLINK) -DSQLITE_NO_SYNC=1 $(TESTFIXTURE_FLAGS) \
shanehb2f20bf2011-06-17 07:07:24 +00002127 -DBUILD_sqlite -I$(TCLINCDIR) \
shaneh2a0b9ef2011-06-20 20:52:32 +00002128 $(TESTFIXTURE_SRC) \
mistachkin78e3f612015-10-14 20:01:12 +00002129 /link $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00002130
mistachkin9b88ace2016-02-26 21:01:37 +00002131extensiontest: testfixture.exe testloadext.dll
mistachkin88739962015-10-14 23:04:08 +00002132 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00002133 .\testfixture.exe $(TOP)\test\loadext.test $(TESTOPTS)
mistachkin1925a2e2014-02-24 21:20:25 +00002134
drhf4375442015-05-11 12:15:45 +00002135fulltest: $(TESTPROGS) fuzztest
mistachkin88739962015-10-14 23:04:08 +00002136 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00002137 .\testfixture.exe $(TOP)\test\all.test $(TESTOPTS)
shanehb2f20bf2011-06-17 07:07:24 +00002138
drhea93c702015-05-26 18:15:08 +00002139soaktest: $(TESTPROGS)
mistachkin88739962015-10-14 23:04:08 +00002140 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00002141 .\testfixture.exe $(TOP)\test\all.test -soak=1 $(TESTOPTS)
shanehb2f20bf2011-06-17 07:07:24 +00002142
drhf4375442015-05-11 12:15:45 +00002143fulltestonly: $(TESTPROGS) fuzztest
mistachkin88739962015-10-14 23:04:08 +00002144 @set PATH=$(LIBTCLPATH);$(PATH)
mistachkinc60941f2012-09-13 01:51:02 +00002145 .\testfixture.exe $(TOP)\test\full.test
2146
mistachkinedcb4eb2016-01-22 01:25:15 +00002147queryplantest: testfixture.exe shell
mistachkin88739962015-10-14 23:04:08 +00002148 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00002149 .\testfixture.exe $(TOP)\test\permutations.test queryplanner $(TESTOPTS)
mistachkin036acf32013-07-20 00:34:31 +00002150
drhea93c702015-05-26 18:15:08 +00002151fuzztest: fuzzcheck.exe
2152 .\fuzzcheck.exe $(FUZZDATA)
drhf3320712015-04-25 13:39:29 +00002153
drha523e312015-07-24 17:26:13 +00002154fastfuzztest: fuzzcheck.exe
drh53e66c32015-07-24 15:49:23 +00002155 .\fuzzcheck.exe --limit-mem 100M $(FUZZDATA)
shanehb2f20bf2011-06-17 07:07:24 +00002156
drh905da632015-06-10 18:53:09 +00002157# Minimal testing that runs in less than 3 minutes (on a fast machine)
2158#
drhfd0d93f2016-02-07 00:08:08 +00002159quicktest: testfixture.exe sourcetest
mistachkin88739962015-10-14 23:04:08 +00002160 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00002161 .\testfixture.exe $(TOP)\test\extraquick.test $(TESTOPTS)
2162
2163# This is the common case. Run many tests that do not take too long,
2164# including fuzzcheck, sqlite3_analyzer, and sqldiff tests.
2165#
drhfd0d93f2016-02-07 00:08:08 +00002166test: $(TESTPROGS) sourcetest fastfuzztest
mistachkin88739962015-10-14 23:04:08 +00002167 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00002168 .\testfixture.exe $(TOP)\test\veryquick.test $(TESTOPTS)
shanehb2f20bf2011-06-17 07:07:24 +00002169
drhea93c702015-05-26 18:15:08 +00002170smoketest: $(TESTPROGS)
mistachkin88739962015-10-14 23:04:08 +00002171 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00002172 .\testfixture.exe $(TOP)\test\main.test $(TESTOPTS)
mistachkin00eb70d2015-04-04 00:02:07 +00002173
mistachkin4ef916e2016-08-24 19:58:46 +00002174sqlite3_analyzer.c: $(SQLITE3C) $(SQLITE3H) $(TOP)\src\tclsqlite.c $(TOP)\tool\spaceanal.tcl $(SQLITE_TCL_DEP)
mistachkind4ab1032015-05-11 16:27:33 +00002175 echo #define TCLSH 2 > $@
2176 echo #define SQLITE_ENABLE_DBSTAT_VTAB 1 >> $@
2177 copy $@ + $(SQLITE3C) + $(TOP)\src\tclsqlite.c $@
mistachkin9a55e312011-09-22 00:06:44 +00002178 echo static const char *tclsh_main_loop(void){ >> $@
2179 echo static const char *zMainloop = >> $@
drh48cc9a32015-10-07 12:36:42 +00002180 $(TCLSH_CMD) $(TOP)\tool\tostr.tcl $(TOP)\tool\spaceanal.tcl >> $@
mistachkin9a55e312011-09-22 00:06:44 +00002181 echo ; return zMainloop; } >> $@
shanehb2f20bf2011-06-17 07:07:24 +00002182
mistachkin08c1c312012-10-06 03:48:25 +00002183sqlite3_analyzer.exe: sqlite3_analyzer.c $(LIBRESOBJS)
mistachkind4ab1032015-05-11 16:27:33 +00002184 $(LTLINK) $(NO_WARN) -DBUILD_sqlite -I$(TCLINCDIR) sqlite3_analyzer.c \
mistachkin78e3f612015-10-14 20:01:12 +00002185 /link $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00002186
mistachkin943d8252017-03-14 15:27:56 +00002187dbdump.exe: $(TOP)\ext\misc\dbdump.c $(SQLITE3C) $(SQLITE3H)
2188 $(LTLINK) $(NO_WARN) -DDBDUMP_STANDALONE $(TOP)\ext\misc\dbdump.c $(SQLITE3C) \
2189 /link $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS)
drh4b34eb32017-03-13 22:02:01 +00002190
mistachkin1925a2e2014-02-24 21:20:25 +00002191testloadext.lo: $(TOP)\src\test_loadext.c
mistachkin44723ce2015-03-21 02:22:37 +00002192 $(LTCOMPILE) $(NO_WARN) -c $(TOP)\src\test_loadext.c
mistachkin1925a2e2014-02-24 21:20:25 +00002193
mistachkin9b88ace2016-02-26 21:01:37 +00002194testloadext.dll: testloadext.lo
mistachkin1925a2e2014-02-24 21:20:25 +00002195 $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /OUT:$@ testloadext.lo
2196
mistachkin5d4d9412016-01-22 03:54:36 +00002197showdb.exe: $(TOP)\tool\showdb.c $(SQLITE3C) $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002198 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
mistachkin78e3f612015-10-14 20:01:12 +00002199 $(TOP)\tool\showdb.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh9ac3c1e2013-11-07 18:37:31 +00002200
mistachkin5d4d9412016-01-22 03:54:36 +00002201showstat4.exe: $(TOP)\tool\showstat4.c $(SQLITE3C) $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002202 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
mistachkin78e3f612015-10-14 20:01:12 +00002203 $(TOP)\tool\showstat4.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh4bb77ec2014-06-30 11:14:26 +00002204
mistachkin5d4d9412016-01-22 03:54:36 +00002205showjournal.exe: $(TOP)\tool\showjournal.c $(SQLITE3C) $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002206 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
mistachkin78e3f612015-10-14 20:01:12 +00002207 $(TOP)\tool\showjournal.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh4bb77ec2014-06-30 11:14:26 +00002208
mistachkin5d4d9412016-01-22 03:54:36 +00002209showwal.exe: $(TOP)\tool\showwal.c $(SQLITE3C) $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002210 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
mistachkin78e3f612015-10-14 20:01:12 +00002211 $(TOP)\tool\showwal.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh4bb77ec2014-06-30 11:14:26 +00002212
mistachkin953fbd12017-02-07 21:09:34 +00002213changeset.exe: $(TOP)\ext\session\changeset.c $(SQLITE3C) $(SQLITE3H)
2214 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
2215 -DSQLITE_ENABLE_SESSION=1 -DSQLITE_ENABLE_PREUPDATE_HOOK=1 \
mistachkin05004782016-03-30 16:23:06 +00002216 $(TOP)\ext\session\changeset.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh9f674f22014-08-18 20:23:29 +00002217
mistachkin5d4d9412016-01-22 03:54:36 +00002218fts3view.exe: $(TOP)\ext\fts3\tool\fts3view.c $(SQLITE3C) $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002219 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
mistachkin78e3f612015-10-14 20:01:12 +00002220 $(TOP)\ext\fts3\tool\fts3view.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
mistachkinde545272014-07-07 17:57:50 +00002221
mistachkin5d4d9412016-01-22 03:54:36 +00002222rollback-test.exe: $(TOP)\tool\rollback-test.c $(SQLITE3C) $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002223 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
mistachkin78e3f612015-10-14 20:01:12 +00002224 $(TOP)\tool\rollback-test.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh4bb77ec2014-06-30 11:14:26 +00002225
mistachkin5d4d9412016-01-22 03:54:36 +00002226LogEst.exe: $(TOP)\tool\logest.c $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002227 $(LTLINK) $(NO_WARN) $(TOP)\tool\LogEst.c /link $(LDFLAGS) $(LTLINKOPTS)
drh267a13f2014-06-18 18:10:12 +00002228
mistachkin5d4d9412016-01-22 03:54:36 +00002229wordcount.exe: $(TOP)\test\wordcount.c $(SQLITE3C) $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002230 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
mistachkin78e3f612015-10-14 20:01:12 +00002231 $(TOP)\test\wordcount.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh9ac3c1e2013-11-07 18:37:31 +00002232
mistachkin5d4d9412016-01-22 03:54:36 +00002233speedtest1.exe: $(TOP)\test\speedtest1.c $(SQLITE3C) $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002234 $(LTLINK) $(NO_WARN) $(ST_COMPILE_OPTS) -DSQLITE_OMIT_LOAD_EXTENSION \
mistachkin78e3f612015-10-14 20:01:12 +00002235 $(TOP)\test\speedtest1.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
mistachkinb482a442012-02-11 22:19:26 +00002236
mistachkin953fbd12017-02-07 21:09:34 +00002237kvtest.exe: $(TOP)\test\kvtest.c $(SQLITE3C) $(SQLITE3H)
2238 $(LTLINK) $(NO_WARN) $(KV_COMPILE_OPTS) \
2239 $(TOP)\test\kvtest.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
2240
2241dbselftest.exe: $(TOP)\test\dbselftest.c $(SQLITE3C) $(SQLITE3H)
2242 $(LTLINK) $(NO_WARN) $(DBSELFTEST_COMPILE_OPTS) $(TOP)\test\dbselftest.c $(SQLITE3C)
2243
mistachkin9b88ace2016-02-26 21:01:37 +00002244rbu.exe: $(TOP)\ext\rbu\rbu.c $(TOP)\ext\rbu\sqlite3rbu.c $(SQLITE3C) $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002245 $(LTLINK) $(NO_WARN) -DSQLITE_ENABLE_RBU \
mistachkin5d4d9412016-01-22 03:54:36 +00002246 $(TOP)\ext\rbu\rbu.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
mistachkin9b88ace2016-02-26 21:01:37 +00002247
mistachkin02679b02017-06-27 05:59:47 +00002248LSMDIR=$(TOP)\ext\lsm1
2249!INCLUDE $(LSMDIR)\Makefile.msc
2250
mistachkin9b88ace2016-02-26 21:01:37 +00002251moreclean: clean
2252 del /Q $(SQLITE3C) $(SQLITE3H) 2>NUL
mistachkin3e786092016-01-23 07:53:04 +00002253# <</mark>>
drh76473772016-01-14 13:22:24 +00002254
shaneh6e7850c2011-06-17 15:57:07 +00002255clean:
mistachkin8dd3ff12015-05-16 03:41:41 +00002256 del /Q *.exp *.lo *.ilk *.lib *.obj *.ncb *.pdb *.sdf *.suo 2>NUL
mistachkin56362a52016-02-19 19:03:04 +00002257 del /Q *.bsc *.def *.cod *.da *.bb *.bbg *.vc gmon.out 2>NUL
mistachkinfe41a982016-02-27 00:21:44 +00002258 del /Q $(SQLITE3EXE) $(SQLITE3DLL) Replace.exe 2>NUL
mistachkin3e786092016-01-23 07:53:04 +00002259# <<mark>>
mistachkin9b88ace2016-02-26 21:01:37 +00002260 del /Q sqlite3.c sqlite3.h 2>NUL
2261 del /Q opcodes.c opcodes.h 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002262 del /Q lemon.* lempar.c parse.* 2>NUL
2263 del /Q mkkeywordhash.* keywordhash.h 2>NUL
2264 del /Q notasharedlib.* 2>NUL
2265 -rmdir /Q/S .deps 2>NUL
2266 -rmdir /Q/S .libs 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002267 -rmdir /Q/S tsrc 2>NUL
2268 del /Q .target_source 2>NUL
mistachkin4ef916e2016-08-24 19:58:46 +00002269 del /Q tclsqlite3.exe $(SQLITETCLH) $(SQLITETCLDECLSH) 2>NUL
mistachkina2d85cb2017-07-07 19:02:51 +00002270 del /Q lsm.dll lsmtest.exe 2>NUL
mistachkin44723ce2015-03-21 02:22:37 +00002271 del /Q testloadext.dll 2>NUL
2272 del /Q testfixture.exe test.db 2>NUL
mistachkin943d8252017-03-14 15:27:56 +00002273 del /Q LogEst.exe fts3view.exe rollback-test.exe showdb.exe dbdump.exe 2>NUL
drhedea9112015-03-24 19:02:13 +00002274 del /Q changeset.exe 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002275 del /Q showjournal.exe showstat4.exe showwal.exe speedtest1.exe 2>NUL
mistachkin27b69972016-02-07 20:39:27 +00002276 del /Q mptester.exe wordcount.exe rbu.exe srcck1.exe 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002277 del /Q sqlite3.c sqlite3-*.c 2>NUL
2278 del /Q sqlite3rc.h 2>NUL
mistachkin27799892016-03-31 22:53:37 +00002279 del /Q shell.c sqlite3ext.h sqlite3session.h 2>NUL
mistachkin44723ce2015-03-21 02:22:37 +00002280 del /Q sqlite3_analyzer.exe sqlite3_analyzer.c 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002281 del /Q sqlite-*-output.vsix 2>NUL
drh290fcaa2016-06-08 01:03:05 +00002282 del /Q fuzzershell.exe fuzzcheck.exe sqldiff.exe dbhash.exe 2>NUL
mistachkinbc50bb72015-07-14 21:56:53 +00002283 del /Q fts5.* fts5parse.* 2>NUL
mistachkin3e786092016-01-23 07:53:04 +00002284# <</mark>>