blob: f8746eebfe0c5afd4fc56ee18525b00c90cf46d1 [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
63
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
mistachkin52fd8e12012-08-28 01:44:13 +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
mistachkin08c1c312012-10-06 03:48:25 +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
mistachkin2f7d5d82012-08-22 00:39:34 +0000142
mistachkinf2d25f22011-08-25 04:09:12 +0000143# 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
166
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
404
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
drh498dcae2013-03-13 11:42:00 +0000449TCC = $(TCC) -I$(TOP)\ext\session
mistachkin38b4daa2013-03-13 19:02:39 +0000450RCC = $(RCC) -I$(TOP)\ext\session
shaneh6e7850c2011-06-17 15:57:07 +0000451!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000452
mistachkinb0427512014-01-30 11:12:52 +0000453# The mksqlite3c.tcl script accepts some options on the command
454# line. When compiling with debugging enabled, some of these
455# options are necessary in order to allow debugging symbols to
456# work correctly with Visual Studio when using the amalgamation.
457#
mistachkincd54bab2014-12-20 21:14:14 +0000458!IF $(DEBUG)>1
mistachkinb0427512014-01-30 11:12:52 +0000459MKSQLITE3C_ARGS = --linemacros
460!ELSE
461MKSQLITE3C_ARGS =
462!ENDIF
463
shanehb2f20bf2011-06-17 07:07:24 +0000464# Define -DNDEBUG to compile without debugging (i.e., for production usage)
465# Omitting the define will cause extra debugging code to be inserted and
466# includes extra comments when "EXPLAIN stmt" is used.
467#
mistachkin753c5442011-08-25 02:02:25 +0000468!IF $(DEBUG)==0
shanehb2f20bf2011-06-17 07:07:24 +0000469TCC = $(TCC) -DNDEBUG
mistachkinfec360a2012-04-18 10:29:21 +0000470BCC = $(BCC) -DNDEBUG
mistachkin4d9d1f42012-09-03 10:32:32 +0000471RCC = $(RCC) -DNDEBUG
mistachkin753c5442011-08-25 02:02:25 +0000472!ENDIF
473
mistachkincd54bab2014-12-20 21:14:14 +0000474!IF $(DEBUG)>0
475TCC = $(TCC) -DSQLITE_ENABLE_API_ARMOR
476RCC = $(RCC) -DSQLITE_ENABLE_API_ARMOR
477!ENDIF
478
479!IF $(DEBUG)>2
mistachkin753c5442011-08-25 02:02:25 +0000480TCC = $(TCC) -DSQLITE_DEBUG
mistachkin4d9d1f42012-09-03 10:32:32 +0000481RCC = $(RCC) -DSQLITE_DEBUG
mistachkin753c5442011-08-25 02:02:25 +0000482!ENDIF
483
mistachkincd54bab2014-12-20 21:14:14 +0000484!IF $(DEBUG)>4
mistachkin753c5442011-08-25 02:02:25 +0000485TCC = $(TCC) -DSQLITE_DEBUG_OS_TRACE=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000486RCC = $(RCC) -DSQLITE_DEBUG_OS_TRACE=1
mistachkin753c5442011-08-25 02:02:25 +0000487!ENDIF
488
mistachkincd54bab2014-12-20 21:14:14 +0000489!IF $(DEBUG)>5
mistachkin753c5442011-08-25 02:02:25 +0000490TCC = $(TCC) -DSQLITE_ENABLE_IOTRACE
mistachkin4d9d1f42012-09-03 10:32:32 +0000491RCC = $(RCC) -DSQLITE_ENABLE_IOTRACE
mistachkin753c5442011-08-25 02:02:25 +0000492!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000493
mistachkinbd58d5f2012-06-30 22:22:34 +0000494# Prevent warnings about "insecure" MSVC runtime library functions
495# being used.
mistachkin176f1b42011-08-02 23:34:00 +0000496#
497TCC = $(TCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
mistachkinfec360a2012-04-18 10:29:21 +0000498BCC = $(BCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
mistachkin4d9d1f42012-09-03 10:32:32 +0000499RCC = $(RCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
mistachkin176f1b42011-08-02 23:34:00 +0000500
mistachkinbd58d5f2012-06-30 22:22:34 +0000501# Prevent warnings about "deprecated" POSIX functions being used.
502#
503TCC = $(TCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
504BCC = $(BCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
mistachkin4d9d1f42012-09-03 10:32:32 +0000505RCC = $(RCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
mistachkinbd58d5f2012-06-30 22:22:34 +0000506
mistachkin2f7d5d82012-08-22 00:39:34 +0000507# Use the SQLite debugging heap subsystem?
mistachkin1b186a92011-08-24 16:13:57 +0000508#
mistachkin2f7d5d82012-08-22 00:39:34 +0000509!IF $(MEMDEBUG)!=0
510TCC = $(TCC) -DSQLITE_MEMDEBUG=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000511RCC = $(RCC) -DSQLITE_MEMDEBUG=1
mistachkin2f7d5d82012-08-22 00:39:34 +0000512
mistachkin2f7d5d82012-08-22 00:39:34 +0000513# Use native Win32 heap subsystem instead of malloc/free?
514#
515!ELSEIF $(WIN32HEAP)!=0
516TCC = $(TCC) -DSQLITE_WIN32_MALLOC=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000517RCC = $(RCC) -DSQLITE_WIN32_MALLOC=1
mistachkin753c5442011-08-25 02:02:25 +0000518
mistachkin753c5442011-08-25 02:02:25 +0000519# Validate the heap on every call into the native Win32 heap subsystem?
520#
mistachkincd54bab2014-12-20 21:14:14 +0000521!IF $(DEBUG)>3
mistachkin753c5442011-08-25 02:02:25 +0000522TCC = $(TCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000523RCC = $(RCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1
mistachkin753c5442011-08-25 02:02:25 +0000524!ENDIF
mistachkin2f7d5d82012-08-22 00:39:34 +0000525!ENDIF
mistachkin1b186a92011-08-24 16:13:57 +0000526
mistachkin5b0b6fd2011-06-25 01:14:36 +0000527# The locations of the Tcl header and library files. Also, the library that
528# non-stubs enabled programs using Tcl must link against. These variables
529# (TCLINCDIR, TCLLIBDIR, and LIBTCL) may be overridden via the environment
530# prior to running nmake in order to match the actual installed location and
531# version on this machine.
shanehb2f20bf2011-06-17 07:07:24 +0000532#
mistachkine37f99c2012-06-30 16:22:05 +0000533!IFNDEF TCLINCDIR
shanehb2f20bf2011-06-17 07:07:24 +0000534TCLINCDIR = c:\tcl\include
mistachkine37f99c2012-06-30 16:22:05 +0000535!ENDIF
mistachkin5b0b6fd2011-06-25 01:14:36 +0000536
mistachkine37f99c2012-06-30 16:22:05 +0000537!IFNDEF TCLLIBDIR
shanehb2f20bf2011-06-17 07:07:24 +0000538TCLLIBDIR = c:\tcl\lib
mistachkine37f99c2012-06-30 16:22:05 +0000539!ENDIF
mistachkin5b0b6fd2011-06-25 01:14:36 +0000540
mistachkine37f99c2012-06-30 16:22:05 +0000541!IFNDEF LIBTCL
mistachkin5b0b6fd2011-06-25 01:14:36 +0000542LIBTCL = tcl85.lib
mistachkine37f99c2012-06-30 16:22:05 +0000543!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000544
mistachkinc756ded2011-10-02 05:23:16 +0000545# The locations of the ICU header and library files. These variables
546# (ICUINCDIR, ICULIBDIR, and LIBICU) may be overridden via the environment
547# prior to running nmake in order to match the actual installed location on
548# this machine.
549#
mistachkine37f99c2012-06-30 16:22:05 +0000550!IFNDEF ICUINCDIR
mistachkinc756ded2011-10-02 05:23:16 +0000551ICUINCDIR = c:\icu\include
mistachkine37f99c2012-06-30 16:22:05 +0000552!ENDIF
mistachkinc756ded2011-10-02 05:23:16 +0000553
mistachkine37f99c2012-06-30 16:22:05 +0000554!IFNDEF ICULIBDIR
mistachkinc756ded2011-10-02 05:23:16 +0000555ICULIBDIR = c:\icu\lib
mistachkine37f99c2012-06-30 16:22:05 +0000556!ENDIF
mistachkinc756ded2011-10-02 05:23:16 +0000557
mistachkine37f99c2012-06-30 16:22:05 +0000558!IFNDEF LIBICU
mistachkinc756ded2011-10-02 05:23:16 +0000559LIBICU = icuuc.lib icuin.lib
mistachkine37f99c2012-06-30 16:22:05 +0000560!ENDIF
mistachkinc756ded2011-10-02 05:23:16 +0000561
shanehb2f20bf2011-06-17 07:07:24 +0000562# This is the command to use for tclsh - normally just "tclsh", but we may
mistachkin5b0b6fd2011-06-25 01:14:36 +0000563# know the specific version we want to use. This variable (TCLSH_CMD) may be
564# overridden via the environment prior to running nmake in order to select a
565# specific Tcl shell to use.
shanehb2f20bf2011-06-17 07:07:24 +0000566#
mistachkine37f99c2012-06-30 16:22:05 +0000567!IFNDEF TCLSH_CMD
shanehb2f20bf2011-06-17 07:07:24 +0000568TCLSH_CMD = tclsh85
mistachkine37f99c2012-06-30 16:22:05 +0000569!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000570
571# Compiler options needed for programs that use the readline() library.
572#
mistachkin8bcd3fa2013-08-29 01:03:38 +0000573!IFNDEF READLINE_FLAGS
shaneh6e7850c2011-06-17 15:57:07 +0000574READLINE_FLAGS = -DHAVE_READLINE=0
mistachkin8bcd3fa2013-08-29 01:03:38 +0000575!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000576
577# The library that programs using readline() must link against.
578#
mistachkin8bcd3fa2013-08-29 01:03:38 +0000579!IFNDEF LIBREADLINE
shaneh6e7850c2011-06-17 15:57:07 +0000580LIBREADLINE =
mistachkin8bcd3fa2013-08-29 01:03:38 +0000581!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000582
583# Should the database engine be compiled threadsafe
584#
585TCC = $(TCC) -DSQLITE_THREADSAFE=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000586RCC = $(RCC) -DSQLITE_THREADSAFE=1
shanehb2f20bf2011-06-17 07:07:24 +0000587
588# Do threads override each others locks by default (1), or do we test (-1)
589#
590TCC = $(TCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1
mistachkin4d9d1f42012-09-03 10:32:32 +0000591RCC = $(RCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1
shanehb2f20bf2011-06-17 07:07:24 +0000592
593# Any target libraries which libsqlite must be linked against
shaneh6e7850c2011-06-17 15:57:07 +0000594#
mistachkine37f99c2012-06-30 16:22:05 +0000595!IFNDEF TLIBS
shaneh6e7850c2011-06-17 15:57:07 +0000596TLIBS =
mistachkine37f99c2012-06-30 16:22:05 +0000597!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000598
599# Flags controlling use of the in memory btree implementation
600#
601# SQLITE_TEMP_STORE is 0 to force temporary tables to be in a file, 1 to
602# default to file, 2 to default to memory, and 3 to force temporary
603# tables to always be in memory.
604#
shaneh6e7850c2011-06-17 15:57:07 +0000605TCC = $(TCC) -DSQLITE_TEMP_STORE=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000606RCC = $(RCC) -DSQLITE_TEMP_STORE=1
shanehb2f20bf2011-06-17 07:07:24 +0000607
608# Enable/disable loadable extensions, and other optional features
shaneh6e7850c2011-06-17 15:57:07 +0000609# based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*).
610# The same set of OMIT and ENABLE flags should be passed to the
shanehb2f20bf2011-06-17 07:07:24 +0000611# LEMON parser generator and the mkkeywordhash tool as well.
612
613# BEGIN standard options
614OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS3=1
615OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RTREE=1
616OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_COLUMN_METADATA=1
mistachkinadb96a62012-01-16 12:33:36 +0000617OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_SESSION=1
618OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_PREUPDATE_HOOK=1
shanehb2f20bf2011-06-17 07:07:24 +0000619# END standard options
620
mistachkin4712c212014-05-09 20:51:17 +0000621# These are the required SQLite compilation options used when compiling for
622# the Windows platform.
623#
624REQ_FEATURE_FLAGS = $(REQ_FEATURE_FLAGS) -DSQLITE_MAX_TRIGGER_DEPTH=100
shanehb2f20bf2011-06-17 07:07:24 +0000625
mistachkine45e0fb2015-01-21 00:48:46 +0000626# If we are linking to the RPCRT4 library, enable features that need it.
627#
628!IF $(USE_RPCRT4_LIB)!=0
629REQ_FEATURE_FLAGS = $(REQ_FEATURE_FLAGS) -DSQLITE_WIN32_USE_UUID=1
630!ENDIF
631
mistachkin4712c212014-05-09 20:51:17 +0000632# Add the required and optional SQLite compilation options into the command
633# lines used to invoke the MSVC code and resource compilers.
634#
635TCC = $(TCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS)
636RCC = $(RCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS)
shanehb2f20bf2011-06-17 07:07:24 +0000637
mistachkin4712c212014-05-09 20:51:17 +0000638# Add in any optional parameters specified on the commane line, e.g.
639# nmake /f Makefile.msc all "OPTS=-DSQLITE_ENABLE_FOO=1 -DSQLITE_OMIT_FOO=1"
640#
shanehb2f20bf2011-06-17 07:07:24 +0000641TCC = $(TCC) $(OPTS)
mistachkin4d9d1f42012-09-03 10:32:32 +0000642RCC = $(RCC) $(OPTS)
shanehb2f20bf2011-06-17 07:07:24 +0000643
mistachkin8bcd3fa2013-08-29 01:03:38 +0000644# If compiling for debugging, add some defines.
mistachkin4712c212014-05-09 20:51:17 +0000645#
mistachkincd54bab2014-12-20 21:14:14 +0000646!IF $(DEBUG)>1
mistachkin8bcd3fa2013-08-29 01:03:38 +0000647TCC = $(TCC) -D_DEBUG
648BCC = $(BCC) -D_DEBUG
mistachkin4d9d1f42012-09-03 10:32:32 +0000649RCC = $(RCC) -D_DEBUG
mistachkin4d60be52011-08-26 05:40:31 +0000650!ENDIF
651
mistachkin8bcd3fa2013-08-29 01:03:38 +0000652# If optimizations are enabled or disabled (either implicitly or
653# explicitly), add the necessary flags.
mistachkin4712c212014-05-09 20:51:17 +0000654#
mistachkincd54bab2014-12-20 21:14:14 +0000655!IF $(DEBUG)>1 || $(OPTIMIZATIONS)==0
mistachkin8bcd3fa2013-08-29 01:03:38 +0000656TCC = $(TCC) -Od
657BCC = $(BCC) -Od
658!ELSEIF $(OPTIMIZATIONS)>=3
659TCC = $(TCC) -Ox
660BCC = $(BCC) -Ox
661!ELSEIF $(OPTIMIZATIONS)==2
662TCC = $(TCC) -O2
663BCC = $(BCC) -O2
664!ELSEIF $(OPTIMIZATIONS)==1
665TCC = $(TCC) -O1
666BCC = $(BCC) -O1
667!ENDIF
668
669# If symbols are enabled (or compiling for debugging), enable PDBs.
mistachkin4712c212014-05-09 20:51:17 +0000670#
mistachkincd54bab2014-12-20 21:14:14 +0000671!IF $(DEBUG)>1 || $(SYMBOLS)!=0
mistachkin4d60be52011-08-26 05:40:31 +0000672TCC = $(TCC) -Zi
mistachkinfec360a2012-04-18 10:29:21 +0000673BCC = $(BCC) -Zi
mistachkin753c5442011-08-25 02:02:25 +0000674!ENDIF
675
mistachkinc756ded2011-10-02 05:23:16 +0000676# If ICU support is enabled, add the compiler options for it.
mistachkin4712c212014-05-09 20:51:17 +0000677#
mistachkinc756ded2011-10-02 05:23:16 +0000678!IF $(USE_ICU)!=0
679TCC = $(TCC) -DSQLITE_ENABLE_ICU=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000680RCC = $(RCC) -DSQLITE_ENABLE_ICU=1
mistachkinc756ded2011-10-02 05:23:16 +0000681TCC = $(TCC) -I$(TOP)\ext\icu
mistachkin4d9d1f42012-09-03 10:32:32 +0000682RCC = $(RCC) -I$(TOP)\ext\icu
mistachkinc756ded2011-10-02 05:23:16 +0000683TCC = $(TCC) -I$(ICUINCDIR)
mistachkin4d9d1f42012-09-03 10:32:32 +0000684RCC = $(RCC) -I$(ICUINCDIR)
mistachkinc756ded2011-10-02 05:23:16 +0000685!ENDIF
686
mistachkin4d9d1f42012-09-03 10:32:32 +0000687# Command line prefixes for compiling code, compiling resources,
688# linking, etc.
mistachkin4712c212014-05-09 20:51:17 +0000689#
shanehb2f20bf2011-06-17 07:07:24 +0000690LTCOMPILE = $(TCC) -Fo$@
mistachkin4d9d1f42012-09-03 10:32:32 +0000691LTRCOMPILE = $(RCC) -r
shanehb2f20bf2011-06-17 07:07:24 +0000692LTLIB = lib.exe
shaneh2a0b9ef2011-06-20 20:52:32 +0000693LTLINK = $(TCC) -Fe$@
694
mistachkine45e0fb2015-01-21 00:48:46 +0000695# If requested, link to the RPCRT4 library.
696#
697!IF $(USE_RPCRT4_LIB)!=0
698LTLINK = $(LTLINK) rpcrt4.lib
699!ENDIF
700
shaneh2a0b9ef2011-06-20 20:52:32 +0000701# If a platform was set, force the linker to target that.
702# Note that the vcvars*.bat family of batch files typically
703# set this for you. Otherwise, the linker will attempt
704# to deduce the binary type based on the object files.
mistachkine37f99c2012-06-30 16:22:05 +0000705!IFDEF PLATFORM
mistachkin44723ce2015-03-21 02:22:37 +0000706LTLINKOPTS = /NOLOGO /MACHINE:$(PLATFORM)
707LTLIBOPTS = /NOLOGO /MACHINE:$(PLATFORM)
708!ELSE
709LTLINKOPTS = /NOLOGO
710LTLIBOPTS = /NOLOGO
shaneh2a0b9ef2011-06-20 20:52:32 +0000711!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000712
mistachkina6ff8572012-04-17 21:00:12 +0000713# When compiling for use in the WinRT environment, the following
714# linker option must be used to mark the executable as runnable
715# only in the context of an application container.
716#
717!IF $(FOR_WINRT)!=0
718LTLINKOPTS = $(LTLINKOPTS) /APPCONTAINER
mistachkin60bdad72013-07-11 03:09:45 +0000719!IF "$(VISUALSTUDIOVERSION)"=="12.0"
mistachkinf6a23422014-05-05 20:24:34 +0000720!IFNDEF STORELIBPATH
mistachkinda5b1cd2013-07-10 19:39:02 +0000721!IF "$(PLATFORM)"=="x86"
mistachkin4712c212014-05-09 20:51:17 +0000722STORELIBPATH = $(CRTLIBPATH)\store
mistachkinda5b1cd2013-07-10 19:39:02 +0000723!ELSEIF "$(PLATFORM)"=="x64"
mistachkin4712c212014-05-09 20:51:17 +0000724STORELIBPATH = $(CRTLIBPATH)\store\amd64
mistachkin4eaa1292013-07-10 21:33:25 +0000725!ELSEIF "$(PLATFORM)"=="ARM"
mistachkin4712c212014-05-09 20:51:17 +0000726STORELIBPATH = $(CRTLIBPATH)\store\arm
mistachkin4eaa1292013-07-10 21:33:25 +0000727!ELSE
mistachkin4712c212014-05-09 20:51:17 +0000728STORELIBPATH = $(CRTLIBPATH)\store
mistachkinda5b1cd2013-07-10 19:39:02 +0000729!ENDIF
730!ENDIF
mistachkinf6a23422014-05-05 20:24:34 +0000731STORELIBPATH = $(STORELIBPATH:\\=\)
732LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(STORELIBPATH)"
733!ENDIF
mistachkina6ff8572012-04-17 21:00:12 +0000734!ENDIF
735
mistachkind9b3c542014-05-09 23:31:55 +0000736# When compiling for Windows Phone 8.1, an extra library path is
737# required.
738#
739!IF $(USE_WP81_OPTS)!=0
740!IFNDEF WP81LIBPATH
741!IF "$(PLATFORM)"=="x86"
742WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86
743!ELSEIF "$(PLATFORM)"=="ARM"
744WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\ARM
745!ELSE
746WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86
mistachkinc756ded2011-10-02 05:23:16 +0000747!ENDIF
mistachkin31856a32012-07-27 07:13:25 +0000748!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000749!ENDIF
750
mistachkind9b3c542014-05-09 23:31:55 +0000751# When compiling for Windows Phone 8.1, some extra linker options
752# are also required.
753#
754!IF $(USE_WP81_OPTS)!=0
755!IFDEF WP81LIBPATH
756LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(WP81LIBPATH)"
757!ENDIF
758LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE
759LTLINKOPTS = $(LTLINKOPTS) WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelHost.lib
760LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:kernel32.lib /NODEFAULTLIB:ole32.lib
761!ENDIF
762
shanehb2f20bf2011-06-17 07:07:24 +0000763# If either debugging or symbols are enabled, enable PDBs.
mistachkin4712c212014-05-09 20:51:17 +0000764#
mistachkincd54bab2014-12-20 21:14:14 +0000765!IF $(DEBUG)>1 || $(SYMBOLS)!=0
shanehb2f20bf2011-06-17 07:07:24 +0000766LDFLAGS = /DEBUG
shanehb2f20bf2011-06-17 07:07:24 +0000767!ENDIF
768
769# Start with the Tcl related linker options.
mistachkin4712c212014-05-09 20:51:17 +0000770#
shanehb2f20bf2011-06-17 07:07:24 +0000771!IF $(NO_TCL)==0
772LTLIBPATHS = /LIBPATH:$(TCLLIBDIR)
773LTLIBS = $(LIBTCL)
mistachkin31856a32012-07-27 07:13:25 +0000774!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000775
776# If ICU support is enabled, add the linker options for it.
mistachkin4712c212014-05-09 20:51:17 +0000777#
shanehb2f20bf2011-06-17 07:07:24 +0000778!IF $(USE_ICU)!=0
779LTLIBPATHS = $(LTLIBPATHS) /LIBPATH:$(ICULIBDIR)
780LTLIBS = $(LTLIBS) $(LIBICU)
781!ENDIF
782
783# nawk compatible awk.
mistachkin4712c212014-05-09 20:51:17 +0000784#
mistachkin8bcd3fa2013-08-29 01:03:38 +0000785!IFNDEF NAWK
shanehb2f20bf2011-06-17 07:07:24 +0000786NAWK = gawk.exe
mistachkin8bcd3fa2013-08-29 01:03:38 +0000787!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000788
789# You should not have to change anything below this line
790###############################################################################
791
792# Object files for the SQLite library (non-amalgamation).
793#
mistachkinf67feef2013-07-29 19:03:20 +0000794LIBOBJS0 = vdbe.lo parse.lo alter.lo analyze.lo attach.lo auth.lo \
shanehb2f20bf2011-06-17 07:07:24 +0000795 backup.lo bitvec.lo btmutex.lo btree.lo build.lo \
796 callback.lo complete.lo ctime.lo date.lo delete.lo \
797 expr.lo fault.lo fkey.lo \
drh391d4ba2012-05-28 20:22:16 +0000798 fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo \
799 fts3_porter.lo fts3_snippet.lo fts3_tokenizer.lo fts3_tokenizer1.lo \
drh4d648c72013-04-22 17:07:56 +0000800 fts3_tokenize_vtab.lo fts3_unicode.lo fts3_unicode2.lo fts3_write.lo \
shanehb2f20bf2011-06-17 07:07:24 +0000801 func.lo global.lo hash.lo \
802 icu.lo insert.lo journal.lo legacy.lo loadext.lo \
803 main.lo malloc.lo mem0.lo mem1.lo mem2.lo mem3.lo mem5.lo \
804 memjournal.lo \
mistachkinf1c6bc52012-06-21 15:09:20 +0000805 mutex.lo mutex_noop.lo mutex_unix.lo mutex_w32.lo \
806 notify.lo opcodes.lo os.lo os_unix.lo os_win.lo \
mistachkinf67feef2013-07-29 19:03:20 +0000807 pager.lo pcache.lo pcache1.lo pragma.lo prepare.lo printf.lo \
drh498dcae2013-03-13 11:42:00 +0000808 random.lo resolve.lo rowset.lo rtree.lo \
809 sqlite3session.lo select.lo status.lo \
mistachkine5007472014-05-02 19:12:37 +0000810 table.lo threads.lo tokenize.lo trigger.lo \
shanehb2f20bf2011-06-17 07:07:24 +0000811 update.lo util.lo vacuum.lo \
mistachkinf67feef2013-07-29 19:03:20 +0000812 vdbeapi.lo vdbeaux.lo vdbeblob.lo vdbemem.lo vdbesort.lo \
shanehb2f20bf2011-06-17 07:07:24 +0000813 vdbetrace.lo wal.lo walker.lo where.lo utf.lo vtab.lo
814
815# Object files for the amalgamation.
816#
817LIBOBJS1 = sqlite3.lo
818
819# Determine the real value of LIBOBJ based on the 'configure' script
820#
821!IF $(USE_AMALGAMATION)==0
822LIBOBJ = $(LIBOBJS0)
823!ELSE
824LIBOBJ = $(LIBOBJS1)
825!ENDIF
826
mistachkin08c1c312012-10-06 03:48:25 +0000827# Determine if embedded resource compilation and usage are enabled.
828#
829!IF $(USE_RC)!=0
830LIBRESOBJS = sqlite3res.lo
831!ELSE
832LIBRESOBJS =
833!ENDIF
834
shanehb2f20bf2011-06-17 07:07:24 +0000835# All of the source code files.
836#
drh62679202015-01-29 18:38:05 +0000837SRC1 = \
shanehb2f20bf2011-06-17 07:07:24 +0000838 $(TOP)\src\alter.c \
839 $(TOP)\src\analyze.c \
840 $(TOP)\src\attach.c \
841 $(TOP)\src\auth.c \
842 $(TOP)\src\backup.c \
843 $(TOP)\src\bitvec.c \
844 $(TOP)\src\btmutex.c \
845 $(TOP)\src\btree.c \
846 $(TOP)\src\btree.h \
847 $(TOP)\src\btreeInt.h \
848 $(TOP)\src\build.c \
849 $(TOP)\src\callback.c \
850 $(TOP)\src\complete.c \
851 $(TOP)\src\ctime.c \
852 $(TOP)\src\date.c \
853 $(TOP)\src\delete.c \
854 $(TOP)\src\expr.c \
855 $(TOP)\src\fault.c \
856 $(TOP)\src\fkey.c \
857 $(TOP)\src\func.c \
858 $(TOP)\src\global.c \
859 $(TOP)\src\hash.c \
860 $(TOP)\src\hash.h \
861 $(TOP)\src\hwtime.h \
862 $(TOP)\src\insert.c \
863 $(TOP)\src\journal.c \
864 $(TOP)\src\legacy.c \
865 $(TOP)\src\loadext.c \
866 $(TOP)\src\main.c \
867 $(TOP)\src\malloc.c \
868 $(TOP)\src\mem0.c \
869 $(TOP)\src\mem1.c \
870 $(TOP)\src\mem2.c \
871 $(TOP)\src\mem3.c \
872 $(TOP)\src\mem5.c \
873 $(TOP)\src\memjournal.c \
mistachkin2318d332015-01-12 18:02:52 +0000874 $(TOP)\src\msvc.h \
shanehb2f20bf2011-06-17 07:07:24 +0000875 $(TOP)\src\mutex.c \
876 $(TOP)\src\mutex.h \
877 $(TOP)\src\mutex_noop.c \
shanehb2f20bf2011-06-17 07:07:24 +0000878 $(TOP)\src\mutex_unix.c \
879 $(TOP)\src\mutex_w32.c \
880 $(TOP)\src\notify.c \
881 $(TOP)\src\os.c \
882 $(TOP)\src\os.h \
883 $(TOP)\src\os_common.h \
mistachkinf74b9e02013-11-26 01:00:31 +0000884 $(TOP)\src\os_setup.h \
shanehb2f20bf2011-06-17 07:07:24 +0000885 $(TOP)\src\os_unix.c \
886 $(TOP)\src\os_win.c \
drh62679202015-01-29 18:38:05 +0000887 $(TOP)\src\os_win.h
888SRC2 = \
shanehb2f20bf2011-06-17 07:07:24 +0000889 $(TOP)\src\pager.c \
890 $(TOP)\src\pager.h \
891 $(TOP)\src\parse.y \
892 $(TOP)\src\pcache.c \
893 $(TOP)\src\pcache.h \
894 $(TOP)\src\pcache1.c \
895 $(TOP)\src\pragma.c \
drh67e65e52015-02-02 21:34:54 +0000896 $(TOP)\src\pragma.h \
shanehb2f20bf2011-06-17 07:07:24 +0000897 $(TOP)\src\prepare.c \
898 $(TOP)\src\printf.c \
899 $(TOP)\src\random.c \
900 $(TOP)\src\resolve.c \
901 $(TOP)\src\rowset.c \
902 $(TOP)\src\select.c \
903 $(TOP)\src\status.c \
904 $(TOP)\src\shell.c \
905 $(TOP)\src\sqlite.h.in \
906 $(TOP)\src\sqlite3ext.h \
907 $(TOP)\src\sqliteInt.h \
908 $(TOP)\src\sqliteLimit.h \
909 $(TOP)\src\table.c \
drhf51446a2012-07-21 19:40:42 +0000910 $(TOP)\src\threads.c \
shanehb2f20bf2011-06-17 07:07:24 +0000911 $(TOP)\src\tclsqlite.c \
912 $(TOP)\src\tokenize.c \
913 $(TOP)\src\trigger.c \
914 $(TOP)\src\utf.c \
915 $(TOP)\src\update.c \
916 $(TOP)\src\util.c \
917 $(TOP)\src\vacuum.c \
918 $(TOP)\src\vdbe.c \
919 $(TOP)\src\vdbe.h \
920 $(TOP)\src\vdbeapi.c \
921 $(TOP)\src\vdbeaux.c \
922 $(TOP)\src\vdbeblob.c \
923 $(TOP)\src\vdbemem.c \
mistachkin81c428a2011-08-17 02:19:54 +0000924 $(TOP)\src\vdbesort.c \
shanehb2f20bf2011-06-17 07:07:24 +0000925 $(TOP)\src\vdbetrace.c \
926 $(TOP)\src\vdbeInt.h \
927 $(TOP)\src\vtab.c \
drh8cd5b252015-03-02 22:06:43 +0000928 $(TOP)\src\vxworks.h \
shanehb2f20bf2011-06-17 07:07:24 +0000929 $(TOP)\src\wal.c \
930 $(TOP)\src\wal.h \
931 $(TOP)\src\walker.c \
drhe54df422013-11-12 18:37:25 +0000932 $(TOP)\src\where.c \
933 $(TOP)\src\whereInt.h
shanehb2f20bf2011-06-17 07:07:24 +0000934
935# Source code for extensions
936#
drh62679202015-01-29 18:38:05 +0000937SRC3 = \
shanehb2f20bf2011-06-17 07:07:24 +0000938 $(TOP)\ext\fts1\fts1.c \
939 $(TOP)\ext\fts1\fts1.h \
940 $(TOP)\ext\fts1\fts1_hash.c \
941 $(TOP)\ext\fts1\fts1_hash.h \
942 $(TOP)\ext\fts1\fts1_porter.c \
943 $(TOP)\ext\fts1\fts1_tokenizer.h \
drh62679202015-01-29 18:38:05 +0000944 $(TOP)\ext\fts1\fts1_tokenizer1.c \
shanehb2f20bf2011-06-17 07:07:24 +0000945 $(TOP)\ext\fts2\fts2.c \
946 $(TOP)\ext\fts2\fts2.h \
947 $(TOP)\ext\fts2\fts2_hash.c \
948 $(TOP)\ext\fts2\fts2_hash.h \
949 $(TOP)\ext\fts2\fts2_icu.c \
950 $(TOP)\ext\fts2\fts2_porter.c \
951 $(TOP)\ext\fts2\fts2_tokenizer.h \
952 $(TOP)\ext\fts2\fts2_tokenizer.c \
953 $(TOP)\ext\fts2\fts2_tokenizer1.c
drh62679202015-01-29 18:38:05 +0000954SRC4 = \
shanehb2f20bf2011-06-17 07:07:24 +0000955 $(TOP)\ext\fts3\fts3.c \
956 $(TOP)\ext\fts3\fts3.h \
957 $(TOP)\ext\fts3\fts3Int.h \
958 $(TOP)\ext\fts3\fts3_aux.c \
959 $(TOP)\ext\fts3\fts3_expr.c \
960 $(TOP)\ext\fts3\fts3_hash.c \
961 $(TOP)\ext\fts3\fts3_hash.h \
962 $(TOP)\ext\fts3\fts3_icu.c \
963 $(TOP)\ext\fts3\fts3_porter.c \
964 $(TOP)\ext\fts3\fts3_snippet.c \
965 $(TOP)\ext\fts3\fts3_tokenizer.h \
966 $(TOP)\ext\fts3\fts3_tokenizer.c \
967 $(TOP)\ext\fts3\fts3_tokenizer1.c \
drh4d648c72013-04-22 17:07:56 +0000968 $(TOP)\ext\fts3\fts3_tokenize_vtab.c \
drh391d4ba2012-05-28 20:22:16 +0000969 $(TOP)\ext\fts3\fts3_unicode.c \
970 $(TOP)\ext\fts3\fts3_unicode2.c \
drh62679202015-01-29 18:38:05 +0000971 $(TOP)\ext\fts3\fts3_write.c \
shanehb2f20bf2011-06-17 07:07:24 +0000972 $(TOP)\ext\icu\sqliteicu.h \
drh62679202015-01-29 18:38:05 +0000973 $(TOP)\ext\icu\icu.c \
shanehb2f20bf2011-06-17 07:07:24 +0000974 $(TOP)\ext\rtree\rtree.h \
drhedea9112015-03-24 19:02:13 +0000975 $(TOP)\ext\rtree\rtree.c \
mistachkinadb96a62012-01-16 12:33:36 +0000976 $(TOP)\ext\session\sqlite3session.h \
977 $(TOP)\ext\session\sqlite3session.c
shanehb2f20bf2011-06-17 07:07:24 +0000978
979
980# Generated source code files
981#
drh62679202015-01-29 18:38:05 +0000982SRC5 = \
shanehb2f20bf2011-06-17 07:07:24 +0000983 keywordhash.h \
984 opcodes.c \
985 opcodes.h \
986 parse.c \
987 parse.h \
988 sqlite3.h
989
drh62679202015-01-29 18:38:05 +0000990# All source code files.
991#
992SRC = $(SRC1) $(SRC2) $(SRC3) $(SRC4) $(SRC5)
993
shanehb2f20bf2011-06-17 07:07:24 +0000994# Source code to the test files.
995#
996TESTSRC = \
997 $(TOP)\src\test1.c \
998 $(TOP)\src\test2.c \
999 $(TOP)\src\test3.c \
1000 $(TOP)\src\test4.c \
1001 $(TOP)\src\test5.c \
1002 $(TOP)\src\test6.c \
1003 $(TOP)\src\test7.c \
1004 $(TOP)\src\test8.c \
1005 $(TOP)\src\test9.c \
1006 $(TOP)\src\test_autoext.c \
1007 $(TOP)\src\test_async.c \
1008 $(TOP)\src\test_backup.c \
drh5de7d962014-12-05 00:17:39 +00001009 $(TOP)\src\test_blob.c \
shanehb2f20bf2011-06-17 07:07:24 +00001010 $(TOP)\src\test_btree.c \
1011 $(TOP)\src\test_config.c \
1012 $(TOP)\src\test_demovfs.c \
1013 $(TOP)\src\test_devsym.c \
mistachkin413c63b2013-01-17 03:18:14 +00001014 $(TOP)\src\test_fs.c \
shanehb2f20bf2011-06-17 07:07:24 +00001015 $(TOP)\src\test_func.c \
shanehb2f20bf2011-06-17 07:07:24 +00001016 $(TOP)\src\test_hexio.c \
1017 $(TOP)\src\test_init.c \
1018 $(TOP)\src\test_intarray.c \
1019 $(TOP)\src\test_journal.c \
1020 $(TOP)\src\test_malloc.c \
1021 $(TOP)\src\test_multiplex.c \
1022 $(TOP)\src\test_mutex.c \
1023 $(TOP)\src\test_onefile.c \
1024 $(TOP)\src\test_osinst.c \
1025 $(TOP)\src\test_pcache.c \
1026 $(TOP)\src\test_quota.c \
1027 $(TOP)\src\test_rtree.c \
1028 $(TOP)\src\test_schema.c \
1029 $(TOP)\src\test_server.c \
1030 $(TOP)\src\test_superlock.c \
1031 $(TOP)\src\test_syscall.c \
1032 $(TOP)\src\test_stat.c \
1033 $(TOP)\src\test_tclvar.c \
1034 $(TOP)\src\test_thread.c \
1035 $(TOP)\src\test_vfs.c \
shanehb2f20bf2011-06-17 07:07:24 +00001036 $(TOP)\src\test_wsd.c \
1037 $(TOP)\ext\fts3\fts3_term.c \
mistachkinadb96a62012-01-16 12:33:36 +00001038 $(TOP)\ext\fts3\fts3_test.c \
1039 $(TOP)\ext\session\test_session.c
shanehb2f20bf2011-06-17 07:07:24 +00001040
drhe50db1c2013-04-25 14:31:46 +00001041# Statically linked extensions
1042#
drh1fb64af2013-04-25 14:36:28 +00001043TESTEXT = \
drh8416fc72013-04-25 16:42:55 +00001044 $(TOP)\ext\misc\amatch.c \
1045 $(TOP)\ext\misc\closure.c \
drh1728bcb2014-11-10 16:49:56 +00001046 $(TOP)\ext\misc\eval.c \
drh51ed2982014-06-16 12:44:32 +00001047 $(TOP)\ext\misc\fileio.c \
drhe50db1c2013-04-25 14:31:46 +00001048 $(TOP)\ext\misc\fuzzer.c \
drh8416fc72013-04-25 16:42:55 +00001049 $(TOP)\ext\misc\ieee754.c \
drhea41dc42013-04-25 19:31:33 +00001050 $(TOP)\ext\misc\nextchar.c \
drhdef33672013-05-28 20:25:54 +00001051 $(TOP)\ext\misc\percentile.c \
drhe50db1c2013-04-25 14:31:46 +00001052 $(TOP)\ext\misc\regexp.c \
drhb7045ab2013-04-25 14:59:01 +00001053 $(TOP)\ext\misc\spellfix.c \
drh5f8cdac2013-10-14 21:14:42 +00001054 $(TOP)\ext\misc\totype.c \
drhe50db1c2013-04-25 14:31:46 +00001055 $(TOP)\ext\misc\wholenumber.c
1056
1057
shanehb2f20bf2011-06-17 07:07:24 +00001058# Source code to the library files needed by the test fixture
mistachkinadb96a62012-01-16 12:33:36 +00001059# (non-amalgamation)
shanehb2f20bf2011-06-17 07:07:24 +00001060#
1061TESTSRC2 = \
1062 $(TOP)\src\attach.c \
1063 $(TOP)\src\backup.c \
1064 $(TOP)\src\bitvec.c \
1065 $(TOP)\src\btree.c \
1066 $(TOP)\src\build.c \
1067 $(TOP)\src\ctime.c \
1068 $(TOP)\src\date.c \
1069 $(TOP)\src\expr.c \
1070 $(TOP)\src\func.c \
1071 $(TOP)\src\insert.c \
1072 $(TOP)\src\wal.c \
mistachkin06006632013-05-15 20:35:13 +00001073 $(TOP)\src\main.c \
shanehb2f20bf2011-06-17 07:07:24 +00001074 $(TOP)\src\mem5.c \
1075 $(TOP)\src\os.c \
shanehb2f20bf2011-06-17 07:07:24 +00001076 $(TOP)\src\os_unix.c \
1077 $(TOP)\src\os_win.c \
1078 $(TOP)\src\pager.c \
1079 $(TOP)\src\pragma.c \
1080 $(TOP)\src\prepare.c \
1081 $(TOP)\src\printf.c \
1082 $(TOP)\src\random.c \
1083 $(TOP)\src\pcache.c \
1084 $(TOP)\src\pcache1.c \
1085 $(TOP)\src\select.c \
1086 $(TOP)\src\tokenize.c \
1087 $(TOP)\src\utf.c \
1088 $(TOP)\src\util.c \
1089 $(TOP)\src\vdbeapi.c \
1090 $(TOP)\src\vdbeaux.c \
1091 $(TOP)\src\vdbe.c \
1092 $(TOP)\src\vdbemem.c \
mistachkin81c428a2011-08-17 02:19:54 +00001093 $(TOP)\src\vdbesort.c \
shanehb2f20bf2011-06-17 07:07:24 +00001094 $(TOP)\src\vdbetrace.c \
1095 $(TOP)\src\where.c \
1096 parse.c \
1097 $(TOP)\ext\fts3\fts3.c \
1098 $(TOP)\ext\fts3\fts3_aux.c \
1099 $(TOP)\ext\fts3\fts3_expr.c \
shanehb2f20bf2011-06-17 07:07:24 +00001100 $(TOP)\ext\fts3\fts3_tokenizer.c \
drh4d648c72013-04-22 17:07:56 +00001101 $(TOP)\ext\fts3\fts3_tokenize_vtab.c \
drh391d4ba2012-05-28 20:22:16 +00001102 $(TOP)\ext\fts3\fts3_unicode.c \
1103 $(TOP)\ext\fts3\fts3_unicode2.c \
shanehb2f20bf2011-06-17 07:07:24 +00001104 $(TOP)\ext\fts3\fts3_write.c \
mistachkinadb96a62012-01-16 12:33:36 +00001105 $(TOP)\ext\async\sqlite3async.c \
1106 $(TOP)\ext\session\sqlite3session.c
1107
1108# Source code to the library files needed by the test fixture
1109# (amalgamation)
1110#
drhc03edc02013-03-18 16:24:33 +00001111TESTSRC3 =
1112
shanehb2f20bf2011-06-17 07:07:24 +00001113
1114# Header files used by all library source files.
1115#
1116HDR = \
1117 $(TOP)\src\btree.h \
1118 $(TOP)\src\btreeInt.h \
1119 $(TOP)\src\hash.h \
1120 $(TOP)\src\hwtime.h \
1121 keywordhash.h \
mistachkin2318d332015-01-12 18:02:52 +00001122 $(TOP)\src\msvc.h \
shanehb2f20bf2011-06-17 07:07:24 +00001123 $(TOP)\src\mutex.h \
1124 opcodes.h \
1125 $(TOP)\src\os.h \
1126 $(TOP)\src\os_common.h \
mistachkinf74b9e02013-11-26 01:00:31 +00001127 $(TOP)\src\os_setup.h \
mistachkin8bc52622013-11-25 09:36:07 +00001128 $(TOP)\src\os_win.h \
shanehb2f20bf2011-06-17 07:07:24 +00001129 $(TOP)\src\pager.h \
1130 $(TOP)\src\pcache.h \
shaneh6e7850c2011-06-17 15:57:07 +00001131 parse.h \
drh67e65e52015-02-02 21:34:54 +00001132 $(TOP)\src\pragma.h \
shaneh6e7850c2011-06-17 15:57:07 +00001133 sqlite3.h \
shanehb2f20bf2011-06-17 07:07:24 +00001134 $(TOP)\src\sqlite3ext.h \
shaneh6e7850c2011-06-17 15:57:07 +00001135 $(TOP)\src\sqliteInt.h \
shanehb2f20bf2011-06-17 07:07:24 +00001136 $(TOP)\src\sqliteLimit.h \
1137 $(TOP)\src\vdbe.h \
drhe54df422013-11-12 18:37:25 +00001138 $(TOP)\src\vdbeInt.h \
drh8cd5b252015-03-02 22:06:43 +00001139 $(TOP)\src\vxworks.h \
drhe54df422013-11-12 18:37:25 +00001140 $(TOP)\src\whereInt.h
shanehb2f20bf2011-06-17 07:07:24 +00001141
1142# Header files used by extensions
1143#
1144EXTHDR = $(EXTHDR) \
1145 $(TOP)\ext\fts1\fts1.h \
1146 $(TOP)\ext\fts1\fts1_hash.h \
1147 $(TOP)\ext\fts1\fts1_tokenizer.h
1148EXTHDR = $(EXTHDR) \
1149 $(TOP)\ext\fts2\fts2.h \
1150 $(TOP)\ext\fts2\fts2_hash.h \
1151 $(TOP)\ext\fts2\fts2_tokenizer.h
1152EXTHDR = $(EXTHDR) \
1153 $(TOP)\ext\fts3\fts3.h \
1154 $(TOP)\ext\fts3\fts3Int.h \
1155 $(TOP)\ext\fts3\fts3_hash.h \
1156 $(TOP)\ext\fts3\fts3_tokenizer.h
1157EXTHDR = $(EXTHDR) \
1158 $(TOP)\ext\rtree\rtree.h
1159EXTHDR = $(EXTHDR) \
1160 $(TOP)\ext\icu\sqliteicu.h
1161EXTHDR = $(EXTHDR) \
1162 $(TOP)\ext\rtree\sqlite3rtree.h
mistachkinadb96a62012-01-16 12:33:36 +00001163EXTHDR = $(EXTHDR) \
1164 $(TOP)\ext\session\sqlite3session.h
shanehb2f20bf2011-06-17 07:07:24 +00001165
1166# This is the default Makefile target. The objects listed here
1167# are what get build when you type just "make" with no arguments.
1168#
mistachkin5b0b6fd2011-06-25 01:14:36 +00001169all: dll libsqlite3.lib sqlite3.exe libtclsqlite3.lib
shanehb2f20bf2011-06-17 07:07:24 +00001170
shanehb2f20bf2011-06-17 07:07:24 +00001171libsqlite3.lib: $(LIBOBJ)
shaneh29ebea82011-06-21 18:12:07 +00001172 $(LTLIB) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001173
1174libtclsqlite3.lib: tclsqlite.lo libsqlite3.lib
mistachkinc756ded2011-10-02 05:23:16 +00001175 $(LTLIB) $(LTLIBOPTS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCL:tcl=tclstub) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001176
mistachkin44723ce2015-03-21 02:22:37 +00001177sqlite3.exe: $(TOP)\src\shell.c $(SHELL_CORE_DEP) $(LIBRESOBJS) sqlite3.h
1178 $(LTLINK) $(SHELL_COMPILE_OPTS) $(READLINE_FLAGS) $(TOP)\src\shell.c \
1179 /link /pdb:sqlite3sh.pdb $(LTLINKOPTS) $(SHELL_LINK_OPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001180
mistachkin44723ce2015-03-21 02:22:37 +00001181mptester.exe: $(TOP)\mptest\mptest.c $(SHELL_CORE_DEP) $(LIBRESOBJS) sqlite3.h
1182 $(LTLINK) $(SHELL_COMPILE_OPTS) $(TOP)\mptest\mptest.c \
1183 /link $(LTLINKOPTS) $(LTLIBPATHS) $(SHELL_LINK_OPTS) $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS)
drhbc94dbb2013-04-08 14:28:33 +00001184
mistachkin4d2daba2015-03-31 16:42:16 +00001185MPTEST1 = mptester mptest.db $(TOP)/mptest/crash01.test --repeat 20
1186MPTEST2 = mptester mptest.db $(TOP)/mptest/multiwrite01.test --repeat 20
1187
drhfe0ba712015-03-31 13:46:13 +00001188mptest: mptester.exe
mistachkin4d2daba2015-03-31 16:42:16 +00001189 del /Q mptest.db 2>NUL
drhfe0ba712015-03-31 13:46:13 +00001190 $(MPTEST1) --journalmode DELETE
1191 $(MPTEST2) --journalmode WAL
1192 $(MPTEST1) --journalmode WAL
1193 $(MPTEST2) --journalmode PERSIST
1194 $(MPTEST1) --journalmode PERSIST
1195 $(MPTEST2) --journalmode TRUNCATE
1196 $(MPTEST1) --journalmode TRUNCATE
1197 $(MPTEST2) --journalmode DELETE
1198
shanehb2f20bf2011-06-17 07:07:24 +00001199# This target creates a directory named "tsrc" and fills it with
1200# copies of all of the C source code and header files needed to
1201# build on the target system. Some of the C source code and header
1202# files are automatically generated. This target takes care of
1203# all that automatic generation.
1204#
1205.target_source: $(SRC) $(TOP)\tool\vdbe-compress.tcl
mistachkin44723ce2015-03-21 02:22:37 +00001206 -rmdir /Q/S tsrc 2>NUL
shanehb2f20bf2011-06-17 07:07:24 +00001207 -mkdir tsrc
drh62679202015-01-29 18:38:05 +00001208 for %i in ($(SRC1)) do copy /Y %i tsrc
1209 for %i in ($(SRC2)) do copy /Y %i tsrc
1210 for %i in ($(SRC3)) do copy /Y %i tsrc
1211 for %i in ($(SRC4)) do copy /Y %i tsrc
1212 for %i in ($(SRC5)) do copy /Y %i tsrc
mistachkin44723ce2015-03-21 02:22:37 +00001213 del /Q tsrc\sqlite.h.in tsrc\parse.y 2>NUL
drh2dc06482013-12-11 00:59:10 +00001214 $(TCLSH_CMD) $(TOP)\tool\vdbe-compress.tcl $(OPTS) < tsrc\vdbe.c > vdbe.new
shanehb2f20bf2011-06-17 07:07:24 +00001215 move vdbe.new tsrc\vdbe.c
1216 echo > .target_source
1217
1218sqlite3.c: .target_source $(TOP)\tool\mksqlite3c.tcl
mistachkinb0427512014-01-30 11:12:52 +00001219 $(TCLSH_CMD) $(TOP)\tool\mksqlite3c.tcl $(MKSQLITE3C_ARGS)
drhe191e2c2013-03-19 15:23:18 +00001220 copy tsrc\shell.c .
1221 copy tsrc\sqlite3ext.h .
1222 copy $(TOP)\ext\session\sqlite3session.h .
shanehb2f20bf2011-06-17 07:07:24 +00001223
mistachkin48dd9de2012-12-06 04:33:13 +00001224sqlite3-all.c: sqlite3.c $(TOP)\tool\split-sqlite3c.tcl
1225 $(TCLSH_CMD) $(TOP)\tool\split-sqlite3c.tcl
drh75e7bc12011-07-22 11:23:49 +00001226
mistachkin76510912013-10-11 23:01:18 +00001227# Set the source code file to be used by executables and libraries when
1228# they need the amalgamation.
1229#
1230!IF $(SPLIT_AMALGAMATION)!=0
1231SQLITE3C = sqlite3-all.c
1232!ELSE
1233SQLITE3C = sqlite3.c
1234!ENDIF
1235
shanehb2f20bf2011-06-17 07:07:24 +00001236# Rule to build the amalgamation
1237#
mistachkin76510912013-10-11 23:01:18 +00001238sqlite3.lo: $(SQLITE3C)
mistachkin44723ce2015-03-21 02:22:37 +00001239 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(SQLITE3C)
shanehb2f20bf2011-06-17 07:07:24 +00001240
1241# Rules to build the LEMON compiler generator
1242#
1243lempar.c: $(TOP)\src\lempar.c
1244 copy $(TOP)\src\lempar.c .
1245
1246lemon.exe: $(TOP)\tool\lemon.c lempar.c
mistachkin2318d332015-01-12 18:02:52 +00001247 $(BCC) $(NO_WARN) -Daccess=_access \
1248 -Fe$@ $(TOP)\tool\lemon.c /link $(NLTLINKOPTS) $(NLTLIBPATHS)
shanehb2f20bf2011-06-17 07:07:24 +00001249
1250# Rules to build individual *.lo files from generated *.c files. This
1251# applies to:
1252#
1253# parse.lo
1254# opcodes.lo
1255#
1256parse.lo: parse.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001257 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c parse.c
shanehb2f20bf2011-06-17 07:07:24 +00001258
1259opcodes.lo: opcodes.c
mistachkin44723ce2015-03-21 02:22:37 +00001260 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c opcodes.c
shanehb2f20bf2011-06-17 07:07:24 +00001261
mistachkin4d9d1f42012-09-03 10:32:32 +00001262# Rule to build the Win32 resources object file.
1263#
mistachkin08c1c312012-10-06 03:48:25 +00001264!IF $(USE_RC)!=0
1265$(LIBRESOBJS): $(TOP)\src\sqlite3.rc $(HDR)
mistachkin4d9d1f42012-09-03 10:32:32 +00001266 echo #ifndef SQLITE_RESOURCE_VERSION > sqlite3rc.h
mistachkin8ccc6d42012-09-27 21:03:53 +00001267 for /F %%V in ('type "$(TOP)\VERSION"') do ( \
mistachkin4d9d1f42012-09-03 10:32:32 +00001268 echo #define SQLITE_RESOURCE_VERSION %%V \
mistachkin597a8c52012-09-03 11:14:53 +00001269 | $(NAWK) "/.*/ { gsub(/[.]/,\",\");print }" >> sqlite3rc.h \
mistachkin4d9d1f42012-09-03 10:32:32 +00001270 )
1271 echo #endif >> sqlite3rc.h
mistachkin08c1c312012-10-06 03:48:25 +00001272 $(LTRCOMPILE) -fo $(LIBRESOBJS) $(TOP)\src\sqlite3.rc
1273!ENDIF
mistachkin4d9d1f42012-09-03 10:32:32 +00001274
shanehb2f20bf2011-06-17 07:07:24 +00001275# Rules to build individual *.lo files from files in the src directory.
1276#
1277alter.lo: $(TOP)\src\alter.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001278 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\alter.c
shanehb2f20bf2011-06-17 07:07:24 +00001279
1280analyze.lo: $(TOP)\src\analyze.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001281 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\analyze.c
shanehb2f20bf2011-06-17 07:07:24 +00001282
1283attach.lo: $(TOP)\src\attach.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001284 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\attach.c
shanehb2f20bf2011-06-17 07:07:24 +00001285
1286auth.lo: $(TOP)\src\auth.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001287 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\auth.c
shanehb2f20bf2011-06-17 07:07:24 +00001288
1289backup.lo: $(TOP)\src\backup.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001290 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\backup.c
shanehb2f20bf2011-06-17 07:07:24 +00001291
1292bitvec.lo: $(TOP)\src\bitvec.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001293 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\bitvec.c
shanehb2f20bf2011-06-17 07:07:24 +00001294
1295btmutex.lo: $(TOP)\src\btmutex.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001296 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\btmutex.c
shanehb2f20bf2011-06-17 07:07:24 +00001297
1298btree.lo: $(TOP)\src\btree.c $(HDR) $(TOP)\src\pager.h
mistachkin44723ce2015-03-21 02:22:37 +00001299 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\btree.c
shanehb2f20bf2011-06-17 07:07:24 +00001300
1301build.lo: $(TOP)\src\build.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001302 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\build.c
shanehb2f20bf2011-06-17 07:07:24 +00001303
1304callback.lo: $(TOP)\src\callback.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001305 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\callback.c
shanehb2f20bf2011-06-17 07:07:24 +00001306
1307complete.lo: $(TOP)\src\complete.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001308 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\complete.c
shanehb2f20bf2011-06-17 07:07:24 +00001309
1310ctime.lo: $(TOP)\src\ctime.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001311 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\ctime.c
shanehb2f20bf2011-06-17 07:07:24 +00001312
1313date.lo: $(TOP)\src\date.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001314 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\date.c
shanehb2f20bf2011-06-17 07:07:24 +00001315
1316delete.lo: $(TOP)\src\delete.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001317 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\delete.c
shanehb2f20bf2011-06-17 07:07:24 +00001318
1319expr.lo: $(TOP)\src\expr.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001320 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\expr.c
shanehb2f20bf2011-06-17 07:07:24 +00001321
1322fault.lo: $(TOP)\src\fault.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001323 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\fault.c
shanehb2f20bf2011-06-17 07:07:24 +00001324
1325fkey.lo: $(TOP)\src\fkey.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001326 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\fkey.c
shanehb2f20bf2011-06-17 07:07:24 +00001327
1328func.lo: $(TOP)\src\func.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001329 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\func.c
shanehb2f20bf2011-06-17 07:07:24 +00001330
1331global.lo: $(TOP)\src\global.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001332 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\global.c
shanehb2f20bf2011-06-17 07:07:24 +00001333
1334hash.lo: $(TOP)\src\hash.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001335 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\hash.c
shanehb2f20bf2011-06-17 07:07:24 +00001336
1337insert.lo: $(TOP)\src\insert.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001338 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\insert.c
shanehb2f20bf2011-06-17 07:07:24 +00001339
1340journal.lo: $(TOP)\src\journal.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001341 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\journal.c
shanehb2f20bf2011-06-17 07:07:24 +00001342
1343legacy.lo: $(TOP)\src\legacy.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001344 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\legacy.c
shanehb2f20bf2011-06-17 07:07:24 +00001345
1346loadext.lo: $(TOP)\src\loadext.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001347 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\loadext.c
shanehb2f20bf2011-06-17 07:07:24 +00001348
1349main.lo: $(TOP)\src\main.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001350 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\main.c
shanehb2f20bf2011-06-17 07:07:24 +00001351
1352malloc.lo: $(TOP)\src\malloc.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001353 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\malloc.c
shanehb2f20bf2011-06-17 07:07:24 +00001354
1355mem0.lo: $(TOP)\src\mem0.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001356 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem0.c
shanehb2f20bf2011-06-17 07:07:24 +00001357
1358mem1.lo: $(TOP)\src\mem1.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001359 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem1.c
shanehb2f20bf2011-06-17 07:07:24 +00001360
1361mem2.lo: $(TOP)\src\mem2.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001362 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem2.c
shanehb2f20bf2011-06-17 07:07:24 +00001363
1364mem3.lo: $(TOP)\src\mem3.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001365 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem3.c
shanehb2f20bf2011-06-17 07:07:24 +00001366
1367mem5.lo: $(TOP)\src\mem5.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001368 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem5.c
shanehb2f20bf2011-06-17 07:07:24 +00001369
1370memjournal.lo: $(TOP)\src\memjournal.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001371 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\memjournal.c
shanehb2f20bf2011-06-17 07:07:24 +00001372
1373mutex.lo: $(TOP)\src\mutex.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001374 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex.c
shanehb2f20bf2011-06-17 07:07:24 +00001375
1376mutex_noop.lo: $(TOP)\src\mutex_noop.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001377 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex_noop.c
shanehb2f20bf2011-06-17 07:07:24 +00001378
shanehb2f20bf2011-06-17 07:07:24 +00001379mutex_unix.lo: $(TOP)\src\mutex_unix.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001380 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex_unix.c
shanehb2f20bf2011-06-17 07:07:24 +00001381
1382mutex_w32.lo: $(TOP)\src\mutex_w32.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001383 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex_w32.c
shanehb2f20bf2011-06-17 07:07:24 +00001384
1385notify.lo: $(TOP)\src\notify.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001386 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\notify.c
shanehb2f20bf2011-06-17 07:07:24 +00001387
1388pager.lo: $(TOP)\src\pager.c $(HDR) $(TOP)\src\pager.h
mistachkin44723ce2015-03-21 02:22:37 +00001389 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pager.c
shanehb2f20bf2011-06-17 07:07:24 +00001390
1391pcache.lo: $(TOP)\src\pcache.c $(HDR) $(TOP)\src\pcache.h
mistachkin44723ce2015-03-21 02:22:37 +00001392 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pcache.c
shanehb2f20bf2011-06-17 07:07:24 +00001393
1394pcache1.lo: $(TOP)\src\pcache1.c $(HDR) $(TOP)\src\pcache.h
mistachkin44723ce2015-03-21 02:22:37 +00001395 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pcache1.c
shanehb2f20bf2011-06-17 07:07:24 +00001396
1397os.lo: $(TOP)\src\os.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001398 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\os.c
shanehb2f20bf2011-06-17 07:07:24 +00001399
1400os_unix.lo: $(TOP)\src\os_unix.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001401 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\os_unix.c
shanehb2f20bf2011-06-17 07:07:24 +00001402
1403os_win.lo: $(TOP)\src\os_win.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001404 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\os_win.c
shanehb2f20bf2011-06-17 07:07:24 +00001405
shanehb2f20bf2011-06-17 07:07:24 +00001406pragma.lo: $(TOP)\src\pragma.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001407 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pragma.c
shanehb2f20bf2011-06-17 07:07:24 +00001408
1409prepare.lo: $(TOP)\src\prepare.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001410 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\prepare.c
shanehb2f20bf2011-06-17 07:07:24 +00001411
1412printf.lo: $(TOP)\src\printf.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001413 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\printf.c
shanehb2f20bf2011-06-17 07:07:24 +00001414
1415random.lo: $(TOP)\src\random.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001416 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\random.c
shanehb2f20bf2011-06-17 07:07:24 +00001417
1418resolve.lo: $(TOP)\src\resolve.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001419 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\resolve.c
shanehb2f20bf2011-06-17 07:07:24 +00001420
1421rowset.lo: $(TOP)\src\rowset.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001422 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\rowset.c
shanehb2f20bf2011-06-17 07:07:24 +00001423
1424select.lo: $(TOP)\src\select.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001425 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\select.c
shanehb2f20bf2011-06-17 07:07:24 +00001426
1427status.lo: $(TOP)\src\status.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001428 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\status.c
shanehb2f20bf2011-06-17 07:07:24 +00001429
1430table.lo: $(TOP)\src\table.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001431 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\table.c
shanehb2f20bf2011-06-17 07:07:24 +00001432
drhf51446a2012-07-21 19:40:42 +00001433threads.lo: $(TOP)\src\threads.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001434 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\threads.c
drhf51446a2012-07-21 19:40:42 +00001435
shanehb2f20bf2011-06-17 07:07:24 +00001436tokenize.lo: $(TOP)\src\tokenize.c keywordhash.h $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001437 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\tokenize.c
shanehb2f20bf2011-06-17 07:07:24 +00001438
1439trigger.lo: $(TOP)\src\trigger.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001440 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\trigger.c
shanehb2f20bf2011-06-17 07:07:24 +00001441
1442update.lo: $(TOP)\src\update.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001443 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\update.c
shanehb2f20bf2011-06-17 07:07:24 +00001444
1445utf.lo: $(TOP)\src\utf.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001446 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\utf.c
shanehb2f20bf2011-06-17 07:07:24 +00001447
1448util.lo: $(TOP)\src\util.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001449 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\util.c
shanehb2f20bf2011-06-17 07:07:24 +00001450
1451vacuum.lo: $(TOP)\src\vacuum.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001452 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vacuum.c
shanehb2f20bf2011-06-17 07:07:24 +00001453
1454vdbe.lo: $(TOP)\src\vdbe.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001455 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbe.c
shanehb2f20bf2011-06-17 07:07:24 +00001456
1457vdbeapi.lo: $(TOP)\src\vdbeapi.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001458 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbeapi.c
shanehb2f20bf2011-06-17 07:07:24 +00001459
1460vdbeaux.lo: $(TOP)\src\vdbeaux.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001461 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbeaux.c
shanehb2f20bf2011-06-17 07:07:24 +00001462
1463vdbeblob.lo: $(TOP)\src\vdbeblob.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001464 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbeblob.c
shanehb2f20bf2011-06-17 07:07:24 +00001465
1466vdbemem.lo: $(TOP)\src\vdbemem.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001467 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbemem.c
shanehb2f20bf2011-06-17 07:07:24 +00001468
mistachkin81c428a2011-08-17 02:19:54 +00001469vdbesort.lo: $(TOP)\src\vdbesort.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001470 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbesort.c
mistachkin81c428a2011-08-17 02:19:54 +00001471
shanehb2f20bf2011-06-17 07:07:24 +00001472vdbetrace.lo: $(TOP)\src\vdbetrace.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001473 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbetrace.c
shanehb2f20bf2011-06-17 07:07:24 +00001474
1475vtab.lo: $(TOP)\src\vtab.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001476 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vtab.c
shanehb2f20bf2011-06-17 07:07:24 +00001477
1478wal.lo: $(TOP)\src\wal.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001479 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\wal.c
shanehb2f20bf2011-06-17 07:07:24 +00001480
1481walker.lo: $(TOP)\src\walker.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001482 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\walker.c
shanehb2f20bf2011-06-17 07:07:24 +00001483
1484where.lo: $(TOP)\src\where.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001485 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\where.c
shanehb2f20bf2011-06-17 07:07:24 +00001486
1487tclsqlite.lo: $(TOP)\src\tclsqlite.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001488 $(LTCOMPILE) $(NO_WARN) -DUSE_TCL_STUBS=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c
shanehb2f20bf2011-06-17 07:07:24 +00001489
1490tclsqlite-shell.lo: $(TOP)\src\tclsqlite.c $(HDR)
mistachkin44723ce2015-03-21 02:22:37 +00001491 $(LTCOMPILE) $(NO_WARN) -DTCLSH=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c
shanehb2f20bf2011-06-17 07:07:24 +00001492
mistachkin44723ce2015-03-21 02:22:37 +00001493tclsqlite3.exe: tclsqlite-shell.lo $(SQLITE3C) $(LIBRESOBJS)
1494 $(LTLINK) $(SQLITE3C) /link $(LTLINKOPTS) $(LTLIBPATHS) /OUT:$@ tclsqlite-shell.lo $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001495
1496# Rules to build opcodes.c and opcodes.h
1497#
1498opcodes.c: opcodes.h $(TOP)\mkopcodec.awk
drh307ff302011-08-30 01:29:04 +00001499 $(NAWK) -f $(TOP)\mkopcodec.awk opcodes.h > opcodes.c
shanehb2f20bf2011-06-17 07:07:24 +00001500
1501opcodes.h: parse.h $(TOP)\src\vdbe.c $(TOP)\mkopcodeh.awk
mistachkin5b0b6fd2011-06-25 01:14:36 +00001502 type parse.h $(TOP)\src\vdbe.c | $(NAWK) -f $(TOP)\mkopcodeh.awk > opcodes.h
shanehb2f20bf2011-06-17 07:07:24 +00001503
1504# Rules to build parse.c and parse.h - the outputs of lemon.
1505#
1506parse.h: parse.c
1507
1508parse.c: $(TOP)\src\parse.y lemon.exe $(TOP)\addopcodes.awk
mistachkin44723ce2015-03-21 02:22:37 +00001509 del /Q parse.y parse.h parse.h.temp 2>NUL
shanehb2f20bf2011-06-17 07:07:24 +00001510 copy $(TOP)\src\parse.y .
mistachkin4712c212014-05-09 20:51:17 +00001511 .\lemon.exe $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(OPTS) parse.y
shanehb2f20bf2011-06-17 07:07:24 +00001512 move parse.h parse.h.temp
mistachkin5b0b6fd2011-06-25 01:14:36 +00001513 $(NAWK) -f $(TOP)\addopcodes.awk parse.h.temp > parse.h
shanehb2f20bf2011-06-17 07:07:24 +00001514
1515sqlite3.h: $(TOP)\src\sqlite.h.in $(TOP)\manifest.uuid $(TOP)\VERSION
mistachkin3f40d402014-02-13 21:57:48 +00001516 $(TCLSH_CMD) $(TOP)\tool\mksqlite3h.tcl $(TOP:\=/) > sqlite3.h
shanehb2f20bf2011-06-17 07:07:24 +00001517
1518mkkeywordhash.exe: $(TOP)\tool\mkkeywordhash.c
mistachkin2318d332015-01-12 18:02:52 +00001519 $(BCC) $(NO_WARN) -Fe$@ $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(OPTS) \
1520 $(TOP)\tool\mkkeywordhash.c /link $(NLTLINKOPTS) $(NLTLIBPATHS)
shanehb2f20bf2011-06-17 07:07:24 +00001521
1522keywordhash.h: $(TOP)\tool\mkkeywordhash.c mkkeywordhash.exe
mistachkin5b0b6fd2011-06-25 01:14:36 +00001523 .\mkkeywordhash.exe > keywordhash.h
shanehb2f20bf2011-06-17 07:07:24 +00001524
1525
1526
1527# Rules to build the extension objects.
1528#
1529icu.lo: $(TOP)\ext\icu\icu.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001530 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\icu\icu.c
shanehb2f20bf2011-06-17 07:07:24 +00001531
1532fts2.lo: $(TOP)\ext\fts2\fts2.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001533 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2.c
shanehb2f20bf2011-06-17 07:07:24 +00001534
1535fts2_hash.lo: $(TOP)\ext\fts2\fts2_hash.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001536 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_hash.c
shanehb2f20bf2011-06-17 07:07:24 +00001537
1538fts2_icu.lo: $(TOP)\ext\fts2\fts2_icu.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001539 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_icu.c
shanehb2f20bf2011-06-17 07:07:24 +00001540
1541fts2_porter.lo: $(TOP)\ext\fts2\fts2_porter.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001542 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_porter.c
shanehb2f20bf2011-06-17 07:07:24 +00001543
1544fts2_tokenizer.lo: $(TOP)\ext\fts2\fts2_tokenizer.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001545 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_tokenizer.c
shanehb2f20bf2011-06-17 07:07:24 +00001546
1547fts2_tokenizer1.lo: $(TOP)\ext\fts2\fts2_tokenizer1.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001548 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_tokenizer1.c
shanehb2f20bf2011-06-17 07:07:24 +00001549
1550fts3.lo: $(TOP)\ext\fts3\fts3.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001551 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3.c
shanehb2f20bf2011-06-17 07:07:24 +00001552
1553fts3_aux.lo: $(TOP)\ext\fts3\fts3_aux.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001554 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_aux.c
shanehb2f20bf2011-06-17 07:07:24 +00001555
1556fts3_expr.lo: $(TOP)\ext\fts3\fts3_expr.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001557 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_expr.c
shanehb2f20bf2011-06-17 07:07:24 +00001558
1559fts3_hash.lo: $(TOP)\ext\fts3\fts3_hash.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001560 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_hash.c
shanehb2f20bf2011-06-17 07:07:24 +00001561
1562fts3_icu.lo: $(TOP)\ext\fts3\fts3_icu.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001563 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_icu.c
shanehb2f20bf2011-06-17 07:07:24 +00001564
1565fts3_snippet.lo: $(TOP)\ext\fts3\fts3_snippet.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001566 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_snippet.c
shanehb2f20bf2011-06-17 07:07:24 +00001567
1568fts3_porter.lo: $(TOP)\ext\fts3\fts3_porter.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001569 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_porter.c
shanehb2f20bf2011-06-17 07:07:24 +00001570
1571fts3_tokenizer.lo: $(TOP)\ext\fts3\fts3_tokenizer.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001572 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenizer.c
shanehb2f20bf2011-06-17 07:07:24 +00001573
1574fts3_tokenizer1.lo: $(TOP)\ext\fts3\fts3_tokenizer1.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001575 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenizer1.c
shanehb2f20bf2011-06-17 07:07:24 +00001576
drh4d648c72013-04-22 17:07:56 +00001577fts3_tokenize_vtab.lo: $(TOP)\ext\fts3\fts3_tokenize_vtab.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001578 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenize_vtab.c
drh4d648c72013-04-22 17:07:56 +00001579
drh391d4ba2012-05-28 20:22:16 +00001580fts3_unicode.lo: $(TOP)\ext\fts3\fts3_unicode.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001581 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_unicode.c
drh391d4ba2012-05-28 20:22:16 +00001582
1583fts3_unicode2.lo: $(TOP)\ext\fts3\fts3_unicode2.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001584 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_unicode2.c
drh391d4ba2012-05-28 20:22:16 +00001585
shanehb2f20bf2011-06-17 07:07:24 +00001586fts3_write.lo: $(TOP)\ext\fts3\fts3_write.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001587 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_write.c
shanehb2f20bf2011-06-17 07:07:24 +00001588
1589rtree.lo: $(TOP)\ext\rtree\rtree.c $(HDR) $(EXTHDR)
mistachkin44723ce2015-03-21 02:22:37 +00001590 $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\rtree\rtree.c
shanehb2f20bf2011-06-17 07:07:24 +00001591
mistachkin38b4daa2013-03-13 19:02:39 +00001592sqlite3session.lo: $(TOP)\ext\session\sqlite3sesion.c $(HDR) $(EXTHDR)
drh498dcae2013-03-13 11:42:00 +00001593 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\session\sqlite3session.c
1594
shanehb2f20bf2011-06-17 07:07:24 +00001595
1596# Rules to build the 'testfixture' application.
1597#
1598# If using the amalgamation, use sqlite3.c directly to build the test
1599# fixture. Otherwise link against libsqlite3.lib. (This distinction is
1600# necessary because the test fixture requires non-API symbols which are
1601# hidden when the library is built via the amalgamation).
1602#
1603TESTFIXTURE_FLAGS = -DTCLSH=1 -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
mistachkin27b2f052015-01-12 19:49:46 +00001604TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_SERVER=1 -DSQLITE_PRIVATE=""
1605TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_CORE $(NO_WARN)
shanehb2f20bf2011-06-17 07:07:24 +00001606
mistachkin44723ce2015-03-21 02:22:37 +00001607TESTFIXTURE_SRC0 = $(TESTEXT) $(TESTSRC2) $(SHELL_CORE_DEP)
drh9327c702013-10-15 14:10:44 +00001608TESTFIXTURE_SRC1 = $(TESTEXT) $(TESTSRC3) $(SQLITE3C)
shanehb2f20bf2011-06-17 07:07:24 +00001609!IF $(USE_AMALGAMATION)==0
1610TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC0)
1611!ELSE
1612TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC1)
1613!ENDIF
1614
mistachkin08c1c312012-10-06 03:48:25 +00001615testfixture.exe: $(TESTFIXTURE_SRC) $(LIBRESOBJS) $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001616 $(LTLINK) -DSQLITE_NO_SYNC=1 $(TESTFIXTURE_FLAGS) \
shanehb2f20bf2011-06-17 07:07:24 +00001617 -DBUILD_sqlite -I$(TCLINCDIR) \
shaneh2a0b9ef2011-06-20 20:52:32 +00001618 $(TESTFIXTURE_SRC) \
mistachkin08c1c312012-10-06 03:48:25 +00001619 /link $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001620
mistachkin1925a2e2014-02-24 21:20:25 +00001621extensiontest: testfixture.exe testloadext.dll
1622 .\testfixture.exe $(TOP)\test\loadext.test
mistachkin1925a2e2014-02-24 21:20:25 +00001623
shanehb2f20bf2011-06-17 07:07:24 +00001624fulltest: testfixture.exe sqlite3.exe
1625 .\testfixture.exe $(TOP)\test\all.test
1626
1627soaktest: testfixture.exe sqlite3.exe
1628 .\testfixture.exe $(TOP)\test\all.test -soak=1
1629
mistachkinc60941f2012-09-13 01:51:02 +00001630fulltestonly: testfixture.exe sqlite3.exe
1631 .\testfixture.exe $(TOP)\test\full.test
1632
mistachkin036acf32013-07-20 00:34:31 +00001633queryplantest: testfixture.exe sqlite3.exe
1634 .\testfixture.exe $(TOP)\test\permutations.test queryplanner
1635
shanehb2f20bf2011-06-17 07:07:24 +00001636test: testfixture.exe sqlite3.exe
1637 .\testfixture.exe $(TOP)\test\veryquick.test
1638
mistachkin76510912013-10-11 23:01:18 +00001639sqlite3_analyzer.c: $(SQLITE3C) $(TOP)\src\test_stat.c $(TOP)\src\tclsqlite.c $(TOP)\tool\spaceanal.tcl
1640 copy $(SQLITE3C) + $(TOP)\src\test_stat.c + $(TOP)\src\tclsqlite.c $@
mistachkin9a55e312011-09-22 00:06:44 +00001641 echo static const char *tclsh_main_loop(void){ >> $@
1642 echo static const char *zMainloop = >> $@
1643 $(NAWK) -f $(TOP)\tool\tostr.awk $(TOP)\tool\spaceanal.tcl >> $@
1644 echo ; return zMainloop; } >> $@
shanehb2f20bf2011-06-17 07:07:24 +00001645
mistachkin08c1c312012-10-06 03:48:25 +00001646sqlite3_analyzer.exe: sqlite3_analyzer.c $(LIBRESOBJS)
mistachkin44723ce2015-03-21 02:22:37 +00001647 $(LTLINK) $(NO_WARN) -DBUILD_sqlite -DTCLSH=2 -I$(TCLINCDIR) sqlite3_analyzer.c \
mistachkin08c1c312012-10-06 03:48:25 +00001648 /link $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001649
mistachkin1925a2e2014-02-24 21:20:25 +00001650testloadext.lo: $(TOP)\src\test_loadext.c
mistachkin44723ce2015-03-21 02:22:37 +00001651 $(LTCOMPILE) $(NO_WARN) -c $(TOP)\src\test_loadext.c
mistachkin1925a2e2014-02-24 21:20:25 +00001652
1653testloadext.dll: testloadext.lo
1654 $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /OUT:$@ testloadext.lo
1655
mistachkinb0427512014-01-30 11:12:52 +00001656showdb.exe: $(TOP)\tool\showdb.c $(SQLITE3C)
mistachkin44723ce2015-03-21 02:22:37 +00001657 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
mistachkinb0427512014-01-30 11:12:52 +00001658 $(TOP)\tool\showdb.c $(SQLITE3C)
drh9ac3c1e2013-11-07 18:37:31 +00001659
drh4bb77ec2014-06-30 11:14:26 +00001660showstat4.exe: $(TOP)\tool\showstat4.c $(SQLITE3C)
mistachkin44723ce2015-03-21 02:22:37 +00001661 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
drh4bb77ec2014-06-30 11:14:26 +00001662 $(TOP)\tool\showstat4.c $(SQLITE3C)
1663
1664showjournal.exe: $(TOP)\tool\showjournal.c $(SQLITE3C)
mistachkin44723ce2015-03-21 02:22:37 +00001665 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
drh4bb77ec2014-06-30 11:14:26 +00001666 $(TOP)\tool\showjournal.c $(SQLITE3C)
1667
1668showwal.exe: $(TOP)\tool\showwal.c $(SQLITE3C)
mistachkin44723ce2015-03-21 02:22:37 +00001669 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
drh4bb77ec2014-06-30 11:14:26 +00001670 $(TOP)\tool\showwal.c $(SQLITE3C)
1671
drh9f674f22014-08-18 20:23:29 +00001672changeset.exe: $(TOP)\ext\session\changeset.c $(SQLITE3C)
1673 $(LTLINK) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
1674 $(TOP)\ext\session\changeset.c $(SQLITE3C)
1675
mistachkinde545272014-07-07 17:57:50 +00001676fts3view.exe: $(TOP)\ext\fts3\tool\fts3view.c $(SQLITE3C)
mistachkin44723ce2015-03-21 02:22:37 +00001677 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
mistachkinde545272014-07-07 17:57:50 +00001678 $(TOP)\ext\fts3\tool\fts3view.c $(SQLITE3C)
1679
drh4bb77ec2014-06-30 11:14:26 +00001680rollback-test.exe: $(TOP)\tool\rollback-test.c $(SQLITE3C)
mistachkin44723ce2015-03-21 02:22:37 +00001681 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
drh4bb77ec2014-06-30 11:14:26 +00001682 $(TOP)\tool\rollback-test.c $(SQLITE3C)
1683
drh267a13f2014-06-18 18:10:12 +00001684LogEst.exe: $(TOP)\tool\logest.c sqlite3.h
mistachkin44723ce2015-03-21 02:22:37 +00001685 $(LTLINK) $(NO_WARN) -Fe$@ $(TOP)\tool\LogEst.c
drh267a13f2014-06-18 18:10:12 +00001686
mistachkinb0427512014-01-30 11:12:52 +00001687wordcount.exe: $(TOP)\test\wordcount.c $(SQLITE3C)
mistachkin44723ce2015-03-21 02:22:37 +00001688 $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
mistachkinb0427512014-01-30 11:12:52 +00001689 $(TOP)\test\wordcount.c $(SQLITE3C)
drh9ac3c1e2013-11-07 18:37:31 +00001690
mistachkinb0427512014-01-30 11:12:52 +00001691speedtest1.exe: $(TOP)\test\speedtest1.c $(SQLITE3C)
mistachkin44723ce2015-03-21 02:22:37 +00001692 $(LTLINK) $(NO_WARN) -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
mistachkinb0427512014-01-30 11:12:52 +00001693 $(TOP)\test\speedtest1.c $(SQLITE3C)
mistachkinb482a442012-02-11 22:19:26 +00001694
shaneh6e7850c2011-06-17 15:57:07 +00001695clean:
mistachkin44723ce2015-03-21 02:22:37 +00001696 del /Q *.exp *.lo *.ilk *.lib *.obj *.pdb 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00001697 del /Q *.cod *.da *.bb *.bbg gmon.out 2>NUL
1698 del /Q sqlite3.h opcodes.c opcodes.h 2>NUL
1699 del /Q lemon.* lempar.c parse.* 2>NUL
1700 del /Q mkkeywordhash.* keywordhash.h 2>NUL
1701 del /Q notasharedlib.* 2>NUL
1702 -rmdir /Q/S .deps 2>NUL
1703 -rmdir /Q/S .libs 2>NUL
1704 -rmdir /Q/S quota2a 2>NUL
1705 -rmdir /Q/S quota2b 2>NUL
1706 -rmdir /Q/S quota2c 2>NUL
1707 -rmdir /Q/S tsrc 2>NUL
1708 del /Q .target_source 2>NUL
mistachkin44723ce2015-03-21 02:22:37 +00001709 del /Q tclsqlite3.exe 2>NUL
1710 del /Q testloadext.dll 2>NUL
1711 del /Q testfixture.exe test.db 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00001712 del /Q LogEst.exe fts3view.exe rollback-test.exe showdb.exe 2>NUL
drhedea9112015-03-24 19:02:13 +00001713 del /Q changeset.exe 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00001714 del /Q showjournal.exe showstat4.exe showwal.exe speedtest1.exe 2>NUL
mistachkin44723ce2015-03-21 02:22:37 +00001715 del /Q mptester.exe wordcount.exe 2>NUL
1716 del /Q sqlite3.exe sqlite3.dll sqlite3.def 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00001717 del /Q sqlite3.c sqlite3-*.c 2>NUL
1718 del /Q sqlite3rc.h 2>NUL
1719 del /Q shell.c sqlite3ext.h 2>NUL
mistachkin44723ce2015-03-21 02:22:37 +00001720 del /Q sqlite3_analyzer.exe sqlite3_analyzer.c 2>NUL
mistachkin8d8738e2015-02-25 01:06:08 +00001721 del /Q sqlite-*-output.vsix 2>NUL
shanehb2f20bf2011-06-17 07:07:24 +00001722
mistachkin4d9d1f42012-09-03 10:32:32 +00001723# Dynamic link library section.
shanehb2f20bf2011-06-17 07:07:24 +00001724#
1725dll: sqlite3.dll
1726
shaneh6e7850c2011-06-17 15:57:07 +00001727sqlite3.def: libsqlite3.lib
mistachkin5b0b6fd2011-06-25 01:14:36 +00001728 echo EXPORTS > sqlite3.def
shaneh6e7850c2011-06-17 15:57:07 +00001729 dumpbin /all libsqlite3.lib \
mistachkin6a3eb4a2011-08-17 07:46:48 +00001730 | $(NAWK) "/ 1 _?sqlite3_/ { sub(/^.* _?/,\"\");print }" \
mistachkin5b0b6fd2011-06-25 01:14:36 +00001731 | sort >> sqlite3.def
shanehb2f20bf2011-06-17 07:07:24 +00001732
mistachkin44723ce2015-03-21 02:22:37 +00001733sqlite3.dll: $(LIBOBJ) $(LIBRESOBJS) $(CORE_LINK_DEP)
1734 $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL $(CORE_LINK_OPTS) /OUT:$@ $(LIBOBJ) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)