blob: 31e30ffc48d8ae67c76614b5db72a0901ef713b9 [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#
dan9508daa2010-08-28 18:58:00 +000029TCC = @CC@ @CPPFLAGS@ @CFLAGS@ -I. -I${TOP}/src -I${TOP}/ext/rtree
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#
mistachkin1b904bf2012-01-14 03:34:24 +000034TCC += -D_HAVE_SQLITE_CONFIG_H -DBUILD_sqlite
mlcreech1e12d432008-05-07 02:42:01 +000035
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#
mistachkinf344a5e2012-12-06 00:16:51 +000048LIBTCL = @TCL_LIB_SPEC@
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
mlcreechc658b0f2008-03-09 02:20:11 +000062# Any target libraries which libsqlite must be linked against
63#
vapier7f19c022007-02-17 14:46:31 +000064TLIBS = @LIBS@
drhf1878b42006-01-23 18:06:52 +000065
drh376deb12004-06-30 11:41:55 +000066# Flags controlling use of the in memory btree implementation
67#
danielk1977b06a0b62008-06-26 10:54:12 +000068# SQLITE_TEMP_STORE is 0 to force temporary tables to be in a file, 1 to
drh376deb12004-06-30 11:41:55 +000069# default to file, 2 to default to memory, and 3 to force temporary
70# tables to always be in memory.
71#
danielk1977b06a0b62008-06-26 10:54:12 +000072TEMP_STORE = -DSQLITE_TEMP_STORE=@TEMP_STORE@
drh376deb12004-06-30 11:41:55 +000073
shanefbedede2008-07-22 05:05:01 +000074# Enable/disable loadable extensions, and other optional features
shaneb1cd7302008-10-22 18:27:31 +000075# based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*).
76# The same set of OMIT and ENABLE flags should be passed to the
77# LEMON parser generator and the mkkeywordhash tool as well.
shanefbedede2008-07-22 05:05:01 +000078OPT_FEATURE_FLAGS = @OPT_FEATURE_FLAGS@
79
80TCC += $(OPT_FEATURE_FLAGS)
mlcreecha4edab02008-03-06 04:14:17 +000081
shaneb1cd7302008-10-22 18:27:31 +000082# Add in any optional parameters specified on the make commane line
83# ie. make "OPTS=-DSQLITE_ENABLE_FOO=1 -DSQLITE_OMIT_FOO=1".
84TCC += $(OPTS)
85
drh4b2266a2004-11-27 15:52:16 +000086# Version numbers and release number for the SQLite being compiled.
87#
88VERSION = @VERSION@
danielk197799ba19e2005-02-05 07:33:34 +000089VERSION_NUMBER = @VERSION_NUMBER@
drh4b2266a2004-11-27 15:52:16 +000090RELEASE = @RELEASE@
91
drh7b5717e2004-11-25 13:50:01 +000092# Filename extensions
93#
94BEXE = @BUILD_EXEEXT@
95TEXE = @TARGET_EXEEXT@
96
drh4b2266a2004-11-27 15:52:16 +000097# The following variable is "1" if the configure script was able to locate
98# the tclConfig.sh file. It is an empty string otherwise. When this
99# variable is "1", the TCL extension library (libtclsqlite3.so) is built
100# and installed.
drh7b5717e2004-11-25 13:50:01 +0000101#
102HAVE_TCL = @HAVE_TCL@
103
mlcreechab1c47b2008-03-09 02:51:10 +0000104# This is the command to use for tclsh - normally just "tclsh", but we may
105# know the specific version we want to use
106#
107TCLSH_CMD = @TCLSH_CMD@
108
vapier6d120f32009-01-28 04:46:14 +0000109# Where do we want to install the tcl plugin
110#
111TCLLIBDIR = @TCLLIBDIR@
112
drh4b2266a2004-11-27 15:52:16 +0000113# The suffix used on shared libraries. Ex: ".dll", ".so", ".dylib"
114#
115SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@
116
mlcreechaac7b932008-04-01 02:45:22 +0000117# If gcov support was enabled by the configure script, add the appropriate
118# flags here. It's not always as easy as just having the user add the right
119# CFLAGS / LDFLAGS, because libtool wants to use CFLAGS when linking, which
120# causes build errors with -fprofile-arcs -ftest-coverage with some GCCs.
121# Supposedly GCC does the right thing if you use --coverage, but in
122# practice it still fails. See:
123#
124# http://www.mail-archive.com/debian-gcc@lists.debian.org/msg26197.html
125#
126# for more info.
127#
shaneb1cd7302008-10-22 18:27:31 +0000128GCOV_CFLAGS1 = -DSQLITE_COVERAGE_TEST=1 -fprofile-arcs -ftest-coverage
mlcreechaac7b932008-04-01 02:45:22 +0000129GCOV_LDFLAGS1 = -lgcov
130USE_GCOV = @USE_GCOV@
131LTCOMPILE_EXTRAS += $(GCOV_CFLAGS$(USE_GCOV))
132LTLINK_EXTRAS += $(GCOV_LDFLAGS$(USE_GCOV))
133
134
drh4b2266a2004-11-27 15:52:16 +0000135# The directory into which to store package information for
136
137# Some standard variables and programs
138#
mlcreech3c080bc2008-03-07 02:20:56 +0000139prefix = @prefix@
140exec_prefix = @exec_prefix@
drh4b2266a2004-11-27 15:52:16 +0000141libdir = @libdir@
danielk197794bdf892008-08-04 04:28:18 +0000142pkgconfigdir = $(libdir)/pkgconfig
mlcreechc55771f2008-03-06 08:09:12 +0000143bindir = @bindir@
144includedir = @includedir@
drh4b2266a2004-11-27 15:52:16 +0000145INSTALL = @INSTALL@
146LIBTOOL = ./libtool
147ALLOWRELEASE = @ALLOWRELEASE@
148
149# libtool compile/link/install
mlcreechaac7b932008-04-01 02:45:22 +0000150LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(TCC) $(LTCOMPILE_EXTRAS)
shaneb0650c22008-10-12 01:49:41 +0000151LTLINK = $(LIBTOOL) --mode=link $(TCC) $(LTCOMPILE_EXTRAS) @LDFLAGS@ $(LTLINK_EXTRAS)
drh4b2266a2004-11-27 15:52:16 +0000152LTINSTALL = $(LIBTOOL) --mode=install $(INSTALL)
153
drhf1878b42006-01-23 18:06:52 +0000154# nawk compatible awk.
155NAWK = @AWK@
156
drh376deb12004-06-30 11:41:55 +0000157# You should not have to change anything below this line
158###############################################################################
drh4b2266a2004-11-27 15:52:16 +0000159
shaneh18607052010-07-06 20:37:09 +0000160USE_AMALGAMATION = @USE_AMALGAMATION@
161
mlcreech94984912008-03-04 19:03:08 +0000162# Object files for the SQLite library (non-amalgamation).
drh376deb12004-06-30 11:41:55 +0000163#
shaneh18607052010-07-06 20:37:09 +0000164LIBOBJS0 = alter.lo analyze.lo attach.lo auth.lo \
165 backup.lo bitvec.lo btmutex.lo btree.lo build.lo \
drh3edd8a52010-10-21 12:34:29 +0000166 callback.lo complete.lo ctime.lo date.lo delete.lo \
167 expr.lo fault.lo fkey.lo \
drhd97f3d72012-05-28 15:32:09 +0000168 fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo \
169 fts3_porter.lo fts3_snippet.lo fts3_tokenizer.lo fts3_tokenizer1.lo \
dand7a959c2013-04-22 15:30:37 +0000170 fts3_tokenize_vtab.lo \
drhd97f3d72012-05-28 15:32:09 +0000171 fts3_unicode.lo fts3_unicode2.lo fts3_write.lo \
shaneh18607052010-07-06 20:37:09 +0000172 func.lo global.lo hash.lo \
173 icu.lo insert.lo journal.lo legacy.lo loadext.lo \
174 main.lo malloc.lo mem0.lo mem1.lo mem2.lo mem3.lo mem5.lo \
175 memjournal.lo \
drh83905c92012-06-21 13:00:37 +0000176 mutex.lo mutex_noop.lo mutex_unix.lo mutex_w32.lo \
177 notify.lo opcodes.lo os.lo os_unix.lo os_win.lo \
shaneh18607052010-07-06 20:37:09 +0000178 pager.lo parse.lo pcache.lo pcache1.lo pragma.lo prepare.lo printf.lo \
179 random.lo resolve.lo rowset.lo rtree.lo select.lo status.lo \
180 table.lo tokenize.lo trigger.lo \
181 update.lo util.lo vacuum.lo \
dana9f39fd2011-08-12 16:34:42 +0000182 vdbe.lo vdbeapi.lo vdbeaux.lo vdbeblob.lo vdbemem.lo vdbesort.lo \
183 vdbetrace.lo wal.lo walker.lo where.lo utf.lo vtab.lo
mlcreech94984912008-03-04 19:03:08 +0000184
185# Object files for the amalgamation.
186#
shaneh18607052010-07-06 20:37:09 +0000187LIBOBJS1 = sqlite3.lo
mlcreech94984912008-03-04 19:03:08 +0000188
189# Determine the real value of LIBOBJ based on the 'configure' script
190#
shaneh18607052010-07-06 20:37:09 +0000191LIBOBJ = $(LIBOBJS$(USE_AMALGAMATION))
mlcreech94984912008-03-04 19:03:08 +0000192
drh376deb12004-06-30 11:41:55 +0000193
194# All of the source code files.
195#
196SRC = \
drhd0e4a6c2005-02-15 20:47:57 +0000197 $(TOP)/src/alter.c \
drh9f18e8a2005-07-08 12:13:04 +0000198 $(TOP)/src/analyze.c \
drh376deb12004-06-30 11:41:55 +0000199 $(TOP)/src/attach.c \
200 $(TOP)/src/auth.c \
danielk197704103022009-02-03 16:51:24 +0000201 $(TOP)/src/backup.c \
mlcreeche0414bb2008-02-26 03:45:59 +0000202 $(TOP)/src/bitvec.c \
drh900b31e2007-08-28 02:27:51 +0000203 $(TOP)/src/btmutex.c \
drh376deb12004-06-30 11:41:55 +0000204 $(TOP)/src/btree.c \
205 $(TOP)/src/btree.h \
mlcreecheb6dc142008-03-13 18:28:03 +0000206 $(TOP)/src/btreeInt.h \
drh376deb12004-06-30 11:41:55 +0000207 $(TOP)/src/build.c \
danielk1977fd9a0a42005-05-24 12:01:00 +0000208 $(TOP)/src/callback.c \
drha2b902d2005-08-14 17:53:20 +0000209 $(TOP)/src/complete.c \
shanehdc97a8c2010-02-23 20:08:35 +0000210 $(TOP)/src/ctime.c \
drh376deb12004-06-30 11:41:55 +0000211 $(TOP)/src/date.c \
212 $(TOP)/src/delete.c \
drh376deb12004-06-30 11:41:55 +0000213 $(TOP)/src/expr.c \
drh643167f2008-01-22 21:30:53 +0000214 $(TOP)/src/fault.c \
dan3be7d6e2009-09-19 17:59:59 +0000215 $(TOP)/src/fkey.c \
drh70a8ca32008-08-21 18:49:27 +0000216 $(TOP)/src/func.c \
drh40257ff2008-06-13 18:24:27 +0000217 $(TOP)/src/global.c \
drh376deb12004-06-30 11:41:55 +0000218 $(TOP)/src/hash.c \
219 $(TOP)/src/hash.h \
shane9bcbdad2008-05-29 20:22:37 +0000220 $(TOP)/src/hwtime.h \
drh376deb12004-06-30 11:41:55 +0000221 $(TOP)/src/insert.c \
drh4bfc8a92007-08-27 23:38:43 +0000222 $(TOP)/src/journal.c \
drh376deb12004-06-30 11:41:55 +0000223 $(TOP)/src/legacy.c \
drh1e397f82006-06-08 15:28:43 +0000224 $(TOP)/src/loadext.c \
drh376deb12004-06-30 11:41:55 +0000225 $(TOP)/src/main.c \
drh9e91c752007-05-07 13:11:10 +0000226 $(TOP)/src/malloc.c \
drhd1370b62008-10-28 18:58:20 +0000227 $(TOP)/src/mem0.c \
drh4bfc8a92007-08-27 23:38:43 +0000228 $(TOP)/src/mem1.c \
229 $(TOP)/src/mem2.c \
drh9c7a60d2007-10-19 17:47:24 +0000230 $(TOP)/src/mem3.c \
mlcreechfcfe27d2008-03-02 05:34:10 +0000231 $(TOP)/src/mem5.c \
danielk19776553c5c2008-10-21 04:30:31 +0000232 $(TOP)/src/memjournal.c \
drh4bfc8a92007-08-27 23:38:43 +0000233 $(TOP)/src/mutex.c \
mlcreecheb6dc142008-03-13 18:28:03 +0000234 $(TOP)/src/mutex.h \
drh18472fa2008-10-07 15:25:48 +0000235 $(TOP)/src/mutex_noop.c \
drh437b9012007-08-28 16:34:42 +0000236 $(TOP)/src/mutex_unix.c \
237 $(TOP)/src/mutex_w32.c \
danielk1977d52acb32009-03-16 14:48:18 +0000238 $(TOP)/src/notify.c \
drh054889e2005-11-30 03:20:31 +0000239 $(TOP)/src/os.c \
mlcreecheb6dc142008-03-13 18:28:03 +0000240 $(TOP)/src/os.h \
241 $(TOP)/src/os_common.h \
drh376deb12004-06-30 11:41:55 +0000242 $(TOP)/src/os_unix.c \
243 $(TOP)/src/os_win.c \
244 $(TOP)/src/pager.c \
245 $(TOP)/src/pager.h \
246 $(TOP)/src/parse.y \
danielk19778c0a7912008-08-20 14:49:23 +0000247 $(TOP)/src/pcache.c \
248 $(TOP)/src/pcache.h \
danielk1977bc2ca9e2008-11-13 14:28:28 +0000249 $(TOP)/src/pcache1.c \
drh376deb12004-06-30 11:41:55 +0000250 $(TOP)/src/pragma.c \
danielk1977fa256a32005-05-25 04:11:56 +0000251 $(TOP)/src/prepare.c \
drh376deb12004-06-30 11:41:55 +0000252 $(TOP)/src/printf.c \
253 $(TOP)/src/random.c \
drh7d10d5a2008-08-20 16:35:10 +0000254 $(TOP)/src/resolve.c \
drh3d4501e2008-12-04 20:40:10 +0000255 $(TOP)/src/rowset.c \
drh376deb12004-06-30 11:41:55 +0000256 $(TOP)/src/select.c \
drhf7141992008-06-19 00:16:08 +0000257 $(TOP)/src/status.c \
drh376deb12004-06-30 11:41:55 +0000258 $(TOP)/src/shell.c \
259 $(TOP)/src/sqlite.h.in \
mlcreecheb6dc142008-03-13 18:28:03 +0000260 $(TOP)/src/sqlite3ext.h \
drh376deb12004-06-30 11:41:55 +0000261 $(TOP)/src/sqliteInt.h \
mlcreecheb6dc142008-03-13 18:28:03 +0000262 $(TOP)/src/sqliteLimit.h \
drh376deb12004-06-30 11:41:55 +0000263 $(TOP)/src/table.c \
264 $(TOP)/src/tclsqlite.c \
265 $(TOP)/src/tokenize.c \
266 $(TOP)/src/trigger.c \
267 $(TOP)/src/utf.c \
268 $(TOP)/src/update.c \
269 $(TOP)/src/util.c \
270 $(TOP)/src/vacuum.c \
271 $(TOP)/src/vdbe.c \
272 $(TOP)/src/vdbe.h \
273 $(TOP)/src/vdbeapi.c \
274 $(TOP)/src/vdbeaux.c \
danielk19776338c762007-05-17 16:38:30 +0000275 $(TOP)/src/vdbeblob.c \
drh376deb12004-06-30 11:41:55 +0000276 $(TOP)/src/vdbemem.c \
dana9f39fd2011-08-12 16:34:42 +0000277 $(TOP)/src/vdbesort.c \
drhc7bc4fd2009-11-25 18:03:42 +0000278 $(TOP)/src/vdbetrace.c \
drh376deb12004-06-30 11:41:55 +0000279 $(TOP)/src/vdbeInt.h \
drhb9bb7c12006-06-11 23:41:55 +0000280 $(TOP)/src/vtab.c \
drhc438efd2010-04-26 00:19:45 +0000281 $(TOP)/src/wal.c \
282 $(TOP)/src/wal.h \
drh7d10d5a2008-08-20 16:35:10 +0000283 $(TOP)/src/walker.c \
drhe54df422013-11-12 18:37:25 +0000284 $(TOP)/src/where.c \
285 $(TOP)/src/whereInt.h
drh376deb12004-06-30 11:41:55 +0000286
drh0c979402006-10-03 19:12:32 +0000287# Source code for extensions
288#
289SRC += \
290 $(TOP)/ext/fts1/fts1.c \
291 $(TOP)/ext/fts1/fts1.h \
292 $(TOP)/ext/fts1/fts1_hash.c \
293 $(TOP)/ext/fts1/fts1_hash.h \
294 $(TOP)/ext/fts1/fts1_porter.c \
295 $(TOP)/ext/fts1/fts1_tokenizer.h \
296 $(TOP)/ext/fts1/fts1_tokenizer1.c
mlcreech47524b82008-03-02 05:40:05 +0000297SRC += \
298 $(TOP)/ext/fts2/fts2.c \
299 $(TOP)/ext/fts2/fts2.h \
300 $(TOP)/ext/fts2/fts2_hash.c \
301 $(TOP)/ext/fts2/fts2_hash.h \
302 $(TOP)/ext/fts2/fts2_icu.c \
303 $(TOP)/ext/fts2/fts2_porter.c \
304 $(TOP)/ext/fts2/fts2_tokenizer.h \
305 $(TOP)/ext/fts2/fts2_tokenizer.c \
306 $(TOP)/ext/fts2/fts2_tokenizer1.c
307SRC += \
308 $(TOP)/ext/fts3/fts3.c \
309 $(TOP)/ext/fts3/fts3.h \
dan16708c42009-11-19 15:25:25 +0000310 $(TOP)/ext/fts3/fts3Int.h \
shanehd01f9cb2011-02-09 15:25:17 +0000311 $(TOP)/ext/fts3/fts3_aux.c \
shane5df7c0f2009-01-02 15:47:01 +0000312 $(TOP)/ext/fts3/fts3_expr.c \
mlcreech47524b82008-03-02 05:40:05 +0000313 $(TOP)/ext/fts3/fts3_hash.c \
314 $(TOP)/ext/fts3/fts3_hash.h \
315 $(TOP)/ext/fts3/fts3_icu.c \
316 $(TOP)/ext/fts3/fts3_porter.c \
dan16708c42009-11-19 15:25:25 +0000317 $(TOP)/ext/fts3/fts3_snippet.c \
mlcreech47524b82008-03-02 05:40:05 +0000318 $(TOP)/ext/fts3/fts3_tokenizer.h \
319 $(TOP)/ext/fts3/fts3_tokenizer.c \
dan16708c42009-11-19 15:25:25 +0000320 $(TOP)/ext/fts3/fts3_tokenizer1.c \
dand7a959c2013-04-22 15:30:37 +0000321 $(TOP)/ext/fts3/fts3_tokenize_vtab.c \
drhd97f3d72012-05-28 15:32:09 +0000322 $(TOP)/ext/fts3/fts3_unicode.c \
323 $(TOP)/ext/fts3/fts3_unicode2.c \
dan16708c42009-11-19 15:25:25 +0000324 $(TOP)/ext/fts3/fts3_write.c
mlcreech47524b82008-03-02 05:40:05 +0000325SRC += \
danielk19771c826652008-09-08 08:08:09 +0000326 $(TOP)/ext/icu/sqliteicu.h \
mlcreech47524b82008-03-02 05:40:05 +0000327 $(TOP)/ext/icu/icu.c
shaneca57b872008-05-28 17:31:17 +0000328SRC += \
329 $(TOP)/ext/rtree/rtree.h \
330 $(TOP)/ext/rtree/rtree.c
drh0c979402006-10-03 19:12:32 +0000331
mlcreech969b2cd2008-03-14 04:11:03 +0000332
shaneh18607052010-07-06 20:37:09 +0000333# Generated source code files
334#
335SRC += \
336 keywordhash.h \
337 opcodes.c \
338 opcodes.h \
339 parse.c \
340 parse.h \
341 config.h \
342 sqlite3.h
343
344# Source code to the test files.
mlcreech969b2cd2008-03-14 04:11:03 +0000345#
346TESTSRC = \
drh376deb12004-06-30 11:41:55 +0000347 $(TOP)/src/test1.c \
348 $(TOP)/src/test2.c \
349 $(TOP)/src/test3.c \
350 $(TOP)/src/test4.c \
351 $(TOP)/src/test5.c \
drh9c06c952005-11-26 00:25:00 +0000352 $(TOP)/src/test6.c \
drh7910e762006-01-09 23:50:11 +0000353 $(TOP)/src/test7.c \
drhb9bb7c12006-06-11 23:41:55 +0000354 $(TOP)/src/test8.c \
danielk1977a713f2c2007-03-29 12:19:11 +0000355 $(TOP)/src/test9.c \
drh1409be62006-08-23 20:07:20 +0000356 $(TOP)/src/test_autoext.c \
drh7910e762006-01-09 23:50:11 +0000357 $(TOP)/src/test_async.c \
danielk197704103022009-02-03 16:51:24 +0000358 $(TOP)/src/test_backup.c \
drh16a9b832007-05-05 18:39:25 +0000359 $(TOP)/src/test_btree.c \
drhc797d4d2007-05-08 01:08:49 +0000360 $(TOP)/src/test_config.c \
shaneh84aab392010-05-06 15:35:59 +0000361 $(TOP)/src/test_demovfs.c \
danielk1977bf260972008-01-22 11:50:13 +0000362 $(TOP)/src/test_devsym.c \
drh70156982013-03-03 20:26:46 +0000363 $(TOP)/src/test_fs.c \
drh984bfaa2008-03-19 16:08:53 +0000364 $(TOP)/src/test_func.c \
drh15926592007-04-06 15:02:13 +0000365 $(TOP)/src/test_hexio.c \
shane8e283792009-08-21 02:07:09 +0000366 $(TOP)/src/test_init.c \
drh522efc62009-11-10 17:24:37 +0000367 $(TOP)/src/test_intarray.c \
danielk1977f3107512008-12-22 10:58:46 +0000368 $(TOP)/src/test_journal.c \
drh4bfc8a92007-08-27 23:38:43 +0000369 $(TOP)/src/test_malloc.c \
drh5af3ebd2010-11-05 00:00:42 +0000370 $(TOP)/src/test_multiplex.c \
shanec6f66c52008-07-08 22:15:49 +0000371 $(TOP)/src/test_mutex.c \
danielk197720e987a2007-10-05 15:04:12 +0000372 $(TOP)/src/test_onefile.c \
mlcreechede26272008-04-13 23:13:39 +0000373 $(TOP)/src/test_osinst.c \
drhb232c232008-11-19 01:20:26 +0000374 $(TOP)/src/test_pcache.c \
drh51e79a72010-10-06 20:25:00 +0000375 $(TOP)/src/test_quota.c \
dan9508daa2010-08-28 18:58:00 +0000376 $(TOP)/src/test_rtree.c \
danielk1977954ce992006-06-15 15:59:19 +0000377 $(TOP)/src/test_schema.c \
drh2d02a672006-01-25 15:55:37 +0000378 $(TOP)/src/test_server.c \
drh01a109e2010-11-24 13:04:22 +0000379 $(TOP)/src/test_superlock.c \
drh8689bc32011-04-01 20:54:38 +0000380 $(TOP)/src/test_syscall.c \
dan599e9d22010-07-12 08:39:37 +0000381 $(TOP)/src/test_stat.c \
drh4be8b512006-06-13 23:51:34 +0000382 $(TOP)/src/test_tclvar.c \
shane8e283792009-08-21 02:07:09 +0000383 $(TOP)/src/test_thread.c \
shaneh84aab392010-05-06 15:35:59 +0000384 $(TOP)/src/test_vfs.c \
dan807d0fc2011-05-17 14:41:36 +0000385 $(TOP)/src/test_wsd.c \
dan99ebad92011-06-13 09:11:01 +0000386 $(TOP)/ext/fts3/fts3_term.c \
387 $(TOP)/ext/fts3/fts3_test.c
drh376deb12004-06-30 11:41:55 +0000388
drhe50db1c2013-04-25 14:31:46 +0000389# Statically linked extensions
390#
391TESTSRC += \
drh8416fc72013-04-25 16:42:55 +0000392 $(TOP)/ext/misc/amatch.c \
393 $(TOP)/ext/misc/closure.c \
drhe50db1c2013-04-25 14:31:46 +0000394 $(TOP)/ext/misc/fuzzer.c \
drh8416fc72013-04-25 16:42:55 +0000395 $(TOP)/ext/misc/ieee754.c \
drhea41dc42013-04-25 19:31:33 +0000396 $(TOP)/ext/misc/nextchar.c \
drhdef33672013-05-28 20:25:54 +0000397 $(TOP)/ext/misc/percentile.c \
drhe50db1c2013-04-25 14:31:46 +0000398 $(TOP)/ext/misc/regexp.c \
drhb7045ab2013-04-25 14:59:01 +0000399 $(TOP)/ext/misc/spellfix.c \
drh5f8cdac2013-10-14 21:14:42 +0000400 $(TOP)/ext/misc/totype.c \
drhe50db1c2013-04-25 14:31:46 +0000401 $(TOP)/ext/misc/wholenumber.c
402
shaneh18607052010-07-06 20:37:09 +0000403# Source code to the library files needed by the test fixture
404#
405TESTSRC2 = \
406 $(TOP)/src/attach.c \
407 $(TOP)/src/backup.c \
408 $(TOP)/src/bitvec.c \
409 $(TOP)/src/btree.c \
410 $(TOP)/src/build.c \
411 $(TOP)/src/ctime.c \
412 $(TOP)/src/date.c \
413 $(TOP)/src/expr.c \
414 $(TOP)/src/func.c \
415 $(TOP)/src/insert.c \
416 $(TOP)/src/wal.c \
mistachkin06006632013-05-15 20:35:13 +0000417 $(TOP)/src/main.c \
shaneh18607052010-07-06 20:37:09 +0000418 $(TOP)/src/mem5.c \
419 $(TOP)/src/os.c \
shaneh18607052010-07-06 20:37:09 +0000420 $(TOP)/src/os_unix.c \
421 $(TOP)/src/os_win.c \
422 $(TOP)/src/pager.c \
423 $(TOP)/src/pragma.c \
424 $(TOP)/src/prepare.c \
425 $(TOP)/src/printf.c \
426 $(TOP)/src/random.c \
427 $(TOP)/src/pcache.c \
428 $(TOP)/src/pcache1.c \
429 $(TOP)/src/select.c \
430 $(TOP)/src/tokenize.c \
431 $(TOP)/src/utf.c \
432 $(TOP)/src/util.c \
433 $(TOP)/src/vdbeapi.c \
434 $(TOP)/src/vdbeaux.c \
435 $(TOP)/src/vdbe.c \
436 $(TOP)/src/vdbemem.c \
437 $(TOP)/src/vdbetrace.c \
438 $(TOP)/src/where.c \
439 parse.c \
440 $(TOP)/ext/fts3/fts3.c \
shanehd01f9cb2011-02-09 15:25:17 +0000441 $(TOP)/ext/fts3/fts3_aux.c \
shaneh18607052010-07-06 20:37:09 +0000442 $(TOP)/ext/fts3/fts3_expr.c \
shaneh671b5222011-05-12 21:01:12 +0000443 $(TOP)/ext/fts3/fts3_term.c \
shaneh18607052010-07-06 20:37:09 +0000444 $(TOP)/ext/fts3/fts3_tokenizer.c \
445 $(TOP)/ext/fts3/fts3_write.c \
446 $(TOP)/ext/async/sqlite3async.c
447
drh376deb12004-06-30 11:41:55 +0000448# Header files used by all library source files.
449#
450HDR = \
drh376deb12004-06-30 11:41:55 +0000451 $(TOP)/src/btree.h \
drha3152892007-05-05 11:48:52 +0000452 $(TOP)/src/btreeInt.h \
drh376deb12004-06-30 11:41:55 +0000453 $(TOP)/src/hash.h \
shane9bcbdad2008-05-29 20:22:37 +0000454 $(TOP)/src/hwtime.h \
shaneh18607052010-07-06 20:37:09 +0000455 keywordhash.h \
drh437b9012007-08-28 16:34:42 +0000456 $(TOP)/src/mutex.h \
drh376deb12004-06-30 11:41:55 +0000457 opcodes.h \
458 $(TOP)/src/os.h \
459 $(TOP)/src/os_common.h \
shaneh18607052010-07-06 20:37:09 +0000460 $(TOP)/src/pager.h \
461 $(TOP)/src/pcache.h \
462 parse.h \
463 sqlite3.h \
drh1e397f82006-06-08 15:28:43 +0000464 $(TOP)/src/sqlite3ext.h \
drh376deb12004-06-30 11:41:55 +0000465 $(TOP)/src/sqliteInt.h \
shaneh18607052010-07-06 20:37:09 +0000466 $(TOP)/src/sqliteLimit.h \
drh376deb12004-06-30 11:41:55 +0000467 $(TOP)/src/vdbe.h \
mlcreecheb6dc142008-03-13 18:28:03 +0000468 $(TOP)/src/vdbeInt.h \
drhe54df422013-11-12 18:37:25 +0000469 $(TOP)/src/whereInt.h \
mlcreech23797062008-03-20 02:25:35 +0000470 config.h
drh376deb12004-06-30 11:41:55 +0000471
drh0c979402006-10-03 19:12:32 +0000472# Header files used by extensions
473#
shaneh18607052010-07-06 20:37:09 +0000474EXTHDR += \
drh0c979402006-10-03 19:12:32 +0000475 $(TOP)/ext/fts1/fts1.h \
476 $(TOP)/ext/fts1/fts1_hash.h \
477 $(TOP)/ext/fts1/fts1_tokenizer.h
shaneh18607052010-07-06 20:37:09 +0000478EXTHDR += \
mlcreech47524b82008-03-02 05:40:05 +0000479 $(TOP)/ext/fts2/fts2.h \
480 $(TOP)/ext/fts2/fts2_hash.h \
481 $(TOP)/ext/fts2/fts2_tokenizer.h
shaneh18607052010-07-06 20:37:09 +0000482EXTHDR += \
mlcreech47524b82008-03-02 05:40:05 +0000483 $(TOP)/ext/fts3/fts3.h \
dan16708c42009-11-19 15:25:25 +0000484 $(TOP)/ext/fts3/fts3Int.h \
mlcreech47524b82008-03-02 05:40:05 +0000485 $(TOP)/ext/fts3/fts3_hash.h \
486 $(TOP)/ext/fts3/fts3_tokenizer.h
shaneh18607052010-07-06 20:37:09 +0000487EXTHDR += \
shaneca57b872008-05-28 17:31:17 +0000488 $(TOP)/ext/rtree/rtree.h
shaneh18607052010-07-06 20:37:09 +0000489EXTHDR += \
danielk19771c826652008-09-08 08:08:09 +0000490 $(TOP)/ext/icu/sqliteicu.h
dan9508daa2010-08-28 18:58:00 +0000491EXTHDR += \
492 $(TOP)/ext/rtree/sqlite3rtree.h
drh0c979402006-10-03 19:12:32 +0000493
drh376deb12004-06-30 11:41:55 +0000494# This is the default Makefile target. The objects listed here
495# are what get build when you type just "make" with no arguments.
496#
drh7b5717e2004-11-25 13:50:01 +0000497all: sqlite3.h libsqlite3.la sqlite3$(TEXE) $(HAVE_TCL:1=libtclsqlite3.la)
drh376deb12004-06-30 11:41:55 +0000498
499Makefile: $(TOP)/Makefile.in
500 ./config.status
501
vapier2574da52009-01-26 20:59:02 +0000502sqlite3.pc: $(TOP)/sqlite3.pc.in
503 ./config.status
504
drh376deb12004-06-30 11:41:55 +0000505libsqlite3.la: $(LIBOBJ)
mistachkin691d4c92013-10-11 22:19:55 +0000506 $(LTLINK) -no-undefined -o $@ $(LIBOBJ) $(TLIBS) \
mlcreech289234c2008-03-13 19:55:20 +0000507 ${ALLOWRELEASE} -rpath "$(libdir)" -version-info "8:6:8"
drh376deb12004-06-30 11:41:55 +0000508
509libtclsqlite3.la: tclsqlite.lo libsqlite3.la
mistachkin691d4c92013-10-11 22:19:55 +0000510 $(LTLINK) -no-undefined -o $@ tclsqlite.lo \
drh0fcf2372008-07-25 12:49:44 +0000511 libsqlite3.la @TCL_STUB_LIB_SPEC@ $(TLIBS) \
vapier6d120f32009-01-28 04:46:14 +0000512 -rpath "$(TCLLIBDIR)" \
513 -version-info "8:6:8" \
514 -avoid-version
drh376deb12004-06-30 11:41:55 +0000515
drhcbd2da92007-12-17 16:20:06 +0000516sqlite3$(TEXE): $(TOP)/src/shell.c libsqlite3.la sqlite3.h
mlcreechc658b0f2008-03-09 02:20:11 +0000517 $(LTLINK) $(READLINE_FLAGS) \
drhc9a67a82007-12-13 18:20:46 +0000518 -o $@ $(TOP)/src/shell.c libsqlite3.la \
mlcreech289234c2008-03-13 19:55:20 +0000519 $(LIBREADLINE) $(TLIBS) -rpath "$(libdir)"
drhc9a67a82007-12-13 18:20:46 +0000520
drhbc94dbb2013-04-08 14:28:33 +0000521mptester$(EXE): sqlite3.c $(TOP)/mptest/mptest.c
522 $(LTLINK) -o $@ -I. $(TOP)/mptest/mptest.c sqlite3.c \
523 $(TLIBS) -rpath "$(libdir)"
524
525
drh376deb12004-06-30 11:41:55 +0000526# This target creates a directory named "tsrc" and fills it with
527# copies of all of the C source code and header files needed to
528# build on the target system. Some of the C source code and header
529# files are automatically generated. This target takes care of
530# all that automatic generation.
531#
shaneh18607052010-07-06 20:37:09 +0000532.target_source: $(SRC) $(TOP)/tool/vdbe-compress.tcl
drh376deb12004-06-30 11:41:55 +0000533 rm -rf tsrc
shaneh18607052010-07-06 20:37:09 +0000534 mkdir tsrc
535 cp -f $(SRC) tsrc
drh376deb12004-06-30 11:41:55 +0000536 rm tsrc/sqlite.h.in tsrc/parse.y
drh2dc06482013-12-11 00:59:10 +0000537 $(TCLSH_CMD) $(TOP)/tool/vdbe-compress.tcl $(OPTS) <tsrc/vdbe.c >vdbe.new
drh856c1032009-06-02 15:21:42 +0000538 mv vdbe.new tsrc/vdbe.c
mlcreech94984912008-03-04 19:03:08 +0000539 touch .target_source
drh376deb12004-06-30 11:41:55 +0000540
mlcreech94984912008-03-04 19:03:08 +0000541sqlite3.c: .target_source $(TOP)/tool/mksqlite3c.tcl
mlcreechab1c47b2008-03-09 02:51:10 +0000542 $(TCLSH_CMD) $(TOP)/tool/mksqlite3c.tcl
drh339d6c62013-03-19 16:12:40 +0000543 cp tsrc/shell.c tsrc/sqlite3ext.h .
drh93d57532007-04-05 18:34:58 +0000544
drhf4fd9ed2011-11-07 16:46:43 +0000545tclsqlite3.c: sqlite3.c
546 echo '#ifndef USE_SYSTEM_SQLITE' >tclsqlite3.c
547 cat sqlite3.c >>tclsqlite3.c
548 echo '#endif /* USE_SYSTEM_SQLITE */' >>tclsqlite3.c
549 cat $(TOP)/src/tclsqlite.c >>tclsqlite3.c
550
drh07516dd2011-07-22 11:16:39 +0000551sqlite3-all.c: sqlite3.c $(TOP)/tool/split-sqlite3c.tcl
552 $(TCLSH_CMD) $(TOP)/tool/split-sqlite3c.tcl
553
shaneh18607052010-07-06 20:37:09 +0000554# Rule to build the amalgamation
555#
556sqlite3.lo: sqlite3.c
557 $(LTCOMPILE) $(TEMP_STORE) -c sqlite3.c
558
drh376deb12004-06-30 11:41:55 +0000559# Rules to build the LEMON compiler generator
560#
drh53bc21b2009-07-03 17:09:28 +0000561lemon$(BEXE): $(TOP)/tool/lemon.c $(TOP)/src/lempar.c
mlcreech1428b372008-03-13 23:28:22 +0000562 $(BCC) -o $@ $(TOP)/tool/lemon.c
drh53bc21b2009-07-03 17:09:28 +0000563 cp $(TOP)/src/lempar.c .
drh376deb12004-06-30 11:41:55 +0000564
shaneh18607052010-07-06 20:37:09 +0000565# Rules to build individual *.o files from generated *.c files. This
566# applies to:
mlcreech94984912008-03-04 19:03:08 +0000567#
shaneh18607052010-07-06 20:37:09 +0000568# parse.o
569# opcodes.o
570#
571parse.lo: parse.c $(HDR)
572 $(LTCOMPILE) $(TEMP_STORE) -c parse.c
mlcreech94984912008-03-04 19:03:08 +0000573
shaneh18607052010-07-06 20:37:09 +0000574opcodes.lo: opcodes.c
575 $(LTCOMPILE) $(TEMP_STORE) -c opcodes.c
576
577# Rules to build individual *.o files from files in the src directory.
drh376deb12004-06-30 11:41:55 +0000578#
drhd0e4a6c2005-02-15 20:47:57 +0000579alter.lo: $(TOP)/src/alter.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000580 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/alter.c
drhd0e4a6c2005-02-15 20:47:57 +0000581
drh9f18e8a2005-07-08 12:13:04 +0000582analyze.lo: $(TOP)/src/analyze.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000583 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/analyze.c
drh9f18e8a2005-07-08 12:13:04 +0000584
drh376deb12004-06-30 11:41:55 +0000585attach.lo: $(TOP)/src/attach.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000586 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/attach.c
drh376deb12004-06-30 11:41:55 +0000587
588auth.lo: $(TOP)/src/auth.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000589 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/auth.c
drh376deb12004-06-30 11:41:55 +0000590
rse973402e2009-02-20 22:27:41 +0000591backup.lo: $(TOP)/src/backup.c $(HDR)
592 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/backup.c
593
mlcreech5b9d8672008-02-27 03:22:49 +0000594bitvec.lo: $(TOP)/src/bitvec.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000595 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/bitvec.c
mlcreech5b9d8672008-02-27 03:22:49 +0000596
drh900b31e2007-08-28 02:27:51 +0000597btmutex.lo: $(TOP)/src/btmutex.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000598 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/btmutex.c
drh900b31e2007-08-28 02:27:51 +0000599
drh376deb12004-06-30 11:41:55 +0000600btree.lo: $(TOP)/src/btree.c $(HDR) $(TOP)/src/pager.h
drh8b727472009-01-19 18:18:40 +0000601 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/btree.c
drh376deb12004-06-30 11:41:55 +0000602
603build.lo: $(TOP)/src/build.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000604 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/build.c
drh376deb12004-06-30 11:41:55 +0000605
danielk1977fd9a0a42005-05-24 12:01:00 +0000606callback.lo: $(TOP)/src/callback.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000607 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/callback.c
danielk1977fd9a0a42005-05-24 12:01:00 +0000608
drha2b902d2005-08-14 17:53:20 +0000609complete.lo: $(TOP)/src/complete.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000610 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/complete.c
drha2b902d2005-08-14 17:53:20 +0000611
shanehdc97a8c2010-02-23 20:08:35 +0000612ctime.lo: $(TOP)/src/ctime.c $(HDR)
613 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/ctime.c
614
drh376deb12004-06-30 11:41:55 +0000615date.lo: $(TOP)/src/date.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000616 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/date.c
drh376deb12004-06-30 11:41:55 +0000617
618delete.lo: $(TOP)/src/delete.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000619 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/delete.c
drh376deb12004-06-30 11:41:55 +0000620
drh376deb12004-06-30 11:41:55 +0000621expr.lo: $(TOP)/src/expr.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000622 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/expr.c
drh376deb12004-06-30 11:41:55 +0000623
drh643167f2008-01-22 21:30:53 +0000624fault.lo: $(TOP)/src/fault.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000625 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/fault.c
drh643167f2008-01-22 21:30:53 +0000626
dan3be7d6e2009-09-19 17:59:59 +0000627fkey.lo: $(TOP)/src/fkey.c $(HDR)
628 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/fkey.c
629
drh70a8ca32008-08-21 18:49:27 +0000630func.lo: $(TOP)/src/func.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000631 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/func.c
drh376deb12004-06-30 11:41:55 +0000632
drh40257ff2008-06-13 18:24:27 +0000633global.lo: $(TOP)/src/global.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000634 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/global.c
drh40257ff2008-06-13 18:24:27 +0000635
drh376deb12004-06-30 11:41:55 +0000636hash.lo: $(TOP)/src/hash.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000637 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/hash.c
drh376deb12004-06-30 11:41:55 +0000638
639insert.lo: $(TOP)/src/insert.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000640 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/insert.c
drh376deb12004-06-30 11:41:55 +0000641
drh4bfc8a92007-08-27 23:38:43 +0000642journal.lo: $(TOP)/src/journal.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000643 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/journal.c
drh4bfc8a92007-08-27 23:38:43 +0000644
drh376deb12004-06-30 11:41:55 +0000645legacy.lo: $(TOP)/src/legacy.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000646 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/legacy.c
drh376deb12004-06-30 11:41:55 +0000647
drh1e397f82006-06-08 15:28:43 +0000648loadext.lo: $(TOP)/src/loadext.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000649 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/loadext.c
drh1e397f82006-06-08 15:28:43 +0000650
drh376deb12004-06-30 11:41:55 +0000651main.lo: $(TOP)/src/main.c $(HDR)
652 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/main.c
653
drha3152892007-05-05 11:48:52 +0000654malloc.lo: $(TOP)/src/malloc.c $(HDR)
655 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/malloc.c
656
drhd1370b62008-10-28 18:58:20 +0000657mem0.lo: $(TOP)/src/mem0.c $(HDR)
658 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem0.c
659
drh4bfc8a92007-08-27 23:38:43 +0000660mem1.lo: $(TOP)/src/mem1.c $(HDR)
661 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem1.c
662
663mem2.lo: $(TOP)/src/mem2.c $(HDR)
664 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem2.c
665
drh9c7a60d2007-10-19 17:47:24 +0000666mem3.lo: $(TOP)/src/mem3.c $(HDR)
667 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem3.c
668
mlcreechfcfe27d2008-03-02 05:34:10 +0000669mem5.lo: $(TOP)/src/mem5.c $(HDR)
670 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem5.c
671
danielk19776553c5c2008-10-21 04:30:31 +0000672memjournal.lo: $(TOP)/src/memjournal.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000673 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/memjournal.c
danielk19776553c5c2008-10-21 04:30:31 +0000674
drh4bfc8a92007-08-27 23:38:43 +0000675mutex.lo: $(TOP)/src/mutex.c $(HDR)
676 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex.c
677
drh18472fa2008-10-07 15:25:48 +0000678mutex_noop.lo: $(TOP)/src/mutex_noop.c $(HDR)
679 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex_noop.c
680
drh437b9012007-08-28 16:34:42 +0000681mutex_unix.lo: $(TOP)/src/mutex_unix.c $(HDR)
682 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex_unix.c
683
684mutex_w32.lo: $(TOP)/src/mutex_w32.c $(HDR)
685 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex_w32.c
686
danielk1977d52acb32009-03-16 14:48:18 +0000687notify.lo: $(TOP)/src/notify.c $(HDR)
688 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/notify.c
689
drh376deb12004-06-30 11:41:55 +0000690pager.lo: $(TOP)/src/pager.c $(HDR) $(TOP)/src/pager.h
drh8b727472009-01-19 18:18:40 +0000691 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pager.c
drh376deb12004-06-30 11:41:55 +0000692
danielk19778c0a7912008-08-20 14:49:23 +0000693pcache.lo: $(TOP)/src/pcache.c $(HDR) $(TOP)/src/pcache.h
drh8b727472009-01-19 18:18:40 +0000694 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pcache.c
danielk19778c0a7912008-08-20 14:49:23 +0000695
danielk1977bc2ca9e2008-11-13 14:28:28 +0000696pcache1.lo: $(TOP)/src/pcache1.c $(HDR) $(TOP)/src/pcache.h
drh8b727472009-01-19 18:18:40 +0000697 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pcache1.c
danielk1977bc2ca9e2008-11-13 14:28:28 +0000698
drh054889e2005-11-30 03:20:31 +0000699os.lo: $(TOP)/src/os.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000700 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os.c
drh054889e2005-11-30 03:20:31 +0000701
drh376deb12004-06-30 11:41:55 +0000702os_unix.lo: $(TOP)/src/os_unix.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000703 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os_unix.c
drh376deb12004-06-30 11:41:55 +0000704
705os_win.lo: $(TOP)/src/os_win.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000706 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os_win.c
drh376deb12004-06-30 11:41:55 +0000707
drh376deb12004-06-30 11:41:55 +0000708pragma.lo: $(TOP)/src/pragma.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000709 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pragma.c
drh376deb12004-06-30 11:41:55 +0000710
danielk1977fa256a32005-05-25 04:11:56 +0000711prepare.lo: $(TOP)/src/prepare.c $(HDR)
712 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/prepare.c
713
drh376deb12004-06-30 11:41:55 +0000714printf.lo: $(TOP)/src/printf.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000715 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/printf.c
drh376deb12004-06-30 11:41:55 +0000716
717random.lo: $(TOP)/src/random.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000718 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/random.c
drh376deb12004-06-30 11:41:55 +0000719
drh7d10d5a2008-08-20 16:35:10 +0000720resolve.lo: $(TOP)/src/resolve.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000721 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/resolve.c
drh7d10d5a2008-08-20 16:35:10 +0000722
drh3d4501e2008-12-04 20:40:10 +0000723rowset.lo: $(TOP)/src/rowset.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000724 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/rowset.c
drh3d4501e2008-12-04 20:40:10 +0000725
drh376deb12004-06-30 11:41:55 +0000726select.lo: $(TOP)/src/select.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000727 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/select.c
drh376deb12004-06-30 11:41:55 +0000728
drhf7141992008-06-19 00:16:08 +0000729status.lo: $(TOP)/src/status.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000730 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/status.c
drhf7141992008-06-19 00:16:08 +0000731
drh376deb12004-06-30 11:41:55 +0000732table.lo: $(TOP)/src/table.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000733 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/table.c
drh376deb12004-06-30 11:41:55 +0000734
drh73b211a2005-01-18 04:00:42 +0000735tokenize.lo: $(TOP)/src/tokenize.c keywordhash.h $(HDR)
drh8b727472009-01-19 18:18:40 +0000736 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/tokenize.c
drh376deb12004-06-30 11:41:55 +0000737
738trigger.lo: $(TOP)/src/trigger.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000739 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/trigger.c
drh376deb12004-06-30 11:41:55 +0000740
741update.lo: $(TOP)/src/update.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000742 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/update.c
drh376deb12004-06-30 11:41:55 +0000743
744utf.lo: $(TOP)/src/utf.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000745 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/utf.c
drh376deb12004-06-30 11:41:55 +0000746
747util.lo: $(TOP)/src/util.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000748 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/util.c
drh376deb12004-06-30 11:41:55 +0000749
750vacuum.lo: $(TOP)/src/vacuum.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000751 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vacuum.c
drh376deb12004-06-30 11:41:55 +0000752
mlcreecheb6dc142008-03-13 18:28:03 +0000753vdbe.lo: $(TOP)/src/vdbe.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000754 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbe.c
drh376deb12004-06-30 11:41:55 +0000755
mlcreecheb6dc142008-03-13 18:28:03 +0000756vdbeapi.lo: $(TOP)/src/vdbeapi.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000757 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbeapi.c
drh376deb12004-06-30 11:41:55 +0000758
mlcreecheb6dc142008-03-13 18:28:03 +0000759vdbeaux.lo: $(TOP)/src/vdbeaux.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000760 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbeaux.c
drh376deb12004-06-30 11:41:55 +0000761
mlcreecheb6dc142008-03-13 18:28:03 +0000762vdbeblob.lo: $(TOP)/src/vdbeblob.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000763 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbeblob.c
danielk19776338c762007-05-17 16:38:30 +0000764
mlcreecheb6dc142008-03-13 18:28:03 +0000765vdbemem.lo: $(TOP)/src/vdbemem.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000766 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbemem.c
drh376deb12004-06-30 11:41:55 +0000767
dana9f39fd2011-08-12 16:34:42 +0000768vdbesort.lo: $(TOP)/src/vdbesort.c $(HDR)
769 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbesort.c
770
drhc7bc4fd2009-11-25 18:03:42 +0000771vdbetrace.lo: $(TOP)/src/vdbetrace.c $(HDR)
772 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbetrace.c
773
mlcreecheb6dc142008-03-13 18:28:03 +0000774vtab.lo: $(TOP)/src/vtab.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000775 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vtab.c
drhb9bb7c12006-06-11 23:41:55 +0000776
drhc438efd2010-04-26 00:19:45 +0000777wal.lo: $(TOP)/src/wal.c $(HDR)
778 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/wal.c
779
drh7d10d5a2008-08-20 16:35:10 +0000780walker.lo: $(TOP)/src/walker.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000781 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/walker.c
drh7d10d5a2008-08-20 16:35:10 +0000782
drh376deb12004-06-30 11:41:55 +0000783where.lo: $(TOP)/src/where.c $(HDR)
drh8b727472009-01-19 18:18:40 +0000784 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/where.c
drh376deb12004-06-30 11:41:55 +0000785
shaneh18607052010-07-06 20:37:09 +0000786tclsqlite.lo: $(TOP)/src/tclsqlite.c $(HDR)
787 $(LTCOMPILE) -DUSE_TCL_STUBS=1 -c $(TOP)/src/tclsqlite.c
788
drh7b5717e2004-11-25 13:50:01 +0000789tclsqlite-shell.lo: $(TOP)/src/tclsqlite.c $(HDR)
790 $(LTCOMPILE) -DTCLSH=1 -o $@ -c $(TOP)/src/tclsqlite.c
drh376deb12004-06-30 11:41:55 +0000791
drh7b5717e2004-11-25 13:50:01 +0000792tclsqlite-stubs.lo: $(TOP)/src/tclsqlite.c $(HDR)
shaneh8128bb22010-08-19 14:41:58 +0000793 $(LTCOMPILE) -DUSE_TCL_STUBS=1 -o $@ -c $(TOP)/src/tclsqlite.c
drh7b5717e2004-11-25 13:50:01 +0000794
mlcreech1428b372008-03-13 23:28:22 +0000795tclsqlite3$(TEXE): tclsqlite-shell.lo libsqlite3.la
796 $(LTLINK) -o $@ tclsqlite-shell.lo \
drh376deb12004-06-30 11:41:55 +0000797 libsqlite3.la $(LIBTCL)
798
shaneh18607052010-07-06 20:37:09 +0000799# Rules to build opcodes.c and opcodes.h
800#
801opcodes.c: opcodes.h $(TOP)/mkopcodec.awk
drh307ff302011-08-30 01:29:04 +0000802 $(NAWK) -f $(TOP)/mkopcodec.awk opcodes.h >opcodes.c
shaneh18607052010-07-06 20:37:09 +0000803
804opcodes.h: parse.h $(TOP)/src/vdbe.c $(TOP)/mkopcodeh.awk
805 cat parse.h $(TOP)/src/vdbe.c | $(NAWK) -f $(TOP)/mkopcodeh.awk >opcodes.h
806
807# Rules to build parse.c and parse.h - the outputs of lemon.
808#
809parse.h: parse.c
810
811parse.c: $(TOP)/src/parse.y lemon$(BEXE) $(TOP)/addopcodes.awk
812 cp $(TOP)/src/parse.y .
813 rm -f parse.h
814 ./lemon$(BEXE) $(OPT_FEATURE_FLAGS) $(OPTS) parse.y
815 mv parse.h parse.h.temp
816 $(NAWK) -f $(TOP)/addopcodes.awk parse.h.temp >parse.h
817
818sqlite3.h: $(TOP)/src/sqlite.h.in $(TOP)/manifest.uuid $(TOP)/VERSION
drh16b92ee2011-07-22 10:33:04 +0000819 $(TCLSH_CMD) $(TOP)/tool/mksqlite3h.tcl $(TOP) >sqlite3.h
shaneh18607052010-07-06 20:37:09 +0000820
821keywordhash.h: $(TOP)/tool/mkkeywordhash.c
822 $(BCC) -o mkkeywordhash$(BEXE) $(OPT_FEATURE_FLAGS) $(OPTS) $(TOP)/tool/mkkeywordhash.c
823 ./mkkeywordhash$(BEXE) >keywordhash.h
824
825
826
827# Rules to build the extension objects.
828#
829icu.lo: $(TOP)/ext/icu/icu.c $(HDR) $(EXTHDR)
830 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/icu/icu.c
831
832fts2.lo: $(TOP)/ext/fts2/fts2.c $(HDR) $(EXTHDR)
833 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2.c
834
835fts2_hash.lo: $(TOP)/ext/fts2/fts2_hash.c $(HDR) $(EXTHDR)
836 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_hash.c
837
838fts2_icu.lo: $(TOP)/ext/fts2/fts2_icu.c $(HDR) $(EXTHDR)
839 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_icu.c
840
841fts2_porter.lo: $(TOP)/ext/fts2/fts2_porter.c $(HDR) $(EXTHDR)
842 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_porter.c
843
844fts2_tokenizer.lo: $(TOP)/ext/fts2/fts2_tokenizer.c $(HDR) $(EXTHDR)
845 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_tokenizer.c
846
847fts2_tokenizer1.lo: $(TOP)/ext/fts2/fts2_tokenizer1.c $(HDR) $(EXTHDR)
848 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_tokenizer1.c
849
850fts3.lo: $(TOP)/ext/fts3/fts3.c $(HDR) $(EXTHDR)
851 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3.c
852
shanehd01f9cb2011-02-09 15:25:17 +0000853fts3_aux.lo: $(TOP)/ext/fts3/fts3_aux.c $(HDR) $(EXTHDR)
854 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_aux.c
855
shaneh18607052010-07-06 20:37:09 +0000856fts3_expr.lo: $(TOP)/ext/fts3/fts3_expr.c $(HDR) $(EXTHDR)
857 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_expr.c
858
859fts3_hash.lo: $(TOP)/ext/fts3/fts3_hash.c $(HDR) $(EXTHDR)
860 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_hash.c
861
862fts3_icu.lo: $(TOP)/ext/fts3/fts3_icu.c $(HDR) $(EXTHDR)
863 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_icu.c
864
shaneh671b5222011-05-12 21:01:12 +0000865fts3_porter.lo: $(TOP)/ext/fts3/fts3_porter.c $(HDR) $(EXTHDR)
866 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_porter.c
867
shaneh18607052010-07-06 20:37:09 +0000868fts3_snippet.lo: $(TOP)/ext/fts3/fts3_snippet.c $(HDR) $(EXTHDR)
869 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_snippet.c
870
shaneh18607052010-07-06 20:37:09 +0000871fts3_tokenizer.lo: $(TOP)/ext/fts3/fts3_tokenizer.c $(HDR) $(EXTHDR)
872 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer.c
873
874fts3_tokenizer1.lo: $(TOP)/ext/fts3/fts3_tokenizer1.c $(HDR) $(EXTHDR)
875 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer1.c
876
dancf5db442013-05-16 18:33:06 +0000877fts3_tokenize_vtab.lo: $(TOP)/ext/fts3/fts3_tokenize_vtab.c $(HDR) $(EXTHDR)
878 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenize_vtab.c
dand7a959c2013-04-22 15:30:37 +0000879
dan4b8213d2012-06-09 18:52:29 +0000880fts3_unicode.lo: $(TOP)/ext/fts3/fts3_unicode.c $(HDR) $(EXTHDR)
881 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_unicode.c
882
883fts3_unicode2.lo: $(TOP)/ext/fts3/fts3_unicode2.c $(HDR) $(EXTHDR)
884 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_unicode2.c
885
shaneh18607052010-07-06 20:37:09 +0000886fts3_write.lo: $(TOP)/ext/fts3/fts3_write.c $(HDR) $(EXTHDR)
887 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_write.c
888
889rtree.lo: $(TOP)/ext/rtree/rtree.c $(HDR) $(EXTHDR)
890 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/rtree/rtree.c
891
892
893# Rules to build the 'testfixture' application.
894#
895# If using the amalgamation, use sqlite3.c directly to build the test
896# fixture. Otherwise link against libsqlite3.la. (This distinction is
897# necessary because the test fixture requires non-API symbols which are
898# hidden when the library is built via the amalgamation).
899#
900TESTFIXTURE_FLAGS = -DTCLSH=1 -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
901TESTFIXTURE_FLAGS += -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE
drh0bab6c32011-09-23 16:34:49 +0000902TESTFIXTURE_FLAGS += -DBUILD_sqlite
shaneh18607052010-07-06 20:37:09 +0000903
904TESTFIXTURE_SRC0 = $(TESTSRC2) libsqlite3.la
905TESTFIXTURE_SRC1 = sqlite3.c
drh339d6c62013-03-19 16:12:40 +0000906TESTFIXTURE_SRC = $(TESTSRC) $(TOP)/src/tclsqlite.c
907TESTFIXTURE_SRC += $(TESTFIXTURE_SRC$(USE_AMALGAMATION))
shaneh18607052010-07-06 20:37:09 +0000908
mlcreech969b2cd2008-03-14 04:11:03 +0000909testfixture$(TEXE): $(TESTFIXTURE_SRC)
shaneh18607052010-07-06 20:37:09 +0000910 $(LTLINK) -DSQLITE_NO_SYNC=1 $(TEMP_STORE) $(TESTFIXTURE_FLAGS) \
drh866108f2008-05-13 00:57:21 +0000911 -o $@ $(TESTFIXTURE_SRC) $(LIBTCL) $(TLIBS)
drh376deb12004-06-30 11:41:55 +0000912
drh376deb12004-06-30 11:41:55 +0000913
drh9c06c952005-11-26 00:25:00 +0000914fulltest: testfixture$(TEXE) sqlite3$(TEXE)
mlcreech1428b372008-03-13 23:28:22 +0000915 ./testfixture$(TEXE) $(TOP)/test/all.test
drh376deb12004-06-30 11:41:55 +0000916
shaneh18607052010-07-06 20:37:09 +0000917soaktest: testfixture$(TEXE) sqlite3$(TEXE)
918 ./testfixture$(TEXE) $(TOP)/test/all.test -soak=1
919
mistachkinc60941f2012-09-13 01:51:02 +0000920fulltestonly: testfixture$(TEXE) sqlite3$(TEXE)
921 ./testfixture$(TEXE) $(TOP)/test/full.test
922
drh7b5717e2004-11-25 13:50:01 +0000923test: testfixture$(TEXE) sqlite3$(TEXE)
danielk1977ff3c8982008-06-25 17:54:53 +0000924 ./testfixture$(TEXE) $(TOP)/test/veryquick.test
drh376deb12004-06-30 11:41:55 +0000925
drhc42cdce2011-09-21 17:04:21 +0000926sqlite3_analyzer.c: sqlite3.c $(TOP)/src/test_stat.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl
927 echo "#define TCLSH 2" > $@
928 cat sqlite3.c $(TOP)/src/test_stat.c $(TOP)/src/tclsqlite.c >> $@
929 echo "static const char *tclsh_main_loop(void){" >> $@
930 echo "static const char *zMainloop = " >> $@
931 $(NAWK) -f $(TOP)/tool/tostr.awk $(TOP)/tool/spaceanal.tcl >> $@
932 echo "; return zMainloop; }" >> $@
drh376deb12004-06-30 11:41:55 +0000933
drh8d43aa12011-09-21 18:29:49 +0000934sqlite3_analyzer$(TEXE): sqlite3_analyzer.c
drhc42cdce2011-09-21 17:04:21 +0000935 $(LTLINK) sqlite3_analyzer.c -o $@ $(LIBTCL) $(TLIBS)
drh376deb12004-06-30 11:41:55 +0000936
drh9ac3c1e2013-11-07 18:37:31 +0000937showdb$(TEXE): $(TOP)/tool/showdb.c sqlite3.c
938 $(LTLINK) -o $@ $(TOP)/tool/showdb.c sqlite3.c $(TLIBS)
939
940wordcount$(TEXE): $(TOP)/test/wordcount.c sqlite3.c
941 $(LTLINK) -o $@ $(TOP)/test/wordcount.c sqlite3.c $(TLIBS)
942
drhad1ca9a2013-11-23 04:16:58 +0000943speedtest1$(TEXE): $(TOP)/test/wordcount.c sqlite3.lo
944 $(LTLINK) -o $@ $(TOP)/test/speedtest1.c sqlite3.lo $(TLIBS)
945
shaneh18607052010-07-06 20:37:09 +0000946# Standard install and cleanup targets
947#
vapierafea9742009-02-18 04:33:59 +0000948lib_install: libsqlite3.la
drh8d45ec02004-09-17 21:07:34 +0000949 $(INSTALL) -d $(DESTDIR)$(libdir)
950 $(LTINSTALL) libsqlite3.la $(DESTDIR)$(libdir)
vapierafea9742009-02-18 04:33:59 +0000951
952install: sqlite3$(BEXE) lib_install sqlite3.h sqlite3.pc ${HAVE_TCL:1=tcl_install}
mlcreechc55771f2008-03-06 08:09:12 +0000953 $(INSTALL) -d $(DESTDIR)$(bindir)
954 $(LTINSTALL) sqlite3$(BEXE) $(DESTDIR)$(bindir)
955 $(INSTALL) -d $(DESTDIR)$(includedir)
956 $(INSTALL) -m 0644 sqlite3.h $(DESTDIR)$(includedir)
957 $(INSTALL) -m 0644 $(TOP)/src/sqlite3ext.h $(DESTDIR)$(includedir)
danielk197794bdf892008-08-04 04:28:18 +0000958 $(INSTALL) -d $(DESTDIR)$(pkgconfigdir)
959 $(INSTALL) -m 0644 sqlite3.pc $(DESTDIR)$(pkgconfigdir)
drh376deb12004-06-30 11:41:55 +0000960
vapier6d120f32009-01-28 04:46:14 +0000961pkgIndex.tcl:
962 echo 'package ifneeded sqlite3 $(RELEASE) [list load $(TCLLIBDIR)/libtclsqlite3.so sqlite3]' > $@
vapierafea9742009-02-18 04:33:59 +0000963tcl_install: lib_install libtclsqlite3.la pkgIndex.tcl
vapier6d120f32009-01-28 04:46:14 +0000964 $(INSTALL) -d $(DESTDIR)$(TCLLIBDIR)
965 $(LTINSTALL) libtclsqlite3.la $(DESTDIR)$(TCLLIBDIR)
966 rm -f $(DESTDIR)$(TCLLIBDIR)/libtclsqlite3.la $(DESTDIR)$(TCLLIBDIR)/libtclsqlite3.a
967 $(INSTALL) -m 0644 pkgIndex.tcl $(DESTDIR)$(TCLLIBDIR)
drh4b2266a2004-11-27 15:52:16 +0000968
drh376deb12004-06-30 11:41:55 +0000969clean:
drh7b5717e2004-11-25 13:50:01 +0000970 rm -f *.lo *.la *.o sqlite3$(TEXE) libsqlite3.la
drh376deb12004-06-30 11:41:55 +0000971 rm -f sqlite3.h opcodes.*
shaneh18607052010-07-06 20:37:09 +0000972 rm -rf .libs .deps
drh52fb6d72004-11-03 03:59:57 +0000973 rm -f lemon$(BEXE) lempar.c parse.* sqlite*.tar.gz
drh73b211a2005-01-18 04:00:42 +0000974 rm -f mkkeywordhash$(BEXE) keywordhash.h
drh376deb12004-06-30 11:41:55 +0000975 rm -f *.da *.bb *.bbg gmon.out
mistachkinf8a78462012-03-08 20:00:36 +0000976 rm -rf quota2a quota2b quota2c
shaneh18607052010-07-06 20:37:09 +0000977 rm -rf tsrc .target_source
mistachkin9a55e312011-09-22 00:06:44 +0000978 rm -f tclsqlite3$(TEXE)
drh7b5717e2004-11-25 13:50:01 +0000979 rm -f testfixture$(TEXE) test.db
mistachkin9a55e312011-09-22 00:06:44 +0000980 rm -f sqlite3.dll sqlite3.lib sqlite3.exp sqlite3.def
shaneh18607052010-07-06 20:37:09 +0000981 rm -f sqlite3.c
mistachkinfde3b1c72013-03-29 19:52:04 +0000982 rm -f sqlite3rc.h
983 rm -f shell.c sqlite3ext.h
mistachkin9a55e312011-09-22 00:06:44 +0000984 rm -f sqlite3_analyzer$(TEXE) sqlite3_analyzer.c
mistachkin29b75bd2012-10-20 09:35:57 +0000985 rm -f sqlite-*-output.vsix
mistachkin21c9b6b2013-04-10 03:06:43 +0000986 rm -f mptester mptester.exe
drh376deb12004-06-30 11:41:55 +0000987
drh376deb12004-06-30 11:41:55 +0000988distclean: clean
mlcreechb87057f2008-03-06 07:19:20 +0000989 rm -f config.log config.status libtool Makefile sqlite3.pc
drh79dc6692006-09-02 22:14:11 +0000990
991#
992# Windows section
993#
994dll: sqlite3.dll
995
996REAL_LIBOBJ = $(LIBOBJ:%.lo=.libs/%.o)
997
998$(REAL_LIBOBJ): $(LIBOBJ)
999
1000sqlite3.def: $(REAL_LIBOBJ)
1001 echo 'EXPORTS' >sqlite3.def
1002 nm $(REAL_LIBOBJ) | grep ' T ' | grep ' _sqlite3_' \
1003 | sed 's/^.* _//' >>sqlite3.def
1004
1005sqlite3.dll: $(REAL_LIBOBJ) sqlite3.def
mlcreech1428b372008-03-13 23:28:22 +00001006 $(TCC) -shared -o $@ sqlite3.def \
drh79dc6692006-09-02 22:14:11 +00001007 -Wl,"--strip-all" $(REAL_LIBOBJ)