blob: a1387bda4283fddd987612ff42f4f19406b10eb8 [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#
18TOP = @srcdir@
19
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
25# C Compile and options for use in building executables that
26# will run on the target platform. (BCC and TCC are usually the
27# same unless your are cross-compiling.)
28#
mlcreech98dc4b12008-03-06 16:28:58 +000029TCC = @CC@ @CPPFLAGS@ @CFLAGS@ -I. -I${TOP}/src
tpoindex9d9f76c2005-01-03 21:28:56 +000030
mlcreech1e12d432008-05-07 02:42:01 +000031# Define this for the autoconf-based build, so that the code knows it can
32# include the generated config.h
33#
34TCC += -D_HAVE_SQLITE_CONFIG_H
35
tpoindex9d9f76c2005-01-03 21:28:56 +000036# Define -DNDEBUG to compile without debugging (i.e., for production usage)
37# Omitting the define will cause extra debugging code to be inserted and
38# includes extra comments when "EXPLAIN stmt" is used.
39#
drh91636d52005-11-24 23:14:00 +000040TCC += @TARGET_DEBUG@ @XTHREADCONNECT@
drh376deb12004-06-30 11:41:55 +000041
drh376deb12004-06-30 11:41:55 +000042# Compiler options needed for programs that use the TCL library.
43#
drh93468362004-12-10 03:08:12 +000044TCC += @TCL_INCLUDE_SPEC@
drh376deb12004-06-30 11:41:55 +000045
46# The library that programs using TCL must link against.
47#
drh7b5717e2004-11-25 13:50:01 +000048LIBTCL = @TCL_LIB_SPEC@ @TCL_LIBS@
drh376deb12004-06-30 11:41:55 +000049
50# Compiler options needed for programs that use the readline() library.
51#
52READLINE_FLAGS = -DHAVE_READLINE=@TARGET_HAVE_READLINE@ @TARGET_READLINE_INC@
53
54# The library that programs using readline() must link against.
55#
56LIBREADLINE = @TARGET_READLINE_LIBS@
57
58# Should the database engine be compiled threadsafe
59#
drh5a3032b2007-09-03 16:12:09 +000060TCC += -DSQLITE_THREADSAFE=@SQLITE_THREADSAFE@
drh376deb12004-06-30 11:41:55 +000061
drh8e2e2a12006-02-01 01:55:17 +000062# Do threads override each others locks by default (1), or do we test (-1)
63#
64TCC += -DSQLITE_THREAD_OVERRIDE_LOCK=@THREADSOVERRIDELOCKS@
65
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
mlcreech94984912008-03-04 19:03:08 +0000164# Object files for the SQLite library (non-amalgamation).
drh376deb12004-06-30 11:41:55 +0000165#
rse973402e2009-02-20 22:27:41 +0000166OBJS0 = alter.lo analyze.lo attach.lo auth.lo backup.lo bitvec.lo btmutex.lo \
drh380083c2010-02-23 20:32:15 +0000167 btree.lo build.lo callback.lo complete.lo ctime.lo date.lo \
dan3be7d6e2009-09-19 17:59:59 +0000168 delete.lo expr.lo fault.lo fkey.lo func.lo global.lo \
pweilbacher87a03282008-08-22 17:28:45 +0000169 hash.lo journal.lo insert.lo legacy.lo loadext.lo \
drhd1370b62008-10-28 18:58:20 +0000170 main.lo malloc.lo mem0.lo mem1.lo mem2.lo mem3.lo mem5.lo \
shane7b607a02008-11-04 21:51:03 +0000171 memjournal.lo \
drh18472fa2008-10-07 15:25:48 +0000172 mutex.lo mutex_noop.lo mutex_os2.lo mutex_unix.lo mutex_w32.lo \
danielk1977d52acb32009-03-16 14:48:18 +0000173 notify.lo opcodes.lo os.lo os_unix.lo os_win.lo os_os2.lo \
danielk1977bc2ca9e2008-11-13 14:28:28 +0000174 pager.lo parse.lo pcache.lo pcache1.lo pragma.lo prepare.lo printf.lo \
drh1b26c7c2009-04-22 02:15:47 +0000175 random.lo resolve.lo rowset.lo select.lo status.lo \
drh7d10d5a2008-08-20 16:35:10 +0000176 table.lo tokenize.lo trigger.lo update.lo \
mlcreech94984912008-03-04 19:03:08 +0000177 util.lo vacuum.lo \
drhc7bc4fd2009-11-25 18:03:42 +0000178 vdbe.lo vdbeapi.lo vdbeaux.lo vdbeblob.lo vdbemem.lo vdbetrace.lo \
drh7d10d5a2008-08-20 16:35:10 +0000179 walker.lo where.lo utf.lo vtab.lo
mlcreech94984912008-03-04 19:03:08 +0000180
181# Object files for the amalgamation.
182#
183OBJS1 = sqlite3.lo
184
185# Determine the real value of LIBOBJ based on the 'configure' script
186#
187USE_AMALGAMATION = @USE_AMALGAMATION@
188LIBOBJ = $(OBJS$(USE_AMALGAMATION))
189
drh376deb12004-06-30 11:41:55 +0000190
191# All of the source code files.
192#
193SRC = \
drhd0e4a6c2005-02-15 20:47:57 +0000194 $(TOP)/src/alter.c \
drh9f18e8a2005-07-08 12:13:04 +0000195 $(TOP)/src/analyze.c \
drh376deb12004-06-30 11:41:55 +0000196 $(TOP)/src/attach.c \
197 $(TOP)/src/auth.c \
danielk197704103022009-02-03 16:51:24 +0000198 $(TOP)/src/backup.c \
mlcreeche0414bb2008-02-26 03:45:59 +0000199 $(TOP)/src/bitvec.c \
drh900b31e2007-08-28 02:27:51 +0000200 $(TOP)/src/btmutex.c \
drh376deb12004-06-30 11:41:55 +0000201 $(TOP)/src/btree.c \
202 $(TOP)/src/btree.h \
mlcreecheb6dc142008-03-13 18:28:03 +0000203 $(TOP)/src/btreeInt.h \
drh376deb12004-06-30 11:41:55 +0000204 $(TOP)/src/build.c \
danielk1977fd9a0a42005-05-24 12:01:00 +0000205 $(TOP)/src/callback.c \
drha2b902d2005-08-14 17:53:20 +0000206 $(TOP)/src/complete.c \
shanehdc97a8c2010-02-23 20:08:35 +0000207 $(TOP)/src/ctime.c \
drh376deb12004-06-30 11:41:55 +0000208 $(TOP)/src/date.c \
209 $(TOP)/src/delete.c \
drh376deb12004-06-30 11:41:55 +0000210 $(TOP)/src/expr.c \
drh643167f2008-01-22 21:30:53 +0000211 $(TOP)/src/fault.c \
dan3be7d6e2009-09-19 17:59:59 +0000212 $(TOP)/src/fkey.c \
drh70a8ca32008-08-21 18:49:27 +0000213 $(TOP)/src/func.c \
drh40257ff2008-06-13 18:24:27 +0000214 $(TOP)/src/global.c \
drh376deb12004-06-30 11:41:55 +0000215 $(TOP)/src/hash.c \
216 $(TOP)/src/hash.h \
shane9bcbdad2008-05-29 20:22:37 +0000217 $(TOP)/src/hwtime.h \
drh376deb12004-06-30 11:41:55 +0000218 $(TOP)/src/insert.c \
drh4bfc8a92007-08-27 23:38:43 +0000219 $(TOP)/src/journal.c \
drh376deb12004-06-30 11:41:55 +0000220 $(TOP)/src/legacy.c \
drh1e397f82006-06-08 15:28:43 +0000221 $(TOP)/src/loadext.c \
drh376deb12004-06-30 11:41:55 +0000222 $(TOP)/src/main.c \
drh9e91c752007-05-07 13:11:10 +0000223 $(TOP)/src/malloc.c \
drhd1370b62008-10-28 18:58:20 +0000224 $(TOP)/src/mem0.c \
drh4bfc8a92007-08-27 23:38:43 +0000225 $(TOP)/src/mem1.c \
226 $(TOP)/src/mem2.c \
drh9c7a60d2007-10-19 17:47:24 +0000227 $(TOP)/src/mem3.c \
mlcreechfcfe27d2008-03-02 05:34:10 +0000228 $(TOP)/src/mem5.c \
danielk19776553c5c2008-10-21 04:30:31 +0000229 $(TOP)/src/memjournal.c \
drh4bfc8a92007-08-27 23:38:43 +0000230 $(TOP)/src/mutex.c \
mlcreecheb6dc142008-03-13 18:28:03 +0000231 $(TOP)/src/mutex.h \
drh18472fa2008-10-07 15:25:48 +0000232 $(TOP)/src/mutex_noop.c \
drh437b9012007-08-28 16:34:42 +0000233 $(TOP)/src/mutex_os2.c \
234 $(TOP)/src/mutex_unix.c \
235 $(TOP)/src/mutex_w32.c \
danielk1977d52acb32009-03-16 14:48:18 +0000236 $(TOP)/src/notify.c \
drh054889e2005-11-30 03:20:31 +0000237 $(TOP)/src/os.c \
mlcreecheb6dc142008-03-13 18:28:03 +0000238 $(TOP)/src/os.h \
239 $(TOP)/src/os_common.h \
shane8e283792009-08-21 02:07:09 +0000240 $(TOP)/src/os_os2.c \
drh376deb12004-06-30 11:41:55 +0000241 $(TOP)/src/os_unix.c \
242 $(TOP)/src/os_win.c \
243 $(TOP)/src/pager.c \
244 $(TOP)/src/pager.h \
245 $(TOP)/src/parse.y \
danielk19778c0a7912008-08-20 14:49:23 +0000246 $(TOP)/src/pcache.c \
247 $(TOP)/src/pcache.h \
danielk1977bc2ca9e2008-11-13 14:28:28 +0000248 $(TOP)/src/pcache1.c \
drh376deb12004-06-30 11:41:55 +0000249 $(TOP)/src/pragma.c \
danielk1977fa256a32005-05-25 04:11:56 +0000250 $(TOP)/src/prepare.c \
drh376deb12004-06-30 11:41:55 +0000251 $(TOP)/src/printf.c \
252 $(TOP)/src/random.c \
drh7d10d5a2008-08-20 16:35:10 +0000253 $(TOP)/src/resolve.c \
drh3d4501e2008-12-04 20:40:10 +0000254 $(TOP)/src/rowset.c \
drh376deb12004-06-30 11:41:55 +0000255 $(TOP)/src/select.c \
drhf7141992008-06-19 00:16:08 +0000256 $(TOP)/src/status.c \
drh376deb12004-06-30 11:41:55 +0000257 $(TOP)/src/shell.c \
258 $(TOP)/src/sqlite.h.in \
mlcreecheb6dc142008-03-13 18:28:03 +0000259 $(TOP)/src/sqlite3ext.h \
drh376deb12004-06-30 11:41:55 +0000260 $(TOP)/src/sqliteInt.h \
mlcreecheb6dc142008-03-13 18:28:03 +0000261 $(TOP)/src/sqliteLimit.h \
drh376deb12004-06-30 11:41:55 +0000262 $(TOP)/src/table.c \
263 $(TOP)/src/tclsqlite.c \
264 $(TOP)/src/tokenize.c \
265 $(TOP)/src/trigger.c \
266 $(TOP)/src/utf.c \
267 $(TOP)/src/update.c \
268 $(TOP)/src/util.c \
269 $(TOP)/src/vacuum.c \
270 $(TOP)/src/vdbe.c \
271 $(TOP)/src/vdbe.h \
272 $(TOP)/src/vdbeapi.c \
273 $(TOP)/src/vdbeaux.c \
danielk19776338c762007-05-17 16:38:30 +0000274 $(TOP)/src/vdbeblob.c \
drh376deb12004-06-30 11:41:55 +0000275 $(TOP)/src/vdbemem.c \
drhc7bc4fd2009-11-25 18:03:42 +0000276 $(TOP)/src/vdbetrace.c \
drh376deb12004-06-30 11:41:55 +0000277 $(TOP)/src/vdbeInt.h \
drhb9bb7c12006-06-11 23:41:55 +0000278 $(TOP)/src/vtab.c \
drhc438efd2010-04-26 00:19:45 +0000279 $(TOP)/src/wal.c \
280 $(TOP)/src/wal.h \
drh7d10d5a2008-08-20 16:35:10 +0000281 $(TOP)/src/walker.c \
drh376deb12004-06-30 11:41:55 +0000282 $(TOP)/src/where.c
283
mlcreecheb6dc142008-03-13 18:28:03 +0000284# Generated source code files
285#
286SRC += \
287 keywordhash.h \
288 opcodes.c \
289 opcodes.h \
290 parse.c \
291 parse.h \
mlcreech23797062008-03-20 02:25:35 +0000292 config.h \
mlcreecheb6dc142008-03-13 18:28:03 +0000293 sqlite3.h
294
drh0c979402006-10-03 19:12:32 +0000295# Source code for extensions
296#
297SRC += \
298 $(TOP)/ext/fts1/fts1.c \
299 $(TOP)/ext/fts1/fts1.h \
300 $(TOP)/ext/fts1/fts1_hash.c \
301 $(TOP)/ext/fts1/fts1_hash.h \
302 $(TOP)/ext/fts1/fts1_porter.c \
303 $(TOP)/ext/fts1/fts1_tokenizer.h \
304 $(TOP)/ext/fts1/fts1_tokenizer1.c
mlcreech47524b82008-03-02 05:40:05 +0000305SRC += \
306 $(TOP)/ext/fts2/fts2.c \
307 $(TOP)/ext/fts2/fts2.h \
308 $(TOP)/ext/fts2/fts2_hash.c \
309 $(TOP)/ext/fts2/fts2_hash.h \
310 $(TOP)/ext/fts2/fts2_icu.c \
311 $(TOP)/ext/fts2/fts2_porter.c \
312 $(TOP)/ext/fts2/fts2_tokenizer.h \
313 $(TOP)/ext/fts2/fts2_tokenizer.c \
314 $(TOP)/ext/fts2/fts2_tokenizer1.c
315SRC += \
316 $(TOP)/ext/fts3/fts3.c \
317 $(TOP)/ext/fts3/fts3.h \
dan16708c42009-11-19 15:25:25 +0000318 $(TOP)/ext/fts3/fts3Int.h \
shane5df7c0f2009-01-02 15:47:01 +0000319 $(TOP)/ext/fts3/fts3_expr.c \
mlcreech47524b82008-03-02 05:40:05 +0000320 $(TOP)/ext/fts3/fts3_hash.c \
321 $(TOP)/ext/fts3/fts3_hash.h \
322 $(TOP)/ext/fts3/fts3_icu.c \
323 $(TOP)/ext/fts3/fts3_porter.c \
dan16708c42009-11-19 15:25:25 +0000324 $(TOP)/ext/fts3/fts3_snippet.c \
mlcreech47524b82008-03-02 05:40:05 +0000325 $(TOP)/ext/fts3/fts3_tokenizer.h \
326 $(TOP)/ext/fts3/fts3_tokenizer.c \
dan16708c42009-11-19 15:25:25 +0000327 $(TOP)/ext/fts3/fts3_tokenizer1.c \
328 $(TOP)/ext/fts3/fts3_write.c
mlcreech47524b82008-03-02 05:40:05 +0000329SRC += \
danielk19771c826652008-09-08 08:08:09 +0000330 $(TOP)/ext/icu/sqliteicu.h \
mlcreech47524b82008-03-02 05:40:05 +0000331 $(TOP)/ext/icu/icu.c
shaneca57b872008-05-28 17:31:17 +0000332SRC += \
333 $(TOP)/ext/rtree/rtree.h \
334 $(TOP)/ext/rtree/rtree.c
drh0c979402006-10-03 19:12:32 +0000335
mlcreech969b2cd2008-03-14 04:11:03 +0000336# Source code to the library files needed by the test fixture
drh376deb12004-06-30 11:41:55 +0000337#
mlcreech969b2cd2008-03-14 04:11:03 +0000338TESTSRC2 = \
drhd33991c2007-09-03 22:15:45 +0000339 $(TOP)/src/attach.c \
danielk197704103022009-02-03 16:51:24 +0000340 $(TOP)/src/backup.c \
mlcreeche0414bb2008-02-26 03:45:59 +0000341 $(TOP)/src/bitvec.c \
drh376deb12004-06-30 11:41:55 +0000342 $(TOP)/src/btree.c \
drhd33991c2007-09-03 22:15:45 +0000343 $(TOP)/src/build.c \
drh6c626082004-11-14 21:56:29 +0000344 $(TOP)/src/date.c \
shanehdc97a8c2010-02-23 20:08:35 +0000345 $(TOP)/src/ctime.c \
drhd33991c2007-09-03 22:15:45 +0000346 $(TOP)/src/expr.c \
drh376deb12004-06-30 11:41:55 +0000347 $(TOP)/src/func.c \
drh3f400ea2007-04-02 22:19:38 +0000348 $(TOP)/src/insert.c \
dancca2de42009-09-10 18:17:10 +0000349 $(TOP)/src/mem5.c \
drh8e2e2a12006-02-01 01:55:17 +0000350 $(TOP)/src/os.c \
drh32250072006-08-13 21:49:07 +0000351 $(TOP)/src/os_os2.c \
drh376deb12004-06-30 11:41:55 +0000352 $(TOP)/src/os_unix.c \
353 $(TOP)/src/os_win.c \
354 $(TOP)/src/pager.c \
danielk19778c0a7912008-08-20 14:49:23 +0000355 $(TOP)/src/pcache.c \
danielk1977bc2ca9e2008-11-13 14:28:28 +0000356 $(TOP)/src/pcache1.c \
drh376deb12004-06-30 11:41:55 +0000357 $(TOP)/src/pragma.c \
drhd33991c2007-09-03 22:15:45 +0000358 $(TOP)/src/prepare.c \
drh376deb12004-06-30 11:41:55 +0000359 $(TOP)/src/printf.c \
drh643167f2008-01-22 21:30:53 +0000360 $(TOP)/src/random.c \
drhd33991c2007-09-03 22:15:45 +0000361 $(TOP)/src/select.c \
mlcreech969b2cd2008-03-14 04:11:03 +0000362 $(TOP)/src/tokenize.c \
363 $(TOP)/src/utf.c \
364 $(TOP)/src/util.c \
365 $(TOP)/src/vdbe.c \
366 $(TOP)/src/vdbeapi.c \
367 $(TOP)/src/vdbeaux.c \
368 $(TOP)/src/vdbemem.c \
drhc7bc4fd2009-11-25 18:03:42 +0000369 $(TOP)/src/vdbetrace.c \
mlcreech969b2cd2008-03-14 04:11:03 +0000370 $(TOP)/src/where.c \
371 parse.c
372
373# Source code to the actual test files.
374#
375TESTSRC = \
drh376deb12004-06-30 11:41:55 +0000376 $(TOP)/src/test1.c \
377 $(TOP)/src/test2.c \
378 $(TOP)/src/test3.c \
379 $(TOP)/src/test4.c \
380 $(TOP)/src/test5.c \
drh9c06c952005-11-26 00:25:00 +0000381 $(TOP)/src/test6.c \
drh7910e762006-01-09 23:50:11 +0000382 $(TOP)/src/test7.c \
drhb9bb7c12006-06-11 23:41:55 +0000383 $(TOP)/src/test8.c \
danielk1977a713f2c2007-03-29 12:19:11 +0000384 $(TOP)/src/test9.c \
drh1409be62006-08-23 20:07:20 +0000385 $(TOP)/src/test_autoext.c \
drh7910e762006-01-09 23:50:11 +0000386 $(TOP)/src/test_async.c \
danielk197704103022009-02-03 16:51:24 +0000387 $(TOP)/src/test_backup.c \
drh16a9b832007-05-05 18:39:25 +0000388 $(TOP)/src/test_btree.c \
drhc797d4d2007-05-08 01:08:49 +0000389 $(TOP)/src/test_config.c \
danielk1977bf260972008-01-22 11:50:13 +0000390 $(TOP)/src/test_devsym.c \
drh984bfaa2008-03-19 16:08:53 +0000391 $(TOP)/src/test_func.c \
drh15926592007-04-06 15:02:13 +0000392 $(TOP)/src/test_hexio.c \
shane8e283792009-08-21 02:07:09 +0000393 $(TOP)/src/test_init.c \
drh522efc62009-11-10 17:24:37 +0000394 $(TOP)/src/test_intarray.c \
danielk1977f3107512008-12-22 10:58:46 +0000395 $(TOP)/src/test_journal.c \
drh4bfc8a92007-08-27 23:38:43 +0000396 $(TOP)/src/test_malloc.c \
shanec6f66c52008-07-08 22:15:49 +0000397 $(TOP)/src/test_mutex.c \
danielk197720e987a2007-10-05 15:04:12 +0000398 $(TOP)/src/test_onefile.c \
mlcreechede26272008-04-13 23:13:39 +0000399 $(TOP)/src/test_osinst.c \
drhb232c232008-11-19 01:20:26 +0000400 $(TOP)/src/test_pcache.c \
danielk1977954ce992006-06-15 15:59:19 +0000401 $(TOP)/src/test_schema.c \
drh2d02a672006-01-25 15:55:37 +0000402 $(TOP)/src/test_server.c \
drh4be8b512006-06-13 23:51:34 +0000403 $(TOP)/src/test_tclvar.c \
shane8e283792009-08-21 02:07:09 +0000404 $(TOP)/src/test_thread.c \
405 $(TOP)/src/test_wsd.c
drh376deb12004-06-30 11:41:55 +0000406
407# Header files used by all library source files.
408#
409HDR = \
410 sqlite3.h \
411 $(TOP)/src/btree.h \
drha3152892007-05-05 11:48:52 +0000412 $(TOP)/src/btreeInt.h \
drh376deb12004-06-30 11:41:55 +0000413 $(TOP)/src/hash.h \
shane9bcbdad2008-05-29 20:22:37 +0000414 $(TOP)/src/hwtime.h \
drhc551dd82007-06-19 15:23:48 +0000415 $(TOP)/src/sqliteLimit.h \
drh437b9012007-08-28 16:34:42 +0000416 $(TOP)/src/mutex.h \
drh376deb12004-06-30 11:41:55 +0000417 opcodes.h \
418 $(TOP)/src/os.h \
419 $(TOP)/src/os_common.h \
drh1e397f82006-06-08 15:28:43 +0000420 $(TOP)/src/sqlite3ext.h \
drh376deb12004-06-30 11:41:55 +0000421 $(TOP)/src/sqliteInt.h \
422 $(TOP)/src/vdbe.h \
mlcreecheb6dc142008-03-13 18:28:03 +0000423 $(TOP)/src/vdbeInt.h \
mlcreechb87057f2008-03-06 07:19:20 +0000424 parse.h \
mlcreech23797062008-03-20 02:25:35 +0000425 config.h
drh376deb12004-06-30 11:41:55 +0000426
drh0c979402006-10-03 19:12:32 +0000427# Header files used by extensions
428#
429HDR += \
430 $(TOP)/ext/fts1/fts1.h \
431 $(TOP)/ext/fts1/fts1_hash.h \
432 $(TOP)/ext/fts1/fts1_tokenizer.h
mlcreech47524b82008-03-02 05:40:05 +0000433HDR += \
434 $(TOP)/ext/fts2/fts2.h \
435 $(TOP)/ext/fts2/fts2_hash.h \
436 $(TOP)/ext/fts2/fts2_tokenizer.h
437HDR += \
438 $(TOP)/ext/fts3/fts3.h \
dan16708c42009-11-19 15:25:25 +0000439 $(TOP)/ext/fts3/fts3Int.h \
mlcreech47524b82008-03-02 05:40:05 +0000440 $(TOP)/ext/fts3/fts3_hash.h \
441 $(TOP)/ext/fts3/fts3_tokenizer.h
shaneca57b872008-05-28 17:31:17 +0000442HDR += \
443 $(TOP)/ext/rtree/rtree.h
danielk19771c826652008-09-08 08:08:09 +0000444HDR += \
445 $(TOP)/ext/icu/sqliteicu.h
drh0c979402006-10-03 19:12:32 +0000446
mlcreech969b2cd2008-03-14 04:11:03 +0000447# If using the amalgamation, use sqlite3.c directly to build the test
448# fixture. Otherwise link against libsqlite3.la. (This distinction is
449# necessary because the test fixture requires non-API symbols which are
450# hidden when the library is built via the amalgamation).
451#
452TESTFIXTURE_SRC0 = $(TESTSRC2) libsqlite3.la
453TESTFIXTURE_SRC1 = sqlite3.c
454TESTFIXTURE_SRC = $(TESTSRC) $(TOP)/src/tclsqlite.c $(TESTFIXTURE_SRC$(USE_AMALGAMATION))
455
456
drh376deb12004-06-30 11:41:55 +0000457# This is the default Makefile target. The objects listed here
458# are what get build when you type just "make" with no arguments.
459#
drh7b5717e2004-11-25 13:50:01 +0000460all: sqlite3.h libsqlite3.la sqlite3$(TEXE) $(HAVE_TCL:1=libtclsqlite3.la)
drh376deb12004-06-30 11:41:55 +0000461
462Makefile: $(TOP)/Makefile.in
463 ./config.status
464
vapier2574da52009-01-26 20:59:02 +0000465sqlite3.pc: $(TOP)/sqlite3.pc.in
466 ./config.status
467
drh376deb12004-06-30 11:41:55 +0000468libsqlite3.la: $(LIBOBJ)
mlcreech1428b372008-03-13 23:28:22 +0000469 $(LTLINK) -o $@ $(LIBOBJ) $(TLIBS) \
mlcreech289234c2008-03-13 19:55:20 +0000470 ${ALLOWRELEASE} -rpath "$(libdir)" -version-info "8:6:8"
drh376deb12004-06-30 11:41:55 +0000471
472libtclsqlite3.la: tclsqlite.lo libsqlite3.la
mlcreech1428b372008-03-13 23:28:22 +0000473 $(LTLINK) -o $@ tclsqlite.lo \
drh0fcf2372008-07-25 12:49:44 +0000474 libsqlite3.la @TCL_STUB_LIB_SPEC@ $(TLIBS) \
vapier6d120f32009-01-28 04:46:14 +0000475 -rpath "$(TCLLIBDIR)" \
476 -version-info "8:6:8" \
477 -avoid-version
drh376deb12004-06-30 11:41:55 +0000478
drhcbd2da92007-12-17 16:20:06 +0000479sqlite3$(TEXE): $(TOP)/src/shell.c libsqlite3.la sqlite3.h
mlcreechc658b0f2008-03-09 02:20:11 +0000480 $(LTLINK) $(READLINE_FLAGS) \
drhc9a67a82007-12-13 18:20:46 +0000481 -o $@ $(TOP)/src/shell.c libsqlite3.la \
mlcreech289234c2008-03-13 19:55:20 +0000482 $(LIBREADLINE) $(TLIBS) -rpath "$(libdir)"
drhc9a67a82007-12-13 18:20:46 +0000483
drh376deb12004-06-30 11:41:55 +0000484# This target creates a directory named "tsrc" and fills it with
485# copies of all of the C source code and header files needed to
486# build on the target system. Some of the C source code and header
487# files are automatically generated. This target takes care of
488# all that automatic generation.
489#
mlcreecheb6dc142008-03-13 18:28:03 +0000490.target_source: $(SRC)
drh376deb12004-06-30 11:41:55 +0000491 rm -rf tsrc
drhd2f397f2004-09-17 20:47:16 +0000492 mkdir -p tsrc
mlcreecheb6dc142008-03-13 18:28:03 +0000493 cp $(SRC) tsrc
drh376deb12004-06-30 11:41:55 +0000494 rm tsrc/sqlite.h.in tsrc/parse.y
drh856c1032009-06-02 15:21:42 +0000495 $(TCLSH_CMD) $(TOP)/tool/vdbe-compress.tcl <tsrc/vdbe.c >vdbe.new
496 mv vdbe.new tsrc/vdbe.c
mlcreech94984912008-03-04 19:03:08 +0000497 touch .target_source
drh376deb12004-06-30 11:41:55 +0000498
mlcreech94984912008-03-04 19:03:08 +0000499sqlite3.c: .target_source $(TOP)/tool/mksqlite3c.tcl
mlcreechab1c47b2008-03-09 02:51:10 +0000500 $(TCLSH_CMD) $(TOP)/tool/mksqlite3c.tcl
drh93d57532007-04-05 18:34:58 +0000501
drh376deb12004-06-30 11:41:55 +0000502# Rules to build the LEMON compiler generator
503#
drh53bc21b2009-07-03 17:09:28 +0000504lemon$(BEXE): $(TOP)/tool/lemon.c $(TOP)/src/lempar.c
mlcreech1428b372008-03-13 23:28:22 +0000505 $(BCC) -o $@ $(TOP)/tool/lemon.c
drh53bc21b2009-07-03 17:09:28 +0000506 cp $(TOP)/src/lempar.c .
drh376deb12004-06-30 11:41:55 +0000507
508
mlcreech94984912008-03-04 19:03:08 +0000509# Rule to build the amalgamation
510#
511sqlite3.lo: sqlite3.c
drh8b727472009-01-19 18:18:40 +0000512 $(LTCOMPILE) $(TEMP_STORE) -c sqlite3.c
mlcreech94984912008-03-04 19:03:08 +0000513
drh376deb12004-06-30 11:41:55 +0000514# Rules to build individual files
515#
drhd0e4a6c2005-02-15 20:47:57 +0000516alter.lo: $(TOP)/src/alter.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000517 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/alter.c
drhd0e4a6c2005-02-15 20:47:57 +0000518
drh9f18e8a2005-07-08 12:13:04 +0000519analyze.lo: $(TOP)/src/analyze.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000520 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/analyze.c
drh9f18e8a2005-07-08 12:13:04 +0000521
drh376deb12004-06-30 11:41:55 +0000522attach.lo: $(TOP)/src/attach.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000523 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/attach.c
drh376deb12004-06-30 11:41:55 +0000524
525auth.lo: $(TOP)/src/auth.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000526 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/auth.c
drh376deb12004-06-30 11:41:55 +0000527
rse973402e2009-02-20 22:27:41 +0000528backup.lo: $(TOP)/src/backup.c $(HDR)
529 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/backup.c
530
mlcreech5b9d8672008-02-27 03:22:49 +0000531bitvec.lo: $(TOP)/src/bitvec.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000532 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/bitvec.c
mlcreech5b9d8672008-02-27 03:22:49 +0000533
drh900b31e2007-08-28 02:27:51 +0000534btmutex.lo: $(TOP)/src/btmutex.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000535 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/btmutex.c
drh900b31e2007-08-28 02:27:51 +0000536
drh376deb12004-06-30 11:41:55 +0000537btree.lo: $(TOP)/src/btree.c $(HDR) $(TOP)/src/pager.h
drh8b727472009-01-19 18:18:40 +0000538 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/btree.c
drh376deb12004-06-30 11:41:55 +0000539
540build.lo: $(TOP)/src/build.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000541 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/build.c
drh376deb12004-06-30 11:41:55 +0000542
danielk1977fd9a0a42005-05-24 12:01:00 +0000543callback.lo: $(TOP)/src/callback.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000544 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/callback.c
danielk1977fd9a0a42005-05-24 12:01:00 +0000545
drha2b902d2005-08-14 17:53:20 +0000546complete.lo: $(TOP)/src/complete.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000547 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/complete.c
drha2b902d2005-08-14 17:53:20 +0000548
shanehdc97a8c2010-02-23 20:08:35 +0000549ctime.lo: $(TOP)/src/ctime.c $(HDR)
550 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/ctime.c
551
drh376deb12004-06-30 11:41:55 +0000552date.lo: $(TOP)/src/date.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000553 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/date.c
drh376deb12004-06-30 11:41:55 +0000554
555delete.lo: $(TOP)/src/delete.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000556 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/delete.c
drh376deb12004-06-30 11:41:55 +0000557
drh376deb12004-06-30 11:41:55 +0000558expr.lo: $(TOP)/src/expr.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000559 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/expr.c
drh376deb12004-06-30 11:41:55 +0000560
drh643167f2008-01-22 21:30:53 +0000561fault.lo: $(TOP)/src/fault.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000562 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/fault.c
drh643167f2008-01-22 21:30:53 +0000563
dan3be7d6e2009-09-19 17:59:59 +0000564fkey.lo: $(TOP)/src/fkey.c $(HDR)
565 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/fkey.c
566
drh70a8ca32008-08-21 18:49:27 +0000567func.lo: $(TOP)/src/func.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000568 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/func.c
drh376deb12004-06-30 11:41:55 +0000569
drh40257ff2008-06-13 18:24:27 +0000570global.lo: $(TOP)/src/global.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000571 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/global.c
drh40257ff2008-06-13 18:24:27 +0000572
drh376deb12004-06-30 11:41:55 +0000573hash.lo: $(TOP)/src/hash.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000574 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/hash.c
drh376deb12004-06-30 11:41:55 +0000575
576insert.lo: $(TOP)/src/insert.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000577 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/insert.c
drh376deb12004-06-30 11:41:55 +0000578
drh4bfc8a92007-08-27 23:38:43 +0000579journal.lo: $(TOP)/src/journal.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000580 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/journal.c
drh4bfc8a92007-08-27 23:38:43 +0000581
drh376deb12004-06-30 11:41:55 +0000582legacy.lo: $(TOP)/src/legacy.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000583 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/legacy.c
drh376deb12004-06-30 11:41:55 +0000584
drh1e397f82006-06-08 15:28:43 +0000585loadext.lo: $(TOP)/src/loadext.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000586 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/loadext.c
drh1e397f82006-06-08 15:28:43 +0000587
drh376deb12004-06-30 11:41:55 +0000588main.lo: $(TOP)/src/main.c $(HDR)
589 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/main.c
590
drha3152892007-05-05 11:48:52 +0000591malloc.lo: $(TOP)/src/malloc.c $(HDR)
592 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/malloc.c
593
drhd1370b62008-10-28 18:58:20 +0000594mem0.lo: $(TOP)/src/mem0.c $(HDR)
595 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem0.c
596
drh4bfc8a92007-08-27 23:38:43 +0000597mem1.lo: $(TOP)/src/mem1.c $(HDR)
598 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem1.c
599
600mem2.lo: $(TOP)/src/mem2.c $(HDR)
601 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem2.c
602
drh9c7a60d2007-10-19 17:47:24 +0000603mem3.lo: $(TOP)/src/mem3.c $(HDR)
604 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem3.c
605
mlcreechfcfe27d2008-03-02 05:34:10 +0000606mem5.lo: $(TOP)/src/mem5.c $(HDR)
607 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem5.c
608
danielk19776553c5c2008-10-21 04:30:31 +0000609memjournal.lo: $(TOP)/src/memjournal.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000610 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/memjournal.c
danielk19776553c5c2008-10-21 04:30:31 +0000611
drh4bfc8a92007-08-27 23:38:43 +0000612mutex.lo: $(TOP)/src/mutex.c $(HDR)
613 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex.c
614
drh18472fa2008-10-07 15:25:48 +0000615mutex_noop.lo: $(TOP)/src/mutex_noop.c $(HDR)
616 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex_noop.c
617
drh437b9012007-08-28 16:34:42 +0000618mutex_os2.lo: $(TOP)/src/mutex_os2.c $(HDR)
619 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex_os2.c
620
621mutex_unix.lo: $(TOP)/src/mutex_unix.c $(HDR)
622 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex_unix.c
623
624mutex_w32.lo: $(TOP)/src/mutex_w32.c $(HDR)
625 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex_w32.c
626
danielk1977d52acb32009-03-16 14:48:18 +0000627notify.lo: $(TOP)/src/notify.c $(HDR)
628 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/notify.c
629
drh376deb12004-06-30 11:41:55 +0000630pager.lo: $(TOP)/src/pager.c $(HDR) $(TOP)/src/pager.h
drh8b727472009-01-19 18:18:40 +0000631 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pager.c
drh376deb12004-06-30 11:41:55 +0000632
danielk19778c0a7912008-08-20 14:49:23 +0000633pcache.lo: $(TOP)/src/pcache.c $(HDR) $(TOP)/src/pcache.h
drh8b727472009-01-19 18:18:40 +0000634 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pcache.c
danielk19778c0a7912008-08-20 14:49:23 +0000635
danielk1977bc2ca9e2008-11-13 14:28:28 +0000636pcache1.lo: $(TOP)/src/pcache1.c $(HDR) $(TOP)/src/pcache.h
drh8b727472009-01-19 18:18:40 +0000637 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pcache1.c
danielk1977bc2ca9e2008-11-13 14:28:28 +0000638
drh376deb12004-06-30 11:41:55 +0000639opcodes.lo: opcodes.c
drh8b727472009-01-19 18:18:40 +0000640 $(LTCOMPILE) $(TEMP_STORE) -c opcodes.c
drh376deb12004-06-30 11:41:55 +0000641
drhb327f772004-10-06 15:03:57 +0000642opcodes.c: opcodes.h $(TOP)/mkopcodec.awk
drh0c07fb92006-06-27 20:05:23 +0000643 sort -n -b -k 3 opcodes.h | $(NAWK) -f $(TOP)/mkopcodec.awk >opcodes.c
drh376deb12004-06-30 11:41:55 +0000644
drhf2bc0132004-10-04 13:19:23 +0000645opcodes.h: parse.h $(TOP)/src/vdbe.c $(TOP)/mkopcodeh.awk
drhf1878b42006-01-23 18:06:52 +0000646 cat parse.h $(TOP)/src/vdbe.c | $(NAWK) -f $(TOP)/mkopcodeh.awk >opcodes.h
drh376deb12004-06-30 11:41:55 +0000647
drh054889e2005-11-30 03:20:31 +0000648os.lo: $(TOP)/src/os.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000649 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os.c
drh054889e2005-11-30 03:20:31 +0000650
drh376deb12004-06-30 11:41:55 +0000651os_unix.lo: $(TOP)/src/os_unix.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000652 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os_unix.c
drh376deb12004-06-30 11:41:55 +0000653
654os_win.lo: $(TOP)/src/os_win.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000655 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os_win.c
drh376deb12004-06-30 11:41:55 +0000656
drh60a1e4b2006-06-03 18:02:15 +0000657os_os2.lo: $(TOP)/src/os_os2.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000658 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os_os2.c
drh60a1e4b2006-06-03 18:02:15 +0000659
drh376deb12004-06-30 11:41:55 +0000660parse.lo: parse.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000661 $(LTCOMPILE) $(TEMP_STORE) -c parse.c
drh376deb12004-06-30 11:41:55 +0000662
663parse.h: parse.c
664
drhfa3b19e2005-11-24 22:22:29 +0000665parse.c: $(TOP)/src/parse.y lemon$(BEXE) $(TOP)/addopcodes.awk
drh376deb12004-06-30 11:41:55 +0000666 cp $(TOP)/src/parse.y .
shaneb1cd7302008-10-22 18:27:31 +0000667 ./lemon$(BEXE) $(OPT_FEATURE_FLAGS) $(OPTS) parse.y
drhfa3b19e2005-11-24 22:22:29 +0000668 mv parse.h parse.h.temp
drhd3067e82007-06-20 16:20:36 +0000669 $(NAWK) -f $(TOP)/addopcodes.awk parse.h.temp >parse.h
drh376deb12004-06-30 11:41:55 +0000670
671pragma.lo: $(TOP)/src/pragma.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000672 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pragma.c
drh376deb12004-06-30 11:41:55 +0000673
danielk1977fa256a32005-05-25 04:11:56 +0000674prepare.lo: $(TOP)/src/prepare.c $(HDR)
675 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/prepare.c
676
drh376deb12004-06-30 11:41:55 +0000677printf.lo: $(TOP)/src/printf.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000678 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/printf.c
drh376deb12004-06-30 11:41:55 +0000679
680random.lo: $(TOP)/src/random.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000681 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/random.c
drh376deb12004-06-30 11:41:55 +0000682
drh7d10d5a2008-08-20 16:35:10 +0000683resolve.lo: $(TOP)/src/resolve.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000684 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/resolve.c
drh7d10d5a2008-08-20 16:35:10 +0000685
drh3d4501e2008-12-04 20:40:10 +0000686rowset.lo: $(TOP)/src/rowset.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000687 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/rowset.c
drh3d4501e2008-12-04 20:40:10 +0000688
drh376deb12004-06-30 11:41:55 +0000689select.lo: $(TOP)/src/select.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000690 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/select.c
drh376deb12004-06-30 11:41:55 +0000691
drhf7141992008-06-19 00:16:08 +0000692status.lo: $(TOP)/src/status.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000693 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/status.c
drhf7141992008-06-19 00:16:08 +0000694
drh47baebc2009-08-14 16:01:24 +0000695sqlite3.h: $(TOP)/src/sqlite.h.in $(TOP)/manifest.uuid $(TOP)/VERSION
696 tclsh $(TOP)/tool/mksqlite3h.tcl $(TOP) >sqlite3.h
drh376deb12004-06-30 11:41:55 +0000697
698table.lo: $(TOP)/src/table.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000699 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/table.c
drh376deb12004-06-30 11:41:55 +0000700
701tclsqlite.lo: $(TOP)/src/tclsqlite.c $(HDR)
drha17378c2008-07-25 12:39:23 +0000702 $(LTCOMPILE) -DUSE_TCL_STUBS=1 -c $(TOP)/src/tclsqlite.c
drh376deb12004-06-30 11:41:55 +0000703
drh73b211a2005-01-18 04:00:42 +0000704tokenize.lo: $(TOP)/src/tokenize.c keywordhash.h $(HDR)
drh8b727472009-01-19 18:18:40 +0000705 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/tokenize.c
drh376deb12004-06-30 11:41:55 +0000706
drh73b211a2005-01-18 04:00:42 +0000707keywordhash.h: $(TOP)/tool/mkkeywordhash.c
shaneb1cd7302008-10-22 18:27:31 +0000708 $(BCC) -o mkkeywordhash$(BEXE) $(OPT_FEATURE_FLAGS) $(OPTS) $(TOP)/tool/mkkeywordhash.c
drh73b211a2005-01-18 04:00:42 +0000709 ./mkkeywordhash$(BEXE) >keywordhash.h
drh52fb6d72004-11-03 03:59:57 +0000710
drh376deb12004-06-30 11:41:55 +0000711trigger.lo: $(TOP)/src/trigger.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000712 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/trigger.c
drh376deb12004-06-30 11:41:55 +0000713
714update.lo: $(TOP)/src/update.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000715 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/update.c
drh376deb12004-06-30 11:41:55 +0000716
717utf.lo: $(TOP)/src/utf.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000718 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/utf.c
drh376deb12004-06-30 11:41:55 +0000719
720util.lo: $(TOP)/src/util.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000721 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/util.c
drh376deb12004-06-30 11:41:55 +0000722
723vacuum.lo: $(TOP)/src/vacuum.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000724 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vacuum.c
drh376deb12004-06-30 11:41:55 +0000725
mlcreecheb6dc142008-03-13 18:28:03 +0000726vdbe.lo: $(TOP)/src/vdbe.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000727 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbe.c
drh376deb12004-06-30 11:41:55 +0000728
mlcreecheb6dc142008-03-13 18:28:03 +0000729vdbeapi.lo: $(TOP)/src/vdbeapi.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000730 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbeapi.c
drh376deb12004-06-30 11:41:55 +0000731
mlcreecheb6dc142008-03-13 18:28:03 +0000732vdbeaux.lo: $(TOP)/src/vdbeaux.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000733 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbeaux.c
drh376deb12004-06-30 11:41:55 +0000734
mlcreecheb6dc142008-03-13 18:28:03 +0000735vdbeblob.lo: $(TOP)/src/vdbeblob.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000736 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbeblob.c
danielk19776338c762007-05-17 16:38:30 +0000737
mlcreecheb6dc142008-03-13 18:28:03 +0000738vdbemem.lo: $(TOP)/src/vdbemem.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000739 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbemem.c
drh376deb12004-06-30 11:41:55 +0000740
drhc7bc4fd2009-11-25 18:03:42 +0000741vdbetrace.lo: $(TOP)/src/vdbetrace.c $(HDR)
742 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbetrace.c
743
mlcreecheb6dc142008-03-13 18:28:03 +0000744vtab.lo: $(TOP)/src/vtab.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000745 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vtab.c
drhb9bb7c12006-06-11 23:41:55 +0000746
drhc438efd2010-04-26 00:19:45 +0000747wal.lo: $(TOP)/src/wal.c $(HDR)
748 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/wal.c
749
drh7d10d5a2008-08-20 16:35:10 +0000750walker.lo: $(TOP)/src/walker.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000751 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/walker.c
drh7d10d5a2008-08-20 16:35:10 +0000752
drh376deb12004-06-30 11:41:55 +0000753where.lo: $(TOP)/src/where.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000754 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/where.c
drh376deb12004-06-30 11:41:55 +0000755
drh7b5717e2004-11-25 13:50:01 +0000756tclsqlite-shell.lo: $(TOP)/src/tclsqlite.c $(HDR)
757 $(LTCOMPILE) -DTCLSH=1 -o $@ -c $(TOP)/src/tclsqlite.c
drh376deb12004-06-30 11:41:55 +0000758
drh7b5717e2004-11-25 13:50:01 +0000759tclsqlite-stubs.lo: $(TOP)/src/tclsqlite.c $(HDR)
760 $(LTCOMPILE) -DTCL_USE_STUBS=1 -o $@ -c $(TOP)/src/tclsqlite.c
761
mlcreech1428b372008-03-13 23:28:22 +0000762tclsqlite3$(TEXE): tclsqlite-shell.lo libsqlite3.la
763 $(LTLINK) -o $@ tclsqlite-shell.lo \
drh376deb12004-06-30 11:41:55 +0000764 libsqlite3.la $(LIBTCL)
765
mlcreech969b2cd2008-03-14 04:11:03 +0000766testfixture$(TEXE): $(TESTFIXTURE_SRC)
drh866108f2008-05-13 00:57:21 +0000767 $(LTLINK) -DTCLSH=1 -DSQLITE_TEST=1 -DSQLITE_NO_SYNC=1\
768 -DSQLITE_CRASH_TEST=1 \
mlcreech969b2cd2008-03-14 04:11:03 +0000769 -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE $(TEMP_STORE) \
drh866108f2008-05-13 00:57:21 +0000770 -o $@ $(TESTFIXTURE_SRC) $(LIBTCL) $(TLIBS)
drh376deb12004-06-30 11:41:55 +0000771
drh376deb12004-06-30 11:41:55 +0000772
drh9c06c952005-11-26 00:25:00 +0000773fulltest: testfixture$(TEXE) sqlite3$(TEXE)
mlcreech1428b372008-03-13 23:28:22 +0000774 ./testfixture$(TEXE) $(TOP)/test/all.test
drh376deb12004-06-30 11:41:55 +0000775
drh7b5717e2004-11-25 13:50:01 +0000776test: testfixture$(TEXE) sqlite3$(TEXE)
danielk1977ff3c8982008-06-25 17:54:53 +0000777 ./testfixture$(TEXE) $(TOP)/test/veryquick.test
drh376deb12004-06-30 11:41:55 +0000778
mlcreech969b2cd2008-03-14 04:11:03 +0000779sqlite3_analyzer$(TEXE): $(TESTFIXTURE_SRC) $(TOP)/tool/spaceanal.tcl
drh61212b62004-12-02 20:17:00 +0000780 sed \
781 -e '/^#/d' \
782 -e 's,\\,\\\\,g' \
783 -e 's,",\\",g' \
784 -e 's,^,",' \
785 -e 's,$$,\\n",' \
786 $(TOP)/tool/spaceanal.tcl >spaceanal_tcl.h
mlcreech969b2cd2008-03-14 04:11:03 +0000787 $(LTLINK) -DTCLSH=2 -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1 \
788 -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE \
789 $(TEMP_STORE) -o $@ $(TESTFIXTURE_SRC) $(LIBTCL)
drh376deb12004-06-30 11:41:55 +0000790
drh376deb12004-06-30 11:41:55 +0000791
vapierafea9742009-02-18 04:33:59 +0000792lib_install: libsqlite3.la
drh8d45ec02004-09-17 21:07:34 +0000793 $(INSTALL) -d $(DESTDIR)$(libdir)
794 $(LTINSTALL) libsqlite3.la $(DESTDIR)$(libdir)
vapierafea9742009-02-18 04:33:59 +0000795
796install: sqlite3$(BEXE) lib_install sqlite3.h sqlite3.pc ${HAVE_TCL:1=tcl_install}
mlcreechc55771f2008-03-06 08:09:12 +0000797 $(INSTALL) -d $(DESTDIR)$(bindir)
798 $(LTINSTALL) sqlite3$(BEXE) $(DESTDIR)$(bindir)
799 $(INSTALL) -d $(DESTDIR)$(includedir)
800 $(INSTALL) -m 0644 sqlite3.h $(DESTDIR)$(includedir)
801 $(INSTALL) -m 0644 $(TOP)/src/sqlite3ext.h $(DESTDIR)$(includedir)
danielk197794bdf892008-08-04 04:28:18 +0000802 $(INSTALL) -d $(DESTDIR)$(pkgconfigdir)
803 $(INSTALL) -m 0644 sqlite3.pc $(DESTDIR)$(pkgconfigdir)
drh376deb12004-06-30 11:41:55 +0000804
vapier6d120f32009-01-28 04:46:14 +0000805pkgIndex.tcl:
806 echo 'package ifneeded sqlite3 $(RELEASE) [list load $(TCLLIBDIR)/libtclsqlite3.so sqlite3]' > $@
vapierafea9742009-02-18 04:33:59 +0000807tcl_install: lib_install libtclsqlite3.la pkgIndex.tcl
vapier6d120f32009-01-28 04:46:14 +0000808 $(INSTALL) -d $(DESTDIR)$(TCLLIBDIR)
809 $(LTINSTALL) libtclsqlite3.la $(DESTDIR)$(TCLLIBDIR)
810 rm -f $(DESTDIR)$(TCLLIBDIR)/libtclsqlite3.la $(DESTDIR)$(TCLLIBDIR)/libtclsqlite3.a
811 $(INSTALL) -m 0644 pkgIndex.tcl $(DESTDIR)$(TCLLIBDIR)
drh4b2266a2004-11-27 15:52:16 +0000812
drh376deb12004-06-30 11:41:55 +0000813clean:
drh7b5717e2004-11-25 13:50:01 +0000814 rm -f *.lo *.la *.o sqlite3$(TEXE) libsqlite3.la
drh376deb12004-06-30 11:41:55 +0000815 rm -f sqlite3.h opcodes.*
mlcreechae28e672008-03-06 09:03:20 +0000816 rm -rf .libs .deps tsrc
drh52fb6d72004-11-03 03:59:57 +0000817 rm -f lemon$(BEXE) lempar.c parse.* sqlite*.tar.gz
drh73b211a2005-01-18 04:00:42 +0000818 rm -f mkkeywordhash$(BEXE) keywordhash.h
drh376deb12004-06-30 11:41:55 +0000819 rm -f $(PUBLISH)
820 rm -f *.da *.bb *.bbg gmon.out
drh7b5717e2004-11-25 13:50:01 +0000821 rm -f testfixture$(TEXE) test.db
drh376deb12004-06-30 11:41:55 +0000822 rm -f common.tcl
drh79dc6692006-09-02 22:14:11 +0000823 rm -f sqlite3.dll sqlite3.lib sqlite3.def
mlcreechae28e672008-03-06 09:03:20 +0000824 rm -f sqlite3.c .target_source
drh376deb12004-06-30 11:41:55 +0000825
drh376deb12004-06-30 11:41:55 +0000826distclean: clean
mlcreechb87057f2008-03-06 07:19:20 +0000827 rm -f config.log config.status libtool Makefile sqlite3.pc
drh79dc6692006-09-02 22:14:11 +0000828
829#
830# Windows section
831#
832dll: sqlite3.dll
833
834REAL_LIBOBJ = $(LIBOBJ:%.lo=.libs/%.o)
835
836$(REAL_LIBOBJ): $(LIBOBJ)
837
838sqlite3.def: $(REAL_LIBOBJ)
839 echo 'EXPORTS' >sqlite3.def
840 nm $(REAL_LIBOBJ) | grep ' T ' | grep ' _sqlite3_' \
841 | sed 's/^.* _//' >>sqlite3.def
842
843sqlite3.dll: $(REAL_LIBOBJ) sqlite3.def
mlcreech1428b372008-03-13 23:28:22 +0000844 $(TCC) -shared -o $@ sqlite3.def \
drh79dc6692006-09-02 22:14:11 +0000845 -Wl,"--strip-all" $(REAL_LIBOBJ)