blob: 63152856c45854ab9a51173e266e810155d32650 [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
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
mlcreech94984912008-03-04 19:03:08 +0000160# Object files for the SQLite library (non-amalgamation).
drh376deb12004-06-30 11:41:55 +0000161#
mlcreech94984912008-03-04 19:03:08 +0000162OBJS0 = alter.lo analyze.lo attach.lo auth.lo bitvec.lo btmutex.lo \
163 btree.lo build.lo callback.lo complete.lo date.lo \
drh70a8ca32008-08-21 18:49:27 +0000164 delete.lo expr.lo fault.lo func.lo global.lo \
pweilbacher87a03282008-08-22 17:28:45 +0000165 hash.lo journal.lo insert.lo legacy.lo loadext.lo \
drhd1370b62008-10-28 18:58:20 +0000166 main.lo malloc.lo mem0.lo mem1.lo mem2.lo mem3.lo mem5.lo \
shane7b607a02008-11-04 21:51:03 +0000167 memjournal.lo \
drh18472fa2008-10-07 15:25:48 +0000168 mutex.lo mutex_noop.lo mutex_os2.lo mutex_unix.lo mutex_w32.lo \
mlcreech94984912008-03-04 19:03:08 +0000169 opcodes.lo os.lo os_unix.lo os_win.lo os_os2.lo \
danielk1977bc2ca9e2008-11-13 14:28:28 +0000170 pager.lo parse.lo pcache.lo pcache1.lo pragma.lo prepare.lo printf.lo \
171 random.lo resolve.lo select.lo status.lo \
drh7d10d5a2008-08-20 16:35:10 +0000172 table.lo tokenize.lo trigger.lo update.lo \
mlcreech94984912008-03-04 19:03:08 +0000173 util.lo vacuum.lo \
174 vdbe.lo vdbeapi.lo vdbeaux.lo vdbeblob.lo vdbefifo.lo vdbemem.lo \
drh7d10d5a2008-08-20 16:35:10 +0000175 walker.lo where.lo utf.lo vtab.lo
mlcreech94984912008-03-04 19:03:08 +0000176
177# Object files for the amalgamation.
178#
179OBJS1 = sqlite3.lo
180
181# Determine the real value of LIBOBJ based on the 'configure' script
182#
183USE_AMALGAMATION = @USE_AMALGAMATION@
184LIBOBJ = $(OBJS$(USE_AMALGAMATION))
185
drh376deb12004-06-30 11:41:55 +0000186
187# All of the source code files.
188#
189SRC = \
drhd0e4a6c2005-02-15 20:47:57 +0000190 $(TOP)/src/alter.c \
drh9f18e8a2005-07-08 12:13:04 +0000191 $(TOP)/src/analyze.c \
drh376deb12004-06-30 11:41:55 +0000192 $(TOP)/src/attach.c \
193 $(TOP)/src/auth.c \
mlcreeche0414bb2008-02-26 03:45:59 +0000194 $(TOP)/src/bitvec.c \
drh900b31e2007-08-28 02:27:51 +0000195 $(TOP)/src/btmutex.c \
drh376deb12004-06-30 11:41:55 +0000196 $(TOP)/src/btree.c \
197 $(TOP)/src/btree.h \
mlcreecheb6dc142008-03-13 18:28:03 +0000198 $(TOP)/src/btreeInt.h \
drh376deb12004-06-30 11:41:55 +0000199 $(TOP)/src/build.c \
danielk1977fd9a0a42005-05-24 12:01:00 +0000200 $(TOP)/src/callback.c \
drha2b902d2005-08-14 17:53:20 +0000201 $(TOP)/src/complete.c \
drh376deb12004-06-30 11:41:55 +0000202 $(TOP)/src/date.c \
203 $(TOP)/src/delete.c \
drh376deb12004-06-30 11:41:55 +0000204 $(TOP)/src/expr.c \
drh643167f2008-01-22 21:30:53 +0000205 $(TOP)/src/fault.c \
drh70a8ca32008-08-21 18:49:27 +0000206 $(TOP)/src/func.c \
drh40257ff2008-06-13 18:24:27 +0000207 $(TOP)/src/global.c \
drh376deb12004-06-30 11:41:55 +0000208 $(TOP)/src/hash.c \
209 $(TOP)/src/hash.h \
shane9bcbdad2008-05-29 20:22:37 +0000210 $(TOP)/src/hwtime.h \
drh376deb12004-06-30 11:41:55 +0000211 $(TOP)/src/insert.c \
drh4bfc8a92007-08-27 23:38:43 +0000212 $(TOP)/src/journal.c \
drh376deb12004-06-30 11:41:55 +0000213 $(TOP)/src/legacy.c \
drh1e397f82006-06-08 15:28:43 +0000214 $(TOP)/src/loadext.c \
drh376deb12004-06-30 11:41:55 +0000215 $(TOP)/src/main.c \
drh9e91c752007-05-07 13:11:10 +0000216 $(TOP)/src/malloc.c \
drhd1370b62008-10-28 18:58:20 +0000217 $(TOP)/src/mem0.c \
drh4bfc8a92007-08-27 23:38:43 +0000218 $(TOP)/src/mem1.c \
219 $(TOP)/src/mem2.c \
drh9c7a60d2007-10-19 17:47:24 +0000220 $(TOP)/src/mem3.c \
mlcreechfcfe27d2008-03-02 05:34:10 +0000221 $(TOP)/src/mem5.c \
danielk19776553c5c2008-10-21 04:30:31 +0000222 $(TOP)/src/memjournal.c \
drh4bfc8a92007-08-27 23:38:43 +0000223 $(TOP)/src/mutex.c \
mlcreecheb6dc142008-03-13 18:28:03 +0000224 $(TOP)/src/mutex.h \
drh18472fa2008-10-07 15:25:48 +0000225 $(TOP)/src/mutex_noop.c \
drh437b9012007-08-28 16:34:42 +0000226 $(TOP)/src/mutex_os2.c \
227 $(TOP)/src/mutex_unix.c \
228 $(TOP)/src/mutex_w32.c \
drh054889e2005-11-30 03:20:31 +0000229 $(TOP)/src/os.c \
mlcreecheb6dc142008-03-13 18:28:03 +0000230 $(TOP)/src/os.h \
231 $(TOP)/src/os_common.h \
drh376deb12004-06-30 11:41:55 +0000232 $(TOP)/src/os_unix.c \
233 $(TOP)/src/os_win.c \
drh60a1e4b2006-06-03 18:02:15 +0000234 $(TOP)/src/os_os2.c \
drh376deb12004-06-30 11:41:55 +0000235 $(TOP)/src/pager.c \
236 $(TOP)/src/pager.h \
237 $(TOP)/src/parse.y \
danielk19778c0a7912008-08-20 14:49:23 +0000238 $(TOP)/src/pcache.c \
239 $(TOP)/src/pcache.h \
danielk1977bc2ca9e2008-11-13 14:28:28 +0000240 $(TOP)/src/pcache1.c \
drh376deb12004-06-30 11:41:55 +0000241 $(TOP)/src/pragma.c \
danielk1977fa256a32005-05-25 04:11:56 +0000242 $(TOP)/src/prepare.c \
drh376deb12004-06-30 11:41:55 +0000243 $(TOP)/src/printf.c \
244 $(TOP)/src/random.c \
drh7d10d5a2008-08-20 16:35:10 +0000245 $(TOP)/src/resolve.c \
drh376deb12004-06-30 11:41:55 +0000246 $(TOP)/src/select.c \
drhf7141992008-06-19 00:16:08 +0000247 $(TOP)/src/status.c \
drh376deb12004-06-30 11:41:55 +0000248 $(TOP)/src/shell.c \
249 $(TOP)/src/sqlite.h.in \
mlcreecheb6dc142008-03-13 18:28:03 +0000250 $(TOP)/src/sqlite3ext.h \
drh376deb12004-06-30 11:41:55 +0000251 $(TOP)/src/sqliteInt.h \
mlcreecheb6dc142008-03-13 18:28:03 +0000252 $(TOP)/src/sqliteLimit.h \
drh376deb12004-06-30 11:41:55 +0000253 $(TOP)/src/table.c \
254 $(TOP)/src/tclsqlite.c \
255 $(TOP)/src/tokenize.c \
256 $(TOP)/src/trigger.c \
257 $(TOP)/src/utf.c \
258 $(TOP)/src/update.c \
259 $(TOP)/src/util.c \
260 $(TOP)/src/vacuum.c \
261 $(TOP)/src/vdbe.c \
262 $(TOP)/src/vdbe.h \
263 $(TOP)/src/vdbeapi.c \
264 $(TOP)/src/vdbeaux.c \
danielk19776338c762007-05-17 16:38:30 +0000265 $(TOP)/src/vdbeblob.c \
drha01f79d2005-07-08 13:07:59 +0000266 $(TOP)/src/vdbefifo.c \
drh376deb12004-06-30 11:41:55 +0000267 $(TOP)/src/vdbemem.c \
268 $(TOP)/src/vdbeInt.h \
drhb9bb7c12006-06-11 23:41:55 +0000269 $(TOP)/src/vtab.c \
drh7d10d5a2008-08-20 16:35:10 +0000270 $(TOP)/src/walker.c \
drh376deb12004-06-30 11:41:55 +0000271 $(TOP)/src/where.c
272
mlcreecheb6dc142008-03-13 18:28:03 +0000273# Generated source code files
274#
275SRC += \
276 keywordhash.h \
277 opcodes.c \
278 opcodes.h \
279 parse.c \
280 parse.h \
mlcreech23797062008-03-20 02:25:35 +0000281 config.h \
mlcreecheb6dc142008-03-13 18:28:03 +0000282 sqlite3.h
283
drh0c979402006-10-03 19:12:32 +0000284# Source code for extensions
285#
286SRC += \
287 $(TOP)/ext/fts1/fts1.c \
288 $(TOP)/ext/fts1/fts1.h \
289 $(TOP)/ext/fts1/fts1_hash.c \
290 $(TOP)/ext/fts1/fts1_hash.h \
291 $(TOP)/ext/fts1/fts1_porter.c \
292 $(TOP)/ext/fts1/fts1_tokenizer.h \
293 $(TOP)/ext/fts1/fts1_tokenizer1.c
mlcreech47524b82008-03-02 05:40:05 +0000294SRC += \
295 $(TOP)/ext/fts2/fts2.c \
296 $(TOP)/ext/fts2/fts2.h \
297 $(TOP)/ext/fts2/fts2_hash.c \
298 $(TOP)/ext/fts2/fts2_hash.h \
299 $(TOP)/ext/fts2/fts2_icu.c \
300 $(TOP)/ext/fts2/fts2_porter.c \
301 $(TOP)/ext/fts2/fts2_tokenizer.h \
302 $(TOP)/ext/fts2/fts2_tokenizer.c \
303 $(TOP)/ext/fts2/fts2_tokenizer1.c
304SRC += \
305 $(TOP)/ext/fts3/fts3.c \
306 $(TOP)/ext/fts3/fts3.h \
307 $(TOP)/ext/fts3/fts3_hash.c \
308 $(TOP)/ext/fts3/fts3_hash.h \
309 $(TOP)/ext/fts3/fts3_icu.c \
310 $(TOP)/ext/fts3/fts3_porter.c \
311 $(TOP)/ext/fts3/fts3_tokenizer.h \
312 $(TOP)/ext/fts3/fts3_tokenizer.c \
313 $(TOP)/ext/fts3/fts3_tokenizer1.c
314SRC += \
danielk19771c826652008-09-08 08:08:09 +0000315 $(TOP)/ext/icu/sqliteicu.h \
mlcreech47524b82008-03-02 05:40:05 +0000316 $(TOP)/ext/icu/icu.c
shaneca57b872008-05-28 17:31:17 +0000317SRC += \
318 $(TOP)/ext/rtree/rtree.h \
319 $(TOP)/ext/rtree/rtree.c
drh0c979402006-10-03 19:12:32 +0000320
mlcreech969b2cd2008-03-14 04:11:03 +0000321# Source code to the library files needed by the test fixture
drh376deb12004-06-30 11:41:55 +0000322#
mlcreech969b2cd2008-03-14 04:11:03 +0000323TESTSRC2 = \
drhd33991c2007-09-03 22:15:45 +0000324 $(TOP)/src/attach.c \
mlcreeche0414bb2008-02-26 03:45:59 +0000325 $(TOP)/src/bitvec.c \
drh376deb12004-06-30 11:41:55 +0000326 $(TOP)/src/btree.c \
drhd33991c2007-09-03 22:15:45 +0000327 $(TOP)/src/build.c \
drh6c626082004-11-14 21:56:29 +0000328 $(TOP)/src/date.c \
drhd33991c2007-09-03 22:15:45 +0000329 $(TOP)/src/expr.c \
drh376deb12004-06-30 11:41:55 +0000330 $(TOP)/src/func.c \
drh3f400ea2007-04-02 22:19:38 +0000331 $(TOP)/src/insert.c \
drha3152892007-05-05 11:48:52 +0000332 $(TOP)/src/malloc.c \
drh8e2e2a12006-02-01 01:55:17 +0000333 $(TOP)/src/os.c \
drh32250072006-08-13 21:49:07 +0000334 $(TOP)/src/os_os2.c \
drh376deb12004-06-30 11:41:55 +0000335 $(TOP)/src/os_unix.c \
336 $(TOP)/src/os_win.c \
337 $(TOP)/src/pager.c \
danielk19778c0a7912008-08-20 14:49:23 +0000338 $(TOP)/src/pcache.c \
danielk1977bc2ca9e2008-11-13 14:28:28 +0000339 $(TOP)/src/pcache1.c \
drh376deb12004-06-30 11:41:55 +0000340 $(TOP)/src/pragma.c \
drhd33991c2007-09-03 22:15:45 +0000341 $(TOP)/src/prepare.c \
drh376deb12004-06-30 11:41:55 +0000342 $(TOP)/src/printf.c \
drh643167f2008-01-22 21:30:53 +0000343 $(TOP)/src/random.c \
drhd33991c2007-09-03 22:15:45 +0000344 $(TOP)/src/select.c \
mlcreech969b2cd2008-03-14 04:11:03 +0000345 $(TOP)/src/tokenize.c \
346 $(TOP)/src/utf.c \
347 $(TOP)/src/util.c \
348 $(TOP)/src/vdbe.c \
349 $(TOP)/src/vdbeapi.c \
350 $(TOP)/src/vdbeaux.c \
351 $(TOP)/src/vdbemem.c \
352 $(TOP)/src/where.c \
353 parse.c
354
355# Source code to the actual test files.
356#
357TESTSRC = \
drh376deb12004-06-30 11:41:55 +0000358 $(TOP)/src/test1.c \
359 $(TOP)/src/test2.c \
360 $(TOP)/src/test3.c \
361 $(TOP)/src/test4.c \
362 $(TOP)/src/test5.c \
drh9c06c952005-11-26 00:25:00 +0000363 $(TOP)/src/test6.c \
drh7910e762006-01-09 23:50:11 +0000364 $(TOP)/src/test7.c \
drhb9bb7c12006-06-11 23:41:55 +0000365 $(TOP)/src/test8.c \
danielk1977a713f2c2007-03-29 12:19:11 +0000366 $(TOP)/src/test9.c \
drh1409be62006-08-23 20:07:20 +0000367 $(TOP)/src/test_autoext.c \
drh7910e762006-01-09 23:50:11 +0000368 $(TOP)/src/test_async.c \
drh16a9b832007-05-05 18:39:25 +0000369 $(TOP)/src/test_btree.c \
drhc797d4d2007-05-08 01:08:49 +0000370 $(TOP)/src/test_config.c \
danielk1977bf260972008-01-22 11:50:13 +0000371 $(TOP)/src/test_devsym.c \
drh984bfaa2008-03-19 16:08:53 +0000372 $(TOP)/src/test_func.c \
drh15926592007-04-06 15:02:13 +0000373 $(TOP)/src/test_hexio.c \
drh4bfc8a92007-08-27 23:38:43 +0000374 $(TOP)/src/test_malloc.c \
drh2d02a672006-01-25 15:55:37 +0000375 $(TOP)/src/test_md5.c \
shanec6f66c52008-07-08 22:15:49 +0000376 $(TOP)/src/test_mutex.c \
danielk197720e987a2007-10-05 15:04:12 +0000377 $(TOP)/src/test_onefile.c \
mlcreechede26272008-04-13 23:13:39 +0000378 $(TOP)/src/test_osinst.c \
danielk1977954ce992006-06-15 15:59:19 +0000379 $(TOP)/src/test_schema.c \
drh2d02a672006-01-25 15:55:37 +0000380 $(TOP)/src/test_server.c \
drh4be8b512006-06-13 23:51:34 +0000381 $(TOP)/src/test_tclvar.c \
mlcreech969b2cd2008-03-14 04:11:03 +0000382 $(TOP)/src/test_thread.c
drh376deb12004-06-30 11:41:55 +0000383
384# Header files used by all library source files.
385#
386HDR = \
387 sqlite3.h \
388 $(TOP)/src/btree.h \
drha3152892007-05-05 11:48:52 +0000389 $(TOP)/src/btreeInt.h \
drh376deb12004-06-30 11:41:55 +0000390 $(TOP)/src/hash.h \
shane9bcbdad2008-05-29 20:22:37 +0000391 $(TOP)/src/hwtime.h \
drhc551dd82007-06-19 15:23:48 +0000392 $(TOP)/src/sqliteLimit.h \
drh437b9012007-08-28 16:34:42 +0000393 $(TOP)/src/mutex.h \
drh376deb12004-06-30 11:41:55 +0000394 opcodes.h \
395 $(TOP)/src/os.h \
396 $(TOP)/src/os_common.h \
drh1e397f82006-06-08 15:28:43 +0000397 $(TOP)/src/sqlite3ext.h \
drh376deb12004-06-30 11:41:55 +0000398 $(TOP)/src/sqliteInt.h \
399 $(TOP)/src/vdbe.h \
mlcreecheb6dc142008-03-13 18:28:03 +0000400 $(TOP)/src/vdbeInt.h \
mlcreechb87057f2008-03-06 07:19:20 +0000401 parse.h \
mlcreech23797062008-03-20 02:25:35 +0000402 config.h
drh376deb12004-06-30 11:41:55 +0000403
drh0c979402006-10-03 19:12:32 +0000404# Header files used by extensions
405#
406HDR += \
407 $(TOP)/ext/fts1/fts1.h \
408 $(TOP)/ext/fts1/fts1_hash.h \
409 $(TOP)/ext/fts1/fts1_tokenizer.h
mlcreech47524b82008-03-02 05:40:05 +0000410HDR += \
411 $(TOP)/ext/fts2/fts2.h \
412 $(TOP)/ext/fts2/fts2_hash.h \
413 $(TOP)/ext/fts2/fts2_tokenizer.h
414HDR += \
415 $(TOP)/ext/fts3/fts3.h \
416 $(TOP)/ext/fts3/fts3_hash.h \
417 $(TOP)/ext/fts3/fts3_tokenizer.h
shaneca57b872008-05-28 17:31:17 +0000418HDR += \
419 $(TOP)/ext/rtree/rtree.h
danielk19771c826652008-09-08 08:08:09 +0000420HDR += \
421 $(TOP)/ext/icu/sqliteicu.h
drh0c979402006-10-03 19:12:32 +0000422
mlcreech969b2cd2008-03-14 04:11:03 +0000423# If using the amalgamation, use sqlite3.c directly to build the test
424# fixture. Otherwise link against libsqlite3.la. (This distinction is
425# necessary because the test fixture requires non-API symbols which are
426# hidden when the library is built via the amalgamation).
427#
428TESTFIXTURE_SRC0 = $(TESTSRC2) libsqlite3.la
429TESTFIXTURE_SRC1 = sqlite3.c
430TESTFIXTURE_SRC = $(TESTSRC) $(TOP)/src/tclsqlite.c $(TESTFIXTURE_SRC$(USE_AMALGAMATION))
431
432
drh376deb12004-06-30 11:41:55 +0000433# This is the default Makefile target. The objects listed here
434# are what get build when you type just "make" with no arguments.
435#
drh7b5717e2004-11-25 13:50:01 +0000436all: sqlite3.h libsqlite3.la sqlite3$(TEXE) $(HAVE_TCL:1=libtclsqlite3.la)
drh376deb12004-06-30 11:41:55 +0000437
438Makefile: $(TOP)/Makefile.in
439 ./config.status
440
441# Generate the file "last_change" which contains the date of change
442# of the most recently modified source code file
443#
444last_change: $(SRC)
drh0c07fb92006-06-27 20:05:23 +0000445 cat $(SRC) | grep '$$Id: ' | sort -k 5 | tail -1 \
drhf1878b42006-01-23 18:06:52 +0000446 | $(NAWK) '{print $$5,$$6}' >last_change
drh376deb12004-06-30 11:41:55 +0000447
448libsqlite3.la: $(LIBOBJ)
mlcreech1428b372008-03-13 23:28:22 +0000449 $(LTLINK) -o $@ $(LIBOBJ) $(TLIBS) \
mlcreech289234c2008-03-13 19:55:20 +0000450 ${ALLOWRELEASE} -rpath "$(libdir)" -version-info "8:6:8"
drh376deb12004-06-30 11:41:55 +0000451
452libtclsqlite3.la: tclsqlite.lo libsqlite3.la
mlcreech1428b372008-03-13 23:28:22 +0000453 $(LTLINK) -o $@ tclsqlite.lo \
drh0fcf2372008-07-25 12:49:44 +0000454 libsqlite3.la @TCL_STUB_LIB_SPEC@ $(TLIBS) \
mlcreech289234c2008-03-13 19:55:20 +0000455 -rpath "$(libdir)/sqlite" \
drh376deb12004-06-30 11:41:55 +0000456 -version-info "8:6:8"
457
drhcbd2da92007-12-17 16:20:06 +0000458sqlite3$(TEXE): $(TOP)/src/shell.c libsqlite3.la sqlite3.h
mlcreechc658b0f2008-03-09 02:20:11 +0000459 $(LTLINK) $(READLINE_FLAGS) \
drhc9a67a82007-12-13 18:20:46 +0000460 -o $@ $(TOP)/src/shell.c libsqlite3.la \
mlcreech289234c2008-03-13 19:55:20 +0000461 $(LIBREADLINE) $(TLIBS) -rpath "$(libdir)"
drhc9a67a82007-12-13 18:20:46 +0000462
drh376deb12004-06-30 11:41:55 +0000463# This target creates a directory named "tsrc" and fills it with
464# copies of all of the C source code and header files needed to
465# build on the target system. Some of the C source code and header
466# files are automatically generated. This target takes care of
467# all that automatic generation.
468#
mlcreecheb6dc142008-03-13 18:28:03 +0000469.target_source: $(SRC)
drh376deb12004-06-30 11:41:55 +0000470 rm -rf tsrc
drhd2f397f2004-09-17 20:47:16 +0000471 mkdir -p tsrc
mlcreecheb6dc142008-03-13 18:28:03 +0000472 cp $(SRC) tsrc
drh376deb12004-06-30 11:41:55 +0000473 rm tsrc/sqlite.h.in tsrc/parse.y
mlcreech94984912008-03-04 19:03:08 +0000474 touch .target_source
drh376deb12004-06-30 11:41:55 +0000475
mlcreech94984912008-03-04 19:03:08 +0000476sqlite3.c: .target_source $(TOP)/tool/mksqlite3c.tcl
mlcreechab1c47b2008-03-09 02:51:10 +0000477 $(TCLSH_CMD) $(TOP)/tool/mksqlite3c.tcl
drh93d57532007-04-05 18:34:58 +0000478
drh376deb12004-06-30 11:41:55 +0000479# Rules to build the LEMON compiler generator
480#
drh52fb6d72004-11-03 03:59:57 +0000481lemon$(BEXE): $(TOP)/tool/lemon.c $(TOP)/tool/lempar.c
mlcreech1428b372008-03-13 23:28:22 +0000482 $(BCC) -o $@ $(TOP)/tool/lemon.c
drh376deb12004-06-30 11:41:55 +0000483 cp $(TOP)/tool/lempar.c .
484
485
mlcreech94984912008-03-04 19:03:08 +0000486# Rule to build the amalgamation
487#
488sqlite3.lo: sqlite3.c
mlcreech88ef0902008-03-19 23:15:37 +0000489 $(LTCOMPILE) -c sqlite3.c
mlcreech94984912008-03-04 19:03:08 +0000490
drh376deb12004-06-30 11:41:55 +0000491# Rules to build individual files
492#
drhd0e4a6c2005-02-15 20:47:57 +0000493alter.lo: $(TOP)/src/alter.c $(HDR)
494 $(LTCOMPILE) -c $(TOP)/src/alter.c
495
drh9f18e8a2005-07-08 12:13:04 +0000496analyze.lo: $(TOP)/src/analyze.c $(HDR)
497 $(LTCOMPILE) -c $(TOP)/src/analyze.c
498
drh376deb12004-06-30 11:41:55 +0000499attach.lo: $(TOP)/src/attach.c $(HDR)
500 $(LTCOMPILE) -c $(TOP)/src/attach.c
501
502auth.lo: $(TOP)/src/auth.c $(HDR)
503 $(LTCOMPILE) -c $(TOP)/src/auth.c
504
mlcreech5b9d8672008-02-27 03:22:49 +0000505bitvec.lo: $(TOP)/src/bitvec.c $(HDR)
506 $(LTCOMPILE) -c $(TOP)/src/bitvec.c
507
drh900b31e2007-08-28 02:27:51 +0000508btmutex.lo: $(TOP)/src/btmutex.c $(HDR)
509 $(LTCOMPILE) -c $(TOP)/src/btmutex.c
510
drh376deb12004-06-30 11:41:55 +0000511btree.lo: $(TOP)/src/btree.c $(HDR) $(TOP)/src/pager.h
512 $(LTCOMPILE) -c $(TOP)/src/btree.c
513
514build.lo: $(TOP)/src/build.c $(HDR)
515 $(LTCOMPILE) -c $(TOP)/src/build.c
516
danielk1977fd9a0a42005-05-24 12:01:00 +0000517callback.lo: $(TOP)/src/callback.c $(HDR)
518 $(LTCOMPILE) -c $(TOP)/src/callback.c
519
drha2b902d2005-08-14 17:53:20 +0000520complete.lo: $(TOP)/src/complete.c $(HDR)
521 $(LTCOMPILE) -c $(TOP)/src/complete.c
522
drh376deb12004-06-30 11:41:55 +0000523date.lo: $(TOP)/src/date.c $(HDR)
524 $(LTCOMPILE) -c $(TOP)/src/date.c
525
526delete.lo: $(TOP)/src/delete.c $(HDR)
527 $(LTCOMPILE) -c $(TOP)/src/delete.c
528
drh376deb12004-06-30 11:41:55 +0000529expr.lo: $(TOP)/src/expr.c $(HDR)
530 $(LTCOMPILE) -c $(TOP)/src/expr.c
531
drh643167f2008-01-22 21:30:53 +0000532fault.lo: $(TOP)/src/fault.c $(HDR)
533 $(LTCOMPILE) -c $(TOP)/src/fault.c
534
drh70a8ca32008-08-21 18:49:27 +0000535func.lo: $(TOP)/src/func.c $(HDR)
536 $(LTCOMPILE) -c $(TOP)/src/func.c
drh376deb12004-06-30 11:41:55 +0000537
drh40257ff2008-06-13 18:24:27 +0000538global.lo: $(TOP)/src/global.c $(HDR)
539 $(LTCOMPILE) -c $(TOP)/src/global.c
540
drh376deb12004-06-30 11:41:55 +0000541hash.lo: $(TOP)/src/hash.c $(HDR)
542 $(LTCOMPILE) -c $(TOP)/src/hash.c
543
544insert.lo: $(TOP)/src/insert.c $(HDR)
545 $(LTCOMPILE) -c $(TOP)/src/insert.c
546
drh4bfc8a92007-08-27 23:38:43 +0000547journal.lo: $(TOP)/src/journal.c $(HDR)
548 $(LTCOMPILE) -c $(TOP)/src/journal.c
549
drh376deb12004-06-30 11:41:55 +0000550legacy.lo: $(TOP)/src/legacy.c $(HDR)
551 $(LTCOMPILE) -c $(TOP)/src/legacy.c
552
drh1e397f82006-06-08 15:28:43 +0000553loadext.lo: $(TOP)/src/loadext.c $(HDR)
554 $(LTCOMPILE) -c $(TOP)/src/loadext.c
555
drh376deb12004-06-30 11:41:55 +0000556main.lo: $(TOP)/src/main.c $(HDR)
557 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/main.c
558
drha3152892007-05-05 11:48:52 +0000559malloc.lo: $(TOP)/src/malloc.c $(HDR)
560 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/malloc.c
561
drhd1370b62008-10-28 18:58:20 +0000562mem0.lo: $(TOP)/src/mem0.c $(HDR)
563 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem0.c
564
drh4bfc8a92007-08-27 23:38:43 +0000565mem1.lo: $(TOP)/src/mem1.c $(HDR)
566 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem1.c
567
568mem2.lo: $(TOP)/src/mem2.c $(HDR)
569 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem2.c
570
drh9c7a60d2007-10-19 17:47:24 +0000571mem3.lo: $(TOP)/src/mem3.c $(HDR)
572 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem3.c
573
mlcreechfcfe27d2008-03-02 05:34:10 +0000574mem5.lo: $(TOP)/src/mem5.c $(HDR)
575 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem5.c
576
danielk19776553c5c2008-10-21 04:30:31 +0000577memjournal.lo: $(TOP)/src/memjournal.c $(HDR)
578 $(LTCOMPILE) -c $(TOP)/src/memjournal.c
579
drh4bfc8a92007-08-27 23:38:43 +0000580mutex.lo: $(TOP)/src/mutex.c $(HDR)
581 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex.c
582
drh18472fa2008-10-07 15:25:48 +0000583mutex_noop.lo: $(TOP)/src/mutex_noop.c $(HDR)
584 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex_noop.c
585
drh437b9012007-08-28 16:34:42 +0000586mutex_os2.lo: $(TOP)/src/mutex_os2.c $(HDR)
587 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex_os2.c
588
589mutex_unix.lo: $(TOP)/src/mutex_unix.c $(HDR)
590 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex_unix.c
591
592mutex_w32.lo: $(TOP)/src/mutex_w32.c $(HDR)
593 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex_w32.c
594
drh376deb12004-06-30 11:41:55 +0000595pager.lo: $(TOP)/src/pager.c $(HDR) $(TOP)/src/pager.h
596 $(LTCOMPILE) -c $(TOP)/src/pager.c
597
danielk19778c0a7912008-08-20 14:49:23 +0000598pcache.lo: $(TOP)/src/pcache.c $(HDR) $(TOP)/src/pcache.h
599 $(LTCOMPILE) -c $(TOP)/src/pcache.c
600
danielk1977bc2ca9e2008-11-13 14:28:28 +0000601pcache1.lo: $(TOP)/src/pcache1.c $(HDR) $(TOP)/src/pcache.h
602 $(LTCOMPILE) -c $(TOP)/src/pcache1.c
603
drh376deb12004-06-30 11:41:55 +0000604opcodes.lo: opcodes.c
605 $(LTCOMPILE) -c opcodes.c
606
drhb327f772004-10-06 15:03:57 +0000607opcodes.c: opcodes.h $(TOP)/mkopcodec.awk
drh0c07fb92006-06-27 20:05:23 +0000608 sort -n -b -k 3 opcodes.h | $(NAWK) -f $(TOP)/mkopcodec.awk >opcodes.c
drh376deb12004-06-30 11:41:55 +0000609
drhf2bc0132004-10-04 13:19:23 +0000610opcodes.h: parse.h $(TOP)/src/vdbe.c $(TOP)/mkopcodeh.awk
drhf1878b42006-01-23 18:06:52 +0000611 cat parse.h $(TOP)/src/vdbe.c | $(NAWK) -f $(TOP)/mkopcodeh.awk >opcodes.h
drh376deb12004-06-30 11:41:55 +0000612
drh054889e2005-11-30 03:20:31 +0000613os.lo: $(TOP)/src/os.c $(HDR)
614 $(LTCOMPILE) -c $(TOP)/src/os.c
615
drh376deb12004-06-30 11:41:55 +0000616os_unix.lo: $(TOP)/src/os_unix.c $(HDR)
drhcf5f58f2005-06-16 18:47:38 +0000617 $(LTCOMPILE) -c $(TOP)/src/os_unix.c
drh376deb12004-06-30 11:41:55 +0000618
619os_win.lo: $(TOP)/src/os_win.c $(HDR)
drhcf5f58f2005-06-16 18:47:38 +0000620 $(LTCOMPILE) -c $(TOP)/src/os_win.c
drh376deb12004-06-30 11:41:55 +0000621
drh60a1e4b2006-06-03 18:02:15 +0000622os_os2.lo: $(TOP)/src/os_os2.c $(HDR)
623 $(LTCOMPILE) -c $(TOP)/src/os_os2.c
624
drh376deb12004-06-30 11:41:55 +0000625parse.lo: parse.c $(HDR)
626 $(LTCOMPILE) -c parse.c
627
628parse.h: parse.c
629
drhfa3b19e2005-11-24 22:22:29 +0000630parse.c: $(TOP)/src/parse.y lemon$(BEXE) $(TOP)/addopcodes.awk
drh376deb12004-06-30 11:41:55 +0000631 cp $(TOP)/src/parse.y .
shaneb1cd7302008-10-22 18:27:31 +0000632 ./lemon$(BEXE) $(OPT_FEATURE_FLAGS) $(OPTS) parse.y
drhfa3b19e2005-11-24 22:22:29 +0000633 mv parse.h parse.h.temp
drhd3067e82007-06-20 16:20:36 +0000634 $(NAWK) -f $(TOP)/addopcodes.awk parse.h.temp >parse.h
drh376deb12004-06-30 11:41:55 +0000635
636pragma.lo: $(TOP)/src/pragma.c $(HDR)
drh7b5717e2004-11-25 13:50:01 +0000637 $(LTCOMPILE) -c $(TOP)/src/pragma.c
drh376deb12004-06-30 11:41:55 +0000638
danielk1977fa256a32005-05-25 04:11:56 +0000639prepare.lo: $(TOP)/src/prepare.c $(HDR)
640 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/prepare.c
641
drh376deb12004-06-30 11:41:55 +0000642printf.lo: $(TOP)/src/printf.c $(HDR)
drh7b5717e2004-11-25 13:50:01 +0000643 $(LTCOMPILE) -c $(TOP)/src/printf.c
drh376deb12004-06-30 11:41:55 +0000644
645random.lo: $(TOP)/src/random.c $(HDR)
646 $(LTCOMPILE) -c $(TOP)/src/random.c
647
drh7d10d5a2008-08-20 16:35:10 +0000648resolve.lo: $(TOP)/src/resolve.c $(HDR)
649 $(LTCOMPILE) -c $(TOP)/src/resolve.c
650
drh376deb12004-06-30 11:41:55 +0000651select.lo: $(TOP)/src/select.c $(HDR)
652 $(LTCOMPILE) -c $(TOP)/src/select.c
653
drhf7141992008-06-19 00:16:08 +0000654status.lo: $(TOP)/src/status.c $(HDR)
655 $(LTCOMPILE) -c $(TOP)/src/status.c
656
drh376deb12004-06-30 11:41:55 +0000657sqlite3.h: $(TOP)/src/sqlite.h.in
danielk197799ba19e2005-02-05 07:33:34 +0000658 sed -e s/--VERS--/$(RELEASE)/ $(TOP)/src/sqlite.h.in | \
659 sed -e s/--VERSION-NUMBER--/$(VERSION_NUMBER)/ >sqlite3.h
drh376deb12004-06-30 11:41:55 +0000660
661table.lo: $(TOP)/src/table.c $(HDR)
662 $(LTCOMPILE) -c $(TOP)/src/table.c
663
664tclsqlite.lo: $(TOP)/src/tclsqlite.c $(HDR)
drha17378c2008-07-25 12:39:23 +0000665 $(LTCOMPILE) -DUSE_TCL_STUBS=1 -c $(TOP)/src/tclsqlite.c
drh376deb12004-06-30 11:41:55 +0000666
drh73b211a2005-01-18 04:00:42 +0000667tokenize.lo: $(TOP)/src/tokenize.c keywordhash.h $(HDR)
drh376deb12004-06-30 11:41:55 +0000668 $(LTCOMPILE) -c $(TOP)/src/tokenize.c
669
drh73b211a2005-01-18 04:00:42 +0000670keywordhash.h: $(TOP)/tool/mkkeywordhash.c
shaneb1cd7302008-10-22 18:27:31 +0000671 $(BCC) -o mkkeywordhash$(BEXE) $(OPT_FEATURE_FLAGS) $(OPTS) $(TOP)/tool/mkkeywordhash.c
drh73b211a2005-01-18 04:00:42 +0000672 ./mkkeywordhash$(BEXE) >keywordhash.h
drh52fb6d72004-11-03 03:59:57 +0000673
drh376deb12004-06-30 11:41:55 +0000674trigger.lo: $(TOP)/src/trigger.c $(HDR)
675 $(LTCOMPILE) -c $(TOP)/src/trigger.c
676
677update.lo: $(TOP)/src/update.c $(HDR)
678 $(LTCOMPILE) -c $(TOP)/src/update.c
679
680utf.lo: $(TOP)/src/utf.c $(HDR)
681 $(LTCOMPILE) -c $(TOP)/src/utf.c
682
683util.lo: $(TOP)/src/util.c $(HDR)
684 $(LTCOMPILE) -c $(TOP)/src/util.c
685
686vacuum.lo: $(TOP)/src/vacuum.c $(HDR)
687 $(LTCOMPILE) -c $(TOP)/src/vacuum.c
688
mlcreecheb6dc142008-03-13 18:28:03 +0000689vdbe.lo: $(TOP)/src/vdbe.c $(HDR)
drh376deb12004-06-30 11:41:55 +0000690 $(LTCOMPILE) -c $(TOP)/src/vdbe.c
691
mlcreecheb6dc142008-03-13 18:28:03 +0000692vdbeapi.lo: $(TOP)/src/vdbeapi.c $(HDR)
drh376deb12004-06-30 11:41:55 +0000693 $(LTCOMPILE) -c $(TOP)/src/vdbeapi.c
694
mlcreecheb6dc142008-03-13 18:28:03 +0000695vdbeaux.lo: $(TOP)/src/vdbeaux.c $(HDR)
drh376deb12004-06-30 11:41:55 +0000696 $(LTCOMPILE) -c $(TOP)/src/vdbeaux.c
697
mlcreecheb6dc142008-03-13 18:28:03 +0000698vdbeblob.lo: $(TOP)/src/vdbeblob.c $(HDR)
danielk19776338c762007-05-17 16:38:30 +0000699 $(LTCOMPILE) -c $(TOP)/src/vdbeblob.c
700
mlcreecheb6dc142008-03-13 18:28:03 +0000701vdbefifo.lo: $(TOP)/src/vdbefifo.c $(HDR)
drha01f79d2005-07-08 13:07:59 +0000702 $(LTCOMPILE) -c $(TOP)/src/vdbefifo.c
703
mlcreecheb6dc142008-03-13 18:28:03 +0000704vdbemem.lo: $(TOP)/src/vdbemem.c $(HDR)
drh376deb12004-06-30 11:41:55 +0000705 $(LTCOMPILE) -c $(TOP)/src/vdbemem.c
706
mlcreecheb6dc142008-03-13 18:28:03 +0000707vtab.lo: $(TOP)/src/vtab.c $(HDR)
drhb9bb7c12006-06-11 23:41:55 +0000708 $(LTCOMPILE) -c $(TOP)/src/vtab.c
709
drh7d10d5a2008-08-20 16:35:10 +0000710walker.lo: $(TOP)/src/walker.c $(HDR)
711 $(LTCOMPILE) -c $(TOP)/src/walker.c
712
drh376deb12004-06-30 11:41:55 +0000713where.lo: $(TOP)/src/where.c $(HDR)
714 $(LTCOMPILE) -c $(TOP)/src/where.c
715
drh7b5717e2004-11-25 13:50:01 +0000716tclsqlite-shell.lo: $(TOP)/src/tclsqlite.c $(HDR)
717 $(LTCOMPILE) -DTCLSH=1 -o $@ -c $(TOP)/src/tclsqlite.c
drh376deb12004-06-30 11:41:55 +0000718
drh7b5717e2004-11-25 13:50:01 +0000719tclsqlite-stubs.lo: $(TOP)/src/tclsqlite.c $(HDR)
720 $(LTCOMPILE) -DTCL_USE_STUBS=1 -o $@ -c $(TOP)/src/tclsqlite.c
721
mlcreech1428b372008-03-13 23:28:22 +0000722tclsqlite3$(TEXE): tclsqlite-shell.lo libsqlite3.la
723 $(LTLINK) -o $@ tclsqlite-shell.lo \
drh376deb12004-06-30 11:41:55 +0000724 libsqlite3.la $(LIBTCL)
725
mlcreech969b2cd2008-03-14 04:11:03 +0000726testfixture$(TEXE): $(TESTFIXTURE_SRC)
drh866108f2008-05-13 00:57:21 +0000727 $(LTLINK) -DTCLSH=1 -DSQLITE_TEST=1 -DSQLITE_NO_SYNC=1\
728 -DSQLITE_CRASH_TEST=1 \
mlcreech969b2cd2008-03-14 04:11:03 +0000729 -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE $(TEMP_STORE) \
drh866108f2008-05-13 00:57:21 +0000730 -o $@ $(TESTFIXTURE_SRC) $(LIBTCL) $(TLIBS)
drh376deb12004-06-30 11:41:55 +0000731
drh376deb12004-06-30 11:41:55 +0000732
drh9c06c952005-11-26 00:25:00 +0000733fulltest: testfixture$(TEXE) sqlite3$(TEXE)
mlcreech1428b372008-03-13 23:28:22 +0000734 ./testfixture$(TEXE) $(TOP)/test/all.test
drh376deb12004-06-30 11:41:55 +0000735
drh7b5717e2004-11-25 13:50:01 +0000736test: testfixture$(TEXE) sqlite3$(TEXE)
danielk1977ff3c8982008-06-25 17:54:53 +0000737 ./testfixture$(TEXE) $(TOP)/test/veryquick.test
drh376deb12004-06-30 11:41:55 +0000738
mlcreech969b2cd2008-03-14 04:11:03 +0000739sqlite3_analyzer$(TEXE): $(TESTFIXTURE_SRC) $(TOP)/tool/spaceanal.tcl
drh61212b62004-12-02 20:17:00 +0000740 sed \
741 -e '/^#/d' \
742 -e 's,\\,\\\\,g' \
743 -e 's,",\\",g' \
744 -e 's,^,",' \
745 -e 's,$$,\\n",' \
746 $(TOP)/tool/spaceanal.tcl >spaceanal_tcl.h
mlcreech969b2cd2008-03-14 04:11:03 +0000747 $(LTLINK) -DTCLSH=2 -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1 \
748 -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE \
749 $(TEMP_STORE) -o $@ $(TESTFIXTURE_SRC) $(LIBTCL)
drh376deb12004-06-30 11:41:55 +0000750
drh376deb12004-06-30 11:41:55 +0000751
drhafbd06b2007-12-01 09:32:53 +0000752install: sqlite3$(BEXE) libsqlite3.la sqlite3.h ${HAVE_TCL:1=tcl_install}
drh8d45ec02004-09-17 21:07:34 +0000753 $(INSTALL) -d $(DESTDIR)$(libdir)
754 $(LTINSTALL) libsqlite3.la $(DESTDIR)$(libdir)
mlcreechc55771f2008-03-06 08:09:12 +0000755 $(INSTALL) -d $(DESTDIR)$(bindir)
756 $(LTINSTALL) sqlite3$(BEXE) $(DESTDIR)$(bindir)
757 $(INSTALL) -d $(DESTDIR)$(includedir)
758 $(INSTALL) -m 0644 sqlite3.h $(DESTDIR)$(includedir)
759 $(INSTALL) -m 0644 $(TOP)/src/sqlite3ext.h $(DESTDIR)$(includedir)
danielk197794bdf892008-08-04 04:28:18 +0000760 $(INSTALL) -d $(DESTDIR)$(pkgconfigdir)
761 $(INSTALL) -m 0644 sqlite3.pc $(DESTDIR)$(pkgconfigdir)
drh376deb12004-06-30 11:41:55 +0000762
drh4b2266a2004-11-27 15:52:16 +0000763tcl_install: libtclsqlite3.la
drh3e59c012008-09-23 10:12:13 +0000764 $(TCLSH_CMD) $(TOP)/tclinstaller.tcl $(RELEASE)
drh4b2266a2004-11-27 15:52:16 +0000765
drh376deb12004-06-30 11:41:55 +0000766clean:
drh7b5717e2004-11-25 13:50:01 +0000767 rm -f *.lo *.la *.o sqlite3$(TEXE) libsqlite3.la
drh376deb12004-06-30 11:41:55 +0000768 rm -f sqlite3.h opcodes.*
mlcreechae28e672008-03-06 09:03:20 +0000769 rm -rf .libs .deps tsrc
drh52fb6d72004-11-03 03:59:57 +0000770 rm -f lemon$(BEXE) lempar.c parse.* sqlite*.tar.gz
drh73b211a2005-01-18 04:00:42 +0000771 rm -f mkkeywordhash$(BEXE) keywordhash.h
drh376deb12004-06-30 11:41:55 +0000772 rm -f $(PUBLISH)
773 rm -f *.da *.bb *.bbg gmon.out
drh7b5717e2004-11-25 13:50:01 +0000774 rm -f testfixture$(TEXE) test.db
drh376deb12004-06-30 11:41:55 +0000775 rm -f common.tcl
drh79dc6692006-09-02 22:14:11 +0000776 rm -f sqlite3.dll sqlite3.lib sqlite3.def
mlcreechae28e672008-03-06 09:03:20 +0000777 rm -f sqlite3.c .target_source
drh376deb12004-06-30 11:41:55 +0000778
drh376deb12004-06-30 11:41:55 +0000779distclean: clean
mlcreechb87057f2008-03-06 07:19:20 +0000780 rm -f config.log config.status libtool Makefile sqlite3.pc
drh79dc6692006-09-02 22:14:11 +0000781
782#
783# Windows section
784#
785dll: sqlite3.dll
786
787REAL_LIBOBJ = $(LIBOBJ:%.lo=.libs/%.o)
788
789$(REAL_LIBOBJ): $(LIBOBJ)
790
791sqlite3.def: $(REAL_LIBOBJ)
792 echo 'EXPORTS' >sqlite3.def
793 nm $(REAL_LIBOBJ) | grep ' T ' | grep ' _sqlite3_' \
794 | sed 's/^.* _//' >>sqlite3.def
795
796sqlite3.dll: $(REAL_LIBOBJ) sqlite3.def
mlcreech1428b372008-03-13 23:28:22 +0000797 $(TCC) -shared -o $@ sqlite3.def \
drh79dc6692006-09-02 22:14:11 +0000798 -Wl,"--strip-all" $(REAL_LIBOBJ)