blob: 4a29f913c8061902845c0211ae6ddbfe321bd9ec [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
748RCC = $(RCC) -DSQLITE_DEBUG=1
mistachkin753c5442011-08-25 02:02:25 +0000749!ENDIF
750
mistachkinb10f22a2015-04-16 16:27:29 +0000751!IF $(DEBUG)>4 || $(OSTRACE)!=0
752TCC = $(TCC) -DSQLITE_FORCE_OS_TRACE=1 -DSQLITE_DEBUG_OS_TRACE=1
753RCC = $(RCC) -DSQLITE_FORCE_OS_TRACE=1 -DSQLITE_DEBUG_OS_TRACE=1
mistachkin753c5442011-08-25 02:02:25 +0000754!ENDIF
755
mistachkincd54bab2014-12-20 21:14:14 +0000756!IF $(DEBUG)>5
mistachkin13a24f82015-05-13 04:50:30 +0000757TCC = $(TCC) -DSQLITE_ENABLE_IOTRACE=1
758RCC = $(RCC) -DSQLITE_ENABLE_IOTRACE=1
mistachkin753c5442011-08-25 02:02:25 +0000759!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000760
mistachkinbd58d5f2012-06-30 22:22:34 +0000761# Prevent warnings about "insecure" MSVC runtime library functions
762# being used.
mistachkin176f1b42011-08-02 23:34:00 +0000763#
764TCC = $(TCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
mistachkinfec360a2012-04-18 10:29:21 +0000765BCC = $(BCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
mistachkin4d9d1f42012-09-03 10:32:32 +0000766RCC = $(RCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
mistachkin176f1b42011-08-02 23:34:00 +0000767
mistachkinbd58d5f2012-06-30 22:22:34 +0000768# Prevent warnings about "deprecated" POSIX functions being used.
769#
770TCC = $(TCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
771BCC = $(BCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
mistachkin4d9d1f42012-09-03 10:32:32 +0000772RCC = $(RCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
mistachkinbd58d5f2012-06-30 22:22:34 +0000773
mistachkin2f7d5d82012-08-22 00:39:34 +0000774# Use the SQLite debugging heap subsystem?
mistachkin1b186a92011-08-24 16:13:57 +0000775#
mistachkin2f7d5d82012-08-22 00:39:34 +0000776!IF $(MEMDEBUG)!=0
777TCC = $(TCC) -DSQLITE_MEMDEBUG=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000778RCC = $(RCC) -DSQLITE_MEMDEBUG=1
mistachkin2f7d5d82012-08-22 00:39:34 +0000779
mistachkin2f7d5d82012-08-22 00:39:34 +0000780# Use native Win32 heap subsystem instead of malloc/free?
781#
782!ELSEIF $(WIN32HEAP)!=0
783TCC = $(TCC) -DSQLITE_WIN32_MALLOC=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000784RCC = $(RCC) -DSQLITE_WIN32_MALLOC=1
mistachkin753c5442011-08-25 02:02:25 +0000785
mistachkin753c5442011-08-25 02:02:25 +0000786# Validate the heap on every call into the native Win32 heap subsystem?
787#
mistachkincd54bab2014-12-20 21:14:14 +0000788!IF $(DEBUG)>3
mistachkin753c5442011-08-25 02:02:25 +0000789TCC = $(TCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000790RCC = $(RCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1
mistachkin753c5442011-08-25 02:02:25 +0000791!ENDIF
mistachkin2f7d5d82012-08-22 00:39:34 +0000792!ENDIF
mistachkin1b186a92011-08-24 16:13:57 +0000793
mistachkin3e786092016-01-23 07:53:04 +0000794# <<mark>>
mistachkin5b0b6fd2011-06-25 01:14:36 +0000795# The locations of the Tcl header and library files. Also, the library that
796# non-stubs enabled programs using Tcl must link against. These variables
797# (TCLINCDIR, TCLLIBDIR, and LIBTCL) may be overridden via the environment
798# prior to running nmake in order to match the actual installed location and
799# version on this machine.
shanehb2f20bf2011-06-17 07:07:24 +0000800#
mistachkine37f99c2012-06-30 16:22:05 +0000801!IFNDEF TCLINCDIR
shanehb2f20bf2011-06-17 07:07:24 +0000802TCLINCDIR = c:\tcl\include
mistachkine37f99c2012-06-30 16:22:05 +0000803!ENDIF
mistachkin5b0b6fd2011-06-25 01:14:36 +0000804
mistachkine37f99c2012-06-30 16:22:05 +0000805!IFNDEF TCLLIBDIR
shanehb2f20bf2011-06-17 07:07:24 +0000806TCLLIBDIR = c:\tcl\lib
mistachkine37f99c2012-06-30 16:22:05 +0000807!ENDIF
mistachkin5b0b6fd2011-06-25 01:14:36 +0000808
mistachkine37f99c2012-06-30 16:22:05 +0000809!IFNDEF LIBTCL
drh506a1402016-11-02 19:49:22 +0000810LIBTCL = tcl86.lib
mistachkine37f99c2012-06-30 16:22:05 +0000811!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000812
mistachkin5b663502015-10-10 23:39:55 +0000813!IFNDEF LIBTCLSTUB
drh506a1402016-11-02 19:49:22 +0000814LIBTCLSTUB = tclstub86.lib
mistachkin5b663502015-10-10 23:39:55 +0000815!ENDIF
816
mistachkin88739962015-10-14 23:04:08 +0000817!IFNDEF LIBTCLPATH
818LIBTCLPATH = c:\tcl\bin
819!ENDIF
820
mistachkinc756ded2011-10-02 05:23:16 +0000821# The locations of the ICU header and library files. These variables
822# (ICUINCDIR, ICULIBDIR, and LIBICU) may be overridden via the environment
823# prior to running nmake in order to match the actual installed location on
824# this machine.
825#
mistachkine37f99c2012-06-30 16:22:05 +0000826!IFNDEF ICUINCDIR
mistachkinc756ded2011-10-02 05:23:16 +0000827ICUINCDIR = c:\icu\include
mistachkine37f99c2012-06-30 16:22:05 +0000828!ENDIF
mistachkinc756ded2011-10-02 05:23:16 +0000829
mistachkine37f99c2012-06-30 16:22:05 +0000830!IFNDEF ICULIBDIR
mistachkinc756ded2011-10-02 05:23:16 +0000831ICULIBDIR = c:\icu\lib
mistachkine37f99c2012-06-30 16:22:05 +0000832!ENDIF
mistachkinc756ded2011-10-02 05:23:16 +0000833
mistachkine37f99c2012-06-30 16:22:05 +0000834!IFNDEF LIBICU
mistachkinc756ded2011-10-02 05:23:16 +0000835LIBICU = icuuc.lib icuin.lib
mistachkine37f99c2012-06-30 16:22:05 +0000836!ENDIF
mistachkinc756ded2011-10-02 05:23:16 +0000837
shanehb2f20bf2011-06-17 07:07:24 +0000838# This is the command to use for tclsh - normally just "tclsh", but we may
mistachkin5b0b6fd2011-06-25 01:14:36 +0000839# know the specific version we want to use. This variable (TCLSH_CMD) may be
840# overridden via the environment prior to running nmake in order to select a
841# specific Tcl shell to use.
shanehb2f20bf2011-06-17 07:07:24 +0000842#
mistachkine37f99c2012-06-30 16:22:05 +0000843!IFNDEF TCLSH_CMD
drh506a1402016-11-02 19:49:22 +0000844TCLSH_CMD = tclsh
mistachkine37f99c2012-06-30 16:22:05 +0000845!ENDIF
mistachkin3e786092016-01-23 07:53:04 +0000846# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +0000847
848# Compiler options needed for programs that use the readline() library.
849#
mistachkin8bcd3fa2013-08-29 01:03:38 +0000850!IFNDEF READLINE_FLAGS
shaneh6e7850c2011-06-17 15:57:07 +0000851READLINE_FLAGS = -DHAVE_READLINE=0
mistachkin8bcd3fa2013-08-29 01:03:38 +0000852!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000853
854# The library that programs using readline() must link against.
855#
mistachkin8bcd3fa2013-08-29 01:03:38 +0000856!IFNDEF LIBREADLINE
shaneh6e7850c2011-06-17 15:57:07 +0000857LIBREADLINE =
mistachkin8bcd3fa2013-08-29 01:03:38 +0000858!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000859
860# Should the database engine be compiled threadsafe
861#
862TCC = $(TCC) -DSQLITE_THREADSAFE=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000863RCC = $(RCC) -DSQLITE_THREADSAFE=1
shanehb2f20bf2011-06-17 07:07:24 +0000864
865# Do threads override each others locks by default (1), or do we test (-1)
866#
867TCC = $(TCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1
mistachkin4d9d1f42012-09-03 10:32:32 +0000868RCC = $(RCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1
shanehb2f20bf2011-06-17 07:07:24 +0000869
870# Any target libraries which libsqlite must be linked against
shaneh6e7850c2011-06-17 15:57:07 +0000871#
mistachkine37f99c2012-06-30 16:22:05 +0000872!IFNDEF TLIBS
shaneh6e7850c2011-06-17 15:57:07 +0000873TLIBS =
mistachkine37f99c2012-06-30 16:22:05 +0000874!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000875
876# Flags controlling use of the in memory btree implementation
877#
878# SQLITE_TEMP_STORE is 0 to force temporary tables to be in a file, 1 to
879# default to file, 2 to default to memory, and 3 to force temporary
880# tables to always be in memory.
881#
shaneh6e7850c2011-06-17 15:57:07 +0000882TCC = $(TCC) -DSQLITE_TEMP_STORE=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000883RCC = $(RCC) -DSQLITE_TEMP_STORE=1
shanehb2f20bf2011-06-17 07:07:24 +0000884
885# Enable/disable loadable extensions, and other optional features
shaneh6e7850c2011-06-17 15:57:07 +0000886# based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*).
887# The same set of OMIT and ENABLE flags should be passed to the
shanehb2f20bf2011-06-17 07:07:24 +0000888# LEMON parser generator and the mkkeywordhash tool as well.
889
mistachkin4712c212014-05-09 20:51:17 +0000890# These are the required SQLite compilation options used when compiling for
891# the Windows platform.
892#
893REQ_FEATURE_FLAGS = $(REQ_FEATURE_FLAGS) -DSQLITE_MAX_TRIGGER_DEPTH=100
shanehb2f20bf2011-06-17 07:07:24 +0000894
mistachkine45e0fb2015-01-21 00:48:46 +0000895# If we are linking to the RPCRT4 library, enable features that need it.
896#
897!IF $(USE_RPCRT4_LIB)!=0
898REQ_FEATURE_FLAGS = $(REQ_FEATURE_FLAGS) -DSQLITE_WIN32_USE_UUID=1
899!ENDIF
900
mistachkin4712c212014-05-09 20:51:17 +0000901# Add the required and optional SQLite compilation options into the command
902# lines used to invoke the MSVC code and resource compilers.
903#
mistachkinedcb4eb2016-01-22 01:25:15 +0000904TCC = $(TCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS)
905RCC = $(RCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS)
shanehb2f20bf2011-06-17 07:07:24 +0000906
mistachkin4712c212014-05-09 20:51:17 +0000907# Add in any optional parameters specified on the commane line, e.g.
908# nmake /f Makefile.msc all "OPTS=-DSQLITE_ENABLE_FOO=1 -DSQLITE_OMIT_FOO=1"
909#
shanehb2f20bf2011-06-17 07:07:24 +0000910TCC = $(TCC) $(OPTS)
mistachkin4d9d1f42012-09-03 10:32:32 +0000911RCC = $(RCC) $(OPTS)
shanehb2f20bf2011-06-17 07:07:24 +0000912
mistachkin8bcd3fa2013-08-29 01:03:38 +0000913# If compiling for debugging, add some defines.
mistachkin4712c212014-05-09 20:51:17 +0000914#
mistachkincd54bab2014-12-20 21:14:14 +0000915!IF $(DEBUG)>1
mistachkin8bcd3fa2013-08-29 01:03:38 +0000916TCC = $(TCC) -D_DEBUG
917BCC = $(BCC) -D_DEBUG
mistachkin4d9d1f42012-09-03 10:32:32 +0000918RCC = $(RCC) -D_DEBUG
mistachkin4d60be52011-08-26 05:40:31 +0000919!ENDIF
920
mistachkin8bcd3fa2013-08-29 01:03:38 +0000921# If optimizations are enabled or disabled (either implicitly or
922# explicitly), add the necessary flags.
mistachkin4712c212014-05-09 20:51:17 +0000923#
mistachkincd54bab2014-12-20 21:14:14 +0000924!IF $(DEBUG)>1 || $(OPTIMIZATIONS)==0
mistachkin8bcd3fa2013-08-29 01:03:38 +0000925TCC = $(TCC) -Od
926BCC = $(BCC) -Od
mistachkin24b6b812016-08-24 18:21:58 +0000927!IF $(USE_RUNTIME_CHECKS)!=0
928TCC = $(TCC) -RTC1
929BCC = $(BCC) -RTC1
930!ENDIF
mistachkin8bcd3fa2013-08-29 01:03:38 +0000931!ELSEIF $(OPTIMIZATIONS)>=3
932TCC = $(TCC) -Ox
933BCC = $(BCC) -Ox
934!ELSEIF $(OPTIMIZATIONS)==2
935TCC = $(TCC) -O2
936BCC = $(BCC) -O2
937!ELSEIF $(OPTIMIZATIONS)==1
938TCC = $(TCC) -O1
939BCC = $(BCC) -O1
940!ENDIF
941
942# If symbols are enabled (or compiling for debugging), enable PDBs.
mistachkin4712c212014-05-09 20:51:17 +0000943#
mistachkincd54bab2014-12-20 21:14:14 +0000944!IF $(DEBUG)>1 || $(SYMBOLS)!=0
mistachkin4d60be52011-08-26 05:40:31 +0000945TCC = $(TCC) -Zi
mistachkinfec360a2012-04-18 10:29:21 +0000946BCC = $(BCC) -Zi
mistachkin753c5442011-08-25 02:02:25 +0000947!ENDIF
948
mistachkin3e786092016-01-23 07:53:04 +0000949# <<mark>>
mistachkinc756ded2011-10-02 05:23:16 +0000950# If ICU support is enabled, add the compiler options for it.
mistachkin4712c212014-05-09 20:51:17 +0000951#
mistachkinc756ded2011-10-02 05:23:16 +0000952!IF $(USE_ICU)!=0
953TCC = $(TCC) -DSQLITE_ENABLE_ICU=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000954RCC = $(RCC) -DSQLITE_ENABLE_ICU=1
mistachkinc756ded2011-10-02 05:23:16 +0000955TCC = $(TCC) -I$(TOP)\ext\icu
mistachkin4d9d1f42012-09-03 10:32:32 +0000956RCC = $(RCC) -I$(TOP)\ext\icu
mistachkinc756ded2011-10-02 05:23:16 +0000957TCC = $(TCC) -I$(ICUINCDIR)
mistachkin4d9d1f42012-09-03 10:32:32 +0000958RCC = $(RCC) -I$(ICUINCDIR)
mistachkinc756ded2011-10-02 05:23:16 +0000959!ENDIF
mistachkin3e786092016-01-23 07:53:04 +0000960# <</mark>>
mistachkinc756ded2011-10-02 05:23:16 +0000961
mistachkin4d9d1f42012-09-03 10:32:32 +0000962# Command line prefixes for compiling code, compiling resources,
963# linking, etc.
mistachkin4712c212014-05-09 20:51:17 +0000964#
shanehb2f20bf2011-06-17 07:07:24 +0000965LTCOMPILE = $(TCC) -Fo$@
mistachkin4d9d1f42012-09-03 10:32:32 +0000966LTRCOMPILE = $(RCC) -r
shanehb2f20bf2011-06-17 07:07:24 +0000967LTLIB = lib.exe
shaneh2a0b9ef2011-06-20 20:52:32 +0000968LTLINK = $(TCC) -Fe$@
969
mistachkine45e0fb2015-01-21 00:48:46 +0000970# If requested, link to the RPCRT4 library.
971#
972!IF $(USE_RPCRT4_LIB)!=0
973LTLINK = $(LTLINK) rpcrt4.lib
974!ENDIF
975
shaneh2a0b9ef2011-06-20 20:52:32 +0000976# If a platform was set, force the linker to target that.
977# Note that the vcvars*.bat family of batch files typically
978# set this for you. Otherwise, the linker will attempt
979# to deduce the binary type based on the object files.
mistachkine37f99c2012-06-30 16:22:05 +0000980!IFDEF PLATFORM
mistachkin44723ce2015-03-21 02:22:37 +0000981LTLINKOPTS = /NOLOGO /MACHINE:$(PLATFORM)
982LTLIBOPTS = /NOLOGO /MACHINE:$(PLATFORM)
983!ELSE
984LTLINKOPTS = /NOLOGO
985LTLIBOPTS = /NOLOGO
shaneh2a0b9ef2011-06-20 20:52:32 +0000986!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000987
mistachkina6ff8572012-04-17 21:00:12 +0000988# When compiling for use in the WinRT environment, the following
989# linker option must be used to mark the executable as runnable
990# only in the context of an application container.
991#
992!IF $(FOR_WINRT)!=0
993LTLINKOPTS = $(LTLINKOPTS) /APPCONTAINER
mistachkin318d38c2015-04-22 01:33:53 +0000994!IF "$(VISUALSTUDIOVERSION)"=="12.0" || "$(VISUALSTUDIOVERSION)"=="14.0"
mistachkinf6a23422014-05-05 20:24:34 +0000995!IFNDEF STORELIBPATH
mistachkinda5b1cd2013-07-10 19:39:02 +0000996!IF "$(PLATFORM)"=="x86"
mistachkin4712c212014-05-09 20:51:17 +0000997STORELIBPATH = $(CRTLIBPATH)\store
mistachkinda5b1cd2013-07-10 19:39:02 +0000998!ELSEIF "$(PLATFORM)"=="x64"
mistachkin4712c212014-05-09 20:51:17 +0000999STORELIBPATH = $(CRTLIBPATH)\store\amd64
mistachkin4eaa1292013-07-10 21:33:25 +00001000!ELSEIF "$(PLATFORM)"=="ARM"
mistachkin4712c212014-05-09 20:51:17 +00001001STORELIBPATH = $(CRTLIBPATH)\store\arm
mistachkin4eaa1292013-07-10 21:33:25 +00001002!ELSE
mistachkin4712c212014-05-09 20:51:17 +00001003STORELIBPATH = $(CRTLIBPATH)\store
mistachkinda5b1cd2013-07-10 19:39:02 +00001004!ENDIF
1005!ENDIF
mistachkinf6a23422014-05-05 20:24:34 +00001006STORELIBPATH = $(STORELIBPATH:\\=\)
1007LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(STORELIBPATH)"
1008!ENDIF
mistachkina6ff8572012-04-17 21:00:12 +00001009!ENDIF
1010
mistachkind9b3c542014-05-09 23:31:55 +00001011# When compiling for Windows Phone 8.1, an extra library path is
1012# required.
1013#
1014!IF $(USE_WP81_OPTS)!=0
1015!IFNDEF WP81LIBPATH
1016!IF "$(PLATFORM)"=="x86"
1017WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86
1018!ELSEIF "$(PLATFORM)"=="ARM"
1019WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\ARM
1020!ELSE
1021WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86
mistachkinc756ded2011-10-02 05:23:16 +00001022!ENDIF
mistachkin31856a32012-07-27 07:13:25 +00001023!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +00001024!ENDIF
1025
mistachkind9b3c542014-05-09 23:31:55 +00001026# When compiling for Windows Phone 8.1, some extra linker options
1027# are also required.
1028#
1029!IF $(USE_WP81_OPTS)!=0
1030!IFDEF WP81LIBPATH
1031LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(WP81LIBPATH)"
1032!ENDIF
1033LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE
1034LTLINKOPTS = $(LTLINKOPTS) WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelHost.lib
1035LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:kernel32.lib /NODEFAULTLIB:ole32.lib
1036!ENDIF
1037
mistachkina819aed2016-02-12 05:19:29 +00001038# When compiling for UWP or the Windows 10 platform, some extra linker
mistachkin55e88d92016-02-08 20:40:57 +00001039# options are also required.
mistachkin318d38c2015-04-22 01:33:53 +00001040#
mistachkina819aed2016-02-12 05:19:29 +00001041!IF $(FOR_UWP)!=0 || $(FOR_WIN10)!=0
mistachkin318d38c2015-04-22 01:33:53 +00001042LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE /NODEFAULTLIB:kernel32.lib
1043LTLINKOPTS = $(LTLINKOPTS) mincore.lib
1044!IFDEF PSDKLIBPATH
1045LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(PSDKLIBPATH)"
1046!ENDIF
1047!ENDIF
1048
mistachkina6f28892016-02-05 19:40:23 +00001049!IF $(FOR_WIN10)!=0
mistachkin406eeff2016-02-09 18:28:20 +00001050LTLINKOPTS = $(LTLINKOPTS) /guard:cf "/LIBPATH:$(UCRTLIBPATH)"
mistachkina6f28892016-02-05 19:40:23 +00001051!IF $(DEBUG)>1
1052LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:libucrtd.lib /DEFAULTLIB:ucrtd.lib
1053!ELSE
1054LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib
1055!ENDIF
1056!ENDIF
1057
shanehb2f20bf2011-06-17 07:07:24 +00001058# If either debugging or symbols are enabled, enable PDBs.
mistachkin4712c212014-05-09 20:51:17 +00001059#
mistachkincd54bab2014-12-20 21:14:14 +00001060!IF $(DEBUG)>1 || $(SYMBOLS)!=0
mistachkinf170ea42015-10-16 20:13:57 +00001061LDFLAGS = /DEBUG $(LDOPTS)
1062!ELSE
1063LDFLAGS = $(LDOPTS)
shanehb2f20bf2011-06-17 07:07:24 +00001064!ENDIF
1065
mistachkin3e786092016-01-23 07:53:04 +00001066# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001067# Start with the Tcl related linker options.
mistachkin4712c212014-05-09 20:51:17 +00001068#
shanehb2f20bf2011-06-17 07:07:24 +00001069!IF $(NO_TCL)==0
1070LTLIBPATHS = /LIBPATH:$(TCLLIBDIR)
1071LTLIBS = $(LIBTCL)
mistachkin31856a32012-07-27 07:13:25 +00001072!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +00001073
1074# If ICU support is enabled, add the linker options for it.
mistachkin4712c212014-05-09 20:51:17 +00001075#
shanehb2f20bf2011-06-17 07:07:24 +00001076!IF $(USE_ICU)!=0
1077LTLIBPATHS = $(LTLIBPATHS) /LIBPATH:$(ICULIBDIR)
1078LTLIBS = $(LTLIBS) $(LIBICU)
1079!ENDIF
mistachkin3e786092016-01-23 07:53:04 +00001080# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001081
shanehb2f20bf2011-06-17 07:07:24 +00001082# You should not have to change anything below this line
1083###############################################################################
1084
mistachkin3e786092016-01-23 07:53:04 +00001085# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001086# Object files for the SQLite library (non-amalgamation).
1087#
mistachkinf67feef2013-07-29 19:03:20 +00001088LIBOBJS0 = vdbe.lo parse.lo alter.lo analyze.lo attach.lo auth.lo \
shanehb2f20bf2011-06-17 07:07:24 +00001089 backup.lo bitvec.lo btmutex.lo btree.lo build.lo \
drh1a4a6802015-05-04 18:31:09 +00001090 callback.lo complete.lo ctime.lo date.lo dbstat.lo delete.lo \
shanehb2f20bf2011-06-17 07:07:24 +00001091 expr.lo fault.lo fkey.lo \
drh391d4ba2012-05-28 20:22:16 +00001092 fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo \
1093 fts3_porter.lo fts3_snippet.lo fts3_tokenizer.lo fts3_tokenizer1.lo \
drh4d648c72013-04-22 17:07:56 +00001094 fts3_tokenize_vtab.lo fts3_unicode.lo fts3_unicode2.lo fts3_write.lo \
mistachkined52f9f2015-06-26 04:34:36 +00001095 fts5.lo \
shanehb2f20bf2011-06-17 07:07:24 +00001096 func.lo global.lo hash.lo \
drhc2f18ad2016-03-05 15:35:09 +00001097 icu.lo insert.lo legacy.lo loadext.lo \
shanehb2f20bf2011-06-17 07:07:24 +00001098 main.lo malloc.lo mem0.lo mem1.lo mem2.lo mem3.lo mem5.lo \
1099 memjournal.lo \
mistachkinf1c6bc52012-06-21 15:09:20 +00001100 mutex.lo mutex_noop.lo mutex_unix.lo mutex_w32.lo \
1101 notify.lo opcodes.lo os.lo os_unix.lo os_win.lo \
mistachkinf67feef2013-07-29 19:03:20 +00001102 pager.lo pcache.lo pcache1.lo pragma.lo prepare.lo printf.lo \
drh498dcae2013-03-13 11:42:00 +00001103 random.lo resolve.lo rowset.lo rtree.lo \
drhcb75bff2016-01-14 14:48:17 +00001104 sqlite3session.lo select.lo sqlite3rbu.lo status.lo \
drh38b41492015-06-08 15:08:15 +00001105 table.lo threads.lo tokenize.lo treeview.lo trigger.lo \
shanehb2f20bf2011-06-17 07:07:24 +00001106 update.lo util.lo vacuum.lo \
mistachkinf67feef2013-07-29 19:03:20 +00001107 vdbeapi.lo vdbeaux.lo vdbeblob.lo vdbemem.lo vdbesort.lo \
drh6c1f4ef2015-06-08 14:23:15 +00001108 vdbetrace.lo wal.lo walker.lo where.lo wherecode.lo whereexpr.lo \
1109 utf.lo vtab.lo
mistachkin3e786092016-01-23 07:53:04 +00001110# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001111
1112# Object files for the amalgamation.
1113#
1114LIBOBJS1 = sqlite3.lo
1115
1116# Determine the real value of LIBOBJ based on the 'configure' script
1117#
mistachkin3e786092016-01-23 07:53:04 +00001118# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001119!IF $(USE_AMALGAMATION)==0
1120LIBOBJ = $(LIBOBJS0)
1121!ELSE
mistachkin3e786092016-01-23 07:53:04 +00001122# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001123LIBOBJ = $(LIBOBJS1)
mistachkin3e786092016-01-23 07:53:04 +00001124# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001125!ENDIF
mistachkin3e786092016-01-23 07:53:04 +00001126# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001127
mistachkin08c1c312012-10-06 03:48:25 +00001128# Determine if embedded resource compilation and usage are enabled.
1129#
1130!IF $(USE_RC)!=0
1131LIBRESOBJS = sqlite3res.lo
1132!ELSE
1133LIBRESOBJS =
1134!ENDIF
1135
mistachkin3e786092016-01-23 07:53:04 +00001136# <<mark>>
mistachkinc04c54b2016-02-11 21:28:16 +00001137# Core source code files, part 1.
shanehb2f20bf2011-06-17 07:07:24 +00001138#
mistachkinc04c54b2016-02-11 21:28:16 +00001139SRC00 = \
shanehb2f20bf2011-06-17 07:07:24 +00001140 $(TOP)\src\alter.c \
1141 $(TOP)\src\analyze.c \
1142 $(TOP)\src\attach.c \
1143 $(TOP)\src\auth.c \
1144 $(TOP)\src\backup.c \
1145 $(TOP)\src\bitvec.c \
1146 $(TOP)\src\btmutex.c \
1147 $(TOP)\src\btree.c \
shanehb2f20bf2011-06-17 07:07:24 +00001148 $(TOP)\src\build.c \
1149 $(TOP)\src\callback.c \
1150 $(TOP)\src\complete.c \
1151 $(TOP)\src\ctime.c \
1152 $(TOP)\src\date.c \
drh1a4a6802015-05-04 18:31:09 +00001153 $(TOP)\src\dbstat.c \
shanehb2f20bf2011-06-17 07:07:24 +00001154 $(TOP)\src\delete.c \
1155 $(TOP)\src\expr.c \
1156 $(TOP)\src\fault.c \
1157 $(TOP)\src\fkey.c \
1158 $(TOP)\src\func.c \
1159 $(TOP)\src\global.c \
1160 $(TOP)\src\hash.c \
shanehb2f20bf2011-06-17 07:07:24 +00001161 $(TOP)\src\insert.c \
shanehb2f20bf2011-06-17 07:07:24 +00001162 $(TOP)\src\legacy.c \
1163 $(TOP)\src\loadext.c \
1164 $(TOP)\src\main.c \
1165 $(TOP)\src\malloc.c \
1166 $(TOP)\src\mem0.c \
1167 $(TOP)\src\mem1.c \
1168 $(TOP)\src\mem2.c \
1169 $(TOP)\src\mem3.c \
1170 $(TOP)\src\mem5.c \
1171 $(TOP)\src\memjournal.c \
1172 $(TOP)\src\mutex.c \
shanehb2f20bf2011-06-17 07:07:24 +00001173 $(TOP)\src\mutex_noop.c \
shanehb2f20bf2011-06-17 07:07:24 +00001174 $(TOP)\src\mutex_unix.c \
1175 $(TOP)\src\mutex_w32.c \
1176 $(TOP)\src\notify.c \
1177 $(TOP)\src\os.c \
shanehb2f20bf2011-06-17 07:07:24 +00001178 $(TOP)\src\os_unix.c \
mistachkinc04c54b2016-02-11 21:28:16 +00001179 $(TOP)\src\os_win.c
1180
1181# Core source code files, part 2.
1182#
1183SRC01 = \
shanehb2f20bf2011-06-17 07:07:24 +00001184 $(TOP)\src\pager.c \
shanehb2f20bf2011-06-17 07:07:24 +00001185 $(TOP)\src\pcache.c \
shanehb2f20bf2011-06-17 07:07:24 +00001186 $(TOP)\src\pcache1.c \
1187 $(TOP)\src\pragma.c \
1188 $(TOP)\src\prepare.c \
1189 $(TOP)\src\printf.c \
1190 $(TOP)\src\random.c \
1191 $(TOP)\src\resolve.c \
1192 $(TOP)\src\rowset.c \
1193 $(TOP)\src\select.c \
1194 $(TOP)\src\status.c \
shanehb2f20bf2011-06-17 07:07:24 +00001195 $(TOP)\src\table.c \
drhf51446a2012-07-21 19:40:42 +00001196 $(TOP)\src\threads.c \
shanehb2f20bf2011-06-17 07:07:24 +00001197 $(TOP)\src\tclsqlite.c \
1198 $(TOP)\src\tokenize.c \
drh38b41492015-06-08 15:08:15 +00001199 $(TOP)\src\treeview.c \
shanehb2f20bf2011-06-17 07:07:24 +00001200 $(TOP)\src\trigger.c \
1201 $(TOP)\src\utf.c \
1202 $(TOP)\src\update.c \
1203 $(TOP)\src\util.c \
1204 $(TOP)\src\vacuum.c \
1205 $(TOP)\src\vdbe.c \
shanehb2f20bf2011-06-17 07:07:24 +00001206 $(TOP)\src\vdbeapi.c \
1207 $(TOP)\src\vdbeaux.c \
1208 $(TOP)\src\vdbeblob.c \
1209 $(TOP)\src\vdbemem.c \
mistachkin81c428a2011-08-17 02:19:54 +00001210 $(TOP)\src\vdbesort.c \
shanehb2f20bf2011-06-17 07:07:24 +00001211 $(TOP)\src\vdbetrace.c \
shanehb2f20bf2011-06-17 07:07:24 +00001212 $(TOP)\src\vtab.c \
1213 $(TOP)\src\wal.c \
shanehb2f20bf2011-06-17 07:07:24 +00001214 $(TOP)\src\walker.c \
drhe54df422013-11-12 18:37:25 +00001215 $(TOP)\src\where.c \
drh6f82e852015-06-06 20:12:09 +00001216 $(TOP)\src\wherecode.c \
mistachkinc04c54b2016-02-11 21:28:16 +00001217 $(TOP)\src\whereexpr.c
1218
1219# Shell source code files.
1220#
1221SRC02 = \
1222 $(TOP)\src\shell.c
1223
1224# Core miscellaneous files.
1225#
1226SRC03 = \
1227 $(TOP)\src\parse.y
1228
1229# Core header files, part 1.
1230#
1231SRC04 = \
1232 $(TOP)\src\btree.h \
1233 $(TOP)\src\btreeInt.h \
1234 $(TOP)\src\hash.h \
1235 $(TOP)\src\hwtime.h \
1236 $(TOP)\src\msvc.h \
1237 $(TOP)\src\mutex.h \
1238 $(TOP)\src\os.h \
1239 $(TOP)\src\os_common.h \
1240 $(TOP)\src\os_setup.h \
1241 $(TOP)\src\os_win.h
1242
1243# Core header files, part 2.
1244#
1245SRC05 = \
1246 $(TOP)\src\pager.h \
1247 $(TOP)\src\pcache.h \
1248 $(TOP)\src\pragma.h \
1249 $(TOP)\src\sqlite.h.in \
1250 $(TOP)\src\sqlite3ext.h \
1251 $(TOP)\src\sqliteInt.h \
1252 $(TOP)\src\sqliteLimit.h \
1253 $(TOP)\src\vdbe.h \
1254 $(TOP)\src\vdbeInt.h \
1255 $(TOP)\src\vxworks.h \
1256 $(TOP)\src\wal.h \
drhe54df422013-11-12 18:37:25 +00001257 $(TOP)\src\whereInt.h
shanehb2f20bf2011-06-17 07:07:24 +00001258
mistachkinc04c54b2016-02-11 21:28:16 +00001259# Extension source code files, part 1.
shanehb2f20bf2011-06-17 07:07:24 +00001260#
mistachkinc04c54b2016-02-11 21:28:16 +00001261SRC06 = \
shanehb2f20bf2011-06-17 07:07:24 +00001262 $(TOP)\ext\fts1\fts1.c \
shanehb2f20bf2011-06-17 07:07:24 +00001263 $(TOP)\ext\fts1\fts1_hash.c \
shanehb2f20bf2011-06-17 07:07:24 +00001264 $(TOP)\ext\fts1\fts1_porter.c \
drh62679202015-01-29 18:38:05 +00001265 $(TOP)\ext\fts1\fts1_tokenizer1.c \
shanehb2f20bf2011-06-17 07:07:24 +00001266 $(TOP)\ext\fts2\fts2.c \
shanehb2f20bf2011-06-17 07:07:24 +00001267 $(TOP)\ext\fts2\fts2_hash.c \
shanehb2f20bf2011-06-17 07:07:24 +00001268 $(TOP)\ext\fts2\fts2_icu.c \
1269 $(TOP)\ext\fts2\fts2_porter.c \
shanehb2f20bf2011-06-17 07:07:24 +00001270 $(TOP)\ext\fts2\fts2_tokenizer.c \
1271 $(TOP)\ext\fts2\fts2_tokenizer1.c
mistachkinc04c54b2016-02-11 21:28:16 +00001272
1273# Extension source code files, part 2.
1274#
1275SRC07 = \
shanehb2f20bf2011-06-17 07:07:24 +00001276 $(TOP)\ext\fts3\fts3.c \
shanehb2f20bf2011-06-17 07:07:24 +00001277 $(TOP)\ext\fts3\fts3_aux.c \
1278 $(TOP)\ext\fts3\fts3_expr.c \
1279 $(TOP)\ext\fts3\fts3_hash.c \
shanehb2f20bf2011-06-17 07:07:24 +00001280 $(TOP)\ext\fts3\fts3_icu.c \
1281 $(TOP)\ext\fts3\fts3_porter.c \
1282 $(TOP)\ext\fts3\fts3_snippet.c \
shanehb2f20bf2011-06-17 07:07:24 +00001283 $(TOP)\ext\fts3\fts3_tokenizer.c \
1284 $(TOP)\ext\fts3\fts3_tokenizer1.c \
drh4d648c72013-04-22 17:07:56 +00001285 $(TOP)\ext\fts3\fts3_tokenize_vtab.c \
drh391d4ba2012-05-28 20:22:16 +00001286 $(TOP)\ext\fts3\fts3_unicode.c \
1287 $(TOP)\ext\fts3\fts3_unicode2.c \
drh62679202015-01-29 18:38:05 +00001288 $(TOP)\ext\fts3\fts3_write.c \
drh62679202015-01-29 18:38:05 +00001289 $(TOP)\ext\icu\icu.c \
drhedea9112015-03-24 19:02:13 +00001290 $(TOP)\ext\rtree\rtree.c \
drhdbbd8162015-05-19 23:04:26 +00001291 $(TOP)\ext\session\sqlite3session.c \
drh50065652015-10-08 19:29:18 +00001292 $(TOP)\ext\rbu\sqlite3rbu.c \
1293 $(TOP)\ext\misc\json1.c
shanehb2f20bf2011-06-17 07:07:24 +00001294
mistachkinc04c54b2016-02-11 21:28:16 +00001295# Extension header files, part 1.
1296#
1297SRC08 = \
1298 $(TOP)\ext\fts1\fts1.h \
1299 $(TOP)\ext\fts1\fts1_hash.h \
1300 $(TOP)\ext\fts1\fts1_tokenizer.h \
1301 $(TOP)\ext\fts2\fts2.h \
1302 $(TOP)\ext\fts2\fts2_hash.h \
1303 $(TOP)\ext\fts2\fts2_tokenizer.h
1304
1305# Extension header files, part 2.
1306#
1307SRC09 = \
1308 $(TOP)\ext\fts3\fts3.h \
1309 $(TOP)\ext\fts3\fts3Int.h \
1310 $(TOP)\ext\fts3\fts3_hash.h \
1311 $(TOP)\ext\fts3\fts3_tokenizer.h \
1312 $(TOP)\ext\icu\sqliteicu.h \
1313 $(TOP)\ext\rtree\rtree.h \
mistachkin05004782016-03-30 16:23:06 +00001314 $(TOP)\ext\rbu\sqlite3rbu.h \
1315 $(TOP)\ext\session\sqlite3session.h
shanehb2f20bf2011-06-17 07:07:24 +00001316
1317# Generated source code files
1318#
mistachkinc04c54b2016-02-11 21:28:16 +00001319SRC10 = \
shanehb2f20bf2011-06-17 07:07:24 +00001320 opcodes.c \
mistachkinc04c54b2016-02-11 21:28:16 +00001321 parse.c
1322
1323# Generated header files
1324#
1325SRC11 = \
1326 keywordhash.h \
shanehb2f20bf2011-06-17 07:07:24 +00001327 opcodes.h \
shanehb2f20bf2011-06-17 07:07:24 +00001328 parse.h \
mistachkin5d4d9412016-01-22 03:54:36 +00001329 $(SQLITE3H)
shanehb2f20bf2011-06-17 07:07:24 +00001330
mistachkin52b1dbb2016-07-28 14:37:04 +00001331# Generated Tcl header files
1332#
mistachkin4ef916e2016-08-24 19:58:46 +00001333!IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
mistachkin52b1dbb2016-07-28 14:37:04 +00001334SRC12 = \
mistachkin4ef916e2016-08-24 19:58:46 +00001335 $(SQLITETCLH) \
1336 $(SQLITETCLDECLSH)
1337!ELSE
1338SRC12 =
1339!ENDIF
mistachkin52b1dbb2016-07-28 14:37:04 +00001340
drh62679202015-01-29 18:38:05 +00001341# All source code files.
1342#
mistachkinc04c54b2016-02-11 21:28:16 +00001343SRC = $(SRC00) $(SRC01) $(SRC02) $(SRC03) $(SRC04) $(SRC05) $(SRC06) $(SRC07) $(SRC08) $(SRC09) $(SRC10) $(SRC11)
drh62679202015-01-29 18:38:05 +00001344
shanehb2f20bf2011-06-17 07:07:24 +00001345# Source code to the test files.
1346#
1347TESTSRC = \
1348 $(TOP)\src\test1.c \
1349 $(TOP)\src\test2.c \
1350 $(TOP)\src\test3.c \
1351 $(TOP)\src\test4.c \
1352 $(TOP)\src\test5.c \
1353 $(TOP)\src\test6.c \
1354 $(TOP)\src\test7.c \
1355 $(TOP)\src\test8.c \
1356 $(TOP)\src\test9.c \
1357 $(TOP)\src\test_autoext.c \
1358 $(TOP)\src\test_async.c \
1359 $(TOP)\src\test_backup.c \
drhddebf162016-03-04 02:59:35 +00001360 $(TOP)\src\test_bestindex.c \
drh5de7d962014-12-05 00:17:39 +00001361 $(TOP)\src\test_blob.c \
shanehb2f20bf2011-06-17 07:07:24 +00001362 $(TOP)\src\test_btree.c \
1363 $(TOP)\src\test_config.c \
dan000f95b2016-09-09 20:00:40 +00001364 $(TOP)\src\test_delete.c \
shanehb2f20bf2011-06-17 07:07:24 +00001365 $(TOP)\src\test_demovfs.c \
1366 $(TOP)\src\test_devsym.c \
mistachkin413c63b2013-01-17 03:18:14 +00001367 $(TOP)\src\test_fs.c \
shanehb2f20bf2011-06-17 07:07:24 +00001368 $(TOP)\src\test_func.c \
shanehb2f20bf2011-06-17 07:07:24 +00001369 $(TOP)\src\test_hexio.c \
1370 $(TOP)\src\test_init.c \
1371 $(TOP)\src\test_intarray.c \
1372 $(TOP)\src\test_journal.c \
1373 $(TOP)\src\test_malloc.c \
1374 $(TOP)\src\test_multiplex.c \
1375 $(TOP)\src\test_mutex.c \
1376 $(TOP)\src\test_onefile.c \
1377 $(TOP)\src\test_osinst.c \
1378 $(TOP)\src\test_pcache.c \
1379 $(TOP)\src\test_quota.c \
1380 $(TOP)\src\test_rtree.c \
1381 $(TOP)\src\test_schema.c \
1382 $(TOP)\src\test_server.c \
1383 $(TOP)\src\test_superlock.c \
1384 $(TOP)\src\test_syscall.c \
shanehb2f20bf2011-06-17 07:07:24 +00001385 $(TOP)\src\test_tclvar.c \
1386 $(TOP)\src\test_thread.c \
1387 $(TOP)\src\test_vfs.c \
mistachkin92af1eb2015-11-30 23:29:07 +00001388 $(TOP)\src\test_windirent.c \
shanehb2f20bf2011-06-17 07:07:24 +00001389 $(TOP)\src\test_wsd.c \
1390 $(TOP)\ext\fts3\fts3_term.c \
mistachkinadb96a62012-01-16 12:33:36 +00001391 $(TOP)\ext\fts3\fts3_test.c \
mistachkin05004782016-03-30 16:23:06 +00001392 $(TOP)\ext\rbu\test_rbu.c \
1393 $(TOP)\ext\session\test_session.c
shanehb2f20bf2011-06-17 07:07:24 +00001394
mistachkinc04c54b2016-02-11 21:28:16 +00001395# Statically linked extensions.
drhe50db1c2013-04-25 14:31:46 +00001396#
drh1fb64af2013-04-25 14:36:28 +00001397TESTEXT = \
drh8416fc72013-04-25 16:42:55 +00001398 $(TOP)\ext\misc\amatch.c \
drh2e3f87a2016-07-03 02:35:47 +00001399 $(TOP)\ext\misc\carray.c \
drh8416fc72013-04-25 16:42:55 +00001400 $(TOP)\ext\misc\closure.c \
drh35db31b2016-06-02 23:13:21 +00001401 $(TOP)\ext\misc\csv.c \
drh1728bcb2014-11-10 16:49:56 +00001402 $(TOP)\ext\misc\eval.c \
drh51ed2982014-06-16 12:44:32 +00001403 $(TOP)\ext\misc\fileio.c \
drhe50db1c2013-04-25 14:31:46 +00001404 $(TOP)\ext\misc\fuzzer.c \
mistachkined52f9f2015-06-26 04:34:36 +00001405 $(TOP)\ext\fts5\fts5_tcl.c \
dand3789c02015-08-04 20:29:00 +00001406 $(TOP)\ext\fts5\fts5_test_mi.c \
dan2cfe0492016-01-14 20:05:59 +00001407 $(TOP)\ext\fts5\fts5_test_tok.c \
drh8416fc72013-04-25 16:42:55 +00001408 $(TOP)\ext\misc\ieee754.c \
drhea41dc42013-04-25 19:31:33 +00001409 $(TOP)\ext\misc\nextchar.c \
drhdef33672013-05-28 20:25:54 +00001410 $(TOP)\ext\misc\percentile.c \
drhe50db1c2013-04-25 14:31:46 +00001411 $(TOP)\ext\misc\regexp.c \
drh6bada272016-08-09 21:08:42 +00001412 $(TOP)\ext\misc\remember.c \
drh398f8722015-08-19 13:54:20 +00001413 $(TOP)\ext\misc\series.c \
drhb7045ab2013-04-25 14:59:01 +00001414 $(TOP)\ext\misc\spellfix.c \
drh5f8cdac2013-10-14 21:14:42 +00001415 $(TOP)\ext\misc\totype.c \
drhe50db1c2013-04-25 14:31:46 +00001416 $(TOP)\ext\misc\wholenumber.c
1417
shanehb2f20bf2011-06-17 07:07:24 +00001418# Source code to the library files needed by the test fixture
mistachkinadb96a62012-01-16 12:33:36 +00001419# (non-amalgamation)
shanehb2f20bf2011-06-17 07:07:24 +00001420#
1421TESTSRC2 = \
mistachkinc04c54b2016-02-11 21:28:16 +00001422 $(SRC00) \
1423 $(SRC01) \
1424 $(SRC06) \
1425 $(SRC07) \
1426 $(SRC10) \
mistachkin05004782016-03-30 16:23:06 +00001427 $(TOP)\ext\async\sqlite3async.c
shanehb2f20bf2011-06-17 07:07:24 +00001428
1429# Header files used by all library source files.
1430#
1431HDR = \
1432 $(TOP)\src\btree.h \
1433 $(TOP)\src\btreeInt.h \
1434 $(TOP)\src\hash.h \
1435 $(TOP)\src\hwtime.h \
1436 keywordhash.h \
mistachkin2318d332015-01-12 18:02:52 +00001437 $(TOP)\src\msvc.h \
shanehb2f20bf2011-06-17 07:07:24 +00001438 $(TOP)\src\mutex.h \
1439 opcodes.h \
1440 $(TOP)\src\os.h \
1441 $(TOP)\src\os_common.h \
mistachkinf74b9e02013-11-26 01:00:31 +00001442 $(TOP)\src\os_setup.h \
mistachkin8bc52622013-11-25 09:36:07 +00001443 $(TOP)\src\os_win.h \
shanehb2f20bf2011-06-17 07:07:24 +00001444 $(TOP)\src\pager.h \
1445 $(TOP)\src\pcache.h \
shaneh6e7850c2011-06-17 15:57:07 +00001446 parse.h \
drh67e65e52015-02-02 21:34:54 +00001447 $(TOP)\src\pragma.h \
mistachkin5d4d9412016-01-22 03:54:36 +00001448 $(SQLITE3H) \
mistachkine37f7392016-07-28 19:28:35 +00001449 sqlite3ext.h \
shaneh6e7850c2011-06-17 15:57:07 +00001450 $(TOP)\src\sqliteInt.h \
shanehb2f20bf2011-06-17 07:07:24 +00001451 $(TOP)\src\sqliteLimit.h \
1452 $(TOP)\src\vdbe.h \
drhe54df422013-11-12 18:37:25 +00001453 $(TOP)\src\vdbeInt.h \
drh8cd5b252015-03-02 22:06:43 +00001454 $(TOP)\src\vxworks.h \
drhe54df422013-11-12 18:37:25 +00001455 $(TOP)\src\whereInt.h
shanehb2f20bf2011-06-17 07:07:24 +00001456
1457# Header files used by extensions
1458#
1459EXTHDR = $(EXTHDR) \
1460 $(TOP)\ext\fts1\fts1.h \
1461 $(TOP)\ext\fts1\fts1_hash.h \
1462 $(TOP)\ext\fts1\fts1_tokenizer.h
1463EXTHDR = $(EXTHDR) \
1464 $(TOP)\ext\fts2\fts2.h \
1465 $(TOP)\ext\fts2\fts2_hash.h \
1466 $(TOP)\ext\fts2\fts2_tokenizer.h
1467EXTHDR = $(EXTHDR) \
1468 $(TOP)\ext\fts3\fts3.h \
1469 $(TOP)\ext\fts3\fts3Int.h \
1470 $(TOP)\ext\fts3\fts3_hash.h \
1471 $(TOP)\ext\fts3\fts3_tokenizer.h
1472EXTHDR = $(EXTHDR) \
1473 $(TOP)\ext\rtree\rtree.h
1474EXTHDR = $(EXTHDR) \
1475 $(TOP)\ext\icu\sqliteicu.h
1476EXTHDR = $(EXTHDR) \
1477 $(TOP)\ext\rtree\sqlite3rtree.h
mistachkinadb96a62012-01-16 12:33:36 +00001478EXTHDR = $(EXTHDR) \
1479 $(TOP)\ext\session\sqlite3session.h
shanehb2f20bf2011-06-17 07:07:24 +00001480
mistachkind4ab1032015-05-11 16:27:33 +00001481# executables needed for testing
drhf4375442015-05-11 12:15:45 +00001482#
1483TESTPROGS = \
1484 testfixture.exe \
mistachkinedcb4eb2016-01-22 01:25:15 +00001485 $(SQLITE3EXE) \
drhf4375442015-05-11 12:15:45 +00001486 sqlite3_analyzer.exe \
drh290fcaa2016-06-08 01:03:05 +00001487 sqldiff.exe \
1488 dbhash.exe
drhf4375442015-05-11 12:15:45 +00001489
drhea93c702015-05-26 18:15:08 +00001490# Databases containing fuzzer test cases
1491#
1492FUZZDATA = \
1493 $(TOP)\test\fuzzdata1.db \
1494 $(TOP)\test\fuzzdata2.db \
drh64ff56f2015-09-23 11:59:50 +00001495 $(TOP)\test\fuzzdata3.db \
drh362b66f2016-11-14 18:27:41 +00001496 $(TOP)\test\fuzzdata4.db \
1497 $(TOP)\test\fuzzdata5.db
mistachkin3e786092016-01-23 07:53:04 +00001498# <</mark>>
drhea93c702015-05-26 18:15:08 +00001499
mistachkin5d4d9412016-01-22 03:54:36 +00001500# Additional compiler options for the shell. These are only effective
1501# when the shell is not being dynamically linked.
drhd7f2bea2015-09-19 14:32:51 +00001502#
mistachkin5d4d9412016-01-22 03:54:36 +00001503!IF $(DYNAMIC_SHELL)==0 && $(FOR_WIN10)==0
drh70ae0e92016-08-04 13:23:28 +00001504SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_SHELL_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS
mistachkinedcb4eb2016-01-22 01:25:15 +00001505!ENDIF
1506
mistachkin3e786092016-01-23 07:53:04 +00001507# <<mark>>
mistachkin5d4d9412016-01-22 03:54:36 +00001508# Extra compiler options for various test tools.
1509#
1510MPTESTER_COMPILE_OPTS = -DSQLITE_SHELL_JSON1 -DSQLITE_ENABLE_FTS5
mistachkin8381be42015-10-09 14:23:56 +00001511FUZZERSHELL_COMPILE_OPTS = -DSQLITE_ENABLE_JSON1
drh362b66f2016-11-14 18:27:41 +00001512FUZZCHECK_COMPILE_OPTS = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMSYS5 -DSQLITE_OSS_FUZZ
1513FUZZCHECK_SRC = $(TOP)\test\fuzzcheck.c $(TOP)\test\ossfuzz.c
1514OSSSHELL_SRC = $(TOP)\test\ossshell.c $(TOP)\test\ossfuzz.c
drhf4375442015-05-11 12:15:45 +00001515
mistachkin5d4d9412016-01-22 03:54:36 +00001516# Standard options to testfixture.
drh905da632015-06-10 18:53:09 +00001517#
1518TESTOPTS = --verbose=file --output=test-out.txt
drhf4375442015-05-11 12:15:45 +00001519
mistachkind5be6f02016-01-27 07:28:33 +00001520# Extra targets for the "all" target that require Tcl.
1521#
1522!IF $(NO_TCL)==0
1523ALL_TCL_TARGETS = libtclsqlite3.lib
1524!ELSE
1525ALL_TCL_TARGETS =
1526!ENDIF
mistachkin3e786092016-01-23 07:53:04 +00001527# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001528
1529# This is the default Makefile target. The objects listed here
1530# are what get build when you type just "make" with no arguments.
1531#
mistachkind5be6f02016-01-27 07:28:33 +00001532all: dll libsqlite3.lib shell $(ALL_TCL_TARGETS)
shanehb2f20bf2011-06-17 07:07:24 +00001533
mistachkina8a18732016-01-22 22:16:50 +00001534# Dynamic link library section.
1535#
mistachkin9b88ace2016-02-26 21:01:37 +00001536dll: $(SQLITE3DLL)
mistachkina8a18732016-01-22 22:16:50 +00001537
1538# Shell executable.
1539#
mistachkin9b88ace2016-02-26 21:01:37 +00001540shell: $(SQLITE3EXE)
shanehb2f20bf2011-06-17 07:07:24 +00001541
mistachkinb0c99af2016-02-19 05:07:56 +00001542# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001543libsqlite3.lib: $(LIBOBJ)
shaneh29ebea82011-06-21 18:12:07 +00001544 $(LTLIB) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001545
1546libtclsqlite3.lib: tclsqlite.lo libsqlite3.lib
mistachkin5b663502015-10-10 23:39:55 +00001547 $(LTLIB) $(LTLIBOPTS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCLSTUB) $(TLIBS)
mistachkin3e786092016-01-23 07:53:04 +00001548# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001549
mistachkin9b88ace2016-02-26 21:01:37 +00001550$(SQLITE3DLL): $(LIBOBJ) $(LIBRESOBJS) $(CORE_LINK_DEP)
mistachkina8a18732016-01-22 22:16:50 +00001551 $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL $(CORE_LINK_OPTS) /OUT:$@ $(LIBOBJ) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001552
mistachkin9aeb9712016-02-26 23:13:16 +00001553# <<block2>>
mistachkin9b88ace2016-02-26 21:01:37 +00001554sqlite3.def: libsqlite3.lib
mistachkina8a18732016-01-22 22:16:50 +00001555 echo EXPORTS > sqlite3.def
1556 dumpbin /all libsqlite3.lib \
mistachkin9b88ace2016-02-26 21:01:37 +00001557 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl include "^\s+1 _?(sqlite3_[^@]*)(?:@\d+)?$$" \1 \
mistachkina8a18732016-01-22 22:16:50 +00001558 | sort >> sqlite3.def
mistachkin9aeb9712016-02-26 23:13:16 +00001559# <</block2>>
drhd62c0f42015-04-09 13:34:29 +00001560
mistachkin5d4d9412016-01-22 03:54:36 +00001561$(SQLITE3EXE): $(TOP)\src\shell.c $(SHELL_CORE_DEP) $(LIBRESOBJS) $(SHELL_CORE_SRC) $(SQLITE3H)
1562 $(LTLINK) $(SHELL_COMPILE_OPTS) $(READLINE_FLAGS) $(TOP)\src\shell.c $(SHELL_CORE_SRC) \
mistachkinedcb4eb2016-01-22 01:25:15 +00001563 /link $(SQLITE3EXEPDB) $(LDFLAGS) $(LTLINKOPTS) $(SHELL_LINK_OPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS)
drh268e72f2015-04-17 14:30:49 +00001564
mistachkin3e786092016-01-23 07:53:04 +00001565# <<mark>>
mistachkin5d4d9412016-01-22 03:54:36 +00001566sqldiff.exe: $(TOP)\tool\sqldiff.c $(SQLITE3C) $(SQLITE3H)
1567 $(LTLINK) $(NO_WARN) $(TOP)\tool\sqldiff.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
mistachkin44723ce2015-03-21 02:22:37 +00001568
drh290fcaa2016-06-08 01:03:05 +00001569dbhash.exe: $(TOP)\tool\dbhash.c $(SQLITE3C) $(SQLITE3H)
1570 $(LTLINK) $(NO_WARN) $(TOP)\tool\dbhash.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
1571
drhda110bf2016-05-05 17:15:23 +00001572scrub.exe: $(TOP)\ext\misc\scrub.c $(SQLITE3C) $(SQLITE3H)
1573 $(LTLINK) $(NO_WARN) $(TOP)\ext\misc\scrub.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
1574
drhfd0d93f2016-02-07 00:08:08 +00001575srcck1.exe: $(TOP)\tool\srcck1.c
1576 $(BCC) $(NO_WARN) -Fe$@ $(TOP)\tool\srcck1.c
1577
1578sourcetest: srcck1.exe sqlite3.c
1579 srcck1.exe sqlite3.c
1580
mistachkin5d4d9412016-01-22 03:54:36 +00001581fuzzershell.exe: $(TOP)\tool\fuzzershell.c $(SQLITE3C) $(SQLITE3H)
1582 $(LTLINK) $(NO_WARN) $(FUZZERSHELL_COMPILE_OPTS) $(TOP)\tool\fuzzershell.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drhbc94dbb2013-04-08 14:28:33 +00001583
drh362b66f2016-11-14 18:27:41 +00001584fuzzcheck.exe: $(FUZZCHECK_SRC) $(SQLITE3C) $(SQLITE3H)
1585 $(LTLINK) $(NO_WARN) $(FUZZCHECK_COMPILE_OPTS) $(FUZZCHECK_SRC) $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
1586
1587ossshell.exe: $(OSSSHELL_SRC) $(SQLITE3C) $(SQLITE3H)
1588 $(LTLINK) $(NO_WARN) $(FUZZCHECK_COMPILE_OPTS) $(OSSSHELL_SRC) $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh1573dc32015-05-25 22:29:26 +00001589
mistachkin5d4d9412016-01-22 03:54:36 +00001590mptester.exe: $(TOP)\mptest\mptest.c $(SQLITE3C) $(SQLITE3H)
1591 $(LTLINK) $(NO_WARN) $(MPTESTER_COMPILE_OPTS) $(TOP)\mptest\mptest.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drhbc94dbb2013-04-08 14:28:33 +00001592
mistachkineb48b062015-03-31 17:45:44 +00001593MPTEST1 = mptester mptest.db $(TOP)\mptest\crash01.test --repeat 20
1594MPTEST2 = mptester mptest.db $(TOP)\mptest\multiwrite01.test --repeat 20
mistachkin4d2daba2015-03-31 16:42:16 +00001595
drhfe0ba712015-03-31 13:46:13 +00001596mptest: mptester.exe
mistachkin4d2daba2015-03-31 16:42:16 +00001597 del /Q mptest.db 2>NUL
drhfe0ba712015-03-31 13:46:13 +00001598 $(MPTEST1) --journalmode DELETE
1599 $(MPTEST2) --journalmode WAL
1600 $(MPTEST1) --journalmode WAL
1601 $(MPTEST2) --journalmode PERSIST
1602 $(MPTEST1) --journalmode PERSIST
1603 $(MPTEST2) --journalmode TRUNCATE
1604 $(MPTEST1) --journalmode TRUNCATE
1605 $(MPTEST2) --journalmode DELETE
1606
shanehb2f20bf2011-06-17 07:07:24 +00001607# This target creates a directory named "tsrc" and fills it with
1608# copies of all of the C source code and header files needed to
1609# build on the target system. Some of the C source code and header
1610# files are automatically generated. This target takes care of
1611# all that automatic generation.
1612#
mistachkin4ef916e2016-08-24 19:58:46 +00001613.target_source: $(SRC) $(TOP)\tool\vdbe-compress.tcl fts5.c $(SQLITE_TCL_DEP)
mistachkin44723ce2015-03-21 02:22:37 +00001614 -rmdir /Q/S tsrc 2>NUL
shanehb2f20bf2011-06-17 07:07:24 +00001615 -mkdir tsrc
mistachkine2eb2592016-02-11 21:38:05 +00001616 for %i in ($(SRC00)) do copy /Y %i tsrc
1617 for %i in ($(SRC01)) do copy /Y %i tsrc
1618 for %i in ($(SRC02)) do copy /Y %i tsrc
1619 for %i in ($(SRC03)) do copy /Y %i tsrc
1620 for %i in ($(SRC04)) do copy /Y %i tsrc
1621 for %i in ($(SRC05)) do copy /Y %i tsrc
1622 for %i in ($(SRC06)) do copy /Y %i tsrc
1623 for %i in ($(SRC07)) do copy /Y %i tsrc
1624 for %i in ($(SRC08)) do copy /Y %i tsrc
1625 for %i in ($(SRC09)) do copy /Y %i tsrc
1626 for %i in ($(SRC10)) do copy /Y %i tsrc
1627 for %i in ($(SRC11)) do copy /Y %i tsrc
mistachkin52b1dbb2016-07-28 14:37:04 +00001628 for %i in ($(SRC12)) do copy /Y %i tsrc
drh50065652015-10-08 19:29:18 +00001629 copy /Y fts5.c tsrc
1630 copy /Y fts5.h tsrc
mistachkin44723ce2015-03-21 02:22:37 +00001631 del /Q tsrc\sqlite.h.in tsrc\parse.y 2>NUL
drh2dc06482013-12-11 00:59:10 +00001632 $(TCLSH_CMD) $(TOP)\tool\vdbe-compress.tcl $(OPTS) < tsrc\vdbe.c > vdbe.new
shanehb2f20bf2011-06-17 07:07:24 +00001633 move vdbe.new tsrc\vdbe.c
1634 echo > .target_source
1635
mistachkin4ef916e2016-08-24 19:58:46 +00001636sqlite3.c: .target_source sqlite3ext.h $(MKSQLITE3C_TOOL)
1637 $(TCLSH_CMD) $(MKSQLITE3C_TOOL) $(MKSQLITE3C_ARGS)
drhe191e2c2013-03-19 15:23:18 +00001638 copy tsrc\shell.c .
drhe191e2c2013-03-19 15:23:18 +00001639 copy $(TOP)\ext\session\sqlite3session.h .
shanehb2f20bf2011-06-17 07:07:24 +00001640
mistachkin48dd9de2012-12-06 04:33:13 +00001641sqlite3-all.c: sqlite3.c $(TOP)\tool\split-sqlite3c.tcl
1642 $(TCLSH_CMD) $(TOP)\tool\split-sqlite3c.tcl
mistachkin3e786092016-01-23 07:53:04 +00001643# <</mark>>
mistachkin76510912013-10-11 23:01:18 +00001644
shanehb2f20bf2011-06-17 07:07:24 +00001645# Rule to build the amalgamation
1646#
mistachkin76510912013-10-11 23:01:18 +00001647sqlite3.lo: $(SQLITE3C)
mistachkin44723ce2015-03-21 02:22:37 +00001648 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(SQLITE3C)
shanehb2f20bf2011-06-17 07:07:24 +00001649
mistachkin3e786092016-01-23 07:53:04 +00001650# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001651# Rules to build the LEMON compiler generator
1652#
drh82415f22015-11-09 19:33:42 +00001653lempar.c: $(TOP)\tool\lempar.c
1654 copy $(TOP)\tool\lempar.c .
shanehb2f20bf2011-06-17 07:07:24 +00001655
1656lemon.exe: $(TOP)\tool\lemon.c lempar.c
mistachkin2318d332015-01-12 18:02:52 +00001657 $(BCC) $(NO_WARN) -Daccess=_access \
mistachkin460cd9c2015-10-14 22:46:37 +00001658 -Fe$@ $(TOP)\tool\lemon.c /link $(LDFLAGS) $(NLTLINKOPTS) $(NLTLIBPATHS)
shanehb2f20bf2011-06-17 07:07:24 +00001659
1660# Rules to build individual *.lo files from generated *.c files. This
1661# applies to:
1662#
1663# parse.lo
1664# opcodes.lo
1665#
1666parse.lo: parse.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001667 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c parse.c
shanehb2f20bf2011-06-17 07:07:24 +00001668
1669opcodes.lo: opcodes.c
mistachkin44723ce2015-03-21 02:22:37 +00001670 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c opcodes.c
mistachkin3e786092016-01-23 07:53:04 +00001671# <</mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001672
mistachkin4d9d1f42012-09-03 10:32:32 +00001673# Rule to build the Win32 resources object file.
1674#
mistachkin08c1c312012-10-06 03:48:25 +00001675!IF $(USE_RC)!=0
mistachkin3e786092016-01-23 07:53:04 +00001676# <<block1>>
mistachkina8a18732016-01-22 22:16:50 +00001677$(LIBRESOBJS): $(TOP)\src\sqlite3.rc $(SQLITE3H)
mistachkin4d9d1f42012-09-03 10:32:32 +00001678 echo #ifndef SQLITE_RESOURCE_VERSION > sqlite3rc.h
mistachkin8ccc6d42012-09-27 21:03:53 +00001679 for /F %%V in ('type "$(TOP)\VERSION"') do ( \
mistachkin4d9d1f42012-09-03 10:32:32 +00001680 echo #define SQLITE_RESOURCE_VERSION %%V \
mistachkin946ef602015-10-10 01:55:57 +00001681 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact . ^, >> sqlite3rc.h \
mistachkin4d9d1f42012-09-03 10:32:32 +00001682 )
1683 echo #endif >> sqlite3rc.h
mistachkin08c1c312012-10-06 03:48:25 +00001684 $(LTRCOMPILE) -fo $(LIBRESOBJS) $(TOP)\src\sqlite3.rc
mistachkin3e786092016-01-23 07:53:04 +00001685# <</block1>>
mistachkin08c1c312012-10-06 03:48:25 +00001686!ENDIF
mistachkin4d9d1f42012-09-03 10:32:32 +00001687
mistachkin3e786092016-01-23 07:53:04 +00001688# <<mark>>
shanehb2f20bf2011-06-17 07:07:24 +00001689# Rules to build individual *.lo files from files in the src directory.
1690#
1691alter.lo: $(TOP)\src\alter.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001692 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\alter.c
shanehb2f20bf2011-06-17 07:07:24 +00001693
1694analyze.lo: $(TOP)\src\analyze.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001695 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\analyze.c
shanehb2f20bf2011-06-17 07:07:24 +00001696
1697attach.lo: $(TOP)\src\attach.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001698 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\attach.c
shanehb2f20bf2011-06-17 07:07:24 +00001699
1700auth.lo: $(TOP)\src\auth.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001701 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\auth.c
shanehb2f20bf2011-06-17 07:07:24 +00001702
1703backup.lo: $(TOP)\src\backup.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001704 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\backup.c
shanehb2f20bf2011-06-17 07:07:24 +00001705
1706bitvec.lo: $(TOP)\src\bitvec.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001707 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\bitvec.c
shanehb2f20bf2011-06-17 07:07:24 +00001708
1709btmutex.lo: $(TOP)\src\btmutex.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001710 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\btmutex.c
shanehb2f20bf2011-06-17 07:07:24 +00001711
1712btree.lo: $(TOP)\src\btree.c $(HDR) $(TOP)\src\pager.h
mistachkin44723ce2015-03-21 02:22:37 +00001713 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\btree.c
shanehb2f20bf2011-06-17 07:07:24 +00001714
1715build.lo: $(TOP)\src\build.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001716 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\build.c
shanehb2f20bf2011-06-17 07:07:24 +00001717
1718callback.lo: $(TOP)\src\callback.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001719 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\callback.c
shanehb2f20bf2011-06-17 07:07:24 +00001720
1721complete.lo: $(TOP)\src\complete.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001722 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\complete.c
shanehb2f20bf2011-06-17 07:07:24 +00001723
1724ctime.lo: $(TOP)\src\ctime.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001725 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\ctime.c
shanehb2f20bf2011-06-17 07:07:24 +00001726
1727date.lo: $(TOP)\src\date.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001728 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\date.c
shanehb2f20bf2011-06-17 07:07:24 +00001729
drh1a4a6802015-05-04 18:31:09 +00001730dbstat.lo: $(TOP)\src\date.c $(HDR)
1731 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\dbstat.c
1732
shanehb2f20bf2011-06-17 07:07:24 +00001733delete.lo: $(TOP)\src\delete.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001734 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\delete.c
shanehb2f20bf2011-06-17 07:07:24 +00001735
1736expr.lo: $(TOP)\src\expr.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001737 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\expr.c
shanehb2f20bf2011-06-17 07:07:24 +00001738
1739fault.lo: $(TOP)\src\fault.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001740 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\fault.c
shanehb2f20bf2011-06-17 07:07:24 +00001741
1742fkey.lo: $(TOP)\src\fkey.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001743 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\fkey.c
shanehb2f20bf2011-06-17 07:07:24 +00001744
1745func.lo: $(TOP)\src\func.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001746 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\func.c
shanehb2f20bf2011-06-17 07:07:24 +00001747
1748global.lo: $(TOP)\src\global.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001749 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\global.c
shanehb2f20bf2011-06-17 07:07:24 +00001750
1751hash.lo: $(TOP)\src\hash.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001752 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\hash.c
shanehb2f20bf2011-06-17 07:07:24 +00001753
1754insert.lo: $(TOP)\src\insert.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001755 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\insert.c
shanehb2f20bf2011-06-17 07:07:24 +00001756
shanehb2f20bf2011-06-17 07:07:24 +00001757legacy.lo: $(TOP)\src\legacy.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001758 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\legacy.c
shanehb2f20bf2011-06-17 07:07:24 +00001759
1760loadext.lo: $(TOP)\src\loadext.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001761 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\loadext.c
shanehb2f20bf2011-06-17 07:07:24 +00001762
1763main.lo: $(TOP)\src\main.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001764 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\main.c
shanehb2f20bf2011-06-17 07:07:24 +00001765
1766malloc.lo: $(TOP)\src\malloc.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001767 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\malloc.c
shanehb2f20bf2011-06-17 07:07:24 +00001768
1769mem0.lo: $(TOP)\src\mem0.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001770 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem0.c
shanehb2f20bf2011-06-17 07:07:24 +00001771
1772mem1.lo: $(TOP)\src\mem1.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001773 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem1.c
shanehb2f20bf2011-06-17 07:07:24 +00001774
1775mem2.lo: $(TOP)\src\mem2.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001776 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem2.c
shanehb2f20bf2011-06-17 07:07:24 +00001777
1778mem3.lo: $(TOP)\src\mem3.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001779 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem3.c
shanehb2f20bf2011-06-17 07:07:24 +00001780
1781mem5.lo: $(TOP)\src\mem5.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001782 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem5.c
shanehb2f20bf2011-06-17 07:07:24 +00001783
1784memjournal.lo: $(TOP)\src\memjournal.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001785 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\memjournal.c
shanehb2f20bf2011-06-17 07:07:24 +00001786
1787mutex.lo: $(TOP)\src\mutex.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001788 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex.c
shanehb2f20bf2011-06-17 07:07:24 +00001789
1790mutex_noop.lo: $(TOP)\src\mutex_noop.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001791 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex_noop.c
shanehb2f20bf2011-06-17 07:07:24 +00001792
shanehb2f20bf2011-06-17 07:07:24 +00001793mutex_unix.lo: $(TOP)\src\mutex_unix.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001794 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex_unix.c
shanehb2f20bf2011-06-17 07:07:24 +00001795
1796mutex_w32.lo: $(TOP)\src\mutex_w32.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001797 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex_w32.c
shanehb2f20bf2011-06-17 07:07:24 +00001798
1799notify.lo: $(TOP)\src\notify.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001800 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\notify.c
shanehb2f20bf2011-06-17 07:07:24 +00001801
1802pager.lo: $(TOP)\src\pager.c $(HDR) $(TOP)\src\pager.h
mistachkin44723ce2015-03-21 02:22:37 +00001803 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pager.c
shanehb2f20bf2011-06-17 07:07:24 +00001804
1805pcache.lo: $(TOP)\src\pcache.c $(HDR) $(TOP)\src\pcache.h
mistachkin44723ce2015-03-21 02:22:37 +00001806 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pcache.c
shanehb2f20bf2011-06-17 07:07:24 +00001807
1808pcache1.lo: $(TOP)\src\pcache1.c $(HDR) $(TOP)\src\pcache.h
mistachkin44723ce2015-03-21 02:22:37 +00001809 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pcache1.c
shanehb2f20bf2011-06-17 07:07:24 +00001810
1811os.lo: $(TOP)\src\os.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001812 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\os.c
shanehb2f20bf2011-06-17 07:07:24 +00001813
1814os_unix.lo: $(TOP)\src\os_unix.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001815 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\os_unix.c
shanehb2f20bf2011-06-17 07:07:24 +00001816
1817os_win.lo: $(TOP)\src\os_win.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001818 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\os_win.c
shanehb2f20bf2011-06-17 07:07:24 +00001819
shanehb2f20bf2011-06-17 07:07:24 +00001820pragma.lo: $(TOP)\src\pragma.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001821 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pragma.c
shanehb2f20bf2011-06-17 07:07:24 +00001822
1823prepare.lo: $(TOP)\src\prepare.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001824 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\prepare.c
shanehb2f20bf2011-06-17 07:07:24 +00001825
1826printf.lo: $(TOP)\src\printf.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001827 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\printf.c
shanehb2f20bf2011-06-17 07:07:24 +00001828
1829random.lo: $(TOP)\src\random.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001830 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\random.c
shanehb2f20bf2011-06-17 07:07:24 +00001831
1832resolve.lo: $(TOP)\src\resolve.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001833 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\resolve.c
shanehb2f20bf2011-06-17 07:07:24 +00001834
1835rowset.lo: $(TOP)\src\rowset.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001836 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\rowset.c
shanehb2f20bf2011-06-17 07:07:24 +00001837
1838select.lo: $(TOP)\src\select.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001839 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\select.c
shanehb2f20bf2011-06-17 07:07:24 +00001840
1841status.lo: $(TOP)\src\status.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001842 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\status.c
shanehb2f20bf2011-06-17 07:07:24 +00001843
1844table.lo: $(TOP)\src\table.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001845 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\table.c
shanehb2f20bf2011-06-17 07:07:24 +00001846
drhf51446a2012-07-21 19:40:42 +00001847threads.lo: $(TOP)\src\threads.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001848 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\threads.c
drhf51446a2012-07-21 19:40:42 +00001849
shanehb2f20bf2011-06-17 07:07:24 +00001850tokenize.lo: $(TOP)\src\tokenize.c keywordhash.h $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001851 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\tokenize.c
shanehb2f20bf2011-06-17 07:07:24 +00001852
drh38b41492015-06-08 15:08:15 +00001853treeview.lo: $(TOP)\src\treeview.c $(HDR)
1854 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\treeview.c
1855
shanehb2f20bf2011-06-17 07:07:24 +00001856trigger.lo: $(TOP)\src\trigger.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001857 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\trigger.c
shanehb2f20bf2011-06-17 07:07:24 +00001858
1859update.lo: $(TOP)\src\update.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001860 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\update.c
shanehb2f20bf2011-06-17 07:07:24 +00001861
1862utf.lo: $(TOP)\src\utf.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001863 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\utf.c
shanehb2f20bf2011-06-17 07:07:24 +00001864
1865util.lo: $(TOP)\src\util.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001866 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\util.c
shanehb2f20bf2011-06-17 07:07:24 +00001867
1868vacuum.lo: $(TOP)\src\vacuum.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001869 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vacuum.c
shanehb2f20bf2011-06-17 07:07:24 +00001870
1871vdbe.lo: $(TOP)\src\vdbe.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001872 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbe.c
shanehb2f20bf2011-06-17 07:07:24 +00001873
1874vdbeapi.lo: $(TOP)\src\vdbeapi.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001875 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbeapi.c
shanehb2f20bf2011-06-17 07:07:24 +00001876
1877vdbeaux.lo: $(TOP)\src\vdbeaux.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001878 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbeaux.c
shanehb2f20bf2011-06-17 07:07:24 +00001879
1880vdbeblob.lo: $(TOP)\src\vdbeblob.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001881 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbeblob.c
shanehb2f20bf2011-06-17 07:07:24 +00001882
1883vdbemem.lo: $(TOP)\src\vdbemem.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001884 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbemem.c
shanehb2f20bf2011-06-17 07:07:24 +00001885
mistachkin81c428a2011-08-17 02:19:54 +00001886vdbesort.lo: $(TOP)\src\vdbesort.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001887 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbesort.c
mistachkin81c428a2011-08-17 02:19:54 +00001888
shanehb2f20bf2011-06-17 07:07:24 +00001889vdbetrace.lo: $(TOP)\src\vdbetrace.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001890 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbetrace.c
shanehb2f20bf2011-06-17 07:07:24 +00001891
1892vtab.lo: $(TOP)\src\vtab.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001893 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vtab.c
shanehb2f20bf2011-06-17 07:07:24 +00001894
1895wal.lo: $(TOP)\src\wal.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001896 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\wal.c
shanehb2f20bf2011-06-17 07:07:24 +00001897
1898walker.lo: $(TOP)\src\walker.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001899 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\walker.c
shanehb2f20bf2011-06-17 07:07:24 +00001900
1901where.lo: $(TOP)\src\where.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001902 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\where.c
shanehb2f20bf2011-06-17 07:07:24 +00001903
drh6f82e852015-06-06 20:12:09 +00001904wherecode.lo: $(TOP)\src\wherecode.c $(HDR)
1905 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\wherecode.c
1906
drh6c1f4ef2015-06-08 14:23:15 +00001907whereexpr.lo: $(TOP)\src\whereexpr.c $(HDR)
1908 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\whereexpr.c
1909
mistachkin4ef916e2016-08-24 19:58:46 +00001910tclsqlite.lo: $(TOP)\src\tclsqlite.c $(HDR) $(SQLITE_TCL_DEP)
mistachkin44723ce2015-03-21 02:22:37 +00001911 $(LTCOMPILE) $(NO_WARN) -DUSE_TCL_STUBS=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c
shanehb2f20bf2011-06-17 07:07:24 +00001912
mistachkin4ef916e2016-08-24 19:58:46 +00001913tclsqlite-shell.lo: $(TOP)\src\tclsqlite.c $(HDR) $(SQLITE_TCL_DEP)
mistachkin44723ce2015-03-21 02:22:37 +00001914 $(LTCOMPILE) $(NO_WARN) -DTCLSH=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c
shanehb2f20bf2011-06-17 07:07:24 +00001915
mistachkin5d4d9412016-01-22 03:54:36 +00001916tclsqlite3.exe: tclsqlite-shell.lo $(SQLITE3C) $(SQLITE3H) $(LIBRESOBJS)
mistachkin78e3f612015-10-14 20:01:12 +00001917 $(LTLINK) $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /OUT:$@ tclsqlite-shell.lo $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001918
1919# Rules to build opcodes.c and opcodes.h
1920#
drh7651e0a2015-10-07 12:11:36 +00001921opcodes.c: opcodes.h $(TOP)\tool\mkopcodec.tcl
1922 $(TCLSH_CMD) $(TOP)\tool\mkopcodec.tcl opcodes.h > opcodes.c
shanehb2f20bf2011-06-17 07:07:24 +00001923
drhb15393b2015-10-07 02:52:09 +00001924opcodes.h: parse.h $(TOP)\src\vdbe.c $(TOP)\tool\mkopcodeh.tcl
mistachkin946ef602015-10-10 01:55:57 +00001925 type parse.h $(TOP)\src\vdbe.c | $(TCLSH_CMD) $(TOP)\tool\mkopcodeh.tcl > opcodes.h
shanehb2f20bf2011-06-17 07:07:24 +00001926
1927# Rules to build parse.c and parse.h - the outputs of lemon.
1928#
1929parse.h: parse.c
1930
drh60a15a42015-10-07 12:21:14 +00001931parse.c: $(TOP)\src\parse.y lemon.exe $(TOP)\tool\addopcodes.tcl
mistachkin44723ce2015-03-21 02:22:37 +00001932 del /Q parse.y parse.h parse.h.temp 2>NUL
shanehb2f20bf2011-06-17 07:07:24 +00001933 copy $(TOP)\src\parse.y .
mistachkinedcb4eb2016-01-22 01:25:15 +00001934 .\lemon.exe $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) $(OPTS) parse.y
shanehb2f20bf2011-06-17 07:07:24 +00001935 move parse.h parse.h.temp
drh60a15a42015-10-07 12:21:14 +00001936 $(TCLSH_CMD) $(TOP)\tool\addopcodes.tcl parse.h.temp > parse.h
shanehb2f20bf2011-06-17 07:07:24 +00001937
mistachkin5d4d9412016-01-22 03:54:36 +00001938$(SQLITE3H): $(TOP)\src\sqlite.h.in $(TOP)\manifest.uuid $(TOP)\VERSION
mistachkin4ef916e2016-08-24 19:58:46 +00001939 $(TCLSH_CMD) $(TOP)\tool\mksqlite3h.tcl $(TOP:\=/) > $(SQLITE3H) $(MKSQLITE3H_ARGS)
shanehb2f20bf2011-06-17 07:07:24 +00001940
mistachkin9b88ace2016-02-26 21:01:37 +00001941sqlite3ext.h: .target_source
mistachkin4ef916e2016-08-24 19:58:46 +00001942!IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
mistachkinc0bebc12016-07-28 18:49:20 +00001943 type tsrc\sqlite3ext.h | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "\(\*\)" "(SQLITE_CALLBACK *)" \
1944 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "\(\*" "(SQLITE_APICALL *" > sqlite3ext.h
mistachkine37f7392016-07-28 19:28:35 +00001945 copy /Y sqlite3ext.h tsrc\sqlite3ext.h
mistachkin4ef916e2016-08-24 19:58:46 +00001946!ELSE
1947 copy /Y tsrc\sqlite3ext.h sqlite3ext.h
1948!ENDIF
mistachkinc978f2d2015-09-21 23:49:35 +00001949
shanehb2f20bf2011-06-17 07:07:24 +00001950mkkeywordhash.exe: $(TOP)\tool\mkkeywordhash.c
mistachkinedcb4eb2016-01-22 01:25:15 +00001951 $(BCC) $(NO_WARN) -Fe$@ $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) $(OPTS) \
mistachkin460cd9c2015-10-14 22:46:37 +00001952 $(TOP)\tool\mkkeywordhash.c /link $(LDFLAGS) $(NLTLINKOPTS) $(NLTLIBPATHS)
shanehb2f20bf2011-06-17 07:07:24 +00001953
1954keywordhash.h: $(TOP)\tool\mkkeywordhash.c mkkeywordhash.exe
mistachkin5b0b6fd2011-06-25 01:14:36 +00001955 .\mkkeywordhash.exe > keywordhash.h
shanehb2f20bf2011-06-17 07:07:24 +00001956
1957
1958
1959# Rules to build the extension objects.
1960#
1961icu.lo: $(TOP)\ext\icu\icu.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001962 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\icu\icu.c
shanehb2f20bf2011-06-17 07:07:24 +00001963
1964fts2.lo: $(TOP)\ext\fts2\fts2.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001965 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2.c
shanehb2f20bf2011-06-17 07:07:24 +00001966
1967fts2_hash.lo: $(TOP)\ext\fts2\fts2_hash.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001968 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_hash.c
shanehb2f20bf2011-06-17 07:07:24 +00001969
1970fts2_icu.lo: $(TOP)\ext\fts2\fts2_icu.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001971 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_icu.c
shanehb2f20bf2011-06-17 07:07:24 +00001972
1973fts2_porter.lo: $(TOP)\ext\fts2\fts2_porter.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001974 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_porter.c
shanehb2f20bf2011-06-17 07:07:24 +00001975
1976fts2_tokenizer.lo: $(TOP)\ext\fts2\fts2_tokenizer.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001977 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_tokenizer.c
shanehb2f20bf2011-06-17 07:07:24 +00001978
1979fts2_tokenizer1.lo: $(TOP)\ext\fts2\fts2_tokenizer1.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001980 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_tokenizer1.c
shanehb2f20bf2011-06-17 07:07:24 +00001981
1982fts3.lo: $(TOP)\ext\fts3\fts3.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001983 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3.c
shanehb2f20bf2011-06-17 07:07:24 +00001984
1985fts3_aux.lo: $(TOP)\ext\fts3\fts3_aux.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001986 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_aux.c
shanehb2f20bf2011-06-17 07:07:24 +00001987
1988fts3_expr.lo: $(TOP)\ext\fts3\fts3_expr.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001989 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_expr.c
shanehb2f20bf2011-06-17 07:07:24 +00001990
1991fts3_hash.lo: $(TOP)\ext\fts3\fts3_hash.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001992 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_hash.c
shanehb2f20bf2011-06-17 07:07:24 +00001993
1994fts3_icu.lo: $(TOP)\ext\fts3\fts3_icu.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001995 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_icu.c
shanehb2f20bf2011-06-17 07:07:24 +00001996
1997fts3_snippet.lo: $(TOP)\ext\fts3\fts3_snippet.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001998 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_snippet.c
shanehb2f20bf2011-06-17 07:07:24 +00001999
2000fts3_porter.lo: $(TOP)\ext\fts3\fts3_porter.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002001 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_porter.c
shanehb2f20bf2011-06-17 07:07:24 +00002002
2003fts3_tokenizer.lo: $(TOP)\ext\fts3\fts3_tokenizer.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002004 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenizer.c
shanehb2f20bf2011-06-17 07:07:24 +00002005
2006fts3_tokenizer1.lo: $(TOP)\ext\fts3\fts3_tokenizer1.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002007 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenizer1.c
shanehb2f20bf2011-06-17 07:07:24 +00002008
drh4d648c72013-04-22 17:07:56 +00002009fts3_tokenize_vtab.lo: $(TOP)\ext\fts3\fts3_tokenize_vtab.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002010 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenize_vtab.c
drh4d648c72013-04-22 17:07:56 +00002011
drh391d4ba2012-05-28 20:22:16 +00002012fts3_unicode.lo: $(TOP)\ext\fts3\fts3_unicode.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002013 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_unicode.c
drh391d4ba2012-05-28 20:22:16 +00002014
2015fts3_unicode2.lo: $(TOP)\ext\fts3\fts3_unicode2.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002016 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_unicode2.c
drh391d4ba2012-05-28 20:22:16 +00002017
shanehb2f20bf2011-06-17 07:07:24 +00002018fts3_write.lo: $(TOP)\ext\fts3\fts3_write.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002019 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_write.c
shanehb2f20bf2011-06-17 07:07:24 +00002020
2021rtree.lo: $(TOP)\ext\rtree\rtree.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00002022 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\rtree\rtree.c
shanehb2f20bf2011-06-17 07:07:24 +00002023
mistachkin4f2c8222016-04-11 22:23:04 +00002024sqlite3session.lo: $(TOP)\ext\session\sqlite3session.c $(HDR) $(EXTHDR)
mistachkin05004782016-03-30 16:23:06 +00002025 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\session\sqlite3session.c
drh498dcae2013-03-13 11:42:00 +00002026
mistachkined52f9f2015-06-26 04:34:36 +00002027# FTS5 things
2028#
2029FTS5_SRC = \
2030 $(TOP)\ext\fts5\fts5.h \
2031 $(TOP)\ext\fts5\fts5Int.h \
2032 $(TOP)\ext\fts5\fts5_aux.c \
2033 $(TOP)\ext\fts5\fts5_buffer.c \
2034 $(TOP)\ext\fts5\fts5_main.c \
2035 $(TOP)\ext\fts5\fts5_config.c \
2036 $(TOP)\ext\fts5\fts5_expr.c \
2037 $(TOP)\ext\fts5\fts5_hash.c \
2038 $(TOP)\ext\fts5\fts5_index.c \
2039 fts5parse.c fts5parse.h \
2040 $(TOP)\ext\fts5\fts5_storage.c \
2041 $(TOP)\ext\fts5\fts5_tokenize.c \
2042 $(TOP)\ext\fts5\fts5_unicode2.c \
2043 $(TOP)\ext\fts5\fts5_varint.c \
2044 $(TOP)\ext\fts5\fts5_vocab.c
2045
2046fts5parse.c: $(TOP)\ext\fts5\fts5parse.y lemon.exe
2047 copy $(TOP)\ext\fts5\fts5parse.y .
2048 del /Q fts5parse.h 2>NUL
mistachkinedcb4eb2016-01-22 01:25:15 +00002049 .\lemon.exe $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) $(OPTS) fts5parse.y
mistachkined52f9f2015-06-26 04:34:36 +00002050
mistachkin9b88ace2016-02-26 21:01:37 +00002051fts5parse.h: fts5parse.c
mistachkined52f9f2015-06-26 04:34:36 +00002052
mistachkin9b88ace2016-02-26 21:01:37 +00002053fts5.c: $(FTS5_SRC)
mistachkined52f9f2015-06-26 04:34:36 +00002054 $(TCLSH_CMD) $(TOP)\ext\fts5\tool\mkfts5c.tcl
dana153bbc2015-07-02 20:12:34 +00002055 copy $(TOP)\ext\fts5\fts5.h .
mistachkined52f9f2015-06-26 04:34:36 +00002056
2057fts5.lo: fts5.c $(HDR) $(EXTHDR)
mistachkin95ae9582015-06-26 20:45:43 +00002058 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c fts5.c
2059
2060fts5_ext.lo: fts5.c $(HDR) $(EXTHDR)
mistachkinae6ca8e2015-07-02 16:50:43 +00002061 $(LTCOMPILE) $(NO_WARN) -c fts5.c
shanehb2f20bf2011-06-17 07:07:24 +00002062
mistachkin95ae9582015-06-26 20:45:43 +00002063fts5.dll: fts5_ext.lo
2064 $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /OUT:$@ fts5_ext.lo
shanehb2f20bf2011-06-17 07:07:24 +00002065
mistachkin83a22532016-01-14 18:01:16 +00002066sqlite3rbu.lo: $(TOP)\ext\rbu\sqlite3rbu.c $(HDR) $(EXTHDR)
2067 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\rbu\sqlite3rbu.c
drh76473772016-01-14 13:22:24 +00002068
shanehb2f20bf2011-06-17 07:07:24 +00002069# Rules to build the 'testfixture' application.
2070#
2071# If using the amalgamation, use sqlite3.c directly to build the test
2072# fixture. Otherwise link against libsqlite3.lib. (This distinction is
2073# necessary because the test fixture requires non-API symbols which are
2074# hidden when the library is built via the amalgamation).
2075#
2076TESTFIXTURE_FLAGS = -DTCLSH=1 -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
mistachkin27b2f052015-01-12 19:49:46 +00002077TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_SERVER=1 -DSQLITE_PRIVATE=""
2078TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_CORE $(NO_WARN)
drhdbc49162016-03-02 03:28:07 +00002079TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_SERIES_CONSTRAINT_VERIFY=1
drh9878fef2016-03-04 03:43:10 +00002080TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_DEFAULT_PAGE_SIZE=1024
mistachkin69def7f2016-07-28 04:14:37 +00002081TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) $(TEST_CCONV_OPTS)
shanehb2f20bf2011-06-17 07:07:24 +00002082
mistachkinc04c54b2016-02-11 21:28:16 +00002083TESTFIXTURE_SRC0 = $(TESTEXT) $(TESTSRC2)
mistachkin05004782016-03-30 16:23:06 +00002084TESTFIXTURE_SRC1 = $(TESTEXT) $(SQLITE3C)
shanehb2f20bf2011-06-17 07:07:24 +00002085!IF $(USE_AMALGAMATION)==0
2086TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC0)
2087!ELSE
2088TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC1)
2089!ENDIF
2090
mistachkin4ef916e2016-08-24 19:58:46 +00002091!IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
mistachkin52b1dbb2016-07-28 14:37:04 +00002092sqlite_tclDecls.h:
mistachkin4ef916e2016-08-24 19:58:46 +00002093 echo #ifndef SQLITE_TCLAPI > $(SQLITETCLDECLSH)
2094 echo # define SQLITE_TCLAPI >> $(SQLITETCLDECLSH)
2095 echo #endif >> $(SQLITETCLDECLSH)
mistachkinf27a80c2016-07-28 16:09:52 +00002096 type "$(TCLINCDIR)\tclDecls.h" \
mistachkina121cc72016-07-28 18:06:52 +00002097 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "^(EXTERN(?: CONST\d+?)?\s+?[^\(]*?\s+?)Tcl_" "\1 SQLITE_TCLAPI Tcl_" \
mistachkinf27a80c2016-07-28 16:09:52 +00002098 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "^(EXTERN\s+?(?:void|VOID)\s+?)TclFreeObj" "\1 SQLITE_TCLAPI TclFreeObj" \
2099 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "\(\*tcl_" "(SQLITE_TCLAPI *tcl_" \
mistachkin7c60b262016-07-28 18:18:53 +00002100 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "\(\*tclFreeObj" "(SQLITE_TCLAPI *tclFreeObj" \
mistachkin4ef916e2016-08-24 19:58:46 +00002101 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "\(\*" "(SQLITE_TCLAPI *" >> $(SQLITETCLDECLSH)
mistachkin52b1dbb2016-07-28 14:37:04 +00002102
mistachkin4ef916e2016-08-24 19:58:46 +00002103sqlite_tcl.h:
mistachkinf27a80c2016-07-28 16:09:52 +00002104 type "$(TCLINCDIR)\tcl.h" | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact tclDecls.h sqlite_tclDecls.h \
2105 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "typedef (.*?)\(Tcl_" "typedef \1 (SQLITE_TCLAPI Tcl_" \
2106 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact "void (*freeProc)" "void (SQLITE_TCLAPI *freeProc)" \
2107 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact "Tcl_HashEntry *(*findProc)" "Tcl_HashEntry *(SQLITE_TCLAPI *findProc)" \
mistachkin4ef916e2016-08-24 19:58:46 +00002108 | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact "Tcl_HashEntry *(*createProc)" "Tcl_HashEntry *(SQLITE_TCLAPI *createProc)" >> $(SQLITETCLH)
2109!ENDIF
mistachkin52b1dbb2016-07-28 14:37:04 +00002110
mistachkin4ef916e2016-08-24 19:58:46 +00002111testfixture.exe: $(TESTFIXTURE_SRC) $(SQLITE3H) $(LIBRESOBJS) $(HDR) $(SQLITE_TCL_DEP)
shaneh6e7850c2011-06-17 15:57:07 +00002112 $(LTLINK) -DSQLITE_NO_SYNC=1 $(TESTFIXTURE_FLAGS) \
shanehb2f20bf2011-06-17 07:07:24 +00002113 -DBUILD_sqlite -I$(TCLINCDIR) \
shaneh2a0b9ef2011-06-20 20:52:32 +00002114 $(TESTFIXTURE_SRC) \
mistachkin78e3f612015-10-14 20:01:12 +00002115 /link $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00002116
mistachkin9b88ace2016-02-26 21:01:37 +00002117extensiontest: testfixture.exe testloadext.dll
mistachkin88739962015-10-14 23:04:08 +00002118 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00002119 .\testfixture.exe $(TOP)\test\loadext.test $(TESTOPTS)
mistachkin1925a2e2014-02-24 21:20:25 +00002120
drhf4375442015-05-11 12:15:45 +00002121fulltest: $(TESTPROGS) fuzztest
mistachkin88739962015-10-14 23:04:08 +00002122 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00002123 .\testfixture.exe $(TOP)\test\all.test $(TESTOPTS)
shanehb2f20bf2011-06-17 07:07:24 +00002124
drhea93c702015-05-26 18:15:08 +00002125soaktest: $(TESTPROGS)
mistachkin88739962015-10-14 23:04:08 +00002126 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00002127 .\testfixture.exe $(TOP)\test\all.test -soak=1 $(TESTOPTS)
shanehb2f20bf2011-06-17 07:07:24 +00002128
drhf4375442015-05-11 12:15:45 +00002129fulltestonly: $(TESTPROGS) fuzztest
mistachkin88739962015-10-14 23:04:08 +00002130 @set PATH=$(LIBTCLPATH);$(PATH)
mistachkinc60941f2012-09-13 01:51:02 +00002131 .\testfixture.exe $(TOP)\test\full.test
2132
mistachkinedcb4eb2016-01-22 01:25:15 +00002133queryplantest: testfixture.exe shell
mistachkin88739962015-10-14 23:04:08 +00002134 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00002135 .\testfixture.exe $(TOP)\test\permutations.test queryplanner $(TESTOPTS)
mistachkin036acf32013-07-20 00:34:31 +00002136
drhea93c702015-05-26 18:15:08 +00002137fuzztest: fuzzcheck.exe
2138 .\fuzzcheck.exe $(FUZZDATA)
drhf3320712015-04-25 13:39:29 +00002139
drha523e312015-07-24 17:26:13 +00002140fastfuzztest: fuzzcheck.exe
drh53e66c32015-07-24 15:49:23 +00002141 .\fuzzcheck.exe --limit-mem 100M $(FUZZDATA)
shanehb2f20bf2011-06-17 07:07:24 +00002142
drh905da632015-06-10 18:53:09 +00002143# Minimal testing that runs in less than 3 minutes (on a fast machine)
2144#
drhfd0d93f2016-02-07 00:08:08 +00002145quicktest: testfixture.exe sourcetest
mistachkin88739962015-10-14 23:04:08 +00002146 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00002147 .\testfixture.exe $(TOP)\test\extraquick.test $(TESTOPTS)
2148
2149# This is the common case. Run many tests that do not take too long,
2150# including fuzzcheck, sqlite3_analyzer, and sqldiff tests.
2151#
drhfd0d93f2016-02-07 00:08:08 +00002152test: $(TESTPROGS) sourcetest fastfuzztest
mistachkin88739962015-10-14 23:04:08 +00002153 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00002154 .\testfixture.exe $(TOP)\test\veryquick.test $(TESTOPTS)
shanehb2f20bf2011-06-17 07:07:24 +00002155
drhea93c702015-05-26 18:15:08 +00002156smoketest: $(TESTPROGS)
mistachkin88739962015-10-14 23:04:08 +00002157 @set PATH=$(LIBTCLPATH);$(PATH)
drh905da632015-06-10 18:53:09 +00002158 .\testfixture.exe $(TOP)\test\main.test $(TESTOPTS)
mistachkin00eb70d2015-04-04 00:02:07 +00002159
mistachkin4ef916e2016-08-24 19:58:46 +00002160sqlite3_analyzer.c: $(SQLITE3C) $(SQLITE3H) $(TOP)\src\tclsqlite.c $(TOP)\tool\spaceanal.tcl $(SQLITE_TCL_DEP)
mistachkind4ab1032015-05-11 16:27:33 +00002161 echo #define TCLSH 2 > $@
2162 echo #define SQLITE_ENABLE_DBSTAT_VTAB 1 >> $@
2163 copy $@ + $(SQLITE3C) + $(TOP)\src\tclsqlite.c $@
mistachkin9a55e312011-09-22 00:06:44 +00002164 echo static const char *tclsh_main_loop(void){ >> $@
2165 echo static const char *zMainloop = >> $@
drh48cc9a32015-10-07 12:36:42 +00002166 $(TCLSH_CMD) $(TOP)\tool\tostr.tcl $(TOP)\tool\spaceanal.tcl >> $@
mistachkin9a55e312011-09-22 00:06:44 +00002167 echo ; return zMainloop; } >> $@
shanehb2f20bf2011-06-17 07:07:24 +00002168
mistachkin08c1c312012-10-06 03:48:25 +00002169sqlite3_analyzer.exe: sqlite3_analyzer.c $(LIBRESOBJS)
mistachkind4ab1032015-05-11 16:27:33 +00002170 $(LTLINK) $(NO_WARN) -DBUILD_sqlite -I$(TCLINCDIR) sqlite3_analyzer.c \
mistachkin78e3f612015-10-14 20:01:12 +00002171 /link $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00002172
mistachkin1925a2e2014-02-24 21:20:25 +00002173testloadext.lo: $(TOP)\src\test_loadext.c
mistachkin44723ce2015-03-21 02:22:37 +00002174 $(LTCOMPILE) $(NO_WARN) -c $(TOP)\src\test_loadext.c
mistachkin1925a2e2014-02-24 21:20:25 +00002175
mistachkin9b88ace2016-02-26 21:01:37 +00002176testloadext.dll: testloadext.lo
mistachkin1925a2e2014-02-24 21:20:25 +00002177 $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /OUT:$@ testloadext.lo
2178
mistachkin5d4d9412016-01-22 03:54:36 +00002179showdb.exe: $(TOP)\tool\showdb.c $(SQLITE3C) $(SQLITE3H)
mistachkin44723ce2015-03-21 02:22:37 +00002180 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
mistachkin78e3f612015-10-14 20:01:12 +00002181 $(TOP)\tool\showdb.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh9ac3c1e2013-11-07 18:37:31 +00002182
mistachkin5d4d9412016-01-22 03:54:36 +00002183showstat4.exe: $(TOP)\tool\showstat4.c $(SQLITE3C) $(SQLITE3H)
mistachkin44723ce2015-03-21 02:22:37 +00002184 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
mistachkin78e3f612015-10-14 20:01:12 +00002185 $(TOP)\tool\showstat4.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh4bb77ec2014-06-30 11:14:26 +00002186
mistachkin5d4d9412016-01-22 03:54:36 +00002187showjournal.exe: $(TOP)\tool\showjournal.c $(SQLITE3C) $(SQLITE3H)
mistachkin44723ce2015-03-21 02:22:37 +00002188 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
mistachkin78e3f612015-10-14 20:01:12 +00002189 $(TOP)\tool\showjournal.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh4bb77ec2014-06-30 11:14:26 +00002190
mistachkin5d4d9412016-01-22 03:54:36 +00002191showwal.exe: $(TOP)\tool\showwal.c $(SQLITE3C) $(SQLITE3H)
mistachkin44723ce2015-03-21 02:22:37 +00002192 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
mistachkin78e3f612015-10-14 20:01:12 +00002193 $(TOP)\tool\showwal.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh4bb77ec2014-06-30 11:14:26 +00002194
drh9f674f22014-08-18 20:23:29 +00002195changeset.exe: $(TOP)\ext\session\changeset.c $(SQLITE3C)
mistachkin05004782016-03-30 16:23:06 +00002196 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
2197 $(TOP)\ext\session\changeset.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh9f674f22014-08-18 20:23:29 +00002198
mistachkin5d4d9412016-01-22 03:54:36 +00002199fts3view.exe: $(TOP)\ext\fts3\tool\fts3view.c $(SQLITE3C) $(SQLITE3H)
mistachkin44723ce2015-03-21 02:22:37 +00002200 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
mistachkin78e3f612015-10-14 20:01:12 +00002201 $(TOP)\ext\fts3\tool\fts3view.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
mistachkinde545272014-07-07 17:57:50 +00002202
mistachkin5d4d9412016-01-22 03:54:36 +00002203rollback-test.exe: $(TOP)\tool\rollback-test.c $(SQLITE3C) $(SQLITE3H)
mistachkin44723ce2015-03-21 02:22:37 +00002204 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
mistachkin78e3f612015-10-14 20:01:12 +00002205 $(TOP)\tool\rollback-test.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh4bb77ec2014-06-30 11:14:26 +00002206
mistachkin5d4d9412016-01-22 03:54:36 +00002207LogEst.exe: $(TOP)\tool\logest.c $(SQLITE3H)
mistachkin78e3f612015-10-14 20:01:12 +00002208 $(LTLINK) $(NO_WARN) -Fe$@ $(TOP)\tool\LogEst.c /link $(LDFLAGS) $(LTLINKOPTS)
drh267a13f2014-06-18 18:10:12 +00002209
mistachkin5d4d9412016-01-22 03:54:36 +00002210wordcount.exe: $(TOP)\test\wordcount.c $(SQLITE3C) $(SQLITE3H)
mistachkin44723ce2015-03-21 02:22:37 +00002211 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
mistachkin78e3f612015-10-14 20:01:12 +00002212 $(TOP)\test\wordcount.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
drh9ac3c1e2013-11-07 18:37:31 +00002213
mistachkin5d4d9412016-01-22 03:54:36 +00002214speedtest1.exe: $(TOP)\test\speedtest1.c $(SQLITE3C) $(SQLITE3H)
mistachkin44723ce2015-03-21 02:22:37 +00002215 $(LTLINK) $(NO_WARN) -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
mistachkin78e3f612015-10-14 20:01:12 +00002216 $(TOP)\test\speedtest1.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
mistachkinb482a442012-02-11 22:19:26 +00002217
mistachkin9b88ace2016-02-26 21:01:37 +00002218rbu.exe: $(TOP)\ext\rbu\rbu.c $(TOP)\ext\rbu\sqlite3rbu.c $(SQLITE3C) $(SQLITE3H)
mistachkin5d4d9412016-01-22 03:54:36 +00002219 $(LTLINK) $(NO_WARN) -DSQLITE_ENABLE_RBU -Fe$@ \
2220 $(TOP)\ext\rbu\rbu.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
mistachkin9b88ace2016-02-26 21:01:37 +00002221
2222moreclean: clean
2223 del /Q $(SQLITE3C) $(SQLITE3H) 2>NUL
mistachkin3e786092016-01-23 07:53:04 +00002224# <</mark>>
drh76473772016-01-14 13:22:24 +00002225
shaneh6e7850c2011-06-17 15:57:07 +00002226clean:
mistachkin8dd3ff12015-05-16 03:41:41 +00002227 del /Q *.exp *.lo *.ilk *.lib *.obj *.ncb *.pdb *.sdf *.suo 2>NUL
mistachkin56362a52016-02-19 19:03:04 +00002228 del /Q *.bsc *.def *.cod *.da *.bb *.bbg *.vc gmon.out 2>NUL
mistachkinfe41a982016-02-27 00:21:44 +00002229 del /Q $(SQLITE3EXE) $(SQLITE3DLL) Replace.exe 2>NUL
mistachkin3e786092016-01-23 07:53:04 +00002230# <<mark>>
mistachkin9b88ace2016-02-26 21:01:37 +00002231 del /Q sqlite3.c sqlite3.h 2>NUL
2232 del /Q opcodes.c opcodes.h 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002233 del /Q lemon.* lempar.c parse.* 2>NUL
2234 del /Q mkkeywordhash.* keywordhash.h 2>NUL
2235 del /Q notasharedlib.* 2>NUL
2236 -rmdir /Q/S .deps 2>NUL
2237 -rmdir /Q/S .libs 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002238 -rmdir /Q/S tsrc 2>NUL
2239 del /Q .target_source 2>NUL
mistachkin4ef916e2016-08-24 19:58:46 +00002240 del /Q tclsqlite3.exe $(SQLITETCLH) $(SQLITETCLDECLSH) 2>NUL
mistachkin44723ce2015-03-21 02:22:37 +00002241 del /Q testloadext.dll 2>NUL
2242 del /Q testfixture.exe test.db 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002243 del /Q LogEst.exe fts3view.exe rollback-test.exe showdb.exe 2>NUL
drhedea9112015-03-24 19:02:13 +00002244 del /Q changeset.exe 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002245 del /Q showjournal.exe showstat4.exe showwal.exe speedtest1.exe 2>NUL
mistachkin27b69972016-02-07 20:39:27 +00002246 del /Q mptester.exe wordcount.exe rbu.exe srcck1.exe 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002247 del /Q sqlite3.c sqlite3-*.c 2>NUL
2248 del /Q sqlite3rc.h 2>NUL
mistachkin27799892016-03-31 22:53:37 +00002249 del /Q shell.c sqlite3ext.h sqlite3session.h 2>NUL
mistachkin44723ce2015-03-21 02:22:37 +00002250 del /Q sqlite3_analyzer.exe sqlite3_analyzer.c 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00002251 del /Q sqlite-*-output.vsix 2>NUL
drh290fcaa2016-06-08 01:03:05 +00002252 del /Q fuzzershell.exe fuzzcheck.exe sqldiff.exe dbhash.exe 2>NUL
mistachkinbc50bb72015-07-14 21:56:53 +00002253 del /Q fts5.* fts5parse.* 2>NUL
mistachkin3e786092016-01-23 07:53:04 +00002254# <</mark>>