blob: b49a3eb0e1519ce5639b4c5c3c9f202e5a10570b [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
shaneh6e7850c2011-06-17 15:57:07 +000013# Set this non-0 to create and use the SQLite amalgamation file.
14#
mistachkin0ec07442012-10-12 18:06:07 +000015!IFNDEF USE_AMALGAMATION
shaneh6e7850c2011-06-17 15:57:07 +000016USE_AMALGAMATION = 1
mistachkin0ec07442012-10-12 18:06:07 +000017!ENDIF
shaneh6e7850c2011-06-17 15:57:07 +000018
mistachkin2318d332015-01-12 18:02:52 +000019# Set this non-0 to enable full warnings (-W4, etc) when compiling.
20#
21!IFNDEF USE_FULLWARN
22USE_FULLWARN = 0
23!ENDIF
24
mistachkin44723ce2015-03-21 02:22:37 +000025# Set this non-0 to use "stdcall" calling convention for the core library
26# and shell executable.
27#
28!IFNDEF USE_STDCALL
29USE_STDCALL = 0
30!ENDIF
31
32# Set this non-0 to have the shell executable link against the core dynamic
33# link library.
34#
35!IFNDEF DYNAMIC_SHELL
36DYNAMIC_SHELL = 0
37!ENDIF
38
mistachkin2318d332015-01-12 18:02:52 +000039# If necessary, create a list of harmless compiler warnings to disable when
mistachkin44723ce2015-03-21 02:22:37 +000040# compiling the various tools. For the SQLite source code itself, warnings,
mistachkin2318d332015-01-12 18:02:52 +000041# if any, will be disabled from within it.
42#
43!IFNDEF NO_WARN
44!IF $(USE_FULLWARN)!=0
mistachkin27b2f052015-01-12 19:49:46 +000045NO_WARN = -wd4054 -wd4055 -wd4100 -wd4127 -wd4152 -wd4189 -wd4206 -wd4210
mistachkin32562502015-01-12 20:20:26 +000046NO_WARN = $(NO_WARN) -wd4232 -wd4244 -wd4305 -wd4306 -wd4702 -wd4706
mistachkin2318d332015-01-12 18:02:52 +000047!ENDIF
48!ENDIF
49
mistachkina5e2b502014-05-12 22:36:50 +000050# Set this non-0 to use the library paths and other options necessary for
51# Windows Phone 8.1.
mistachkind9b3c542014-05-09 23:31:55 +000052#
53!IFNDEF USE_WP81_OPTS
54USE_WP81_OPTS = 0
55!ENDIF
56
mistachkin76510912013-10-11 23:01:18 +000057# Set this non-0 to split the SQLite amalgamation file into chunks to
58# be used for debugging with Visual Studio.
59#
60!IFNDEF SPLIT_AMALGAMATION
mistachkin0aedc6b2013-10-11 23:02:13 +000061SPLIT_AMALGAMATION = 0
mistachkin76510912013-10-11 23:01:18 +000062!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +000063
mistachkinc756ded2011-10-02 05:23:16 +000064# Set this non-0 to use the International Components for Unicode (ICU).
65#
mistachkin0ec07442012-10-12 18:06:07 +000066!IFNDEF USE_ICU
mistachkinc756ded2011-10-02 05:23:16 +000067USE_ICU = 0
mistachkin0ec07442012-10-12 18:06:07 +000068!ENDIF
mistachkinc756ded2011-10-02 05:23:16 +000069
mistachkin8d967a92012-06-21 04:21:35 +000070# Set this non-0 to dynamically link to the MSVC runtime library.
71#
mistachkin0ec07442012-10-12 18:06:07 +000072!IFNDEF USE_CRT_DLL
mistachkin8d967a92012-06-21 04:21:35 +000073USE_CRT_DLL = 0
mistachkin0ec07442012-10-12 18:06:07 +000074!ENDIF
mistachkin8d967a92012-06-21 04:21:35 +000075
mistachkine45e0fb2015-01-21 00:48:46 +000076# Set this non-0 to link to the RPCRT4 library.
77#
78!IFNDEF USE_RPCRT4_LIB
79USE_RPCRT4_LIB = 0
80!ENDIF
81
mistachkin0157e012013-09-06 21:41:11 +000082# Set this non-0 to generate assembly code listings for the source code
83# files.
84#
85!IFNDEF USE_LISTINGS
86USE_LISTINGS = 0
87!ENDIF
88
mistachkin52fd8e12012-08-28 01:44:13 +000089# Set this non-0 to attempt setting the native compiler automatically
90# for cross-compiling the command line tools needed during the compilation
91# process.
92#
mistachkin0ec07442012-10-12 18:06:07 +000093!IFNDEF XCOMPILE
mistachkin52fd8e12012-08-28 01:44:13 +000094XCOMPILE = 0
mistachkin0ec07442012-10-12 18:06:07 +000095!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +000096
mistachkinbd58d5f2012-06-30 22:22:34 +000097# Set this non-0 to use the native libraries paths for cross-compiling
98# the command line tools needed during the compilation process.
99#
mistachkin0ec07442012-10-12 18:06:07 +0000100!IFNDEF USE_NATIVE_LIBPATHS
mistachkinbd58d5f2012-06-30 22:22:34 +0000101USE_NATIVE_LIBPATHS = 0
mistachkin0ec07442012-10-12 18:06:07 +0000102!ENDIF
mistachkinbd58d5f2012-06-30 22:22:34 +0000103
mistachkin08c1c312012-10-06 03:48:25 +0000104# Set this 0 to skip the compiling and embedding of version resources.
105#
mistachkin0ec07442012-10-12 18:06:07 +0000106!IFNDEF USE_RC
mistachkin08c1c312012-10-06 03:48:25 +0000107USE_RC = 1
mistachkin0ec07442012-10-12 18:06:07 +0000108!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000109
mistachkin46b721a2012-03-23 12:28:21 +0000110# Set this non-0 to compile binaries suitable for the WinRT environment.
111# This setting does not apply to any binaries that require Tcl to operate
112# properly (i.e. the text fixture, etc).
113#
mistachkin0ec07442012-10-12 18:06:07 +0000114!IFNDEF FOR_WINRT
mistachkin46b721a2012-03-23 12:28:21 +0000115FOR_WINRT = 0
mistachkin0ec07442012-10-12 18:06:07 +0000116!ENDIF
mistachkin46b721a2012-03-23 12:28:21 +0000117
mistachkin31856a32012-07-27 07:13:25 +0000118# Set this non-0 to skip attempting to look for and/or link with the Tcl
119# runtime library.
120#
mistachkin0ec07442012-10-12 18:06:07 +0000121!IFNDEF NO_TCL
mistachkin31856a32012-07-27 07:13:25 +0000122NO_TCL = 0
mistachkin0ec07442012-10-12 18:06:07 +0000123!ENDIF
mistachkin31856a32012-07-27 07:13:25 +0000124
mistachkin4d60be52011-08-26 05:40:31 +0000125# Set this to non-0 to create and use PDBs.
126#
mistachkin0ec07442012-10-12 18:06:07 +0000127!IFNDEF SYMBOLS
mistachkin4d60be52011-08-26 05:40:31 +0000128SYMBOLS = 1
mistachkin0ec07442012-10-12 18:06:07 +0000129!ENDIF
mistachkin4d60be52011-08-26 05:40:31 +0000130
mistachkin2f7d5d82012-08-22 00:39:34 +0000131# Set this to non-0 to use the SQLite debugging heap subsystem.
132#
mistachkin0ec07442012-10-12 18:06:07 +0000133!IFNDEF MEMDEBUG
mistachkin2f7d5d82012-08-22 00:39:34 +0000134MEMDEBUG = 0
mistachkin0ec07442012-10-12 18:06:07 +0000135!ENDIF
mistachkin2f7d5d82012-08-22 00:39:34 +0000136
137# Set this to non-0 to use the Win32 native heap subsystem.
138#
mistachkin0ec07442012-10-12 18:06:07 +0000139!IFNDEF WIN32HEAP
mistachkin2f7d5d82012-08-22 00:39:34 +0000140WIN32HEAP = 0
mistachkin0ec07442012-10-12 18:06:07 +0000141!ENDIF
mistachkinf2d25f22011-08-25 04:09:12 +0000142
143# Set this to one of the following values to enable various debugging
144# features. Each level includes the debugging options from the previous
145# levels. Currently, the recognized values for DEBUG are:
146#
147# 0 == NDEBUG: Disables assert() and other runtime diagnostics.
mistachkincd54bab2014-12-20 21:14:14 +0000148# 1 == SQLITE_ENABLE_API_ARMOR: extra attempts to detect misuse of the API.
149# 2 == Disables NDEBUG and all optimizations and then enables PDBs.
150# 3 == SQLITE_DEBUG: Enables various diagnostics messages and code.
151# 4 == SQLITE_WIN32_MALLOC_VALIDATE: Validate the Win32 native heap per call.
152# 5 == SQLITE_DEBUG_OS_TRACE: Enables output from the OSTRACE() macros.
153# 6 == SQLITE_ENABLE_IOTRACE: Enables output from the IOTRACE() macros.
mistachkinf2d25f22011-08-25 04:09:12 +0000154#
mistachkin0ec07442012-10-12 18:06:07 +0000155!IFNDEF DEBUG
mistachkinf2d25f22011-08-25 04:09:12 +0000156DEBUG = 0
mistachkin0ec07442012-10-12 18:06:07 +0000157!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000158
mistachkin8bcd3fa2013-08-29 01:03:38 +0000159# Enable use of available compiler optimizations? Normally, this should be
160# non-zero. Setting this to zero, thus disabling all compiler optimizations,
161# can be useful for testing.
162#
163!IFNDEF OPTIMIZATIONS
164OPTIMIZATIONS = 2
165!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000166
mistachkin4712c212014-05-09 20:51:17 +0000167# These are the "standard" SQLite compilation options used when compiling for
168# the Windows platform.
169#
170!IFNDEF OPT_FEATURE_FLAGS
171OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS3=1
172OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RTREE=1
173OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_COLUMN_METADATA=1
174!ENDIF
175
176###############################################################################
177############################### END OF OPTIONS ################################
178###############################################################################
179
mistachkind9b3c542014-05-09 23:31:55 +0000180# This assumes that MSVC is always installed in 32-bit Program Files directory
181# and sets the variable for use in locating other 32-bit installs accordingly.
182#
183PROGRAMFILES_X86 = $(VCINSTALLDIR)\..\..
184PROGRAMFILES_X86 = $(PROGRAMFILES_X86:\\=\)
185
mistachkine37f99c2012-06-30 16:22:05 +0000186# Check for the predefined command macro CC. This should point to the compiler
mistachkinbd58d5f2012-06-30 22:22:34 +0000187# binary for the target platform. If it is not defined, simply define it to
mistachkine37f99c2012-06-30 16:22:05 +0000188# the legacy default value 'cl.exe'.
189#
190!IFNDEF CC
191CC = cl.exe
192!ENDIF
193
mistachkin228aeff2012-06-30 19:24:09 +0000194# Check for the command macro LD. This should point to the linker binary for
mistachkinbd58d5f2012-06-30 22:22:34 +0000195# the target platform. If it is not defined, simply define it to the legacy
mistachkin228aeff2012-06-30 19:24:09 +0000196# default value 'link.exe'.
197#
198!IFNDEF LD
199LD = link.exe
200!ENDIF
201
mistachkin4d9d1f42012-09-03 10:32:32 +0000202# Check for the predefined command macro RC. This should point to the resource
203# compiler binary for the target platform. If it is not defined, simply define
204# it to the legacy default value 'rc.exe'.
205#
206!IFNDEF RC
207RC = rc.exe
208!ENDIF
209
mistachkin4712c212014-05-09 20:51:17 +0000210# Check for the MSVC runtime library path macro. Othertise, this value will
211# default to the 'lib' directory underneath the MSVC installation directory.
212#
213!IFNDEF CRTLIBPATH
214CRTLIBPATH = $(VCINSTALLDIR)\lib
215!ENDIF
216
217CRTLIBPATH = $(CRTLIBPATH:\\=\)
218
mistachkine37f99c2012-06-30 16:22:05 +0000219# Check for the command macro NCC. This should point to the compiler binary
mistachkinbd58d5f2012-06-30 22:22:34 +0000220# for the platform the compilation process is taking place on. If it is not
221# defined, simply define it to have the same value as the CC macro. When
mistachkine37f99c2012-06-30 16:22:05 +0000222# cross-compiling, it is suggested that this macro be modified via the command
223# line (since nmake itself does not provide a built-in method to guess it).
224# For example, to use the x86 compiler when cross-compiling for x64, a command
mistachkinbd58d5f2012-06-30 22:22:34 +0000225# line similar to the following could be used (all on one line):
mistachkine37f99c2012-06-30 16:22:05 +0000226#
mistachkin6f928332012-08-17 11:47:32 +0000227# nmake /f Makefile.msc sqlite3.dll
mistachkin52fd8e12012-08-28 01:44:13 +0000228# XCOMPILE=1 USE_NATIVE_LIBPATHS=1
229#
230# Alternatively, the full path and file name to the compiler binary for the
231# platform the compilation process is taking place may be specified (all on
232# one line):
233#
234# nmake /f Makefile.msc sqlite3.dll
mistachkinbd58d5f2012-06-30 22:22:34 +0000235# "NCC=""%VCINSTALLDIR%\bin\cl.exe"""
236# USE_NATIVE_LIBPATHS=1
mistachkine37f99c2012-06-30 16:22:05 +0000237#
mistachkinfd0ba2a2012-07-27 08:21:45 +0000238!IFDEF NCC
239NCC = $(NCC:\\=\)
mistachkin52fd8e12012-08-28 01:44:13 +0000240!ELSEIF $(XCOMPILE)!=0
mistachkin5fac4202013-12-03 23:33:29 +0000241NCC = "$(VCINSTALLDIR)\bin\$(CC)"
mistachkin52fd8e12012-08-28 01:44:13 +0000242NCC = $(NCC:\\=\)
mistachkinfd0ba2a2012-07-27 08:21:45 +0000243!ELSE
mistachkine37f99c2012-06-30 16:22:05 +0000244NCC = $(CC)
245!ENDIF
246
mistachkin4712c212014-05-09 20:51:17 +0000247# Check for the MSVC native runtime library path macro. Othertise,
248# this value will default to the 'lib' directory underneath the MSVC
mistachkinbd58d5f2012-06-30 22:22:34 +0000249# installation directory.
250#
251!IFNDEF NCRTLIBPATH
252NCRTLIBPATH = $(VCINSTALLDIR)\lib
253!ENDIF
254
mistachkin0b5ae722012-07-27 23:03:47 +0000255NCRTLIBPATH = $(NCRTLIBPATH:\\=\)
256
mistachkinbd58d5f2012-06-30 22:22:34 +0000257# Check for the Platform SDK library path macro. Othertise, this
258# value will default to the 'lib' directory underneath the Windows
259# SDK installation directory (the environment variable used appears
260# to be available when using Visual C++ 2008 or later via the
261# command line).
262#
263!IFNDEF NSDKLIBPATH
264NSDKLIBPATH = $(WINDOWSSDKDIR)\lib
265!ENDIF
266
mistachkin0b5ae722012-07-27 23:03:47 +0000267NSDKLIBPATH = $(NSDKLIBPATH:\\=\)
268
mistachkinbd58d5f2012-06-30 22:22:34 +0000269# C compiler and options for use in building executables that
shanehb2f20bf2011-06-17 07:07:24 +0000270# will run on the platform that is doing the build.
271#
mistachkin2318d332015-01-12 18:02:52 +0000272!IF $(USE_FULLWARN)!=0
mistachkin44723ce2015-03-21 02:22:37 +0000273BCC = $(NCC) -nologo -W4
mistachkin2318d332015-01-12 18:02:52 +0000274!ELSE
mistachkin44723ce2015-03-21 02:22:37 +0000275BCC = $(NCC) -nologo -W3
mistachkin2318d332015-01-12 18:02:52 +0000276!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000277
mistachkin0157e012013-09-06 21:41:11 +0000278# Check if assembly code listings should be generated for the source
279# code files to be compiled.
280#
281!IF $(USE_LISTINGS)!=0
282BCC = $(BCC) -FAcs
283!ENDIF
284
mistachkinbd58d5f2012-06-30 22:22:34 +0000285# Check if the native library paths should be used when compiling
286# the command line tools used during the compilation process. If
287# so, set the necessary macro now.
288#
289!IF $(USE_NATIVE_LIBPATHS)!=0
290NLTLIBPATHS = "/LIBPATH:$(NCRTLIBPATH)" "/LIBPATH:$(NSDKLIBPATH)"
291!ENDIF
292
293# C compiler and options for use in building executables that
shanehb2f20bf2011-06-17 07:07:24 +0000294# will run on the target platform. (BCC and TCC are usually the
295# same unless your are cross-compiling.)
296#
mistachkin2318d332015-01-12 18:02:52 +0000297!IF $(USE_FULLWARN)!=0
mistachkin44723ce2015-03-21 02:22:37 +0000298TCC = $(CC) -nologo -W4 -DINCLUDE_MSVC_H=1
mistachkin2318d332015-01-12 18:02:52 +0000299!ELSE
mistachkin44723ce2015-03-21 02:22:37 +0000300TCC = $(CC) -nologo -W3
mistachkin2318d332015-01-12 18:02:52 +0000301!ENDIF
302
303TCC = $(TCC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) -I$(TOP)\src -fp:precise
mistachkin8ccc6d42012-09-27 21:03:53 +0000304RCC = $(RC) -DSQLITE_OS_WIN=1 -I$(TOP) -I$(TOP)\src
shaneh6e7850c2011-06-17 15:57:07 +0000305
mistachkin44723ce2015-03-21 02:22:37 +0000306# Check if we want to use the "stdcall" calling convention when compiling.
307# This is not supported by the compilers for non-x86 platforms. It should
308# also be noted here that building any target with these "stdcall" options
309# will most likely fail if the Tcl library is also required. This is due
310# to how the Tcl library functions are declared and exported (i.e. without
311# an explicit calling convention, which results in "cdecl").
312#
313!IF $(USE_STDCALL)!=0
314!IF "$(PLATFORM)"=="x86"
mistachkin59b9b022015-03-24 21:27:27 +0000315CORE_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_STDCALL=__stdcall
316SHELL_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_STDCALL=__stdcall
mistachkin44723ce2015-03-21 02:22:37 +0000317!ELSE
318!IFNDEF PLATFORM
mistachkin59b9b022015-03-24 21:27:27 +0000319CORE_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_STDCALL=__stdcall
320SHELL_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_STDCALL=__stdcall
mistachkin44723ce2015-03-21 02:22:37 +0000321!ELSE
322CORE_CCONV_OPTS =
323SHELL_CCONV_OPTS =
324!ENDIF
325!ENDIF
326!ELSE
327CORE_CCONV_OPTS =
328SHELL_CCONV_OPTS =
329!ENDIF
330
331# These are additional compiler options used for the core library.
332#
333!IFNDEF CORE_COMPILE_OPTS
mistachkin34a80652015-03-27 00:19:31 +0000334!IF $(DYNAMIC_SHELL)!=0
mistachkin44723ce2015-03-21 02:22:37 +0000335CORE_COMPILE_OPTS = $(CORE_CCONV_OPTS) -DSQLITE_API=__declspec(dllexport)
336!ELSE
337CORE_COMPILE_OPTS = $(CORE_CCONV_OPTS)
338!ENDIF
339!ENDIF
340
341# These are the additional targets that the core library should depend on
342# when linking.
343#
344!IFNDEF CORE_LINK_DEP
mistachkin34a80652015-03-27 00:19:31 +0000345!IF $(DYNAMIC_SHELL)!=0
mistachkin44723ce2015-03-21 02:22:37 +0000346CORE_LINK_DEP =
347!ELSE
348CORE_LINK_DEP = sqlite3.def
349!ENDIF
350!ENDIF
351
352# These are additional linker options used for the core library.
353#
354!IFNDEF CORE_LINK_OPTS
mistachkin34a80652015-03-27 00:19:31 +0000355!IF $(DYNAMIC_SHELL)!=0
mistachkin44723ce2015-03-21 02:22:37 +0000356CORE_LINK_OPTS =
357!ELSE
358CORE_LINK_OPTS = /DEF:sqlite3.def
359!ENDIF
360!ENDIF
361
362# These are additional compiler options used for the shell executable.
363#
364!IFNDEF SHELL_COMPILE_OPTS
365!IF $(DYNAMIC_SHELL)!=0
366SHELL_COMPILE_OPTS = $(SHELL_CCONV_OPTS) -DSQLITE_API=__declspec(dllimport)
367!ELSE
368SHELL_COMPILE_OPTS = $(SHELL_CCONV_OPTS)
369!ENDIF
370!ENDIF
371
372# This is the core library that the shell executable should depend on.
373#
374!IFNDEF SHELL_CORE_DEP
375!IF $(DYNAMIC_SHELL)!=0
376SHELL_CORE_DEP = sqlite3.dll
377!ELSE
378SHELL_CORE_DEP = libsqlite3.lib
379!ENDIF
380!ENDIF
381
382# This is the core library that the shell executable should link with.
383#
384!IFNDEF SHELL_CORE_LIB
385!IF $(DYNAMIC_SHELL)!=0
386SHELL_CORE_LIB = sqlite3.lib
387!ELSE
388SHELL_CORE_LIB = libsqlite3.lib
389!ENDIF
390!ENDIF
391
392# These are additional linker options used for the shell executable.
393#
394!IFNDEF SHELL_LINK_OPTS
395SHELL_LINK_OPTS = $(SHELL_CORE_LIB)
396!ENDIF
397
mistachkin0157e012013-09-06 21:41:11 +0000398# Check if assembly code listings should be generated for the source
399# code files to be compiled.
400#
401!IF $(USE_LISTINGS)!=0
402TCC = $(TCC) -FAcs
403!ENDIF
shaneh6e7850c2011-06-17 15:57:07 +0000404
mistachkinf39eaf22012-03-20 02:18:42 +0000405# When compiling the library for use in the WinRT environment,
mistachkin46b721a2012-03-23 12:28:21 +0000406# the following compile-time options must be used as well to
mistachkinf39eaf22012-03-20 02:18:42 +0000407# disable use of Win32 APIs that are not available and to enable
408# use of Win32 APIs that are specific to Windows 8 and/or WinRT.
409#
mistachkin46b721a2012-03-23 12:28:21 +0000410!IF $(FOR_WINRT)!=0
mistachkin8d967a92012-06-21 04:21:35 +0000411TCC = $(TCC) -DSQLITE_OS_WINRT=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000412RCC = $(RCC) -DSQLITE_OS_WINRT=1
mistachkin08c1c312012-10-06 03:48:25 +0000413TCC = $(TCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
414RCC = $(RCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
mistachkin8d967a92012-06-21 04:21:35 +0000415!ENDIF
416
417# Also, we need to dynamically link to the correct MSVC runtime
418# when compiling for WinRT (e.g. debug or release) OR if the
419# USE_CRT_DLL option is set to force dynamically linking to the
420# MSVC runtime library.
421#
422!IF $(FOR_WINRT)!=0 || $(USE_CRT_DLL)!=0
mistachkincd54bab2014-12-20 21:14:14 +0000423!IF $(DEBUG)>1
mistachkin8d967a92012-06-21 04:21:35 +0000424TCC = $(TCC) -MDd
mistachkin08c1c312012-10-06 03:48:25 +0000425BCC = $(BCC) -MDd
mistachkin8d967a92012-06-21 04:21:35 +0000426!ELSE
427TCC = $(TCC) -MD
mistachkin08c1c312012-10-06 03:48:25 +0000428BCC = $(BCC) -MD
mistachkin8d967a92012-06-21 04:21:35 +0000429!ENDIF
430!ELSE
mistachkincd54bab2014-12-20 21:14:14 +0000431!IF $(DEBUG)>1
mistachkin8d967a92012-06-21 04:21:35 +0000432TCC = $(TCC) -MTd
mistachkin08c1c312012-10-06 03:48:25 +0000433BCC = $(BCC) -MTd
mistachkin8d967a92012-06-21 04:21:35 +0000434!ELSE
435TCC = $(TCC) -MT
mistachkin08c1c312012-10-06 03:48:25 +0000436BCC = $(BCC) -MT
mistachkin8d967a92012-06-21 04:21:35 +0000437!ENDIF
mistachkin46b721a2012-03-23 12:28:21 +0000438!ENDIF
mistachkinf39eaf22012-03-20 02:18:42 +0000439
440# The mksqlite3c.tcl and mksqlite3h.tcl scripts will pull in
shaneh6e7850c2011-06-17 15:57:07 +0000441# any extension header files by default. For non-amalgamation
442# builds, we need to make sure the compiler can find these.
443#
444!IF $(USE_AMALGAMATION)==0
445TCC = $(TCC) -I$(TOP)\ext\fts3
mistachkin4d9d1f42012-09-03 10:32:32 +0000446RCC = $(RCC) -I$(TOP)\ext\fts3
shaneh6e7850c2011-06-17 15:57:07 +0000447TCC = $(TCC) -I$(TOP)\ext\rtree
mistachkin4d9d1f42012-09-03 10:32:32 +0000448RCC = $(RCC) -I$(TOP)\ext\rtree
shaneh6e7850c2011-06-17 15:57:07 +0000449!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000450
mistachkinb0427512014-01-30 11:12:52 +0000451# The mksqlite3c.tcl script accepts some options on the command
452# line. When compiling with debugging enabled, some of these
453# options are necessary in order to allow debugging symbols to
454# work correctly with Visual Studio when using the amalgamation.
455#
mistachkincd54bab2014-12-20 21:14:14 +0000456!IF $(DEBUG)>1
mistachkinb0427512014-01-30 11:12:52 +0000457MKSQLITE3C_ARGS = --linemacros
458!ELSE
459MKSQLITE3C_ARGS =
shanehb2f20bf2011-06-17 07:07:24 +0000460!ENDIF
461
462# Define -DNDEBUG to compile without debugging (i.e., for production usage)
463# Omitting the define will cause extra debugging code to be inserted and
464# includes extra comments when "EXPLAIN stmt" is used.
465#
mistachkin753c5442011-08-25 02:02:25 +0000466!IF $(DEBUG)==0
shanehb2f20bf2011-06-17 07:07:24 +0000467TCC = $(TCC) -DNDEBUG
mistachkinfec360a2012-04-18 10:29:21 +0000468BCC = $(BCC) -DNDEBUG
mistachkin4d9d1f42012-09-03 10:32:32 +0000469RCC = $(RCC) -DNDEBUG
mistachkin753c5442011-08-25 02:02:25 +0000470!ENDIF
471
mistachkincd54bab2014-12-20 21:14:14 +0000472!IF $(DEBUG)>0
473TCC = $(TCC) -DSQLITE_ENABLE_API_ARMOR
474RCC = $(RCC) -DSQLITE_ENABLE_API_ARMOR
475!ENDIF
476
477!IF $(DEBUG)>2
mistachkin753c5442011-08-25 02:02:25 +0000478TCC = $(TCC) -DSQLITE_DEBUG
mistachkin4d9d1f42012-09-03 10:32:32 +0000479RCC = $(RCC) -DSQLITE_DEBUG
mistachkin753c5442011-08-25 02:02:25 +0000480!ENDIF
481
mistachkincd54bab2014-12-20 21:14:14 +0000482!IF $(DEBUG)>4
mistachkin753c5442011-08-25 02:02:25 +0000483TCC = $(TCC) -DSQLITE_DEBUG_OS_TRACE=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000484RCC = $(RCC) -DSQLITE_DEBUG_OS_TRACE=1
mistachkin753c5442011-08-25 02:02:25 +0000485!ENDIF
486
mistachkincd54bab2014-12-20 21:14:14 +0000487!IF $(DEBUG)>5
mistachkin753c5442011-08-25 02:02:25 +0000488TCC = $(TCC) -DSQLITE_ENABLE_IOTRACE
mistachkin4d9d1f42012-09-03 10:32:32 +0000489RCC = $(RCC) -DSQLITE_ENABLE_IOTRACE
mistachkin753c5442011-08-25 02:02:25 +0000490!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000491
mistachkinbd58d5f2012-06-30 22:22:34 +0000492# Prevent warnings about "insecure" MSVC runtime library functions
493# being used.
mistachkin176f1b42011-08-02 23:34:00 +0000494#
495TCC = $(TCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
mistachkinfec360a2012-04-18 10:29:21 +0000496BCC = $(BCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
mistachkin4d9d1f42012-09-03 10:32:32 +0000497RCC = $(RCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
mistachkin176f1b42011-08-02 23:34:00 +0000498
mistachkinbd58d5f2012-06-30 22:22:34 +0000499# Prevent warnings about "deprecated" POSIX functions being used.
500#
501TCC = $(TCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
502BCC = $(BCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
mistachkin4d9d1f42012-09-03 10:32:32 +0000503RCC = $(RCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
mistachkinbd58d5f2012-06-30 22:22:34 +0000504
mistachkin2f7d5d82012-08-22 00:39:34 +0000505# Use the SQLite debugging heap subsystem?
mistachkin1b186a92011-08-24 16:13:57 +0000506#
mistachkin2f7d5d82012-08-22 00:39:34 +0000507!IF $(MEMDEBUG)!=0
508TCC = $(TCC) -DSQLITE_MEMDEBUG=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000509RCC = $(RCC) -DSQLITE_MEMDEBUG=1
mistachkin2f7d5d82012-08-22 00:39:34 +0000510
mistachkin2f7d5d82012-08-22 00:39:34 +0000511# Use native Win32 heap subsystem instead of malloc/free?
512#
513!ELSEIF $(WIN32HEAP)!=0
514TCC = $(TCC) -DSQLITE_WIN32_MALLOC=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000515RCC = $(RCC) -DSQLITE_WIN32_MALLOC=1
mistachkin753c5442011-08-25 02:02:25 +0000516
mistachkin753c5442011-08-25 02:02:25 +0000517# Validate the heap on every call into the native Win32 heap subsystem?
518#
mistachkincd54bab2014-12-20 21:14:14 +0000519!IF $(DEBUG)>3
mistachkin753c5442011-08-25 02:02:25 +0000520TCC = $(TCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000521RCC = $(RCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1
mistachkin753c5442011-08-25 02:02:25 +0000522!ENDIF
mistachkin468690e2011-08-24 17:42:22 +0000523!ENDIF
mistachkin1b186a92011-08-24 16:13:57 +0000524
mistachkin5b0b6fd2011-06-25 01:14:36 +0000525# The locations of the Tcl header and library files. Also, the library that
526# non-stubs enabled programs using Tcl must link against. These variables
527# (TCLINCDIR, TCLLIBDIR, and LIBTCL) may be overridden via the environment
528# prior to running nmake in order to match the actual installed location and
529# version on this machine.
shanehb2f20bf2011-06-17 07:07:24 +0000530#
mistachkine37f99c2012-06-30 16:22:05 +0000531!IFNDEF TCLINCDIR
shanehb2f20bf2011-06-17 07:07:24 +0000532TCLINCDIR = c:\tcl\include
mistachkine37f99c2012-06-30 16:22:05 +0000533!ENDIF
mistachkin5b0b6fd2011-06-25 01:14:36 +0000534
mistachkine37f99c2012-06-30 16:22:05 +0000535!IFNDEF TCLLIBDIR
shanehb2f20bf2011-06-17 07:07:24 +0000536TCLLIBDIR = c:\tcl\lib
mistachkine37f99c2012-06-30 16:22:05 +0000537!ENDIF
mistachkin5b0b6fd2011-06-25 01:14:36 +0000538
mistachkine37f99c2012-06-30 16:22:05 +0000539!IFNDEF LIBTCL
mistachkin5b0b6fd2011-06-25 01:14:36 +0000540LIBTCL = tcl85.lib
mistachkine37f99c2012-06-30 16:22:05 +0000541!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000542
mistachkinc756ded2011-10-02 05:23:16 +0000543# The locations of the ICU header and library files. These variables
544# (ICUINCDIR, ICULIBDIR, and LIBICU) may be overridden via the environment
545# prior to running nmake in order to match the actual installed location on
546# this machine.
547#
mistachkine37f99c2012-06-30 16:22:05 +0000548!IFNDEF ICUINCDIR
mistachkinc756ded2011-10-02 05:23:16 +0000549ICUINCDIR = c:\icu\include
mistachkine37f99c2012-06-30 16:22:05 +0000550!ENDIF
mistachkinc756ded2011-10-02 05:23:16 +0000551
mistachkine37f99c2012-06-30 16:22:05 +0000552!IFNDEF ICULIBDIR
mistachkinc756ded2011-10-02 05:23:16 +0000553ICULIBDIR = c:\icu\lib
mistachkine37f99c2012-06-30 16:22:05 +0000554!ENDIF
mistachkinc756ded2011-10-02 05:23:16 +0000555
mistachkine37f99c2012-06-30 16:22:05 +0000556!IFNDEF LIBICU
mistachkinc756ded2011-10-02 05:23:16 +0000557LIBICU = icuuc.lib icuin.lib
mistachkine37f99c2012-06-30 16:22:05 +0000558!ENDIF
mistachkinc756ded2011-10-02 05:23:16 +0000559
shanehb2f20bf2011-06-17 07:07:24 +0000560# This is the command to use for tclsh - normally just "tclsh", but we may
mistachkin5b0b6fd2011-06-25 01:14:36 +0000561# know the specific version we want to use. This variable (TCLSH_CMD) may be
562# overridden via the environment prior to running nmake in order to select a
563# specific Tcl shell to use.
shanehb2f20bf2011-06-17 07:07:24 +0000564#
mistachkine37f99c2012-06-30 16:22:05 +0000565!IFNDEF TCLSH_CMD
shanehb2f20bf2011-06-17 07:07:24 +0000566TCLSH_CMD = tclsh85
mistachkine37f99c2012-06-30 16:22:05 +0000567!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000568
569# Compiler options needed for programs that use the readline() library.
570#
mistachkin8bcd3fa2013-08-29 01:03:38 +0000571!IFNDEF READLINE_FLAGS
shaneh6e7850c2011-06-17 15:57:07 +0000572READLINE_FLAGS = -DHAVE_READLINE=0
mistachkin8bcd3fa2013-08-29 01:03:38 +0000573!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000574
575# The library that programs using readline() must link against.
576#
mistachkin8bcd3fa2013-08-29 01:03:38 +0000577!IFNDEF LIBREADLINE
shaneh6e7850c2011-06-17 15:57:07 +0000578LIBREADLINE =
mistachkin8bcd3fa2013-08-29 01:03:38 +0000579!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000580
581# Should the database engine be compiled threadsafe
582#
583TCC = $(TCC) -DSQLITE_THREADSAFE=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000584RCC = $(RCC) -DSQLITE_THREADSAFE=1
shanehb2f20bf2011-06-17 07:07:24 +0000585
586# Do threads override each others locks by default (1), or do we test (-1)
587#
588TCC = $(TCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1
mistachkin4d9d1f42012-09-03 10:32:32 +0000589RCC = $(RCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1
shanehb2f20bf2011-06-17 07:07:24 +0000590
591# Any target libraries which libsqlite must be linked against
shaneh6e7850c2011-06-17 15:57:07 +0000592#
mistachkine37f99c2012-06-30 16:22:05 +0000593!IFNDEF TLIBS
shaneh6e7850c2011-06-17 15:57:07 +0000594TLIBS =
mistachkine37f99c2012-06-30 16:22:05 +0000595!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000596
597# Flags controlling use of the in memory btree implementation
598#
599# SQLITE_TEMP_STORE is 0 to force temporary tables to be in a file, 1 to
600# default to file, 2 to default to memory, and 3 to force temporary
601# tables to always be in memory.
602#
shaneh6e7850c2011-06-17 15:57:07 +0000603TCC = $(TCC) -DSQLITE_TEMP_STORE=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000604RCC = $(RCC) -DSQLITE_TEMP_STORE=1
shanehb2f20bf2011-06-17 07:07:24 +0000605
606# Enable/disable loadable extensions, and other optional features
shaneh6e7850c2011-06-17 15:57:07 +0000607# based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*).
608# The same set of OMIT and ENABLE flags should be passed to the
shanehb2f20bf2011-06-17 07:07:24 +0000609# LEMON parser generator and the mkkeywordhash tool as well.
610
mistachkin4712c212014-05-09 20:51:17 +0000611# These are the required SQLite compilation options used when compiling for
612# the Windows platform.
613#
614REQ_FEATURE_FLAGS = $(REQ_FEATURE_FLAGS) -DSQLITE_MAX_TRIGGER_DEPTH=100
shanehb2f20bf2011-06-17 07:07:24 +0000615
mistachkine45e0fb2015-01-21 00:48:46 +0000616# If we are linking to the RPCRT4 library, enable features that need it.
617#
618!IF $(USE_RPCRT4_LIB)!=0
619REQ_FEATURE_FLAGS = $(REQ_FEATURE_FLAGS) -DSQLITE_WIN32_USE_UUID=1
620!ENDIF
621
mistachkin4712c212014-05-09 20:51:17 +0000622# Add the required and optional SQLite compilation options into the command
623# lines used to invoke the MSVC code and resource compilers.
624#
625TCC = $(TCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS)
626RCC = $(RCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS)
shanehb2f20bf2011-06-17 07:07:24 +0000627
mistachkin4712c212014-05-09 20:51:17 +0000628# Add in any optional parameters specified on the commane line, e.g.
629# nmake /f Makefile.msc all "OPTS=-DSQLITE_ENABLE_FOO=1 -DSQLITE_OMIT_FOO=1"
630#
shanehb2f20bf2011-06-17 07:07:24 +0000631TCC = $(TCC) $(OPTS)
mistachkin4d9d1f42012-09-03 10:32:32 +0000632RCC = $(RCC) $(OPTS)
shanehb2f20bf2011-06-17 07:07:24 +0000633
mistachkin8bcd3fa2013-08-29 01:03:38 +0000634# If compiling for debugging, add some defines.
mistachkin4712c212014-05-09 20:51:17 +0000635#
mistachkincd54bab2014-12-20 21:14:14 +0000636!IF $(DEBUG)>1
mistachkin8bcd3fa2013-08-29 01:03:38 +0000637TCC = $(TCC) -D_DEBUG
638BCC = $(BCC) -D_DEBUG
mistachkin4d9d1f42012-09-03 10:32:32 +0000639RCC = $(RCC) -D_DEBUG
mistachkin4d60be52011-08-26 05:40:31 +0000640!ENDIF
641
mistachkin8bcd3fa2013-08-29 01:03:38 +0000642# If optimizations are enabled or disabled (either implicitly or
643# explicitly), add the necessary flags.
mistachkin4712c212014-05-09 20:51:17 +0000644#
mistachkincd54bab2014-12-20 21:14:14 +0000645!IF $(DEBUG)>1 || $(OPTIMIZATIONS)==0
mistachkin8bcd3fa2013-08-29 01:03:38 +0000646TCC = $(TCC) -Od
647BCC = $(BCC) -Od
648!ELSEIF $(OPTIMIZATIONS)>=3
649TCC = $(TCC) -Ox
650BCC = $(BCC) -Ox
651!ELSEIF $(OPTIMIZATIONS)==2
652TCC = $(TCC) -O2
653BCC = $(BCC) -O2
654!ELSEIF $(OPTIMIZATIONS)==1
655TCC = $(TCC) -O1
656BCC = $(BCC) -O1
657!ENDIF
658
659# If symbols are enabled (or compiling for debugging), enable PDBs.
mistachkin4712c212014-05-09 20:51:17 +0000660#
mistachkincd54bab2014-12-20 21:14:14 +0000661!IF $(DEBUG)>1 || $(SYMBOLS)!=0
mistachkin4d60be52011-08-26 05:40:31 +0000662TCC = $(TCC) -Zi
mistachkinfec360a2012-04-18 10:29:21 +0000663BCC = $(BCC) -Zi
mistachkin753c5442011-08-25 02:02:25 +0000664!ENDIF
665
mistachkinc756ded2011-10-02 05:23:16 +0000666# If ICU support is enabled, add the compiler options for it.
mistachkin4712c212014-05-09 20:51:17 +0000667#
mistachkinc756ded2011-10-02 05:23:16 +0000668!IF $(USE_ICU)!=0
669TCC = $(TCC) -DSQLITE_ENABLE_ICU=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000670RCC = $(RCC) -DSQLITE_ENABLE_ICU=1
mistachkinc756ded2011-10-02 05:23:16 +0000671TCC = $(TCC) -I$(TOP)\ext\icu
mistachkin4d9d1f42012-09-03 10:32:32 +0000672RCC = $(RCC) -I$(TOP)\ext\icu
mistachkinc756ded2011-10-02 05:23:16 +0000673TCC = $(TCC) -I$(ICUINCDIR)
mistachkin4d9d1f42012-09-03 10:32:32 +0000674RCC = $(RCC) -I$(ICUINCDIR)
mistachkinc756ded2011-10-02 05:23:16 +0000675!ENDIF
676
mistachkin4d9d1f42012-09-03 10:32:32 +0000677# Command line prefixes for compiling code, compiling resources,
678# linking, etc.
mistachkin4712c212014-05-09 20:51:17 +0000679#
shanehb2f20bf2011-06-17 07:07:24 +0000680LTCOMPILE = $(TCC) -Fo$@
mistachkin4d9d1f42012-09-03 10:32:32 +0000681LTRCOMPILE = $(RCC) -r
shanehb2f20bf2011-06-17 07:07:24 +0000682LTLIB = lib.exe
shaneh2a0b9ef2011-06-20 20:52:32 +0000683LTLINK = $(TCC) -Fe$@
684
mistachkine45e0fb2015-01-21 00:48:46 +0000685# If requested, link to the RPCRT4 library.
686#
687!IF $(USE_RPCRT4_LIB)!=0
688LTLINK = $(LTLINK) rpcrt4.lib
689!ENDIF
690
shaneh2a0b9ef2011-06-20 20:52:32 +0000691# If a platform was set, force the linker to target that.
692# Note that the vcvars*.bat family of batch files typically
693# set this for you. Otherwise, the linker will attempt
694# to deduce the binary type based on the object files.
mistachkine37f99c2012-06-30 16:22:05 +0000695!IFDEF PLATFORM
mistachkin44723ce2015-03-21 02:22:37 +0000696LTLINKOPTS = /NOLOGO /MACHINE:$(PLATFORM)
697LTLIBOPTS = /NOLOGO /MACHINE:$(PLATFORM)
698!ELSE
699LTLINKOPTS = /NOLOGO
700LTLIBOPTS = /NOLOGO
shaneh2a0b9ef2011-06-20 20:52:32 +0000701!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000702
mistachkina6ff8572012-04-17 21:00:12 +0000703# When compiling for use in the WinRT environment, the following
704# linker option must be used to mark the executable as runnable
705# only in the context of an application container.
706#
707!IF $(FOR_WINRT)!=0
708LTLINKOPTS = $(LTLINKOPTS) /APPCONTAINER
mistachkin60bdad72013-07-11 03:09:45 +0000709!IF "$(VISUALSTUDIOVERSION)"=="12.0"
mistachkinf6a23422014-05-05 20:24:34 +0000710!IFNDEF STORELIBPATH
mistachkinda5b1cd2013-07-10 19:39:02 +0000711!IF "$(PLATFORM)"=="x86"
mistachkin4712c212014-05-09 20:51:17 +0000712STORELIBPATH = $(CRTLIBPATH)\store
mistachkinda5b1cd2013-07-10 19:39:02 +0000713!ELSEIF "$(PLATFORM)"=="x64"
mistachkin4712c212014-05-09 20:51:17 +0000714STORELIBPATH = $(CRTLIBPATH)\store\amd64
mistachkin4eaa1292013-07-10 21:33:25 +0000715!ELSEIF "$(PLATFORM)"=="ARM"
mistachkin4712c212014-05-09 20:51:17 +0000716STORELIBPATH = $(CRTLIBPATH)\store\arm
mistachkin4eaa1292013-07-10 21:33:25 +0000717!ELSE
mistachkin4712c212014-05-09 20:51:17 +0000718STORELIBPATH = $(CRTLIBPATH)\store
mistachkinda5b1cd2013-07-10 19:39:02 +0000719!ENDIF
720!ENDIF
mistachkinf6a23422014-05-05 20:24:34 +0000721STORELIBPATH = $(STORELIBPATH:\\=\)
722LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(STORELIBPATH)"
723!ENDIF
mistachkina6ff8572012-04-17 21:00:12 +0000724!ENDIF
725
mistachkind9b3c542014-05-09 23:31:55 +0000726# When compiling for Windows Phone 8.1, an extra library path is
727# required.
728#
729!IF $(USE_WP81_OPTS)!=0
730!IFNDEF WP81LIBPATH
731!IF "$(PLATFORM)"=="x86"
732WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86
733!ELSEIF "$(PLATFORM)"=="ARM"
734WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\ARM
735!ELSE
736WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86
737!ENDIF
738!ENDIF
739!ENDIF
740
741# When compiling for Windows Phone 8.1, some extra linker options
742# are also required.
743#
744!IF $(USE_WP81_OPTS)!=0
745!IFDEF WP81LIBPATH
746LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(WP81LIBPATH)"
747!ENDIF
748LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE
749LTLINKOPTS = $(LTLINKOPTS) WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelHost.lib
750LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:kernel32.lib /NODEFAULTLIB:ole32.lib
751!ENDIF
752
mistachkinfec360a2012-04-18 10:29:21 +0000753# If either debugging or symbols are enabled, enable PDBs.
mistachkin4712c212014-05-09 20:51:17 +0000754#
mistachkincd54bab2014-12-20 21:14:14 +0000755!IF $(DEBUG)>1 || $(SYMBOLS)!=0
mistachkin228aeff2012-06-30 19:24:09 +0000756LDFLAGS = /DEBUG
mistachkin753c5442011-08-25 02:02:25 +0000757!ENDIF
758
mistachkinc756ded2011-10-02 05:23:16 +0000759# Start with the Tcl related linker options.
mistachkin4712c212014-05-09 20:51:17 +0000760#
mistachkin31856a32012-07-27 07:13:25 +0000761!IF $(NO_TCL)==0
mistachkinc756ded2011-10-02 05:23:16 +0000762LTLIBPATHS = /LIBPATH:$(TCLLIBDIR)
763LTLIBS = $(LIBTCL)
mistachkin31856a32012-07-27 07:13:25 +0000764!ENDIF
mistachkinc756ded2011-10-02 05:23:16 +0000765
766# If ICU support is enabled, add the linker options for it.
mistachkin4712c212014-05-09 20:51:17 +0000767#
mistachkinc756ded2011-10-02 05:23:16 +0000768!IF $(USE_ICU)!=0
769LTLIBPATHS = $(LTLIBPATHS) /LIBPATH:$(ICULIBDIR)
770LTLIBS = $(LTLIBS) $(LIBICU)
771!ENDIF
772
shanehb2f20bf2011-06-17 07:07:24 +0000773# nawk compatible awk.
mistachkin4712c212014-05-09 20:51:17 +0000774#
mistachkin8bcd3fa2013-08-29 01:03:38 +0000775!IFNDEF NAWK
mistachkin5b0b6fd2011-06-25 01:14:36 +0000776NAWK = gawk.exe
mistachkin8bcd3fa2013-08-29 01:03:38 +0000777!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000778
779# You should not have to change anything below this line
780###############################################################################
781
shanehb2f20bf2011-06-17 07:07:24 +0000782# Object files for the SQLite library (non-amalgamation).
783#
mistachkinf67feef2013-07-29 19:03:20 +0000784LIBOBJS0 = vdbe.lo parse.lo alter.lo analyze.lo attach.lo auth.lo \
shanehb2f20bf2011-06-17 07:07:24 +0000785 backup.lo bitvec.lo btmutex.lo btree.lo build.lo \
786 callback.lo complete.lo ctime.lo date.lo delete.lo \
787 expr.lo fault.lo fkey.lo \
drh391d4ba2012-05-28 20:22:16 +0000788 fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo \
789 fts3_porter.lo fts3_snippet.lo fts3_tokenizer.lo fts3_tokenizer1.lo \
drh4d648c72013-04-22 17:07:56 +0000790 fts3_tokenize_vtab.lo fts3_unicode.lo fts3_unicode2.lo fts3_write.lo \
shanehb2f20bf2011-06-17 07:07:24 +0000791 func.lo global.lo hash.lo \
792 icu.lo insert.lo journal.lo legacy.lo loadext.lo \
793 main.lo malloc.lo mem0.lo mem1.lo mem2.lo mem3.lo mem5.lo \
794 memjournal.lo \
mistachkinf1c6bc52012-06-21 15:09:20 +0000795 mutex.lo mutex_noop.lo mutex_unix.lo mutex_w32.lo \
796 notify.lo opcodes.lo os.lo os_unix.lo os_win.lo \
mistachkinf67feef2013-07-29 19:03:20 +0000797 pager.lo pcache.lo pcache1.lo pragma.lo prepare.lo printf.lo \
shanehb2f20bf2011-06-17 07:07:24 +0000798 random.lo resolve.lo rowset.lo rtree.lo select.lo status.lo \
mistachkine5007472014-05-02 19:12:37 +0000799 table.lo threads.lo tokenize.lo trigger.lo \
shanehb2f20bf2011-06-17 07:07:24 +0000800 update.lo util.lo vacuum.lo \
mistachkinf67feef2013-07-29 19:03:20 +0000801 vdbeapi.lo vdbeaux.lo vdbeblob.lo vdbemem.lo vdbesort.lo \
mistachkin81c428a2011-08-17 02:19:54 +0000802 vdbetrace.lo wal.lo walker.lo where.lo utf.lo vtab.lo
shanehb2f20bf2011-06-17 07:07:24 +0000803
804# Object files for the amalgamation.
805#
806LIBOBJS1 = sqlite3.lo
807
808# Determine the real value of LIBOBJ based on the 'configure' script
809#
810!IF $(USE_AMALGAMATION)==0
811LIBOBJ = $(LIBOBJS0)
812!ELSE
813LIBOBJ = $(LIBOBJS1)
814!ENDIF
815
mistachkin08c1c312012-10-06 03:48:25 +0000816# Determine if embedded resource compilation and usage are enabled.
817#
818!IF $(USE_RC)!=0
819LIBRESOBJS = sqlite3res.lo
820!ELSE
821LIBRESOBJS =
822!ENDIF
823
shanehb2f20bf2011-06-17 07:07:24 +0000824# All of the source code files.
825#
drh62679202015-01-29 18:38:05 +0000826SRC1 = \
shanehb2f20bf2011-06-17 07:07:24 +0000827 $(TOP)\src\alter.c \
828 $(TOP)\src\analyze.c \
829 $(TOP)\src\attach.c \
830 $(TOP)\src\auth.c \
831 $(TOP)\src\backup.c \
832 $(TOP)\src\bitvec.c \
833 $(TOP)\src\btmutex.c \
834 $(TOP)\src\btree.c \
835 $(TOP)\src\btree.h \
836 $(TOP)\src\btreeInt.h \
837 $(TOP)\src\build.c \
838 $(TOP)\src\callback.c \
839 $(TOP)\src\complete.c \
840 $(TOP)\src\ctime.c \
841 $(TOP)\src\date.c \
842 $(TOP)\src\delete.c \
843 $(TOP)\src\expr.c \
844 $(TOP)\src\fault.c \
845 $(TOP)\src\fkey.c \
846 $(TOP)\src\func.c \
847 $(TOP)\src\global.c \
848 $(TOP)\src\hash.c \
849 $(TOP)\src\hash.h \
850 $(TOP)\src\hwtime.h \
851 $(TOP)\src\insert.c \
852 $(TOP)\src\journal.c \
853 $(TOP)\src\legacy.c \
854 $(TOP)\src\loadext.c \
855 $(TOP)\src\main.c \
856 $(TOP)\src\malloc.c \
857 $(TOP)\src\mem0.c \
858 $(TOP)\src\mem1.c \
859 $(TOP)\src\mem2.c \
860 $(TOP)\src\mem3.c \
861 $(TOP)\src\mem5.c \
862 $(TOP)\src\memjournal.c \
mistachkin2318d332015-01-12 18:02:52 +0000863 $(TOP)\src\msvc.h \
shanehb2f20bf2011-06-17 07:07:24 +0000864 $(TOP)\src\mutex.c \
865 $(TOP)\src\mutex.h \
866 $(TOP)\src\mutex_noop.c \
shanehb2f20bf2011-06-17 07:07:24 +0000867 $(TOP)\src\mutex_unix.c \
868 $(TOP)\src\mutex_w32.c \
869 $(TOP)\src\notify.c \
870 $(TOP)\src\os.c \
871 $(TOP)\src\os.h \
872 $(TOP)\src\os_common.h \
mistachkinf74b9e02013-11-26 01:00:31 +0000873 $(TOP)\src\os_setup.h \
shanehb2f20bf2011-06-17 07:07:24 +0000874 $(TOP)\src\os_unix.c \
875 $(TOP)\src\os_win.c \
drh62679202015-01-29 18:38:05 +0000876 $(TOP)\src\os_win.h
877SRC2 = \
shanehb2f20bf2011-06-17 07:07:24 +0000878 $(TOP)\src\pager.c \
879 $(TOP)\src\pager.h \
880 $(TOP)\src\parse.y \
881 $(TOP)\src\pcache.c \
882 $(TOP)\src\pcache.h \
883 $(TOP)\src\pcache1.c \
884 $(TOP)\src\pragma.c \
drh67e65e52015-02-02 21:34:54 +0000885 $(TOP)\src\pragma.h \
shanehb2f20bf2011-06-17 07:07:24 +0000886 $(TOP)\src\prepare.c \
887 $(TOP)\src\printf.c \
888 $(TOP)\src\random.c \
889 $(TOP)\src\resolve.c \
890 $(TOP)\src\rowset.c \
891 $(TOP)\src\select.c \
892 $(TOP)\src\status.c \
893 $(TOP)\src\shell.c \
894 $(TOP)\src\sqlite.h.in \
895 $(TOP)\src\sqlite3ext.h \
896 $(TOP)\src\sqliteInt.h \
897 $(TOP)\src\sqliteLimit.h \
898 $(TOP)\src\table.c \
drhf51446a2012-07-21 19:40:42 +0000899 $(TOP)\src\threads.c \
shanehb2f20bf2011-06-17 07:07:24 +0000900 $(TOP)\src\tclsqlite.c \
901 $(TOP)\src\tokenize.c \
902 $(TOP)\src\trigger.c \
903 $(TOP)\src\utf.c \
904 $(TOP)\src\update.c \
905 $(TOP)\src\util.c \
906 $(TOP)\src\vacuum.c \
907 $(TOP)\src\vdbe.c \
908 $(TOP)\src\vdbe.h \
909 $(TOP)\src\vdbeapi.c \
910 $(TOP)\src\vdbeaux.c \
911 $(TOP)\src\vdbeblob.c \
912 $(TOP)\src\vdbemem.c \
mistachkin81c428a2011-08-17 02:19:54 +0000913 $(TOP)\src\vdbesort.c \
shanehb2f20bf2011-06-17 07:07:24 +0000914 $(TOP)\src\vdbetrace.c \
915 $(TOP)\src\vdbeInt.h \
916 $(TOP)\src\vtab.c \
drh8cd5b252015-03-02 22:06:43 +0000917 $(TOP)\src\vxworks.h \
shanehb2f20bf2011-06-17 07:07:24 +0000918 $(TOP)\src\wal.c \
919 $(TOP)\src\wal.h \
920 $(TOP)\src\walker.c \
drhe54df422013-11-12 18:37:25 +0000921 $(TOP)\src\where.c \
922 $(TOP)\src\whereInt.h
shanehb2f20bf2011-06-17 07:07:24 +0000923
924# Source code for extensions
925#
drh62679202015-01-29 18:38:05 +0000926SRC3 = \
shanehb2f20bf2011-06-17 07:07:24 +0000927 $(TOP)\ext\fts1\fts1.c \
928 $(TOP)\ext\fts1\fts1.h \
929 $(TOP)\ext\fts1\fts1_hash.c \
930 $(TOP)\ext\fts1\fts1_hash.h \
931 $(TOP)\ext\fts1\fts1_porter.c \
932 $(TOP)\ext\fts1\fts1_tokenizer.h \
drh62679202015-01-29 18:38:05 +0000933 $(TOP)\ext\fts1\fts1_tokenizer1.c \
shanehb2f20bf2011-06-17 07:07:24 +0000934 $(TOP)\ext\fts2\fts2.c \
935 $(TOP)\ext\fts2\fts2.h \
936 $(TOP)\ext\fts2\fts2_hash.c \
937 $(TOP)\ext\fts2\fts2_hash.h \
938 $(TOP)\ext\fts2\fts2_icu.c \
939 $(TOP)\ext\fts2\fts2_porter.c \
940 $(TOP)\ext\fts2\fts2_tokenizer.h \
941 $(TOP)\ext\fts2\fts2_tokenizer.c \
942 $(TOP)\ext\fts2\fts2_tokenizer1.c
drh62679202015-01-29 18:38:05 +0000943SRC4 = \
shanehb2f20bf2011-06-17 07:07:24 +0000944 $(TOP)\ext\fts3\fts3.c \
945 $(TOP)\ext\fts3\fts3.h \
946 $(TOP)\ext\fts3\fts3Int.h \
947 $(TOP)\ext\fts3\fts3_aux.c \
948 $(TOP)\ext\fts3\fts3_expr.c \
949 $(TOP)\ext\fts3\fts3_hash.c \
950 $(TOP)\ext\fts3\fts3_hash.h \
951 $(TOP)\ext\fts3\fts3_icu.c \
952 $(TOP)\ext\fts3\fts3_porter.c \
953 $(TOP)\ext\fts3\fts3_snippet.c \
954 $(TOP)\ext\fts3\fts3_tokenizer.h \
955 $(TOP)\ext\fts3\fts3_tokenizer.c \
956 $(TOP)\ext\fts3\fts3_tokenizer1.c \
drh4d648c72013-04-22 17:07:56 +0000957 $(TOP)\ext\fts3\fts3_tokenize_vtab.c \
drh391d4ba2012-05-28 20:22:16 +0000958 $(TOP)\ext\fts3\fts3_unicode.c \
959 $(TOP)\ext\fts3\fts3_unicode2.c \
drh62679202015-01-29 18:38:05 +0000960 $(TOP)\ext\fts3\fts3_write.c \
shanehb2f20bf2011-06-17 07:07:24 +0000961 $(TOP)\ext\icu\sqliteicu.h \
drh62679202015-01-29 18:38:05 +0000962 $(TOP)\ext\icu\icu.c \
shanehb2f20bf2011-06-17 07:07:24 +0000963 $(TOP)\ext\rtree\rtree.h \
964 $(TOP)\ext\rtree\rtree.c
965
966
967# Generated source code files
968#
drh62679202015-01-29 18:38:05 +0000969SRC5 = \
shanehb2f20bf2011-06-17 07:07:24 +0000970 keywordhash.h \
971 opcodes.c \
972 opcodes.h \
973 parse.c \
974 parse.h \
975 sqlite3.h
976
drh62679202015-01-29 18:38:05 +0000977# All source code files.
978#
979SRC = $(SRC1) $(SRC2) $(SRC3) $(SRC4) $(SRC5)
980
shanehb2f20bf2011-06-17 07:07:24 +0000981# Source code to the test files.
982#
983TESTSRC = \
984 $(TOP)\src\test1.c \
985 $(TOP)\src\test2.c \
986 $(TOP)\src\test3.c \
987 $(TOP)\src\test4.c \
988 $(TOP)\src\test5.c \
989 $(TOP)\src\test6.c \
990 $(TOP)\src\test7.c \
991 $(TOP)\src\test8.c \
992 $(TOP)\src\test9.c \
993 $(TOP)\src\test_autoext.c \
994 $(TOP)\src\test_async.c \
995 $(TOP)\src\test_backup.c \
drh5de7d962014-12-05 00:17:39 +0000996 $(TOP)\src\test_blob.c \
shanehb2f20bf2011-06-17 07:07:24 +0000997 $(TOP)\src\test_btree.c \
998 $(TOP)\src\test_config.c \
999 $(TOP)\src\test_demovfs.c \
1000 $(TOP)\src\test_devsym.c \
mistachkin413c63b2013-01-17 03:18:14 +00001001 $(TOP)\src\test_fs.c \
shanehb2f20bf2011-06-17 07:07:24 +00001002 $(TOP)\src\test_func.c \
shanehb2f20bf2011-06-17 07:07:24 +00001003 $(TOP)\src\test_hexio.c \
1004 $(TOP)\src\test_init.c \
1005 $(TOP)\src\test_intarray.c \
1006 $(TOP)\src\test_journal.c \
1007 $(TOP)\src\test_malloc.c \
1008 $(TOP)\src\test_multiplex.c \
1009 $(TOP)\src\test_mutex.c \
1010 $(TOP)\src\test_onefile.c \
1011 $(TOP)\src\test_osinst.c \
1012 $(TOP)\src\test_pcache.c \
1013 $(TOP)\src\test_quota.c \
1014 $(TOP)\src\test_rtree.c \
1015 $(TOP)\src\test_schema.c \
1016 $(TOP)\src\test_server.c \
1017 $(TOP)\src\test_superlock.c \
1018 $(TOP)\src\test_syscall.c \
1019 $(TOP)\src\test_stat.c \
1020 $(TOP)\src\test_tclvar.c \
1021 $(TOP)\src\test_thread.c \
1022 $(TOP)\src\test_vfs.c \
shanehb2f20bf2011-06-17 07:07:24 +00001023 $(TOP)\src\test_wsd.c \
1024 $(TOP)\ext\fts3\fts3_term.c \
shaneh6e7850c2011-06-17 15:57:07 +00001025 $(TOP)\ext\fts3\fts3_test.c
shanehb2f20bf2011-06-17 07:07:24 +00001026
drhe50db1c2013-04-25 14:31:46 +00001027# Statically linked extensions
1028#
drh1fb64af2013-04-25 14:36:28 +00001029TESTEXT = \
drh8416fc72013-04-25 16:42:55 +00001030 $(TOP)\ext\misc\amatch.c \
1031 $(TOP)\ext\misc\closure.c \
drh1728bcb2014-11-10 16:49:56 +00001032 $(TOP)\ext\misc\eval.c \
drh51ed2982014-06-16 12:44:32 +00001033 $(TOP)\ext\misc\fileio.c \
drhe50db1c2013-04-25 14:31:46 +00001034 $(TOP)\ext\misc\fuzzer.c \
drh8416fc72013-04-25 16:42:55 +00001035 $(TOP)\ext\misc\ieee754.c \
drhea41dc42013-04-25 19:31:33 +00001036 $(TOP)\ext\misc\nextchar.c \
drhdef33672013-05-28 20:25:54 +00001037 $(TOP)\ext\misc\percentile.c \
drhe50db1c2013-04-25 14:31:46 +00001038 $(TOP)\ext\misc\regexp.c \
drhb7045ab2013-04-25 14:59:01 +00001039 $(TOP)\ext\misc\spellfix.c \
drh5f8cdac2013-10-14 21:14:42 +00001040 $(TOP)\ext\misc\totype.c \
drhe50db1c2013-04-25 14:31:46 +00001041 $(TOP)\ext\misc\wholenumber.c
1042
1043
shanehb2f20bf2011-06-17 07:07:24 +00001044# Source code to the library files needed by the test fixture
1045#
1046TESTSRC2 = \
1047 $(TOP)\src\attach.c \
1048 $(TOP)\src\backup.c \
1049 $(TOP)\src\bitvec.c \
1050 $(TOP)\src\btree.c \
1051 $(TOP)\src\build.c \
1052 $(TOP)\src\ctime.c \
1053 $(TOP)\src\date.c \
1054 $(TOP)\src\expr.c \
1055 $(TOP)\src\func.c \
1056 $(TOP)\src\insert.c \
1057 $(TOP)\src\wal.c \
mistachkin06006632013-05-15 20:35:13 +00001058 $(TOP)\src\main.c \
shanehb2f20bf2011-06-17 07:07:24 +00001059 $(TOP)\src\mem5.c \
1060 $(TOP)\src\os.c \
shanehb2f20bf2011-06-17 07:07:24 +00001061 $(TOP)\src\os_unix.c \
1062 $(TOP)\src\os_win.c \
1063 $(TOP)\src\pager.c \
1064 $(TOP)\src\pragma.c \
1065 $(TOP)\src\prepare.c \
1066 $(TOP)\src\printf.c \
1067 $(TOP)\src\random.c \
1068 $(TOP)\src\pcache.c \
1069 $(TOP)\src\pcache1.c \
1070 $(TOP)\src\select.c \
1071 $(TOP)\src\tokenize.c \
1072 $(TOP)\src\utf.c \
1073 $(TOP)\src\util.c \
1074 $(TOP)\src\vdbeapi.c \
1075 $(TOP)\src\vdbeaux.c \
1076 $(TOP)\src\vdbe.c \
1077 $(TOP)\src\vdbemem.c \
mistachkin81c428a2011-08-17 02:19:54 +00001078 $(TOP)\src\vdbesort.c \
shanehb2f20bf2011-06-17 07:07:24 +00001079 $(TOP)\src\vdbetrace.c \
1080 $(TOP)\src\where.c \
1081 parse.c \
1082 $(TOP)\ext\fts3\fts3.c \
1083 $(TOP)\ext\fts3\fts3_aux.c \
1084 $(TOP)\ext\fts3\fts3_expr.c \
shanehb2f20bf2011-06-17 07:07:24 +00001085 $(TOP)\ext\fts3\fts3_tokenizer.c \
drh4d648c72013-04-22 17:07:56 +00001086 $(TOP)\ext\fts3\fts3_tokenize_vtab.c \
drh391d4ba2012-05-28 20:22:16 +00001087 $(TOP)\ext\fts3\fts3_unicode.c \
1088 $(TOP)\ext\fts3\fts3_unicode2.c \
shanehb2f20bf2011-06-17 07:07:24 +00001089 $(TOP)\ext\fts3\fts3_write.c \
1090 $(TOP)\ext\async\sqlite3async.c
1091
1092# Header files used by all library source files.
1093#
1094HDR = \
1095 $(TOP)\src\btree.h \
1096 $(TOP)\src\btreeInt.h \
1097 $(TOP)\src\hash.h \
1098 $(TOP)\src\hwtime.h \
1099 keywordhash.h \
mistachkin2318d332015-01-12 18:02:52 +00001100 $(TOP)\src\msvc.h \
shanehb2f20bf2011-06-17 07:07:24 +00001101 $(TOP)\src\mutex.h \
1102 opcodes.h \
1103 $(TOP)\src\os.h \
1104 $(TOP)\src\os_common.h \
mistachkinf74b9e02013-11-26 01:00:31 +00001105 $(TOP)\src\os_setup.h \
mistachkin8bc52622013-11-25 09:36:07 +00001106 $(TOP)\src\os_win.h \
shanehb2f20bf2011-06-17 07:07:24 +00001107 $(TOP)\src\pager.h \
1108 $(TOP)\src\pcache.h \
shaneh6e7850c2011-06-17 15:57:07 +00001109 parse.h \
drh67e65e52015-02-02 21:34:54 +00001110 $(TOP)\src\pragma.h \
shaneh6e7850c2011-06-17 15:57:07 +00001111 sqlite3.h \
shanehb2f20bf2011-06-17 07:07:24 +00001112 $(TOP)\src\sqlite3ext.h \
shaneh6e7850c2011-06-17 15:57:07 +00001113 $(TOP)\src\sqliteInt.h \
shanehb2f20bf2011-06-17 07:07:24 +00001114 $(TOP)\src\sqliteLimit.h \
1115 $(TOP)\src\vdbe.h \
drhe54df422013-11-12 18:37:25 +00001116 $(TOP)\src\vdbeInt.h \
drh8cd5b252015-03-02 22:06:43 +00001117 $(TOP)\src\vxworks.h \
drhe54df422013-11-12 18:37:25 +00001118 $(TOP)\src\whereInt.h
shanehb2f20bf2011-06-17 07:07:24 +00001119
1120# Header files used by extensions
1121#
1122EXTHDR = $(EXTHDR) \
1123 $(TOP)\ext\fts1\fts1.h \
1124 $(TOP)\ext\fts1\fts1_hash.h \
1125 $(TOP)\ext\fts1\fts1_tokenizer.h
1126EXTHDR = $(EXTHDR) \
1127 $(TOP)\ext\fts2\fts2.h \
1128 $(TOP)\ext\fts2\fts2_hash.h \
1129 $(TOP)\ext\fts2\fts2_tokenizer.h
1130EXTHDR = $(EXTHDR) \
1131 $(TOP)\ext\fts3\fts3.h \
1132 $(TOP)\ext\fts3\fts3Int.h \
1133 $(TOP)\ext\fts3\fts3_hash.h \
1134 $(TOP)\ext\fts3\fts3_tokenizer.h
1135EXTHDR = $(EXTHDR) \
1136 $(TOP)\ext\rtree\rtree.h
1137EXTHDR = $(EXTHDR) \
1138 $(TOP)\ext\icu\sqliteicu.h
1139EXTHDR = $(EXTHDR) \
1140 $(TOP)\ext\rtree\sqlite3rtree.h
1141
1142# This is the default Makefile target. The objects listed here
1143# are what get build when you type just "make" with no arguments.
1144#
mistachkin5b0b6fd2011-06-25 01:14:36 +00001145all: dll libsqlite3.lib sqlite3.exe libtclsqlite3.lib
shanehb2f20bf2011-06-17 07:07:24 +00001146
shanehb2f20bf2011-06-17 07:07:24 +00001147libsqlite3.lib: $(LIBOBJ)
shaneh29ebea82011-06-21 18:12:07 +00001148 $(LTLIB) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001149
1150libtclsqlite3.lib: tclsqlite.lo libsqlite3.lib
mistachkinc756ded2011-10-02 05:23:16 +00001151 $(LTLIB) $(LTLIBOPTS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCL:tcl=tclstub) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001152
mistachkin44723ce2015-03-21 02:22:37 +00001153sqlite3.exe: $(TOP)\src\shell.c $(SHELL_CORE_DEP) $(LIBRESOBJS) sqlite3.h
1154 $(LTLINK) $(SHELL_COMPILE_OPTS) $(READLINE_FLAGS) $(TOP)\src\shell.c \
1155 /link /pdb:sqlite3sh.pdb $(LTLINKOPTS) $(SHELL_LINK_OPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001156
drhd62c0f42015-04-09 13:34:29 +00001157sqldiff.exe: $(TOP)\tool\sqldiff.c sqlite3.c sqlite3.h
1158 $(LTLINK) $(TOP)\tool\sqldiff.c sqlite3.c
1159
mistachkin44723ce2015-03-21 02:22:37 +00001160mptester.exe: $(TOP)\mptest\mptest.c $(SHELL_CORE_DEP) $(LIBRESOBJS) sqlite3.h
1161 $(LTLINK) $(SHELL_COMPILE_OPTS) $(TOP)\mptest\mptest.c \
1162 /link $(LTLINKOPTS) $(LTLIBPATHS) $(SHELL_LINK_OPTS) $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001163
mistachkin4d2daba2015-03-31 16:42:16 +00001164MPTEST1 = mptester mptest.db $(TOP)/mptest/crash01.test --repeat 20
1165MPTEST2 = mptester mptest.db $(TOP)/mptest/multiwrite01.test --repeat 20
1166
drhfe0ba712015-03-31 13:46:13 +00001167mptest: mptester.exe
mistachkin4d2daba2015-03-31 16:42:16 +00001168 del /Q mptest.db 2>NUL
drhfe0ba712015-03-31 13:46:13 +00001169 $(MPTEST1) --journalmode DELETE
1170 $(MPTEST2) --journalmode WAL
1171 $(MPTEST1) --journalmode WAL
1172 $(MPTEST2) --journalmode PERSIST
1173 $(MPTEST1) --journalmode PERSIST
1174 $(MPTEST2) --journalmode TRUNCATE
1175 $(MPTEST1) --journalmode TRUNCATE
1176 $(MPTEST2) --journalmode DELETE
1177
shanehb2f20bf2011-06-17 07:07:24 +00001178# This target creates a directory named "tsrc" and fills it with
1179# copies of all of the C source code and header files needed to
1180# build on the target system. Some of the C source code and header
1181# files are automatically generated. This target takes care of
1182# all that automatic generation.
1183#
1184.target_source: $(SRC) $(TOP)\tool\vdbe-compress.tcl
mistachkin44723ce2015-03-21 02:22:37 +00001185 -rmdir /Q/S tsrc 2>NUL
shanehb2f20bf2011-06-17 07:07:24 +00001186 -mkdir tsrc
drh62679202015-01-29 18:38:05 +00001187 for %i in ($(SRC1)) do copy /Y %i tsrc
1188 for %i in ($(SRC2)) do copy /Y %i tsrc
1189 for %i in ($(SRC3)) do copy /Y %i tsrc
1190 for %i in ($(SRC4)) do copy /Y %i tsrc
1191 for %i in ($(SRC5)) do copy /Y %i tsrc
mistachkin44723ce2015-03-21 02:22:37 +00001192 del /Q tsrc\sqlite.h.in tsrc\parse.y 2>NUL
drh2dc06482013-12-11 00:59:10 +00001193 $(TCLSH_CMD) $(TOP)\tool\vdbe-compress.tcl $(OPTS) < tsrc\vdbe.c > vdbe.new
shanehb2f20bf2011-06-17 07:07:24 +00001194 move vdbe.new tsrc\vdbe.c
1195 echo > .target_source
1196
1197sqlite3.c: .target_source $(TOP)\tool\mksqlite3c.tcl
mistachkinb0427512014-01-30 11:12:52 +00001198 $(TCLSH_CMD) $(TOP)\tool\mksqlite3c.tcl $(MKSQLITE3C_ARGS)
drh339d6c62013-03-19 16:12:40 +00001199 copy tsrc\shell.c .
1200 copy tsrc\sqlite3ext.h .
shanehb2f20bf2011-06-17 07:07:24 +00001201
mistachkin48dd9de2012-12-06 04:33:13 +00001202sqlite3-all.c: sqlite3.c $(TOP)\tool\split-sqlite3c.tcl
1203 $(TCLSH_CMD) $(TOP)\tool\split-sqlite3c.tcl
drh75e7bc12011-07-22 11:23:49 +00001204
mistachkin76510912013-10-11 23:01:18 +00001205# Set the source code file to be used by executables and libraries when
1206# they need the amalgamation.
1207#
1208!IF $(SPLIT_AMALGAMATION)!=0
1209SQLITE3C = sqlite3-all.c
1210!ELSE
1211SQLITE3C = sqlite3.c
1212!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +00001213
shaneh6e7850c2011-06-17 15:57:07 +00001214# Rule to build the amalgamation
shanehb2f20bf2011-06-17 07:07:24 +00001215#
mistachkin76510912013-10-11 23:01:18 +00001216sqlite3.lo: $(SQLITE3C)
mistachkin44723ce2015-03-21 02:22:37 +00001217 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(SQLITE3C)
shanehb2f20bf2011-06-17 07:07:24 +00001218
1219# Rules to build the LEMON compiler generator
1220#
1221lempar.c: $(TOP)\src\lempar.c
1222 copy $(TOP)\src\lempar.c .
1223
1224lemon.exe: $(TOP)\tool\lemon.c lempar.c
mistachkin2318d332015-01-12 18:02:52 +00001225 $(BCC) $(NO_WARN) -Daccess=_access \
1226 -Fe$@ $(TOP)\tool\lemon.c /link $(NLTLINKOPTS) $(NLTLIBPATHS)
shanehb2f20bf2011-06-17 07:07:24 +00001227
1228# Rules to build individual *.lo files from generated *.c files. This
1229# applies to:
1230#
1231# parse.lo
1232# opcodes.lo
1233#
1234parse.lo: parse.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001235 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c parse.c
shanehb2f20bf2011-06-17 07:07:24 +00001236
1237opcodes.lo: opcodes.c
mistachkin44723ce2015-03-21 02:22:37 +00001238 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c opcodes.c
shanehb2f20bf2011-06-17 07:07:24 +00001239
mistachkin4d9d1f42012-09-03 10:32:32 +00001240# Rule to build the Win32 resources object file.
1241#
mistachkin08c1c312012-10-06 03:48:25 +00001242!IF $(USE_RC)!=0
1243$(LIBRESOBJS): $(TOP)\src\sqlite3.rc $(HDR)
mistachkin4d9d1f42012-09-03 10:32:32 +00001244 echo #ifndef SQLITE_RESOURCE_VERSION > sqlite3rc.h
mistachkin8ccc6d42012-09-27 21:03:53 +00001245 for /F %%V in ('type "$(TOP)\VERSION"') do ( \
mistachkin4d9d1f42012-09-03 10:32:32 +00001246 echo #define SQLITE_RESOURCE_VERSION %%V \
mistachkin597a8c52012-09-03 11:14:53 +00001247 | $(NAWK) "/.*/ { gsub(/[.]/,\",\");print }" >> sqlite3rc.h \
mistachkin4d9d1f42012-09-03 10:32:32 +00001248 )
1249 echo #endif >> sqlite3rc.h
mistachkin08c1c312012-10-06 03:48:25 +00001250 $(LTRCOMPILE) -fo $(LIBRESOBJS) $(TOP)\src\sqlite3.rc
1251!ENDIF
mistachkin4d9d1f42012-09-03 10:32:32 +00001252
shanehb2f20bf2011-06-17 07:07:24 +00001253# Rules to build individual *.lo files from files in the src directory.
1254#
1255alter.lo: $(TOP)\src\alter.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001256 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\alter.c
shanehb2f20bf2011-06-17 07:07:24 +00001257
1258analyze.lo: $(TOP)\src\analyze.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001259 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\analyze.c
shanehb2f20bf2011-06-17 07:07:24 +00001260
1261attach.lo: $(TOP)\src\attach.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001262 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\attach.c
shanehb2f20bf2011-06-17 07:07:24 +00001263
1264auth.lo: $(TOP)\src\auth.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001265 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\auth.c
shanehb2f20bf2011-06-17 07:07:24 +00001266
1267backup.lo: $(TOP)\src\backup.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001268 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\backup.c
shanehb2f20bf2011-06-17 07:07:24 +00001269
1270bitvec.lo: $(TOP)\src\bitvec.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001271 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\bitvec.c
shanehb2f20bf2011-06-17 07:07:24 +00001272
1273btmutex.lo: $(TOP)\src\btmutex.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001274 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\btmutex.c
shanehb2f20bf2011-06-17 07:07:24 +00001275
1276btree.lo: $(TOP)\src\btree.c $(HDR) $(TOP)\src\pager.h
mistachkin44723ce2015-03-21 02:22:37 +00001277 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\btree.c
shanehb2f20bf2011-06-17 07:07:24 +00001278
1279build.lo: $(TOP)\src\build.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001280 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\build.c
shanehb2f20bf2011-06-17 07:07:24 +00001281
1282callback.lo: $(TOP)\src\callback.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001283 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\callback.c
shanehb2f20bf2011-06-17 07:07:24 +00001284
1285complete.lo: $(TOP)\src\complete.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001286 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\complete.c
shanehb2f20bf2011-06-17 07:07:24 +00001287
1288ctime.lo: $(TOP)\src\ctime.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001289 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\ctime.c
shanehb2f20bf2011-06-17 07:07:24 +00001290
1291date.lo: $(TOP)\src\date.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001292 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\date.c
shanehb2f20bf2011-06-17 07:07:24 +00001293
1294delete.lo: $(TOP)\src\delete.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001295 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\delete.c
shanehb2f20bf2011-06-17 07:07:24 +00001296
1297expr.lo: $(TOP)\src\expr.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001298 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\expr.c
shanehb2f20bf2011-06-17 07:07:24 +00001299
1300fault.lo: $(TOP)\src\fault.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001301 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\fault.c
shanehb2f20bf2011-06-17 07:07:24 +00001302
1303fkey.lo: $(TOP)\src\fkey.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001304 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\fkey.c
shanehb2f20bf2011-06-17 07:07:24 +00001305
1306func.lo: $(TOP)\src\func.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001307 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\func.c
shanehb2f20bf2011-06-17 07:07:24 +00001308
1309global.lo: $(TOP)\src\global.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001310 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\global.c
shanehb2f20bf2011-06-17 07:07:24 +00001311
1312hash.lo: $(TOP)\src\hash.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001313 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\hash.c
shanehb2f20bf2011-06-17 07:07:24 +00001314
1315insert.lo: $(TOP)\src\insert.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001316 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\insert.c
shanehb2f20bf2011-06-17 07:07:24 +00001317
1318journal.lo: $(TOP)\src\journal.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001319 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\journal.c
shanehb2f20bf2011-06-17 07:07:24 +00001320
1321legacy.lo: $(TOP)\src\legacy.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001322 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\legacy.c
shanehb2f20bf2011-06-17 07:07:24 +00001323
1324loadext.lo: $(TOP)\src\loadext.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001325 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\loadext.c
shanehb2f20bf2011-06-17 07:07:24 +00001326
1327main.lo: $(TOP)\src\main.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001328 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\main.c
shanehb2f20bf2011-06-17 07:07:24 +00001329
1330malloc.lo: $(TOP)\src\malloc.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001331 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\malloc.c
shanehb2f20bf2011-06-17 07:07:24 +00001332
1333mem0.lo: $(TOP)\src\mem0.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001334 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem0.c
shanehb2f20bf2011-06-17 07:07:24 +00001335
1336mem1.lo: $(TOP)\src\mem1.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001337 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem1.c
shanehb2f20bf2011-06-17 07:07:24 +00001338
1339mem2.lo: $(TOP)\src\mem2.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001340 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem2.c
shanehb2f20bf2011-06-17 07:07:24 +00001341
1342mem3.lo: $(TOP)\src\mem3.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001343 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem3.c
shanehb2f20bf2011-06-17 07:07:24 +00001344
1345mem5.lo: $(TOP)\src\mem5.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001346 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem5.c
shanehb2f20bf2011-06-17 07:07:24 +00001347
1348memjournal.lo: $(TOP)\src\memjournal.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001349 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\memjournal.c
shanehb2f20bf2011-06-17 07:07:24 +00001350
1351mutex.lo: $(TOP)\src\mutex.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001352 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex.c
shanehb2f20bf2011-06-17 07:07:24 +00001353
1354mutex_noop.lo: $(TOP)\src\mutex_noop.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001355 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex_noop.c
shanehb2f20bf2011-06-17 07:07:24 +00001356
shanehb2f20bf2011-06-17 07:07:24 +00001357mutex_unix.lo: $(TOP)\src\mutex_unix.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001358 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex_unix.c
shanehb2f20bf2011-06-17 07:07:24 +00001359
1360mutex_w32.lo: $(TOP)\src\mutex_w32.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001361 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex_w32.c
shanehb2f20bf2011-06-17 07:07:24 +00001362
1363notify.lo: $(TOP)\src\notify.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001364 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\notify.c
shanehb2f20bf2011-06-17 07:07:24 +00001365
1366pager.lo: $(TOP)\src\pager.c $(HDR) $(TOP)\src\pager.h
mistachkin44723ce2015-03-21 02:22:37 +00001367 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pager.c
shanehb2f20bf2011-06-17 07:07:24 +00001368
1369pcache.lo: $(TOP)\src\pcache.c $(HDR) $(TOP)\src\pcache.h
mistachkin44723ce2015-03-21 02:22:37 +00001370 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pcache.c
shanehb2f20bf2011-06-17 07:07:24 +00001371
1372pcache1.lo: $(TOP)\src\pcache1.c $(HDR) $(TOP)\src\pcache.h
mistachkin44723ce2015-03-21 02:22:37 +00001373 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pcache1.c
shanehb2f20bf2011-06-17 07:07:24 +00001374
1375os.lo: $(TOP)\src\os.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001376 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\os.c
shanehb2f20bf2011-06-17 07:07:24 +00001377
1378os_unix.lo: $(TOP)\src\os_unix.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001379 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\os_unix.c
shanehb2f20bf2011-06-17 07:07:24 +00001380
1381os_win.lo: $(TOP)\src\os_win.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001382 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\os_win.c
shanehb2f20bf2011-06-17 07:07:24 +00001383
shanehb2f20bf2011-06-17 07:07:24 +00001384pragma.lo: $(TOP)\src\pragma.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001385 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pragma.c
shanehb2f20bf2011-06-17 07:07:24 +00001386
1387prepare.lo: $(TOP)\src\prepare.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001388 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\prepare.c
shanehb2f20bf2011-06-17 07:07:24 +00001389
1390printf.lo: $(TOP)\src\printf.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001391 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\printf.c
shanehb2f20bf2011-06-17 07:07:24 +00001392
1393random.lo: $(TOP)\src\random.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001394 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\random.c
shanehb2f20bf2011-06-17 07:07:24 +00001395
1396resolve.lo: $(TOP)\src\resolve.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001397 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\resolve.c
shanehb2f20bf2011-06-17 07:07:24 +00001398
1399rowset.lo: $(TOP)\src\rowset.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001400 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\rowset.c
shanehb2f20bf2011-06-17 07:07:24 +00001401
1402select.lo: $(TOP)\src\select.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001403 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\select.c
shanehb2f20bf2011-06-17 07:07:24 +00001404
1405status.lo: $(TOP)\src\status.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001406 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\status.c
shanehb2f20bf2011-06-17 07:07:24 +00001407
1408table.lo: $(TOP)\src\table.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001409 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\table.c
shanehb2f20bf2011-06-17 07:07:24 +00001410
drhf51446a2012-07-21 19:40:42 +00001411threads.lo: $(TOP)\src\threads.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001412 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\threads.c
drhf51446a2012-07-21 19:40:42 +00001413
shanehb2f20bf2011-06-17 07:07:24 +00001414tokenize.lo: $(TOP)\src\tokenize.c keywordhash.h $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001415 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\tokenize.c
shanehb2f20bf2011-06-17 07:07:24 +00001416
1417trigger.lo: $(TOP)\src\trigger.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001418 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\trigger.c
shanehb2f20bf2011-06-17 07:07:24 +00001419
1420update.lo: $(TOP)\src\update.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001421 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\update.c
shanehb2f20bf2011-06-17 07:07:24 +00001422
1423utf.lo: $(TOP)\src\utf.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001424 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\utf.c
shanehb2f20bf2011-06-17 07:07:24 +00001425
1426util.lo: $(TOP)\src\util.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001427 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\util.c
shanehb2f20bf2011-06-17 07:07:24 +00001428
1429vacuum.lo: $(TOP)\src\vacuum.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001430 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vacuum.c
shanehb2f20bf2011-06-17 07:07:24 +00001431
1432vdbe.lo: $(TOP)\src\vdbe.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001433 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbe.c
shanehb2f20bf2011-06-17 07:07:24 +00001434
1435vdbeapi.lo: $(TOP)\src\vdbeapi.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001436 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbeapi.c
shanehb2f20bf2011-06-17 07:07:24 +00001437
1438vdbeaux.lo: $(TOP)\src\vdbeaux.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001439 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbeaux.c
shanehb2f20bf2011-06-17 07:07:24 +00001440
1441vdbeblob.lo: $(TOP)\src\vdbeblob.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001442 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbeblob.c
shanehb2f20bf2011-06-17 07:07:24 +00001443
1444vdbemem.lo: $(TOP)\src\vdbemem.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001445 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbemem.c
shanehb2f20bf2011-06-17 07:07:24 +00001446
mistachkin81c428a2011-08-17 02:19:54 +00001447vdbesort.lo: $(TOP)\src\vdbesort.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001448 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbesort.c
mistachkin81c428a2011-08-17 02:19:54 +00001449
shanehb2f20bf2011-06-17 07:07:24 +00001450vdbetrace.lo: $(TOP)\src\vdbetrace.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001451 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbetrace.c
shanehb2f20bf2011-06-17 07:07:24 +00001452
1453vtab.lo: $(TOP)\src\vtab.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001454 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vtab.c
shanehb2f20bf2011-06-17 07:07:24 +00001455
1456wal.lo: $(TOP)\src\wal.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001457 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\wal.c
shanehb2f20bf2011-06-17 07:07:24 +00001458
1459walker.lo: $(TOP)\src\walker.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001460 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\walker.c
shanehb2f20bf2011-06-17 07:07:24 +00001461
1462where.lo: $(TOP)\src\where.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001463 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\where.c
shanehb2f20bf2011-06-17 07:07:24 +00001464
1465tclsqlite.lo: $(TOP)\src\tclsqlite.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001466 $(LTCOMPILE) $(NO_WARN) -DUSE_TCL_STUBS=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c
shanehb2f20bf2011-06-17 07:07:24 +00001467
1468tclsqlite-shell.lo: $(TOP)\src\tclsqlite.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001469 $(LTCOMPILE) $(NO_WARN) -DTCLSH=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c
shanehb2f20bf2011-06-17 07:07:24 +00001470
mistachkin44723ce2015-03-21 02:22:37 +00001471tclsqlite3.exe: tclsqlite-shell.lo $(SQLITE3C) $(LIBRESOBJS)
1472 $(LTLINK) $(SQLITE3C) /link $(LTLINKOPTS) $(LTLIBPATHS) /OUT:$@ tclsqlite-shell.lo $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001473
1474# Rules to build opcodes.c and opcodes.h
1475#
1476opcodes.c: opcodes.h $(TOP)\mkopcodec.awk
drh307ff302011-08-30 01:29:04 +00001477 $(NAWK) -f $(TOP)\mkopcodec.awk opcodes.h > opcodes.c
shanehb2f20bf2011-06-17 07:07:24 +00001478
1479opcodes.h: parse.h $(TOP)\src\vdbe.c $(TOP)\mkopcodeh.awk
mistachkin5b0b6fd2011-06-25 01:14:36 +00001480 type parse.h $(TOP)\src\vdbe.c | $(NAWK) -f $(TOP)\mkopcodeh.awk > opcodes.h
shanehb2f20bf2011-06-17 07:07:24 +00001481
1482# Rules to build parse.c and parse.h - the outputs of lemon.
1483#
1484parse.h: parse.c
1485
1486parse.c: $(TOP)\src\parse.y lemon.exe $(TOP)\addopcodes.awk
mistachkin44723ce2015-03-21 02:22:37 +00001487 del /Q parse.y parse.h parse.h.temp 2>NUL
shanehb2f20bf2011-06-17 07:07:24 +00001488 copy $(TOP)\src\parse.y .
mistachkin4712c212014-05-09 20:51:17 +00001489 .\lemon.exe $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(OPTS) parse.y
shanehb2f20bf2011-06-17 07:07:24 +00001490 move parse.h parse.h.temp
mistachkin5b0b6fd2011-06-25 01:14:36 +00001491 $(NAWK) -f $(TOP)\addopcodes.awk parse.h.temp > parse.h
shanehb2f20bf2011-06-17 07:07:24 +00001492
1493sqlite3.h: $(TOP)\src\sqlite.h.in $(TOP)\manifest.uuid $(TOP)\VERSION
mistachkin3f40d402014-02-13 21:57:48 +00001494 $(TCLSH_CMD) $(TOP)\tool\mksqlite3h.tcl $(TOP:\=/) > sqlite3.h
shanehb2f20bf2011-06-17 07:07:24 +00001495
1496mkkeywordhash.exe: $(TOP)\tool\mkkeywordhash.c
mistachkin2318d332015-01-12 18:02:52 +00001497 $(BCC) $(NO_WARN) -Fe$@ $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(OPTS) \
1498 $(TOP)\tool\mkkeywordhash.c /link $(NLTLINKOPTS) $(NLTLIBPATHS)
shanehb2f20bf2011-06-17 07:07:24 +00001499
1500keywordhash.h: $(TOP)\tool\mkkeywordhash.c mkkeywordhash.exe
mistachkin5b0b6fd2011-06-25 01:14:36 +00001501 .\mkkeywordhash.exe > keywordhash.h
shanehb2f20bf2011-06-17 07:07:24 +00001502
1503
1504
1505# Rules to build the extension objects.
1506#
1507icu.lo: $(TOP)\ext\icu\icu.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001508 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\icu\icu.c
shanehb2f20bf2011-06-17 07:07:24 +00001509
1510fts2.lo: $(TOP)\ext\fts2\fts2.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001511 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2.c
shanehb2f20bf2011-06-17 07:07:24 +00001512
1513fts2_hash.lo: $(TOP)\ext\fts2\fts2_hash.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001514 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_hash.c
shanehb2f20bf2011-06-17 07:07:24 +00001515
1516fts2_icu.lo: $(TOP)\ext\fts2\fts2_icu.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001517 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_icu.c
shanehb2f20bf2011-06-17 07:07:24 +00001518
1519fts2_porter.lo: $(TOP)\ext\fts2\fts2_porter.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001520 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_porter.c
shanehb2f20bf2011-06-17 07:07:24 +00001521
1522fts2_tokenizer.lo: $(TOP)\ext\fts2\fts2_tokenizer.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001523 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_tokenizer.c
shanehb2f20bf2011-06-17 07:07:24 +00001524
1525fts2_tokenizer1.lo: $(TOP)\ext\fts2\fts2_tokenizer1.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001526 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_tokenizer1.c
shanehb2f20bf2011-06-17 07:07:24 +00001527
1528fts3.lo: $(TOP)\ext\fts3\fts3.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001529 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3.c
shanehb2f20bf2011-06-17 07:07:24 +00001530
1531fts3_aux.lo: $(TOP)\ext\fts3\fts3_aux.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001532 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_aux.c
shanehb2f20bf2011-06-17 07:07:24 +00001533
1534fts3_expr.lo: $(TOP)\ext\fts3\fts3_expr.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001535 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_expr.c
shanehb2f20bf2011-06-17 07:07:24 +00001536
1537fts3_hash.lo: $(TOP)\ext\fts3\fts3_hash.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001538 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_hash.c
shanehb2f20bf2011-06-17 07:07:24 +00001539
1540fts3_icu.lo: $(TOP)\ext\fts3\fts3_icu.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001541 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_icu.c
shanehb2f20bf2011-06-17 07:07:24 +00001542
1543fts3_snippet.lo: $(TOP)\ext\fts3\fts3_snippet.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001544 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_snippet.c
shanehb2f20bf2011-06-17 07:07:24 +00001545
1546fts3_porter.lo: $(TOP)\ext\fts3\fts3_porter.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001547 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_porter.c
shanehb2f20bf2011-06-17 07:07:24 +00001548
1549fts3_tokenizer.lo: $(TOP)\ext\fts3\fts3_tokenizer.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001550 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenizer.c
shanehb2f20bf2011-06-17 07:07:24 +00001551
1552fts3_tokenizer1.lo: $(TOP)\ext\fts3\fts3_tokenizer1.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001553 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenizer1.c
shanehb2f20bf2011-06-17 07:07:24 +00001554
drh4d648c72013-04-22 17:07:56 +00001555fts3_tokenize_vtab.lo: $(TOP)\ext\fts3\fts3_tokenize_vtab.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001556 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenize_vtab.c
drh4d648c72013-04-22 17:07:56 +00001557
drh391d4ba2012-05-28 20:22:16 +00001558fts3_unicode.lo: $(TOP)\ext\fts3\fts3_unicode.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001559 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_unicode.c
drh391d4ba2012-05-28 20:22:16 +00001560
1561fts3_unicode2.lo: $(TOP)\ext\fts3\fts3_unicode2.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001562 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_unicode2.c
drh391d4ba2012-05-28 20:22:16 +00001563
shanehb2f20bf2011-06-17 07:07:24 +00001564fts3_write.lo: $(TOP)\ext\fts3\fts3_write.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001565 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_write.c
shanehb2f20bf2011-06-17 07:07:24 +00001566
1567rtree.lo: $(TOP)\ext\rtree\rtree.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001568 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\rtree\rtree.c
shanehb2f20bf2011-06-17 07:07:24 +00001569
1570
1571# Rules to build the 'testfixture' application.
1572#
1573# If using the amalgamation, use sqlite3.c directly to build the test
1574# fixture. Otherwise link against libsqlite3.lib. (This distinction is
1575# necessary because the test fixture requires non-API symbols which are
1576# hidden when the library is built via the amalgamation).
1577#
1578TESTFIXTURE_FLAGS = -DTCLSH=1 -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
mistachkin27b2f052015-01-12 19:49:46 +00001579TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_SERVER=1 -DSQLITE_PRIVATE=""
1580TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_CORE $(NO_WARN)
shanehb2f20bf2011-06-17 07:07:24 +00001581
mistachkin44723ce2015-03-21 02:22:37 +00001582TESTFIXTURE_SRC0 = $(TESTEXT) $(TESTSRC2) $(SHELL_CORE_DEP)
mistachkin76510912013-10-11 23:01:18 +00001583TESTFIXTURE_SRC1 = $(TESTEXT) $(SQLITE3C)
shanehb2f20bf2011-06-17 07:07:24 +00001584!IF $(USE_AMALGAMATION)==0
1585TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC0)
1586!ELSE
1587TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC1)
1588!ENDIF
1589
mistachkin08c1c312012-10-06 03:48:25 +00001590testfixture.exe: $(TESTFIXTURE_SRC) $(LIBRESOBJS) $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001591 $(LTLINK) -DSQLITE_NO_SYNC=1 $(TESTFIXTURE_FLAGS) \
shanehb2f20bf2011-06-17 07:07:24 +00001592 -DBUILD_sqlite -I$(TCLINCDIR) \
shaneh2a0b9ef2011-06-20 20:52:32 +00001593 $(TESTFIXTURE_SRC) \
mistachkin08c1c312012-10-06 03:48:25 +00001594 /link $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001595
mistachkin1925a2e2014-02-24 21:20:25 +00001596extensiontest: testfixture.exe testloadext.dll
1597 .\testfixture.exe $(TOP)\test\loadext.test
shanehb2f20bf2011-06-17 07:07:24 +00001598
1599fulltest: testfixture.exe sqlite3.exe
1600 .\testfixture.exe $(TOP)\test\all.test
1601
1602soaktest: testfixture.exe sqlite3.exe
1603 .\testfixture.exe $(TOP)\test\all.test -soak=1
1604
mistachkinc60941f2012-09-13 01:51:02 +00001605fulltestonly: testfixture.exe sqlite3.exe
1606 .\testfixture.exe $(TOP)\test\full.test
1607
mistachkin036acf32013-07-20 00:34:31 +00001608queryplantest: testfixture.exe sqlite3.exe
1609 .\testfixture.exe $(TOP)\test\permutations.test queryplanner
1610
shanehb2f20bf2011-06-17 07:07:24 +00001611test: testfixture.exe sqlite3.exe
1612 .\testfixture.exe $(TOP)\test\veryquick.test
1613
mistachkin76510912013-10-11 23:01:18 +00001614sqlite3_analyzer.c: $(SQLITE3C) $(TOP)\src\test_stat.c $(TOP)\src\tclsqlite.c $(TOP)\tool\spaceanal.tcl
1615 copy $(SQLITE3C) + $(TOP)\src\test_stat.c + $(TOP)\src\tclsqlite.c $@
mistachkin9a55e312011-09-22 00:06:44 +00001616 echo static const char *tclsh_main_loop(void){ >> $@
1617 echo static const char *zMainloop = >> $@
1618 $(NAWK) -f $(TOP)\tool\tostr.awk $(TOP)\tool\spaceanal.tcl >> $@
1619 echo ; return zMainloop; } >> $@
shanehb2f20bf2011-06-17 07:07:24 +00001620
mistachkin08c1c312012-10-06 03:48:25 +00001621sqlite3_analyzer.exe: sqlite3_analyzer.c $(LIBRESOBJS)
mistachkin44723ce2015-03-21 02:22:37 +00001622 $(LTLINK) $(NO_WARN) -DBUILD_sqlite -DTCLSH=2 -I$(TCLINCDIR) sqlite3_analyzer.c \
mistachkin08c1c312012-10-06 03:48:25 +00001623 /link $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001624
mistachkin1925a2e2014-02-24 21:20:25 +00001625testloadext.lo: $(TOP)\src\test_loadext.c
mistachkin44723ce2015-03-21 02:22:37 +00001626 $(LTCOMPILE) $(NO_WARN) -c $(TOP)\src\test_loadext.c
mistachkin1925a2e2014-02-24 21:20:25 +00001627
1628testloadext.dll: testloadext.lo
1629 $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /OUT:$@ testloadext.lo
1630
mistachkinb0427512014-01-30 11:12:52 +00001631showdb.exe: $(TOP)\tool\showdb.c $(SQLITE3C)
mistachkin44723ce2015-03-21 02:22:37 +00001632 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
mistachkinb0427512014-01-30 11:12:52 +00001633 $(TOP)\tool\showdb.c $(SQLITE3C)
drh9ac3c1e2013-11-07 18:37:31 +00001634
drh4bb77ec2014-06-30 11:14:26 +00001635showstat4.exe: $(TOP)\tool\showstat4.c $(SQLITE3C)
mistachkin44723ce2015-03-21 02:22:37 +00001636 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
drh4bb77ec2014-06-30 11:14:26 +00001637 $(TOP)\tool\showstat4.c $(SQLITE3C)
1638
1639showjournal.exe: $(TOP)\tool\showjournal.c $(SQLITE3C)
mistachkin44723ce2015-03-21 02:22:37 +00001640 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
drh4bb77ec2014-06-30 11:14:26 +00001641 $(TOP)\tool\showjournal.c $(SQLITE3C)
1642
1643showwal.exe: $(TOP)\tool\showwal.c $(SQLITE3C)
mistachkin44723ce2015-03-21 02:22:37 +00001644 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
drh4bb77ec2014-06-30 11:14:26 +00001645 $(TOP)\tool\showwal.c $(SQLITE3C)
1646
mistachkinde545272014-07-07 17:57:50 +00001647fts3view.exe: $(TOP)\ext\fts3\tool\fts3view.c $(SQLITE3C)
mistachkin44723ce2015-03-21 02:22:37 +00001648 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
mistachkinde545272014-07-07 17:57:50 +00001649 $(TOP)\ext\fts3\tool\fts3view.c $(SQLITE3C)
1650
drh4bb77ec2014-06-30 11:14:26 +00001651rollback-test.exe: $(TOP)\tool\rollback-test.c $(SQLITE3C)
mistachkin44723ce2015-03-21 02:22:37 +00001652 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
drh4bb77ec2014-06-30 11:14:26 +00001653 $(TOP)\tool\rollback-test.c $(SQLITE3C)
1654
drh267a13f2014-06-18 18:10:12 +00001655LogEst.exe: $(TOP)\tool\logest.c sqlite3.h
mistachkin44723ce2015-03-21 02:22:37 +00001656 $(LTLINK) $(NO_WARN) -Fe$@ $(TOP)\tool\LogEst.c
drh267a13f2014-06-18 18:10:12 +00001657
mistachkinb0427512014-01-30 11:12:52 +00001658wordcount.exe: $(TOP)\test\wordcount.c $(SQLITE3C)
mistachkin44723ce2015-03-21 02:22:37 +00001659 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
mistachkinb0427512014-01-30 11:12:52 +00001660 $(TOP)\test\wordcount.c $(SQLITE3C)
drh9ac3c1e2013-11-07 18:37:31 +00001661
mistachkinb0427512014-01-30 11:12:52 +00001662speedtest1.exe: $(TOP)\test\speedtest1.c $(SQLITE3C)
mistachkin44723ce2015-03-21 02:22:37 +00001663 $(LTLINK) $(NO_WARN) -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
mistachkinb0427512014-01-30 11:12:52 +00001664 $(TOP)\test\speedtest1.c $(SQLITE3C)
shanehb2f20bf2011-06-17 07:07:24 +00001665
shaneh6e7850c2011-06-17 15:57:07 +00001666clean:
mistachkin44723ce2015-03-21 02:22:37 +00001667 del /Q *.exp *.lo *.ilk *.lib *.obj *.pdb 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00001668 del /Q *.cod *.da *.bb *.bbg gmon.out 2>NUL
1669 del /Q sqlite3.h opcodes.c opcodes.h 2>NUL
1670 del /Q lemon.* lempar.c parse.* 2>NUL
1671 del /Q mkkeywordhash.* keywordhash.h 2>NUL
1672 del /Q notasharedlib.* 2>NUL
1673 -rmdir /Q/S .deps 2>NUL
1674 -rmdir /Q/S .libs 2>NUL
1675 -rmdir /Q/S quota2a 2>NUL
1676 -rmdir /Q/S quota2b 2>NUL
1677 -rmdir /Q/S quota2c 2>NUL
1678 -rmdir /Q/S tsrc 2>NUL
1679 del /Q .target_source 2>NUL
mistachkin44723ce2015-03-21 02:22:37 +00001680 del /Q tclsqlite3.exe 2>NUL
1681 del /Q testloadext.dll 2>NUL
1682 del /Q testfixture.exe test.db 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00001683 del /Q LogEst.exe fts3view.exe rollback-test.exe showdb.exe 2>NUL
1684 del /Q showjournal.exe showstat4.exe showwal.exe speedtest1.exe 2>NUL
mistachkin44723ce2015-03-21 02:22:37 +00001685 del /Q mptester.exe wordcount.exe 2>NUL
1686 del /Q sqlite3.exe sqlite3.dll sqlite3.def 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00001687 del /Q sqlite3.c sqlite3-*.c 2>NUL
1688 del /Q sqlite3rc.h 2>NUL
1689 del /Q shell.c sqlite3ext.h 2>NUL
mistachkin44723ce2015-03-21 02:22:37 +00001690 del /Q sqlite3_analyzer.exe sqlite3_analyzer.c 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00001691 del /Q sqlite-*-output.vsix 2>NUL
shanehb2f20bf2011-06-17 07:07:24 +00001692
mistachkin4d9d1f42012-09-03 10:32:32 +00001693# Dynamic link library section.
shanehb2f20bf2011-06-17 07:07:24 +00001694#
1695dll: sqlite3.dll
1696
shaneh6e7850c2011-06-17 15:57:07 +00001697sqlite3.def: libsqlite3.lib
mistachkin5b0b6fd2011-06-25 01:14:36 +00001698 echo EXPORTS > sqlite3.def
shaneh6e7850c2011-06-17 15:57:07 +00001699 dumpbin /all libsqlite3.lib \
mistachkin6a3eb4a2011-08-17 07:46:48 +00001700 | $(NAWK) "/ 1 _?sqlite3_/ { sub(/^.* _?/,\"\");print }" \
mistachkin5b0b6fd2011-06-25 01:14:36 +00001701 | sort >> sqlite3.def
shanehb2f20bf2011-06-17 07:07:24 +00001702
mistachkin44723ce2015-03-21 02:22:37 +00001703sqlite3.dll: $(LIBOBJ) $(LIBRESOBJS) $(CORE_LINK_DEP)
1704 $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL $(CORE_LINK_OPTS) /OUT:$@ $(LIBOBJ) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)