blob: 3a9fa297405d9259b3489cb0606ceb36bd876446 [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
mistachkina5e2b502014-05-12 22:36:50 +000019# Set this non-0 to use the library paths and other options necessary for
20# Windows Phone 8.1.
mistachkind9b3c542014-05-09 23:31:55 +000021#
22!IFNDEF USE_WP81_OPTS
23USE_WP81_OPTS = 0
24!ENDIF
25
mistachkin76510912013-10-11 23:01:18 +000026# Set this non-0 to split the SQLite amalgamation file into chunks to
27# be used for debugging with Visual Studio.
28#
29!IFNDEF SPLIT_AMALGAMATION
mistachkin0aedc6b2013-10-11 23:02:13 +000030SPLIT_AMALGAMATION = 0
mistachkin76510912013-10-11 23:01:18 +000031!ENDIF
32
mistachkinc756ded2011-10-02 05:23:16 +000033# Set this non-0 to use the International Components for Unicode (ICU).
34#
mistachkin0ec07442012-10-12 18:06:07 +000035!IFNDEF USE_ICU
mistachkinc756ded2011-10-02 05:23:16 +000036USE_ICU = 0
mistachkin0ec07442012-10-12 18:06:07 +000037!ENDIF
mistachkinc756ded2011-10-02 05:23:16 +000038
mistachkin8d967a92012-06-21 04:21:35 +000039# Set this non-0 to dynamically link to the MSVC runtime library.
40#
mistachkin0ec07442012-10-12 18:06:07 +000041!IFNDEF USE_CRT_DLL
mistachkin8d967a92012-06-21 04:21:35 +000042USE_CRT_DLL = 0
mistachkin0ec07442012-10-12 18:06:07 +000043!ENDIF
mistachkin8d967a92012-06-21 04:21:35 +000044
mistachkin0157e012013-09-06 21:41:11 +000045# Set this non-0 to generate assembly code listings for the source code
46# files.
47#
48!IFNDEF USE_LISTINGS
49USE_LISTINGS = 0
50!ENDIF
51
mistachkin52fd8e12012-08-28 01:44:13 +000052# Set this non-0 to attempt setting the native compiler automatically
53# for cross-compiling the command line tools needed during the compilation
54# process.
55#
mistachkin0ec07442012-10-12 18:06:07 +000056!IFNDEF XCOMPILE
mistachkin52fd8e12012-08-28 01:44:13 +000057XCOMPILE = 0
mistachkin0ec07442012-10-12 18:06:07 +000058!ENDIF
mistachkin52fd8e12012-08-28 01:44:13 +000059
mistachkinbd58d5f2012-06-30 22:22:34 +000060# Set this non-0 to use the native libraries paths for cross-compiling
61# the command line tools needed during the compilation process.
62#
mistachkin0ec07442012-10-12 18:06:07 +000063!IFNDEF USE_NATIVE_LIBPATHS
mistachkinbd58d5f2012-06-30 22:22:34 +000064USE_NATIVE_LIBPATHS = 0
mistachkin0ec07442012-10-12 18:06:07 +000065!ENDIF
mistachkinbd58d5f2012-06-30 22:22:34 +000066
mistachkin08c1c312012-10-06 03:48:25 +000067# Set this 0 to skip the compiling and embedding of version resources.
68#
mistachkin0ec07442012-10-12 18:06:07 +000069!IFNDEF USE_RC
mistachkin08c1c312012-10-06 03:48:25 +000070USE_RC = 1
mistachkin0ec07442012-10-12 18:06:07 +000071!ENDIF
mistachkin08c1c312012-10-06 03:48:25 +000072
mistachkin46b721a2012-03-23 12:28:21 +000073# Set this non-0 to compile binaries suitable for the WinRT environment.
74# This setting does not apply to any binaries that require Tcl to operate
75# properly (i.e. the text fixture, etc).
76#
mistachkin0ec07442012-10-12 18:06:07 +000077!IFNDEF FOR_WINRT
mistachkin46b721a2012-03-23 12:28:21 +000078FOR_WINRT = 0
mistachkin0ec07442012-10-12 18:06:07 +000079!ENDIF
mistachkin46b721a2012-03-23 12:28:21 +000080
mistachkin31856a32012-07-27 07:13:25 +000081# Set this non-0 to skip attempting to look for and/or link with the Tcl
82# runtime library.
83#
mistachkin0ec07442012-10-12 18:06:07 +000084!IFNDEF NO_TCL
mistachkin31856a32012-07-27 07:13:25 +000085NO_TCL = 0
mistachkin0ec07442012-10-12 18:06:07 +000086!ENDIF
mistachkin31856a32012-07-27 07:13:25 +000087
mistachkin4d60be52011-08-26 05:40:31 +000088# Set this to non-0 to create and use PDBs.
89#
mistachkin0ec07442012-10-12 18:06:07 +000090!IFNDEF SYMBOLS
mistachkin4d60be52011-08-26 05:40:31 +000091SYMBOLS = 1
mistachkin0ec07442012-10-12 18:06:07 +000092!ENDIF
mistachkin4d60be52011-08-26 05:40:31 +000093
mistachkin2f7d5d82012-08-22 00:39:34 +000094# Set this to non-0 to use the SQLite debugging heap subsystem.
95#
mistachkin0ec07442012-10-12 18:06:07 +000096!IFNDEF MEMDEBUG
mistachkin2f7d5d82012-08-22 00:39:34 +000097MEMDEBUG = 0
mistachkin0ec07442012-10-12 18:06:07 +000098!ENDIF
mistachkin2f7d5d82012-08-22 00:39:34 +000099
100# Set this to non-0 to use the Win32 native heap subsystem.
101#
mistachkin0ec07442012-10-12 18:06:07 +0000102!IFNDEF WIN32HEAP
mistachkin2f7d5d82012-08-22 00:39:34 +0000103WIN32HEAP = 0
mistachkin0ec07442012-10-12 18:06:07 +0000104!ENDIF
mistachkin2f7d5d82012-08-22 00:39:34 +0000105
mistachkinf2d25f22011-08-25 04:09:12 +0000106# Set this to one of the following values to enable various debugging
107# features. Each level includes the debugging options from the previous
108# levels. Currently, the recognized values for DEBUG are:
109#
110# 0 == NDEBUG: Disables assert() and other runtime diagnostics.
111# 1 == Disables NDEBUG and all optimizations and then enables PDBs.
112# 2 == SQLITE_DEBUG: Enables various diagnostics messages and code.
113# 3 == SQLITE_WIN32_MALLOC_VALIDATE: Validate the Win32 native heap per call.
114# 4 == SQLITE_DEBUG_OS_TRACE: Enables output from the OSTRACE() macros.
115# 5 == SQLITE_ENABLE_IOTRACE: Enables output from the IOTRACE() macros.
116#
mistachkin0ec07442012-10-12 18:06:07 +0000117!IFNDEF DEBUG
mistachkinf2d25f22011-08-25 04:09:12 +0000118DEBUG = 0
mistachkin0ec07442012-10-12 18:06:07 +0000119!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000120
mistachkin8bcd3fa2013-08-29 01:03:38 +0000121# Enable use of available compiler optimizations? Normally, this should be
122# non-zero. Setting this to zero, thus disabling all compiler optimizations,
123# can be useful for testing.
124#
125!IFNDEF OPTIMIZATIONS
126OPTIMIZATIONS = 2
127!ENDIF
128
mistachkin4712c212014-05-09 20:51:17 +0000129# These are the "standard" SQLite compilation options used when compiling for
130# the Windows platform.
131#
132!IFNDEF OPT_FEATURE_FLAGS
133OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS3=1
134OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RTREE=1
135OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_COLUMN_METADATA=1
136!ENDIF
137
138###############################################################################
139############################### END OF OPTIONS ################################
140###############################################################################
141
mistachkind9b3c542014-05-09 23:31:55 +0000142# This assumes that MSVC is always installed in 32-bit Program Files directory
143# and sets the variable for use in locating other 32-bit installs accordingly.
144#
145PROGRAMFILES_X86 = $(VCINSTALLDIR)\..\..
146PROGRAMFILES_X86 = $(PROGRAMFILES_X86:\\=\)
147
mistachkine37f99c2012-06-30 16:22:05 +0000148# Check for the predefined command macro CC. This should point to the compiler
mistachkinbd58d5f2012-06-30 22:22:34 +0000149# binary for the target platform. If it is not defined, simply define it to
mistachkine37f99c2012-06-30 16:22:05 +0000150# the legacy default value 'cl.exe'.
151#
152!IFNDEF CC
153CC = cl.exe
154!ENDIF
155
mistachkin228aeff2012-06-30 19:24:09 +0000156# Check for the command macro LD. This should point to the linker binary for
mistachkinbd58d5f2012-06-30 22:22:34 +0000157# the target platform. If it is not defined, simply define it to the legacy
mistachkin228aeff2012-06-30 19:24:09 +0000158# default value 'link.exe'.
159#
160!IFNDEF LD
161LD = link.exe
162!ENDIF
163
mistachkin4d9d1f42012-09-03 10:32:32 +0000164# Check for the predefined command macro RC. This should point to the resource
165# compiler binary for the target platform. If it is not defined, simply define
166# it to the legacy default value 'rc.exe'.
167#
168!IFNDEF RC
169RC = rc.exe
170!ENDIF
171
mistachkin4712c212014-05-09 20:51:17 +0000172# Check for the MSVC runtime library path macro. Othertise, this value will
173# default to the 'lib' directory underneath the MSVC installation directory.
174#
175!IFNDEF CRTLIBPATH
176CRTLIBPATH = $(VCINSTALLDIR)\lib
177!ENDIF
178
179CRTLIBPATH = $(CRTLIBPATH:\\=\)
180
mistachkine37f99c2012-06-30 16:22:05 +0000181# Check for the command macro NCC. This should point to the compiler binary
mistachkinbd58d5f2012-06-30 22:22:34 +0000182# for the platform the compilation process is taking place on. If it is not
183# defined, simply define it to have the same value as the CC macro. When
mistachkine37f99c2012-06-30 16:22:05 +0000184# cross-compiling, it is suggested that this macro be modified via the command
185# line (since nmake itself does not provide a built-in method to guess it).
186# For example, to use the x86 compiler when cross-compiling for x64, a command
mistachkinbd58d5f2012-06-30 22:22:34 +0000187# line similar to the following could be used (all on one line):
mistachkine37f99c2012-06-30 16:22:05 +0000188#
mistachkin6f928332012-08-17 11:47:32 +0000189# nmake /f Makefile.msc sqlite3.dll
mistachkin52fd8e12012-08-28 01:44:13 +0000190# XCOMPILE=1 USE_NATIVE_LIBPATHS=1
191#
192# Alternatively, the full path and file name to the compiler binary for the
193# platform the compilation process is taking place may be specified (all on
194# one line):
195#
196# nmake /f Makefile.msc sqlite3.dll
mistachkinbd58d5f2012-06-30 22:22:34 +0000197# "NCC=""%VCINSTALLDIR%\bin\cl.exe"""
198# USE_NATIVE_LIBPATHS=1
mistachkine37f99c2012-06-30 16:22:05 +0000199#
mistachkinfd0ba2a2012-07-27 08:21:45 +0000200!IFDEF NCC
201NCC = $(NCC:\\=\)
mistachkin52fd8e12012-08-28 01:44:13 +0000202!ELSEIF $(XCOMPILE)!=0
mistachkin5fac4202013-12-03 23:33:29 +0000203NCC = "$(VCINSTALLDIR)\bin\$(CC)"
mistachkin52fd8e12012-08-28 01:44:13 +0000204NCC = $(NCC:\\=\)
mistachkinfd0ba2a2012-07-27 08:21:45 +0000205!ELSE
mistachkine37f99c2012-06-30 16:22:05 +0000206NCC = $(CC)
207!ENDIF
208
mistachkin4712c212014-05-09 20:51:17 +0000209# Check for the MSVC native runtime library path macro. Othertise,
210# this value will default to the 'lib' directory underneath the MSVC
mistachkinbd58d5f2012-06-30 22:22:34 +0000211# installation directory.
212#
213!IFNDEF NCRTLIBPATH
214NCRTLIBPATH = $(VCINSTALLDIR)\lib
215!ENDIF
216
mistachkin0b5ae722012-07-27 23:03:47 +0000217NCRTLIBPATH = $(NCRTLIBPATH:\\=\)
218
mistachkinbd58d5f2012-06-30 22:22:34 +0000219# Check for the Platform SDK library path macro. Othertise, this
220# value will default to the 'lib' directory underneath the Windows
221# SDK installation directory (the environment variable used appears
222# to be available when using Visual C++ 2008 or later via the
223# command line).
224#
225!IFNDEF NSDKLIBPATH
226NSDKLIBPATH = $(WINDOWSSDKDIR)\lib
227!ENDIF
228
mistachkin0b5ae722012-07-27 23:03:47 +0000229NSDKLIBPATH = $(NSDKLIBPATH:\\=\)
230
mistachkinbd58d5f2012-06-30 22:22:34 +0000231# C compiler and options for use in building executables that
shanehb2f20bf2011-06-17 07:07:24 +0000232# will run on the platform that is doing the build.
233#
mistachkine37f99c2012-06-30 16:22:05 +0000234BCC = $(NCC) -W3
shanehb2f20bf2011-06-17 07:07:24 +0000235
mistachkin0157e012013-09-06 21:41:11 +0000236# Check if assembly code listings should be generated for the source
237# code files to be compiled.
238#
239!IF $(USE_LISTINGS)!=0
240BCC = $(BCC) -FAcs
241!ENDIF
242
mistachkinbd58d5f2012-06-30 22:22:34 +0000243# Check if the native library paths should be used when compiling
244# the command line tools used during the compilation process. If
245# so, set the necessary macro now.
246#
247!IF $(USE_NATIVE_LIBPATHS)!=0
248NLTLIBPATHS = "/LIBPATH:$(NCRTLIBPATH)" "/LIBPATH:$(NSDKLIBPATH)"
249!ENDIF
250
251# C compiler and options for use in building executables that
shanehb2f20bf2011-06-17 07:07:24 +0000252# will run on the target platform. (BCC and TCC are usually the
253# same unless your are cross-compiling.)
254#
mistachkin3f40d402014-02-13 21:57:48 +0000255TCC = $(CC) -W3 -DSQLITE_OS_WIN=1 -I. -I$(TOP) -I$(TOP)\src -fp:precise
mistachkin8ccc6d42012-09-27 21:03:53 +0000256RCC = $(RC) -DSQLITE_OS_WIN=1 -I$(TOP) -I$(TOP)\src
shaneh6e7850c2011-06-17 15:57:07 +0000257
mistachkin0157e012013-09-06 21:41:11 +0000258# Check if assembly code listings should be generated for the source
259# code files to be compiled.
260#
261!IF $(USE_LISTINGS)!=0
262TCC = $(TCC) -FAcs
263!ENDIF
264
mistachkinf39eaf22012-03-20 02:18:42 +0000265# When compiling the library for use in the WinRT environment,
mistachkin46b721a2012-03-23 12:28:21 +0000266# the following compile-time options must be used as well to
mistachkinf39eaf22012-03-20 02:18:42 +0000267# disable use of Win32 APIs that are not available and to enable
268# use of Win32 APIs that are specific to Windows 8 and/or WinRT.
269#
mistachkin46b721a2012-03-23 12:28:21 +0000270!IF $(FOR_WINRT)!=0
mistachkin8d967a92012-06-21 04:21:35 +0000271TCC = $(TCC) -DSQLITE_OS_WINRT=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000272RCC = $(RCC) -DSQLITE_OS_WINRT=1
mistachkin08c1c312012-10-06 03:48:25 +0000273TCC = $(TCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
274RCC = $(RCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
mistachkin8d967a92012-06-21 04:21:35 +0000275!ENDIF
276
277# Also, we need to dynamically link to the correct MSVC runtime
278# when compiling for WinRT (e.g. debug or release) OR if the
279# USE_CRT_DLL option is set to force dynamically linking to the
280# MSVC runtime library.
281#
282!IF $(FOR_WINRT)!=0 || $(USE_CRT_DLL)!=0
283!IF $(DEBUG)>0
284TCC = $(TCC) -MDd
mistachkin08c1c312012-10-06 03:48:25 +0000285BCC = $(BCC) -MDd
mistachkin8d967a92012-06-21 04:21:35 +0000286!ELSE
287TCC = $(TCC) -MD
mistachkin08c1c312012-10-06 03:48:25 +0000288BCC = $(BCC) -MD
mistachkin8d967a92012-06-21 04:21:35 +0000289!ENDIF
290!ELSE
291!IF $(DEBUG)>0
292TCC = $(TCC) -MTd
mistachkin08c1c312012-10-06 03:48:25 +0000293BCC = $(BCC) -MTd
mistachkin8d967a92012-06-21 04:21:35 +0000294!ELSE
295TCC = $(TCC) -MT
mistachkin08c1c312012-10-06 03:48:25 +0000296BCC = $(BCC) -MT
mistachkin8d967a92012-06-21 04:21:35 +0000297!ENDIF
mistachkin46b721a2012-03-23 12:28:21 +0000298!ENDIF
mistachkinf39eaf22012-03-20 02:18:42 +0000299
300# The mksqlite3c.tcl and mksqlite3h.tcl scripts will pull in
shaneh6e7850c2011-06-17 15:57:07 +0000301# any extension header files by default. For non-amalgamation
302# builds, we need to make sure the compiler can find these.
303#
304!IF $(USE_AMALGAMATION)==0
305TCC = $(TCC) -I$(TOP)\ext\fts3
mistachkin4d9d1f42012-09-03 10:32:32 +0000306RCC = $(RCC) -I$(TOP)\ext\fts3
shaneh6e7850c2011-06-17 15:57:07 +0000307TCC = $(TCC) -I$(TOP)\ext\rtree
mistachkin4d9d1f42012-09-03 10:32:32 +0000308RCC = $(RCC) -I$(TOP)\ext\rtree
shaneh6e7850c2011-06-17 15:57:07 +0000309!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000310
mistachkinb0427512014-01-30 11:12:52 +0000311# The mksqlite3c.tcl script accepts some options on the command
312# line. When compiling with debugging enabled, some of these
313# options are necessary in order to allow debugging symbols to
314# work correctly with Visual Studio when using the amalgamation.
315#
316!IF $(DEBUG)>0
317MKSQLITE3C_ARGS = --linemacros
318!ELSE
319MKSQLITE3C_ARGS =
320!ENDIF
321
shanehb2f20bf2011-06-17 07:07:24 +0000322# Define -DNDEBUG to compile without debugging (i.e., for production usage)
323# Omitting the define will cause extra debugging code to be inserted and
324# includes extra comments when "EXPLAIN stmt" is used.
325#
mistachkin753c5442011-08-25 02:02:25 +0000326!IF $(DEBUG)==0
shanehb2f20bf2011-06-17 07:07:24 +0000327TCC = $(TCC) -DNDEBUG
mistachkinfec360a2012-04-18 10:29:21 +0000328BCC = $(BCC) -DNDEBUG
mistachkin4d9d1f42012-09-03 10:32:32 +0000329RCC = $(RCC) -DNDEBUG
mistachkin753c5442011-08-25 02:02:25 +0000330!ENDIF
331
332!IF $(DEBUG)>1
333TCC = $(TCC) -DSQLITE_DEBUG
mistachkin4d9d1f42012-09-03 10:32:32 +0000334RCC = $(RCC) -DSQLITE_DEBUG
mistachkin753c5442011-08-25 02:02:25 +0000335!ENDIF
336
337!IF $(DEBUG)>3
338TCC = $(TCC) -DSQLITE_DEBUG_OS_TRACE=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000339RCC = $(RCC) -DSQLITE_DEBUG_OS_TRACE=1
mistachkin753c5442011-08-25 02:02:25 +0000340!ENDIF
341
342!IF $(DEBUG)>4
343TCC = $(TCC) -DSQLITE_ENABLE_IOTRACE
mistachkin4d9d1f42012-09-03 10:32:32 +0000344RCC = $(RCC) -DSQLITE_ENABLE_IOTRACE
mistachkin753c5442011-08-25 02:02:25 +0000345!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000346
mistachkinbd58d5f2012-06-30 22:22:34 +0000347# Prevent warnings about "insecure" MSVC runtime library functions
348# being used.
mistachkin176f1b42011-08-02 23:34:00 +0000349#
350TCC = $(TCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
mistachkinfec360a2012-04-18 10:29:21 +0000351BCC = $(BCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
mistachkin4d9d1f42012-09-03 10:32:32 +0000352RCC = $(RCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
mistachkin176f1b42011-08-02 23:34:00 +0000353
mistachkinbd58d5f2012-06-30 22:22:34 +0000354# Prevent warnings about "deprecated" POSIX functions being used.
355#
356TCC = $(TCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
357BCC = $(BCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
mistachkin4d9d1f42012-09-03 10:32:32 +0000358RCC = $(RCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
mistachkinbd58d5f2012-06-30 22:22:34 +0000359
mistachkin2f7d5d82012-08-22 00:39:34 +0000360# Use the SQLite debugging heap subsystem?
mistachkin1b186a92011-08-24 16:13:57 +0000361#
mistachkin2f7d5d82012-08-22 00:39:34 +0000362!IF $(MEMDEBUG)!=0
363TCC = $(TCC) -DSQLITE_MEMDEBUG=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000364RCC = $(RCC) -DSQLITE_MEMDEBUG=1
mistachkin2f7d5d82012-08-22 00:39:34 +0000365
mistachkin2f7d5d82012-08-22 00:39:34 +0000366# Use native Win32 heap subsystem instead of malloc/free?
367#
368!ELSEIF $(WIN32HEAP)!=0
369TCC = $(TCC) -DSQLITE_WIN32_MALLOC=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000370RCC = $(RCC) -DSQLITE_WIN32_MALLOC=1
mistachkin753c5442011-08-25 02:02:25 +0000371
mistachkin753c5442011-08-25 02:02:25 +0000372# Validate the heap on every call into the native Win32 heap subsystem?
373#
374!IF $(DEBUG)>2
375TCC = $(TCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000376RCC = $(RCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1
mistachkin753c5442011-08-25 02:02:25 +0000377!ENDIF
mistachkin2f7d5d82012-08-22 00:39:34 +0000378!ENDIF
mistachkin1b186a92011-08-24 16:13:57 +0000379
mistachkin5b0b6fd2011-06-25 01:14:36 +0000380# The locations of the Tcl header and library files. Also, the library that
381# non-stubs enabled programs using Tcl must link against. These variables
382# (TCLINCDIR, TCLLIBDIR, and LIBTCL) may be overridden via the environment
383# prior to running nmake in order to match the actual installed location and
384# version on this machine.
shanehb2f20bf2011-06-17 07:07:24 +0000385#
mistachkine37f99c2012-06-30 16:22:05 +0000386!IFNDEF TCLINCDIR
shanehb2f20bf2011-06-17 07:07:24 +0000387TCLINCDIR = c:\tcl\include
mistachkine37f99c2012-06-30 16:22:05 +0000388!ENDIF
mistachkin5b0b6fd2011-06-25 01:14:36 +0000389
mistachkine37f99c2012-06-30 16:22:05 +0000390!IFNDEF TCLLIBDIR
shanehb2f20bf2011-06-17 07:07:24 +0000391TCLLIBDIR = c:\tcl\lib
mistachkine37f99c2012-06-30 16:22:05 +0000392!ENDIF
mistachkin5b0b6fd2011-06-25 01:14:36 +0000393
mistachkine37f99c2012-06-30 16:22:05 +0000394!IFNDEF LIBTCL
mistachkin5b0b6fd2011-06-25 01:14:36 +0000395LIBTCL = tcl85.lib
mistachkine37f99c2012-06-30 16:22:05 +0000396!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000397
mistachkinc756ded2011-10-02 05:23:16 +0000398# The locations of the ICU header and library files. These variables
399# (ICUINCDIR, ICULIBDIR, and LIBICU) may be overridden via the environment
400# prior to running nmake in order to match the actual installed location on
401# this machine.
402#
mistachkine37f99c2012-06-30 16:22:05 +0000403!IFNDEF ICUINCDIR
mistachkinc756ded2011-10-02 05:23:16 +0000404ICUINCDIR = c:\icu\include
mistachkine37f99c2012-06-30 16:22:05 +0000405!ENDIF
mistachkinc756ded2011-10-02 05:23:16 +0000406
mistachkine37f99c2012-06-30 16:22:05 +0000407!IFNDEF ICULIBDIR
mistachkinc756ded2011-10-02 05:23:16 +0000408ICULIBDIR = c:\icu\lib
mistachkine37f99c2012-06-30 16:22:05 +0000409!ENDIF
mistachkinc756ded2011-10-02 05:23:16 +0000410
mistachkine37f99c2012-06-30 16:22:05 +0000411!IFNDEF LIBICU
mistachkinc756ded2011-10-02 05:23:16 +0000412LIBICU = icuuc.lib icuin.lib
mistachkine37f99c2012-06-30 16:22:05 +0000413!ENDIF
mistachkinc756ded2011-10-02 05:23:16 +0000414
shanehb2f20bf2011-06-17 07:07:24 +0000415# This is the command to use for tclsh - normally just "tclsh", but we may
mistachkin5b0b6fd2011-06-25 01:14:36 +0000416# know the specific version we want to use. This variable (TCLSH_CMD) may be
417# overridden via the environment prior to running nmake in order to select a
418# specific Tcl shell to use.
shanehb2f20bf2011-06-17 07:07:24 +0000419#
mistachkine37f99c2012-06-30 16:22:05 +0000420!IFNDEF TCLSH_CMD
shanehb2f20bf2011-06-17 07:07:24 +0000421TCLSH_CMD = tclsh85
mistachkine37f99c2012-06-30 16:22:05 +0000422!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000423
424# Compiler options needed for programs that use the readline() library.
425#
mistachkin8bcd3fa2013-08-29 01:03:38 +0000426!IFNDEF READLINE_FLAGS
shaneh6e7850c2011-06-17 15:57:07 +0000427READLINE_FLAGS = -DHAVE_READLINE=0
mistachkin8bcd3fa2013-08-29 01:03:38 +0000428!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000429
430# The library that programs using readline() must link against.
431#
mistachkin8bcd3fa2013-08-29 01:03:38 +0000432!IFNDEF LIBREADLINE
shaneh6e7850c2011-06-17 15:57:07 +0000433LIBREADLINE =
mistachkin8bcd3fa2013-08-29 01:03:38 +0000434!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000435
436# Should the database engine be compiled threadsafe
437#
438TCC = $(TCC) -DSQLITE_THREADSAFE=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000439RCC = $(RCC) -DSQLITE_THREADSAFE=1
shanehb2f20bf2011-06-17 07:07:24 +0000440
441# Do threads override each others locks by default (1), or do we test (-1)
442#
443TCC = $(TCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1
mistachkin4d9d1f42012-09-03 10:32:32 +0000444RCC = $(RCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1
shanehb2f20bf2011-06-17 07:07:24 +0000445
446# Any target libraries which libsqlite must be linked against
shaneh6e7850c2011-06-17 15:57:07 +0000447#
mistachkine37f99c2012-06-30 16:22:05 +0000448!IFNDEF TLIBS
shaneh6e7850c2011-06-17 15:57:07 +0000449TLIBS =
mistachkine37f99c2012-06-30 16:22:05 +0000450!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000451
452# Flags controlling use of the in memory btree implementation
453#
454# SQLITE_TEMP_STORE is 0 to force temporary tables to be in a file, 1 to
455# default to file, 2 to default to memory, and 3 to force temporary
456# tables to always be in memory.
457#
shaneh6e7850c2011-06-17 15:57:07 +0000458TCC = $(TCC) -DSQLITE_TEMP_STORE=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000459RCC = $(RCC) -DSQLITE_TEMP_STORE=1
shanehb2f20bf2011-06-17 07:07:24 +0000460
461# Enable/disable loadable extensions, and other optional features
shaneh6e7850c2011-06-17 15:57:07 +0000462# based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*).
463# The same set of OMIT and ENABLE flags should be passed to the
shanehb2f20bf2011-06-17 07:07:24 +0000464# LEMON parser generator and the mkkeywordhash tool as well.
465
mistachkin4712c212014-05-09 20:51:17 +0000466# These are the required SQLite compilation options used when compiling for
467# the Windows platform.
468#
469REQ_FEATURE_FLAGS = $(REQ_FEATURE_FLAGS) -DSQLITE_MAX_TRIGGER_DEPTH=100
shanehb2f20bf2011-06-17 07:07:24 +0000470
mistachkin4712c212014-05-09 20:51:17 +0000471# Add the required and optional SQLite compilation options into the command
472# lines used to invoke the MSVC code and resource compilers.
473#
474TCC = $(TCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS)
475RCC = $(RCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS)
shanehb2f20bf2011-06-17 07:07:24 +0000476
mistachkin4712c212014-05-09 20:51:17 +0000477# Add in any optional parameters specified on the commane line, e.g.
478# nmake /f Makefile.msc all "OPTS=-DSQLITE_ENABLE_FOO=1 -DSQLITE_OMIT_FOO=1"
479#
shanehb2f20bf2011-06-17 07:07:24 +0000480TCC = $(TCC) $(OPTS)
mistachkin4d9d1f42012-09-03 10:32:32 +0000481RCC = $(RCC) $(OPTS)
shanehb2f20bf2011-06-17 07:07:24 +0000482
mistachkin8bcd3fa2013-08-29 01:03:38 +0000483# If compiling for debugging, add some defines.
mistachkin4712c212014-05-09 20:51:17 +0000484#
mistachkinf2d25f22011-08-25 04:09:12 +0000485!IF $(DEBUG)>0
mistachkin8bcd3fa2013-08-29 01:03:38 +0000486TCC = $(TCC) -D_DEBUG
487BCC = $(BCC) -D_DEBUG
mistachkin4d9d1f42012-09-03 10:32:32 +0000488RCC = $(RCC) -D_DEBUG
mistachkin4d60be52011-08-26 05:40:31 +0000489!ENDIF
490
mistachkin8bcd3fa2013-08-29 01:03:38 +0000491# If optimizations are enabled or disabled (either implicitly or
492# explicitly), add the necessary flags.
mistachkin4712c212014-05-09 20:51:17 +0000493#
mistachkin8bcd3fa2013-08-29 01:03:38 +0000494!IF $(DEBUG)>0 || $(OPTIMIZATIONS)==0
495TCC = $(TCC) -Od
496BCC = $(BCC) -Od
497!ELSEIF $(OPTIMIZATIONS)>=3
498TCC = $(TCC) -Ox
499BCC = $(BCC) -Ox
500!ELSEIF $(OPTIMIZATIONS)==2
501TCC = $(TCC) -O2
502BCC = $(BCC) -O2
503!ELSEIF $(OPTIMIZATIONS)==1
504TCC = $(TCC) -O1
505BCC = $(BCC) -O1
506!ENDIF
507
508# If symbols are enabled (or compiling for debugging), enable PDBs.
mistachkin4712c212014-05-09 20:51:17 +0000509#
mistachkin4d60be52011-08-26 05:40:31 +0000510!IF $(DEBUG)>0 || $(SYMBOLS)!=0
511TCC = $(TCC) -Zi
mistachkinfec360a2012-04-18 10:29:21 +0000512BCC = $(BCC) -Zi
mistachkin753c5442011-08-25 02:02:25 +0000513!ENDIF
514
mistachkinc756ded2011-10-02 05:23:16 +0000515# If ICU support is enabled, add the compiler options for it.
mistachkin4712c212014-05-09 20:51:17 +0000516#
mistachkinc756ded2011-10-02 05:23:16 +0000517!IF $(USE_ICU)!=0
518TCC = $(TCC) -DSQLITE_ENABLE_ICU=1
mistachkin4d9d1f42012-09-03 10:32:32 +0000519RCC = $(RCC) -DSQLITE_ENABLE_ICU=1
mistachkinc756ded2011-10-02 05:23:16 +0000520TCC = $(TCC) -I$(TOP)\ext\icu
mistachkin4d9d1f42012-09-03 10:32:32 +0000521RCC = $(RCC) -I$(TOP)\ext\icu
mistachkinc756ded2011-10-02 05:23:16 +0000522TCC = $(TCC) -I$(ICUINCDIR)
mistachkin4d9d1f42012-09-03 10:32:32 +0000523RCC = $(RCC) -I$(ICUINCDIR)
mistachkinc756ded2011-10-02 05:23:16 +0000524!ENDIF
525
mistachkin4d9d1f42012-09-03 10:32:32 +0000526# Command line prefixes for compiling code, compiling resources,
527# linking, etc.
mistachkin4712c212014-05-09 20:51:17 +0000528#
shanehb2f20bf2011-06-17 07:07:24 +0000529LTCOMPILE = $(TCC) -Fo$@
mistachkin4d9d1f42012-09-03 10:32:32 +0000530LTRCOMPILE = $(RCC) -r
shanehb2f20bf2011-06-17 07:07:24 +0000531LTLIB = lib.exe
shaneh2a0b9ef2011-06-20 20:52:32 +0000532LTLINK = $(TCC) -Fe$@
533
534# If a platform was set, force the linker to target that.
535# Note that the vcvars*.bat family of batch files typically
536# set this for you. Otherwise, the linker will attempt
537# to deduce the binary type based on the object files.
mistachkine37f99c2012-06-30 16:22:05 +0000538!IFDEF PLATFORM
shaneh2a0b9ef2011-06-20 20:52:32 +0000539LTLINKOPTS = /MACHINE:$(PLATFORM)
shaneh29ebea82011-06-21 18:12:07 +0000540LTLIBOPTS = /MACHINE:$(PLATFORM)
shaneh2a0b9ef2011-06-20 20:52:32 +0000541!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000542
mistachkina6ff8572012-04-17 21:00:12 +0000543# When compiling for use in the WinRT environment, the following
544# linker option must be used to mark the executable as runnable
545# only in the context of an application container.
546#
547!IF $(FOR_WINRT)!=0
548LTLINKOPTS = $(LTLINKOPTS) /APPCONTAINER
mistachkin60bdad72013-07-11 03:09:45 +0000549!IF "$(VISUALSTUDIOVERSION)"=="12.0"
mistachkinf6a23422014-05-05 20:24:34 +0000550!IFNDEF STORELIBPATH
mistachkinda5b1cd2013-07-10 19:39:02 +0000551!IF "$(PLATFORM)"=="x86"
mistachkin4712c212014-05-09 20:51:17 +0000552STORELIBPATH = $(CRTLIBPATH)\store
mistachkinda5b1cd2013-07-10 19:39:02 +0000553!ELSEIF "$(PLATFORM)"=="x64"
mistachkin4712c212014-05-09 20:51:17 +0000554STORELIBPATH = $(CRTLIBPATH)\store\amd64
mistachkin4eaa1292013-07-10 21:33:25 +0000555!ELSEIF "$(PLATFORM)"=="ARM"
mistachkin4712c212014-05-09 20:51:17 +0000556STORELIBPATH = $(CRTLIBPATH)\store\arm
mistachkin4eaa1292013-07-10 21:33:25 +0000557!ELSE
mistachkin4712c212014-05-09 20:51:17 +0000558STORELIBPATH = $(CRTLIBPATH)\store
mistachkinda5b1cd2013-07-10 19:39:02 +0000559!ENDIF
560!ENDIF
mistachkinf6a23422014-05-05 20:24:34 +0000561STORELIBPATH = $(STORELIBPATH:\\=\)
562LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(STORELIBPATH)"
563!ENDIF
mistachkina6ff8572012-04-17 21:00:12 +0000564!ENDIF
565
mistachkind9b3c542014-05-09 23:31:55 +0000566# When compiling for Windows Phone 8.1, an extra library path is
567# required.
568#
569!IF $(USE_WP81_OPTS)!=0
570!IFNDEF WP81LIBPATH
571!IF "$(PLATFORM)"=="x86"
572WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86
573!ELSEIF "$(PLATFORM)"=="ARM"
574WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\ARM
575!ELSE
576WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86
577!ENDIF
578!ENDIF
579!ENDIF
580
581# When compiling for Windows Phone 8.1, some extra linker options
582# are also required.
583#
584!IF $(USE_WP81_OPTS)!=0
585!IFDEF WP81LIBPATH
586LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(WP81LIBPATH)"
587!ENDIF
588LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE
589LTLINKOPTS = $(LTLINKOPTS) WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelHost.lib
590LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:kernel32.lib /NODEFAULTLIB:ole32.lib
591!ENDIF
592
mistachkinfec360a2012-04-18 10:29:21 +0000593# If either debugging or symbols are enabled, enable PDBs.
mistachkin4712c212014-05-09 20:51:17 +0000594#
mistachkin4d60be52011-08-26 05:40:31 +0000595!IF $(DEBUG)>0 || $(SYMBOLS)!=0
mistachkin228aeff2012-06-30 19:24:09 +0000596LDFLAGS = /DEBUG
mistachkin753c5442011-08-25 02:02:25 +0000597!ENDIF
598
mistachkinc756ded2011-10-02 05:23:16 +0000599# Start with the Tcl related linker options.
mistachkin4712c212014-05-09 20:51:17 +0000600#
mistachkin31856a32012-07-27 07:13:25 +0000601!IF $(NO_TCL)==0
mistachkinc756ded2011-10-02 05:23:16 +0000602LTLIBPATHS = /LIBPATH:$(TCLLIBDIR)
603LTLIBS = $(LIBTCL)
mistachkin31856a32012-07-27 07:13:25 +0000604!ENDIF
mistachkinc756ded2011-10-02 05:23:16 +0000605
606# If ICU support is enabled, add the linker options for it.
mistachkin4712c212014-05-09 20:51:17 +0000607#
mistachkinc756ded2011-10-02 05:23:16 +0000608!IF $(USE_ICU)!=0
609LTLIBPATHS = $(LTLIBPATHS) /LIBPATH:$(ICULIBDIR)
610LTLIBS = $(LTLIBS) $(LIBICU)
611!ENDIF
612
shanehb2f20bf2011-06-17 07:07:24 +0000613# nawk compatible awk.
mistachkin4712c212014-05-09 20:51:17 +0000614#
mistachkin8bcd3fa2013-08-29 01:03:38 +0000615!IFNDEF NAWK
mistachkin5b0b6fd2011-06-25 01:14:36 +0000616NAWK = gawk.exe
mistachkin8bcd3fa2013-08-29 01:03:38 +0000617!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000618
619# You should not have to change anything below this line
620###############################################################################
621
shanehb2f20bf2011-06-17 07:07:24 +0000622# Object files for the SQLite library (non-amalgamation).
623#
mistachkinf67feef2013-07-29 19:03:20 +0000624LIBOBJS0 = vdbe.lo parse.lo alter.lo analyze.lo attach.lo auth.lo \
shanehb2f20bf2011-06-17 07:07:24 +0000625 backup.lo bitvec.lo btmutex.lo btree.lo build.lo \
626 callback.lo complete.lo ctime.lo date.lo delete.lo \
627 expr.lo fault.lo fkey.lo \
drh391d4ba2012-05-28 20:22:16 +0000628 fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo \
629 fts3_porter.lo fts3_snippet.lo fts3_tokenizer.lo fts3_tokenizer1.lo \
drh4d648c72013-04-22 17:07:56 +0000630 fts3_tokenize_vtab.lo fts3_unicode.lo fts3_unicode2.lo fts3_write.lo \
shanehb2f20bf2011-06-17 07:07:24 +0000631 func.lo global.lo hash.lo \
632 icu.lo insert.lo journal.lo legacy.lo loadext.lo \
633 main.lo malloc.lo mem0.lo mem1.lo mem2.lo mem3.lo mem5.lo \
634 memjournal.lo \
mistachkinf1c6bc52012-06-21 15:09:20 +0000635 mutex.lo mutex_noop.lo mutex_unix.lo mutex_w32.lo \
636 notify.lo opcodes.lo os.lo os_unix.lo os_win.lo \
mistachkinf67feef2013-07-29 19:03:20 +0000637 pager.lo pcache.lo pcache1.lo pragma.lo prepare.lo printf.lo \
shanehb2f20bf2011-06-17 07:07:24 +0000638 random.lo resolve.lo rowset.lo rtree.lo select.lo status.lo \
639 table.lo tokenize.lo trigger.lo \
640 update.lo util.lo vacuum.lo \
mistachkinf67feef2013-07-29 19:03:20 +0000641 vdbeapi.lo vdbeaux.lo vdbeblob.lo vdbemem.lo vdbesort.lo \
mistachkin81c428a2011-08-17 02:19:54 +0000642 vdbetrace.lo wal.lo walker.lo where.lo utf.lo vtab.lo
shanehb2f20bf2011-06-17 07:07:24 +0000643
644# Object files for the amalgamation.
645#
646LIBOBJS1 = sqlite3.lo
647
648# Determine the real value of LIBOBJ based on the 'configure' script
649#
650!IF $(USE_AMALGAMATION)==0
651LIBOBJ = $(LIBOBJS0)
652!ELSE
653LIBOBJ = $(LIBOBJS1)
654!ENDIF
655
mistachkin08c1c312012-10-06 03:48:25 +0000656# Determine if embedded resource compilation and usage are enabled.
657#
658!IF $(USE_RC)!=0
659LIBRESOBJS = sqlite3res.lo
660!ELSE
661LIBRESOBJS =
662!ENDIF
663
shanehb2f20bf2011-06-17 07:07:24 +0000664# All of the source code files.
665#
666SRC = \
667 $(TOP)\src\alter.c \
668 $(TOP)\src\analyze.c \
669 $(TOP)\src\attach.c \
670 $(TOP)\src\auth.c \
671 $(TOP)\src\backup.c \
672 $(TOP)\src\bitvec.c \
673 $(TOP)\src\btmutex.c \
674 $(TOP)\src\btree.c \
675 $(TOP)\src\btree.h \
676 $(TOP)\src\btreeInt.h \
677 $(TOP)\src\build.c \
678 $(TOP)\src\callback.c \
679 $(TOP)\src\complete.c \
680 $(TOP)\src\ctime.c \
681 $(TOP)\src\date.c \
682 $(TOP)\src\delete.c \
683 $(TOP)\src\expr.c \
684 $(TOP)\src\fault.c \
685 $(TOP)\src\fkey.c \
686 $(TOP)\src\func.c \
687 $(TOP)\src\global.c \
688 $(TOP)\src\hash.c \
689 $(TOP)\src\hash.h \
690 $(TOP)\src\hwtime.h \
691 $(TOP)\src\insert.c \
692 $(TOP)\src\journal.c \
693 $(TOP)\src\legacy.c \
694 $(TOP)\src\loadext.c \
695 $(TOP)\src\main.c \
696 $(TOP)\src\malloc.c \
697 $(TOP)\src\mem0.c \
698 $(TOP)\src\mem1.c \
699 $(TOP)\src\mem2.c \
700 $(TOP)\src\mem3.c \
701 $(TOP)\src\mem5.c \
702 $(TOP)\src\memjournal.c \
703 $(TOP)\src\mutex.c \
704 $(TOP)\src\mutex.h \
705 $(TOP)\src\mutex_noop.c \
shanehb2f20bf2011-06-17 07:07:24 +0000706 $(TOP)\src\mutex_unix.c \
707 $(TOP)\src\mutex_w32.c \
708 $(TOP)\src\notify.c \
709 $(TOP)\src\os.c \
710 $(TOP)\src\os.h \
711 $(TOP)\src\os_common.h \
mistachkinf74b9e02013-11-26 01:00:31 +0000712 $(TOP)\src\os_setup.h \
shanehb2f20bf2011-06-17 07:07:24 +0000713 $(TOP)\src\os_unix.c \
714 $(TOP)\src\os_win.c \
mistachkin8bc52622013-11-25 09:36:07 +0000715 $(TOP)\src\os_win.h \
shanehb2f20bf2011-06-17 07:07:24 +0000716 $(TOP)\src\pager.c \
717 $(TOP)\src\pager.h \
718 $(TOP)\src\parse.y \
719 $(TOP)\src\pcache.c \
720 $(TOP)\src\pcache.h \
721 $(TOP)\src\pcache1.c \
722 $(TOP)\src\pragma.c \
723 $(TOP)\src\prepare.c \
724 $(TOP)\src\printf.c \
725 $(TOP)\src\random.c \
726 $(TOP)\src\resolve.c \
727 $(TOP)\src\rowset.c \
728 $(TOP)\src\select.c \
729 $(TOP)\src\status.c \
730 $(TOP)\src\shell.c \
731 $(TOP)\src\sqlite.h.in \
732 $(TOP)\src\sqlite3ext.h \
733 $(TOP)\src\sqliteInt.h \
734 $(TOP)\src\sqliteLimit.h \
735 $(TOP)\src\table.c \
736 $(TOP)\src\tclsqlite.c \
737 $(TOP)\src\tokenize.c \
738 $(TOP)\src\trigger.c \
739 $(TOP)\src\utf.c \
740 $(TOP)\src\update.c \
741 $(TOP)\src\util.c \
742 $(TOP)\src\vacuum.c \
743 $(TOP)\src\vdbe.c \
744 $(TOP)\src\vdbe.h \
745 $(TOP)\src\vdbeapi.c \
746 $(TOP)\src\vdbeaux.c \
747 $(TOP)\src\vdbeblob.c \
748 $(TOP)\src\vdbemem.c \
mistachkin81c428a2011-08-17 02:19:54 +0000749 $(TOP)\src\vdbesort.c \
shanehb2f20bf2011-06-17 07:07:24 +0000750 $(TOP)\src\vdbetrace.c \
751 $(TOP)\src\vdbeInt.h \
752 $(TOP)\src\vtab.c \
753 $(TOP)\src\wal.c \
754 $(TOP)\src\wal.h \
755 $(TOP)\src\walker.c \
drhe54df422013-11-12 18:37:25 +0000756 $(TOP)\src\where.c \
757 $(TOP)\src\whereInt.h
shanehb2f20bf2011-06-17 07:07:24 +0000758
759# Source code for extensions
760#
761SRC = $(SRC) \
762 $(TOP)\ext\fts1\fts1.c \
763 $(TOP)\ext\fts1\fts1.h \
764 $(TOP)\ext\fts1\fts1_hash.c \
765 $(TOP)\ext\fts1\fts1_hash.h \
766 $(TOP)\ext\fts1\fts1_porter.c \
767 $(TOP)\ext\fts1\fts1_tokenizer.h \
768 $(TOP)\ext\fts1\fts1_tokenizer1.c
769SRC = $(SRC) \
770 $(TOP)\ext\fts2\fts2.c \
771 $(TOP)\ext\fts2\fts2.h \
772 $(TOP)\ext\fts2\fts2_hash.c \
773 $(TOP)\ext\fts2\fts2_hash.h \
774 $(TOP)\ext\fts2\fts2_icu.c \
775 $(TOP)\ext\fts2\fts2_porter.c \
776 $(TOP)\ext\fts2\fts2_tokenizer.h \
777 $(TOP)\ext\fts2\fts2_tokenizer.c \
778 $(TOP)\ext\fts2\fts2_tokenizer1.c
779SRC = $(SRC) \
780 $(TOP)\ext\fts3\fts3.c \
781 $(TOP)\ext\fts3\fts3.h \
782 $(TOP)\ext\fts3\fts3Int.h \
783 $(TOP)\ext\fts3\fts3_aux.c \
784 $(TOP)\ext\fts3\fts3_expr.c \
785 $(TOP)\ext\fts3\fts3_hash.c \
786 $(TOP)\ext\fts3\fts3_hash.h \
787 $(TOP)\ext\fts3\fts3_icu.c \
788 $(TOP)\ext\fts3\fts3_porter.c \
789 $(TOP)\ext\fts3\fts3_snippet.c \
790 $(TOP)\ext\fts3\fts3_tokenizer.h \
791 $(TOP)\ext\fts3\fts3_tokenizer.c \
792 $(TOP)\ext\fts3\fts3_tokenizer1.c \
drh4d648c72013-04-22 17:07:56 +0000793 $(TOP)\ext\fts3\fts3_tokenize_vtab.c \
drh391d4ba2012-05-28 20:22:16 +0000794 $(TOP)\ext\fts3\fts3_unicode.c \
795 $(TOP)\ext\fts3\fts3_unicode2.c \
shanehb2f20bf2011-06-17 07:07:24 +0000796 $(TOP)\ext\fts3\fts3_write.c
797SRC = $(SRC) \
798 $(TOP)\ext\icu\sqliteicu.h \
799 $(TOP)\ext\icu\icu.c
800SRC = $(SRC) \
801 $(TOP)\ext\rtree\rtree.h \
802 $(TOP)\ext\rtree\rtree.c
803
804
805# Generated source code files
806#
807SRC = $(SRC) \
808 keywordhash.h \
809 opcodes.c \
810 opcodes.h \
811 parse.c \
812 parse.h \
813 sqlite3.h
814
815# Source code to the test files.
816#
817TESTSRC = \
818 $(TOP)\src\test1.c \
819 $(TOP)\src\test2.c \
820 $(TOP)\src\test3.c \
821 $(TOP)\src\test4.c \
822 $(TOP)\src\test5.c \
823 $(TOP)\src\test6.c \
824 $(TOP)\src\test7.c \
825 $(TOP)\src\test8.c \
826 $(TOP)\src\test9.c \
827 $(TOP)\src\test_autoext.c \
828 $(TOP)\src\test_async.c \
829 $(TOP)\src\test_backup.c \
830 $(TOP)\src\test_btree.c \
831 $(TOP)\src\test_config.c \
832 $(TOP)\src\test_demovfs.c \
833 $(TOP)\src\test_devsym.c \
mistachkin413c63b2013-01-17 03:18:14 +0000834 $(TOP)\src\test_fs.c \
shanehb2f20bf2011-06-17 07:07:24 +0000835 $(TOP)\src\test_func.c \
shanehb2f20bf2011-06-17 07:07:24 +0000836 $(TOP)\src\test_hexio.c \
837 $(TOP)\src\test_init.c \
838 $(TOP)\src\test_intarray.c \
839 $(TOP)\src\test_journal.c \
840 $(TOP)\src\test_malloc.c \
841 $(TOP)\src\test_multiplex.c \
842 $(TOP)\src\test_mutex.c \
843 $(TOP)\src\test_onefile.c \
844 $(TOP)\src\test_osinst.c \
845 $(TOP)\src\test_pcache.c \
846 $(TOP)\src\test_quota.c \
847 $(TOP)\src\test_rtree.c \
848 $(TOP)\src\test_schema.c \
849 $(TOP)\src\test_server.c \
850 $(TOP)\src\test_superlock.c \
851 $(TOP)\src\test_syscall.c \
852 $(TOP)\src\test_stat.c \
853 $(TOP)\src\test_tclvar.c \
854 $(TOP)\src\test_thread.c \
855 $(TOP)\src\test_vfs.c \
shanehb2f20bf2011-06-17 07:07:24 +0000856 $(TOP)\src\test_wsd.c \
857 $(TOP)\ext\fts3\fts3_term.c \
shaneh6e7850c2011-06-17 15:57:07 +0000858 $(TOP)\ext\fts3\fts3_test.c
shanehb2f20bf2011-06-17 07:07:24 +0000859
drhe50db1c2013-04-25 14:31:46 +0000860# Statically linked extensions
861#
drh1fb64af2013-04-25 14:36:28 +0000862TESTEXT = \
drh8416fc72013-04-25 16:42:55 +0000863 $(TOP)\ext\misc\amatch.c \
864 $(TOP)\ext\misc\closure.c \
drh51ed2982014-06-16 12:44:32 +0000865 $(TOP)\ext\misc\fileio.c \
drhe50db1c2013-04-25 14:31:46 +0000866 $(TOP)\ext\misc\fuzzer.c \
drh8416fc72013-04-25 16:42:55 +0000867 $(TOP)\ext\misc\ieee754.c \
drhea41dc42013-04-25 19:31:33 +0000868 $(TOP)\ext\misc\nextchar.c \
drhdef33672013-05-28 20:25:54 +0000869 $(TOP)\ext\misc\percentile.c \
drhe50db1c2013-04-25 14:31:46 +0000870 $(TOP)\ext\misc\regexp.c \
drhb7045ab2013-04-25 14:59:01 +0000871 $(TOP)\ext\misc\spellfix.c \
drh5f8cdac2013-10-14 21:14:42 +0000872 $(TOP)\ext\misc\totype.c \
drhe50db1c2013-04-25 14:31:46 +0000873 $(TOP)\ext\misc\wholenumber.c
874
875
shanehb2f20bf2011-06-17 07:07:24 +0000876# Source code to the library files needed by the test fixture
877#
878TESTSRC2 = \
879 $(TOP)\src\attach.c \
880 $(TOP)\src\backup.c \
881 $(TOP)\src\bitvec.c \
882 $(TOP)\src\btree.c \
883 $(TOP)\src\build.c \
884 $(TOP)\src\ctime.c \
885 $(TOP)\src\date.c \
886 $(TOP)\src\expr.c \
887 $(TOP)\src\func.c \
888 $(TOP)\src\insert.c \
889 $(TOP)\src\wal.c \
mistachkin06006632013-05-15 20:35:13 +0000890 $(TOP)\src\main.c \
shanehb2f20bf2011-06-17 07:07:24 +0000891 $(TOP)\src\mem5.c \
892 $(TOP)\src\os.c \
shanehb2f20bf2011-06-17 07:07:24 +0000893 $(TOP)\src\os_unix.c \
894 $(TOP)\src\os_win.c \
895 $(TOP)\src\pager.c \
896 $(TOP)\src\pragma.c \
897 $(TOP)\src\prepare.c \
898 $(TOP)\src\printf.c \
899 $(TOP)\src\random.c \
900 $(TOP)\src\pcache.c \
901 $(TOP)\src\pcache1.c \
902 $(TOP)\src\select.c \
903 $(TOP)\src\tokenize.c \
904 $(TOP)\src\utf.c \
905 $(TOP)\src\util.c \
906 $(TOP)\src\vdbeapi.c \
907 $(TOP)\src\vdbeaux.c \
908 $(TOP)\src\vdbe.c \
909 $(TOP)\src\vdbemem.c \
mistachkin81c428a2011-08-17 02:19:54 +0000910 $(TOP)\src\vdbesort.c \
shanehb2f20bf2011-06-17 07:07:24 +0000911 $(TOP)\src\vdbetrace.c \
912 $(TOP)\src\where.c \
913 parse.c \
914 $(TOP)\ext\fts3\fts3.c \
915 $(TOP)\ext\fts3\fts3_aux.c \
916 $(TOP)\ext\fts3\fts3_expr.c \
shanehb2f20bf2011-06-17 07:07:24 +0000917 $(TOP)\ext\fts3\fts3_tokenizer.c \
drh4d648c72013-04-22 17:07:56 +0000918 $(TOP)\ext\fts3\fts3_tokenize_vtab.c \
drh391d4ba2012-05-28 20:22:16 +0000919 $(TOP)\ext\fts3\fts3_unicode.c \
920 $(TOP)\ext\fts3\fts3_unicode2.c \
shanehb2f20bf2011-06-17 07:07:24 +0000921 $(TOP)\ext\fts3\fts3_write.c \
922 $(TOP)\ext\async\sqlite3async.c
923
924# Header files used by all library source files.
925#
926HDR = \
927 $(TOP)\src\btree.h \
928 $(TOP)\src\btreeInt.h \
929 $(TOP)\src\hash.h \
930 $(TOP)\src\hwtime.h \
931 keywordhash.h \
932 $(TOP)\src\mutex.h \
933 opcodes.h \
934 $(TOP)\src\os.h \
935 $(TOP)\src\os_common.h \
mistachkinf74b9e02013-11-26 01:00:31 +0000936 $(TOP)\src\os_setup.h \
mistachkin8bc52622013-11-25 09:36:07 +0000937 $(TOP)\src\os_win.h \
shanehb2f20bf2011-06-17 07:07:24 +0000938 $(TOP)\src\pager.h \
939 $(TOP)\src\pcache.h \
shaneh6e7850c2011-06-17 15:57:07 +0000940 parse.h \
941 sqlite3.h \
shanehb2f20bf2011-06-17 07:07:24 +0000942 $(TOP)\src\sqlite3ext.h \
shaneh6e7850c2011-06-17 15:57:07 +0000943 $(TOP)\src\sqliteInt.h \
shanehb2f20bf2011-06-17 07:07:24 +0000944 $(TOP)\src\sqliteLimit.h \
945 $(TOP)\src\vdbe.h \
drhe54df422013-11-12 18:37:25 +0000946 $(TOP)\src\vdbeInt.h \
947 $(TOP)\src\whereInt.h
shanehb2f20bf2011-06-17 07:07:24 +0000948
949# Header files used by extensions
950#
951EXTHDR = $(EXTHDR) \
952 $(TOP)\ext\fts1\fts1.h \
953 $(TOP)\ext\fts1\fts1_hash.h \
954 $(TOP)\ext\fts1\fts1_tokenizer.h
955EXTHDR = $(EXTHDR) \
956 $(TOP)\ext\fts2\fts2.h \
957 $(TOP)\ext\fts2\fts2_hash.h \
958 $(TOP)\ext\fts2\fts2_tokenizer.h
959EXTHDR = $(EXTHDR) \
960 $(TOP)\ext\fts3\fts3.h \
961 $(TOP)\ext\fts3\fts3Int.h \
962 $(TOP)\ext\fts3\fts3_hash.h \
963 $(TOP)\ext\fts3\fts3_tokenizer.h
964EXTHDR = $(EXTHDR) \
965 $(TOP)\ext\rtree\rtree.h
966EXTHDR = $(EXTHDR) \
967 $(TOP)\ext\icu\sqliteicu.h
968EXTHDR = $(EXTHDR) \
969 $(TOP)\ext\rtree\sqlite3rtree.h
970
971# This is the default Makefile target. The objects listed here
972# are what get build when you type just "make" with no arguments.
973#
mistachkin5b0b6fd2011-06-25 01:14:36 +0000974all: dll libsqlite3.lib sqlite3.exe libtclsqlite3.lib
shanehb2f20bf2011-06-17 07:07:24 +0000975
shanehb2f20bf2011-06-17 07:07:24 +0000976libsqlite3.lib: $(LIBOBJ)
shaneh29ebea82011-06-21 18:12:07 +0000977 $(LTLIB) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +0000978
979libtclsqlite3.lib: tclsqlite.lo libsqlite3.lib
mistachkinc756ded2011-10-02 05:23:16 +0000980 $(LTLIB) $(LTLIBOPTS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCL:tcl=tclstub) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +0000981
mistachkin08c1c312012-10-06 03:48:25 +0000982sqlite3.exe: $(TOP)\src\shell.c libsqlite3.lib $(LIBRESOBJS) sqlite3.h
shanehb2f20bf2011-06-17 07:07:24 +0000983 $(LTLINK) $(READLINE_FLAGS) \
shaneh2a0b9ef2011-06-20 20:52:32 +0000984 $(TOP)\src\shell.c \
mistachkin08c1c312012-10-06 03:48:25 +0000985 /link $(LTLINKOPTS) $(LTLIBPATHS) libsqlite3.lib $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +0000986
drhbc94dbb2013-04-08 14:28:33 +0000987mptester.exe: $(TOP)\mptest\mptest.c libsqlite3.lib $(LIBRESOBJS) sqlite3.h
988 $(LTLINK) $(TOP)\mptest\mptest.c \
989 /link $(LTLINKOPTS) $(LTLIBPATHS) libsqlite3.lib $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS)
990
shanehb2f20bf2011-06-17 07:07:24 +0000991# This target creates a directory named "tsrc" and fills it with
992# copies of all of the C source code and header files needed to
993# build on the target system. Some of the C source code and header
994# files are automatically generated. This target takes care of
995# all that automatic generation.
996#
997.target_source: $(SRC) $(TOP)\tool\vdbe-compress.tcl
998 -rmdir /S/Q tsrc
999 -mkdir tsrc
1000 for %i in ($(SRC)) do copy /Y %i tsrc
1001 del /Q tsrc\sqlite.h.in tsrc\parse.y
drh2dc06482013-12-11 00:59:10 +00001002 $(TCLSH_CMD) $(TOP)\tool\vdbe-compress.tcl $(OPTS) < tsrc\vdbe.c > vdbe.new
shanehb2f20bf2011-06-17 07:07:24 +00001003 move vdbe.new tsrc\vdbe.c
1004 echo > .target_source
1005
1006sqlite3.c: .target_source $(TOP)\tool\mksqlite3c.tcl
mistachkinb0427512014-01-30 11:12:52 +00001007 $(TCLSH_CMD) $(TOP)\tool\mksqlite3c.tcl $(MKSQLITE3C_ARGS)
drh339d6c62013-03-19 16:12:40 +00001008 copy tsrc\shell.c .
1009 copy tsrc\sqlite3ext.h .
shanehb2f20bf2011-06-17 07:07:24 +00001010
mistachkin48dd9de2012-12-06 04:33:13 +00001011sqlite3-all.c: sqlite3.c $(TOP)\tool\split-sqlite3c.tcl
1012 $(TCLSH_CMD) $(TOP)\tool\split-sqlite3c.tcl
drh75e7bc12011-07-22 11:23:49 +00001013
mistachkin76510912013-10-11 23:01:18 +00001014# Set the source code file to be used by executables and libraries when
1015# they need the amalgamation.
1016#
1017!IF $(SPLIT_AMALGAMATION)!=0
1018SQLITE3C = sqlite3-all.c
1019!ELSE
1020SQLITE3C = sqlite3.c
1021!ENDIF
1022
shanehb2f20bf2011-06-17 07:07:24 +00001023# Rule to build the amalgamation
1024#
mistachkin76510912013-10-11 23:01:18 +00001025sqlite3.lo: $(SQLITE3C)
1026 $(LTCOMPILE) -c $(SQLITE3C)
shanehb2f20bf2011-06-17 07:07:24 +00001027
1028# Rules to build the LEMON compiler generator
1029#
1030lempar.c: $(TOP)\src\lempar.c
1031 copy $(TOP)\src\lempar.c .
1032
1033lemon.exe: $(TOP)\tool\lemon.c lempar.c
mistachkin7dd9fb62014-05-05 22:43:17 +00001034 $(BCC) -Daccess=_access -Fe$@ $(TOP)\tool\lemon.c /link $(NLTLINKOPTS) $(NLTLIBPATHS)
shanehb2f20bf2011-06-17 07:07:24 +00001035
1036# Rules to build individual *.lo files from generated *.c files. This
1037# applies to:
1038#
1039# parse.lo
1040# opcodes.lo
1041#
1042parse.lo: parse.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001043 $(LTCOMPILE) -c parse.c
shanehb2f20bf2011-06-17 07:07:24 +00001044
1045opcodes.lo: opcodes.c
shaneh6e7850c2011-06-17 15:57:07 +00001046 $(LTCOMPILE) -c opcodes.c
shanehb2f20bf2011-06-17 07:07:24 +00001047
mistachkin4d9d1f42012-09-03 10:32:32 +00001048# Rule to build the Win32 resources object file.
1049#
mistachkin08c1c312012-10-06 03:48:25 +00001050!IF $(USE_RC)!=0
1051$(LIBRESOBJS): $(TOP)\src\sqlite3.rc $(HDR)
mistachkin4d9d1f42012-09-03 10:32:32 +00001052 echo #ifndef SQLITE_RESOURCE_VERSION > sqlite3rc.h
mistachkin8ccc6d42012-09-27 21:03:53 +00001053 for /F %%V in ('type "$(TOP)\VERSION"') do ( \
mistachkin4d9d1f42012-09-03 10:32:32 +00001054 echo #define SQLITE_RESOURCE_VERSION %%V \
mistachkin597a8c52012-09-03 11:14:53 +00001055 | $(NAWK) "/.*/ { gsub(/[.]/,\",\");print }" >> sqlite3rc.h \
mistachkin4d9d1f42012-09-03 10:32:32 +00001056 )
1057 echo #endif >> sqlite3rc.h
mistachkin08c1c312012-10-06 03:48:25 +00001058 $(LTRCOMPILE) -fo $(LIBRESOBJS) $(TOP)\src\sqlite3.rc
1059!ENDIF
mistachkin4d9d1f42012-09-03 10:32:32 +00001060
shanehb2f20bf2011-06-17 07:07:24 +00001061# Rules to build individual *.lo files from files in the src directory.
1062#
1063alter.lo: $(TOP)\src\alter.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001064 $(LTCOMPILE) -c $(TOP)\src\alter.c
shanehb2f20bf2011-06-17 07:07:24 +00001065
1066analyze.lo: $(TOP)\src\analyze.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001067 $(LTCOMPILE) -c $(TOP)\src\analyze.c
shanehb2f20bf2011-06-17 07:07:24 +00001068
1069attach.lo: $(TOP)\src\attach.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001070 $(LTCOMPILE) -c $(TOP)\src\attach.c
shanehb2f20bf2011-06-17 07:07:24 +00001071
1072auth.lo: $(TOP)\src\auth.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001073 $(LTCOMPILE) -c $(TOP)\src\auth.c
shanehb2f20bf2011-06-17 07:07:24 +00001074
1075backup.lo: $(TOP)\src\backup.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001076 $(LTCOMPILE) -c $(TOP)\src\backup.c
shanehb2f20bf2011-06-17 07:07:24 +00001077
1078bitvec.lo: $(TOP)\src\bitvec.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001079 $(LTCOMPILE) -c $(TOP)\src\bitvec.c
shanehb2f20bf2011-06-17 07:07:24 +00001080
1081btmutex.lo: $(TOP)\src\btmutex.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001082 $(LTCOMPILE) -c $(TOP)\src\btmutex.c
shanehb2f20bf2011-06-17 07:07:24 +00001083
1084btree.lo: $(TOP)\src\btree.c $(HDR) $(TOP)\src\pager.h
shaneh6e7850c2011-06-17 15:57:07 +00001085 $(LTCOMPILE) -c $(TOP)\src\btree.c
shanehb2f20bf2011-06-17 07:07:24 +00001086
1087build.lo: $(TOP)\src\build.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001088 $(LTCOMPILE) -c $(TOP)\src\build.c
shanehb2f20bf2011-06-17 07:07:24 +00001089
1090callback.lo: $(TOP)\src\callback.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001091 $(LTCOMPILE) -c $(TOP)\src\callback.c
shanehb2f20bf2011-06-17 07:07:24 +00001092
1093complete.lo: $(TOP)\src\complete.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001094 $(LTCOMPILE) -c $(TOP)\src\complete.c
shanehb2f20bf2011-06-17 07:07:24 +00001095
1096ctime.lo: $(TOP)\src\ctime.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001097 $(LTCOMPILE) -c $(TOP)\src\ctime.c
shanehb2f20bf2011-06-17 07:07:24 +00001098
1099date.lo: $(TOP)\src\date.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001100 $(LTCOMPILE) -c $(TOP)\src\date.c
shanehb2f20bf2011-06-17 07:07:24 +00001101
1102delete.lo: $(TOP)\src\delete.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001103 $(LTCOMPILE) -c $(TOP)\src\delete.c
shanehb2f20bf2011-06-17 07:07:24 +00001104
1105expr.lo: $(TOP)\src\expr.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001106 $(LTCOMPILE) -c $(TOP)\src\expr.c
shanehb2f20bf2011-06-17 07:07:24 +00001107
1108fault.lo: $(TOP)\src\fault.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001109 $(LTCOMPILE) -c $(TOP)\src\fault.c
shanehb2f20bf2011-06-17 07:07:24 +00001110
1111fkey.lo: $(TOP)\src\fkey.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001112 $(LTCOMPILE) -c $(TOP)\src\fkey.c
shanehb2f20bf2011-06-17 07:07:24 +00001113
1114func.lo: $(TOP)\src\func.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001115 $(LTCOMPILE) -c $(TOP)\src\func.c
shanehb2f20bf2011-06-17 07:07:24 +00001116
1117global.lo: $(TOP)\src\global.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001118 $(LTCOMPILE) -c $(TOP)\src\global.c
shanehb2f20bf2011-06-17 07:07:24 +00001119
1120hash.lo: $(TOP)\src\hash.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001121 $(LTCOMPILE) -c $(TOP)\src\hash.c
shanehb2f20bf2011-06-17 07:07:24 +00001122
1123insert.lo: $(TOP)\src\insert.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001124 $(LTCOMPILE) -c $(TOP)\src\insert.c
shanehb2f20bf2011-06-17 07:07:24 +00001125
1126journal.lo: $(TOP)\src\journal.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001127 $(LTCOMPILE) -c $(TOP)\src\journal.c
shanehb2f20bf2011-06-17 07:07:24 +00001128
1129legacy.lo: $(TOP)\src\legacy.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001130 $(LTCOMPILE) -c $(TOP)\src\legacy.c
shanehb2f20bf2011-06-17 07:07:24 +00001131
1132loadext.lo: $(TOP)\src\loadext.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001133 $(LTCOMPILE) -c $(TOP)\src\loadext.c
shanehb2f20bf2011-06-17 07:07:24 +00001134
1135main.lo: $(TOP)\src\main.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001136 $(LTCOMPILE) -c $(TOP)\src\main.c
shanehb2f20bf2011-06-17 07:07:24 +00001137
1138malloc.lo: $(TOP)\src\malloc.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001139 $(LTCOMPILE) -c $(TOP)\src\malloc.c
shanehb2f20bf2011-06-17 07:07:24 +00001140
1141mem0.lo: $(TOP)\src\mem0.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001142 $(LTCOMPILE) -c $(TOP)\src\mem0.c
shanehb2f20bf2011-06-17 07:07:24 +00001143
1144mem1.lo: $(TOP)\src\mem1.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001145 $(LTCOMPILE) -c $(TOP)\src\mem1.c
shanehb2f20bf2011-06-17 07:07:24 +00001146
1147mem2.lo: $(TOP)\src\mem2.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001148 $(LTCOMPILE) -c $(TOP)\src\mem2.c
shanehb2f20bf2011-06-17 07:07:24 +00001149
1150mem3.lo: $(TOP)\src\mem3.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001151 $(LTCOMPILE) -c $(TOP)\src\mem3.c
shanehb2f20bf2011-06-17 07:07:24 +00001152
1153mem5.lo: $(TOP)\src\mem5.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001154 $(LTCOMPILE) -c $(TOP)\src\mem5.c
shanehb2f20bf2011-06-17 07:07:24 +00001155
1156memjournal.lo: $(TOP)\src\memjournal.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001157 $(LTCOMPILE) -c $(TOP)\src\memjournal.c
shanehb2f20bf2011-06-17 07:07:24 +00001158
1159mutex.lo: $(TOP)\src\mutex.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001160 $(LTCOMPILE) -c $(TOP)\src\mutex.c
shanehb2f20bf2011-06-17 07:07:24 +00001161
1162mutex_noop.lo: $(TOP)\src\mutex_noop.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001163 $(LTCOMPILE) -c $(TOP)\src\mutex_noop.c
shanehb2f20bf2011-06-17 07:07:24 +00001164
shanehb2f20bf2011-06-17 07:07:24 +00001165mutex_unix.lo: $(TOP)\src\mutex_unix.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001166 $(LTCOMPILE) -c $(TOP)\src\mutex_unix.c
shanehb2f20bf2011-06-17 07:07:24 +00001167
1168mutex_w32.lo: $(TOP)\src\mutex_w32.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001169 $(LTCOMPILE) -c $(TOP)\src\mutex_w32.c
shanehb2f20bf2011-06-17 07:07:24 +00001170
1171notify.lo: $(TOP)\src\notify.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001172 $(LTCOMPILE) -c $(TOP)\src\notify.c
shanehb2f20bf2011-06-17 07:07:24 +00001173
1174pager.lo: $(TOP)\src\pager.c $(HDR) $(TOP)\src\pager.h
shaneh6e7850c2011-06-17 15:57:07 +00001175 $(LTCOMPILE) -c $(TOP)\src\pager.c
shanehb2f20bf2011-06-17 07:07:24 +00001176
1177pcache.lo: $(TOP)\src\pcache.c $(HDR) $(TOP)\src\pcache.h
shaneh6e7850c2011-06-17 15:57:07 +00001178 $(LTCOMPILE) -c $(TOP)\src\pcache.c
shanehb2f20bf2011-06-17 07:07:24 +00001179
1180pcache1.lo: $(TOP)\src\pcache1.c $(HDR) $(TOP)\src\pcache.h
shaneh6e7850c2011-06-17 15:57:07 +00001181 $(LTCOMPILE) -c $(TOP)\src\pcache1.c
shanehb2f20bf2011-06-17 07:07:24 +00001182
1183os.lo: $(TOP)\src\os.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001184 $(LTCOMPILE) -c $(TOP)\src\os.c
shanehb2f20bf2011-06-17 07:07:24 +00001185
1186os_unix.lo: $(TOP)\src\os_unix.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001187 $(LTCOMPILE) -c $(TOP)\src\os_unix.c
shanehb2f20bf2011-06-17 07:07:24 +00001188
1189os_win.lo: $(TOP)\src\os_win.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001190 $(LTCOMPILE) -c $(TOP)\src\os_win.c
shanehb2f20bf2011-06-17 07:07:24 +00001191
shanehb2f20bf2011-06-17 07:07:24 +00001192pragma.lo: $(TOP)\src\pragma.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001193 $(LTCOMPILE) -c $(TOP)\src\pragma.c
shanehb2f20bf2011-06-17 07:07:24 +00001194
1195prepare.lo: $(TOP)\src\prepare.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001196 $(LTCOMPILE) -c $(TOP)\src\prepare.c
shanehb2f20bf2011-06-17 07:07:24 +00001197
1198printf.lo: $(TOP)\src\printf.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001199 $(LTCOMPILE) -c $(TOP)\src\printf.c
shanehb2f20bf2011-06-17 07:07:24 +00001200
1201random.lo: $(TOP)\src\random.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001202 $(LTCOMPILE) -c $(TOP)\src\random.c
shanehb2f20bf2011-06-17 07:07:24 +00001203
1204resolve.lo: $(TOP)\src\resolve.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001205 $(LTCOMPILE) -c $(TOP)\src\resolve.c
shanehb2f20bf2011-06-17 07:07:24 +00001206
1207rowset.lo: $(TOP)\src\rowset.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001208 $(LTCOMPILE) -c $(TOP)\src\rowset.c
shanehb2f20bf2011-06-17 07:07:24 +00001209
1210select.lo: $(TOP)\src\select.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001211 $(LTCOMPILE) -c $(TOP)\src\select.c
shanehb2f20bf2011-06-17 07:07:24 +00001212
1213status.lo: $(TOP)\src\status.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001214 $(LTCOMPILE) -c $(TOP)\src\status.c
shanehb2f20bf2011-06-17 07:07:24 +00001215
1216table.lo: $(TOP)\src\table.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001217 $(LTCOMPILE) -c $(TOP)\src\table.c
shanehb2f20bf2011-06-17 07:07:24 +00001218
1219tokenize.lo: $(TOP)\src\tokenize.c keywordhash.h $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001220 $(LTCOMPILE) -c $(TOP)\src\tokenize.c
shanehb2f20bf2011-06-17 07:07:24 +00001221
1222trigger.lo: $(TOP)\src\trigger.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001223 $(LTCOMPILE) -c $(TOP)\src\trigger.c
shanehb2f20bf2011-06-17 07:07:24 +00001224
1225update.lo: $(TOP)\src\update.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001226 $(LTCOMPILE) -c $(TOP)\src\update.c
shanehb2f20bf2011-06-17 07:07:24 +00001227
1228utf.lo: $(TOP)\src\utf.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001229 $(LTCOMPILE) -c $(TOP)\src\utf.c
shanehb2f20bf2011-06-17 07:07:24 +00001230
1231util.lo: $(TOP)\src\util.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001232 $(LTCOMPILE) -c $(TOP)\src\util.c
shanehb2f20bf2011-06-17 07:07:24 +00001233
1234vacuum.lo: $(TOP)\src\vacuum.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001235 $(LTCOMPILE) -c $(TOP)\src\vacuum.c
shanehb2f20bf2011-06-17 07:07:24 +00001236
1237vdbe.lo: $(TOP)\src\vdbe.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001238 $(LTCOMPILE) -c $(TOP)\src\vdbe.c
shanehb2f20bf2011-06-17 07:07:24 +00001239
1240vdbeapi.lo: $(TOP)\src\vdbeapi.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001241 $(LTCOMPILE) -c $(TOP)\src\vdbeapi.c
shanehb2f20bf2011-06-17 07:07:24 +00001242
1243vdbeaux.lo: $(TOP)\src\vdbeaux.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001244 $(LTCOMPILE) -c $(TOP)\src\vdbeaux.c
shanehb2f20bf2011-06-17 07:07:24 +00001245
1246vdbeblob.lo: $(TOP)\src\vdbeblob.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001247 $(LTCOMPILE) -c $(TOP)\src\vdbeblob.c
shanehb2f20bf2011-06-17 07:07:24 +00001248
1249vdbemem.lo: $(TOP)\src\vdbemem.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001250 $(LTCOMPILE) -c $(TOP)\src\vdbemem.c
shanehb2f20bf2011-06-17 07:07:24 +00001251
mistachkin81c428a2011-08-17 02:19:54 +00001252vdbesort.lo: $(TOP)\src\vdbesort.c $(HDR)
1253 $(LTCOMPILE) -c $(TOP)\src\vdbesort.c
1254
shanehb2f20bf2011-06-17 07:07:24 +00001255vdbetrace.lo: $(TOP)\src\vdbetrace.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001256 $(LTCOMPILE) -c $(TOP)\src\vdbetrace.c
shanehb2f20bf2011-06-17 07:07:24 +00001257
1258vtab.lo: $(TOP)\src\vtab.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001259 $(LTCOMPILE) -c $(TOP)\src\vtab.c
shanehb2f20bf2011-06-17 07:07:24 +00001260
1261wal.lo: $(TOP)\src\wal.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001262 $(LTCOMPILE) -c $(TOP)\src\wal.c
shanehb2f20bf2011-06-17 07:07:24 +00001263
1264walker.lo: $(TOP)\src\walker.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001265 $(LTCOMPILE) -c $(TOP)\src\walker.c
shanehb2f20bf2011-06-17 07:07:24 +00001266
1267where.lo: $(TOP)\src\where.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001268 $(LTCOMPILE) -c $(TOP)\src\where.c
shanehb2f20bf2011-06-17 07:07:24 +00001269
1270tclsqlite.lo: $(TOP)\src\tclsqlite.c $(HDR)
1271 $(LTCOMPILE) -DUSE_TCL_STUBS=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c
1272
1273tclsqlite-shell.lo: $(TOP)\src\tclsqlite.c $(HDR)
1274 $(LTCOMPILE) -DTCLSH=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c
1275
mistachkin08c1c312012-10-06 03:48:25 +00001276tclsqlite3.exe: tclsqlite-shell.lo libsqlite3.lib $(LIBRESOBJS)
1277 $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /OUT:$@ libsqlite3.lib tclsqlite-shell.lo $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001278
1279# Rules to build opcodes.c and opcodes.h
1280#
1281opcodes.c: opcodes.h $(TOP)\mkopcodec.awk
drh307ff302011-08-30 01:29:04 +00001282 $(NAWK) -f $(TOP)\mkopcodec.awk opcodes.h > opcodes.c
shanehb2f20bf2011-06-17 07:07:24 +00001283
1284opcodes.h: parse.h $(TOP)\src\vdbe.c $(TOP)\mkopcodeh.awk
mistachkin5b0b6fd2011-06-25 01:14:36 +00001285 type parse.h $(TOP)\src\vdbe.c | $(NAWK) -f $(TOP)\mkopcodeh.awk > opcodes.h
shanehb2f20bf2011-06-17 07:07:24 +00001286
1287# Rules to build parse.c and parse.h - the outputs of lemon.
1288#
1289parse.h: parse.c
1290
1291parse.c: $(TOP)\src\parse.y lemon.exe $(TOP)\addopcodes.awk
shaneh6e7850c2011-06-17 15:57:07 +00001292 del /Q parse.y parse.h parse.h.temp
shanehb2f20bf2011-06-17 07:07:24 +00001293 copy $(TOP)\src\parse.y .
mistachkin4712c212014-05-09 20:51:17 +00001294 .\lemon.exe $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(OPTS) parse.y
shanehb2f20bf2011-06-17 07:07:24 +00001295 move parse.h parse.h.temp
mistachkin5b0b6fd2011-06-25 01:14:36 +00001296 $(NAWK) -f $(TOP)\addopcodes.awk parse.h.temp > parse.h
shanehb2f20bf2011-06-17 07:07:24 +00001297
1298sqlite3.h: $(TOP)\src\sqlite.h.in $(TOP)\manifest.uuid $(TOP)\VERSION
mistachkin3f40d402014-02-13 21:57:48 +00001299 $(TCLSH_CMD) $(TOP)\tool\mksqlite3h.tcl $(TOP:\=/) > sqlite3.h
shanehb2f20bf2011-06-17 07:07:24 +00001300
1301mkkeywordhash.exe: $(TOP)\tool\mkkeywordhash.c
mistachkin4712c212014-05-09 20:51:17 +00001302 $(BCC) -Fe$@ $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(OPTS) $(TOP)\tool\mkkeywordhash.c /link $(NLTLINKOPTS) $(NLTLIBPATHS)
shanehb2f20bf2011-06-17 07:07:24 +00001303
1304keywordhash.h: $(TOP)\tool\mkkeywordhash.c mkkeywordhash.exe
mistachkin5b0b6fd2011-06-25 01:14:36 +00001305 .\mkkeywordhash.exe > keywordhash.h
shanehb2f20bf2011-06-17 07:07:24 +00001306
1307
1308
1309# Rules to build the extension objects.
1310#
1311icu.lo: $(TOP)\ext\icu\icu.c $(HDR) $(EXTHDR)
1312 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\icu\icu.c
1313
1314fts2.lo: $(TOP)\ext\fts2\fts2.c $(HDR) $(EXTHDR)
1315 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2.c
1316
1317fts2_hash.lo: $(TOP)\ext\fts2\fts2_hash.c $(HDR) $(EXTHDR)
1318 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_hash.c
1319
1320fts2_icu.lo: $(TOP)\ext\fts2\fts2_icu.c $(HDR) $(EXTHDR)
1321 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_icu.c
1322
1323fts2_porter.lo: $(TOP)\ext\fts2\fts2_porter.c $(HDR) $(EXTHDR)
1324 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_porter.c
1325
1326fts2_tokenizer.lo: $(TOP)\ext\fts2\fts2_tokenizer.c $(HDR) $(EXTHDR)
1327 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_tokenizer.c
1328
1329fts2_tokenizer1.lo: $(TOP)\ext\fts2\fts2_tokenizer1.c $(HDR) $(EXTHDR)
1330 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_tokenizer1.c
1331
1332fts3.lo: $(TOP)\ext\fts3\fts3.c $(HDR) $(EXTHDR)
1333 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3.c
1334
1335fts3_aux.lo: $(TOP)\ext\fts3\fts3_aux.c $(HDR) $(EXTHDR)
1336 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_aux.c
1337
1338fts3_expr.lo: $(TOP)\ext\fts3\fts3_expr.c $(HDR) $(EXTHDR)
1339 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_expr.c
1340
1341fts3_hash.lo: $(TOP)\ext\fts3\fts3_hash.c $(HDR) $(EXTHDR)
1342 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_hash.c
1343
1344fts3_icu.lo: $(TOP)\ext\fts3\fts3_icu.c $(HDR) $(EXTHDR)
1345 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_icu.c
1346
1347fts3_snippet.lo: $(TOP)\ext\fts3\fts3_snippet.c $(HDR) $(EXTHDR)
1348 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_snippet.c
1349
1350fts3_porter.lo: $(TOP)\ext\fts3\fts3_porter.c $(HDR) $(EXTHDR)
1351 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_porter.c
1352
1353fts3_tokenizer.lo: $(TOP)\ext\fts3\fts3_tokenizer.c $(HDR) $(EXTHDR)
1354 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenizer.c
1355
1356fts3_tokenizer1.lo: $(TOP)\ext\fts3\fts3_tokenizer1.c $(HDR) $(EXTHDR)
1357 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenizer1.c
1358
drh4d648c72013-04-22 17:07:56 +00001359fts3_tokenize_vtab.lo: $(TOP)\ext\fts3\fts3_tokenize_vtab.c $(HDR) $(EXTHDR)
1360 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenize_vtab.c
1361
drh391d4ba2012-05-28 20:22:16 +00001362fts3_unicode.lo: $(TOP)\ext\fts3\fts3_unicode.c $(HDR) $(EXTHDR)
1363 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_unicode.c
1364
1365fts3_unicode2.lo: $(TOP)\ext\fts3\fts3_unicode2.c $(HDR) $(EXTHDR)
1366 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_unicode2.c
1367
shanehb2f20bf2011-06-17 07:07:24 +00001368fts3_write.lo: $(TOP)\ext\fts3\fts3_write.c $(HDR) $(EXTHDR)
1369 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_write.c
1370
1371rtree.lo: $(TOP)\ext\rtree\rtree.c $(HDR) $(EXTHDR)
1372 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\rtree\rtree.c
1373
1374
1375# Rules to build the 'testfixture' application.
1376#
1377# If using the amalgamation, use sqlite3.c directly to build the test
1378# fixture. Otherwise link against libsqlite3.lib. (This distinction is
1379# necessary because the test fixture requires non-API symbols which are
1380# hidden when the library is built via the amalgamation).
1381#
1382TESTFIXTURE_FLAGS = -DTCLSH=1 -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
shaneh6e7850c2011-06-17 15:57:07 +00001383TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE
shanehb2f20bf2011-06-17 07:07:24 +00001384
drh1fb64af2013-04-25 14:36:28 +00001385TESTFIXTURE_SRC0 = $(TESTEXT) $(TESTSRC2) libsqlite3.lib
mistachkin76510912013-10-11 23:01:18 +00001386TESTFIXTURE_SRC1 = $(TESTEXT) $(SQLITE3C)
shanehb2f20bf2011-06-17 07:07:24 +00001387!IF $(USE_AMALGAMATION)==0
1388TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC0)
1389!ELSE
1390TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC1)
1391!ENDIF
1392
mistachkin08c1c312012-10-06 03:48:25 +00001393testfixture.exe: $(TESTFIXTURE_SRC) $(LIBRESOBJS) $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +00001394 $(LTLINK) -DSQLITE_NO_SYNC=1 $(TESTFIXTURE_FLAGS) \
shanehb2f20bf2011-06-17 07:07:24 +00001395 -DBUILD_sqlite -I$(TCLINCDIR) \
shaneh2a0b9ef2011-06-20 20:52:32 +00001396 $(TESTFIXTURE_SRC) \
mistachkin08c1c312012-10-06 03:48:25 +00001397 /link $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001398
mistachkin1925a2e2014-02-24 21:20:25 +00001399extensiontest: testfixture.exe testloadext.dll
1400 .\testfixture.exe $(TOP)\test\loadext.test
mistachkin1925a2e2014-02-24 21:20:25 +00001401
shanehb2f20bf2011-06-17 07:07:24 +00001402fulltest: testfixture.exe sqlite3.exe
1403 .\testfixture.exe $(TOP)\test\all.test
1404
1405soaktest: testfixture.exe sqlite3.exe
1406 .\testfixture.exe $(TOP)\test\all.test -soak=1
1407
mistachkinc60941f2012-09-13 01:51:02 +00001408fulltestonly: testfixture.exe sqlite3.exe
1409 .\testfixture.exe $(TOP)\test\full.test
1410
mistachkin036acf32013-07-20 00:34:31 +00001411queryplantest: testfixture.exe sqlite3.exe
1412 .\testfixture.exe $(TOP)\test\permutations.test queryplanner
1413
shanehb2f20bf2011-06-17 07:07:24 +00001414test: testfixture.exe sqlite3.exe
1415 .\testfixture.exe $(TOP)\test\veryquick.test
1416
mistachkin76510912013-10-11 23:01:18 +00001417sqlite3_analyzer.c: $(SQLITE3C) $(TOP)\src\test_stat.c $(TOP)\src\tclsqlite.c $(TOP)\tool\spaceanal.tcl
1418 copy $(SQLITE3C) + $(TOP)\src\test_stat.c + $(TOP)\src\tclsqlite.c $@
mistachkin9a55e312011-09-22 00:06:44 +00001419 echo static const char *tclsh_main_loop(void){ >> $@
1420 echo static const char *zMainloop = >> $@
1421 $(NAWK) -f $(TOP)\tool\tostr.awk $(TOP)\tool\spaceanal.tcl >> $@
1422 echo ; return zMainloop; } >> $@
shanehb2f20bf2011-06-17 07:07:24 +00001423
mistachkin08c1c312012-10-06 03:48:25 +00001424sqlite3_analyzer.exe: sqlite3_analyzer.c $(LIBRESOBJS)
mistachkin9a55e312011-09-22 00:06:44 +00001425 $(LTLINK) -DBUILD_sqlite -DTCLSH=2 -I$(TCLINCDIR) sqlite3_analyzer.c \
mistachkin08c1c312012-10-06 03:48:25 +00001426 /link $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +00001427
mistachkin1925a2e2014-02-24 21:20:25 +00001428testloadext.lo: $(TOP)\src\test_loadext.c
1429 $(LTCOMPILE) -c $(TOP)\src\test_loadext.c
1430
1431testloadext.dll: testloadext.lo
1432 $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /OUT:$@ testloadext.lo
1433
mistachkinb0427512014-01-30 11:12:52 +00001434showdb.exe: $(TOP)\tool\showdb.c $(SQLITE3C)
1435 $(LTLINK) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
1436 $(TOP)\tool\showdb.c $(SQLITE3C)
drh9ac3c1e2013-11-07 18:37:31 +00001437
drh4bb77ec2014-06-30 11:14:26 +00001438showstat4.exe: $(TOP)\tool\showstat4.c $(SQLITE3C)
1439 $(LTLINK) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
1440 $(TOP)\tool\showstat4.c $(SQLITE3C)
1441
1442showjournal.exe: $(TOP)\tool\showjournal.c $(SQLITE3C)
1443 $(LTLINK) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
1444 $(TOP)\tool\showjournal.c $(SQLITE3C)
1445
1446showwal.exe: $(TOP)\tool\showwal.c $(SQLITE3C)
1447 $(LTLINK) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
1448 $(TOP)\tool\showwal.c $(SQLITE3C)
1449
mistachkinde545272014-07-07 17:57:50 +00001450fts3view.exe: $(TOP)\ext\fts3\tool\fts3view.c $(SQLITE3C)
1451 $(LTLINK) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
1452 $(TOP)\ext\fts3\tool\fts3view.c $(SQLITE3C)
1453
drh4bb77ec2014-06-30 11:14:26 +00001454rollback-test.exe: $(TOP)\tool\rollback-test.c $(SQLITE3C)
1455 $(LTLINK) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
1456 $(TOP)\tool\rollback-test.c $(SQLITE3C)
1457
drh267a13f2014-06-18 18:10:12 +00001458LogEst.exe: $(TOP)\tool\logest.c sqlite3.h
1459 $(LTLINK) -Fe$@ $(TOP)\tool\LogEst.c
1460
mistachkinb0427512014-01-30 11:12:52 +00001461wordcount.exe: $(TOP)\test\wordcount.c $(SQLITE3C)
1462 $(LTLINK) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
1463 $(TOP)\test\wordcount.c $(SQLITE3C)
drh9ac3c1e2013-11-07 18:37:31 +00001464
mistachkinb0427512014-01-30 11:12:52 +00001465speedtest1.exe: $(TOP)\test\speedtest1.c $(SQLITE3C)
1466 $(LTLINK) -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
1467 $(TOP)\test\speedtest1.c $(SQLITE3C)
drhad1ca9a2013-11-23 04:16:58 +00001468
shaneh6e7850c2011-06-17 15:57:07 +00001469clean:
mistachkin649591a2011-09-11 10:14:37 +00001470 del /Q *.lo *.ilk *.lib *.obj *.pdb sqlite3.exe libsqlite3.lib
mistachkin0157e012013-09-06 21:41:11 +00001471 del /Q *.cod *.da *.bb *.bbg gmon.out
shanehb2f20bf2011-06-17 07:07:24 +00001472 del /Q sqlite3.h opcodes.c opcodes.h
mistachkinf6a23422014-05-05 20:24:34 +00001473 del /Q lemon.* lempar.c parse.*
1474 del /Q mkkeywordhash.* keywordhash.h
mistachkin151d05c2014-02-24 21:42:33 +00001475 del /Q notasharedlib.*
mistachkinb482a442012-02-11 22:19:26 +00001476 -rmdir /Q/S .deps
1477 -rmdir /Q/S .libs
mistachkinf8a78462012-03-08 20:00:36 +00001478 -rmdir /Q/S quota2a
1479 -rmdir /Q/S quota2b
1480 -rmdir /Q/S quota2c
shanehb2f20bf2011-06-17 07:07:24 +00001481 -rmdir /Q/S tsrc
1482 del /Q .target_source
mistachkin0f104d52012-09-03 11:01:21 +00001483 del /Q tclsqlite3.exe tclsqlite3.exp
mistachkin1925a2e2014-02-24 21:20:25 +00001484 del /Q testloadext.dll testloadext.exp
shaneh603e4262011-06-17 18:52:07 +00001485 del /Q testfixture.exe testfixture.exp test.db
mistachkin3a046c62014-07-18 21:02:54 +00001486 del /Q LogEst.exe fts3view.exe rollback-test.exe showdb.exe
1487 del /Q showjournal.exe showstat4.exe showwal.exe speedtest1.exe
1488 del /Q wordcount.exe
shaneh6e7850c2011-06-17 15:57:07 +00001489 del /Q sqlite3.dll sqlite3.lib sqlite3.exp sqlite3.def
mistachkin76510912013-10-11 23:01:18 +00001490 del /Q sqlite3.c sqlite3-*.c
mistachkin4d9d1f42012-09-03 10:32:32 +00001491 del /Q sqlite3rc.h
mistachkinfde3b1c72013-03-29 19:52:04 +00001492 del /Q shell.c sqlite3ext.h
mistachkin9a55e312011-09-22 00:06:44 +00001493 del /Q sqlite3_analyzer.exe sqlite3_analyzer.exp sqlite3_analyzer.c
mistachkin29b75bd2012-10-20 09:35:57 +00001494 del /Q sqlite-*-output.vsix
drhbc94dbb2013-04-08 14:28:33 +00001495 del /Q mptester.exe
shanehb2f20bf2011-06-17 07:07:24 +00001496
mistachkin4d9d1f42012-09-03 10:32:32 +00001497# Dynamic link library section.
shanehb2f20bf2011-06-17 07:07:24 +00001498#
1499dll: sqlite3.dll
1500
shaneh6e7850c2011-06-17 15:57:07 +00001501sqlite3.def: libsqlite3.lib
mistachkin5b0b6fd2011-06-25 01:14:36 +00001502 echo EXPORTS > sqlite3.def
shaneh6e7850c2011-06-17 15:57:07 +00001503 dumpbin /all libsqlite3.lib \
mistachkin6a3eb4a2011-08-17 07:46:48 +00001504 | $(NAWK) "/ 1 _?sqlite3_/ { sub(/^.* _?/,\"\");print }" \
mistachkin5b0b6fd2011-06-25 01:14:36 +00001505 | sort >> sqlite3.def
shanehb2f20bf2011-06-17 07:07:24 +00001506
mistachkin08c1c312012-10-06 03:48:25 +00001507sqlite3.dll: $(LIBOBJ) $(LIBRESOBJS) sqlite3.def
1508 $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /DEF:sqlite3.def /OUT:$@ $(LIBOBJ) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)