blob: 20c8420d34bf74980d1f68c51c6bb02dab4c209d [file] [log] [blame]
drh376deb12004-06-30 11:41:55 +00001#!/usr/make
2#
3# Makefile for SQLITE
4#
5# This makefile is suppose to be configured automatically using the
6# autoconf. But if that does not work for you, you can configure
7# the makefile manually. Just set the parameters below to values that
8# work well for your system.
9#
10# If the configure script does not work out-of-the-box, you might
11# be able to get it to work by giving it some hints. See the comment
12# at the beginning of configure.in for additional information.
13#
14
15# The toplevel directory of the source tree. This is the directory
16# that contains this "Makefile.in" and the "configure.in" script.
17#
drhb43be552015-01-15 15:47:06 +000018TOP = @abs_srcdir@
drh376deb12004-06-30 11:41:55 +000019
20# C Compiler and options for use in building executables that
21# will run on the platform that is doing the build.
22#
23BCC = @BUILD_CC@ @BUILD_CFLAGS@
24
drh149735d2015-01-01 19:53:10 +000025# TCC is the C Compile and options for use in building executables that
drh376deb12004-06-30 11:41:55 +000026# will run on the target platform. (BCC and TCC are usually the
drh149735d2015-01-01 19:53:10 +000027# same unless your are cross-compiling.) Separate CC and CFLAGS macros
28# are provide so that these aspects of the build process can be changed
29# on the "make" command-line. Ex: "make CC=clang CFLAGS=-fsanitize=undefined"
drh376deb12004-06-30 11:41:55 +000030#
drh149735d2015-01-01 19:53:10 +000031CC = @CC@
32CFLAGS = @CPPFLAGS@ @CFLAGS@
drh8f455552015-01-07 14:41:18 +000033TCC = $(CC) $(CFLAGS) -I. -I${TOP}/src -I${TOP}/ext/rtree -I${TOP}/ext/fts3
tpoindex9d9f76c2005-01-03 21:28:56 +000034
mlcreech1e12d432008-05-07 02:42:01 +000035# Define this for the autoconf-based build, so that the code knows it can
36# include the generated config.h
37#
mistachkin1b904bf2012-01-14 03:34:24 +000038TCC += -D_HAVE_SQLITE_CONFIG_H -DBUILD_sqlite
mlcreech1e12d432008-05-07 02:42:01 +000039
tpoindex9d9f76c2005-01-03 21:28:56 +000040# Define -DNDEBUG to compile without debugging (i.e., for production usage)
41# Omitting the define will cause extra debugging code to be inserted and
42# includes extra comments when "EXPLAIN stmt" is used.
43#
drh05c7e0b2015-01-10 14:27:17 +000044TCC += @TARGET_DEBUG@
drh376deb12004-06-30 11:41:55 +000045
drh376deb12004-06-30 11:41:55 +000046# Compiler options needed for programs that use the TCL library.
47#
drh93468362004-12-10 03:08:12 +000048TCC += @TCL_INCLUDE_SPEC@
drh376deb12004-06-30 11:41:55 +000049
50# The library that programs using TCL must link against.
51#
mistachkinf344a5e2012-12-06 00:16:51 +000052LIBTCL = @TCL_LIB_SPEC@
drh376deb12004-06-30 11:41:55 +000053
54# Compiler options needed for programs that use the readline() library.
55#
56READLINE_FLAGS = -DHAVE_READLINE=@TARGET_HAVE_READLINE@ @TARGET_READLINE_INC@
57
58# The library that programs using readline() must link against.
59#
60LIBREADLINE = @TARGET_READLINE_LIBS@
61
62# Should the database engine be compiled threadsafe
63#
drh5a3032b2007-09-03 16:12:09 +000064TCC += -DSQLITE_THREADSAFE=@SQLITE_THREADSAFE@
drh376deb12004-06-30 11:41:55 +000065
mlcreechc658b0f2008-03-09 02:20:11 +000066# Any target libraries which libsqlite must be linked against
67#
vapier7f19c022007-02-17 14:46:31 +000068TLIBS = @LIBS@
drhf1878b42006-01-23 18:06:52 +000069
drh376deb12004-06-30 11:41:55 +000070# Flags controlling use of the in memory btree implementation
71#
danielk1977b06a0b62008-06-26 10:54:12 +000072# SQLITE_TEMP_STORE is 0 to force temporary tables to be in a file, 1 to
drh376deb12004-06-30 11:41:55 +000073# default to file, 2 to default to memory, and 3 to force temporary
74# tables to always be in memory.
75#
danielk1977b06a0b62008-06-26 10:54:12 +000076TEMP_STORE = -DSQLITE_TEMP_STORE=@TEMP_STORE@
drh376deb12004-06-30 11:41:55 +000077
shanefbedede2008-07-22 05:05:01 +000078# Enable/disable loadable extensions, and other optional features
shaneb1cd7302008-10-22 18:27:31 +000079# based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*).
80# The same set of OMIT and ENABLE flags should be passed to the
81# LEMON parser generator and the mkkeywordhash tool as well.
shanefbedede2008-07-22 05:05:01 +000082OPT_FEATURE_FLAGS = @OPT_FEATURE_FLAGS@
83
84TCC += $(OPT_FEATURE_FLAGS)
mlcreecha4edab02008-03-06 04:14:17 +000085
shaneb1cd7302008-10-22 18:27:31 +000086# Add in any optional parameters specified on the make commane line
87# ie. make "OPTS=-DSQLITE_ENABLE_FOO=1 -DSQLITE_OMIT_FOO=1".
88TCC += $(OPTS)
89
drh4b2266a2004-11-27 15:52:16 +000090# Version numbers and release number for the SQLite being compiled.
91#
92VERSION = @VERSION@
danielk197799ba19e2005-02-05 07:33:34 +000093VERSION_NUMBER = @VERSION_NUMBER@
drh4b2266a2004-11-27 15:52:16 +000094RELEASE = @RELEASE@
95
drh7b5717e2004-11-25 13:50:01 +000096# Filename extensions
97#
98BEXE = @BUILD_EXEEXT@
99TEXE = @TARGET_EXEEXT@
100
drh4b2266a2004-11-27 15:52:16 +0000101# The following variable is "1" if the configure script was able to locate
102# the tclConfig.sh file. It is an empty string otherwise. When this
103# variable is "1", the TCL extension library (libtclsqlite3.so) is built
104# and installed.
drh7b5717e2004-11-25 13:50:01 +0000105#
106HAVE_TCL = @HAVE_TCL@
107
mlcreechab1c47b2008-03-09 02:51:10 +0000108# This is the command to use for tclsh - normally just "tclsh", but we may
109# know the specific version we want to use
110#
111TCLSH_CMD = @TCLSH_CMD@
112
vapier6d120f32009-01-28 04:46:14 +0000113# Where do we want to install the tcl plugin
114#
115TCLLIBDIR = @TCLLIBDIR@
116
drh4b2266a2004-11-27 15:52:16 +0000117# The suffix used on shared libraries. Ex: ".dll", ".so", ".dylib"
118#
119SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@
120
mlcreechaac7b932008-04-01 02:45:22 +0000121# If gcov support was enabled by the configure script, add the appropriate
122# flags here. It's not always as easy as just having the user add the right
123# CFLAGS / LDFLAGS, because libtool wants to use CFLAGS when linking, which
124# causes build errors with -fprofile-arcs -ftest-coverage with some GCCs.
125# Supposedly GCC does the right thing if you use --coverage, but in
126# practice it still fails. See:
127#
128# http://www.mail-archive.com/debian-gcc@lists.debian.org/msg26197.html
129#
130# for more info.
131#
shaneb1cd7302008-10-22 18:27:31 +0000132GCOV_CFLAGS1 = -DSQLITE_COVERAGE_TEST=1 -fprofile-arcs -ftest-coverage
mlcreechaac7b932008-04-01 02:45:22 +0000133GCOV_LDFLAGS1 = -lgcov
134USE_GCOV = @USE_GCOV@
135LTCOMPILE_EXTRAS += $(GCOV_CFLAGS$(USE_GCOV))
136LTLINK_EXTRAS += $(GCOV_LDFLAGS$(USE_GCOV))
137
138
drh4b2266a2004-11-27 15:52:16 +0000139# The directory into which to store package information for
140
141# Some standard variables and programs
142#
mlcreech3c080bc2008-03-07 02:20:56 +0000143prefix = @prefix@
144exec_prefix = @exec_prefix@
drh4b2266a2004-11-27 15:52:16 +0000145libdir = @libdir@
danielk197794bdf892008-08-04 04:28:18 +0000146pkgconfigdir = $(libdir)/pkgconfig
mlcreechc55771f2008-03-06 08:09:12 +0000147bindir = @bindir@
148includedir = @includedir@
drh4b2266a2004-11-27 15:52:16 +0000149INSTALL = @INSTALL@
150LIBTOOL = ./libtool
151ALLOWRELEASE = @ALLOWRELEASE@
152
153# libtool compile/link/install
mlcreechaac7b932008-04-01 02:45:22 +0000154LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(TCC) $(LTCOMPILE_EXTRAS)
shaneb0650c22008-10-12 01:49:41 +0000155LTLINK = $(LIBTOOL) --mode=link $(TCC) $(LTCOMPILE_EXTRAS) @LDFLAGS@ $(LTLINK_EXTRAS)
drh4b2266a2004-11-27 15:52:16 +0000156LTINSTALL = $(LIBTOOL) --mode=install $(INSTALL)
157
drhf1878b42006-01-23 18:06:52 +0000158# nawk compatible awk.
159NAWK = @AWK@
160
drh376deb12004-06-30 11:41:55 +0000161# You should not have to change anything below this line
162###############################################################################
drh4b2266a2004-11-27 15:52:16 +0000163
shaneh18607052010-07-06 20:37:09 +0000164USE_AMALGAMATION = @USE_AMALGAMATION@
165
mlcreech94984912008-03-04 19:03:08 +0000166# Object files for the SQLite library (non-amalgamation).
drh376deb12004-06-30 11:41:55 +0000167#
shaneh18607052010-07-06 20:37:09 +0000168LIBOBJS0 = alter.lo analyze.lo attach.lo auth.lo \
169 backup.lo bitvec.lo btmutex.lo btree.lo build.lo \
drh1a4a6802015-05-04 18:31:09 +0000170 callback.lo complete.lo ctime.lo date.lo dbstat.lo delete.lo \
drh3edd8a52010-10-21 12:34:29 +0000171 expr.lo fault.lo fkey.lo \
drhd97f3d72012-05-28 15:32:09 +0000172 fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo \
173 fts3_porter.lo fts3_snippet.lo fts3_tokenizer.lo fts3_tokenizer1.lo \
dand7a959c2013-04-22 15:30:37 +0000174 fts3_tokenize_vtab.lo \
drhd97f3d72012-05-28 15:32:09 +0000175 fts3_unicode.lo fts3_unicode2.lo fts3_write.lo \
dan3e65f892015-06-25 20:36:36 +0000176 fts5.lo \
shaneh18607052010-07-06 20:37:09 +0000177 func.lo global.lo hash.lo \
178 icu.lo insert.lo journal.lo legacy.lo loadext.lo \
179 main.lo malloc.lo mem0.lo mem1.lo mem2.lo mem3.lo mem5.lo \
180 memjournal.lo \
drh83905c92012-06-21 13:00:37 +0000181 mutex.lo mutex_noop.lo mutex_unix.lo mutex_w32.lo \
182 notify.lo opcodes.lo os.lo os_unix.lo os_win.lo \
shaneh18607052010-07-06 20:37:09 +0000183 pager.lo parse.lo pcache.lo pcache1.lo pragma.lo prepare.lo printf.lo \
184 random.lo resolve.lo rowset.lo rtree.lo select.lo status.lo \
drh38b41492015-06-08 15:08:15 +0000185 table.lo threads.lo tokenize.lo treeview.lo trigger.lo \
shaneh18607052010-07-06 20:37:09 +0000186 update.lo util.lo vacuum.lo \
dana9f39fd2011-08-12 16:34:42 +0000187 vdbe.lo vdbeapi.lo vdbeaux.lo vdbeblob.lo vdbemem.lo vdbesort.lo \
drh6c1f4ef2015-06-08 14:23:15 +0000188 vdbetrace.lo wal.lo walker.lo where.lo wherecode.lo whereexpr.lo \
189 utf.lo vtab.lo
mlcreech94984912008-03-04 19:03:08 +0000190
191# Object files for the amalgamation.
192#
shaneh18607052010-07-06 20:37:09 +0000193LIBOBJS1 = sqlite3.lo
mlcreech94984912008-03-04 19:03:08 +0000194
195# Determine the real value of LIBOBJ based on the 'configure' script
196#
shaneh18607052010-07-06 20:37:09 +0000197LIBOBJ = $(LIBOBJS$(USE_AMALGAMATION))
mlcreech94984912008-03-04 19:03:08 +0000198
drh376deb12004-06-30 11:41:55 +0000199
200# All of the source code files.
201#
202SRC = \
drhd0e4a6c2005-02-15 20:47:57 +0000203 $(TOP)/src/alter.c \
drh9f18e8a2005-07-08 12:13:04 +0000204 $(TOP)/src/analyze.c \
drh376deb12004-06-30 11:41:55 +0000205 $(TOP)/src/attach.c \
206 $(TOP)/src/auth.c \
danielk197704103022009-02-03 16:51:24 +0000207 $(TOP)/src/backup.c \
mlcreeche0414bb2008-02-26 03:45:59 +0000208 $(TOP)/src/bitvec.c \
drh900b31e2007-08-28 02:27:51 +0000209 $(TOP)/src/btmutex.c \
drh376deb12004-06-30 11:41:55 +0000210 $(TOP)/src/btree.c \
211 $(TOP)/src/btree.h \
mlcreecheb6dc142008-03-13 18:28:03 +0000212 $(TOP)/src/btreeInt.h \
drh376deb12004-06-30 11:41:55 +0000213 $(TOP)/src/build.c \
danielk1977fd9a0a42005-05-24 12:01:00 +0000214 $(TOP)/src/callback.c \
drha2b902d2005-08-14 17:53:20 +0000215 $(TOP)/src/complete.c \
shanehdc97a8c2010-02-23 20:08:35 +0000216 $(TOP)/src/ctime.c \
drh376deb12004-06-30 11:41:55 +0000217 $(TOP)/src/date.c \
drh1a4a6802015-05-04 18:31:09 +0000218 $(TOP)/src/dbstat.c \
drh376deb12004-06-30 11:41:55 +0000219 $(TOP)/src/delete.c \
drh376deb12004-06-30 11:41:55 +0000220 $(TOP)/src/expr.c \
drh643167f2008-01-22 21:30:53 +0000221 $(TOP)/src/fault.c \
dan3be7d6e2009-09-19 17:59:59 +0000222 $(TOP)/src/fkey.c \
drh70a8ca32008-08-21 18:49:27 +0000223 $(TOP)/src/func.c \
drh40257ff2008-06-13 18:24:27 +0000224 $(TOP)/src/global.c \
drh376deb12004-06-30 11:41:55 +0000225 $(TOP)/src/hash.c \
226 $(TOP)/src/hash.h \
shane9bcbdad2008-05-29 20:22:37 +0000227 $(TOP)/src/hwtime.h \
drh376deb12004-06-30 11:41:55 +0000228 $(TOP)/src/insert.c \
drh4bfc8a92007-08-27 23:38:43 +0000229 $(TOP)/src/journal.c \
drh376deb12004-06-30 11:41:55 +0000230 $(TOP)/src/legacy.c \
drh1e397f82006-06-08 15:28:43 +0000231 $(TOP)/src/loadext.c \
drh376deb12004-06-30 11:41:55 +0000232 $(TOP)/src/main.c \
drh9e91c752007-05-07 13:11:10 +0000233 $(TOP)/src/malloc.c \
drhd1370b62008-10-28 18:58:20 +0000234 $(TOP)/src/mem0.c \
drh4bfc8a92007-08-27 23:38:43 +0000235 $(TOP)/src/mem1.c \
236 $(TOP)/src/mem2.c \
drh9c7a60d2007-10-19 17:47:24 +0000237 $(TOP)/src/mem3.c \
mlcreechfcfe27d2008-03-02 05:34:10 +0000238 $(TOP)/src/mem5.c \
danielk19776553c5c2008-10-21 04:30:31 +0000239 $(TOP)/src/memjournal.c \
mistachkin2318d332015-01-12 18:02:52 +0000240 $(TOP)/src/msvc.h \
drh4bfc8a92007-08-27 23:38:43 +0000241 $(TOP)/src/mutex.c \
mlcreecheb6dc142008-03-13 18:28:03 +0000242 $(TOP)/src/mutex.h \
drh18472fa2008-10-07 15:25:48 +0000243 $(TOP)/src/mutex_noop.c \
drh437b9012007-08-28 16:34:42 +0000244 $(TOP)/src/mutex_unix.c \
245 $(TOP)/src/mutex_w32.c \
danielk1977d52acb32009-03-16 14:48:18 +0000246 $(TOP)/src/notify.c \
drh054889e2005-11-30 03:20:31 +0000247 $(TOP)/src/os.c \
mlcreecheb6dc142008-03-13 18:28:03 +0000248 $(TOP)/src/os.h \
249 $(TOP)/src/os_common.h \
mistachkinf74b9e02013-11-26 01:00:31 +0000250 $(TOP)/src/os_setup.h \
drh376deb12004-06-30 11:41:55 +0000251 $(TOP)/src/os_unix.c \
252 $(TOP)/src/os_win.c \
mistachkin8bc52622013-11-25 09:36:07 +0000253 $(TOP)/src/os_win.h \
drh376deb12004-06-30 11:41:55 +0000254 $(TOP)/src/pager.c \
255 $(TOP)/src/pager.h \
256 $(TOP)/src/parse.y \
danielk19778c0a7912008-08-20 14:49:23 +0000257 $(TOP)/src/pcache.c \
258 $(TOP)/src/pcache.h \
danielk1977bc2ca9e2008-11-13 14:28:28 +0000259 $(TOP)/src/pcache1.c \
drh376deb12004-06-30 11:41:55 +0000260 $(TOP)/src/pragma.c \
drh67e65e52015-02-02 21:34:54 +0000261 $(TOP)/src/pragma.h \
danielk1977fa256a32005-05-25 04:11:56 +0000262 $(TOP)/src/prepare.c \
drh376deb12004-06-30 11:41:55 +0000263 $(TOP)/src/printf.c \
264 $(TOP)/src/random.c \
drh7d10d5a2008-08-20 16:35:10 +0000265 $(TOP)/src/resolve.c \
drh3d4501e2008-12-04 20:40:10 +0000266 $(TOP)/src/rowset.c \
drh376deb12004-06-30 11:41:55 +0000267 $(TOP)/src/select.c \
drhf7141992008-06-19 00:16:08 +0000268 $(TOP)/src/status.c \
drh376deb12004-06-30 11:41:55 +0000269 $(TOP)/src/shell.c \
270 $(TOP)/src/sqlite.h.in \
mlcreecheb6dc142008-03-13 18:28:03 +0000271 $(TOP)/src/sqlite3ext.h \
drh376deb12004-06-30 11:41:55 +0000272 $(TOP)/src/sqliteInt.h \
mlcreecheb6dc142008-03-13 18:28:03 +0000273 $(TOP)/src/sqliteLimit.h \
drh376deb12004-06-30 11:41:55 +0000274 $(TOP)/src/table.c \
drhf51446a2012-07-21 19:40:42 +0000275 $(TOP)/src/threads.c \
drh376deb12004-06-30 11:41:55 +0000276 $(TOP)/src/tclsqlite.c \
277 $(TOP)/src/tokenize.c \
drh38b41492015-06-08 15:08:15 +0000278 $(TOP)/src/treeview.c \
drh376deb12004-06-30 11:41:55 +0000279 $(TOP)/src/trigger.c \
280 $(TOP)/src/utf.c \
281 $(TOP)/src/update.c \
282 $(TOP)/src/util.c \
283 $(TOP)/src/vacuum.c \
284 $(TOP)/src/vdbe.c \
285 $(TOP)/src/vdbe.h \
286 $(TOP)/src/vdbeapi.c \
287 $(TOP)/src/vdbeaux.c \
danielk19776338c762007-05-17 16:38:30 +0000288 $(TOP)/src/vdbeblob.c \
drh376deb12004-06-30 11:41:55 +0000289 $(TOP)/src/vdbemem.c \
dana9f39fd2011-08-12 16:34:42 +0000290 $(TOP)/src/vdbesort.c \
drhc7bc4fd2009-11-25 18:03:42 +0000291 $(TOP)/src/vdbetrace.c \
drh376deb12004-06-30 11:41:55 +0000292 $(TOP)/src/vdbeInt.h \
drhb9bb7c12006-06-11 23:41:55 +0000293 $(TOP)/src/vtab.c \
drh8cd5b252015-03-02 22:06:43 +0000294 $(TOP)/src/vxworks.h \
drhc438efd2010-04-26 00:19:45 +0000295 $(TOP)/src/wal.c \
296 $(TOP)/src/wal.h \
drh7d10d5a2008-08-20 16:35:10 +0000297 $(TOP)/src/walker.c \
drhe54df422013-11-12 18:37:25 +0000298 $(TOP)/src/where.c \
drh6f82e852015-06-06 20:12:09 +0000299 $(TOP)/src/wherecode.c \
drh6c1f4ef2015-06-08 14:23:15 +0000300 $(TOP)/src/whereexpr.c \
drhe54df422013-11-12 18:37:25 +0000301 $(TOP)/src/whereInt.h
drh376deb12004-06-30 11:41:55 +0000302
drh0c979402006-10-03 19:12:32 +0000303# Source code for extensions
304#
305SRC += \
306 $(TOP)/ext/fts1/fts1.c \
307 $(TOP)/ext/fts1/fts1.h \
308 $(TOP)/ext/fts1/fts1_hash.c \
309 $(TOP)/ext/fts1/fts1_hash.h \
310 $(TOP)/ext/fts1/fts1_porter.c \
311 $(TOP)/ext/fts1/fts1_tokenizer.h \
312 $(TOP)/ext/fts1/fts1_tokenizer1.c
mlcreech47524b82008-03-02 05:40:05 +0000313SRC += \
314 $(TOP)/ext/fts2/fts2.c \
315 $(TOP)/ext/fts2/fts2.h \
316 $(TOP)/ext/fts2/fts2_hash.c \
317 $(TOP)/ext/fts2/fts2_hash.h \
318 $(TOP)/ext/fts2/fts2_icu.c \
319 $(TOP)/ext/fts2/fts2_porter.c \
320 $(TOP)/ext/fts2/fts2_tokenizer.h \
321 $(TOP)/ext/fts2/fts2_tokenizer.c \
322 $(TOP)/ext/fts2/fts2_tokenizer1.c
323SRC += \
324 $(TOP)/ext/fts3/fts3.c \
325 $(TOP)/ext/fts3/fts3.h \
dan16708c42009-11-19 15:25:25 +0000326 $(TOP)/ext/fts3/fts3Int.h \
shanehd01f9cb2011-02-09 15:25:17 +0000327 $(TOP)/ext/fts3/fts3_aux.c \
shane5df7c0f2009-01-02 15:47:01 +0000328 $(TOP)/ext/fts3/fts3_expr.c \
mlcreech47524b82008-03-02 05:40:05 +0000329 $(TOP)/ext/fts3/fts3_hash.c \
330 $(TOP)/ext/fts3/fts3_hash.h \
331 $(TOP)/ext/fts3/fts3_icu.c \
332 $(TOP)/ext/fts3/fts3_porter.c \
dan16708c42009-11-19 15:25:25 +0000333 $(TOP)/ext/fts3/fts3_snippet.c \
mlcreech47524b82008-03-02 05:40:05 +0000334 $(TOP)/ext/fts3/fts3_tokenizer.h \
335 $(TOP)/ext/fts3/fts3_tokenizer.c \
dan16708c42009-11-19 15:25:25 +0000336 $(TOP)/ext/fts3/fts3_tokenizer1.c \
dand7a959c2013-04-22 15:30:37 +0000337 $(TOP)/ext/fts3/fts3_tokenize_vtab.c \
drhd97f3d72012-05-28 15:32:09 +0000338 $(TOP)/ext/fts3/fts3_unicode.c \
339 $(TOP)/ext/fts3/fts3_unicode2.c \
dan16708c42009-11-19 15:25:25 +0000340 $(TOP)/ext/fts3/fts3_write.c
mlcreech47524b82008-03-02 05:40:05 +0000341SRC += \
danielk19771c826652008-09-08 08:08:09 +0000342 $(TOP)/ext/icu/sqliteicu.h \
mlcreech47524b82008-03-02 05:40:05 +0000343 $(TOP)/ext/icu/icu.c
shaneca57b872008-05-28 17:31:17 +0000344SRC += \
345 $(TOP)/ext/rtree/rtree.h \
346 $(TOP)/ext/rtree/rtree.c
dan28b22a02015-04-16 14:33:09 +0000347SRC += \
drhcfb8f8d2015-07-23 20:44:49 +0000348 $(TOP)/ext/rbu/sqlite3rbu.h \
349 $(TOP)/ext/rbu/sqlite3rbu.c
drh0c979402006-10-03 19:12:32 +0000350
mlcreech969b2cd2008-03-14 04:11:03 +0000351
shaneh18607052010-07-06 20:37:09 +0000352# Generated source code files
353#
354SRC += \
355 keywordhash.h \
356 opcodes.c \
357 opcodes.h \
358 parse.c \
359 parse.h \
360 config.h \
361 sqlite3.h
362
363# Source code to the test files.
mlcreech969b2cd2008-03-14 04:11:03 +0000364#
365TESTSRC = \
drh376deb12004-06-30 11:41:55 +0000366 $(TOP)/src/test1.c \
367 $(TOP)/src/test2.c \
368 $(TOP)/src/test3.c \
369 $(TOP)/src/test4.c \
370 $(TOP)/src/test5.c \
drh9c06c952005-11-26 00:25:00 +0000371 $(TOP)/src/test6.c \
drh7910e762006-01-09 23:50:11 +0000372 $(TOP)/src/test7.c \
drhb9bb7c12006-06-11 23:41:55 +0000373 $(TOP)/src/test8.c \
danielk1977a713f2c2007-03-29 12:19:11 +0000374 $(TOP)/src/test9.c \
drh1409be62006-08-23 20:07:20 +0000375 $(TOP)/src/test_autoext.c \
drh7910e762006-01-09 23:50:11 +0000376 $(TOP)/src/test_async.c \
danielk197704103022009-02-03 16:51:24 +0000377 $(TOP)/src/test_backup.c \
drh5de7d962014-12-05 00:17:39 +0000378 $(TOP)/src/test_blob.c \
drh16a9b832007-05-05 18:39:25 +0000379 $(TOP)/src/test_btree.c \
drhc797d4d2007-05-08 01:08:49 +0000380 $(TOP)/src/test_config.c \
shaneh84aab392010-05-06 15:35:59 +0000381 $(TOP)/src/test_demovfs.c \
danielk1977bf260972008-01-22 11:50:13 +0000382 $(TOP)/src/test_devsym.c \
drh70156982013-03-03 20:26:46 +0000383 $(TOP)/src/test_fs.c \
drh984bfaa2008-03-19 16:08:53 +0000384 $(TOP)/src/test_func.c \
drh15926592007-04-06 15:02:13 +0000385 $(TOP)/src/test_hexio.c \
shane8e283792009-08-21 02:07:09 +0000386 $(TOP)/src/test_init.c \
drh522efc62009-11-10 17:24:37 +0000387 $(TOP)/src/test_intarray.c \
danielk1977f3107512008-12-22 10:58:46 +0000388 $(TOP)/src/test_journal.c \
drh4bfc8a92007-08-27 23:38:43 +0000389 $(TOP)/src/test_malloc.c \
drh5af3ebd2010-11-05 00:00:42 +0000390 $(TOP)/src/test_multiplex.c \
shanec6f66c52008-07-08 22:15:49 +0000391 $(TOP)/src/test_mutex.c \
danielk197720e987a2007-10-05 15:04:12 +0000392 $(TOP)/src/test_onefile.c \
mlcreechede26272008-04-13 23:13:39 +0000393 $(TOP)/src/test_osinst.c \
drhb232c232008-11-19 01:20:26 +0000394 $(TOP)/src/test_pcache.c \
drh51e79a72010-10-06 20:25:00 +0000395 $(TOP)/src/test_quota.c \
dan9508daa2010-08-28 18:58:00 +0000396 $(TOP)/src/test_rtree.c \
danielk1977954ce992006-06-15 15:59:19 +0000397 $(TOP)/src/test_schema.c \
drh2d02a672006-01-25 15:55:37 +0000398 $(TOP)/src/test_server.c \
drh01a109e2010-11-24 13:04:22 +0000399 $(TOP)/src/test_superlock.c \
drh8689bc32011-04-01 20:54:38 +0000400 $(TOP)/src/test_syscall.c \
drh4be8b512006-06-13 23:51:34 +0000401 $(TOP)/src/test_tclvar.c \
shane8e283792009-08-21 02:07:09 +0000402 $(TOP)/src/test_thread.c \
shaneh84aab392010-05-06 15:35:59 +0000403 $(TOP)/src/test_vfs.c \
dan807d0fc2011-05-17 14:41:36 +0000404 $(TOP)/src/test_wsd.c \
dan99ebad92011-06-13 09:11:01 +0000405 $(TOP)/ext/fts3/fts3_term.c \
dan28b22a02015-04-16 14:33:09 +0000406 $(TOP)/ext/fts3/fts3_test.c \
drhcfb8f8d2015-07-23 20:44:49 +0000407 $(TOP)/ext/rbu/test_rbu.c
drh376deb12004-06-30 11:41:55 +0000408
drhe50db1c2013-04-25 14:31:46 +0000409# Statically linked extensions
410#
411TESTSRC += \
drh8416fc72013-04-25 16:42:55 +0000412 $(TOP)/ext/misc/amatch.c \
413 $(TOP)/ext/misc/closure.c \
drh1728bcb2014-11-10 16:49:56 +0000414 $(TOP)/ext/misc/eval.c \
drh51ed2982014-06-16 12:44:32 +0000415 $(TOP)/ext/misc/fileio.c \
drhe50db1c2013-04-25 14:31:46 +0000416 $(TOP)/ext/misc/fuzzer.c \
dan3e65f892015-06-25 20:36:36 +0000417 $(TOP)/ext/fts5/fts5_tcl.c \
dand3789c02015-08-04 20:29:00 +0000418 $(TOP)/ext/fts5/fts5_test_mi.c \
drh8416fc72013-04-25 16:42:55 +0000419 $(TOP)/ext/misc/ieee754.c \
drh6fd5c1e2015-08-21 20:37:12 +0000420 $(TOP)/ext/misc/json1.c \
drhea41dc42013-04-25 19:31:33 +0000421 $(TOP)/ext/misc/nextchar.c \
drhdef33672013-05-28 20:25:54 +0000422 $(TOP)/ext/misc/percentile.c \
drhe50db1c2013-04-25 14:31:46 +0000423 $(TOP)/ext/misc/regexp.c \
drh398f8722015-08-19 13:54:20 +0000424 $(TOP)/ext/misc/series.c \
drhb7045ab2013-04-25 14:59:01 +0000425 $(TOP)/ext/misc/spellfix.c \
drh5f8cdac2013-10-14 21:14:42 +0000426 $(TOP)/ext/misc/totype.c \
drhe50db1c2013-04-25 14:31:46 +0000427 $(TOP)/ext/misc/wholenumber.c
428
shaneh18607052010-07-06 20:37:09 +0000429# Source code to the library files needed by the test fixture
430#
431TESTSRC2 = \
432 $(TOP)/src/attach.c \
433 $(TOP)/src/backup.c \
434 $(TOP)/src/bitvec.c \
435 $(TOP)/src/btree.c \
436 $(TOP)/src/build.c \
437 $(TOP)/src/ctime.c \
438 $(TOP)/src/date.c \
drh1a4a6802015-05-04 18:31:09 +0000439 $(TOP)/src/dbstat.c \
shaneh18607052010-07-06 20:37:09 +0000440 $(TOP)/src/expr.c \
441 $(TOP)/src/func.c \
442 $(TOP)/src/insert.c \
443 $(TOP)/src/wal.c \
mistachkin06006632013-05-15 20:35:13 +0000444 $(TOP)/src/main.c \
shaneh18607052010-07-06 20:37:09 +0000445 $(TOP)/src/mem5.c \
446 $(TOP)/src/os.c \
shaneh18607052010-07-06 20:37:09 +0000447 $(TOP)/src/os_unix.c \
448 $(TOP)/src/os_win.c \
449 $(TOP)/src/pager.c \
450 $(TOP)/src/pragma.c \
451 $(TOP)/src/prepare.c \
452 $(TOP)/src/printf.c \
453 $(TOP)/src/random.c \
454 $(TOP)/src/pcache.c \
455 $(TOP)/src/pcache1.c \
456 $(TOP)/src/select.c \
457 $(TOP)/src/tokenize.c \
458 $(TOP)/src/utf.c \
459 $(TOP)/src/util.c \
460 $(TOP)/src/vdbeapi.c \
461 $(TOP)/src/vdbeaux.c \
462 $(TOP)/src/vdbe.c \
463 $(TOP)/src/vdbemem.c \
464 $(TOP)/src/vdbetrace.c \
465 $(TOP)/src/where.c \
drh6f82e852015-06-06 20:12:09 +0000466 $(TOP)/src/wherecode.c \
drh6c1f4ef2015-06-08 14:23:15 +0000467 $(TOP)/src/whereexpr.c \
shaneh18607052010-07-06 20:37:09 +0000468 parse.c \
469 $(TOP)/ext/fts3/fts3.c \
shanehd01f9cb2011-02-09 15:25:17 +0000470 $(TOP)/ext/fts3/fts3_aux.c \
shaneh18607052010-07-06 20:37:09 +0000471 $(TOP)/ext/fts3/fts3_expr.c \
shaneh671b5222011-05-12 21:01:12 +0000472 $(TOP)/ext/fts3/fts3_term.c \
shaneh18607052010-07-06 20:37:09 +0000473 $(TOP)/ext/fts3/fts3_tokenizer.c \
474 $(TOP)/ext/fts3/fts3_write.c \
475 $(TOP)/ext/async/sqlite3async.c
476
drh376deb12004-06-30 11:41:55 +0000477# Header files used by all library source files.
478#
479HDR = \
drh376deb12004-06-30 11:41:55 +0000480 $(TOP)/src/btree.h \
drha3152892007-05-05 11:48:52 +0000481 $(TOP)/src/btreeInt.h \
drh376deb12004-06-30 11:41:55 +0000482 $(TOP)/src/hash.h \
shane9bcbdad2008-05-29 20:22:37 +0000483 $(TOP)/src/hwtime.h \
shaneh18607052010-07-06 20:37:09 +0000484 keywordhash.h \
mistachkin2318d332015-01-12 18:02:52 +0000485 $(TOP)/src/msvc.h \
drh437b9012007-08-28 16:34:42 +0000486 $(TOP)/src/mutex.h \
drh376deb12004-06-30 11:41:55 +0000487 opcodes.h \
488 $(TOP)/src/os.h \
489 $(TOP)/src/os_common.h \
mistachkinf74b9e02013-11-26 01:00:31 +0000490 $(TOP)/src/os_setup.h \
mistachkin8bc52622013-11-25 09:36:07 +0000491 $(TOP)/src/os_win.h \
shaneh18607052010-07-06 20:37:09 +0000492 $(TOP)/src/pager.h \
493 $(TOP)/src/pcache.h \
494 parse.h \
drh67e65e52015-02-02 21:34:54 +0000495 $(TOP)/src/pragma.h \
shaneh18607052010-07-06 20:37:09 +0000496 sqlite3.h \
drh1e397f82006-06-08 15:28:43 +0000497 $(TOP)/src/sqlite3ext.h \
drh376deb12004-06-30 11:41:55 +0000498 $(TOP)/src/sqliteInt.h \
shaneh18607052010-07-06 20:37:09 +0000499 $(TOP)/src/sqliteLimit.h \
drh376deb12004-06-30 11:41:55 +0000500 $(TOP)/src/vdbe.h \
mlcreecheb6dc142008-03-13 18:28:03 +0000501 $(TOP)/src/vdbeInt.h \
drh8cd5b252015-03-02 22:06:43 +0000502 $(TOP)/src/vxworks.h \
drhe54df422013-11-12 18:37:25 +0000503 $(TOP)/src/whereInt.h \
mlcreech23797062008-03-20 02:25:35 +0000504 config.h
drh376deb12004-06-30 11:41:55 +0000505
drh0c979402006-10-03 19:12:32 +0000506# Header files used by extensions
507#
shaneh18607052010-07-06 20:37:09 +0000508EXTHDR += \
drh0c979402006-10-03 19:12:32 +0000509 $(TOP)/ext/fts1/fts1.h \
510 $(TOP)/ext/fts1/fts1_hash.h \
511 $(TOP)/ext/fts1/fts1_tokenizer.h
shaneh18607052010-07-06 20:37:09 +0000512EXTHDR += \
mlcreech47524b82008-03-02 05:40:05 +0000513 $(TOP)/ext/fts2/fts2.h \
514 $(TOP)/ext/fts2/fts2_hash.h \
515 $(TOP)/ext/fts2/fts2_tokenizer.h
shaneh18607052010-07-06 20:37:09 +0000516EXTHDR += \
mlcreech47524b82008-03-02 05:40:05 +0000517 $(TOP)/ext/fts3/fts3.h \
dan16708c42009-11-19 15:25:25 +0000518 $(TOP)/ext/fts3/fts3Int.h \
mlcreech47524b82008-03-02 05:40:05 +0000519 $(TOP)/ext/fts3/fts3_hash.h \
520 $(TOP)/ext/fts3/fts3_tokenizer.h
shaneh18607052010-07-06 20:37:09 +0000521EXTHDR += \
shaneca57b872008-05-28 17:31:17 +0000522 $(TOP)/ext/rtree/rtree.h
shaneh18607052010-07-06 20:37:09 +0000523EXTHDR += \
danielk19771c826652008-09-08 08:08:09 +0000524 $(TOP)/ext/icu/sqliteicu.h
dan9508daa2010-08-28 18:58:00 +0000525EXTHDR += \
526 $(TOP)/ext/rtree/sqlite3rtree.h
drh0c979402006-10-03 19:12:32 +0000527
mistachkind4ab1032015-05-11 16:27:33 +0000528# executables needed for testing
drhf4375442015-05-11 12:15:45 +0000529#
530TESTPROGS = \
531 testfixture$(TEXE) \
532 sqlite3$(TEXE) \
533 sqlite3_analyzer$(TEXE) \
534 sqldiff$(TEXE)
535
drhea93c702015-05-26 18:15:08 +0000536# Databases containing fuzzer test cases
537#
538FUZZDATA = \
539 $(TOP)/test/fuzzdata1.db \
540 $(TOP)/test/fuzzdata2.db \
drh64ff56f2015-09-23 11:59:50 +0000541 $(TOP)/test/fuzzdata3.db \
542 $(TOP)/test/fuzzdata4.db
drhf4375442015-05-11 12:15:45 +0000543
drhd7f2bea2015-09-19 14:32:51 +0000544# Extra arguments for including json1 in the build of tools
545#
546JSON1_DEP = $(TOP)/ext/misc/json1.c sqlite3ext.h
drh2f20e132015-09-26 17:44:59 +0000547JSON1_OPT = -DSQLITE_SHELL_JSON1 -DSQLITE_CORE
drhd7f2bea2015-09-19 14:32:51 +0000548JSON1_SRC = $(TOP)/ext/misc/json1.c
549
drh905da632015-06-10 18:53:09 +0000550# Standard options to testfixture
551#
552TESTOPTS = --verbose=file --output=test-out.txt
553
drh376deb12004-06-30 11:41:55 +0000554# This is the default Makefile target. The objects listed here
555# are what get build when you type just "make" with no arguments.
556#
drh7b5717e2004-11-25 13:50:01 +0000557all: sqlite3.h libsqlite3.la sqlite3$(TEXE) $(HAVE_TCL:1=libtclsqlite3.la)
drh376deb12004-06-30 11:41:55 +0000558
559Makefile: $(TOP)/Makefile.in
560 ./config.status
561
vapier2574da52009-01-26 20:59:02 +0000562sqlite3.pc: $(TOP)/sqlite3.pc.in
563 ./config.status
564
drh376deb12004-06-30 11:41:55 +0000565libsqlite3.la: $(LIBOBJ)
mistachkin691d4c92013-10-11 22:19:55 +0000566 $(LTLINK) -no-undefined -o $@ $(LIBOBJ) $(TLIBS) \
mlcreech289234c2008-03-13 19:55:20 +0000567 ${ALLOWRELEASE} -rpath "$(libdir)" -version-info "8:6:8"
drh376deb12004-06-30 11:41:55 +0000568
569libtclsqlite3.la: tclsqlite.lo libsqlite3.la
mistachkin691d4c92013-10-11 22:19:55 +0000570 $(LTLINK) -no-undefined -o $@ tclsqlite.lo \
drh0fcf2372008-07-25 12:49:44 +0000571 libsqlite3.la @TCL_STUB_LIB_SPEC@ $(TLIBS) \
vapier6d120f32009-01-28 04:46:14 +0000572 -rpath "$(TCLLIBDIR)" \
573 -version-info "8:6:8" \
574 -avoid-version
drh376deb12004-06-30 11:41:55 +0000575
drhd7f2bea2015-09-19 14:32:51 +0000576sqlite3$(TEXE): $(TOP)/src/shell.c libsqlite3.la sqlite3.h $(JSON1_DEP)
577 $(LTLINK) $(READLINE_FLAGS) $(JSON1_OPT) -o $@ \
578 $(TOP)/src/shell.c $(JSON1_SRC) libsqlite3.la \
mlcreech289234c2008-03-13 19:55:20 +0000579 $(LIBREADLINE) $(TLIBS) -rpath "$(libdir)"
drhc9a67a82007-12-13 18:20:46 +0000580
drhb6750b12015-05-05 01:09:06 +0000581sqldiff$(TEXE): $(TOP)/tool/sqldiff.c sqlite3.c sqlite3.h
mistachkin7a94e6b2015-05-26 03:24:33 +0000582 $(LTLINK) -o $@ $(TOP)/tool/sqldiff.c sqlite3.c $(TLIBS)
drhd62c0f42015-04-09 13:34:29 +0000583
drhd7f2bea2015-09-19 14:32:51 +0000584fuzzershell$(TEXE): $(TOP)/tool/fuzzershell.c sqlite3.c sqlite3.h $(JSON1_DEP)
585 $(LTLINK) -o $@ $(JSON1_OPT) \
586 $(TOP)/tool/fuzzershell.c $(JSON1_SRC) sqlite3.c $(TLIBS)
drh268e72f2015-04-17 14:30:49 +0000587
drhd7f2bea2015-09-19 14:32:51 +0000588fuzzcheck$(TEXE): $(TOP)/test/fuzzcheck.c sqlite3.c sqlite3.h $(JSON1_DEP)
589 $(LTLINK) -o $@ $(JSON1_OPT) $(TOP)/test/fuzzcheck.c $(JSON1_SRC) sqlite3.c $(TLIBS)
drhbc94dbb2013-04-08 14:28:33 +0000590
drhb6750b12015-05-05 01:09:06 +0000591mptester$(TEXE): sqlite3.c $(TOP)/mptest/mptest.c
drhbc94dbb2013-04-08 14:28:33 +0000592 $(LTLINK) -o $@ -I. $(TOP)/mptest/mptest.c sqlite3.c \
593 $(TLIBS) -rpath "$(libdir)"
594
drhb6750b12015-05-05 01:09:06 +0000595MPTEST1=./mptester$(TEXE) mptest.db $(TOP)/mptest/crash01.test --repeat 20
596MPTEST2=./mptester$(TEXE) mptest.db $(TOP)/mptest/multiwrite01.test --repeat 20
597mptest: mptester$(TEXE)
drhcc285c52015-03-11 14:34:38 +0000598 rm -f mptest.db
599 $(MPTEST1) --journalmode DELETE
600 $(MPTEST2) --journalmode WAL
601 $(MPTEST1) --journalmode WAL
602 $(MPTEST2) --journalmode PERSIST
603 $(MPTEST1) --journalmode PERSIST
604 $(MPTEST2) --journalmode TRUNCATE
605 $(MPTEST1) --journalmode TRUNCATE
606 $(MPTEST2) --journalmode DELETE
607
drhbc94dbb2013-04-08 14:28:33 +0000608
drh376deb12004-06-30 11:41:55 +0000609# This target creates a directory named "tsrc" and fills it with
610# copies of all of the C source code and header files needed to
611# build on the target system. Some of the C source code and header
612# files are automatically generated. This target takes care of
613# all that automatic generation.
614#
shaneh18607052010-07-06 20:37:09 +0000615.target_source: $(SRC) $(TOP)/tool/vdbe-compress.tcl
drh376deb12004-06-30 11:41:55 +0000616 rm -rf tsrc
shaneh18607052010-07-06 20:37:09 +0000617 mkdir tsrc
618 cp -f $(SRC) tsrc
drh376deb12004-06-30 11:41:55 +0000619 rm tsrc/sqlite.h.in tsrc/parse.y
drh2dc06482013-12-11 00:59:10 +0000620 $(TCLSH_CMD) $(TOP)/tool/vdbe-compress.tcl $(OPTS) <tsrc/vdbe.c >vdbe.new
drh856c1032009-06-02 15:21:42 +0000621 mv vdbe.new tsrc/vdbe.c
mlcreech94984912008-03-04 19:03:08 +0000622 touch .target_source
drh376deb12004-06-30 11:41:55 +0000623
drh1a4a6802015-05-04 18:31:09 +0000624sqlite3.c: .target_source $(TOP)/tool/mksqlite3c.tcl
625 $(TCLSH_CMD) $(TOP)/tool/mksqlite3c.tcl
drh339d6c62013-03-19 16:12:40 +0000626 cp tsrc/shell.c tsrc/sqlite3ext.h .
drh93d57532007-04-05 18:34:58 +0000627
drh2f20e132015-09-26 17:44:59 +0000628sqlite3ext.h: .target_source
629 cp tsrc/sqlite3ext.h .
630
drhf4fd9ed2011-11-07 16:46:43 +0000631tclsqlite3.c: sqlite3.c
632 echo '#ifndef USE_SYSTEM_SQLITE' >tclsqlite3.c
633 cat sqlite3.c >>tclsqlite3.c
634 echo '#endif /* USE_SYSTEM_SQLITE */' >>tclsqlite3.c
635 cat $(TOP)/src/tclsqlite.c >>tclsqlite3.c
636
drh07516dd2011-07-22 11:16:39 +0000637sqlite3-all.c: sqlite3.c $(TOP)/tool/split-sqlite3c.tcl
638 $(TCLSH_CMD) $(TOP)/tool/split-sqlite3c.tcl
639
shaneh18607052010-07-06 20:37:09 +0000640# Rule to build the amalgamation
641#
642sqlite3.lo: sqlite3.c
643 $(LTCOMPILE) $(TEMP_STORE) -c sqlite3.c
644
drh376deb12004-06-30 11:41:55 +0000645# Rules to build the LEMON compiler generator
646#
drh53bc21b2009-07-03 17:09:28 +0000647lemon$(BEXE): $(TOP)/tool/lemon.c $(TOP)/src/lempar.c
mlcreech1428b372008-03-13 23:28:22 +0000648 $(BCC) -o $@ $(TOP)/tool/lemon.c
drh53bc21b2009-07-03 17:09:28 +0000649 cp $(TOP)/src/lempar.c .
drh376deb12004-06-30 11:41:55 +0000650
shaneh18607052010-07-06 20:37:09 +0000651# Rules to build individual *.o files from generated *.c files. This
652# applies to:
mlcreech94984912008-03-04 19:03:08 +0000653#
shaneh18607052010-07-06 20:37:09 +0000654# parse.o
655# opcodes.o
656#
657parse.lo: parse.c $(HDR)
658 $(LTCOMPILE) $(TEMP_STORE) -c parse.c
mlcreech94984912008-03-04 19:03:08 +0000659
shaneh18607052010-07-06 20:37:09 +0000660opcodes.lo: opcodes.c
661 $(LTCOMPILE) $(TEMP_STORE) -c opcodes.c
662
663# Rules to build individual *.o files from files in the src directory.
drh376deb12004-06-30 11:41:55 +0000664#
drhd0e4a6c2005-02-15 20:47:57 +0000665alter.lo: $(TOP)/src/alter.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000666 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/alter.c
drhd0e4a6c2005-02-15 20:47:57 +0000667
drh9f18e8a2005-07-08 12:13:04 +0000668analyze.lo: $(TOP)/src/analyze.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000669 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/analyze.c
drh9f18e8a2005-07-08 12:13:04 +0000670
drh376deb12004-06-30 11:41:55 +0000671attach.lo: $(TOP)/src/attach.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000672 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/attach.c
drh376deb12004-06-30 11:41:55 +0000673
674auth.lo: $(TOP)/src/auth.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000675 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/auth.c
drh376deb12004-06-30 11:41:55 +0000676
rse973402e2009-02-20 22:27:41 +0000677backup.lo: $(TOP)/src/backup.c $(HDR)
678 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/backup.c
679
mlcreech5b9d8672008-02-27 03:22:49 +0000680bitvec.lo: $(TOP)/src/bitvec.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000681 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/bitvec.c
mlcreech5b9d8672008-02-27 03:22:49 +0000682
drh900b31e2007-08-28 02:27:51 +0000683btmutex.lo: $(TOP)/src/btmutex.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000684 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/btmutex.c
drh900b31e2007-08-28 02:27:51 +0000685
drh376deb12004-06-30 11:41:55 +0000686btree.lo: $(TOP)/src/btree.c $(HDR) $(TOP)/src/pager.h
drh8b727472009-01-19 18:18:40 +0000687 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/btree.c
drh376deb12004-06-30 11:41:55 +0000688
689build.lo: $(TOP)/src/build.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000690 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/build.c
drh376deb12004-06-30 11:41:55 +0000691
danielk1977fd9a0a42005-05-24 12:01:00 +0000692callback.lo: $(TOP)/src/callback.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000693 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/callback.c
danielk1977fd9a0a42005-05-24 12:01:00 +0000694
drha2b902d2005-08-14 17:53:20 +0000695complete.lo: $(TOP)/src/complete.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000696 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/complete.c
drha2b902d2005-08-14 17:53:20 +0000697
shanehdc97a8c2010-02-23 20:08:35 +0000698ctime.lo: $(TOP)/src/ctime.c $(HDR)
699 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/ctime.c
700
drh376deb12004-06-30 11:41:55 +0000701date.lo: $(TOP)/src/date.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000702 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/date.c
drh376deb12004-06-30 11:41:55 +0000703
drh1a4a6802015-05-04 18:31:09 +0000704dbstat.lo: $(TOP)/src/dbstat.c $(HDR)
705 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/dbstat.c
706
drh376deb12004-06-30 11:41:55 +0000707delete.lo: $(TOP)/src/delete.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000708 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/delete.c
drh376deb12004-06-30 11:41:55 +0000709
drh376deb12004-06-30 11:41:55 +0000710expr.lo: $(TOP)/src/expr.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000711 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/expr.c
drh376deb12004-06-30 11:41:55 +0000712
drh643167f2008-01-22 21:30:53 +0000713fault.lo: $(TOP)/src/fault.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000714 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/fault.c
drh643167f2008-01-22 21:30:53 +0000715
dan3be7d6e2009-09-19 17:59:59 +0000716fkey.lo: $(TOP)/src/fkey.c $(HDR)
717 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/fkey.c
718
drh70a8ca32008-08-21 18:49:27 +0000719func.lo: $(TOP)/src/func.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000720 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/func.c
drh376deb12004-06-30 11:41:55 +0000721
drh40257ff2008-06-13 18:24:27 +0000722global.lo: $(TOP)/src/global.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000723 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/global.c
drh40257ff2008-06-13 18:24:27 +0000724
drh376deb12004-06-30 11:41:55 +0000725hash.lo: $(TOP)/src/hash.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000726 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/hash.c
drh376deb12004-06-30 11:41:55 +0000727
728insert.lo: $(TOP)/src/insert.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000729 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/insert.c
drh376deb12004-06-30 11:41:55 +0000730
drh4bfc8a92007-08-27 23:38:43 +0000731journal.lo: $(TOP)/src/journal.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000732 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/journal.c
drh4bfc8a92007-08-27 23:38:43 +0000733
drh376deb12004-06-30 11:41:55 +0000734legacy.lo: $(TOP)/src/legacy.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000735 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/legacy.c
drh376deb12004-06-30 11:41:55 +0000736
drh1e397f82006-06-08 15:28:43 +0000737loadext.lo: $(TOP)/src/loadext.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000738 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/loadext.c
drh1e397f82006-06-08 15:28:43 +0000739
drh376deb12004-06-30 11:41:55 +0000740main.lo: $(TOP)/src/main.c $(HDR)
741 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/main.c
742
drha3152892007-05-05 11:48:52 +0000743malloc.lo: $(TOP)/src/malloc.c $(HDR)
744 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/malloc.c
745
drhd1370b62008-10-28 18:58:20 +0000746mem0.lo: $(TOP)/src/mem0.c $(HDR)
747 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem0.c
748
drh4bfc8a92007-08-27 23:38:43 +0000749mem1.lo: $(TOP)/src/mem1.c $(HDR)
750 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem1.c
751
752mem2.lo: $(TOP)/src/mem2.c $(HDR)
753 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem2.c
754
drh9c7a60d2007-10-19 17:47:24 +0000755mem3.lo: $(TOP)/src/mem3.c $(HDR)
756 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem3.c
757
mlcreechfcfe27d2008-03-02 05:34:10 +0000758mem5.lo: $(TOP)/src/mem5.c $(HDR)
759 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem5.c
760
danielk19776553c5c2008-10-21 04:30:31 +0000761memjournal.lo: $(TOP)/src/memjournal.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000762 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/memjournal.c
danielk19776553c5c2008-10-21 04:30:31 +0000763
drh4bfc8a92007-08-27 23:38:43 +0000764mutex.lo: $(TOP)/src/mutex.c $(HDR)
765 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex.c
766
drh18472fa2008-10-07 15:25:48 +0000767mutex_noop.lo: $(TOP)/src/mutex_noop.c $(HDR)
768 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex_noop.c
769
drh437b9012007-08-28 16:34:42 +0000770mutex_unix.lo: $(TOP)/src/mutex_unix.c $(HDR)
771 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex_unix.c
772
773mutex_w32.lo: $(TOP)/src/mutex_w32.c $(HDR)
774 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex_w32.c
775
danielk1977d52acb32009-03-16 14:48:18 +0000776notify.lo: $(TOP)/src/notify.c $(HDR)
777 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/notify.c
778
drh376deb12004-06-30 11:41:55 +0000779pager.lo: $(TOP)/src/pager.c $(HDR) $(TOP)/src/pager.h
drh8b727472009-01-19 18:18:40 +0000780 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pager.c
drh376deb12004-06-30 11:41:55 +0000781
danielk19778c0a7912008-08-20 14:49:23 +0000782pcache.lo: $(TOP)/src/pcache.c $(HDR) $(TOP)/src/pcache.h
drh8b727472009-01-19 18:18:40 +0000783 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pcache.c
danielk19778c0a7912008-08-20 14:49:23 +0000784
danielk1977bc2ca9e2008-11-13 14:28:28 +0000785pcache1.lo: $(TOP)/src/pcache1.c $(HDR) $(TOP)/src/pcache.h
drh8b727472009-01-19 18:18:40 +0000786 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pcache1.c
danielk1977bc2ca9e2008-11-13 14:28:28 +0000787
drh054889e2005-11-30 03:20:31 +0000788os.lo: $(TOP)/src/os.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000789 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os.c
drh054889e2005-11-30 03:20:31 +0000790
drh376deb12004-06-30 11:41:55 +0000791os_unix.lo: $(TOP)/src/os_unix.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000792 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os_unix.c
drh376deb12004-06-30 11:41:55 +0000793
794os_win.lo: $(TOP)/src/os_win.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000795 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os_win.c
drh376deb12004-06-30 11:41:55 +0000796
drh376deb12004-06-30 11:41:55 +0000797pragma.lo: $(TOP)/src/pragma.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000798 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pragma.c
drh376deb12004-06-30 11:41:55 +0000799
danielk1977fa256a32005-05-25 04:11:56 +0000800prepare.lo: $(TOP)/src/prepare.c $(HDR)
801 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/prepare.c
802
drh376deb12004-06-30 11:41:55 +0000803printf.lo: $(TOP)/src/printf.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000804 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/printf.c
drh376deb12004-06-30 11:41:55 +0000805
806random.lo: $(TOP)/src/random.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000807 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/random.c
drh376deb12004-06-30 11:41:55 +0000808
drh7d10d5a2008-08-20 16:35:10 +0000809resolve.lo: $(TOP)/src/resolve.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000810 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/resolve.c
drh7d10d5a2008-08-20 16:35:10 +0000811
drh3d4501e2008-12-04 20:40:10 +0000812rowset.lo: $(TOP)/src/rowset.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000813 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/rowset.c
drh3d4501e2008-12-04 20:40:10 +0000814
drh376deb12004-06-30 11:41:55 +0000815select.lo: $(TOP)/src/select.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000816 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/select.c
drh376deb12004-06-30 11:41:55 +0000817
drhf7141992008-06-19 00:16:08 +0000818status.lo: $(TOP)/src/status.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000819 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/status.c
drhf7141992008-06-19 00:16:08 +0000820
drh376deb12004-06-30 11:41:55 +0000821table.lo: $(TOP)/src/table.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000822 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/table.c
drh376deb12004-06-30 11:41:55 +0000823
drhf51446a2012-07-21 19:40:42 +0000824threads.lo: $(TOP)/src/threads.c $(HDR)
825 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/threads.c
826
drh73b211a2005-01-18 04:00:42 +0000827tokenize.lo: $(TOP)/src/tokenize.c keywordhash.h $(HDR)
drh8b727472009-01-19 18:18:40 +0000828 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/tokenize.c
drh376deb12004-06-30 11:41:55 +0000829
drh38b41492015-06-08 15:08:15 +0000830treeview.lo: $(TOP)/src/treeview.c $(HDR)
831 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/treeview.c
832
drh376deb12004-06-30 11:41:55 +0000833trigger.lo: $(TOP)/src/trigger.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000834 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/trigger.c
drh376deb12004-06-30 11:41:55 +0000835
836update.lo: $(TOP)/src/update.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000837 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/update.c
drh376deb12004-06-30 11:41:55 +0000838
839utf.lo: $(TOP)/src/utf.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000840 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/utf.c
drh376deb12004-06-30 11:41:55 +0000841
842util.lo: $(TOP)/src/util.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000843 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/util.c
drh376deb12004-06-30 11:41:55 +0000844
845vacuum.lo: $(TOP)/src/vacuum.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000846 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vacuum.c
drh376deb12004-06-30 11:41:55 +0000847
mlcreecheb6dc142008-03-13 18:28:03 +0000848vdbe.lo: $(TOP)/src/vdbe.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000849 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbe.c
drh376deb12004-06-30 11:41:55 +0000850
mlcreecheb6dc142008-03-13 18:28:03 +0000851vdbeapi.lo: $(TOP)/src/vdbeapi.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000852 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbeapi.c
drh376deb12004-06-30 11:41:55 +0000853
mlcreecheb6dc142008-03-13 18:28:03 +0000854vdbeaux.lo: $(TOP)/src/vdbeaux.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000855 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbeaux.c
drh376deb12004-06-30 11:41:55 +0000856
mlcreecheb6dc142008-03-13 18:28:03 +0000857vdbeblob.lo: $(TOP)/src/vdbeblob.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000858 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbeblob.c
danielk19776338c762007-05-17 16:38:30 +0000859
mlcreecheb6dc142008-03-13 18:28:03 +0000860vdbemem.lo: $(TOP)/src/vdbemem.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000861 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbemem.c
drh376deb12004-06-30 11:41:55 +0000862
dana9f39fd2011-08-12 16:34:42 +0000863vdbesort.lo: $(TOP)/src/vdbesort.c $(HDR)
864 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbesort.c
865
drhc7bc4fd2009-11-25 18:03:42 +0000866vdbetrace.lo: $(TOP)/src/vdbetrace.c $(HDR)
867 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbetrace.c
868
mlcreecheb6dc142008-03-13 18:28:03 +0000869vtab.lo: $(TOP)/src/vtab.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000870 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vtab.c
drhb9bb7c12006-06-11 23:41:55 +0000871
drhc438efd2010-04-26 00:19:45 +0000872wal.lo: $(TOP)/src/wal.c $(HDR)
873 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/wal.c
874
drh7d10d5a2008-08-20 16:35:10 +0000875walker.lo: $(TOP)/src/walker.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000876 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/walker.c
drh7d10d5a2008-08-20 16:35:10 +0000877
drh376deb12004-06-30 11:41:55 +0000878where.lo: $(TOP)/src/where.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000879 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/where.c
drh376deb12004-06-30 11:41:55 +0000880
drh6f82e852015-06-06 20:12:09 +0000881wherecode.lo: $(TOP)/src/wherecode.c $(HDR)
882 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/wherecode.c
883
drh6c1f4ef2015-06-08 14:23:15 +0000884whereexpr.lo: $(TOP)/src/whereexpr.c $(HDR)
885 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/whereexpr.c
886
shaneh18607052010-07-06 20:37:09 +0000887tclsqlite.lo: $(TOP)/src/tclsqlite.c $(HDR)
888 $(LTCOMPILE) -DUSE_TCL_STUBS=1 -c $(TOP)/src/tclsqlite.c
889
drh7b5717e2004-11-25 13:50:01 +0000890tclsqlite-shell.lo: $(TOP)/src/tclsqlite.c $(HDR)
891 $(LTCOMPILE) -DTCLSH=1 -o $@ -c $(TOP)/src/tclsqlite.c
drh376deb12004-06-30 11:41:55 +0000892
drh7b5717e2004-11-25 13:50:01 +0000893tclsqlite-stubs.lo: $(TOP)/src/tclsqlite.c $(HDR)
shaneh8128bb22010-08-19 14:41:58 +0000894 $(LTCOMPILE) -DUSE_TCL_STUBS=1 -o $@ -c $(TOP)/src/tclsqlite.c
drh7b5717e2004-11-25 13:50:01 +0000895
mlcreech1428b372008-03-13 23:28:22 +0000896tclsqlite3$(TEXE): tclsqlite-shell.lo libsqlite3.la
897 $(LTLINK) -o $@ tclsqlite-shell.lo \
drh376deb12004-06-30 11:41:55 +0000898 libsqlite3.la $(LIBTCL)
899
shaneh18607052010-07-06 20:37:09 +0000900# Rules to build opcodes.c and opcodes.h
901#
902opcodes.c: opcodes.h $(TOP)/mkopcodec.awk
drh307ff302011-08-30 01:29:04 +0000903 $(NAWK) -f $(TOP)/mkopcodec.awk opcodes.h >opcodes.c
shaneh18607052010-07-06 20:37:09 +0000904
drhb15393b2015-10-07 02:52:09 +0000905opcodes.h: parse.h $(TOP)/src/vdbe.c $(TOP)/tool/mkopcodeh.tcl
906 cat parse.h $(TOP)/src/vdbe.c | $(TCLSH_CMD) $(TOP)/tool/mkopcodeh.tcl >opcodes.h
shaneh18607052010-07-06 20:37:09 +0000907
908# Rules to build parse.c and parse.h - the outputs of lemon.
909#
910parse.h: parse.c
911
912parse.c: $(TOP)/src/parse.y lemon$(BEXE) $(TOP)/addopcodes.awk
913 cp $(TOP)/src/parse.y .
914 rm -f parse.h
915 ./lemon$(BEXE) $(OPT_FEATURE_FLAGS) $(OPTS) parse.y
916 mv parse.h parse.h.temp
917 $(NAWK) -f $(TOP)/addopcodes.awk parse.h.temp >parse.h
918
919sqlite3.h: $(TOP)/src/sqlite.h.in $(TOP)/manifest.uuid $(TOP)/VERSION
drh16b92ee2011-07-22 10:33:04 +0000920 $(TCLSH_CMD) $(TOP)/tool/mksqlite3h.tcl $(TOP) >sqlite3.h
shaneh18607052010-07-06 20:37:09 +0000921
922keywordhash.h: $(TOP)/tool/mkkeywordhash.c
923 $(BCC) -o mkkeywordhash$(BEXE) $(OPT_FEATURE_FLAGS) $(OPTS) $(TOP)/tool/mkkeywordhash.c
924 ./mkkeywordhash$(BEXE) >keywordhash.h
925
926
927
928# Rules to build the extension objects.
929#
930icu.lo: $(TOP)/ext/icu/icu.c $(HDR) $(EXTHDR)
931 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/icu/icu.c
932
933fts2.lo: $(TOP)/ext/fts2/fts2.c $(HDR) $(EXTHDR)
934 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2.c
935
936fts2_hash.lo: $(TOP)/ext/fts2/fts2_hash.c $(HDR) $(EXTHDR)
937 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_hash.c
938
939fts2_icu.lo: $(TOP)/ext/fts2/fts2_icu.c $(HDR) $(EXTHDR)
940 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_icu.c
941
942fts2_porter.lo: $(TOP)/ext/fts2/fts2_porter.c $(HDR) $(EXTHDR)
943 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_porter.c
944
945fts2_tokenizer.lo: $(TOP)/ext/fts2/fts2_tokenizer.c $(HDR) $(EXTHDR)
946 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_tokenizer.c
947
948fts2_tokenizer1.lo: $(TOP)/ext/fts2/fts2_tokenizer1.c $(HDR) $(EXTHDR)
949 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_tokenizer1.c
950
951fts3.lo: $(TOP)/ext/fts3/fts3.c $(HDR) $(EXTHDR)
952 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3.c
953
shanehd01f9cb2011-02-09 15:25:17 +0000954fts3_aux.lo: $(TOP)/ext/fts3/fts3_aux.c $(HDR) $(EXTHDR)
955 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_aux.c
956
shaneh18607052010-07-06 20:37:09 +0000957fts3_expr.lo: $(TOP)/ext/fts3/fts3_expr.c $(HDR) $(EXTHDR)
958 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_expr.c
959
960fts3_hash.lo: $(TOP)/ext/fts3/fts3_hash.c $(HDR) $(EXTHDR)
961 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_hash.c
962
963fts3_icu.lo: $(TOP)/ext/fts3/fts3_icu.c $(HDR) $(EXTHDR)
964 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_icu.c
965
shaneh671b5222011-05-12 21:01:12 +0000966fts3_porter.lo: $(TOP)/ext/fts3/fts3_porter.c $(HDR) $(EXTHDR)
967 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_porter.c
968
shaneh18607052010-07-06 20:37:09 +0000969fts3_snippet.lo: $(TOP)/ext/fts3/fts3_snippet.c $(HDR) $(EXTHDR)
970 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_snippet.c
971
shaneh18607052010-07-06 20:37:09 +0000972fts3_tokenizer.lo: $(TOP)/ext/fts3/fts3_tokenizer.c $(HDR) $(EXTHDR)
973 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer.c
974
975fts3_tokenizer1.lo: $(TOP)/ext/fts3/fts3_tokenizer1.c $(HDR) $(EXTHDR)
976 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer1.c
977
dancf5db442013-05-16 18:33:06 +0000978fts3_tokenize_vtab.lo: $(TOP)/ext/fts3/fts3_tokenize_vtab.c $(HDR) $(EXTHDR)
979 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenize_vtab.c
dand7a959c2013-04-22 15:30:37 +0000980
dan4b8213d2012-06-09 18:52:29 +0000981fts3_unicode.lo: $(TOP)/ext/fts3/fts3_unicode.c $(HDR) $(EXTHDR)
982 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_unicode.c
983
984fts3_unicode2.lo: $(TOP)/ext/fts3/fts3_unicode2.c $(HDR) $(EXTHDR)
985 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_unicode2.c
986
shaneh18607052010-07-06 20:37:09 +0000987fts3_write.lo: $(TOP)/ext/fts3/fts3_write.c $(HDR) $(EXTHDR)
988 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_write.c
989
990rtree.lo: $(TOP)/ext/rtree/rtree.c $(HDR) $(EXTHDR)
991 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/rtree/rtree.c
992
dan3e65f892015-06-25 20:36:36 +0000993# FTS5 things
994#
995FTS5_SRC = \
996 $(TOP)/ext/fts5/fts5.h \
997 $(TOP)/ext/fts5/fts5Int.h \
998 $(TOP)/ext/fts5/fts5_aux.c \
999 $(TOP)/ext/fts5/fts5_buffer.c \
1000 $(TOP)/ext/fts5/fts5_main.c \
1001 $(TOP)/ext/fts5/fts5_config.c \
1002 $(TOP)/ext/fts5/fts5_expr.c \
1003 $(TOP)/ext/fts5/fts5_hash.c \
1004 $(TOP)/ext/fts5/fts5_index.c \
1005 fts5parse.c fts5parse.h \
1006 $(TOP)/ext/fts5/fts5_storage.c \
1007 $(TOP)/ext/fts5/fts5_tokenize.c \
1008 $(TOP)/ext/fts5/fts5_unicode2.c \
1009 $(TOP)/ext/fts5/fts5_varint.c \
1010 $(TOP)/ext/fts5/fts5_vocab.c \
1011
dan08e71992015-05-19 11:38:32 +00001012fts5parse.c: $(TOP)/ext/fts5/fts5parse.y lemon
1013 cp $(TOP)/ext/fts5/fts5parse.y .
1014 rm -f fts5parse.h
1015 ./lemon $(OPTS) fts5parse.y
dan08e71992015-05-19 11:38:32 +00001016
1017fts5parse.h: fts5parse.c
1018
dan3e65f892015-06-25 20:36:36 +00001019fts5.c: $(FTS5_SRC)
1020 $(TCLSH_CMD) $(TOP)/ext/fts5/tool/mkfts5c.tcl
dana153bbc2015-07-02 20:12:34 +00001021 cp $(TOP)/ext/fts5/fts5.h .
dan3e65f892015-06-25 20:36:36 +00001022
1023fts5.lo: fts5.c $(HDR) $(EXTHDR)
1024 $(LTCOMPILE) -DSQLITE_CORE -c fts5.c
1025
shaneh18607052010-07-06 20:37:09 +00001026
1027# Rules to build the 'testfixture' application.
1028#
1029# If using the amalgamation, use sqlite3.c directly to build the test
1030# fixture. Otherwise link against libsqlite3.la. (This distinction is
1031# necessary because the test fixture requires non-API symbols which are
1032# hidden when the library is built via the amalgamation).
1033#
1034TESTFIXTURE_FLAGS = -DTCLSH=1 -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
1035TESTFIXTURE_FLAGS += -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE
drh0bab6c32011-09-23 16:34:49 +00001036TESTFIXTURE_FLAGS += -DBUILD_sqlite
shaneh18607052010-07-06 20:37:09 +00001037
1038TESTFIXTURE_SRC0 = $(TESTSRC2) libsqlite3.la
1039TESTFIXTURE_SRC1 = sqlite3.c
drh339d6c62013-03-19 16:12:40 +00001040TESTFIXTURE_SRC = $(TESTSRC) $(TOP)/src/tclsqlite.c
1041TESTFIXTURE_SRC += $(TESTFIXTURE_SRC$(USE_AMALGAMATION))
shaneh18607052010-07-06 20:37:09 +00001042
mlcreech969b2cd2008-03-14 04:11:03 +00001043testfixture$(TEXE): $(TESTFIXTURE_SRC)
shaneh18607052010-07-06 20:37:09 +00001044 $(LTLINK) -DSQLITE_NO_SYNC=1 $(TEMP_STORE) $(TESTFIXTURE_FLAGS) \
drh866108f2008-05-13 00:57:21 +00001045 -o $@ $(TESTFIXTURE_SRC) $(LIBTCL) $(TLIBS)
drh376deb12004-06-30 11:41:55 +00001046
drh5bfff9d2015-01-08 01:05:42 +00001047# A very detailed test running most or all test cases
drhf4375442015-05-11 12:15:45 +00001048fulltest: $(TESTPROGS) fuzztest
drh905da632015-06-10 18:53:09 +00001049 ./testfixture$(TEXE) $(TOP)/test/all.test $(TESTOPTS)
drh376deb12004-06-30 11:41:55 +00001050
drh5bfff9d2015-01-08 01:05:42 +00001051# Really really long testing
drhea93c702015-05-26 18:15:08 +00001052soaktest: $(TESTPROGS)
drh905da632015-06-10 18:53:09 +00001053 ./testfixture$(TEXE) $(TOP)/test/all.test -soak=1 $(TESTOPTS)
shaneh18607052010-07-06 20:37:09 +00001054
mistachkind4ab1032015-05-11 16:27:33 +00001055# Do extra testing but not everything.
drha523e312015-07-24 17:26:13 +00001056fulltestonly: $(TESTPROGS) fuzztest
mistachkinc60941f2012-09-13 01:51:02 +00001057 ./testfixture$(TEXE) $(TOP)/test/full.test
1058
drhe1a71a52015-04-24 16:09:12 +00001059# Fuzz testing
drhd1f2f9b2015-06-08 19:15:50 +00001060fuzztest: fuzzcheck$(TEXE) $(FUZZDATA)
drha523e312015-07-24 17:26:13 +00001061 ./fuzzcheck$(TEXE) $(FUZZDATA)
1062
1063fastfuzztest: fuzzcheck$(TEXE) $(FUZZDATA)
drh53e66c32015-07-24 15:49:23 +00001064 ./fuzzcheck$(TEXE) --limit-mem 100M $(FUZZDATA)
drhf3320712015-04-25 13:39:29 +00001065
drhd1f2f9b2015-06-08 19:15:50 +00001066valgrindfuzz: fuzzcheck$(TEXT) $(FUZZDATA)
drha523e312015-07-24 17:26:13 +00001067 valgrind ./fuzzcheck$(TEXE) --cell-size-check --limit-mem 10M $(FUZZDATA)
drhd1f2f9b2015-06-08 19:15:50 +00001068
drh905da632015-06-10 18:53:09 +00001069# Minimal testing that runs in less than 3 minutes
1070#
1071quicktest: ./testfixture$(TEXE)
1072 ./testfixture$(TEXE) $(TOP)/test/extraquick.test $(TESTOPTS)
1073
1074# This is the common case. Run many tests that do not take too long,
1075# including fuzzcheck, sqlite3_analyzer, and sqldiff tests.
drh5bfff9d2015-01-08 01:05:42 +00001076#
drha523e312015-07-24 17:26:13 +00001077test: $(TESTPROGS) fastfuzztest
drh905da632015-06-10 18:53:09 +00001078 ./testfixture$(TEXE) $(TOP)/test/veryquick.test $(TESTOPTS)
drh376deb12004-06-30 11:41:55 +00001079
drh5bfff9d2015-01-08 01:05:42 +00001080# Run a test using valgrind. This can take a really long time
1081# because valgrind is so much slower than a native machine.
1082#
drhd1f2f9b2015-06-08 19:15:50 +00001083valgrindtest: $(TESTPROGS) valgrindfuzz
drh905da632015-06-10 18:53:09 +00001084 OMIT_MISUSE=1 valgrind -v ./testfixture$(TEXE) $(TOP)/test/permutations.test valgrind $(TESTOPTS)
drh8a2a0f52015-01-07 14:09:41 +00001085
drh5bfff9d2015-01-08 01:05:42 +00001086# A very fast test that checks basic sanity. The name comes from
1087# the 60s-era electronics testing: "Turn it on and see if smoke
1088# comes out."
1089#
drhea93c702015-05-26 18:15:08 +00001090smoketest: $(TESTPROGS) fuzzcheck$(TEXE)
drh905da632015-06-10 18:53:09 +00001091 ./testfixture$(TEXE) $(TOP)/test/main.test $(TESTOPTS)
drh5bfff9d2015-01-08 01:05:42 +00001092
drh1a4a6802015-05-04 18:31:09 +00001093sqlite3_analyzer.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl
drhc42cdce2011-09-21 17:04:21 +00001094 echo "#define TCLSH 2" > $@
drh3e0327d2015-05-11 11:59:15 +00001095 echo "#define SQLITE_ENABLE_DBSTAT_VTAB 1" >> $@
drh84ab9532015-05-04 17:06:39 +00001096 cat sqlite3.c $(TOP)/src/tclsqlite.c >> $@
drhc42cdce2011-09-21 17:04:21 +00001097 echo "static const char *tclsh_main_loop(void){" >> $@
1098 echo "static const char *zMainloop = " >> $@
1099 $(NAWK) -f $(TOP)/tool/tostr.awk $(TOP)/tool/spaceanal.tcl >> $@
1100 echo "; return zMainloop; }" >> $@
drh376deb12004-06-30 11:41:55 +00001101
drh8d43aa12011-09-21 18:29:49 +00001102sqlite3_analyzer$(TEXE): sqlite3_analyzer.c
drhc42cdce2011-09-21 17:04:21 +00001103 $(LTLINK) sqlite3_analyzer.c -o $@ $(LIBTCL) $(TLIBS)
drh376deb12004-06-30 11:41:55 +00001104
drh4bb77ec2014-06-30 11:14:26 +00001105showdb$(TEXE): $(TOP)/tool/showdb.c sqlite3.lo
1106 $(LTLINK) -o $@ $(TOP)/tool/showdb.c sqlite3.lo $(TLIBS)
1107
1108showstat4$(TEXE): $(TOP)/tool/showstat4.c sqlite3.lo
1109 $(LTLINK) -o $@ $(TOP)/tool/showstat4.c sqlite3.lo $(TLIBS)
1110
1111showjournal$(TEXE): $(TOP)/tool/showjournal.c sqlite3.lo
1112 $(LTLINK) -o $@ $(TOP)/tool/showjournal.c sqlite3.lo $(TLIBS)
1113
1114showwal$(TEXE): $(TOP)/tool/showwal.c sqlite3.lo
1115 $(LTLINK) -o $@ $(TOP)/tool/showwal.c sqlite3.lo $(TLIBS)
1116
1117rollback-test$(TEXE): $(TOP)/tool/rollback-test.c sqlite3.lo
1118 $(LTLINK) -o $@ $(TOP)/tool/rollback-test.c sqlite3.lo $(TLIBS)
drh9ac3c1e2013-11-07 18:37:31 +00001119
drh267a13f2014-06-18 18:10:12 +00001120LogEst$(TEXE): $(TOP)/tool/logest.c sqlite3.h
1121 $(LTLINK) -I. -o $@ $(TOP)/tool/logest.c
drh9ac3c1e2013-11-07 18:37:31 +00001122
1123wordcount$(TEXE): $(TOP)/test/wordcount.c sqlite3.c
1124 $(LTLINK) -o $@ $(TOP)/test/wordcount.c sqlite3.c $(TLIBS)
1125
drh1dae26b2015-02-03 19:20:03 +00001126speedtest1$(TEXE): $(TOP)/test/speedtest1.c sqlite3.lo
drhad1ca9a2013-11-23 04:16:58 +00001127 $(LTLINK) -o $@ $(TOP)/test/speedtest1.c sqlite3.lo $(TLIBS)
1128
drh00fa3342014-12-23 19:52:26 +00001129# This target will fail if the SQLite amalgamation contains any exported
1130# symbols that do not begin with "sqlite3_". It is run as part of the
1131# releasetest.tcl script.
1132#
mistachkin4d03a382014-12-23 21:03:09 +00001133checksymbols: sqlite3.lo
drh277b4e42014-12-29 02:55:58 +00001134 nm -g --defined-only sqlite3.o | grep -v " sqlite3_" ; test $$? -ne 0
1135 echo '0 errors out of 1 tests'
drh00fa3342014-12-23 19:52:26 +00001136
drhb43be552015-01-15 15:47:06 +00001137# Build the amalgamation-autoconf package.
1138#
1139amalgamation-tarball: sqlite3.c
1140 TOP=$(TOP) sh $(TOP)/tool/mkautoconfamal.sh
1141
drh069b8f22014-12-23 20:31:43 +00001142# The next two rules are used to support the "threadtest" target. Building
1143# threadtest runs a few thread-safety tests that are implemented in C. This
1144# target is invoked by the releasetest.tcl script.
1145#
1146THREADTEST3_SRC = $(TOP)/test/threadtest3.c \
1147 $(TOP)/test/tt3_checkpoint.c \
1148 $(TOP)/test/tt3_index.c \
1149 $(TOP)/test/tt3_vacuum.c \
1150 $(TOP)/test/tt3_stress.c \
1151 $(TOP)/test/tt3_lookaside1.c
1152
mistachkin4d03a382014-12-23 21:03:09 +00001153threadtest3$(TEXE): sqlite3.lo $(THREADTEST3_SRC)
1154 $(LTLINK) $(TOP)/test/threadtest3.c sqlite3.lo -o $@ $(TLIBS)
drh069b8f22014-12-23 20:31:43 +00001155
1156threadtest: threadtest3$(TEXE)
1157 ./threadtest3$(TEXE)
1158
drha7c432c2014-12-23 21:17:58 +00001159releasetest:
1160 $(TCLSH_CMD) $(TOP)/test/releasetest.tcl
1161
shaneh18607052010-07-06 20:37:09 +00001162# Standard install and cleanup targets
1163#
vapierafea9742009-02-18 04:33:59 +00001164lib_install: libsqlite3.la
drh8d45ec02004-09-17 21:07:34 +00001165 $(INSTALL) -d $(DESTDIR)$(libdir)
1166 $(LTINSTALL) libsqlite3.la $(DESTDIR)$(libdir)
vapierafea9742009-02-18 04:33:59 +00001167
1168install: sqlite3$(BEXE) lib_install sqlite3.h sqlite3.pc ${HAVE_TCL:1=tcl_install}
mlcreechc55771f2008-03-06 08:09:12 +00001169 $(INSTALL) -d $(DESTDIR)$(bindir)
1170 $(LTINSTALL) sqlite3$(BEXE) $(DESTDIR)$(bindir)
1171 $(INSTALL) -d $(DESTDIR)$(includedir)
1172 $(INSTALL) -m 0644 sqlite3.h $(DESTDIR)$(includedir)
1173 $(INSTALL) -m 0644 $(TOP)/src/sqlite3ext.h $(DESTDIR)$(includedir)
danielk197794bdf892008-08-04 04:28:18 +00001174 $(INSTALL) -d $(DESTDIR)$(pkgconfigdir)
1175 $(INSTALL) -m 0644 sqlite3.pc $(DESTDIR)$(pkgconfigdir)
drh376deb12004-06-30 11:41:55 +00001176
vapier6d120f32009-01-28 04:46:14 +00001177pkgIndex.tcl:
drhd881ce82015-03-31 17:01:52 +00001178 echo 'package ifneeded sqlite3 $(RELEASE) [list load $(TCLLIBDIR)/libtclsqlite3$(SHLIB_SUFFIX) sqlite3]' > $@
vapierafea9742009-02-18 04:33:59 +00001179tcl_install: lib_install libtclsqlite3.la pkgIndex.tcl
vapier6d120f32009-01-28 04:46:14 +00001180 $(INSTALL) -d $(DESTDIR)$(TCLLIBDIR)
1181 $(LTINSTALL) libtclsqlite3.la $(DESTDIR)$(TCLLIBDIR)
1182 rm -f $(DESTDIR)$(TCLLIBDIR)/libtclsqlite3.la $(DESTDIR)$(TCLLIBDIR)/libtclsqlite3.a
1183 $(INSTALL) -m 0644 pkgIndex.tcl $(DESTDIR)$(TCLLIBDIR)
drh4b2266a2004-11-27 15:52:16 +00001184
drh376deb12004-06-30 11:41:55 +00001185clean:
drh7b5717e2004-11-25 13:50:01 +00001186 rm -f *.lo *.la *.o sqlite3$(TEXE) libsqlite3.la
drh376deb12004-06-30 11:41:55 +00001187 rm -f sqlite3.h opcodes.*
shaneh18607052010-07-06 20:37:09 +00001188 rm -rf .libs .deps
drh52fb6d72004-11-03 03:59:57 +00001189 rm -f lemon$(BEXE) lempar.c parse.* sqlite*.tar.gz
drh73b211a2005-01-18 04:00:42 +00001190 rm -f mkkeywordhash$(BEXE) keywordhash.h
drh376deb12004-06-30 11:41:55 +00001191 rm -f *.da *.bb *.bbg gmon.out
mistachkinf8a78462012-03-08 20:00:36 +00001192 rm -rf quota2a quota2b quota2c
shaneh18607052010-07-06 20:37:09 +00001193 rm -rf tsrc .target_source
mistachkin9a55e312011-09-22 00:06:44 +00001194 rm -f tclsqlite3$(TEXE)
drh7b5717e2004-11-25 13:50:01 +00001195 rm -f testfixture$(TEXE) test.db
mistachkin3a046c62014-07-18 21:02:54 +00001196 rm -f LogEst$(TEXE) fts3view$(TEXE) rollback-test$(TEXE) showdb$(TEXE)
1197 rm -f showjournal$(TEXE) showstat4$(TEXE) showwal$(TEXE) speedtest1$(TEXE)
1198 rm -f wordcount$(TEXE)
mistachkin9a55e312011-09-22 00:06:44 +00001199 rm -f sqlite3.dll sqlite3.lib sqlite3.exp sqlite3.def
shaneh18607052010-07-06 20:37:09 +00001200 rm -f sqlite3.c
mistachkinfde3b1c72013-03-29 19:52:04 +00001201 rm -f sqlite3rc.h
1202 rm -f shell.c sqlite3ext.h
mistachkin9a55e312011-09-22 00:06:44 +00001203 rm -f sqlite3_analyzer$(TEXE) sqlite3_analyzer.c
mistachkin29b75bd2012-10-20 09:35:57 +00001204 rm -f sqlite-*-output.vsix
mistachkin21c9b6b2013-04-10 03:06:43 +00001205 rm -f mptester mptester.exe
mistachkind4ab1032015-05-11 16:27:33 +00001206 rm -f fuzzershell fuzzershell.exe
mistachkin7a94e6b2015-05-26 03:24:33 +00001207 rm -f fuzzcheck fuzzcheck.exe
mistachkind4ab1032015-05-11 16:27:33 +00001208 rm -f sqldiff sqldiff.exe
mistachkinbc50bb72015-07-14 21:56:53 +00001209 rm -f fts5.* fts5parse.*
drh376deb12004-06-30 11:41:55 +00001210
drh376deb12004-06-30 11:41:55 +00001211distclean: clean
mistachkin9edb5ce2015-07-19 19:53:23 +00001212 rm -f config.h config.log config.status libtool Makefile sqlite3.pc
drh79dc6692006-09-02 22:14:11 +00001213
1214#
1215# Windows section
1216#
1217dll: sqlite3.dll
1218
1219REAL_LIBOBJ = $(LIBOBJ:%.lo=.libs/%.o)
1220
1221$(REAL_LIBOBJ): $(LIBOBJ)
1222
1223sqlite3.def: $(REAL_LIBOBJ)
1224 echo 'EXPORTS' >sqlite3.def
1225 nm $(REAL_LIBOBJ) | grep ' T ' | grep ' _sqlite3_' \
1226 | sed 's/^.* _//' >>sqlite3.def
1227
1228sqlite3.dll: $(REAL_LIBOBJ) sqlite3.def
mlcreech1428b372008-03-13 23:28:22 +00001229 $(TCC) -shared -o $@ sqlite3.def \
drh79dc6692006-09-02 22:14:11 +00001230 -Wl,"--strip-all" $(REAL_LIBOBJ)