blob: 1dfc6bc49d114deab0e29406dc531c9cf68ea18a [file] [log] [blame]
shanehb2f20bf2011-06-17 07:07:24 +00001#
shaneh603e4262011-06-17 18:52:07 +00002# nmake Makefile for SQLite
shanehb2f20bf2011-06-17 07:07:24 +00003#
mistachkin4712c212014-05-09 20:51:17 +00004###############################################################################
5############################## START OF OPTIONS ###############################
6###############################################################################
shanehb2f20bf2011-06-17 07:07:24 +00007
8# The toplevel directory of the source tree. This is the directory
9# that contains this "Makefile.msc".
10#
11TOP = .
12
mistachkin3e786092016-01-23 07:53:04 +000013# <<mark>>
shaneh6e7850c2011-06-17 15:57:07 +000014# Set this non-0 to create and use the SQLite amalgamation file.
15#
mistachkin0ec07442012-10-12 18:06:07 +000016!IFNDEF USE_AMALGAMATION
shaneh6e7850c2011-06-17 15:57:07 +000017USE_AMALGAMATION = 1
mistachkin0ec07442012-10-12 18:06:07 +000018!ENDIF
mistachkin3e786092016-01-23 07:53:04 +000019# <</mark>>
shaneh6e7850c2011-06-17 15:57:07 +000020
mistachkin2318d332015-01-12 18:02:52 +000021# Set this non-0 to enable full warnings (-W4, etc) when compiling.
22#
23!IFNDEF USE_FULLWARN
24USE_FULLWARN = 0
25!ENDIF
26
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
drh2b44fd92017-02-17 01:43:51 +0000748TCC = $(TCC) -DSQLITE_ENABLE_WHERETRACE -DSQLITE_ENABLE_SELECTTRACE
mistachkin13a24f82015-05-13 04:50:30 +0000749RCC = $(RCC) -DSQLITE_DEBUG=1
mistachkin753c5442011-08-25 02:02:25 +0000750!ENDIF
751
mistachkinb10f22a2015-04-16 16:27:29 +0000752!IF $(DEBUG)>4 || $(OSTRACE)!=0
753TCC = $(TCC) -DSQLITE_FORCE_OS_TRACE=1 -DSQLITE_DEBUG_OS_TRACE=1
754RCC = $(RCC) -DSQLITE_FORCE_OS_TRACE=1 -DSQLITE_DEBUG_OS_TRACE=1
mistachkin753c5442011-08-25 02:02:25 +0000755!ENDIF
756
mistachkincd54bab2014-12-20 21:14:14 +0000757!IF $(DEBUG)>5
mistachkin13a24f82015-05-13 04:50:30 +0000758TCC = $(TCC) -DSQLITE_ENABLE_IOTRACE=1
759RCC = $(RCC) -DSQLITE_ENABLE_IOTRACE=1
mistachkin753c5442011-08-25 02:02:25 +0000760!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000761
mistachkinbd58d5f2012-06-30 22:22:34 +0000762# Prevent warnings about "insecure" MSVC runtime library functions
763# being used.
mistachkin176f1b42011-08-02 23:34:00 +0000764#
765TCC = $(TCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
mistachkinfec360a2012-04-18 10:29:21 +0000766BCC = $(BCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
mistachkin4d9d1f42012-09-03 10:32:32 +0000767RCC = $(RCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
mistachkin176f1b42011-08-02 23:34:00 +0000768
mistachkinbd58d5f2012-06-30 22:22:34 +0000769# Prevent warnings about "deprecated" POSIX functions being used.
770#
771TCC = $(TCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
772BCC = $(BCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
mistachkin4d9d1f42012-09-03 10:32:32 +0000773RCC = $(RCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
mistachkinbd58d5f2012-06-30 22:22:34 +0000774
mistachkin2f7d5d82012-08-22 00:39:34 +0000775# Use the SQLite debugging heap subsystem?
mistachkin1b186a92011-08-24 16:13:57 +0000776#
mistachkin2f7d5d82012-08-22 00:39:34 +0000777!IF $(MEMDEBUG)!=0
778TCC = $(TCC) -DSQLITE_MEMDEBUG=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000779RCC = $(RCC) -DSQLITE_MEMDEBUG=1
mistachkin2f7d5d82012-08-22 00:39:34 +0000780
mistachkin2f7d5d82012-08-22 00:39:34 +0000781# Use native Win32 heap subsystem instead of malloc/free?
782#
783!ELSEIF $(WIN32HEAP)!=0
784TCC = $(TCC) -DSQLITE_WIN32_MALLOC=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000785RCC = $(RCC) -DSQLITE_WIN32_MALLOC=1
mistachkin753c5442011-08-25 02:02:25 +0000786
mistachkin753c5442011-08-25 02:02:25 +0000787# Validate the heap on every call into the native Win32 heap subsystem?
788#
mistachkincd54bab2014-12-20 21:14:14 +0000789!IF $(DEBUG)>3
mistachkin753c5442011-08-25 02:02:25 +0000790TCC = $(TCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000791RCC = $(RCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1
mistachkin753c5442011-08-25 02:02:25 +0000792!ENDIF
mistachkin2f7d5d82012-08-22 00:39:34 +0000793!ENDIF
mistachkin1b186a92011-08-24 16:13:57 +0000794
mistachkin3e786092016-01-23 07:53:04 +0000795# <<mark>>
mistachkin5b0b6fd2011-06-25 01:14:36 +0000796# The locations of the Tcl header and library files. Also, the library that
797# non-stubs enabled programs using Tcl must link against. These variables
798# (TCLINCDIR, TCLLIBDIR, and LIBTCL) may be overridden via the environment
799# prior to running nmake in order to match the actual installed location and
800# version on this machine.
shanehb2f20bf2011-06-17 07:07:24 +0000801#
mistachkine37f99c2012-06-30 16:22:05 +0000802!IFNDEF TCLINCDIR
shanehb2f20bf2011-06-17 07:07:24 +0000803TCLINCDIR = c:\tcl\include
mistachkine37f99c2012-06-30 16:22:05 +0000804!ENDIF
mistachkin5b0b6fd2011-06-25 01:14:36 +0000805
mistachkine37f99c2012-06-30 16:22:05 +0000806!IFNDEF TCLLIBDIR
shanehb2f20bf2011-06-17 07:07:24 +0000807TCLLIBDIR = c:\tcl\lib
mistachkine37f99c2012-06-30 16:22:05 +0000808!ENDIF
mistachkin5b0b6fd2011-06-25 01:14:36 +0000809
mistachkine37f99c2012-06-30 16:22:05 +0000810!IFNDEF LIBTCL
drh506a1402016-11-02 19:49:22 +0000811LIBTCL = tcl86.lib
mistachkine37f99c2012-06-30 16:22:05 +0000812!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000813
mistachkin5b663502015-10-10 23:39:55 +0000814!IFNDEF LIBTCLSTUB
drh506a1402016-11-02 19:49:22 +0000815LIBTCLSTUB = tclstub86.lib
mistachkin5b663502015-10-10 23:39:55 +0000816!ENDIF
817
mistachkin88739962015-10-14 23:04:08 +0000818!IFNDEF LIBTCLPATH
819LIBTCLPATH = c:\tcl\bin
820!ENDIF
821
mistachkinc756ded2011-10-02 05:23:16 +0000822# The locations of the ICU header and library files. These variables
823# (ICUINCDIR, ICULIBDIR, and LIBICU) may be overridden via the environment
824# prior to running nmake in order to match the actual installed location on
825# this machine.
826#
mistachkine37f99c2012-06-30 16:22:05 +0000827!IFNDEF ICUINCDIR
mistachkinc756ded2011-10-02 05:23:16 +0000828ICUINCDIR = c:\icu\include
mistachkine37f99c2012-06-30 16:22:05 +0000829!ENDIF
mistachkinc756ded2011-10-02 05:23:16 +0000830
mistachkine37f99c2012-06-30 16:22:05 +0000831!IFNDEF ICULIBDIR
mistachkinc756ded2011-10-02 05:23:16 +0000832ICULIBDIR = c:\icu\lib
mistachkine37f99c2012-06-30 16:22:05 +0000833!ENDIF
mistachkinc756ded2011-10-02 05:23:16 +0000834
mistachkine37f99c2012-06-30 16:22:05 +0000835!IFNDEF LIBICU
mistachkinc756ded2011-10-02 05:23:16 +0000836LIBICU = icuuc.lib icuin.lib
mistachkine37f99c2012-06-30 16:22:05 +0000837!ENDIF
mistachkinc756ded2011-10-02 05:23:16 +0000838
shanehb2f20bf2011-06-17 07:07:24 +0000839# This is the command to use for tclsh - normally just "tclsh", but we may
mistachkin5b0b6fd2011-06-25 01:14:36 +0000840# know the specific version we want to use. This variable (TCLSH_CMD) may be
841# overridden via the environment prior to running nmake in order to select a
842# specific Tcl shell to use.
shanehb2f20bf2011-06-17 07:07:24 +0000843#
mistachkine37f99c2012-06-30 16:22:05 +0000844!IFNDEF TCLSH_CMD
drh506a1402016-11-02 19:49:22 +0000845TCLSH_CMD = tclsh
mistachkine37f99c2012-06-30 16:22:05 +0000846!ENDIF
mistachkin3e786092016-01-23 07:53:04 +0000847# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +0000848
849# Compiler options needed for programs that use the readline() library.
850#
mistachkin8bcd3fa2013-08-29 01:03:38 +0000851!IFNDEF READLINE_FLAGS
shaneh6e7850c2011-06-17 15:57:07 +0000852READLINE_FLAGS = -DHAVE_READLINE=0
mistachkin8bcd3fa2013-08-29 01:03:38 +0000853!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000854
855# The library that programs using readline() must link against.
856#
mistachkin8bcd3fa2013-08-29 01:03:38 +0000857!IFNDEF LIBREADLINE
shaneh6e7850c2011-06-17 15:57:07 +0000858LIBREADLINE =
mistachkin8bcd3fa2013-08-29 01:03:38 +0000859!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000860
861# Should the database engine be compiled threadsafe
862#
863TCC = $(TCC) -DSQLITE_THREADSAFE=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000864RCC = $(RCC) -DSQLITE_THREADSAFE=1
shanehb2f20bf2011-06-17 07:07:24 +0000865
866# Do threads override each others locks by default (1), or do we test (-1)
867#
868TCC = $(TCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1
mistachkin4d9d1f42012-09-03 10:32:32 +0000869RCC = $(RCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1
shanehb2f20bf2011-06-17 07:07:24 +0000870
871# Any target libraries which libsqlite must be linked against
shaneh6e7850c2011-06-17 15:57:07 +0000872#
mistachkine37f99c2012-06-30 16:22:05 +0000873!IFNDEF TLIBS
shaneh6e7850c2011-06-17 15:57:07 +0000874TLIBS =
mistachkine37f99c2012-06-30 16:22:05 +0000875!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000876
877# Flags controlling use of the in memory btree implementation
878#
879# SQLITE_TEMP_STORE is 0 to force temporary tables to be in a file, 1 to
880# default to file, 2 to default to memory, and 3 to force temporary
881# tables to always be in memory.
882#
shaneh6e7850c2011-06-17 15:57:07 +0000883TCC = $(TCC) -DSQLITE_TEMP_STORE=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000884RCC = $(RCC) -DSQLITE_TEMP_STORE=1
shanehb2f20bf2011-06-17 07:07:24 +0000885
886# Enable/disable loadable extensions, and other optional features
shaneh6e7850c2011-06-17 15:57:07 +0000887# based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*).
888# The same set of OMIT and ENABLE flags should be passed to the
shanehb2f20bf2011-06-17 07:07:24 +0000889# LEMON parser generator and the mkkeywordhash tool as well.
890
mistachkin4712c212014-05-09 20:51:17 +0000891# These are the required SQLite compilation options used when compiling for
892# the Windows platform.
893#
894REQ_FEATURE_FLAGS = $(REQ_FEATURE_FLAGS) -DSQLITE_MAX_TRIGGER_DEPTH=100
shanehb2f20bf2011-06-17 07:07:24 +0000895
mistachkine45e0fb2015-01-21 00:48:46 +0000896# If we are linking to the RPCRT4 library, enable features that need it.
897#
898!IF $(USE_RPCRT4_LIB)!=0
899REQ_FEATURE_FLAGS = $(REQ_FEATURE_FLAGS) -DSQLITE_WIN32_USE_UUID=1
900!ENDIF
901
mistachkin4712c212014-05-09 20:51:17 +0000902# Add the required and optional SQLite compilation options into the command
903# lines used to invoke the MSVC code and resource compilers.
904#
mistachkinedcb4eb2016-01-22 01:25:15 +0000905TCC = $(TCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS)
906RCC = $(RCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS)
shanehb2f20bf2011-06-17 07:07:24 +0000907
mistachkin4712c212014-05-09 20:51:17 +0000908# Add in any optional parameters specified on the commane line, e.g.
909# nmake /f Makefile.msc all "OPTS=-DSQLITE_ENABLE_FOO=1 -DSQLITE_OMIT_FOO=1"
910#
shanehb2f20bf2011-06-17 07:07:24 +0000911TCC = $(TCC) $(OPTS)
mistachkin4d9d1f42012-09-03 10:32:32 +0000912RCC = $(RCC) $(OPTS)
shanehb2f20bf2011-06-17 07:07:24 +0000913
mistachkin8bcd3fa2013-08-29 01:03:38 +0000914# If compiling for debugging, add some defines.
mistachkin4712c212014-05-09 20:51:17 +0000915#
mistachkincd54bab2014-12-20 21:14:14 +0000916!IF $(DEBUG)>1
mistachkin8bcd3fa2013-08-29 01:03:38 +0000917TCC = $(TCC) -D_DEBUG
918BCC = $(BCC) -D_DEBUG
mistachkin4d9d1f42012-09-03 10:32:32 +0000919RCC = $(RCC) -D_DEBUG
mistachkin4d60be52011-08-26 05:40:31 +0000920!ENDIF
921
mistachkin8bcd3fa2013-08-29 01:03:38 +0000922# If optimizations are enabled or disabled (either implicitly or
923# explicitly), add the necessary flags.
mistachkin4712c212014-05-09 20:51:17 +0000924#
mistachkincd54bab2014-12-20 21:14:14 +0000925!IF $(DEBUG)>1 || $(OPTIMIZATIONS)==0
mistachkin8bcd3fa2013-08-29 01:03:38 +0000926TCC = $(TCC) -Od
927BCC = $(BCC) -Od
mistachkin24b6b812016-08-24 18:21:58 +0000928!IF $(USE_RUNTIME_CHECKS)!=0
929TCC = $(TCC) -RTC1
930BCC = $(BCC) -RTC1
931!ENDIF
mistachkin8bcd3fa2013-08-29 01:03:38 +0000932!ELSEIF $(OPTIMIZATIONS)>=3
933TCC = $(TCC) -Ox
934BCC = $(BCC) -Ox
935!ELSEIF $(OPTIMIZATIONS)==2
936TCC = $(TCC) -O2
937BCC = $(BCC) -O2
938!ELSEIF $(OPTIMIZATIONS)==1
939TCC = $(TCC) -O1
940BCC = $(BCC) -O1
941!ENDIF
942
943# If symbols are enabled (or compiling for debugging), enable PDBs.
mistachkin4712c212014-05-09 20:51:17 +0000944#
mistachkincd54bab2014-12-20 21:14:14 +0000945!IF $(DEBUG)>1 || $(SYMBOLS)!=0
mistachkin4d60be52011-08-26 05:40:31 +0000946TCC = $(TCC) -Zi
mistachkinfec360a2012-04-18 10:29:21 +0000947BCC = $(BCC) -Zi
mistachkin753c5442011-08-25 02:02:25 +0000948!ENDIF
949
mistachkin3e786092016-01-23 07:53:04 +0000950# <<mark>>
mistachkinc756ded2011-10-02 05:23:16 +0000951# If ICU support is enabled, add the compiler options for it.
mistachkin4712c212014-05-09 20:51:17 +0000952#
mistachkinc756ded2011-10-02 05:23:16 +0000953!IF $(USE_ICU)!=0
954TCC = $(TCC) -DSQLITE_ENABLE_ICU=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000955RCC = $(RCC) -DSQLITE_ENABLE_ICU=1
mistachkinc756ded2011-10-02 05:23:16 +0000956TCC = $(TCC) -I$(TOP)\ext\icu
mistachkin4d9d1f42012-09-03 10:32:32 +0000957RCC = $(RCC) -I$(TOP)\ext\icu
mistachkinc756ded2011-10-02 05:23:16 +0000958TCC = $(TCC) -I$(ICUINCDIR)
mistachkin4d9d1f42012-09-03 10:32:32 +0000959RCC = $(RCC) -I$(ICUINCDIR)
mistachkinc756ded2011-10-02 05:23:16 +0000960!ENDIF
mistachkin3e786092016-01-23 07:53:04 +0000961# <</mark>>
mistachkinc756ded2011-10-02 05:23:16 +0000962
mistachkin4d9d1f42012-09-03 10:32:32 +0000963# Command line prefixes for compiling code, compiling resources,
964# linking, etc.
mistachkin4712c212014-05-09 20:51:17 +0000965#
shanehb2f20bf2011-06-17 07:07:24 +0000966LTCOMPILE = $(TCC) -Fo$@
mistachkin4d9d1f42012-09-03 10:32:32 +0000967LTRCOMPILE = $(RCC) -r
shanehb2f20bf2011-06-17 07:07:24 +0000968LTLIB = lib.exe
shaneh2a0b9ef2011-06-20 20:52:32 +0000969LTLINK = $(TCC) -Fe$@
970
mistachkine45e0fb2015-01-21 00:48:46 +0000971# If requested, link to the RPCRT4 library.
972#
973!IF $(USE_RPCRT4_LIB)!=0
974LTLINK = $(LTLINK) rpcrt4.lib
975!ENDIF
976
shaneh2a0b9ef2011-06-20 20:52:32 +0000977# If a platform was set, force the linker to target that.
978# Note that the vcvars*.bat family of batch files typically
979# set this for you. Otherwise, the linker will attempt
980# to deduce the binary type based on the object files.
mistachkine37f99c2012-06-30 16:22:05 +0000981!IFDEF PLATFORM
mistachkin44723ce2015-03-21 02:22:37 +0000982LTLINKOPTS = /NOLOGO /MACHINE:$(PLATFORM)
983LTLIBOPTS = /NOLOGO /MACHINE:$(PLATFORM)
984!ELSE
985LTLINKOPTS = /NOLOGO
986LTLIBOPTS = /NOLOGO
shaneh2a0b9ef2011-06-20 20:52:32 +0000987!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000988
mistachkina6ff8572012-04-17 21:00:12 +0000989# When compiling for use in the WinRT environment, the following
990# linker option must be used to mark the executable as runnable
991# only in the context of an application container.
992#
993!IF $(FOR_WINRT)!=0
994LTLINKOPTS = $(LTLINKOPTS) /APPCONTAINER
mistachkin318d38c2015-04-22 01:33:53 +0000995!IF "$(VISUALSTUDIOVERSION)"=="12.0" || "$(VISUALSTUDIOVERSION)"=="14.0"
mistachkinf6a23422014-05-05 20:24:34 +0000996!IFNDEF STORELIBPATH
mistachkinda5b1cd2013-07-10 19:39:02 +0000997!IF "$(PLATFORM)"=="x86"
mistachkin4712c212014-05-09 20:51:17 +0000998STORELIBPATH = $(CRTLIBPATH)\store
mistachkinda5b1cd2013-07-10 19:39:02 +0000999!ELSEIF "$(PLATFORM)"=="x64"
mistachkin4712c212014-05-09 20:51:17 +00001000STORELIBPATH = $(CRTLIBPATH)\store\amd64
mistachkin4eaa1292013-07-10 21:33:25 +00001001!ELSEIF "$(PLATFORM)"=="ARM"
mistachkin4712c212014-05-09 20:51:17 +00001002STORELIBPATH = $(CRTLIBPATH)\store\arm
mistachkin4eaa1292013-07-10 21:33:25 +00001003!ELSE
mistachkin4712c212014-05-09 20:51:17 +00001004STORELIBPATH = $(CRTLIBPATH)\store
mistachkinda5b1cd2013-07-10 19:39:02 +00001005!ENDIF
1006!ENDIF
mistachkinf6a23422014-05-05 20:24:34 +00001007STORELIBPATH = $(STORELIBPATH:\\=\)
1008LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(STORELIBPATH)"
1009!ENDIF
mistachkina6ff8572012-04-17 21:00:12 +00001010!ENDIF
1011
mistachkind9b3c542014-05-09 23:31:55 +00001012# When compiling for Windows Phone 8.1, an extra library path is
1013# required.
1014#
1015!IF $(USE_WP81_OPTS)!=0
1016!IFNDEF WP81LIBPATH
1017!IF "$(PLATFORM)"=="x86"
1018WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86
1019!ELSEIF "$(PLATFORM)"=="ARM"
1020WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\ARM
1021!ELSE
1022WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86
mistachkinc756ded2011-10-02 05:23:16 +00001023!ENDIF
mistachkin31856a32012-07-27 07:13:25 +00001024!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +00001025!ENDIF
1026
mistachkind9b3c542014-05-09 23:31:55 +00001027# When compiling for Windows Phone 8.1, some extra linker options
1028# are also required.
1029#
1030!IF $(USE_WP81_OPTS)!=0
1031!IFDEF WP81LIBPATH
1032LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(WP81LIBPATH)"
1033!ENDIF
1034LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE
1035LTLINKOPTS = $(LTLINKOPTS) WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelHost.lib
1036LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:kernel32.lib /NODEFAULTLIB:ole32.lib
1037!ENDIF
1038
mistachkina819aed2016-02-12 05:19:29 +00001039# When compiling for UWP or the Windows 10 platform, some extra linker
mistachkin55e88d92016-02-08 20:40:57 +00001040# options are also required.
mistachkin318d38c2015-04-22 01:33:53 +00001041#
mistachkina819aed2016-02-12 05:19:29 +00001042!IF $(FOR_UWP)!=0 || $(FOR_WIN10)!=0
mistachkin318d38c2015-04-22 01:33:53 +00001043LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE /NODEFAULTLIB:kernel32.lib
1044LTLINKOPTS = $(LTLINKOPTS) mincore.lib
1045!IFDEF PSDKLIBPATH
1046LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(PSDKLIBPATH)"
1047!ENDIF
1048!ENDIF
1049
mistachkina6f28892016-02-05 19:40:23 +00001050!IF $(FOR_WIN10)!=0
mistachkin406eeff2016-02-09 18:28:20 +00001051LTLINKOPTS = $(LTLINKOPTS) /guard:cf "/LIBPATH:$(UCRTLIBPATH)"
mistachkina6f28892016-02-05 19:40:23 +00001052!IF $(DEBUG)>1
1053LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:libucrtd.lib /DEFAULTLIB:ucrtd.lib
1054!ELSE
1055LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib
1056!ENDIF
1057!ENDIF
1058
shanehb2f20bf2011-06-17 07:07:24 +00001059# If either debugging or symbols are enabled, enable PDBs.
mistachkin4712c212014-05-09 20:51:17 +00001060#
mistachkincd54bab2014-12-20 21:14:14 +00001061!IF $(DEBUG)>1 || $(SYMBOLS)!=0
mistachkinf170ea42015-10-16 20:13:57 +00001062LDFLAGS = /DEBUG $(LDOPTS)
1063!ELSE
1064LDFLAGS = $(LDOPTS)
shanehb2f20bf2011-06-17 07:07:24 +00001065!ENDIF
1066
mistachkin3e786092016-01-23 07:53:04 +00001067# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001068# Start with the Tcl related linker options.
mistachkin4712c212014-05-09 20:51:17 +00001069#
shanehb2f20bf2011-06-17 07:07:24 +00001070!IF $(NO_TCL)==0
1071LTLIBPATHS = /LIBPATH:$(TCLLIBDIR)
1072LTLIBS = $(LIBTCL)
mistachkin31856a32012-07-27 07:13:25 +00001073!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +00001074
1075# If ICU support is enabled, add the linker options for it.
mistachkin4712c212014-05-09 20:51:17 +00001076#
shanehb2f20bf2011-06-17 07:07:24 +00001077!IF $(USE_ICU)!=0
1078LTLIBPATHS = $(LTLIBPATHS) /LIBPATH:$(ICULIBDIR)
1079LTLIBS = $(LTLIBS) $(LIBICU)
1080!ENDIF
mistachkin3e786092016-01-23 07:53:04 +00001081# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001082
shanehb2f20bf2011-06-17 07:07:24 +00001083# You should not have to change anything below this line
1084###############################################################################
1085
mistachkin3e786092016-01-23 07:53:04 +00001086# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001087# Object files for the SQLite library (non-amalgamation).
1088#
mistachkinf67feef2013-07-29 19:03:20 +00001089LIBOBJS0 = vdbe.lo parse.lo alter.lo analyze.lo attach.lo auth.lo \
shanehb2f20bf2011-06-17 07:07:24 +00001090 backup.lo bitvec.lo btmutex.lo btree.lo build.lo \
drh1a4a6802015-05-04 18:31:09 +00001091 callback.lo complete.lo ctime.lo date.lo dbstat.lo delete.lo \
shanehb2f20bf2011-06-17 07:07:24 +00001092 expr.lo fault.lo fkey.lo \
drh391d4ba2012-05-28 20:22:16 +00001093 fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo \
1094 fts3_porter.lo fts3_snippet.lo fts3_tokenizer.lo fts3_tokenizer1.lo \
drh4d648c72013-04-22 17:07:56 +00001095 fts3_tokenize_vtab.lo fts3_unicode.lo fts3_unicode2.lo fts3_write.lo \
mistachkined52f9f2015-06-26 04:34:36 +00001096 fts5.lo \
shanehb2f20bf2011-06-17 07:07:24 +00001097 func.lo global.lo hash.lo \
drhc2f18ad2016-03-05 15:35:09 +00001098 icu.lo insert.lo legacy.lo loadext.lo \
shanehb2f20bf2011-06-17 07:07:24 +00001099 main.lo malloc.lo mem0.lo mem1.lo mem2.lo mem3.lo mem5.lo \
1100 memjournal.lo \
mistachkinf1c6bc52012-06-21 15:09:20 +00001101 mutex.lo mutex_noop.lo mutex_unix.lo mutex_w32.lo \
1102 notify.lo opcodes.lo os.lo os_unix.lo os_win.lo \
mistachkinf67feef2013-07-29 19:03:20 +00001103 pager.lo pcache.lo pcache1.lo pragma.lo prepare.lo printf.lo \
drh498dcae2013-03-13 11:42:00 +00001104 random.lo resolve.lo rowset.lo rtree.lo \
drhcb75bff2016-01-14 14:48:17 +00001105 sqlite3session.lo select.lo sqlite3rbu.lo status.lo \
drh38b41492015-06-08 15:08:15 +00001106 table.lo threads.lo tokenize.lo treeview.lo trigger.lo \
shanehb2f20bf2011-06-17 07:07:24 +00001107 update.lo util.lo vacuum.lo \
mistachkinf67feef2013-07-29 19:03:20 +00001108 vdbeapi.lo vdbeaux.lo vdbeblob.lo vdbemem.lo vdbesort.lo \
drh6c1f4ef2015-06-08 14:23:15 +00001109 vdbetrace.lo wal.lo walker.lo where.lo wherecode.lo whereexpr.lo \
1110 utf.lo vtab.lo
mistachkin3e786092016-01-23 07:53:04 +00001111# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001112
1113# Object files for the amalgamation.
1114#
1115LIBOBJS1 = sqlite3.lo
1116
1117# Determine the real value of LIBOBJ based on the 'configure' script
1118#
mistachkin3e786092016-01-23 07:53:04 +00001119# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001120!IF $(USE_AMALGAMATION)==0
1121LIBOBJ = $(LIBOBJS0)
1122!ELSE
mistachkin3e786092016-01-23 07:53:04 +00001123# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001124LIBOBJ = $(LIBOBJS1)
mistachkin3e786092016-01-23 07:53:04 +00001125# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001126!ENDIF
mistachkin3e786092016-01-23 07:53:04 +00001127# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001128
mistachkin08c1c312012-10-06 03:48:25 +00001129# Determine if embedded resource compilation and usage are enabled.
1130#
1131!IF $(USE_RC)!=0
1132LIBRESOBJS = sqlite3res.lo
1133!ELSE
1134LIBRESOBJS =
1135!ENDIF
1136
mistachkin3e786092016-01-23 07:53:04 +00001137# <<mark>>
mistachkinc04c54b2016-02-11 21:28:16 +00001138# Core source code files, part 1.
shanehb2f20bf2011-06-17 07:07:24 +00001139#
mistachkinc04c54b2016-02-11 21:28:16 +00001140SRC00 = \
shanehb2f20bf2011-06-17 07:07:24 +00001141 $(TOP)\src\alter.c \
1142 $(TOP)\src\analyze.c \
1143 $(TOP)\src\attach.c \
1144 $(TOP)\src\auth.c \
1145 $(TOP)\src\backup.c \
1146 $(TOP)\src\bitvec.c \
1147 $(TOP)\src\btmutex.c \
1148 $(TOP)\src\btree.c \
shanehb2f20bf2011-06-17 07:07:24 +00001149 $(TOP)\src\build.c \
1150 $(TOP)\src\callback.c \
1151 $(TOP)\src\complete.c \
1152 $(TOP)\src\ctime.c \
1153 $(TOP)\src\date.c \
drh1a4a6802015-05-04 18:31:09 +00001154 $(TOP)\src\dbstat.c \
shanehb2f20bf2011-06-17 07:07:24 +00001155 $(TOP)\src\delete.c \
1156 $(TOP)\src\expr.c \
1157 $(TOP)\src\fault.c \
1158 $(TOP)\src\fkey.c \
1159 $(TOP)\src\func.c \
1160 $(TOP)\src\global.c \
1161 $(TOP)\src\hash.c \
shanehb2f20bf2011-06-17 07:07:24 +00001162 $(TOP)\src\insert.c \
shanehb2f20bf2011-06-17 07:07:24 +00001163 $(TOP)\src\legacy.c \
1164 $(TOP)\src\loadext.c \
1165 $(TOP)\src\main.c \
1166 $(TOP)\src\malloc.c \
1167 $(TOP)\src\mem0.c \
1168 $(TOP)\src\mem1.c \
1169 $(TOP)\src\mem2.c \
1170 $(TOP)\src\mem3.c \
1171 $(TOP)\src\mem5.c \
1172 $(TOP)\src\memjournal.c \
1173 $(TOP)\src\mutex.c \
shanehb2f20bf2011-06-17 07:07:24 +00001174 $(TOP)\src\mutex_noop.c \
shanehb2f20bf2011-06-17 07:07:24 +00001175 $(TOP)\src\mutex_unix.c \
1176 $(TOP)\src\mutex_w32.c \
1177 $(TOP)\src\notify.c \
1178 $(TOP)\src\os.c \
shanehb2f20bf2011-06-17 07:07:24 +00001179 $(TOP)\src\os_unix.c \
mistachkinc04c54b2016-02-11 21:28:16 +00001180 $(TOP)\src\os_win.c
1181
1182# Core source code files, part 2.
1183#
1184SRC01 = \
shanehb2f20bf2011-06-17 07:07:24 +00001185 $(TOP)\src\pager.c \
shanehb2f20bf2011-06-17 07:07:24 +00001186 $(TOP)\src\pcache.c \
shanehb2f20bf2011-06-17 07:07:24 +00001187 $(TOP)\src\pcache1.c \
1188 $(TOP)\src\pragma.c \
1189 $(TOP)\src\prepare.c \
1190 $(TOP)\src\printf.c \
1191 $(TOP)\src\random.c \
1192 $(TOP)\src\resolve.c \
1193 $(TOP)\src\rowset.c \
1194 $(TOP)\src\select.c \
1195 $(TOP)\src\status.c \
shanehb2f20bf2011-06-17 07:07:24 +00001196 $(TOP)\src\table.c \
drhf51446a2012-07-21 19:40:42 +00001197 $(TOP)\src\threads.c \
shanehb2f20bf2011-06-17 07:07:24 +00001198 $(TOP)\src\tclsqlite.c \
1199 $(TOP)\src\tokenize.c \
drh38b41492015-06-08 15:08:15 +00001200 $(TOP)\src\treeview.c \
shanehb2f20bf2011-06-17 07:07:24 +00001201 $(TOP)\src\trigger.c \
1202 $(TOP)\src\utf.c \
1203 $(TOP)\src\update.c \
1204 $(TOP)\src\util.c \
1205 $(TOP)\src\vacuum.c \
1206 $(TOP)\src\vdbe.c \
shanehb2f20bf2011-06-17 07:07:24 +00001207 $(TOP)\src\vdbeapi.c \
1208 $(TOP)\src\vdbeaux.c \
1209 $(TOP)\src\vdbeblob.c \
1210 $(TOP)\src\vdbemem.c \
mistachkin81c428a2011-08-17 02:19:54 +00001211 $(TOP)\src\vdbesort.c \
shanehb2f20bf2011-06-17 07:07:24 +00001212 $(TOP)\src\vdbetrace.c \
shanehb2f20bf2011-06-17 07:07:24 +00001213 $(TOP)\src\vtab.c \
1214 $(TOP)\src\wal.c \
shanehb2f20bf2011-06-17 07:07:24 +00001215 $(TOP)\src\walker.c \
drhe54df422013-11-12 18:37:25 +00001216 $(TOP)\src\where.c \
drh6f82e852015-06-06 20:12:09 +00001217 $(TOP)\src\wherecode.c \
mistachkinc04c54b2016-02-11 21:28:16 +00001218 $(TOP)\src\whereexpr.c
1219
1220# Shell source code files.
1221#
1222SRC02 = \
1223 $(TOP)\src\shell.c
1224
1225# Core miscellaneous files.
1226#
1227SRC03 = \
1228 $(TOP)\src\parse.y
1229
1230# Core header files, part 1.
1231#
1232SRC04 = \
1233 $(TOP)\src\btree.h \
1234 $(TOP)\src\btreeInt.h \
1235 $(TOP)\src\hash.h \
1236 $(TOP)\src\hwtime.h \
1237 $(TOP)\src\msvc.h \
1238 $(TOP)\src\mutex.h \
1239 $(TOP)\src\os.h \
1240 $(TOP)\src\os_common.h \
1241 $(TOP)\src\os_setup.h \
1242 $(TOP)\src\os_win.h
1243
1244# Core header files, part 2.
1245#
1246SRC05 = \
1247 $(TOP)\src\pager.h \
1248 $(TOP)\src\pcache.h \
1249 $(TOP)\src\pragma.h \
1250 $(TOP)\src\sqlite.h.in \
1251 $(TOP)\src\sqlite3ext.h \
1252 $(TOP)\src\sqliteInt.h \
1253 $(TOP)\src\sqliteLimit.h \
1254 $(TOP)\src\vdbe.h \
1255 $(TOP)\src\vdbeInt.h \
1256 $(TOP)\src\vxworks.h \
1257 $(TOP)\src\wal.h \
drhe54df422013-11-12 18:37:25 +00001258 $(TOP)\src\whereInt.h
shanehb2f20bf2011-06-17 07:07:24 +00001259
mistachkinc04c54b2016-02-11 21:28:16 +00001260# Extension source code files, part 1.
shanehb2f20bf2011-06-17 07:07:24 +00001261#
mistachkinc04c54b2016-02-11 21:28:16 +00001262SRC06 = \
shanehb2f20bf2011-06-17 07:07:24 +00001263 $(TOP)\ext\fts1\fts1.c \
shanehb2f20bf2011-06-17 07:07:24 +00001264 $(TOP)\ext\fts1\fts1_hash.c \
shanehb2f20bf2011-06-17 07:07:24 +00001265 $(TOP)\ext\fts1\fts1_porter.c \
drh62679202015-01-29 18:38:05 +00001266 $(TOP)\ext\fts1\fts1_tokenizer1.c \
shanehb2f20bf2011-06-17 07:07:24 +00001267 $(TOP)\ext\fts2\fts2.c \
shanehb2f20bf2011-06-17 07:07:24 +00001268 $(TOP)\ext\fts2\fts2_hash.c \
shanehb2f20bf2011-06-17 07:07:24 +00001269 $(TOP)\ext\fts2\fts2_icu.c \
1270 $(TOP)\ext\fts2\fts2_porter.c \
shanehb2f20bf2011-06-17 07:07:24 +00001271 $(TOP)\ext\fts2\fts2_tokenizer.c \
1272 $(TOP)\ext\fts2\fts2_tokenizer1.c
mistachkinc04c54b2016-02-11 21:28:16 +00001273
1274# Extension source code files, part 2.
1275#
1276SRC07 = \
shanehb2f20bf2011-06-17 07:07:24 +00001277 $(TOP)\ext\fts3\fts3.c \
shanehb2f20bf2011-06-17 07:07:24 +00001278 $(TOP)\ext\fts3\fts3_aux.c \
1279 $(TOP)\ext\fts3\fts3_expr.c \
1280 $(TOP)\ext\fts3\fts3_hash.c \
shanehb2f20bf2011-06-17 07:07:24 +00001281 $(TOP)\ext\fts3\fts3_icu.c \
1282 $(TOP)\ext\fts3\fts3_porter.c \
1283 $(TOP)\ext\fts3\fts3_snippet.c \
shanehb2f20bf2011-06-17 07:07:24 +00001284 $(TOP)\ext\fts3\fts3_tokenizer.c \
1285 $(TOP)\ext\fts3\fts3_tokenizer1.c \
drh4d648c72013-04-22 17:07:56 +00001286 $(TOP)\ext\fts3\fts3_tokenize_vtab.c \
drh391d4ba2012-05-28 20:22:16 +00001287 $(TOP)\ext\fts3\fts3_unicode.c \
1288 $(TOP)\ext\fts3\fts3_unicode2.c \
drh62679202015-01-29 18:38:05 +00001289 $(TOP)\ext\fts3\fts3_write.c \
drh62679202015-01-29 18:38:05 +00001290 $(TOP)\ext\icu\icu.c \
drhedea9112015-03-24 19:02:13 +00001291 $(TOP)\ext\rtree\rtree.c \
drhdbbd8162015-05-19 23:04:26 +00001292 $(TOP)\ext\session\sqlite3session.c \
drh50065652015-10-08 19:29:18 +00001293 $(TOP)\ext\rbu\sqlite3rbu.c \
1294 $(TOP)\ext\misc\json1.c
shanehb2f20bf2011-06-17 07:07:24 +00001295
mistachkinc04c54b2016-02-11 21:28:16 +00001296# Extension header files, part 1.
1297#
1298SRC08 = \
1299 $(TOP)\ext\fts1\fts1.h \
1300 $(TOP)\ext\fts1\fts1_hash.h \
1301 $(TOP)\ext\fts1\fts1_tokenizer.h \
1302 $(TOP)\ext\fts2\fts2.h \
1303 $(TOP)\ext\fts2\fts2_hash.h \
1304 $(TOP)\ext\fts2\fts2_tokenizer.h
1305
1306# Extension header files, part 2.
1307#
1308SRC09 = \
1309 $(TOP)\ext\fts3\fts3.h \
1310 $(TOP)\ext\fts3\fts3Int.h \
1311 $(TOP)\ext\fts3\fts3_hash.h \
1312 $(TOP)\ext\fts3\fts3_tokenizer.h \
1313 $(TOP)\ext\icu\sqliteicu.h \
1314 $(TOP)\ext\rtree\rtree.h \
mistachkin05004782016-03-30 16:23:06 +00001315 $(TOP)\ext\rbu\sqlite3rbu.h \
1316 $(TOP)\ext\session\sqlite3session.h
shanehb2f20bf2011-06-17 07:07:24 +00001317
1318# Generated source code files
1319#
mistachkinc04c54b2016-02-11 21:28:16 +00001320SRC10 = \
shanehb2f20bf2011-06-17 07:07:24 +00001321 opcodes.c \
mistachkinc04c54b2016-02-11 21:28:16 +00001322 parse.c
1323
1324# Generated header files
1325#
1326SRC11 = \
1327 keywordhash.h \
shanehb2f20bf2011-06-17 07:07:24 +00001328 opcodes.h \
shanehb2f20bf2011-06-17 07:07:24 +00001329 parse.h \
mistachkin5d4d9412016-01-22 03:54:36 +00001330 $(SQLITE3H)
shanehb2f20bf2011-06-17 07:07:24 +00001331
mistachkin52b1dbb2016-07-28 14:37:04 +00001332# Generated Tcl header files
1333#
mistachkin4ef916e2016-08-24 19:58:46 +00001334!IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
mistachkin52b1dbb2016-07-28 14:37:04 +00001335SRC12 = \
mistachkin4ef916e2016-08-24 19:58:46 +00001336 $(SQLITETCLH) \
1337 $(SQLITETCLDECLSH)
1338!ELSE
1339SRC12 =
1340!ENDIF
mistachkin52b1dbb2016-07-28 14:37:04 +00001341
drh62679202015-01-29 18:38:05 +00001342# All source code files.
1343#
mistachkinc04c54b2016-02-11 21:28:16 +00001344SRC = $(SRC00) $(SRC01) $(SRC02) $(SRC03) $(SRC04) $(SRC05) $(SRC06) $(SRC07) $(SRC08) $(SRC09) $(SRC10) $(SRC11)
drh62679202015-01-29 18:38:05 +00001345
shanehb2f20bf2011-06-17 07:07:24 +00001346# Source code to the test files.
1347#
1348TESTSRC = \
1349 $(TOP)\src\test1.c \
1350 $(TOP)\src\test2.c \
1351 $(TOP)\src\test3.c \
1352 $(TOP)\src\test4.c \
1353 $(TOP)\src\test5.c \
1354 $(TOP)\src\test6.c \
1355 $(TOP)\src\test7.c \
1356 $(TOP)\src\test8.c \
1357 $(TOP)\src\test9.c \
1358 $(TOP)\src\test_autoext.c \
1359 $(TOP)\src\test_async.c \
1360 $(TOP)\src\test_backup.c \
drhddebf162016-03-04 02:59:35 +00001361 $(TOP)\src\test_bestindex.c \
drh5de7d962014-12-05 00:17:39 +00001362 $(TOP)\src\test_blob.c \
shanehb2f20bf2011-06-17 07:07:24 +00001363 $(TOP)\src\test_btree.c \
1364 $(TOP)\src\test_config.c \
dan000f95b2016-09-09 20:00:40 +00001365 $(TOP)\src\test_delete.c \
shanehb2f20bf2011-06-17 07:07:24 +00001366 $(TOP)\src\test_demovfs.c \
1367 $(TOP)\src\test_devsym.c \
mistachkin413c63b2013-01-17 03:18:14 +00001368 $(TOP)\src\test_fs.c \
shanehb2f20bf2011-06-17 07:07:24 +00001369 $(TOP)\src\test_func.c \
shanehb2f20bf2011-06-17 07:07:24 +00001370 $(TOP)\src\test_hexio.c \
1371 $(TOP)\src\test_init.c \
1372 $(TOP)\src\test_intarray.c \
1373 $(TOP)\src\test_journal.c \
1374 $(TOP)\src\test_malloc.c \
1375 $(TOP)\src\test_multiplex.c \
1376 $(TOP)\src\test_mutex.c \
1377 $(TOP)\src\test_onefile.c \
1378 $(TOP)\src\test_osinst.c \
1379 $(TOP)\src\test_pcache.c \
1380 $(TOP)\src\test_quota.c \
1381 $(TOP)\src\test_rtree.c \
1382 $(TOP)\src\test_schema.c \
1383 $(TOP)\src\test_server.c \
1384 $(TOP)\src\test_superlock.c \
1385 $(TOP)\src\test_syscall.c \
shanehb2f20bf2011-06-17 07:07:24 +00001386 $(TOP)\src\test_tclvar.c \
1387 $(TOP)\src\test_thread.c \
1388 $(TOP)\src\test_vfs.c \
mistachkin92af1eb2015-11-30 23:29:07 +00001389 $(TOP)\src\test_windirent.c \
shanehb2f20bf2011-06-17 07:07:24 +00001390 $(TOP)\src\test_wsd.c \
1391 $(TOP)\ext\fts3\fts3_term.c \
mistachkinadb96a62012-01-16 12:33:36 +00001392 $(TOP)\ext\fts3\fts3_test.c \
mistachkin05004782016-03-30 16:23:06 +00001393 $(TOP)\ext\rbu\test_rbu.c \
1394 $(TOP)\ext\session\test_session.c
shanehb2f20bf2011-06-17 07:07:24 +00001395
mistachkinc04c54b2016-02-11 21:28:16 +00001396# Statically linked extensions.
drhe50db1c2013-04-25 14:31:46 +00001397#
drh1fb64af2013-04-25 14:36:28 +00001398TESTEXT = \
drh8416fc72013-04-25 16:42:55 +00001399 $(TOP)\ext\misc\amatch.c \
drh2e3f87a2016-07-03 02:35:47 +00001400 $(TOP)\ext\misc\carray.c \
drh8416fc72013-04-25 16:42:55 +00001401 $(TOP)\ext\misc\closure.c \
drh35db31b2016-06-02 23:13:21 +00001402 $(TOP)\ext\misc\csv.c \
drh1728bcb2014-11-10 16:49:56 +00001403 $(TOP)\ext\misc\eval.c \
drh51ed2982014-06-16 12:44:32 +00001404 $(TOP)\ext\misc\fileio.c \
drhe50db1c2013-04-25 14:31:46 +00001405 $(TOP)\ext\misc\fuzzer.c \
mistachkined52f9f2015-06-26 04:34:36 +00001406 $(TOP)\ext\fts5\fts5_tcl.c \
dand3789c02015-08-04 20:29:00 +00001407 $(TOP)\ext\fts5\fts5_test_mi.c \
dan2cfe0492016-01-14 20:05:59 +00001408 $(TOP)\ext\fts5\fts5_test_tok.c \
drh8416fc72013-04-25 16:42:55 +00001409 $(TOP)\ext\misc\ieee754.c \
drhea41dc42013-04-25 19:31:33 +00001410 $(TOP)\ext\misc\nextchar.c \
drhdef33672013-05-28 20:25:54 +00001411 $(TOP)\ext\misc\percentile.c \
drhe50db1c2013-04-25 14:31:46 +00001412 $(TOP)\ext\misc\regexp.c \
drh6bada272016-08-09 21:08:42 +00001413 $(TOP)\ext\misc\remember.c \
drh398f8722015-08-19 13:54:20 +00001414 $(TOP)\ext\misc\series.c \
drhb7045ab2013-04-25 14:59:01 +00001415 $(TOP)\ext\misc\spellfix.c \
drh5f8cdac2013-10-14 21:14:42 +00001416 $(TOP)\ext\misc\totype.c \
drhe50db1c2013-04-25 14:31:46 +00001417 $(TOP)\ext\misc\wholenumber.c
1418
shanehb2f20bf2011-06-17 07:07:24 +00001419# Source code to the library files needed by the test fixture
mistachkinadb96a62012-01-16 12:33:36 +00001420# (non-amalgamation)
shanehb2f20bf2011-06-17 07:07:24 +00001421#
1422TESTSRC2 = \
mistachkinc04c54b2016-02-11 21:28:16 +00001423 $(SRC00) \
1424 $(SRC01) \
1425 $(SRC06) \
1426 $(SRC07) \
1427 $(SRC10) \
mistachkin05004782016-03-30 16:23:06 +00001428 $(TOP)\ext\async\sqlite3async.c
shanehb2f20bf2011-06-17 07:07:24 +00001429
1430# Header files used by all library source files.
1431#
1432HDR = \
1433 $(TOP)\src\btree.h \
1434 $(TOP)\src\btreeInt.h \
1435 $(TOP)\src\hash.h \
1436 $(TOP)\src\hwtime.h \
1437 keywordhash.h \
mistachkin2318d332015-01-12 18:02:52 +00001438 $(TOP)\src\msvc.h \
shanehb2f20bf2011-06-17 07:07:24 +00001439 $(TOP)\src\mutex.h \
1440 opcodes.h \
1441 $(TOP)\src\os.h \
1442 $(TOP)\src\os_common.h \
mistachkinf74b9e02013-11-26 01:00:31 +00001443 $(TOP)\src\os_setup.h \
mistachkin8bc52622013-11-25 09:36:07 +00001444 $(TOP)\src\os_win.h \
shanehb2f20bf2011-06-17 07:07:24 +00001445 $(TOP)\src\pager.h \
1446 $(TOP)\src\pcache.h \
shaneh6e7850c2011-06-17 15:57:07 +00001447 parse.h \
drh67e65e52015-02-02 21:34:54 +00001448 $(TOP)\src\pragma.h \
mistachkin5d4d9412016-01-22 03:54:36 +00001449 $(SQLITE3H) \
mistachkine37f7392016-07-28 19:28:35 +00001450 sqlite3ext.h \
shaneh6e7850c2011-06-17 15:57:07 +00001451 $(TOP)\src\sqliteInt.h \
shanehb2f20bf2011-06-17 07:07:24 +00001452 $(TOP)\src\sqliteLimit.h \
1453 $(TOP)\src\vdbe.h \
drhe54df422013-11-12 18:37:25 +00001454 $(TOP)\src\vdbeInt.h \
drh8cd5b252015-03-02 22:06:43 +00001455 $(TOP)\src\vxworks.h \
drhe54df422013-11-12 18:37:25 +00001456 $(TOP)\src\whereInt.h
shanehb2f20bf2011-06-17 07:07:24 +00001457
1458# Header files used by extensions
1459#
1460EXTHDR = $(EXTHDR) \
1461 $(TOP)\ext\fts1\fts1.h \
1462 $(TOP)\ext\fts1\fts1_hash.h \
1463 $(TOP)\ext\fts1\fts1_tokenizer.h
1464EXTHDR = $(EXTHDR) \
1465 $(TOP)\ext\fts2\fts2.h \
1466 $(TOP)\ext\fts2\fts2_hash.h \
1467 $(TOP)\ext\fts2\fts2_tokenizer.h
1468EXTHDR = $(EXTHDR) \
1469 $(TOP)\ext\fts3\fts3.h \
1470 $(TOP)\ext\fts3\fts3Int.h \
1471 $(TOP)\ext\fts3\fts3_hash.h \
1472 $(TOP)\ext\fts3\fts3_tokenizer.h
1473EXTHDR = $(EXTHDR) \
1474 $(TOP)\ext\rtree\rtree.h
1475EXTHDR = $(EXTHDR) \
1476 $(TOP)\ext\icu\sqliteicu.h
1477EXTHDR = $(EXTHDR) \
1478 $(TOP)\ext\rtree\sqlite3rtree.h
mistachkinadb96a62012-01-16 12:33:36 +00001479EXTHDR = $(EXTHDR) \
1480 $(TOP)\ext\session\sqlite3session.h
shanehb2f20bf2011-06-17 07:07:24 +00001481
mistachkind4ab1032015-05-11 16:27:33 +00001482# executables needed for testing
drhf4375442015-05-11 12:15:45 +00001483#
1484TESTPROGS = \
1485 testfixture.exe \
mistachkinedcb4eb2016-01-22 01:25:15 +00001486 $(SQLITE3EXE) \
drhf4375442015-05-11 12:15:45 +00001487 sqlite3_analyzer.exe \
drh290fcaa2016-06-08 01:03:05 +00001488 sqldiff.exe \
1489 dbhash.exe
drhf4375442015-05-11 12:15:45 +00001490
drhea93c702015-05-26 18:15:08 +00001491# Databases containing fuzzer test cases
1492#
1493FUZZDATA = \
1494 $(TOP)\test\fuzzdata1.db \
1495 $(TOP)\test\fuzzdata2.db \
drh64ff56f2015-09-23 11:59:50 +00001496 $(TOP)\test\fuzzdata3.db \
drh362b66f2016-11-14 18:27:41 +00001497 $(TOP)\test\fuzzdata4.db \
1498 $(TOP)\test\fuzzdata5.db
mistachkin3e786092016-01-23 07:53:04 +00001499# <</mark>>
drhea93c702015-05-26 18:15:08 +00001500
mistachkin5d4d9412016-01-22 03:54:36 +00001501# Additional compiler options for the shell. These are only effective
1502# when the shell is not being dynamically linked.
drhd7f2bea2015-09-19 14:32:51 +00001503#
mistachkin5d4d9412016-01-22 03:54:36 +00001504!IF $(DYNAMIC_SHELL)==0 && $(FOR_WIN10)==0
drh70ae0e92016-08-04 13:23:28 +00001505SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_SHELL_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS
mistachkinedcb4eb2016-01-22 01:25:15 +00001506!ENDIF
1507
mistachkin3e786092016-01-23 07:53:04 +00001508# <<mark>>
mistachkin5d4d9412016-01-22 03:54:36 +00001509# Extra compiler options for various test tools.
1510#
1511MPTESTER_COMPILE_OPTS = -DSQLITE_SHELL_JSON1 -DSQLITE_ENABLE_FTS5
mistachkin8381be42015-10-09 14:23:56 +00001512FUZZERSHELL_COMPILE_OPTS = -DSQLITE_ENABLE_JSON1
drha6bf20b2017-03-10 17:03:11 +00001513FUZZCHECK_COMPILE_OPTS = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMSYS5 -DSQLITE_OSS_FUZZ -DSQLITE_MAX_MEMORY=50000000
drh362b66f2016-11-14 18:27:41 +00001514FUZZCHECK_SRC = $(TOP)\test\fuzzcheck.c $(TOP)\test\ossfuzz.c
1515OSSSHELL_SRC = $(TOP)\test\ossshell.c $(TOP)\test\ossfuzz.c
mistachkin953fbd12017-02-07 21:09:34 +00001516DBFUZZ_COMPILE_OPTS = -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION
1517KV_COMPILE_OPTS = -DSQLITE_THREADSAFE=0 -DSQLITE_DIRECT_OVERFLOW_READ
1518DBSELFTEST_COMPILE_OPTS = -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5
1519ST_COMPILE_OPTS = -DSQLITE_THREADSAFE=0
drhf4375442015-05-11 12:15:45 +00001520
mistachkin5d4d9412016-01-22 03:54:36 +00001521# Standard options to testfixture.
drh905da632015-06-10 18:53:09 +00001522#
1523TESTOPTS = --verbose=file --output=test-out.txt
drhf4375442015-05-11 12:15:45 +00001524
mistachkind5be6f02016-01-27 07:28:33 +00001525# Extra targets for the "all" target that require Tcl.
1526#
1527!IF $(NO_TCL)==0
1528ALL_TCL_TARGETS = libtclsqlite3.lib
1529!ELSE
1530ALL_TCL_TARGETS =
1531!ENDIF
mistachkin3e786092016-01-23 07:53:04 +00001532# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001533
1534# This is the default Makefile target. The objects listed here
1535# are what get build when you type just "make" with no arguments.
1536#
mistachkind5be6f02016-01-27 07:28:33 +00001537all: dll libsqlite3.lib shell $(ALL_TCL_TARGETS)
shanehb2f20bf2011-06-17 07:07:24 +00001538
mistachkina8a18732016-01-22 22:16:50 +00001539# Dynamic link library section.
1540#
mistachkin9b88ace2016-02-26 21:01:37 +00001541dll: $(SQLITE3DLL)
mistachkina8a18732016-01-22 22:16:50 +00001542
1543# Shell executable.
1544#
mistachkin9b88ace2016-02-26 21:01:37 +00001545shell: $(SQLITE3EXE)
shanehb2f20bf2011-06-17 07:07:24 +00001546
mistachkinb0c99af2016-02-19 05:07:56 +00001547# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001548libsqlite3.lib: $(LIBOBJ)
shaneh29ebea82011-06-21 18:12:07 +00001549 $(LTLIB) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001550
1551libtclsqlite3.lib: tclsqlite.lo libsqlite3.lib
mistachkin5b663502015-10-10 23:39:55 +00001552 $(LTLIB) $(LTLIBOPTS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCLSTUB) $(TLIBS)
mistachkin3e786092016-01-23 07:53:04 +00001553# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001554
mistachkin9b88ace2016-02-26 21:01:37 +00001555$(SQLITE3DLL): $(LIBOBJ) $(LIBRESOBJS) $(CORE_LINK_DEP)
mistachkina8a18732016-01-22 22:16:50 +00001556 $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL $(CORE_LINK_OPTS) /OUT:$@ $(LIBOBJ) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001557
mistachkin9aeb9712016-02-26 23:13:16 +00001558# <<block2>>
mistachkin9b88ace2016-02-26 21:01:37 +00001559sqlite3.def: libsqlite3.lib
mistachkina8a18732016-01-22 22:16:50 +00001560 echo EXPORTS > sqlite3.def
1561 dumpbin /all libsqlite3.lib \
mistachkin953fbd12017-02-07 21:09:34 +00001562 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl include "^\s+1 _?(sqlite3(?:session|changeset)?_[^@]*)(?:@\d+)?$$" \1 \
mistachkina8a18732016-01-22 22:16:50 +00001563 | sort >> sqlite3.def
mistachkin9aeb9712016-02-26 23:13:16 +00001564# <</block2>>
drhd62c0f42015-04-09 13:34:29 +00001565
mistachkin5d4d9412016-01-22 03:54:36 +00001566$(SQLITE3EXE): $(TOP)\src\shell.c $(SHELL_CORE_DEP) $(LIBRESOBJS) $(SHELL_CORE_SRC) $(SQLITE3H)
1567 $(LTLINK) $(SHELL_COMPILE_OPTS) $(READLINE_FLAGS) $(TOP)\src\shell.c $(SHELL_CORE_SRC) \
mistachkinedcb4eb2016-01-22 01:25:15 +00001568 /link $(SQLITE3EXEPDB) $(LDFLAGS) $(LTLINKOPTS) $(SHELL_LINK_OPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS)
drh268e72f2015-04-17 14:30:49 +00001569
mistachkin3e786092016-01-23 07:53:04 +00001570# <<mark>>
mistachkin5d4d9412016-01-22 03:54:36 +00001571sqldiff.exe: $(TOP)\tool\sqldiff.c $(SQLITE3C) $(SQLITE3H)
1572 $(LTLINK) $(NO_WARN) $(TOP)\tool\sqldiff.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
mistachkin44723ce2015-03-21 02:22:37 +00001573
drh290fcaa2016-06-08 01:03:05 +00001574dbhash.exe: $(TOP)\tool\dbhash.c $(SQLITE3C) $(SQLITE3H)
1575 $(LTLINK) $(NO_WARN) $(TOP)\tool\dbhash.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
1576
drhda110bf2016-05-05 17:15:23 +00001577scrub.exe: $(TOP)\ext\misc\scrub.c $(SQLITE3C) $(SQLITE3H)
1578 $(LTLINK) $(NO_WARN) $(TOP)\ext\misc\scrub.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
1579
drhfd0d93f2016-02-07 00:08:08 +00001580srcck1.exe: $(TOP)\tool\srcck1.c
1581 $(BCC) $(NO_WARN) -Fe$@ $(TOP)\tool\srcck1.c
1582
1583sourcetest: srcck1.exe sqlite3.c
1584 srcck1.exe sqlite3.c
1585
mistachkin5d4d9412016-01-22 03:54:36 +00001586fuzzershell.exe: $(TOP)\tool\fuzzershell.c $(SQLITE3C) $(SQLITE3H)
1587 $(LTLINK) $(NO_WARN) $(FUZZERSHELL_COMPILE_OPTS) $(TOP)\tool\fuzzershell.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drhbc94dbb2013-04-08 14:28:33 +00001588
mistachkin953fbd12017-02-07 21:09:34 +00001589dbfuzz.exe: $(TOP)\test\dbfuzz.c $(SQLITE3C) $(SQLITE3H)
1590 $(LTLINK) $(NO_WARN) $(DBFUZZ_COMPILE_OPTS) $(TOP)\test\dbfuzz.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
1591
drh362b66f2016-11-14 18:27:41 +00001592fuzzcheck.exe: $(FUZZCHECK_SRC) $(SQLITE3C) $(SQLITE3H)
1593 $(LTLINK) $(NO_WARN) $(FUZZCHECK_COMPILE_OPTS) $(FUZZCHECK_SRC) $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
1594
1595ossshell.exe: $(OSSSHELL_SRC) $(SQLITE3C) $(SQLITE3H)
1596 $(LTLINK) $(NO_WARN) $(FUZZCHECK_COMPILE_OPTS) $(OSSSHELL_SRC) $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh1573dc32015-05-25 22:29:26 +00001597
mistachkin5d4d9412016-01-22 03:54:36 +00001598mptester.exe: $(TOP)\mptest\mptest.c $(SQLITE3C) $(SQLITE3H)
1599 $(LTLINK) $(NO_WARN) $(MPTESTER_COMPILE_OPTS) $(TOP)\mptest\mptest.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drhbc94dbb2013-04-08 14:28:33 +00001600
mistachkineb48b062015-03-31 17:45:44 +00001601MPTEST1 = mptester mptest.db $(TOP)\mptest\crash01.test --repeat 20
1602MPTEST2 = mptester mptest.db $(TOP)\mptest\multiwrite01.test --repeat 20
mistachkin4d2daba2015-03-31 16:42:16 +00001603
drhfe0ba712015-03-31 13:46:13 +00001604mptest: mptester.exe
mistachkin4d2daba2015-03-31 16:42:16 +00001605 del /Q mptest.db 2>NUL
drhfe0ba712015-03-31 13:46:13 +00001606 $(MPTEST1) --journalmode DELETE
1607 $(MPTEST2) --journalmode WAL
1608 $(MPTEST1) --journalmode WAL
1609 $(MPTEST2) --journalmode PERSIST
1610 $(MPTEST1) --journalmode PERSIST
1611 $(MPTEST2) --journalmode TRUNCATE
1612 $(MPTEST1) --journalmode TRUNCATE
1613 $(MPTEST2) --journalmode DELETE
1614
shanehb2f20bf2011-06-17 07:07:24 +00001615# This target creates a directory named "tsrc" and fills it with
1616# copies of all of the C source code and header files needed to
1617# build on the target system. Some of the C source code and header
1618# files are automatically generated. This target takes care of
1619# all that automatic generation.
1620#
mistachkin4ef916e2016-08-24 19:58:46 +00001621.target_source: $(SRC) $(TOP)\tool\vdbe-compress.tcl fts5.c $(SQLITE_TCL_DEP)
mistachkin44723ce2015-03-21 02:22:37 +00001622 -rmdir /Q/S tsrc 2>NUL
shanehb2f20bf2011-06-17 07:07:24 +00001623 -mkdir tsrc
mistachkine2eb2592016-02-11 21:38:05 +00001624 for %i in ($(SRC00)) do copy /Y %i tsrc
1625 for %i in ($(SRC01)) do copy /Y %i tsrc
1626 for %i in ($(SRC02)) do copy /Y %i tsrc
1627 for %i in ($(SRC03)) do copy /Y %i tsrc
1628 for %i in ($(SRC04)) do copy /Y %i tsrc
1629 for %i in ($(SRC05)) do copy /Y %i tsrc
1630 for %i in ($(SRC06)) do copy /Y %i tsrc
1631 for %i in ($(SRC07)) do copy /Y %i tsrc
1632 for %i in ($(SRC08)) do copy /Y %i tsrc
1633 for %i in ($(SRC09)) do copy /Y %i tsrc
1634 for %i in ($(SRC10)) do copy /Y %i tsrc
1635 for %i in ($(SRC11)) do copy /Y %i tsrc
mistachkin52b1dbb2016-07-28 14:37:04 +00001636 for %i in ($(SRC12)) do copy /Y %i tsrc
drh50065652015-10-08 19:29:18 +00001637 copy /Y fts5.c tsrc
1638 copy /Y fts5.h tsrc
mistachkin44723ce2015-03-21 02:22:37 +00001639 del /Q tsrc\sqlite.h.in tsrc\parse.y 2>NUL
drh2dc06482013-12-11 00:59:10 +00001640 $(TCLSH_CMD) $(TOP)\tool\vdbe-compress.tcl $(OPTS) < tsrc\vdbe.c > vdbe.new
shanehb2f20bf2011-06-17 07:07:24 +00001641 move vdbe.new tsrc\vdbe.c
1642 echo > .target_source
1643
mistachkin4ef916e2016-08-24 19:58:46 +00001644sqlite3.c: .target_source sqlite3ext.h $(MKSQLITE3C_TOOL)
1645 $(TCLSH_CMD) $(MKSQLITE3C_TOOL) $(MKSQLITE3C_ARGS)
drhe191e2c2013-03-19 15:23:18 +00001646 copy tsrc\shell.c .
drhe191e2c2013-03-19 15:23:18 +00001647 copy $(TOP)\ext\session\sqlite3session.h .
shanehb2f20bf2011-06-17 07:07:24 +00001648
mistachkin48dd9de2012-12-06 04:33:13 +00001649sqlite3-all.c: sqlite3.c $(TOP)\tool\split-sqlite3c.tcl
1650 $(TCLSH_CMD) $(TOP)\tool\split-sqlite3c.tcl
mistachkin3e786092016-01-23 07:53:04 +00001651# <</mark>>
mistachkin76510912013-10-11 23:01:18 +00001652
shanehb2f20bf2011-06-17 07:07:24 +00001653# Rule to build the amalgamation
1654#
mistachkin76510912013-10-11 23:01:18 +00001655sqlite3.lo: $(SQLITE3C)
mistachkin44723ce2015-03-21 02:22:37 +00001656 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(SQLITE3C)
shanehb2f20bf2011-06-17 07:07:24 +00001657
mistachkin3e786092016-01-23 07:53:04 +00001658# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001659# Rules to build the LEMON compiler generator
1660#
drh82415f22015-11-09 19:33:42 +00001661lempar.c: $(TOP)\tool\lempar.c
1662 copy $(TOP)\tool\lempar.c .
shanehb2f20bf2011-06-17 07:07:24 +00001663
1664lemon.exe: $(TOP)\tool\lemon.c lempar.c
mistachkin2318d332015-01-12 18:02:52 +00001665 $(BCC) $(NO_WARN) -Daccess=_access \
mistachkin460cd9c2015-10-14 22:46:37 +00001666 -Fe$@ $(TOP)\tool\lemon.c /link $(LDFLAGS) $(NLTLINKOPTS) $(NLTLIBPATHS)
shanehb2f20bf2011-06-17 07:07:24 +00001667
1668# Rules to build individual *.lo files from generated *.c files. This
1669# applies to:
1670#
1671# parse.lo
1672# opcodes.lo
1673#
1674parse.lo: parse.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001675 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c parse.c
shanehb2f20bf2011-06-17 07:07:24 +00001676
1677opcodes.lo: opcodes.c
mistachkin44723ce2015-03-21 02:22:37 +00001678 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c opcodes.c
mistachkin3e786092016-01-23 07:53:04 +00001679# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001680
mistachkin4d9d1f42012-09-03 10:32:32 +00001681# Rule to build the Win32 resources object file.
1682#
mistachkin08c1c312012-10-06 03:48:25 +00001683!IF $(USE_RC)!=0
mistachkin3e786092016-01-23 07:53:04 +00001684# <<block1>>
mistachkina8a18732016-01-22 22:16:50 +00001685$(LIBRESOBJS): $(TOP)\src\sqlite3.rc $(SQLITE3H)
mistachkin4d9d1f42012-09-03 10:32:32 +00001686 echo #ifndef SQLITE_RESOURCE_VERSION > sqlite3rc.h
mistachkin8ccc6d42012-09-27 21:03:53 +00001687 for /F %%V in ('type "$(TOP)\VERSION"') do ( \
mistachkin4d9d1f42012-09-03 10:32:32 +00001688 echo #define SQLITE_RESOURCE_VERSION %%V \
mistachkin946ef602015-10-10 01:55:57 +00001689 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact . ^, >> sqlite3rc.h \
mistachkin4d9d1f42012-09-03 10:32:32 +00001690 )
1691 echo #endif >> sqlite3rc.h
mistachkin08c1c312012-10-06 03:48:25 +00001692 $(LTRCOMPILE) -fo $(LIBRESOBJS) $(TOP)\src\sqlite3.rc
mistachkin3e786092016-01-23 07:53:04 +00001693# <</block1>>
mistachkin08c1c312012-10-06 03:48:25 +00001694!ENDIF
mistachkin4d9d1f42012-09-03 10:32:32 +00001695
mistachkin3e786092016-01-23 07:53:04 +00001696# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001697# Rules to build individual *.lo files from files in the src directory.
1698#
1699alter.lo: $(TOP)\src\alter.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001700 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\alter.c
shanehb2f20bf2011-06-17 07:07:24 +00001701
1702analyze.lo: $(TOP)\src\analyze.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001703 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\analyze.c
shanehb2f20bf2011-06-17 07:07:24 +00001704
1705attach.lo: $(TOP)\src\attach.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001706 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\attach.c
shanehb2f20bf2011-06-17 07:07:24 +00001707
1708auth.lo: $(TOP)\src\auth.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001709 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\auth.c
shanehb2f20bf2011-06-17 07:07:24 +00001710
1711backup.lo: $(TOP)\src\backup.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001712 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\backup.c
shanehb2f20bf2011-06-17 07:07:24 +00001713
1714bitvec.lo: $(TOP)\src\bitvec.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001715 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\bitvec.c
shanehb2f20bf2011-06-17 07:07:24 +00001716
1717btmutex.lo: $(TOP)\src\btmutex.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001718 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\btmutex.c
shanehb2f20bf2011-06-17 07:07:24 +00001719
1720btree.lo: $(TOP)\src\btree.c $(HDR) $(TOP)\src\pager.h
mistachkin44723ce2015-03-21 02:22:37 +00001721 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\btree.c
shanehb2f20bf2011-06-17 07:07:24 +00001722
1723build.lo: $(TOP)\src\build.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001724 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\build.c
shanehb2f20bf2011-06-17 07:07:24 +00001725
1726callback.lo: $(TOP)\src\callback.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001727 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\callback.c
shanehb2f20bf2011-06-17 07:07:24 +00001728
1729complete.lo: $(TOP)\src\complete.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001730 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\complete.c
shanehb2f20bf2011-06-17 07:07:24 +00001731
1732ctime.lo: $(TOP)\src\ctime.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001733 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\ctime.c
shanehb2f20bf2011-06-17 07:07:24 +00001734
1735date.lo: $(TOP)\src\date.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001736 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\date.c
shanehb2f20bf2011-06-17 07:07:24 +00001737
drh1a4a6802015-05-04 18:31:09 +00001738dbstat.lo: $(TOP)\src\date.c $(HDR)
1739 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\dbstat.c
1740
shanehb2f20bf2011-06-17 07:07:24 +00001741delete.lo: $(TOP)\src\delete.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001742 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\delete.c
shanehb2f20bf2011-06-17 07:07:24 +00001743
1744expr.lo: $(TOP)\src\expr.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001745 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\expr.c
shanehb2f20bf2011-06-17 07:07:24 +00001746
1747fault.lo: $(TOP)\src\fault.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001748 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\fault.c
shanehb2f20bf2011-06-17 07:07:24 +00001749
1750fkey.lo: $(TOP)\src\fkey.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001751 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\fkey.c
shanehb2f20bf2011-06-17 07:07:24 +00001752
1753func.lo: $(TOP)\src\func.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001754 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\func.c
shanehb2f20bf2011-06-17 07:07:24 +00001755
1756global.lo: $(TOP)\src\global.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001757 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\global.c
shanehb2f20bf2011-06-17 07:07:24 +00001758
1759hash.lo: $(TOP)\src\hash.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001760 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\hash.c
shanehb2f20bf2011-06-17 07:07:24 +00001761
1762insert.lo: $(TOP)\src\insert.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001763 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\insert.c
shanehb2f20bf2011-06-17 07:07:24 +00001764
shanehb2f20bf2011-06-17 07:07:24 +00001765legacy.lo: $(TOP)\src\legacy.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001766 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\legacy.c
shanehb2f20bf2011-06-17 07:07:24 +00001767
1768loadext.lo: $(TOP)\src\loadext.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001769 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\loadext.c
shanehb2f20bf2011-06-17 07:07:24 +00001770
1771main.lo: $(TOP)\src\main.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001772 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\main.c
shanehb2f20bf2011-06-17 07:07:24 +00001773
1774malloc.lo: $(TOP)\src\malloc.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001775 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\malloc.c
shanehb2f20bf2011-06-17 07:07:24 +00001776
1777mem0.lo: $(TOP)\src\mem0.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001778 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem0.c
shanehb2f20bf2011-06-17 07:07:24 +00001779
1780mem1.lo: $(TOP)\src\mem1.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001781 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem1.c
shanehb2f20bf2011-06-17 07:07:24 +00001782
1783mem2.lo: $(TOP)\src\mem2.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001784 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem2.c
shanehb2f20bf2011-06-17 07:07:24 +00001785
1786mem3.lo: $(TOP)\src\mem3.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001787 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem3.c
shanehb2f20bf2011-06-17 07:07:24 +00001788
1789mem5.lo: $(TOP)\src\mem5.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001790 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem5.c
shanehb2f20bf2011-06-17 07:07:24 +00001791
1792memjournal.lo: $(TOP)\src\memjournal.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001793 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\memjournal.c
shanehb2f20bf2011-06-17 07:07:24 +00001794
1795mutex.lo: $(TOP)\src\mutex.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001796 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex.c
shanehb2f20bf2011-06-17 07:07:24 +00001797
1798mutex_noop.lo: $(TOP)\src\mutex_noop.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001799 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex_noop.c
shanehb2f20bf2011-06-17 07:07:24 +00001800
shanehb2f20bf2011-06-17 07:07:24 +00001801mutex_unix.lo: $(TOP)\src\mutex_unix.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001802 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex_unix.c
shanehb2f20bf2011-06-17 07:07:24 +00001803
1804mutex_w32.lo: $(TOP)\src\mutex_w32.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001805 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex_w32.c
shanehb2f20bf2011-06-17 07:07:24 +00001806
1807notify.lo: $(TOP)\src\notify.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001808 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\notify.c
shanehb2f20bf2011-06-17 07:07:24 +00001809
1810pager.lo: $(TOP)\src\pager.c $(HDR) $(TOP)\src\pager.h
mistachkin44723ce2015-03-21 02:22:37 +00001811 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pager.c
shanehb2f20bf2011-06-17 07:07:24 +00001812
1813pcache.lo: $(TOP)\src\pcache.c $(HDR) $(TOP)\src\pcache.h
mistachkin44723ce2015-03-21 02:22:37 +00001814 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pcache.c
shanehb2f20bf2011-06-17 07:07:24 +00001815
1816pcache1.lo: $(TOP)\src\pcache1.c $(HDR) $(TOP)\src\pcache.h
mistachkin44723ce2015-03-21 02:22:37 +00001817 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pcache1.c
shanehb2f20bf2011-06-17 07:07:24 +00001818
1819os.lo: $(TOP)\src\os.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001820 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\os.c
shanehb2f20bf2011-06-17 07:07:24 +00001821
1822os_unix.lo: $(TOP)\src\os_unix.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001823 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\os_unix.c
shanehb2f20bf2011-06-17 07:07:24 +00001824
1825os_win.lo: $(TOP)\src\os_win.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001826 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\os_win.c
shanehb2f20bf2011-06-17 07:07:24 +00001827
shanehb2f20bf2011-06-17 07:07:24 +00001828pragma.lo: $(TOP)\src\pragma.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001829 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pragma.c
shanehb2f20bf2011-06-17 07:07:24 +00001830
1831prepare.lo: $(TOP)\src\prepare.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001832 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\prepare.c
shanehb2f20bf2011-06-17 07:07:24 +00001833
1834printf.lo: $(TOP)\src\printf.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001835 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\printf.c
shanehb2f20bf2011-06-17 07:07:24 +00001836
1837random.lo: $(TOP)\src\random.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001838 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\random.c
shanehb2f20bf2011-06-17 07:07:24 +00001839
1840resolve.lo: $(TOP)\src\resolve.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001841 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\resolve.c
shanehb2f20bf2011-06-17 07:07:24 +00001842
1843rowset.lo: $(TOP)\src\rowset.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001844 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\rowset.c
shanehb2f20bf2011-06-17 07:07:24 +00001845
1846select.lo: $(TOP)\src\select.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001847 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\select.c
shanehb2f20bf2011-06-17 07:07:24 +00001848
1849status.lo: $(TOP)\src\status.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001850 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\status.c
shanehb2f20bf2011-06-17 07:07:24 +00001851
1852table.lo: $(TOP)\src\table.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001853 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\table.c
shanehb2f20bf2011-06-17 07:07:24 +00001854
drhf51446a2012-07-21 19:40:42 +00001855threads.lo: $(TOP)\src\threads.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001856 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\threads.c
drhf51446a2012-07-21 19:40:42 +00001857
shanehb2f20bf2011-06-17 07:07:24 +00001858tokenize.lo: $(TOP)\src\tokenize.c keywordhash.h $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001859 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\tokenize.c
shanehb2f20bf2011-06-17 07:07:24 +00001860
drh38b41492015-06-08 15:08:15 +00001861treeview.lo: $(TOP)\src\treeview.c $(HDR)
1862 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\treeview.c
1863
shanehb2f20bf2011-06-17 07:07:24 +00001864trigger.lo: $(TOP)\src\trigger.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001865 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\trigger.c
shanehb2f20bf2011-06-17 07:07:24 +00001866
1867update.lo: $(TOP)\src\update.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001868 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\update.c
shanehb2f20bf2011-06-17 07:07:24 +00001869
1870utf.lo: $(TOP)\src\utf.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001871 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\utf.c
shanehb2f20bf2011-06-17 07:07:24 +00001872
1873util.lo: $(TOP)\src\util.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001874 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\util.c
shanehb2f20bf2011-06-17 07:07:24 +00001875
1876vacuum.lo: $(TOP)\src\vacuum.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001877 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vacuum.c
shanehb2f20bf2011-06-17 07:07:24 +00001878
1879vdbe.lo: $(TOP)\src\vdbe.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001880 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbe.c
shanehb2f20bf2011-06-17 07:07:24 +00001881
1882vdbeapi.lo: $(TOP)\src\vdbeapi.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001883 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbeapi.c
shanehb2f20bf2011-06-17 07:07:24 +00001884
1885vdbeaux.lo: $(TOP)\src\vdbeaux.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001886 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbeaux.c
shanehb2f20bf2011-06-17 07:07:24 +00001887
1888vdbeblob.lo: $(TOP)\src\vdbeblob.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001889 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbeblob.c
shanehb2f20bf2011-06-17 07:07:24 +00001890
1891vdbemem.lo: $(TOP)\src\vdbemem.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001892 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbemem.c
shanehb2f20bf2011-06-17 07:07:24 +00001893
mistachkin81c428a2011-08-17 02:19:54 +00001894vdbesort.lo: $(TOP)\src\vdbesort.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001895 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbesort.c
mistachkin81c428a2011-08-17 02:19:54 +00001896
shanehb2f20bf2011-06-17 07:07:24 +00001897vdbetrace.lo: $(TOP)\src\vdbetrace.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001898 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbetrace.c
shanehb2f20bf2011-06-17 07:07:24 +00001899
1900vtab.lo: $(TOP)\src\vtab.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001901 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vtab.c
shanehb2f20bf2011-06-17 07:07:24 +00001902
1903wal.lo: $(TOP)\src\wal.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001904 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\wal.c
shanehb2f20bf2011-06-17 07:07:24 +00001905
1906walker.lo: $(TOP)\src\walker.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001907 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\walker.c
shanehb2f20bf2011-06-17 07:07:24 +00001908
1909where.lo: $(TOP)\src\where.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001910 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\where.c
shanehb2f20bf2011-06-17 07:07:24 +00001911
drh6f82e852015-06-06 20:12:09 +00001912wherecode.lo: $(TOP)\src\wherecode.c $(HDR)
1913 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\wherecode.c
1914
drh6c1f4ef2015-06-08 14:23:15 +00001915whereexpr.lo: $(TOP)\src\whereexpr.c $(HDR)
1916 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\whereexpr.c
1917
mistachkin4ef916e2016-08-24 19:58:46 +00001918tclsqlite.lo: $(TOP)\src\tclsqlite.c $(HDR) $(SQLITE_TCL_DEP)
mistachkin44723ce2015-03-21 02:22:37 +00001919 $(LTCOMPILE) $(NO_WARN) -DUSE_TCL_STUBS=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c
shanehb2f20bf2011-06-17 07:07:24 +00001920
mistachkin4ef916e2016-08-24 19:58:46 +00001921tclsqlite-shell.lo: $(TOP)\src\tclsqlite.c $(HDR) $(SQLITE_TCL_DEP)
mistachkin44723ce2015-03-21 02:22:37 +00001922 $(LTCOMPILE) $(NO_WARN) -DTCLSH=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c
shanehb2f20bf2011-06-17 07:07:24 +00001923
mistachkin5d4d9412016-01-22 03:54:36 +00001924tclsqlite3.exe: tclsqlite-shell.lo $(SQLITE3C) $(SQLITE3H) $(LIBRESOBJS)
mistachkin78e3f612015-10-14 20:01:12 +00001925 $(LTLINK) $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /OUT:$@ tclsqlite-shell.lo $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001926
1927# Rules to build opcodes.c and opcodes.h
1928#
drh7651e0a2015-10-07 12:11:36 +00001929opcodes.c: opcodes.h $(TOP)\tool\mkopcodec.tcl
1930 $(TCLSH_CMD) $(TOP)\tool\mkopcodec.tcl opcodes.h > opcodes.c
shanehb2f20bf2011-06-17 07:07:24 +00001931
drhb15393b2015-10-07 02:52:09 +00001932opcodes.h: parse.h $(TOP)\src\vdbe.c $(TOP)\tool\mkopcodeh.tcl
mistachkin946ef602015-10-10 01:55:57 +00001933 type parse.h $(TOP)\src\vdbe.c | $(TCLSH_CMD) $(TOP)\tool\mkopcodeh.tcl > opcodes.h
shanehb2f20bf2011-06-17 07:07:24 +00001934
1935# Rules to build parse.c and parse.h - the outputs of lemon.
1936#
1937parse.h: parse.c
1938
drh60a15a42015-10-07 12:21:14 +00001939parse.c: $(TOP)\src\parse.y lemon.exe $(TOP)\tool\addopcodes.tcl
mistachkin44723ce2015-03-21 02:22:37 +00001940 del /Q parse.y parse.h parse.h.temp 2>NUL
shanehb2f20bf2011-06-17 07:07:24 +00001941 copy $(TOP)\src\parse.y .
mistachkinedcb4eb2016-01-22 01:25:15 +00001942 .\lemon.exe $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) $(OPTS) parse.y
shanehb2f20bf2011-06-17 07:07:24 +00001943 move parse.h parse.h.temp
drh60a15a42015-10-07 12:21:14 +00001944 $(TCLSH_CMD) $(TOP)\tool\addopcodes.tcl parse.h.temp > parse.h
shanehb2f20bf2011-06-17 07:07:24 +00001945
mistachkin5d4d9412016-01-22 03:54:36 +00001946$(SQLITE3H): $(TOP)\src\sqlite.h.in $(TOP)\manifest.uuid $(TOP)\VERSION
mistachkin4ef916e2016-08-24 19:58:46 +00001947 $(TCLSH_CMD) $(TOP)\tool\mksqlite3h.tcl $(TOP:\=/) > $(SQLITE3H) $(MKSQLITE3H_ARGS)
shanehb2f20bf2011-06-17 07:07:24 +00001948
mistachkin9b88ace2016-02-26 21:01:37 +00001949sqlite3ext.h: .target_source
mistachkin4ef916e2016-08-24 19:58:46 +00001950!IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
mistachkinc0bebc12016-07-28 18:49:20 +00001951 type tsrc\sqlite3ext.h | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "\(\*\)" "(SQLITE_CALLBACK *)" \
1952 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "\(\*" "(SQLITE_APICALL *" > sqlite3ext.h
mistachkine37f7392016-07-28 19:28:35 +00001953 copy /Y sqlite3ext.h tsrc\sqlite3ext.h
mistachkin4ef916e2016-08-24 19:58:46 +00001954!ELSE
1955 copy /Y tsrc\sqlite3ext.h sqlite3ext.h
1956!ENDIF
mistachkinc978f2d2015-09-21 23:49:35 +00001957
shanehb2f20bf2011-06-17 07:07:24 +00001958mkkeywordhash.exe: $(TOP)\tool\mkkeywordhash.c
mistachkinedcb4eb2016-01-22 01:25:15 +00001959 $(BCC) $(NO_WARN) -Fe$@ $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) $(OPTS) \
mistachkin460cd9c2015-10-14 22:46:37 +00001960 $(TOP)\tool\mkkeywordhash.c /link $(LDFLAGS) $(NLTLINKOPTS) $(NLTLIBPATHS)
shanehb2f20bf2011-06-17 07:07:24 +00001961
1962keywordhash.h: $(TOP)\tool\mkkeywordhash.c mkkeywordhash.exe
mistachkin5b0b6fd2011-06-25 01:14:36 +00001963 .\mkkeywordhash.exe > keywordhash.h
shanehb2f20bf2011-06-17 07:07:24 +00001964
1965
1966
1967# Rules to build the extension objects.
1968#
1969icu.lo: $(TOP)\ext\icu\icu.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001970 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\icu\icu.c
shanehb2f20bf2011-06-17 07:07:24 +00001971
1972fts2.lo: $(TOP)\ext\fts2\fts2.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001973 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2.c
shanehb2f20bf2011-06-17 07:07:24 +00001974
1975fts2_hash.lo: $(TOP)\ext\fts2\fts2_hash.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001976 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_hash.c
shanehb2f20bf2011-06-17 07:07:24 +00001977
1978fts2_icu.lo: $(TOP)\ext\fts2\fts2_icu.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001979 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_icu.c
shanehb2f20bf2011-06-17 07:07:24 +00001980
1981fts2_porter.lo: $(TOP)\ext\fts2\fts2_porter.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001982 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_porter.c
shanehb2f20bf2011-06-17 07:07:24 +00001983
1984fts2_tokenizer.lo: $(TOP)\ext\fts2\fts2_tokenizer.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001985 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_tokenizer.c
shanehb2f20bf2011-06-17 07:07:24 +00001986
1987fts2_tokenizer1.lo: $(TOP)\ext\fts2\fts2_tokenizer1.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001988 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_tokenizer1.c
shanehb2f20bf2011-06-17 07:07:24 +00001989
1990fts3.lo: $(TOP)\ext\fts3\fts3.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001991 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3.c
shanehb2f20bf2011-06-17 07:07:24 +00001992
1993fts3_aux.lo: $(TOP)\ext\fts3\fts3_aux.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001994 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_aux.c
shanehb2f20bf2011-06-17 07:07:24 +00001995
1996fts3_expr.lo: $(TOP)\ext\fts3\fts3_expr.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001997 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_expr.c
shanehb2f20bf2011-06-17 07:07:24 +00001998
1999fts3_hash.lo: $(TOP)\ext\fts3\fts3_hash.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002000 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_hash.c
shanehb2f20bf2011-06-17 07:07:24 +00002001
2002fts3_icu.lo: $(TOP)\ext\fts3\fts3_icu.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002003 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_icu.c
shanehb2f20bf2011-06-17 07:07:24 +00002004
2005fts3_snippet.lo: $(TOP)\ext\fts3\fts3_snippet.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002006 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_snippet.c
shanehb2f20bf2011-06-17 07:07:24 +00002007
2008fts3_porter.lo: $(TOP)\ext\fts3\fts3_porter.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002009 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_porter.c
shanehb2f20bf2011-06-17 07:07:24 +00002010
2011fts3_tokenizer.lo: $(TOP)\ext\fts3\fts3_tokenizer.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002012 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenizer.c
shanehb2f20bf2011-06-17 07:07:24 +00002013
2014fts3_tokenizer1.lo: $(TOP)\ext\fts3\fts3_tokenizer1.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002015 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenizer1.c
shanehb2f20bf2011-06-17 07:07:24 +00002016
drh4d648c72013-04-22 17:07:56 +00002017fts3_tokenize_vtab.lo: $(TOP)\ext\fts3\fts3_tokenize_vtab.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002018 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenize_vtab.c
drh4d648c72013-04-22 17:07:56 +00002019
drh391d4ba2012-05-28 20:22:16 +00002020fts3_unicode.lo: $(TOP)\ext\fts3\fts3_unicode.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002021 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_unicode.c
drh391d4ba2012-05-28 20:22:16 +00002022
2023fts3_unicode2.lo: $(TOP)\ext\fts3\fts3_unicode2.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002024 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_unicode2.c
drh391d4ba2012-05-28 20:22:16 +00002025
shanehb2f20bf2011-06-17 07:07:24 +00002026fts3_write.lo: $(TOP)\ext\fts3\fts3_write.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002027 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_write.c
shanehb2f20bf2011-06-17 07:07:24 +00002028
2029rtree.lo: $(TOP)\ext\rtree\rtree.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002030 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\rtree\rtree.c
shanehb2f20bf2011-06-17 07:07:24 +00002031
mistachkin4f2c8222016-04-11 22:23:04 +00002032sqlite3session.lo: $(TOP)\ext\session\sqlite3session.c $(HDR) $(EXTHDR)
mistachkin05004782016-03-30 16:23:06 +00002033 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\session\sqlite3session.c
drh498dcae2013-03-13 11:42:00 +00002034
mistachkined52f9f2015-06-26 04:34:36 +00002035# FTS5 things
2036#
2037FTS5_SRC = \
2038 $(TOP)\ext\fts5\fts5.h \
2039 $(TOP)\ext\fts5\fts5Int.h \
2040 $(TOP)\ext\fts5\fts5_aux.c \
2041 $(TOP)\ext\fts5\fts5_buffer.c \
2042 $(TOP)\ext\fts5\fts5_main.c \
2043 $(TOP)\ext\fts5\fts5_config.c \
2044 $(TOP)\ext\fts5\fts5_expr.c \
2045 $(TOP)\ext\fts5\fts5_hash.c \
2046 $(TOP)\ext\fts5\fts5_index.c \
2047 fts5parse.c fts5parse.h \
2048 $(TOP)\ext\fts5\fts5_storage.c \
2049 $(TOP)\ext\fts5\fts5_tokenize.c \
2050 $(TOP)\ext\fts5\fts5_unicode2.c \
2051 $(TOP)\ext\fts5\fts5_varint.c \
2052 $(TOP)\ext\fts5\fts5_vocab.c
2053
2054fts5parse.c: $(TOP)\ext\fts5\fts5parse.y lemon.exe
2055 copy $(TOP)\ext\fts5\fts5parse.y .
2056 del /Q fts5parse.h 2>NUL
mistachkinedcb4eb2016-01-22 01:25:15 +00002057 .\lemon.exe $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) $(OPTS) fts5parse.y
mistachkined52f9f2015-06-26 04:34:36 +00002058
mistachkin9b88ace2016-02-26 21:01:37 +00002059fts5parse.h: fts5parse.c
mistachkined52f9f2015-06-26 04:34:36 +00002060
mistachkin9b88ace2016-02-26 21:01:37 +00002061fts5.c: $(FTS5_SRC)
mistachkined52f9f2015-06-26 04:34:36 +00002062 $(TCLSH_CMD) $(TOP)\ext\fts5\tool\mkfts5c.tcl
dana153bbc2015-07-02 20:12:34 +00002063 copy $(TOP)\ext\fts5\fts5.h .
mistachkined52f9f2015-06-26 04:34:36 +00002064
2065fts5.lo: fts5.c $(HDR) $(EXTHDR)
mistachkin95ae9582015-06-26 20:45:43 +00002066 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c fts5.c
2067
2068fts5_ext.lo: fts5.c $(HDR) $(EXTHDR)
mistachkinae6ca8e2015-07-02 16:50:43 +00002069 $(LTCOMPILE) $(NO_WARN) -c fts5.c
shanehb2f20bf2011-06-17 07:07:24 +00002070
mistachkin95ae9582015-06-26 20:45:43 +00002071fts5.dll: fts5_ext.lo
2072 $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /OUT:$@ fts5_ext.lo
shanehb2f20bf2011-06-17 07:07:24 +00002073
mistachkin83a22532016-01-14 18:01:16 +00002074sqlite3rbu.lo: $(TOP)\ext\rbu\sqlite3rbu.c $(HDR) $(EXTHDR)
2075 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\rbu\sqlite3rbu.c
drh76473772016-01-14 13:22:24 +00002076
shanehb2f20bf2011-06-17 07:07:24 +00002077# Rules to build the 'testfixture' application.
2078#
2079# If using the amalgamation, use sqlite3.c directly to build the test
2080# fixture. Otherwise link against libsqlite3.lib. (This distinction is
2081# necessary because the test fixture requires non-API symbols which are
2082# hidden when the library is built via the amalgamation).
2083#
2084TESTFIXTURE_FLAGS = -DTCLSH=1 -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
mistachkin27b2f052015-01-12 19:49:46 +00002085TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_SERVER=1 -DSQLITE_PRIVATE=""
2086TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_CORE $(NO_WARN)
drhdbc49162016-03-02 03:28:07 +00002087TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_SERIES_CONSTRAINT_VERIFY=1
drh9878fef2016-03-04 03:43:10 +00002088TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_DEFAULT_PAGE_SIZE=1024
mistachkin69def7f2016-07-28 04:14:37 +00002089TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) $(TEST_CCONV_OPTS)
shanehb2f20bf2011-06-17 07:07:24 +00002090
mistachkinc04c54b2016-02-11 21:28:16 +00002091TESTFIXTURE_SRC0 = $(TESTEXT) $(TESTSRC2)
mistachkin05004782016-03-30 16:23:06 +00002092TESTFIXTURE_SRC1 = $(TESTEXT) $(SQLITE3C)
shanehb2f20bf2011-06-17 07:07:24 +00002093!IF $(USE_AMALGAMATION)==0
2094TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC0)
2095!ELSE
2096TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC1)
2097!ENDIF
2098
mistachkin4ef916e2016-08-24 19:58:46 +00002099!IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
mistachkin52b1dbb2016-07-28 14:37:04 +00002100sqlite_tclDecls.h:
mistachkin4ef916e2016-08-24 19:58:46 +00002101 echo #ifndef SQLITE_TCLAPI > $(SQLITETCLDECLSH)
2102 echo # define SQLITE_TCLAPI >> $(SQLITETCLDECLSH)
2103 echo #endif >> $(SQLITETCLDECLSH)
mistachkinf27a80c2016-07-28 16:09:52 +00002104 type "$(TCLINCDIR)\tclDecls.h" \
mistachkina121cc72016-07-28 18:06:52 +00002105 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "^(EXTERN(?: CONST\d+?)?\s+?[^\(]*?\s+?)Tcl_" "\1 SQLITE_TCLAPI Tcl_" \
mistachkinf27a80c2016-07-28 16:09:52 +00002106 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "^(EXTERN\s+?(?:void|VOID)\s+?)TclFreeObj" "\1 SQLITE_TCLAPI TclFreeObj" \
2107 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "\(\*tcl_" "(SQLITE_TCLAPI *tcl_" \
mistachkin7c60b262016-07-28 18:18:53 +00002108 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "\(\*tclFreeObj" "(SQLITE_TCLAPI *tclFreeObj" \
mistachkin4ef916e2016-08-24 19:58:46 +00002109 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "\(\*" "(SQLITE_TCLAPI *" >> $(SQLITETCLDECLSH)
mistachkin52b1dbb2016-07-28 14:37:04 +00002110
mistachkin4ef916e2016-08-24 19:58:46 +00002111sqlite_tcl.h:
mistachkinf27a80c2016-07-28 16:09:52 +00002112 type "$(TCLINCDIR)\tcl.h" | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact tclDecls.h sqlite_tclDecls.h \
2113 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "typedef (.*?)\(Tcl_" "typedef \1 (SQLITE_TCLAPI Tcl_" \
2114 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact "void (*freeProc)" "void (SQLITE_TCLAPI *freeProc)" \
2115 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact "Tcl_HashEntry *(*findProc)" "Tcl_HashEntry *(SQLITE_TCLAPI *findProc)" \
mistachkin4ef916e2016-08-24 19:58:46 +00002116 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact "Tcl_HashEntry *(*createProc)" "Tcl_HashEntry *(SQLITE_TCLAPI *createProc)" >> $(SQLITETCLH)
2117!ENDIF
mistachkin52b1dbb2016-07-28 14:37:04 +00002118
mistachkin4ef916e2016-08-24 19:58:46 +00002119testfixture.exe: $(TESTFIXTURE_SRC) $(SQLITE3H) $(LIBRESOBJS) $(HDR) $(SQLITE_TCL_DEP)
shaneh6e7850c2011-06-17 15:57:07 +00002120 $(LTLINK) -DSQLITE_NO_SYNC=1 $(TESTFIXTURE_FLAGS) \
shanehb2f20bf2011-06-17 07:07:24 +00002121 -DBUILD_sqlite -I$(TCLINCDIR) \
shaneh2a0b9ef2011-06-20 20:52:32 +00002122 $(TESTFIXTURE_SRC) \
mistachkin78e3f612015-10-14 20:01:12 +00002123 /link $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00002124
mistachkin9b88ace2016-02-26 21:01:37 +00002125extensiontest: testfixture.exe testloadext.dll
mistachkin88739962015-10-14 23:04:08 +00002126 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00002127 .\testfixture.exe $(TOP)\test\loadext.test $(TESTOPTS)
mistachkin1925a2e2014-02-24 21:20:25 +00002128
drhf4375442015-05-11 12:15:45 +00002129fulltest: $(TESTPROGS) fuzztest
mistachkin88739962015-10-14 23:04:08 +00002130 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00002131 .\testfixture.exe $(TOP)\test\all.test $(TESTOPTS)
shanehb2f20bf2011-06-17 07:07:24 +00002132
drhea93c702015-05-26 18:15:08 +00002133soaktest: $(TESTPROGS)
mistachkin88739962015-10-14 23:04:08 +00002134 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00002135 .\testfixture.exe $(TOP)\test\all.test -soak=1 $(TESTOPTS)
shanehb2f20bf2011-06-17 07:07:24 +00002136
drhf4375442015-05-11 12:15:45 +00002137fulltestonly: $(TESTPROGS) fuzztest
mistachkin88739962015-10-14 23:04:08 +00002138 @set PATH=$(LIBTCLPATH);$(PATH)
mistachkinc60941f2012-09-13 01:51:02 +00002139 .\testfixture.exe $(TOP)\test\full.test
2140
mistachkinedcb4eb2016-01-22 01:25:15 +00002141queryplantest: testfixture.exe shell
mistachkin88739962015-10-14 23:04:08 +00002142 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00002143 .\testfixture.exe $(TOP)\test\permutations.test queryplanner $(TESTOPTS)
mistachkin036acf32013-07-20 00:34:31 +00002144
drhea93c702015-05-26 18:15:08 +00002145fuzztest: fuzzcheck.exe
2146 .\fuzzcheck.exe $(FUZZDATA)
drhf3320712015-04-25 13:39:29 +00002147
drha523e312015-07-24 17:26:13 +00002148fastfuzztest: fuzzcheck.exe
drh53e66c32015-07-24 15:49:23 +00002149 .\fuzzcheck.exe --limit-mem 100M $(FUZZDATA)
shanehb2f20bf2011-06-17 07:07:24 +00002150
drh905da632015-06-10 18:53:09 +00002151# Minimal testing that runs in less than 3 minutes (on a fast machine)
2152#
drhfd0d93f2016-02-07 00:08:08 +00002153quicktest: testfixture.exe sourcetest
mistachkin88739962015-10-14 23:04:08 +00002154 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00002155 .\testfixture.exe $(TOP)\test\extraquick.test $(TESTOPTS)
2156
2157# This is the common case. Run many tests that do not take too long,
2158# including fuzzcheck, sqlite3_analyzer, and sqldiff tests.
2159#
drhfd0d93f2016-02-07 00:08:08 +00002160test: $(TESTPROGS) sourcetest fastfuzztest
mistachkin88739962015-10-14 23:04:08 +00002161 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00002162 .\testfixture.exe $(TOP)\test\veryquick.test $(TESTOPTS)
shanehb2f20bf2011-06-17 07:07:24 +00002163
drhea93c702015-05-26 18:15:08 +00002164smoketest: $(TESTPROGS)
mistachkin88739962015-10-14 23:04:08 +00002165 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00002166 .\testfixture.exe $(TOP)\test\main.test $(TESTOPTS)
mistachkin00eb70d2015-04-04 00:02:07 +00002167
mistachkin4ef916e2016-08-24 19:58:46 +00002168sqlite3_analyzer.c: $(SQLITE3C) $(SQLITE3H) $(TOP)\src\tclsqlite.c $(TOP)\tool\spaceanal.tcl $(SQLITE_TCL_DEP)
mistachkind4ab1032015-05-11 16:27:33 +00002169 echo #define TCLSH 2 > $@
2170 echo #define SQLITE_ENABLE_DBSTAT_VTAB 1 >> $@
2171 copy $@ + $(SQLITE3C) + $(TOP)\src\tclsqlite.c $@
mistachkin9a55e312011-09-22 00:06:44 +00002172 echo static const char *tclsh_main_loop(void){ >> $@
2173 echo static const char *zMainloop = >> $@
drh48cc9a32015-10-07 12:36:42 +00002174 $(TCLSH_CMD) $(TOP)\tool\tostr.tcl $(TOP)\tool\spaceanal.tcl >> $@
mistachkin9a55e312011-09-22 00:06:44 +00002175 echo ; return zMainloop; } >> $@
shanehb2f20bf2011-06-17 07:07:24 +00002176
mistachkin08c1c312012-10-06 03:48:25 +00002177sqlite3_analyzer.exe: sqlite3_analyzer.c $(LIBRESOBJS)
mistachkind4ab1032015-05-11 16:27:33 +00002178 $(LTLINK) $(NO_WARN) -DBUILD_sqlite -I$(TCLINCDIR) sqlite3_analyzer.c \
mistachkin78e3f612015-10-14 20:01:12 +00002179 /link $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00002180
mistachkin943d8252017-03-14 15:27:56 +00002181dbdump.exe: $(TOP)\ext\misc\dbdump.c $(SQLITE3C) $(SQLITE3H)
2182 $(LTLINK) $(NO_WARN) -DDBDUMP_STANDALONE $(TOP)\ext\misc\dbdump.c $(SQLITE3C) \
2183 /link $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS)
drh4b34eb32017-03-13 22:02:01 +00002184
mistachkin1925a2e2014-02-24 21:20:25 +00002185testloadext.lo: $(TOP)\src\test_loadext.c
mistachkin44723ce2015-03-21 02:22:37 +00002186 $(LTCOMPILE) $(NO_WARN) -c $(TOP)\src\test_loadext.c
mistachkin1925a2e2014-02-24 21:20:25 +00002187
mistachkin9b88ace2016-02-26 21:01:37 +00002188testloadext.dll: testloadext.lo
mistachkin1925a2e2014-02-24 21:20:25 +00002189 $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /OUT:$@ testloadext.lo
2190
mistachkin5d4d9412016-01-22 03:54:36 +00002191showdb.exe: $(TOP)\tool\showdb.c $(SQLITE3C) $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002192 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
mistachkin78e3f612015-10-14 20:01:12 +00002193 $(TOP)\tool\showdb.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh9ac3c1e2013-11-07 18:37:31 +00002194
mistachkin5d4d9412016-01-22 03:54:36 +00002195showstat4.exe: $(TOP)\tool\showstat4.c $(SQLITE3C) $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002196 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
mistachkin78e3f612015-10-14 20:01:12 +00002197 $(TOP)\tool\showstat4.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh4bb77ec2014-06-30 11:14:26 +00002198
mistachkin5d4d9412016-01-22 03:54:36 +00002199showjournal.exe: $(TOP)\tool\showjournal.c $(SQLITE3C) $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002200 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
mistachkin78e3f612015-10-14 20:01:12 +00002201 $(TOP)\tool\showjournal.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh4bb77ec2014-06-30 11:14:26 +00002202
mistachkin5d4d9412016-01-22 03:54:36 +00002203showwal.exe: $(TOP)\tool\showwal.c $(SQLITE3C) $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002204 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
mistachkin78e3f612015-10-14 20:01:12 +00002205 $(TOP)\tool\showwal.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh4bb77ec2014-06-30 11:14:26 +00002206
mistachkin953fbd12017-02-07 21:09:34 +00002207changeset.exe: $(TOP)\ext\session\changeset.c $(SQLITE3C) $(SQLITE3H)
2208 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
2209 -DSQLITE_ENABLE_SESSION=1 -DSQLITE_ENABLE_PREUPDATE_HOOK=1 \
mistachkin05004782016-03-30 16:23:06 +00002210 $(TOP)\ext\session\changeset.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh9f674f22014-08-18 20:23:29 +00002211
mistachkin5d4d9412016-01-22 03:54:36 +00002212fts3view.exe: $(TOP)\ext\fts3\tool\fts3view.c $(SQLITE3C) $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002213 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
mistachkin78e3f612015-10-14 20:01:12 +00002214 $(TOP)\ext\fts3\tool\fts3view.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
mistachkinde545272014-07-07 17:57:50 +00002215
mistachkin5d4d9412016-01-22 03:54:36 +00002216rollback-test.exe: $(TOP)\tool\rollback-test.c $(SQLITE3C) $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002217 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
mistachkin78e3f612015-10-14 20:01:12 +00002218 $(TOP)\tool\rollback-test.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh4bb77ec2014-06-30 11:14:26 +00002219
mistachkin5d4d9412016-01-22 03:54:36 +00002220LogEst.exe: $(TOP)\tool\logest.c $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002221 $(LTLINK) $(NO_WARN) $(TOP)\tool\LogEst.c /link $(LDFLAGS) $(LTLINKOPTS)
drh267a13f2014-06-18 18:10:12 +00002222
mistachkin5d4d9412016-01-22 03:54:36 +00002223wordcount.exe: $(TOP)\test\wordcount.c $(SQLITE3C) $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002224 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
mistachkin78e3f612015-10-14 20:01:12 +00002225 $(TOP)\test\wordcount.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh9ac3c1e2013-11-07 18:37:31 +00002226
mistachkin5d4d9412016-01-22 03:54:36 +00002227speedtest1.exe: $(TOP)\test\speedtest1.c $(SQLITE3C) $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002228 $(LTLINK) $(NO_WARN) $(ST_COMPILE_OPTS) -DSQLITE_OMIT_LOAD_EXTENSION \
mistachkin78e3f612015-10-14 20:01:12 +00002229 $(TOP)\test\speedtest1.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
mistachkinb482a442012-02-11 22:19:26 +00002230
mistachkin953fbd12017-02-07 21:09:34 +00002231kvtest.exe: $(TOP)\test\kvtest.c $(SQLITE3C) $(SQLITE3H)
2232 $(LTLINK) $(NO_WARN) $(KV_COMPILE_OPTS) \
2233 $(TOP)\test\kvtest.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
2234
2235dbselftest.exe: $(TOP)\test\dbselftest.c $(SQLITE3C) $(SQLITE3H)
2236 $(LTLINK) $(NO_WARN) $(DBSELFTEST_COMPILE_OPTS) $(TOP)\test\dbselftest.c $(SQLITE3C)
2237
mistachkin9b88ace2016-02-26 21:01:37 +00002238rbu.exe: $(TOP)\ext\rbu\rbu.c $(TOP)\ext\rbu\sqlite3rbu.c $(SQLITE3C) $(SQLITE3H)
mistachkin953fbd12017-02-07 21:09:34 +00002239 $(LTLINK) $(NO_WARN) -DSQLITE_ENABLE_RBU \
mistachkin5d4d9412016-01-22 03:54:36 +00002240 $(TOP)\ext\rbu\rbu.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
mistachkin9b88ace2016-02-26 21:01:37 +00002241
2242moreclean: clean
2243 del /Q $(SQLITE3C) $(SQLITE3H) 2>NUL
mistachkin3e786092016-01-23 07:53:04 +00002244# <</mark>>
drh76473772016-01-14 13:22:24 +00002245
shaneh6e7850c2011-06-17 15:57:07 +00002246clean:
mistachkin8dd3ff12015-05-16 03:41:41 +00002247 del /Q *.exp *.lo *.ilk *.lib *.obj *.ncb *.pdb *.sdf *.suo 2>NUL
mistachkin56362a52016-02-19 19:03:04 +00002248 del /Q *.bsc *.def *.cod *.da *.bb *.bbg *.vc gmon.out 2>NUL
mistachkinfe41a982016-02-27 00:21:44 +00002249 del /Q $(SQLITE3EXE) $(SQLITE3DLL) Replace.exe 2>NUL
mistachkin3e786092016-01-23 07:53:04 +00002250# <<mark>>
mistachkin9b88ace2016-02-26 21:01:37 +00002251 del /Q sqlite3.c sqlite3.h 2>NUL
2252 del /Q opcodes.c opcodes.h 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002253 del /Q lemon.* lempar.c parse.* 2>NUL
2254 del /Q mkkeywordhash.* keywordhash.h 2>NUL
2255 del /Q notasharedlib.* 2>NUL
2256 -rmdir /Q/S .deps 2>NUL
2257 -rmdir /Q/S .libs 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002258 -rmdir /Q/S tsrc 2>NUL
2259 del /Q .target_source 2>NUL
mistachkin4ef916e2016-08-24 19:58:46 +00002260 del /Q tclsqlite3.exe $(SQLITETCLH) $(SQLITETCLDECLSH) 2>NUL
mistachkin44723ce2015-03-21 02:22:37 +00002261 del /Q testloadext.dll 2>NUL
2262 del /Q testfixture.exe test.db 2>NUL
mistachkin943d8252017-03-14 15:27:56 +00002263 del /Q LogEst.exe fts3view.exe rollback-test.exe showdb.exe dbdump.exe 2>NUL
drhedea9112015-03-24 19:02:13 +00002264 del /Q changeset.exe 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002265 del /Q showjournal.exe showstat4.exe showwal.exe speedtest1.exe 2>NUL
mistachkin27b69972016-02-07 20:39:27 +00002266 del /Q mptester.exe wordcount.exe rbu.exe srcck1.exe 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002267 del /Q sqlite3.c sqlite3-*.c 2>NUL
2268 del /Q sqlite3rc.h 2>NUL
mistachkin27799892016-03-31 22:53:37 +00002269 del /Q shell.c sqlite3ext.h sqlite3session.h 2>NUL
mistachkin44723ce2015-03-21 02:22:37 +00002270 del /Q sqlite3_analyzer.exe sqlite3_analyzer.c 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002271 del /Q sqlite-*-output.vsix 2>NUL
drh290fcaa2016-06-08 01:03:05 +00002272 del /Q fuzzershell.exe fuzzcheck.exe sqldiff.exe dbhash.exe 2>NUL
mistachkinbc50bb72015-07-14 21:56:53 +00002273 del /Q fts5.* fts5parse.* 2>NUL
mistachkin3e786092016-01-23 07:53:04 +00002274# <</mark>>