blob: 58d370fcde30d14a1d68b4d6c4b960f26fc4da22 [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
25# If necessary, create a list of harmless compiler warnings to disable when
26# compiling the build tools. For the SQLite source code itself, warnings,
27# if any, will be disabled from within it.
28#
29!IFNDEF NO_WARN
30!IF $(USE_FULLWARN)!=0
mistachkin27b2f052015-01-12 19:49:46 +000031NO_WARN = -wd4054 -wd4055 -wd4100 -wd4127 -wd4152 -wd4189 -wd4206 -wd4210
mistachkin32562502015-01-12 20:20:26 +000032NO_WARN = $(NO_WARN) -wd4232 -wd4244 -wd4305 -wd4306 -wd4702 -wd4706
mistachkin2318d332015-01-12 18:02:52 +000033!ENDIF
34!ENDIF
35
mistachkina5e2b502014-05-12 22:36:50 +000036# Set this non-0 to use the library paths and other options necessary for
37# Windows Phone 8.1.
mistachkind9b3c542014-05-09 23:31:55 +000038#
39!IFNDEF USE_WP81_OPTS
40USE_WP81_OPTS = 0
41!ENDIF
42
mistachkin76510912013-10-11 23:01:18 +000043# Set this non-0 to split the SQLite amalgamation file into chunks to
44# be used for debugging with Visual Studio.
45#
46!IFNDEF SPLIT_AMALGAMATION
mistachkin0aedc6b2013-10-11 23:02:13 +000047SPLIT_AMALGAMATION = 0
mistachkin76510912013-10-11 23:01:18 +000048!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +000049
mistachkinc756ded2011-10-02 05:23:16 +000050# Set this non-0 to use the International Components for Unicode (ICU).
51#
mistachkin0ec07442012-10-12 18:06:07 +000052!IFNDEF USE_ICU
mistachkinc756ded2011-10-02 05:23:16 +000053USE_ICU = 0
mistachkin0ec07442012-10-12 18:06:07 +000054!ENDIF
mistachkinc756ded2011-10-02 05:23:16 +000055
mistachkin8d967a92012-06-21 04:21:35 +000056# Set this non-0 to dynamically link to the MSVC runtime library.
57#
mistachkin0ec07442012-10-12 18:06:07 +000058!IFNDEF USE_CRT_DLL
mistachkin8d967a92012-06-21 04:21:35 +000059USE_CRT_DLL = 0
mistachkin0ec07442012-10-12 18:06:07 +000060!ENDIF
mistachkin8d967a92012-06-21 04:21:35 +000061
mistachkine45e0fb2015-01-21 00:48:46 +000062# Set this non-0 to link to the RPCRT4 library.
63#
64!IFNDEF USE_RPCRT4_LIB
65USE_RPCRT4_LIB = 0
66!ENDIF
67
mistachkin0157e012013-09-06 21:41:11 +000068# Set this non-0 to generate assembly code listings for the source code
69# files.
70#
71!IFNDEF USE_LISTINGS
72USE_LISTINGS = 0
73!ENDIF
74
mistachkin52fd8e12012-08-28 01:44:13 +000075# Set this non-0 to attempt setting the native compiler automatically
76# for cross-compiling the command line tools needed during the compilation
77# process.
78#
mistachkin0ec07442012-10-12 18:06:07 +000079!IFNDEF XCOMPILE
mistachkin52fd8e12012-08-28 01:44:13 +000080XCOMPILE = 0
mistachkin0ec07442012-10-12 18:06:07 +000081!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +000082
mistachkinbd58d5f2012-06-30 22:22:34 +000083# Set this non-0 to use the native libraries paths for cross-compiling
84# the command line tools needed during the compilation process.
85#
mistachkin0ec07442012-10-12 18:06:07 +000086!IFNDEF USE_NATIVE_LIBPATHS
mistachkinbd58d5f2012-06-30 22:22:34 +000087USE_NATIVE_LIBPATHS = 0
mistachkin0ec07442012-10-12 18:06:07 +000088!ENDIF
mistachkinbd58d5f2012-06-30 22:22:34 +000089
mistachkin08c1c312012-10-06 03:48:25 +000090# Set this 0 to skip the compiling and embedding of version resources.
91#
mistachkin0ec07442012-10-12 18:06:07 +000092!IFNDEF USE_RC
mistachkin08c1c312012-10-06 03:48:25 +000093USE_RC = 1
mistachkin0ec07442012-10-12 18:06:07 +000094!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +000095
mistachkin46b721a2012-03-23 12:28:21 +000096# Set this non-0 to compile binaries suitable for the WinRT environment.
97# This setting does not apply to any binaries that require Tcl to operate
98# properly (i.e. the text fixture, etc).
99#
mistachkin0ec07442012-10-12 18:06:07 +0000100!IFNDEF FOR_WINRT
mistachkin46b721a2012-03-23 12:28:21 +0000101FOR_WINRT = 0
mistachkin0ec07442012-10-12 18:06:07 +0000102!ENDIF
mistachkin46b721a2012-03-23 12:28:21 +0000103
mistachkin31856a32012-07-27 07:13:25 +0000104# Set this non-0 to skip attempting to look for and/or link with the Tcl
105# runtime library.
106#
mistachkin0ec07442012-10-12 18:06:07 +0000107!IFNDEF NO_TCL
mistachkin31856a32012-07-27 07:13:25 +0000108NO_TCL = 0
mistachkin0ec07442012-10-12 18:06:07 +0000109!ENDIF
mistachkin31856a32012-07-27 07:13:25 +0000110
mistachkin4d60be52011-08-26 05:40:31 +0000111# Set this to non-0 to create and use PDBs.
112#
mistachkin0ec07442012-10-12 18:06:07 +0000113!IFNDEF SYMBOLS
mistachkin4d60be52011-08-26 05:40:31 +0000114SYMBOLS = 1
mistachkin0ec07442012-10-12 18:06:07 +0000115!ENDIF
mistachkin4d60be52011-08-26 05:40:31 +0000116
mistachkin2f7d5d82012-08-22 00:39:34 +0000117# Set this to non-0 to use the SQLite debugging heap subsystem.
118#
mistachkin0ec07442012-10-12 18:06:07 +0000119!IFNDEF MEMDEBUG
mistachkin2f7d5d82012-08-22 00:39:34 +0000120MEMDEBUG = 0
mistachkin0ec07442012-10-12 18:06:07 +0000121!ENDIF
mistachkin2f7d5d82012-08-22 00:39:34 +0000122
123# Set this to non-0 to use the Win32 native heap subsystem.
124#
mistachkin0ec07442012-10-12 18:06:07 +0000125!IFNDEF WIN32HEAP
mistachkin2f7d5d82012-08-22 00:39:34 +0000126WIN32HEAP = 0
mistachkin0ec07442012-10-12 18:06:07 +0000127!ENDIF
mistachkinf2d25f22011-08-25 04:09:12 +0000128
129# Set this to one of the following values to enable various debugging
130# features. Each level includes the debugging options from the previous
131# levels. Currently, the recognized values for DEBUG are:
132#
133# 0 == NDEBUG: Disables assert() and other runtime diagnostics.
mistachkincd54bab2014-12-20 21:14:14 +0000134# 1 == SQLITE_ENABLE_API_ARMOR: extra attempts to detect misuse of the API.
135# 2 == Disables NDEBUG and all optimizations and then enables PDBs.
136# 3 == SQLITE_DEBUG: Enables various diagnostics messages and code.
137# 4 == SQLITE_WIN32_MALLOC_VALIDATE: Validate the Win32 native heap per call.
138# 5 == SQLITE_DEBUG_OS_TRACE: Enables output from the OSTRACE() macros.
139# 6 == SQLITE_ENABLE_IOTRACE: Enables output from the IOTRACE() macros.
mistachkinf2d25f22011-08-25 04:09:12 +0000140#
mistachkin0ec07442012-10-12 18:06:07 +0000141!IFNDEF DEBUG
mistachkinf2d25f22011-08-25 04:09:12 +0000142DEBUG = 0
mistachkin0ec07442012-10-12 18:06:07 +0000143!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000144
mistachkin8bcd3fa2013-08-29 01:03:38 +0000145# Enable use of available compiler optimizations? Normally, this should be
146# non-zero. Setting this to zero, thus disabling all compiler optimizations,
147# can be useful for testing.
148#
149!IFNDEF OPTIMIZATIONS
150OPTIMIZATIONS = 2
151!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000152
mistachkin4712c212014-05-09 20:51:17 +0000153# These are the "standard" SQLite compilation options used when compiling for
154# the Windows platform.
155#
156!IFNDEF OPT_FEATURE_FLAGS
157OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS3=1
158OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RTREE=1
159OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_COLUMN_METADATA=1
160!ENDIF
161
162###############################################################################
163############################### END OF OPTIONS ################################
164###############################################################################
165
mistachkind9b3c542014-05-09 23:31:55 +0000166# This assumes that MSVC is always installed in 32-bit Program Files directory
167# and sets the variable for use in locating other 32-bit installs accordingly.
168#
169PROGRAMFILES_X86 = $(VCINSTALLDIR)\..\..
170PROGRAMFILES_X86 = $(PROGRAMFILES_X86:\\=\)
171
mistachkine37f99c2012-06-30 16:22:05 +0000172# Check for the predefined command macro CC. This should point to the compiler
mistachkinbd58d5f2012-06-30 22:22:34 +0000173# binary for the target platform. If it is not defined, simply define it to
mistachkine37f99c2012-06-30 16:22:05 +0000174# the legacy default value 'cl.exe'.
175#
176!IFNDEF CC
177CC = cl.exe
178!ENDIF
179
mistachkin228aeff2012-06-30 19:24:09 +0000180# Check for the command macro LD. This should point to the linker binary for
mistachkinbd58d5f2012-06-30 22:22:34 +0000181# the target platform. If it is not defined, simply define it to the legacy
mistachkin228aeff2012-06-30 19:24:09 +0000182# default value 'link.exe'.
183#
184!IFNDEF LD
185LD = link.exe
186!ENDIF
187
mistachkin4d9d1f42012-09-03 10:32:32 +0000188# Check for the predefined command macro RC. This should point to the resource
189# compiler binary for the target platform. If it is not defined, simply define
190# it to the legacy default value 'rc.exe'.
191#
192!IFNDEF RC
193RC = rc.exe
194!ENDIF
195
mistachkin4712c212014-05-09 20:51:17 +0000196# Check for the MSVC runtime library path macro. Othertise, this value will
197# default to the 'lib' directory underneath the MSVC installation directory.
198#
199!IFNDEF CRTLIBPATH
200CRTLIBPATH = $(VCINSTALLDIR)\lib
201!ENDIF
202
203CRTLIBPATH = $(CRTLIBPATH:\\=\)
204
mistachkine37f99c2012-06-30 16:22:05 +0000205# Check for the command macro NCC. This should point to the compiler binary
mistachkinbd58d5f2012-06-30 22:22:34 +0000206# for the platform the compilation process is taking place on. If it is not
207# defined, simply define it to have the same value as the CC macro. When
mistachkine37f99c2012-06-30 16:22:05 +0000208# cross-compiling, it is suggested that this macro be modified via the command
209# line (since nmake itself does not provide a built-in method to guess it).
210# For example, to use the x86 compiler when cross-compiling for x64, a command
mistachkinbd58d5f2012-06-30 22:22:34 +0000211# line similar to the following could be used (all on one line):
mistachkine37f99c2012-06-30 16:22:05 +0000212#
mistachkin6f928332012-08-17 11:47:32 +0000213# nmake /f Makefile.msc sqlite3.dll
mistachkin52fd8e12012-08-28 01:44:13 +0000214# XCOMPILE=1 USE_NATIVE_LIBPATHS=1
215#
216# Alternatively, the full path and file name to the compiler binary for the
217# platform the compilation process is taking place may be specified (all on
218# one line):
219#
220# nmake /f Makefile.msc sqlite3.dll
mistachkinbd58d5f2012-06-30 22:22:34 +0000221# "NCC=""%VCINSTALLDIR%\bin\cl.exe"""
222# USE_NATIVE_LIBPATHS=1
mistachkine37f99c2012-06-30 16:22:05 +0000223#
mistachkinfd0ba2a2012-07-27 08:21:45 +0000224!IFDEF NCC
225NCC = $(NCC:\\=\)
mistachkin52fd8e12012-08-28 01:44:13 +0000226!ELSEIF $(XCOMPILE)!=0
mistachkin5fac4202013-12-03 23:33:29 +0000227NCC = "$(VCINSTALLDIR)\bin\$(CC)"
mistachkin52fd8e12012-08-28 01:44:13 +0000228NCC = $(NCC:\\=\)
mistachkinfd0ba2a2012-07-27 08:21:45 +0000229!ELSE
mistachkine37f99c2012-06-30 16:22:05 +0000230NCC = $(CC)
231!ENDIF
232
mistachkin4712c212014-05-09 20:51:17 +0000233# Check for the MSVC native runtime library path macro. Othertise,
234# this value will default to the 'lib' directory underneath the MSVC
mistachkinbd58d5f2012-06-30 22:22:34 +0000235# installation directory.
236#
237!IFNDEF NCRTLIBPATH
238NCRTLIBPATH = $(VCINSTALLDIR)\lib
239!ENDIF
240
mistachkin0b5ae722012-07-27 23:03:47 +0000241NCRTLIBPATH = $(NCRTLIBPATH:\\=\)
242
mistachkinbd58d5f2012-06-30 22:22:34 +0000243# Check for the Platform SDK library path macro. Othertise, this
244# value will default to the 'lib' directory underneath the Windows
245# SDK installation directory (the environment variable used appears
246# to be available when using Visual C++ 2008 or later via the
247# command line).
248#
249!IFNDEF NSDKLIBPATH
250NSDKLIBPATH = $(WINDOWSSDKDIR)\lib
251!ENDIF
252
mistachkin0b5ae722012-07-27 23:03:47 +0000253NSDKLIBPATH = $(NSDKLIBPATH:\\=\)
254
mistachkinbd58d5f2012-06-30 22:22:34 +0000255# C compiler and options for use in building executables that
shanehb2f20bf2011-06-17 07:07:24 +0000256# will run on the platform that is doing the build.
257#
mistachkin2318d332015-01-12 18:02:52 +0000258!IF $(USE_FULLWARN)!=0
259BCC = $(NCC) -W4
260!ELSE
mistachkine37f99c2012-06-30 16:22:05 +0000261BCC = $(NCC) -W3
mistachkin2318d332015-01-12 18:02:52 +0000262!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000263
mistachkin0157e012013-09-06 21:41:11 +0000264# Check if assembly code listings should be generated for the source
265# code files to be compiled.
266#
267!IF $(USE_LISTINGS)!=0
268BCC = $(BCC) -FAcs
269!ENDIF
270
mistachkinbd58d5f2012-06-30 22:22:34 +0000271# Check if the native library paths should be used when compiling
272# the command line tools used during the compilation process. If
273# so, set the necessary macro now.
274#
275!IF $(USE_NATIVE_LIBPATHS)!=0
276NLTLIBPATHS = "/LIBPATH:$(NCRTLIBPATH)" "/LIBPATH:$(NSDKLIBPATH)"
277!ENDIF
278
279# C compiler and options for use in building executables that
shanehb2f20bf2011-06-17 07:07:24 +0000280# will run on the target platform. (BCC and TCC are usually the
281# same unless your are cross-compiling.)
282#
mistachkin2318d332015-01-12 18:02:52 +0000283!IF $(USE_FULLWARN)!=0
mistachkin27b2f052015-01-12 19:49:46 +0000284TCC = $(CC) -W4 -DINCLUDE_MSVC_H=1
mistachkin2318d332015-01-12 18:02:52 +0000285!ELSE
286TCC = $(CC) -W3
287!ENDIF
288
289TCC = $(TCC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) -I$(TOP)\src -fp:precise
mistachkin8ccc6d42012-09-27 21:03:53 +0000290RCC = $(RC) -DSQLITE_OS_WIN=1 -I$(TOP) -I$(TOP)\src
shaneh6e7850c2011-06-17 15:57:07 +0000291
mistachkin0157e012013-09-06 21:41:11 +0000292# Check if assembly code listings should be generated for the source
293# code files to be compiled.
294#
295!IF $(USE_LISTINGS)!=0
296TCC = $(TCC) -FAcs
297!ENDIF
shaneh6e7850c2011-06-17 15:57:07 +0000298
mistachkinf39eaf22012-03-20 02:18:42 +0000299# When compiling the library for use in the WinRT environment,
mistachkin46b721a2012-03-23 12:28:21 +0000300# the following compile-time options must be used as well to
mistachkinf39eaf22012-03-20 02:18:42 +0000301# disable use of Win32 APIs that are not available and to enable
302# use of Win32 APIs that are specific to Windows 8 and/or WinRT.
303#
mistachkin46b721a2012-03-23 12:28:21 +0000304!IF $(FOR_WINRT)!=0
mistachkin8d967a92012-06-21 04:21:35 +0000305TCC = $(TCC) -DSQLITE_OS_WINRT=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000306RCC = $(RCC) -DSQLITE_OS_WINRT=1
mistachkin08c1c312012-10-06 03:48:25 +0000307TCC = $(TCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
308RCC = $(RCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
mistachkin8d967a92012-06-21 04:21:35 +0000309!ENDIF
310
311# Also, we need to dynamically link to the correct MSVC runtime
312# when compiling for WinRT (e.g. debug or release) OR if the
313# USE_CRT_DLL option is set to force dynamically linking to the
314# MSVC runtime library.
315#
316!IF $(FOR_WINRT)!=0 || $(USE_CRT_DLL)!=0
mistachkincd54bab2014-12-20 21:14:14 +0000317!IF $(DEBUG)>1
mistachkin8d967a92012-06-21 04:21:35 +0000318TCC = $(TCC) -MDd
mistachkin08c1c312012-10-06 03:48:25 +0000319BCC = $(BCC) -MDd
mistachkin8d967a92012-06-21 04:21:35 +0000320!ELSE
321TCC = $(TCC) -MD
mistachkin08c1c312012-10-06 03:48:25 +0000322BCC = $(BCC) -MD
mistachkin8d967a92012-06-21 04:21:35 +0000323!ENDIF
324!ELSE
mistachkincd54bab2014-12-20 21:14:14 +0000325!IF $(DEBUG)>1
mistachkin8d967a92012-06-21 04:21:35 +0000326TCC = $(TCC) -MTd
mistachkin08c1c312012-10-06 03:48:25 +0000327BCC = $(BCC) -MTd
mistachkin8d967a92012-06-21 04:21:35 +0000328!ELSE
329TCC = $(TCC) -MT
mistachkin08c1c312012-10-06 03:48:25 +0000330BCC = $(BCC) -MT
mistachkin8d967a92012-06-21 04:21:35 +0000331!ENDIF
mistachkin46b721a2012-03-23 12:28:21 +0000332!ENDIF
mistachkinf39eaf22012-03-20 02:18:42 +0000333
334# The mksqlite3c.tcl and mksqlite3h.tcl scripts will pull in
shaneh6e7850c2011-06-17 15:57:07 +0000335# any extension header files by default. For non-amalgamation
336# builds, we need to make sure the compiler can find these.
337#
338!IF $(USE_AMALGAMATION)==0
339TCC = $(TCC) -I$(TOP)\ext\fts3
mistachkin4d9d1f42012-09-03 10:32:32 +0000340RCC = $(RCC) -I$(TOP)\ext\fts3
shaneh6e7850c2011-06-17 15:57:07 +0000341TCC = $(TCC) -I$(TOP)\ext\rtree
mistachkin4d9d1f42012-09-03 10:32:32 +0000342RCC = $(RCC) -I$(TOP)\ext\rtree
shaneh6e7850c2011-06-17 15:57:07 +0000343!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000344
mistachkinb0427512014-01-30 11:12:52 +0000345# The mksqlite3c.tcl script accepts some options on the command
346# line. When compiling with debugging enabled, some of these
347# options are necessary in order to allow debugging symbols to
348# work correctly with Visual Studio when using the amalgamation.
349#
mistachkincd54bab2014-12-20 21:14:14 +0000350!IF $(DEBUG)>1
mistachkinb0427512014-01-30 11:12:52 +0000351MKSQLITE3C_ARGS = --linemacros
352!ELSE
353MKSQLITE3C_ARGS =
shanehb2f20bf2011-06-17 07:07:24 +0000354!ENDIF
355
356# Define -DNDEBUG to compile without debugging (i.e., for production usage)
357# Omitting the define will cause extra debugging code to be inserted and
358# includes extra comments when "EXPLAIN stmt" is used.
359#
mistachkin753c5442011-08-25 02:02:25 +0000360!IF $(DEBUG)==0
shanehb2f20bf2011-06-17 07:07:24 +0000361TCC = $(TCC) -DNDEBUG
mistachkinfec360a2012-04-18 10:29:21 +0000362BCC = $(BCC) -DNDEBUG
mistachkin4d9d1f42012-09-03 10:32:32 +0000363RCC = $(RCC) -DNDEBUG
mistachkin753c5442011-08-25 02:02:25 +0000364!ENDIF
365
mistachkincd54bab2014-12-20 21:14:14 +0000366!IF $(DEBUG)>0
367TCC = $(TCC) -DSQLITE_ENABLE_API_ARMOR
368RCC = $(RCC) -DSQLITE_ENABLE_API_ARMOR
369!ENDIF
370
371!IF $(DEBUG)>2
mistachkin753c5442011-08-25 02:02:25 +0000372TCC = $(TCC) -DSQLITE_DEBUG
mistachkin4d9d1f42012-09-03 10:32:32 +0000373RCC = $(RCC) -DSQLITE_DEBUG
mistachkin753c5442011-08-25 02:02:25 +0000374!ENDIF
375
mistachkincd54bab2014-12-20 21:14:14 +0000376!IF $(DEBUG)>4
mistachkin753c5442011-08-25 02:02:25 +0000377TCC = $(TCC) -DSQLITE_DEBUG_OS_TRACE=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000378RCC = $(RCC) -DSQLITE_DEBUG_OS_TRACE=1
mistachkin753c5442011-08-25 02:02:25 +0000379!ENDIF
380
mistachkincd54bab2014-12-20 21:14:14 +0000381!IF $(DEBUG)>5
mistachkin753c5442011-08-25 02:02:25 +0000382TCC = $(TCC) -DSQLITE_ENABLE_IOTRACE
mistachkin4d9d1f42012-09-03 10:32:32 +0000383RCC = $(RCC) -DSQLITE_ENABLE_IOTRACE
mistachkin753c5442011-08-25 02:02:25 +0000384!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000385
mistachkinbd58d5f2012-06-30 22:22:34 +0000386# Prevent warnings about "insecure" MSVC runtime library functions
387# being used.
mistachkin176f1b42011-08-02 23:34:00 +0000388#
389TCC = $(TCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
mistachkinfec360a2012-04-18 10:29:21 +0000390BCC = $(BCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
mistachkin4d9d1f42012-09-03 10:32:32 +0000391RCC = $(RCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
mistachkin176f1b42011-08-02 23:34:00 +0000392
mistachkinbd58d5f2012-06-30 22:22:34 +0000393# Prevent warnings about "deprecated" POSIX functions being used.
394#
395TCC = $(TCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
396BCC = $(BCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
mistachkin4d9d1f42012-09-03 10:32:32 +0000397RCC = $(RCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
mistachkinbd58d5f2012-06-30 22:22:34 +0000398
mistachkin2f7d5d82012-08-22 00:39:34 +0000399# Use the SQLite debugging heap subsystem?
mistachkin1b186a92011-08-24 16:13:57 +0000400#
mistachkin2f7d5d82012-08-22 00:39:34 +0000401!IF $(MEMDEBUG)!=0
402TCC = $(TCC) -DSQLITE_MEMDEBUG=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000403RCC = $(RCC) -DSQLITE_MEMDEBUG=1
mistachkin2f7d5d82012-08-22 00:39:34 +0000404
mistachkin2f7d5d82012-08-22 00:39:34 +0000405# Use native Win32 heap subsystem instead of malloc/free?
406#
407!ELSEIF $(WIN32HEAP)!=0
408TCC = $(TCC) -DSQLITE_WIN32_MALLOC=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000409RCC = $(RCC) -DSQLITE_WIN32_MALLOC=1
mistachkin753c5442011-08-25 02:02:25 +0000410
mistachkin753c5442011-08-25 02:02:25 +0000411# Validate the heap on every call into the native Win32 heap subsystem?
412#
mistachkincd54bab2014-12-20 21:14:14 +0000413!IF $(DEBUG)>3
mistachkin753c5442011-08-25 02:02:25 +0000414TCC = $(TCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000415RCC = $(RCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1
mistachkin753c5442011-08-25 02:02:25 +0000416!ENDIF
mistachkin468690e2011-08-24 17:42:22 +0000417!ENDIF
mistachkin1b186a92011-08-24 16:13:57 +0000418
mistachkin5b0b6fd2011-06-25 01:14:36 +0000419# The locations of the Tcl header and library files. Also, the library that
420# non-stubs enabled programs using Tcl must link against. These variables
421# (TCLINCDIR, TCLLIBDIR, and LIBTCL) may be overridden via the environment
422# prior to running nmake in order to match the actual installed location and
423# version on this machine.
shanehb2f20bf2011-06-17 07:07:24 +0000424#
mistachkine37f99c2012-06-30 16:22:05 +0000425!IFNDEF TCLINCDIR
shanehb2f20bf2011-06-17 07:07:24 +0000426TCLINCDIR = c:\tcl\include
mistachkine37f99c2012-06-30 16:22:05 +0000427!ENDIF
mistachkin5b0b6fd2011-06-25 01:14:36 +0000428
mistachkine37f99c2012-06-30 16:22:05 +0000429!IFNDEF TCLLIBDIR
shanehb2f20bf2011-06-17 07:07:24 +0000430TCLLIBDIR = c:\tcl\lib
mistachkine37f99c2012-06-30 16:22:05 +0000431!ENDIF
mistachkin5b0b6fd2011-06-25 01:14:36 +0000432
mistachkine37f99c2012-06-30 16:22:05 +0000433!IFNDEF LIBTCL
mistachkin5b0b6fd2011-06-25 01:14:36 +0000434LIBTCL = tcl85.lib
mistachkine37f99c2012-06-30 16:22:05 +0000435!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000436
mistachkinc756ded2011-10-02 05:23:16 +0000437# The locations of the ICU header and library files. These variables
438# (ICUINCDIR, ICULIBDIR, and LIBICU) may be overridden via the environment
439# prior to running nmake in order to match the actual installed location on
440# this machine.
441#
mistachkine37f99c2012-06-30 16:22:05 +0000442!IFNDEF ICUINCDIR
mistachkinc756ded2011-10-02 05:23:16 +0000443ICUINCDIR = c:\icu\include
mistachkine37f99c2012-06-30 16:22:05 +0000444!ENDIF
mistachkinc756ded2011-10-02 05:23:16 +0000445
mistachkine37f99c2012-06-30 16:22:05 +0000446!IFNDEF ICULIBDIR
mistachkinc756ded2011-10-02 05:23:16 +0000447ICULIBDIR = c:\icu\lib
mistachkine37f99c2012-06-30 16:22:05 +0000448!ENDIF
mistachkinc756ded2011-10-02 05:23:16 +0000449
mistachkine37f99c2012-06-30 16:22:05 +0000450!IFNDEF LIBICU
mistachkinc756ded2011-10-02 05:23:16 +0000451LIBICU = icuuc.lib icuin.lib
mistachkine37f99c2012-06-30 16:22:05 +0000452!ENDIF
mistachkinc756ded2011-10-02 05:23:16 +0000453
shanehb2f20bf2011-06-17 07:07:24 +0000454# This is the command to use for tclsh - normally just "tclsh", but we may
mistachkin5b0b6fd2011-06-25 01:14:36 +0000455# know the specific version we want to use. This variable (TCLSH_CMD) may be
456# overridden via the environment prior to running nmake in order to select a
457# specific Tcl shell to use.
shanehb2f20bf2011-06-17 07:07:24 +0000458#
mistachkine37f99c2012-06-30 16:22:05 +0000459!IFNDEF TCLSH_CMD
shanehb2f20bf2011-06-17 07:07:24 +0000460TCLSH_CMD = tclsh85
mistachkine37f99c2012-06-30 16:22:05 +0000461!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000462
463# Compiler options needed for programs that use the readline() library.
464#
mistachkin8bcd3fa2013-08-29 01:03:38 +0000465!IFNDEF READLINE_FLAGS
shaneh6e7850c2011-06-17 15:57:07 +0000466READLINE_FLAGS = -DHAVE_READLINE=0
mistachkin8bcd3fa2013-08-29 01:03:38 +0000467!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000468
469# The library that programs using readline() must link against.
470#
mistachkin8bcd3fa2013-08-29 01:03:38 +0000471!IFNDEF LIBREADLINE
shaneh6e7850c2011-06-17 15:57:07 +0000472LIBREADLINE =
mistachkin8bcd3fa2013-08-29 01:03:38 +0000473!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000474
475# Should the database engine be compiled threadsafe
476#
477TCC = $(TCC) -DSQLITE_THREADSAFE=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000478RCC = $(RCC) -DSQLITE_THREADSAFE=1
shanehb2f20bf2011-06-17 07:07:24 +0000479
480# Do threads override each others locks by default (1), or do we test (-1)
481#
482TCC = $(TCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1
mistachkin4d9d1f42012-09-03 10:32:32 +0000483RCC = $(RCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1
shanehb2f20bf2011-06-17 07:07:24 +0000484
485# Any target libraries which libsqlite must be linked against
shaneh6e7850c2011-06-17 15:57:07 +0000486#
mistachkine37f99c2012-06-30 16:22:05 +0000487!IFNDEF TLIBS
shaneh6e7850c2011-06-17 15:57:07 +0000488TLIBS =
mistachkine37f99c2012-06-30 16:22:05 +0000489!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000490
491# Flags controlling use of the in memory btree implementation
492#
493# SQLITE_TEMP_STORE is 0 to force temporary tables to be in a file, 1 to
494# default to file, 2 to default to memory, and 3 to force temporary
495# tables to always be in memory.
496#
shaneh6e7850c2011-06-17 15:57:07 +0000497TCC = $(TCC) -DSQLITE_TEMP_STORE=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000498RCC = $(RCC) -DSQLITE_TEMP_STORE=1
shanehb2f20bf2011-06-17 07:07:24 +0000499
500# Enable/disable loadable extensions, and other optional features
shaneh6e7850c2011-06-17 15:57:07 +0000501# based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*).
502# The same set of OMIT and ENABLE flags should be passed to the
shanehb2f20bf2011-06-17 07:07:24 +0000503# LEMON parser generator and the mkkeywordhash tool as well.
504
mistachkin4712c212014-05-09 20:51:17 +0000505# These are the required SQLite compilation options used when compiling for
506# the Windows platform.
507#
508REQ_FEATURE_FLAGS = $(REQ_FEATURE_FLAGS) -DSQLITE_MAX_TRIGGER_DEPTH=100
shanehb2f20bf2011-06-17 07:07:24 +0000509
mistachkine45e0fb2015-01-21 00:48:46 +0000510# If we are linking to the RPCRT4 library, enable features that need it.
511#
512!IF $(USE_RPCRT4_LIB)!=0
513REQ_FEATURE_FLAGS = $(REQ_FEATURE_FLAGS) -DSQLITE_WIN32_USE_UUID=1
514!ENDIF
515
mistachkin4712c212014-05-09 20:51:17 +0000516# Add the required and optional SQLite compilation options into the command
517# lines used to invoke the MSVC code and resource compilers.
518#
519TCC = $(TCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS)
520RCC = $(RCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS)
shanehb2f20bf2011-06-17 07:07:24 +0000521
mistachkin4712c212014-05-09 20:51:17 +0000522# Add in any optional parameters specified on the commane line, e.g.
523# nmake /f Makefile.msc all "OPTS=-DSQLITE_ENABLE_FOO=1 -DSQLITE_OMIT_FOO=1"
524#
shanehb2f20bf2011-06-17 07:07:24 +0000525TCC = $(TCC) $(OPTS)
mistachkin4d9d1f42012-09-03 10:32:32 +0000526RCC = $(RCC) $(OPTS)
shanehb2f20bf2011-06-17 07:07:24 +0000527
mistachkin8bcd3fa2013-08-29 01:03:38 +0000528# If compiling for debugging, add some defines.
mistachkin4712c212014-05-09 20:51:17 +0000529#
mistachkincd54bab2014-12-20 21:14:14 +0000530!IF $(DEBUG)>1
mistachkin8bcd3fa2013-08-29 01:03:38 +0000531TCC = $(TCC) -D_DEBUG
532BCC = $(BCC) -D_DEBUG
mistachkin4d9d1f42012-09-03 10:32:32 +0000533RCC = $(RCC) -D_DEBUG
mistachkin4d60be52011-08-26 05:40:31 +0000534!ENDIF
535
mistachkin8bcd3fa2013-08-29 01:03:38 +0000536# If optimizations are enabled or disabled (either implicitly or
537# explicitly), add the necessary flags.
mistachkin4712c212014-05-09 20:51:17 +0000538#
mistachkincd54bab2014-12-20 21:14:14 +0000539!IF $(DEBUG)>1 || $(OPTIMIZATIONS)==0
mistachkin8bcd3fa2013-08-29 01:03:38 +0000540TCC = $(TCC) -Od
541BCC = $(BCC) -Od
542!ELSEIF $(OPTIMIZATIONS)>=3
543TCC = $(TCC) -Ox
544BCC = $(BCC) -Ox
545!ELSEIF $(OPTIMIZATIONS)==2
546TCC = $(TCC) -O2
547BCC = $(BCC) -O2
548!ELSEIF $(OPTIMIZATIONS)==1
549TCC = $(TCC) -O1
550BCC = $(BCC) -O1
551!ENDIF
552
553# If symbols are enabled (or compiling for debugging), enable PDBs.
mistachkin4712c212014-05-09 20:51:17 +0000554#
mistachkincd54bab2014-12-20 21:14:14 +0000555!IF $(DEBUG)>1 || $(SYMBOLS)!=0
mistachkin4d60be52011-08-26 05:40:31 +0000556TCC = $(TCC) -Zi
mistachkinfec360a2012-04-18 10:29:21 +0000557BCC = $(BCC) -Zi
mistachkin753c5442011-08-25 02:02:25 +0000558!ENDIF
559
mistachkinc756ded2011-10-02 05:23:16 +0000560# If ICU support is enabled, add the compiler options for it.
mistachkin4712c212014-05-09 20:51:17 +0000561#
mistachkinc756ded2011-10-02 05:23:16 +0000562!IF $(USE_ICU)!=0
563TCC = $(TCC) -DSQLITE_ENABLE_ICU=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000564RCC = $(RCC) -DSQLITE_ENABLE_ICU=1
mistachkinc756ded2011-10-02 05:23:16 +0000565TCC = $(TCC) -I$(TOP)\ext\icu
mistachkin4d9d1f42012-09-03 10:32:32 +0000566RCC = $(RCC) -I$(TOP)\ext\icu
mistachkinc756ded2011-10-02 05:23:16 +0000567TCC = $(TCC) -I$(ICUINCDIR)
mistachkin4d9d1f42012-09-03 10:32:32 +0000568RCC = $(RCC) -I$(ICUINCDIR)
mistachkinc756ded2011-10-02 05:23:16 +0000569!ENDIF
570
mistachkin4d9d1f42012-09-03 10:32:32 +0000571# Command line prefixes for compiling code, compiling resources,
572# linking, etc.
mistachkin4712c212014-05-09 20:51:17 +0000573#
shanehb2f20bf2011-06-17 07:07:24 +0000574LTCOMPILE = $(TCC) -Fo$@
mistachkin4d9d1f42012-09-03 10:32:32 +0000575LTRCOMPILE = $(RCC) -r
shanehb2f20bf2011-06-17 07:07:24 +0000576LTLIB = lib.exe
shaneh2a0b9ef2011-06-20 20:52:32 +0000577LTLINK = $(TCC) -Fe$@
578
mistachkine45e0fb2015-01-21 00:48:46 +0000579# If requested, link to the RPCRT4 library.
580#
581!IF $(USE_RPCRT4_LIB)!=0
582LTLINK = $(LTLINK) rpcrt4.lib
583!ENDIF
584
shaneh2a0b9ef2011-06-20 20:52:32 +0000585# If a platform was set, force the linker to target that.
586# Note that the vcvars*.bat family of batch files typically
587# set this for you. Otherwise, the linker will attempt
588# to deduce the binary type based on the object files.
mistachkine37f99c2012-06-30 16:22:05 +0000589!IFDEF PLATFORM
shaneh2a0b9ef2011-06-20 20:52:32 +0000590LTLINKOPTS = /MACHINE:$(PLATFORM)
shaneh29ebea82011-06-21 18:12:07 +0000591LTLIBOPTS = /MACHINE:$(PLATFORM)
shaneh2a0b9ef2011-06-20 20:52:32 +0000592!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000593
mistachkina6ff8572012-04-17 21:00:12 +0000594# When compiling for use in the WinRT environment, the following
595# linker option must be used to mark the executable as runnable
596# only in the context of an application container.
597#
598!IF $(FOR_WINRT)!=0
599LTLINKOPTS = $(LTLINKOPTS) /APPCONTAINER
mistachkin60bdad72013-07-11 03:09:45 +0000600!IF "$(VISUALSTUDIOVERSION)"=="12.0"
mistachkinf6a23422014-05-05 20:24:34 +0000601!IFNDEF STORELIBPATH
mistachkinda5b1cd2013-07-10 19:39:02 +0000602!IF "$(PLATFORM)"=="x86"
mistachkin4712c212014-05-09 20:51:17 +0000603STORELIBPATH = $(CRTLIBPATH)\store
mistachkinda5b1cd2013-07-10 19:39:02 +0000604!ELSEIF "$(PLATFORM)"=="x64"
mistachkin4712c212014-05-09 20:51:17 +0000605STORELIBPATH = $(CRTLIBPATH)\store\amd64
mistachkin4eaa1292013-07-10 21:33:25 +0000606!ELSEIF "$(PLATFORM)"=="ARM"
mistachkin4712c212014-05-09 20:51:17 +0000607STORELIBPATH = $(CRTLIBPATH)\store\arm
mistachkin4eaa1292013-07-10 21:33:25 +0000608!ELSE
mistachkin4712c212014-05-09 20:51:17 +0000609STORELIBPATH = $(CRTLIBPATH)\store
mistachkinda5b1cd2013-07-10 19:39:02 +0000610!ENDIF
611!ENDIF
mistachkinf6a23422014-05-05 20:24:34 +0000612STORELIBPATH = $(STORELIBPATH:\\=\)
613LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(STORELIBPATH)"
614!ENDIF
mistachkina6ff8572012-04-17 21:00:12 +0000615!ENDIF
616
mistachkind9b3c542014-05-09 23:31:55 +0000617# When compiling for Windows Phone 8.1, an extra library path is
618# required.
619#
620!IF $(USE_WP81_OPTS)!=0
621!IFNDEF WP81LIBPATH
622!IF "$(PLATFORM)"=="x86"
623WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86
624!ELSEIF "$(PLATFORM)"=="ARM"
625WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\ARM
626!ELSE
627WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86
628!ENDIF
629!ENDIF
630!ENDIF
631
632# When compiling for Windows Phone 8.1, some extra linker options
633# are also required.
634#
635!IF $(USE_WP81_OPTS)!=0
636!IFDEF WP81LIBPATH
637LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(WP81LIBPATH)"
638!ENDIF
639LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE
640LTLINKOPTS = $(LTLINKOPTS) WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelHost.lib
641LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:kernel32.lib /NODEFAULTLIB:ole32.lib
642!ENDIF
643
mistachkinfec360a2012-04-18 10:29:21 +0000644# If either debugging or symbols are enabled, enable PDBs.
mistachkin4712c212014-05-09 20:51:17 +0000645#
mistachkincd54bab2014-12-20 21:14:14 +0000646!IF $(DEBUG)>1 || $(SYMBOLS)!=0
mistachkin228aeff2012-06-30 19:24:09 +0000647LDFLAGS = /DEBUG
mistachkin753c5442011-08-25 02:02:25 +0000648!ENDIF
649
mistachkinc756ded2011-10-02 05:23:16 +0000650# Start with the Tcl related linker options.
mistachkin4712c212014-05-09 20:51:17 +0000651#
mistachkin31856a32012-07-27 07:13:25 +0000652!IF $(NO_TCL)==0
mistachkinc756ded2011-10-02 05:23:16 +0000653LTLIBPATHS = /LIBPATH:$(TCLLIBDIR)
654LTLIBS = $(LIBTCL)
mistachkin31856a32012-07-27 07:13:25 +0000655!ENDIF
mistachkinc756ded2011-10-02 05:23:16 +0000656
657# If ICU support is enabled, add the linker options for it.
mistachkin4712c212014-05-09 20:51:17 +0000658#
mistachkinc756ded2011-10-02 05:23:16 +0000659!IF $(USE_ICU)!=0
660LTLIBPATHS = $(LTLIBPATHS) /LIBPATH:$(ICULIBDIR)
661LTLIBS = $(LTLIBS) $(LIBICU)
662!ENDIF
663
shanehb2f20bf2011-06-17 07:07:24 +0000664# nawk compatible awk.
mistachkin4712c212014-05-09 20:51:17 +0000665#
mistachkin8bcd3fa2013-08-29 01:03:38 +0000666!IFNDEF NAWK
mistachkin5b0b6fd2011-06-25 01:14:36 +0000667NAWK = gawk.exe
mistachkin8bcd3fa2013-08-29 01:03:38 +0000668!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000669
670# You should not have to change anything below this line
671###############################################################################
672
shanehb2f20bf2011-06-17 07:07:24 +0000673# Object files for the SQLite library (non-amalgamation).
674#
mistachkinf67feef2013-07-29 19:03:20 +0000675LIBOBJS0 = vdbe.lo parse.lo alter.lo analyze.lo attach.lo auth.lo \
shanehb2f20bf2011-06-17 07:07:24 +0000676 backup.lo bitvec.lo btmutex.lo btree.lo build.lo \
677 callback.lo complete.lo ctime.lo date.lo delete.lo \
678 expr.lo fault.lo fkey.lo \
drh391d4ba2012-05-28 20:22:16 +0000679 fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo \
680 fts3_porter.lo fts3_snippet.lo fts3_tokenizer.lo fts3_tokenizer1.lo \
drh4d648c72013-04-22 17:07:56 +0000681 fts3_tokenize_vtab.lo fts3_unicode.lo fts3_unicode2.lo fts3_write.lo \
shanehb2f20bf2011-06-17 07:07:24 +0000682 func.lo global.lo hash.lo \
683 icu.lo insert.lo journal.lo legacy.lo loadext.lo \
684 main.lo malloc.lo mem0.lo mem1.lo mem2.lo mem3.lo mem5.lo \
685 memjournal.lo \
mistachkinf1c6bc52012-06-21 15:09:20 +0000686 mutex.lo mutex_noop.lo mutex_unix.lo mutex_w32.lo \
687 notify.lo opcodes.lo os.lo os_unix.lo os_win.lo \
mistachkinf67feef2013-07-29 19:03:20 +0000688 pager.lo pcache.lo pcache1.lo pragma.lo prepare.lo printf.lo \
shanehb2f20bf2011-06-17 07:07:24 +0000689 random.lo resolve.lo rowset.lo rtree.lo select.lo status.lo \
mistachkine5007472014-05-02 19:12:37 +0000690 table.lo threads.lo tokenize.lo trigger.lo \
shanehb2f20bf2011-06-17 07:07:24 +0000691 update.lo util.lo vacuum.lo \
mistachkinf67feef2013-07-29 19:03:20 +0000692 vdbeapi.lo vdbeaux.lo vdbeblob.lo vdbemem.lo vdbesort.lo \
mistachkin81c428a2011-08-17 02:19:54 +0000693 vdbetrace.lo wal.lo walker.lo where.lo utf.lo vtab.lo
shanehb2f20bf2011-06-17 07:07:24 +0000694
695# Object files for the amalgamation.
696#
697LIBOBJS1 = sqlite3.lo
698
699# Determine the real value of LIBOBJ based on the 'configure' script
700#
701!IF $(USE_AMALGAMATION)==0
702LIBOBJ = $(LIBOBJS0)
703!ELSE
704LIBOBJ = $(LIBOBJS1)
705!ENDIF
706
mistachkin08c1c312012-10-06 03:48:25 +0000707# Determine if embedded resource compilation and usage are enabled.
708#
709!IF $(USE_RC)!=0
710LIBRESOBJS = sqlite3res.lo
711!ELSE
712LIBRESOBJS =
713!ENDIF
714
shanehb2f20bf2011-06-17 07:07:24 +0000715# All of the source code files.
716#
drh62679202015-01-29 18:38:05 +0000717SRC1 = \
shanehb2f20bf2011-06-17 07:07:24 +0000718 $(TOP)\src\alter.c \
719 $(TOP)\src\analyze.c \
720 $(TOP)\src\attach.c \
721 $(TOP)\src\auth.c \
722 $(TOP)\src\backup.c \
723 $(TOP)\src\bitvec.c \
724 $(TOP)\src\btmutex.c \
725 $(TOP)\src\btree.c \
726 $(TOP)\src\btree.h \
727 $(TOP)\src\btreeInt.h \
728 $(TOP)\src\build.c \
729 $(TOP)\src\callback.c \
730 $(TOP)\src\complete.c \
731 $(TOP)\src\ctime.c \
732 $(TOP)\src\date.c \
733 $(TOP)\src\delete.c \
734 $(TOP)\src\expr.c \
735 $(TOP)\src\fault.c \
736 $(TOP)\src\fkey.c \
737 $(TOP)\src\func.c \
738 $(TOP)\src\global.c \
739 $(TOP)\src\hash.c \
740 $(TOP)\src\hash.h \
741 $(TOP)\src\hwtime.h \
742 $(TOP)\src\insert.c \
743 $(TOP)\src\journal.c \
744 $(TOP)\src\legacy.c \
745 $(TOP)\src\loadext.c \
746 $(TOP)\src\main.c \
747 $(TOP)\src\malloc.c \
748 $(TOP)\src\mem0.c \
749 $(TOP)\src\mem1.c \
750 $(TOP)\src\mem2.c \
751 $(TOP)\src\mem3.c \
752 $(TOP)\src\mem5.c \
753 $(TOP)\src\memjournal.c \
mistachkin2318d332015-01-12 18:02:52 +0000754 $(TOP)\src\msvc.h \
shanehb2f20bf2011-06-17 07:07:24 +0000755 $(TOP)\src\mutex.c \
756 $(TOP)\src\mutex.h \
757 $(TOP)\src\mutex_noop.c \
shanehb2f20bf2011-06-17 07:07:24 +0000758 $(TOP)\src\mutex_unix.c \
759 $(TOP)\src\mutex_w32.c \
760 $(TOP)\src\notify.c \
761 $(TOP)\src\os.c \
762 $(TOP)\src\os.h \
763 $(TOP)\src\os_common.h \
mistachkinf74b9e02013-11-26 01:00:31 +0000764 $(TOP)\src\os_setup.h \
shanehb2f20bf2011-06-17 07:07:24 +0000765 $(TOP)\src\os_unix.c \
766 $(TOP)\src\os_win.c \
drh62679202015-01-29 18:38:05 +0000767 $(TOP)\src\os_win.h
768SRC2 = \
shanehb2f20bf2011-06-17 07:07:24 +0000769 $(TOP)\src\pager.c \
770 $(TOP)\src\pager.h \
771 $(TOP)\src\parse.y \
772 $(TOP)\src\pcache.c \
773 $(TOP)\src\pcache.h \
774 $(TOP)\src\pcache1.c \
775 $(TOP)\src\pragma.c \
drh67e65e52015-02-02 21:34:54 +0000776 $(TOP)\src\pragma.h \
shanehb2f20bf2011-06-17 07:07:24 +0000777 $(TOP)\src\prepare.c \
778 $(TOP)\src\printf.c \
779 $(TOP)\src\random.c \
780 $(TOP)\src\resolve.c \
781 $(TOP)\src\rowset.c \
782 $(TOP)\src\select.c \
783 $(TOP)\src\status.c \
784 $(TOP)\src\shell.c \
785 $(TOP)\src\sqlite.h.in \
786 $(TOP)\src\sqlite3ext.h \
787 $(TOP)\src\sqliteInt.h \
788 $(TOP)\src\sqliteLimit.h \
789 $(TOP)\src\table.c \
drhf51446a2012-07-21 19:40:42 +0000790 $(TOP)\src\threads.c \
shanehb2f20bf2011-06-17 07:07:24 +0000791 $(TOP)\src\tclsqlite.c \
792 $(TOP)\src\tokenize.c \
793 $(TOP)\src\trigger.c \
794 $(TOP)\src\utf.c \
795 $(TOP)\src\update.c \
796 $(TOP)\src\util.c \
797 $(TOP)\src\vacuum.c \
798 $(TOP)\src\vdbe.c \
799 $(TOP)\src\vdbe.h \
800 $(TOP)\src\vdbeapi.c \
801 $(TOP)\src\vdbeaux.c \
802 $(TOP)\src\vdbeblob.c \
803 $(TOP)\src\vdbemem.c \
mistachkin81c428a2011-08-17 02:19:54 +0000804 $(TOP)\src\vdbesort.c \
shanehb2f20bf2011-06-17 07:07:24 +0000805 $(TOP)\src\vdbetrace.c \
806 $(TOP)\src\vdbeInt.h \
807 $(TOP)\src\vtab.c \
drh8cd5b252015-03-02 22:06:43 +0000808 $(TOP)\src\vxworks.h \
shanehb2f20bf2011-06-17 07:07:24 +0000809 $(TOP)\src\wal.c \
810 $(TOP)\src\wal.h \
811 $(TOP)\src\walker.c \
drhe54df422013-11-12 18:37:25 +0000812 $(TOP)\src\where.c \
813 $(TOP)\src\whereInt.h
shanehb2f20bf2011-06-17 07:07:24 +0000814
815# Source code for extensions
816#
drh62679202015-01-29 18:38:05 +0000817SRC3 = \
shanehb2f20bf2011-06-17 07:07:24 +0000818 $(TOP)\ext\fts1\fts1.c \
819 $(TOP)\ext\fts1\fts1.h \
820 $(TOP)\ext\fts1\fts1_hash.c \
821 $(TOP)\ext\fts1\fts1_hash.h \
822 $(TOP)\ext\fts1\fts1_porter.c \
823 $(TOP)\ext\fts1\fts1_tokenizer.h \
drh62679202015-01-29 18:38:05 +0000824 $(TOP)\ext\fts1\fts1_tokenizer1.c \
shanehb2f20bf2011-06-17 07:07:24 +0000825 $(TOP)\ext\fts2\fts2.c \
826 $(TOP)\ext\fts2\fts2.h \
827 $(TOP)\ext\fts2\fts2_hash.c \
828 $(TOP)\ext\fts2\fts2_hash.h \
829 $(TOP)\ext\fts2\fts2_icu.c \
830 $(TOP)\ext\fts2\fts2_porter.c \
831 $(TOP)\ext\fts2\fts2_tokenizer.h \
832 $(TOP)\ext\fts2\fts2_tokenizer.c \
833 $(TOP)\ext\fts2\fts2_tokenizer1.c
drh62679202015-01-29 18:38:05 +0000834SRC4 = \
shanehb2f20bf2011-06-17 07:07:24 +0000835 $(TOP)\ext\fts3\fts3.c \
836 $(TOP)\ext\fts3\fts3.h \
837 $(TOP)\ext\fts3\fts3Int.h \
838 $(TOP)\ext\fts3\fts3_aux.c \
839 $(TOP)\ext\fts3\fts3_expr.c \
840 $(TOP)\ext\fts3\fts3_hash.c \
841 $(TOP)\ext\fts3\fts3_hash.h \
842 $(TOP)\ext\fts3\fts3_icu.c \
843 $(TOP)\ext\fts3\fts3_porter.c \
844 $(TOP)\ext\fts3\fts3_snippet.c \
845 $(TOP)\ext\fts3\fts3_tokenizer.h \
846 $(TOP)\ext\fts3\fts3_tokenizer.c \
847 $(TOP)\ext\fts3\fts3_tokenizer1.c \
drh4d648c72013-04-22 17:07:56 +0000848 $(TOP)\ext\fts3\fts3_tokenize_vtab.c \
drh391d4ba2012-05-28 20:22:16 +0000849 $(TOP)\ext\fts3\fts3_unicode.c \
850 $(TOP)\ext\fts3\fts3_unicode2.c \
drh62679202015-01-29 18:38:05 +0000851 $(TOP)\ext\fts3\fts3_write.c \
shanehb2f20bf2011-06-17 07:07:24 +0000852 $(TOP)\ext\icu\sqliteicu.h \
drh62679202015-01-29 18:38:05 +0000853 $(TOP)\ext\icu\icu.c \
shanehb2f20bf2011-06-17 07:07:24 +0000854 $(TOP)\ext\rtree\rtree.h \
855 $(TOP)\ext\rtree\rtree.c
856
857
858# Generated source code files
859#
drh62679202015-01-29 18:38:05 +0000860SRC5 = \
shanehb2f20bf2011-06-17 07:07:24 +0000861 keywordhash.h \
862 opcodes.c \
863 opcodes.h \
864 parse.c \
865 parse.h \
866 sqlite3.h
867
drh62679202015-01-29 18:38:05 +0000868# All source code files.
869#
870SRC = $(SRC1) $(SRC2) $(SRC3) $(SRC4) $(SRC5)
871
shanehb2f20bf2011-06-17 07:07:24 +0000872# Source code to the test files.
873#
874TESTSRC = \
875 $(TOP)\src\test1.c \
876 $(TOP)\src\test2.c \
877 $(TOP)\src\test3.c \
878 $(TOP)\src\test4.c \
879 $(TOP)\src\test5.c \
880 $(TOP)\src\test6.c \
881 $(TOP)\src\test7.c \
882 $(TOP)\src\test8.c \
883 $(TOP)\src\test9.c \
884 $(TOP)\src\test_autoext.c \
885 $(TOP)\src\test_async.c \
886 $(TOP)\src\test_backup.c \
drh5de7d962014-12-05 00:17:39 +0000887 $(TOP)\src\test_blob.c \
shanehb2f20bf2011-06-17 07:07:24 +0000888 $(TOP)\src\test_btree.c \
889 $(TOP)\src\test_config.c \
890 $(TOP)\src\test_demovfs.c \
891 $(TOP)\src\test_devsym.c \
mistachkin413c63b2013-01-17 03:18:14 +0000892 $(TOP)\src\test_fs.c \
shanehb2f20bf2011-06-17 07:07:24 +0000893 $(TOP)\src\test_func.c \
shanehb2f20bf2011-06-17 07:07:24 +0000894 $(TOP)\src\test_hexio.c \
895 $(TOP)\src\test_init.c \
896 $(TOP)\src\test_intarray.c \
897 $(TOP)\src\test_journal.c \
898 $(TOP)\src\test_malloc.c \
899 $(TOP)\src\test_multiplex.c \
900 $(TOP)\src\test_mutex.c \
901 $(TOP)\src\test_onefile.c \
902 $(TOP)\src\test_osinst.c \
903 $(TOP)\src\test_pcache.c \
904 $(TOP)\src\test_quota.c \
905 $(TOP)\src\test_rtree.c \
906 $(TOP)\src\test_schema.c \
907 $(TOP)\src\test_server.c \
908 $(TOP)\src\test_superlock.c \
909 $(TOP)\src\test_syscall.c \
910 $(TOP)\src\test_stat.c \
911 $(TOP)\src\test_tclvar.c \
912 $(TOP)\src\test_thread.c \
913 $(TOP)\src\test_vfs.c \
shanehb2f20bf2011-06-17 07:07:24 +0000914 $(TOP)\src\test_wsd.c \
915 $(TOP)\ext\fts3\fts3_term.c \
shaneh6e7850c2011-06-17 15:57:07 +0000916 $(TOP)\ext\fts3\fts3_test.c
shanehb2f20bf2011-06-17 07:07:24 +0000917
drhe50db1c2013-04-25 14:31:46 +0000918# Statically linked extensions
919#
drh1fb64af2013-04-25 14:36:28 +0000920TESTEXT = \
drh8416fc72013-04-25 16:42:55 +0000921 $(TOP)\ext\misc\amatch.c \
922 $(TOP)\ext\misc\closure.c \
drh1728bcb2014-11-10 16:49:56 +0000923 $(TOP)\ext\misc\eval.c \
drh51ed2982014-06-16 12:44:32 +0000924 $(TOP)\ext\misc\fileio.c \
drhe50db1c2013-04-25 14:31:46 +0000925 $(TOP)\ext\misc\fuzzer.c \
drh8416fc72013-04-25 16:42:55 +0000926 $(TOP)\ext\misc\ieee754.c \
drhea41dc42013-04-25 19:31:33 +0000927 $(TOP)\ext\misc\nextchar.c \
drhdef33672013-05-28 20:25:54 +0000928 $(TOP)\ext\misc\percentile.c \
drhe50db1c2013-04-25 14:31:46 +0000929 $(TOP)\ext\misc\regexp.c \
drhb7045ab2013-04-25 14:59:01 +0000930 $(TOP)\ext\misc\spellfix.c \
drh5f8cdac2013-10-14 21:14:42 +0000931 $(TOP)\ext\misc\totype.c \
drhe50db1c2013-04-25 14:31:46 +0000932 $(TOP)\ext\misc\wholenumber.c
933
934
shanehb2f20bf2011-06-17 07:07:24 +0000935# Source code to the library files needed by the test fixture
936#
937TESTSRC2 = \
938 $(TOP)\src\attach.c \
939 $(TOP)\src\backup.c \
940 $(TOP)\src\bitvec.c \
941 $(TOP)\src\btree.c \
942 $(TOP)\src\build.c \
943 $(TOP)\src\ctime.c \
944 $(TOP)\src\date.c \
945 $(TOP)\src\expr.c \
946 $(TOP)\src\func.c \
947 $(TOP)\src\insert.c \
948 $(TOP)\src\wal.c \
mistachkin06006632013-05-15 20:35:13 +0000949 $(TOP)\src\main.c \
shanehb2f20bf2011-06-17 07:07:24 +0000950 $(TOP)\src\mem5.c \
951 $(TOP)\src\os.c \
shanehb2f20bf2011-06-17 07:07:24 +0000952 $(TOP)\src\os_unix.c \
953 $(TOP)\src\os_win.c \
954 $(TOP)\src\pager.c \
955 $(TOP)\src\pragma.c \
956 $(TOP)\src\prepare.c \
957 $(TOP)\src\printf.c \
958 $(TOP)\src\random.c \
959 $(TOP)\src\pcache.c \
960 $(TOP)\src\pcache1.c \
961 $(TOP)\src\select.c \
962 $(TOP)\src\tokenize.c \
963 $(TOP)\src\utf.c \
964 $(TOP)\src\util.c \
965 $(TOP)\src\vdbeapi.c \
966 $(TOP)\src\vdbeaux.c \
967 $(TOP)\src\vdbe.c \
968 $(TOP)\src\vdbemem.c \
mistachkin81c428a2011-08-17 02:19:54 +0000969 $(TOP)\src\vdbesort.c \
shanehb2f20bf2011-06-17 07:07:24 +0000970 $(TOP)\src\vdbetrace.c \
971 $(TOP)\src\where.c \
972 parse.c \
973 $(TOP)\ext\fts3\fts3.c \
974 $(TOP)\ext\fts3\fts3_aux.c \
975 $(TOP)\ext\fts3\fts3_expr.c \
shanehb2f20bf2011-06-17 07:07:24 +0000976 $(TOP)\ext\fts3\fts3_tokenizer.c \
drh4d648c72013-04-22 17:07:56 +0000977 $(TOP)\ext\fts3\fts3_tokenize_vtab.c \
drh391d4ba2012-05-28 20:22:16 +0000978 $(TOP)\ext\fts3\fts3_unicode.c \
979 $(TOP)\ext\fts3\fts3_unicode2.c \
shanehb2f20bf2011-06-17 07:07:24 +0000980 $(TOP)\ext\fts3\fts3_write.c \
981 $(TOP)\ext\async\sqlite3async.c
982
983# Header files used by all library source files.
984#
985HDR = \
986 $(TOP)\src\btree.h \
987 $(TOP)\src\btreeInt.h \
988 $(TOP)\src\hash.h \
989 $(TOP)\src\hwtime.h \
990 keywordhash.h \
mistachkin2318d332015-01-12 18:02:52 +0000991 $(TOP)\src\msvc.h \
shanehb2f20bf2011-06-17 07:07:24 +0000992 $(TOP)\src\mutex.h \
993 opcodes.h \
994 $(TOP)\src\os.h \
995 $(TOP)\src\os_common.h \
mistachkinf74b9e02013-11-26 01:00:31 +0000996 $(TOP)\src\os_setup.h \
mistachkin8bc52622013-11-25 09:36:07 +0000997 $(TOP)\src\os_win.h \
shanehb2f20bf2011-06-17 07:07:24 +0000998 $(TOP)\src\pager.h \
999 $(TOP)\src\pcache.h \
shaneh6e7850c2011-06-17 15:57:07 +00001000 parse.h \
drh67e65e52015-02-02 21:34:54 +00001001 $(TOP)\src\pragma.h \
shaneh6e7850c2011-06-17 15:57:07 +00001002 sqlite3.h \
shanehb2f20bf2011-06-17 07:07:24 +00001003 $(TOP)\src\sqlite3ext.h \
shaneh6e7850c2011-06-17 15:57:07 +00001004 $(TOP)\src\sqliteInt.h \
shanehb2f20bf2011-06-17 07:07:24 +00001005 $(TOP)\src\sqliteLimit.h \
1006 $(TOP)\src\vdbe.h \
drhe54df422013-11-12 18:37:25 +00001007 $(TOP)\src\vdbeInt.h \
drh8cd5b252015-03-02 22:06:43 +00001008 $(TOP)\src\vxworks.h \
drhe54df422013-11-12 18:37:25 +00001009 $(TOP)\src\whereInt.h
shanehb2f20bf2011-06-17 07:07:24 +00001010
1011# Header files used by extensions
1012#
1013EXTHDR = $(EXTHDR) \
1014 $(TOP)\ext\fts1\fts1.h \
1015 $(TOP)\ext\fts1\fts1_hash.h \
1016 $(TOP)\ext\fts1\fts1_tokenizer.h
1017EXTHDR = $(EXTHDR) \
1018 $(TOP)\ext\fts2\fts2.h \
1019 $(TOP)\ext\fts2\fts2_hash.h \
1020 $(TOP)\ext\fts2\fts2_tokenizer.h
1021EXTHDR = $(EXTHDR) \
1022 $(TOP)\ext\fts3\fts3.h \
1023 $(TOP)\ext\fts3\fts3Int.h \
1024 $(TOP)\ext\fts3\fts3_hash.h \
1025 $(TOP)\ext\fts3\fts3_tokenizer.h
1026EXTHDR = $(EXTHDR) \
1027 $(TOP)\ext\rtree\rtree.h
1028EXTHDR = $(EXTHDR) \
1029 $(TOP)\ext\icu\sqliteicu.h
1030EXTHDR = $(EXTHDR) \
1031 $(TOP)\ext\rtree\sqlite3rtree.h
1032
1033# This is the default Makefile target. The objects listed here
1034# are what get build when you type just "make" with no arguments.
1035#
mistachkin5b0b6fd2011-06-25 01:14:36 +00001036all: dll libsqlite3.lib sqlite3.exe libtclsqlite3.lib
shanehb2f20bf2011-06-17 07:07:24 +00001037
shanehb2f20bf2011-06-17 07:07:24 +00001038libsqlite3.lib: $(LIBOBJ)
shaneh29ebea82011-06-21 18:12:07 +00001039 $(LTLIB) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001040
1041libtclsqlite3.lib: tclsqlite.lo libsqlite3.lib
mistachkinc756ded2011-10-02 05:23:16 +00001042 $(LTLIB) $(LTLIBOPTS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCL:tcl=tclstub) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001043
mistachkin08c1c312012-10-06 03:48:25 +00001044sqlite3.exe: $(TOP)\src\shell.c libsqlite3.lib $(LIBRESOBJS) sqlite3.h
mistachkin27b2f052015-01-12 19:49:46 +00001045 $(LTLINK) $(READLINE_FLAGS) $(TOP)\src\shell.c \
mistachkin08c1c312012-10-06 03:48:25 +00001046 /link $(LTLINKOPTS) $(LTLIBPATHS) libsqlite3.lib $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001047
drhbc94dbb2013-04-08 14:28:33 +00001048mptester.exe: $(TOP)\mptest\mptest.c libsqlite3.lib $(LIBRESOBJS) sqlite3.h
1049 $(LTLINK) $(TOP)\mptest\mptest.c \
1050 /link $(LTLINKOPTS) $(LTLIBPATHS) libsqlite3.lib $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001051
1052# This target creates a directory named "tsrc" and fills it with
1053# copies of all of the C source code and header files needed to
1054# build on the target system. Some of the C source code and header
1055# files are automatically generated. This target takes care of
1056# all that automatic generation.
1057#
1058.target_source: $(SRC) $(TOP)\tool\vdbe-compress.tcl
1059 -rmdir /S/Q tsrc
1060 -mkdir tsrc
drh62679202015-01-29 18:38:05 +00001061 for %i in ($(SRC1)) do copy /Y %i tsrc
1062 for %i in ($(SRC2)) do copy /Y %i tsrc
1063 for %i in ($(SRC3)) do copy /Y %i tsrc
1064 for %i in ($(SRC4)) do copy /Y %i tsrc
1065 for %i in ($(SRC5)) do copy /Y %i tsrc
shanehb2f20bf2011-06-17 07:07:24 +00001066 del /Q tsrc\sqlite.h.in tsrc\parse.y
drh2dc06482013-12-11 00:59:10 +00001067 $(TCLSH_CMD) $(TOP)\tool\vdbe-compress.tcl $(OPTS) < tsrc\vdbe.c > vdbe.new
shanehb2f20bf2011-06-17 07:07:24 +00001068 move vdbe.new tsrc\vdbe.c
1069 echo > .target_source
1070
1071sqlite3.c: .target_source $(TOP)\tool\mksqlite3c.tcl
mistachkinb0427512014-01-30 11:12:52 +00001072 $(TCLSH_CMD) $(TOP)\tool\mksqlite3c.tcl $(MKSQLITE3C_ARGS)
drh339d6c62013-03-19 16:12:40 +00001073 copy tsrc\shell.c .
1074 copy tsrc\sqlite3ext.h .
shanehb2f20bf2011-06-17 07:07:24 +00001075
mistachkin48dd9de2012-12-06 04:33:13 +00001076sqlite3-all.c: sqlite3.c $(TOP)\tool\split-sqlite3c.tcl
1077 $(TCLSH_CMD) $(TOP)\tool\split-sqlite3c.tcl
drh75e7bc12011-07-22 11:23:49 +00001078
mistachkin76510912013-10-11 23:01:18 +00001079# Set the source code file to be used by executables and libraries when
1080# they need the amalgamation.
1081#
1082!IF $(SPLIT_AMALGAMATION)!=0
1083SQLITE3C = sqlite3-all.c
1084!ELSE
1085SQLITE3C = sqlite3.c
1086!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +00001087
shaneh6e7850c2011-06-17 15:57:07 +00001088# Rule to build the amalgamation
shanehb2f20bf2011-06-17 07:07:24 +00001089#
mistachkin76510912013-10-11 23:01:18 +00001090sqlite3.lo: $(SQLITE3C)
1091 $(LTCOMPILE) -c $(SQLITE3C)
shanehb2f20bf2011-06-17 07:07:24 +00001092
1093# Rules to build the LEMON compiler generator
1094#
1095lempar.c: $(TOP)\src\lempar.c
1096 copy $(TOP)\src\lempar.c .
1097
1098lemon.exe: $(TOP)\tool\lemon.c lempar.c
mistachkin2318d332015-01-12 18:02:52 +00001099 $(BCC) $(NO_WARN) -Daccess=_access \
1100 -Fe$@ $(TOP)\tool\lemon.c /link $(NLTLINKOPTS) $(NLTLIBPATHS)
shanehb2f20bf2011-06-17 07:07:24 +00001101
1102# Rules to build individual *.lo files from generated *.c files. This
1103# applies to:
1104#
1105# parse.lo
1106# opcodes.lo
1107#
1108parse.lo: parse.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001109 $(LTCOMPILE) -c parse.c
shanehb2f20bf2011-06-17 07:07:24 +00001110
1111opcodes.lo: opcodes.c
shaneh6e7850c2011-06-17 15:57:07 +00001112 $(LTCOMPILE) -c opcodes.c
shanehb2f20bf2011-06-17 07:07:24 +00001113
mistachkin4d9d1f42012-09-03 10:32:32 +00001114# Rule to build the Win32 resources object file.
1115#
mistachkin08c1c312012-10-06 03:48:25 +00001116!IF $(USE_RC)!=0
1117$(LIBRESOBJS): $(TOP)\src\sqlite3.rc $(HDR)
mistachkin4d9d1f42012-09-03 10:32:32 +00001118 echo #ifndef SQLITE_RESOURCE_VERSION > sqlite3rc.h
mistachkin8ccc6d42012-09-27 21:03:53 +00001119 for /F %%V in ('type "$(TOP)\VERSION"') do ( \
mistachkin4d9d1f42012-09-03 10:32:32 +00001120 echo #define SQLITE_RESOURCE_VERSION %%V \
mistachkin597a8c52012-09-03 11:14:53 +00001121 | $(NAWK) "/.*/ { gsub(/[.]/,\",\");print }" >> sqlite3rc.h \
mistachkin4d9d1f42012-09-03 10:32:32 +00001122 )
1123 echo #endif >> sqlite3rc.h
mistachkin08c1c312012-10-06 03:48:25 +00001124 $(LTRCOMPILE) -fo $(LIBRESOBJS) $(TOP)\src\sqlite3.rc
1125!ENDIF
mistachkin4d9d1f42012-09-03 10:32:32 +00001126
shanehb2f20bf2011-06-17 07:07:24 +00001127# Rules to build individual *.lo files from files in the src directory.
1128#
1129alter.lo: $(TOP)\src\alter.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001130 $(LTCOMPILE) -c $(TOP)\src\alter.c
shanehb2f20bf2011-06-17 07:07:24 +00001131
1132analyze.lo: $(TOP)\src\analyze.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001133 $(LTCOMPILE) -c $(TOP)\src\analyze.c
shanehb2f20bf2011-06-17 07:07:24 +00001134
1135attach.lo: $(TOP)\src\attach.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001136 $(LTCOMPILE) -c $(TOP)\src\attach.c
shanehb2f20bf2011-06-17 07:07:24 +00001137
1138auth.lo: $(TOP)\src\auth.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001139 $(LTCOMPILE) -c $(TOP)\src\auth.c
shanehb2f20bf2011-06-17 07:07:24 +00001140
1141backup.lo: $(TOP)\src\backup.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001142 $(LTCOMPILE) -c $(TOP)\src\backup.c
shanehb2f20bf2011-06-17 07:07:24 +00001143
1144bitvec.lo: $(TOP)\src\bitvec.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001145 $(LTCOMPILE) -c $(TOP)\src\bitvec.c
shanehb2f20bf2011-06-17 07:07:24 +00001146
1147btmutex.lo: $(TOP)\src\btmutex.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001148 $(LTCOMPILE) -c $(TOP)\src\btmutex.c
shanehb2f20bf2011-06-17 07:07:24 +00001149
1150btree.lo: $(TOP)\src\btree.c $(HDR) $(TOP)\src\pager.h
shaneh6e7850c2011-06-17 15:57:07 +00001151 $(LTCOMPILE) -c $(TOP)\src\btree.c
shanehb2f20bf2011-06-17 07:07:24 +00001152
1153build.lo: $(TOP)\src\build.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001154 $(LTCOMPILE) -c $(TOP)\src\build.c
shanehb2f20bf2011-06-17 07:07:24 +00001155
1156callback.lo: $(TOP)\src\callback.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001157 $(LTCOMPILE) -c $(TOP)\src\callback.c
shanehb2f20bf2011-06-17 07:07:24 +00001158
1159complete.lo: $(TOP)\src\complete.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001160 $(LTCOMPILE) -c $(TOP)\src\complete.c
shanehb2f20bf2011-06-17 07:07:24 +00001161
1162ctime.lo: $(TOP)\src\ctime.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001163 $(LTCOMPILE) -c $(TOP)\src\ctime.c
shanehb2f20bf2011-06-17 07:07:24 +00001164
1165date.lo: $(TOP)\src\date.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001166 $(LTCOMPILE) -c $(TOP)\src\date.c
shanehb2f20bf2011-06-17 07:07:24 +00001167
1168delete.lo: $(TOP)\src\delete.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001169 $(LTCOMPILE) -c $(TOP)\src\delete.c
shanehb2f20bf2011-06-17 07:07:24 +00001170
1171expr.lo: $(TOP)\src\expr.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001172 $(LTCOMPILE) -c $(TOP)\src\expr.c
shanehb2f20bf2011-06-17 07:07:24 +00001173
1174fault.lo: $(TOP)\src\fault.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001175 $(LTCOMPILE) -c $(TOP)\src\fault.c
shanehb2f20bf2011-06-17 07:07:24 +00001176
1177fkey.lo: $(TOP)\src\fkey.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001178 $(LTCOMPILE) -c $(TOP)\src\fkey.c
shanehb2f20bf2011-06-17 07:07:24 +00001179
1180func.lo: $(TOP)\src\func.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001181 $(LTCOMPILE) -c $(TOP)\src\func.c
shanehb2f20bf2011-06-17 07:07:24 +00001182
1183global.lo: $(TOP)\src\global.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001184 $(LTCOMPILE) -c $(TOP)\src\global.c
shanehb2f20bf2011-06-17 07:07:24 +00001185
1186hash.lo: $(TOP)\src\hash.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001187 $(LTCOMPILE) -c $(TOP)\src\hash.c
shanehb2f20bf2011-06-17 07:07:24 +00001188
1189insert.lo: $(TOP)\src\insert.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001190 $(LTCOMPILE) -c $(TOP)\src\insert.c
shanehb2f20bf2011-06-17 07:07:24 +00001191
1192journal.lo: $(TOP)\src\journal.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001193 $(LTCOMPILE) -c $(TOP)\src\journal.c
shanehb2f20bf2011-06-17 07:07:24 +00001194
1195legacy.lo: $(TOP)\src\legacy.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001196 $(LTCOMPILE) -c $(TOP)\src\legacy.c
shanehb2f20bf2011-06-17 07:07:24 +00001197
1198loadext.lo: $(TOP)\src\loadext.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001199 $(LTCOMPILE) -c $(TOP)\src\loadext.c
shanehb2f20bf2011-06-17 07:07:24 +00001200
1201main.lo: $(TOP)\src\main.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001202 $(LTCOMPILE) -c $(TOP)\src\main.c
shanehb2f20bf2011-06-17 07:07:24 +00001203
1204malloc.lo: $(TOP)\src\malloc.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001205 $(LTCOMPILE) -c $(TOP)\src\malloc.c
shanehb2f20bf2011-06-17 07:07:24 +00001206
1207mem0.lo: $(TOP)\src\mem0.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001208 $(LTCOMPILE) -c $(TOP)\src\mem0.c
shanehb2f20bf2011-06-17 07:07:24 +00001209
1210mem1.lo: $(TOP)\src\mem1.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001211 $(LTCOMPILE) -c $(TOP)\src\mem1.c
shanehb2f20bf2011-06-17 07:07:24 +00001212
1213mem2.lo: $(TOP)\src\mem2.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001214 $(LTCOMPILE) -c $(TOP)\src\mem2.c
shanehb2f20bf2011-06-17 07:07:24 +00001215
1216mem3.lo: $(TOP)\src\mem3.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001217 $(LTCOMPILE) -c $(TOP)\src\mem3.c
shanehb2f20bf2011-06-17 07:07:24 +00001218
1219mem5.lo: $(TOP)\src\mem5.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001220 $(LTCOMPILE) -c $(TOP)\src\mem5.c
shanehb2f20bf2011-06-17 07:07:24 +00001221
1222memjournal.lo: $(TOP)\src\memjournal.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001223 $(LTCOMPILE) -c $(TOP)\src\memjournal.c
shanehb2f20bf2011-06-17 07:07:24 +00001224
1225mutex.lo: $(TOP)\src\mutex.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001226 $(LTCOMPILE) -c $(TOP)\src\mutex.c
shanehb2f20bf2011-06-17 07:07:24 +00001227
1228mutex_noop.lo: $(TOP)\src\mutex_noop.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001229 $(LTCOMPILE) -c $(TOP)\src\mutex_noop.c
shanehb2f20bf2011-06-17 07:07:24 +00001230
shanehb2f20bf2011-06-17 07:07:24 +00001231mutex_unix.lo: $(TOP)\src\mutex_unix.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001232 $(LTCOMPILE) -c $(TOP)\src\mutex_unix.c
shanehb2f20bf2011-06-17 07:07:24 +00001233
1234mutex_w32.lo: $(TOP)\src\mutex_w32.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001235 $(LTCOMPILE) -c $(TOP)\src\mutex_w32.c
shanehb2f20bf2011-06-17 07:07:24 +00001236
1237notify.lo: $(TOP)\src\notify.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001238 $(LTCOMPILE) -c $(TOP)\src\notify.c
shanehb2f20bf2011-06-17 07:07:24 +00001239
1240pager.lo: $(TOP)\src\pager.c $(HDR) $(TOP)\src\pager.h
shaneh6e7850c2011-06-17 15:57:07 +00001241 $(LTCOMPILE) -c $(TOP)\src\pager.c
shanehb2f20bf2011-06-17 07:07:24 +00001242
1243pcache.lo: $(TOP)\src\pcache.c $(HDR) $(TOP)\src\pcache.h
shaneh6e7850c2011-06-17 15:57:07 +00001244 $(LTCOMPILE) -c $(TOP)\src\pcache.c
shanehb2f20bf2011-06-17 07:07:24 +00001245
1246pcache1.lo: $(TOP)\src\pcache1.c $(HDR) $(TOP)\src\pcache.h
shaneh6e7850c2011-06-17 15:57:07 +00001247 $(LTCOMPILE) -c $(TOP)\src\pcache1.c
shanehb2f20bf2011-06-17 07:07:24 +00001248
1249os.lo: $(TOP)\src\os.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001250 $(LTCOMPILE) -c $(TOP)\src\os.c
shanehb2f20bf2011-06-17 07:07:24 +00001251
1252os_unix.lo: $(TOP)\src\os_unix.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001253 $(LTCOMPILE) -c $(TOP)\src\os_unix.c
shanehb2f20bf2011-06-17 07:07:24 +00001254
1255os_win.lo: $(TOP)\src\os_win.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001256 $(LTCOMPILE) -c $(TOP)\src\os_win.c
shanehb2f20bf2011-06-17 07:07:24 +00001257
shanehb2f20bf2011-06-17 07:07:24 +00001258pragma.lo: $(TOP)\src\pragma.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001259 $(LTCOMPILE) -c $(TOP)\src\pragma.c
shanehb2f20bf2011-06-17 07:07:24 +00001260
1261prepare.lo: $(TOP)\src\prepare.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001262 $(LTCOMPILE) -c $(TOP)\src\prepare.c
shanehb2f20bf2011-06-17 07:07:24 +00001263
1264printf.lo: $(TOP)\src\printf.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001265 $(LTCOMPILE) -c $(TOP)\src\printf.c
shanehb2f20bf2011-06-17 07:07:24 +00001266
1267random.lo: $(TOP)\src\random.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001268 $(LTCOMPILE) -c $(TOP)\src\random.c
shanehb2f20bf2011-06-17 07:07:24 +00001269
1270resolve.lo: $(TOP)\src\resolve.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001271 $(LTCOMPILE) -c $(TOP)\src\resolve.c
shanehb2f20bf2011-06-17 07:07:24 +00001272
1273rowset.lo: $(TOP)\src\rowset.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001274 $(LTCOMPILE) -c $(TOP)\src\rowset.c
shanehb2f20bf2011-06-17 07:07:24 +00001275
1276select.lo: $(TOP)\src\select.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001277 $(LTCOMPILE) -c $(TOP)\src\select.c
shanehb2f20bf2011-06-17 07:07:24 +00001278
1279status.lo: $(TOP)\src\status.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001280 $(LTCOMPILE) -c $(TOP)\src\status.c
shanehb2f20bf2011-06-17 07:07:24 +00001281
1282table.lo: $(TOP)\src\table.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001283 $(LTCOMPILE) -c $(TOP)\src\table.c
shanehb2f20bf2011-06-17 07:07:24 +00001284
drhf51446a2012-07-21 19:40:42 +00001285threads.lo: $(TOP)\src\threads.c $(HDR)
1286 $(LTCOMPILE) -c $(TOP)\src\threads.c
1287
shanehb2f20bf2011-06-17 07:07:24 +00001288tokenize.lo: $(TOP)\src\tokenize.c keywordhash.h $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001289 $(LTCOMPILE) -c $(TOP)\src\tokenize.c
shanehb2f20bf2011-06-17 07:07:24 +00001290
1291trigger.lo: $(TOP)\src\trigger.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001292 $(LTCOMPILE) -c $(TOP)\src\trigger.c
shanehb2f20bf2011-06-17 07:07:24 +00001293
1294update.lo: $(TOP)\src\update.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001295 $(LTCOMPILE) -c $(TOP)\src\update.c
shanehb2f20bf2011-06-17 07:07:24 +00001296
1297utf.lo: $(TOP)\src\utf.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001298 $(LTCOMPILE) -c $(TOP)\src\utf.c
shanehb2f20bf2011-06-17 07:07:24 +00001299
1300util.lo: $(TOP)\src\util.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001301 $(LTCOMPILE) -c $(TOP)\src\util.c
shanehb2f20bf2011-06-17 07:07:24 +00001302
1303vacuum.lo: $(TOP)\src\vacuum.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001304 $(LTCOMPILE) -c $(TOP)\src\vacuum.c
shanehb2f20bf2011-06-17 07:07:24 +00001305
1306vdbe.lo: $(TOP)\src\vdbe.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001307 $(LTCOMPILE) -c $(TOP)\src\vdbe.c
shanehb2f20bf2011-06-17 07:07:24 +00001308
1309vdbeapi.lo: $(TOP)\src\vdbeapi.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001310 $(LTCOMPILE) -c $(TOP)\src\vdbeapi.c
shanehb2f20bf2011-06-17 07:07:24 +00001311
1312vdbeaux.lo: $(TOP)\src\vdbeaux.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001313 $(LTCOMPILE) -c $(TOP)\src\vdbeaux.c
shanehb2f20bf2011-06-17 07:07:24 +00001314
1315vdbeblob.lo: $(TOP)\src\vdbeblob.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001316 $(LTCOMPILE) -c $(TOP)\src\vdbeblob.c
shanehb2f20bf2011-06-17 07:07:24 +00001317
1318vdbemem.lo: $(TOP)\src\vdbemem.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001319 $(LTCOMPILE) -c $(TOP)\src\vdbemem.c
shanehb2f20bf2011-06-17 07:07:24 +00001320
mistachkin81c428a2011-08-17 02:19:54 +00001321vdbesort.lo: $(TOP)\src\vdbesort.c $(HDR)
1322 $(LTCOMPILE) -c $(TOP)\src\vdbesort.c
1323
shanehb2f20bf2011-06-17 07:07:24 +00001324vdbetrace.lo: $(TOP)\src\vdbetrace.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001325 $(LTCOMPILE) -c $(TOP)\src\vdbetrace.c
shanehb2f20bf2011-06-17 07:07:24 +00001326
1327vtab.lo: $(TOP)\src\vtab.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001328 $(LTCOMPILE) -c $(TOP)\src\vtab.c
shanehb2f20bf2011-06-17 07:07:24 +00001329
1330wal.lo: $(TOP)\src\wal.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001331 $(LTCOMPILE) -c $(TOP)\src\wal.c
shanehb2f20bf2011-06-17 07:07:24 +00001332
1333walker.lo: $(TOP)\src\walker.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001334 $(LTCOMPILE) -c $(TOP)\src\walker.c
shanehb2f20bf2011-06-17 07:07:24 +00001335
1336where.lo: $(TOP)\src\where.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001337 $(LTCOMPILE) -c $(TOP)\src\where.c
shanehb2f20bf2011-06-17 07:07:24 +00001338
1339tclsqlite.lo: $(TOP)\src\tclsqlite.c $(HDR)
1340 $(LTCOMPILE) -DUSE_TCL_STUBS=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c
1341
1342tclsqlite-shell.lo: $(TOP)\src\tclsqlite.c $(HDR)
1343 $(LTCOMPILE) -DTCLSH=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c
1344
mistachkin08c1c312012-10-06 03:48:25 +00001345tclsqlite3.exe: tclsqlite-shell.lo libsqlite3.lib $(LIBRESOBJS)
1346 $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /OUT:$@ libsqlite3.lib tclsqlite-shell.lo $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001347
1348# Rules to build opcodes.c and opcodes.h
1349#
1350opcodes.c: opcodes.h $(TOP)\mkopcodec.awk
drh307ff302011-08-30 01:29:04 +00001351 $(NAWK) -f $(TOP)\mkopcodec.awk opcodes.h > opcodes.c
shanehb2f20bf2011-06-17 07:07:24 +00001352
1353opcodes.h: parse.h $(TOP)\src\vdbe.c $(TOP)\mkopcodeh.awk
mistachkin5b0b6fd2011-06-25 01:14:36 +00001354 type parse.h $(TOP)\src\vdbe.c | $(NAWK) -f $(TOP)\mkopcodeh.awk > opcodes.h
shanehb2f20bf2011-06-17 07:07:24 +00001355
1356# Rules to build parse.c and parse.h - the outputs of lemon.
1357#
1358parse.h: parse.c
1359
1360parse.c: $(TOP)\src\parse.y lemon.exe $(TOP)\addopcodes.awk
shaneh6e7850c2011-06-17 15:57:07 +00001361 del /Q parse.y parse.h parse.h.temp
shanehb2f20bf2011-06-17 07:07:24 +00001362 copy $(TOP)\src\parse.y .
mistachkin4712c212014-05-09 20:51:17 +00001363 .\lemon.exe $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(OPTS) parse.y
shanehb2f20bf2011-06-17 07:07:24 +00001364 move parse.h parse.h.temp
mistachkin5b0b6fd2011-06-25 01:14:36 +00001365 $(NAWK) -f $(TOP)\addopcodes.awk parse.h.temp > parse.h
shanehb2f20bf2011-06-17 07:07:24 +00001366
1367sqlite3.h: $(TOP)\src\sqlite.h.in $(TOP)\manifest.uuid $(TOP)\VERSION
mistachkin3f40d402014-02-13 21:57:48 +00001368 $(TCLSH_CMD) $(TOP)\tool\mksqlite3h.tcl $(TOP:\=/) > sqlite3.h
shanehb2f20bf2011-06-17 07:07:24 +00001369
1370mkkeywordhash.exe: $(TOP)\tool\mkkeywordhash.c
mistachkin2318d332015-01-12 18:02:52 +00001371 $(BCC) $(NO_WARN) -Fe$@ $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(OPTS) \
1372 $(TOP)\tool\mkkeywordhash.c /link $(NLTLINKOPTS) $(NLTLIBPATHS)
shanehb2f20bf2011-06-17 07:07:24 +00001373
1374keywordhash.h: $(TOP)\tool\mkkeywordhash.c mkkeywordhash.exe
mistachkin5b0b6fd2011-06-25 01:14:36 +00001375 .\mkkeywordhash.exe > keywordhash.h
shanehb2f20bf2011-06-17 07:07:24 +00001376
1377
1378
1379# Rules to build the extension objects.
1380#
1381icu.lo: $(TOP)\ext\icu\icu.c $(HDR) $(EXTHDR)
1382 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\icu\icu.c
1383
1384fts2.lo: $(TOP)\ext\fts2\fts2.c $(HDR) $(EXTHDR)
1385 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2.c
1386
1387fts2_hash.lo: $(TOP)\ext\fts2\fts2_hash.c $(HDR) $(EXTHDR)
1388 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_hash.c
1389
1390fts2_icu.lo: $(TOP)\ext\fts2\fts2_icu.c $(HDR) $(EXTHDR)
1391 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_icu.c
1392
1393fts2_porter.lo: $(TOP)\ext\fts2\fts2_porter.c $(HDR) $(EXTHDR)
1394 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_porter.c
1395
1396fts2_tokenizer.lo: $(TOP)\ext\fts2\fts2_tokenizer.c $(HDR) $(EXTHDR)
1397 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_tokenizer.c
1398
1399fts2_tokenizer1.lo: $(TOP)\ext\fts2\fts2_tokenizer1.c $(HDR) $(EXTHDR)
1400 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_tokenizer1.c
1401
1402fts3.lo: $(TOP)\ext\fts3\fts3.c $(HDR) $(EXTHDR)
1403 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3.c
1404
1405fts3_aux.lo: $(TOP)\ext\fts3\fts3_aux.c $(HDR) $(EXTHDR)
1406 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_aux.c
1407
1408fts3_expr.lo: $(TOP)\ext\fts3\fts3_expr.c $(HDR) $(EXTHDR)
1409 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_expr.c
1410
1411fts3_hash.lo: $(TOP)\ext\fts3\fts3_hash.c $(HDR) $(EXTHDR)
1412 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_hash.c
1413
1414fts3_icu.lo: $(TOP)\ext\fts3\fts3_icu.c $(HDR) $(EXTHDR)
1415 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_icu.c
1416
1417fts3_snippet.lo: $(TOP)\ext\fts3\fts3_snippet.c $(HDR) $(EXTHDR)
1418 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_snippet.c
1419
1420fts3_porter.lo: $(TOP)\ext\fts3\fts3_porter.c $(HDR) $(EXTHDR)
1421 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_porter.c
1422
1423fts3_tokenizer.lo: $(TOP)\ext\fts3\fts3_tokenizer.c $(HDR) $(EXTHDR)
1424 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenizer.c
1425
1426fts3_tokenizer1.lo: $(TOP)\ext\fts3\fts3_tokenizer1.c $(HDR) $(EXTHDR)
1427 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenizer1.c
1428
drh4d648c72013-04-22 17:07:56 +00001429fts3_tokenize_vtab.lo: $(TOP)\ext\fts3\fts3_tokenize_vtab.c $(HDR) $(EXTHDR)
1430 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenize_vtab.c
1431
drh391d4ba2012-05-28 20:22:16 +00001432fts3_unicode.lo: $(TOP)\ext\fts3\fts3_unicode.c $(HDR) $(EXTHDR)
1433 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_unicode.c
1434
1435fts3_unicode2.lo: $(TOP)\ext\fts3\fts3_unicode2.c $(HDR) $(EXTHDR)
1436 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_unicode2.c
1437
shanehb2f20bf2011-06-17 07:07:24 +00001438fts3_write.lo: $(TOP)\ext\fts3\fts3_write.c $(HDR) $(EXTHDR)
1439 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_write.c
1440
1441rtree.lo: $(TOP)\ext\rtree\rtree.c $(HDR) $(EXTHDR)
1442 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\rtree\rtree.c
1443
1444
1445# Rules to build the 'testfixture' application.
1446#
1447# If using the amalgamation, use sqlite3.c directly to build the test
1448# fixture. Otherwise link against libsqlite3.lib. (This distinction is
1449# necessary because the test fixture requires non-API symbols which are
1450# hidden when the library is built via the amalgamation).
1451#
1452TESTFIXTURE_FLAGS = -DTCLSH=1 -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
mistachkin27b2f052015-01-12 19:49:46 +00001453TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_SERVER=1 -DSQLITE_PRIVATE=""
1454TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_CORE $(NO_WARN)
shanehb2f20bf2011-06-17 07:07:24 +00001455
drh1fb64af2013-04-25 14:36:28 +00001456TESTFIXTURE_SRC0 = $(TESTEXT) $(TESTSRC2) libsqlite3.lib
mistachkin76510912013-10-11 23:01:18 +00001457TESTFIXTURE_SRC1 = $(TESTEXT) $(SQLITE3C)
shanehb2f20bf2011-06-17 07:07:24 +00001458!IF $(USE_AMALGAMATION)==0
1459TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC0)
1460!ELSE
1461TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC1)
1462!ENDIF
1463
mistachkin08c1c312012-10-06 03:48:25 +00001464testfixture.exe: $(TESTFIXTURE_SRC) $(LIBRESOBJS) $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001465 $(LTLINK) -DSQLITE_NO_SYNC=1 $(TESTFIXTURE_FLAGS) \
shanehb2f20bf2011-06-17 07:07:24 +00001466 -DBUILD_sqlite -I$(TCLINCDIR) \
shaneh2a0b9ef2011-06-20 20:52:32 +00001467 $(TESTFIXTURE_SRC) \
mistachkin08c1c312012-10-06 03:48:25 +00001468 /link $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001469
mistachkin1925a2e2014-02-24 21:20:25 +00001470extensiontest: testfixture.exe testloadext.dll
1471 .\testfixture.exe $(TOP)\test\loadext.test
shanehb2f20bf2011-06-17 07:07:24 +00001472
1473fulltest: testfixture.exe sqlite3.exe
1474 .\testfixture.exe $(TOP)\test\all.test
1475
1476soaktest: testfixture.exe sqlite3.exe
1477 .\testfixture.exe $(TOP)\test\all.test -soak=1
1478
mistachkinc60941f2012-09-13 01:51:02 +00001479fulltestonly: testfixture.exe sqlite3.exe
1480 .\testfixture.exe $(TOP)\test\full.test
1481
mistachkin036acf32013-07-20 00:34:31 +00001482queryplantest: testfixture.exe sqlite3.exe
1483 .\testfixture.exe $(TOP)\test\permutations.test queryplanner
1484
shanehb2f20bf2011-06-17 07:07:24 +00001485test: testfixture.exe sqlite3.exe
1486 .\testfixture.exe $(TOP)\test\veryquick.test
1487
mistachkin76510912013-10-11 23:01:18 +00001488sqlite3_analyzer.c: $(SQLITE3C) $(TOP)\src\test_stat.c $(TOP)\src\tclsqlite.c $(TOP)\tool\spaceanal.tcl
1489 copy $(SQLITE3C) + $(TOP)\src\test_stat.c + $(TOP)\src\tclsqlite.c $@
mistachkin9a55e312011-09-22 00:06:44 +00001490 echo static const char *tclsh_main_loop(void){ >> $@
1491 echo static const char *zMainloop = >> $@
1492 $(NAWK) -f $(TOP)\tool\tostr.awk $(TOP)\tool\spaceanal.tcl >> $@
1493 echo ; return zMainloop; } >> $@
shanehb2f20bf2011-06-17 07:07:24 +00001494
mistachkin08c1c312012-10-06 03:48:25 +00001495sqlite3_analyzer.exe: sqlite3_analyzer.c $(LIBRESOBJS)
mistachkin9a55e312011-09-22 00:06:44 +00001496 $(LTLINK) -DBUILD_sqlite -DTCLSH=2 -I$(TCLINCDIR) sqlite3_analyzer.c \
mistachkin08c1c312012-10-06 03:48:25 +00001497 /link $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001498
mistachkin1925a2e2014-02-24 21:20:25 +00001499testloadext.lo: $(TOP)\src\test_loadext.c
1500 $(LTCOMPILE) -c $(TOP)\src\test_loadext.c
1501
1502testloadext.dll: testloadext.lo
1503 $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /OUT:$@ testloadext.lo
1504
mistachkinb0427512014-01-30 11:12:52 +00001505showdb.exe: $(TOP)\tool\showdb.c $(SQLITE3C)
1506 $(LTLINK) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
1507 $(TOP)\tool\showdb.c $(SQLITE3C)
drh9ac3c1e2013-11-07 18:37:31 +00001508
drh4bb77ec2014-06-30 11:14:26 +00001509showstat4.exe: $(TOP)\tool\showstat4.c $(SQLITE3C)
1510 $(LTLINK) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
1511 $(TOP)\tool\showstat4.c $(SQLITE3C)
1512
1513showjournal.exe: $(TOP)\tool\showjournal.c $(SQLITE3C)
1514 $(LTLINK) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
1515 $(TOP)\tool\showjournal.c $(SQLITE3C)
1516
1517showwal.exe: $(TOP)\tool\showwal.c $(SQLITE3C)
1518 $(LTLINK) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
1519 $(TOP)\tool\showwal.c $(SQLITE3C)
1520
mistachkinde545272014-07-07 17:57:50 +00001521fts3view.exe: $(TOP)\ext\fts3\tool\fts3view.c $(SQLITE3C)
1522 $(LTLINK) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
1523 $(TOP)\ext\fts3\tool\fts3view.c $(SQLITE3C)
1524
drh4bb77ec2014-06-30 11:14:26 +00001525rollback-test.exe: $(TOP)\tool\rollback-test.c $(SQLITE3C)
1526 $(LTLINK) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
1527 $(TOP)\tool\rollback-test.c $(SQLITE3C)
1528
drh267a13f2014-06-18 18:10:12 +00001529LogEst.exe: $(TOP)\tool\logest.c sqlite3.h
1530 $(LTLINK) -Fe$@ $(TOP)\tool\LogEst.c
1531
mistachkinb0427512014-01-30 11:12:52 +00001532wordcount.exe: $(TOP)\test\wordcount.c $(SQLITE3C)
1533 $(LTLINK) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
1534 $(TOP)\test\wordcount.c $(SQLITE3C)
drh9ac3c1e2013-11-07 18:37:31 +00001535
mistachkinb0427512014-01-30 11:12:52 +00001536speedtest1.exe: $(TOP)\test\speedtest1.c $(SQLITE3C)
1537 $(LTLINK) -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
1538 $(TOP)\test\speedtest1.c $(SQLITE3C)
shanehb2f20bf2011-06-17 07:07:24 +00001539
shaneh6e7850c2011-06-17 15:57:07 +00001540clean:
mistachkin8d8738e2015-02-25 01:06:08 +00001541 del /Q *.lo *.ilk *.lib *.obj *.pdb sqlite3.exe libsqlite3.lib 2>NUL
1542 del /Q *.cod *.da *.bb *.bbg gmon.out 2>NUL
1543 del /Q sqlite3.h opcodes.c opcodes.h 2>NUL
1544 del /Q lemon.* lempar.c parse.* 2>NUL
1545 del /Q mkkeywordhash.* keywordhash.h 2>NUL
1546 del /Q notasharedlib.* 2>NUL
1547 -rmdir /Q/S .deps 2>NUL
1548 -rmdir /Q/S .libs 2>NUL
1549 -rmdir /Q/S quota2a 2>NUL
1550 -rmdir /Q/S quota2b 2>NUL
1551 -rmdir /Q/S quota2c 2>NUL
1552 -rmdir /Q/S tsrc 2>NUL
1553 del /Q .target_source 2>NUL
1554 del /Q tclsqlite3.exe tclsqlite3.exp 2>NUL
1555 del /Q testloadext.dll testloadext.exp 2>NUL
1556 del /Q testfixture.exe testfixture.exp test.db 2>NUL
1557 del /Q LogEst.exe fts3view.exe rollback-test.exe showdb.exe 2>NUL
1558 del /Q showjournal.exe showstat4.exe showwal.exe speedtest1.exe 2>NUL
1559 del /Q wordcount.exe 2>NUL
1560 del /Q sqlite3.dll sqlite3.lib sqlite3.exp sqlite3.def 2>NUL
1561 del /Q sqlite3.c sqlite3-*.c 2>NUL
1562 del /Q sqlite3rc.h 2>NUL
1563 del /Q shell.c sqlite3ext.h 2>NUL
1564 del /Q sqlite3_analyzer.exe sqlite3_analyzer.exp sqlite3_analyzer.c 2>NUL
1565 del /Q sqlite-*-output.vsix 2>NUL
1566 del /Q mptester.exe 2>NUL
shanehb2f20bf2011-06-17 07:07:24 +00001567
mistachkin4d9d1f42012-09-03 10:32:32 +00001568# Dynamic link library section.
shanehb2f20bf2011-06-17 07:07:24 +00001569#
1570dll: sqlite3.dll
1571
shaneh6e7850c2011-06-17 15:57:07 +00001572sqlite3.def: libsqlite3.lib
mistachkin5b0b6fd2011-06-25 01:14:36 +00001573 echo EXPORTS > sqlite3.def
shaneh6e7850c2011-06-17 15:57:07 +00001574 dumpbin /all libsqlite3.lib \
mistachkin6a3eb4a2011-08-17 07:46:48 +00001575 | $(NAWK) "/ 1 _?sqlite3_/ { sub(/^.* _?/,\"\");print }" \
mistachkin5b0b6fd2011-06-25 01:14:36 +00001576 | sort >> sqlite3.def
shanehb2f20bf2011-06-17 07:07:24 +00001577
mistachkin08c1c312012-10-06 03:48:25 +00001578sqlite3.dll: $(LIBOBJ) $(LIBRESOBJS) sqlite3.def
1579 $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /DEF:sqlite3.def /OUT:$@ $(LIBOBJ) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)