blob: 26ada6818d71f73d8b7221267108aea40e4499a5 [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#
tpoindex9d9f76c2005-01-03 21:28:56 +000029TCC = @TARGET_CC@ @TARGET_CFLAGS@ -I. -I${TOP}/src
30
31# Define -DNDEBUG to compile without debugging (i.e., for production usage)
32# Omitting the define will cause extra debugging code to be inserted and
33# includes extra comments when "EXPLAIN stmt" is used.
34#
drh91636d52005-11-24 23:14:00 +000035TCC += @TARGET_DEBUG@ @XTHREADCONNECT@
drh376deb12004-06-30 11:41:55 +000036
drh376deb12004-06-30 11:41:55 +000037# Compiler options needed for programs that use the TCL library.
38#
drh93468362004-12-10 03:08:12 +000039TCC += @TCL_INCLUDE_SPEC@
drh376deb12004-06-30 11:41:55 +000040
41# The library that programs using TCL must link against.
42#
drh7b5717e2004-11-25 13:50:01 +000043LIBTCL = @TCL_LIB_SPEC@ @TCL_LIBS@
drh376deb12004-06-30 11:41:55 +000044
45# Compiler options needed for programs that use the readline() library.
46#
47READLINE_FLAGS = -DHAVE_READLINE=@TARGET_HAVE_READLINE@ @TARGET_READLINE_INC@
48
49# The library that programs using readline() must link against.
50#
51LIBREADLINE = @TARGET_READLINE_LIBS@
52
53# Should the database engine be compiled threadsafe
54#
drh65d415c2005-08-24 18:04:51 +000055TCC += -DTHREADSAFE=@THREADSAFE@
drh376deb12004-06-30 11:41:55 +000056
dougcurrie65623c72004-09-20 14:57:23 +000057# The pthreads library if needed
58#
59LIBPTHREAD=@TARGET_THREAD_LIB@
60
drh8e2e2a12006-02-01 01:55:17 +000061# Do threads override each others locks by default (1), or do we test (-1)
62#
63TCC += -DSQLITE_THREAD_OVERRIDE_LOCK=@THREADSOVERRIDELOCKS@
64
drhf1878b42006-01-23 18:06:52 +000065# The fdatasync library
66TLIBS = @TARGET_LIBS@
67
drh376deb12004-06-30 11:41:55 +000068# Flags controlling use of the in memory btree implementation
69#
70# TEMP_STORE is 0 to force temporary tables to be in a file, 1 to
71# default to file, 2 to default to memory, and 3 to force temporary
72# tables to always be in memory.
73#
74TEMP_STORE = -DTEMP_STORE=@TEMP_STORE@
75
drh4b2266a2004-11-27 15:52:16 +000076# Version numbers and release number for the SQLite being compiled.
77#
78VERSION = @VERSION@
danielk197799ba19e2005-02-05 07:33:34 +000079VERSION_NUMBER = @VERSION_NUMBER@
drh4b2266a2004-11-27 15:52:16 +000080RELEASE = @RELEASE@
81
drh7b5717e2004-11-25 13:50:01 +000082# Filename extensions
83#
84BEXE = @BUILD_EXEEXT@
85TEXE = @TARGET_EXEEXT@
86
drh4b2266a2004-11-27 15:52:16 +000087# The following variable is "1" if the configure script was able to locate
88# the tclConfig.sh file. It is an empty string otherwise. When this
89# variable is "1", the TCL extension library (libtclsqlite3.so) is built
90# and installed.
drh7b5717e2004-11-25 13:50:01 +000091#
92HAVE_TCL = @HAVE_TCL@
93
drh4b2266a2004-11-27 15:52:16 +000094# The suffix used on shared libraries. Ex: ".dll", ".so", ".dylib"
95#
96SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@
97
98# The directory into which to store package information for
99
100# Some standard variables and programs
101#
102prefix = @prefix@
103exec_prefix = @exec_prefix@
104libdir = @libdir@
105INSTALL = @INSTALL@
106LIBTOOL = ./libtool
107ALLOWRELEASE = @ALLOWRELEASE@
108
109# libtool compile/link/install
110LTCOMPILE = $(LIBTOOL) --mode=compile $(TCC)
111LTLINK = $(LIBTOOL) --mode=link $(TCC)
112LTINSTALL = $(LIBTOOL) --mode=install $(INSTALL)
113
drhf1878b42006-01-23 18:06:52 +0000114# nawk compatible awk.
115NAWK = @AWK@
116
drh376deb12004-06-30 11:41:55 +0000117# You should not have to change anything below this line
118###############################################################################
drh91636d52005-11-24 23:14:00 +0000119OPTS =
drh4b2266a2004-11-27 15:52:16 +0000120OPTS += -DSQLITE_OMIT_CURSOR # Cursors do not work at this time
121TCC += -DSQLITE_OMIT_CURSOR
122
drh376deb12004-06-30 11:41:55 +0000123# Object files for the SQLite library.
124#
drh9f18e8a2005-07-08 12:13:04 +0000125LIBOBJ = alter.lo analyze.lo attach.lo auth.lo btree.lo build.lo \
drha2b902d2005-08-14 17:53:20 +0000126 callback.lo complete.lo date.lo \
drh1e397f82006-06-08 15:28:43 +0000127 delete.lo expr.lo func.lo hash.lo insert.lo loadext.lo \
drh60a1e4b2006-06-03 18:02:15 +0000128 main.lo opcodes.lo os.lo os_unix.lo os_win.lo os_os2.lo \
danielk1977fa256a32005-05-25 04:11:56 +0000129 pager.lo parse.lo pragma.lo prepare.lo printf.lo random.lo \
drh7b5717e2004-11-25 13:50:01 +0000130 select.lo table.lo tokenize.lo trigger.lo update.lo \
drha01f79d2005-07-08 13:07:59 +0000131 util.lo vacuum.lo \
132 vdbe.lo vdbeapi.lo vdbeaux.lo vdbefifo.lo vdbemem.lo \
drhb9bb7c12006-06-11 23:41:55 +0000133 where.lo utf.lo legacy.lo vtab.lo
drh376deb12004-06-30 11:41:55 +0000134
135# All of the source code files.
136#
137SRC = \
drhd0e4a6c2005-02-15 20:47:57 +0000138 $(TOP)/src/alter.c \
drh9f18e8a2005-07-08 12:13:04 +0000139 $(TOP)/src/analyze.c \
drh376deb12004-06-30 11:41:55 +0000140 $(TOP)/src/attach.c \
141 $(TOP)/src/auth.c \
142 $(TOP)/src/btree.c \
143 $(TOP)/src/btree.h \
144 $(TOP)/src/build.c \
danielk1977fd9a0a42005-05-24 12:01:00 +0000145 $(TOP)/src/callback.c \
drha2b902d2005-08-14 17:53:20 +0000146 $(TOP)/src/complete.c \
drh376deb12004-06-30 11:41:55 +0000147 $(TOP)/src/date.c \
148 $(TOP)/src/delete.c \
drh376deb12004-06-30 11:41:55 +0000149 $(TOP)/src/expr.c \
150 $(TOP)/src/func.c \
151 $(TOP)/src/hash.c \
152 $(TOP)/src/hash.h \
153 $(TOP)/src/insert.c \
154 $(TOP)/src/legacy.c \
drh1e397f82006-06-08 15:28:43 +0000155 $(TOP)/src/loadext.c \
drh376deb12004-06-30 11:41:55 +0000156 $(TOP)/src/main.c \
drh054889e2005-11-30 03:20:31 +0000157 $(TOP)/src/os.c \
drh376deb12004-06-30 11:41:55 +0000158 $(TOP)/src/os_unix.c \
159 $(TOP)/src/os_win.c \
drh60a1e4b2006-06-03 18:02:15 +0000160 $(TOP)/src/os_os2.c \
drh376deb12004-06-30 11:41:55 +0000161 $(TOP)/src/pager.c \
162 $(TOP)/src/pager.h \
163 $(TOP)/src/parse.y \
164 $(TOP)/src/pragma.c \
danielk1977fa256a32005-05-25 04:11:56 +0000165 $(TOP)/src/prepare.c \
drh376deb12004-06-30 11:41:55 +0000166 $(TOP)/src/printf.c \
167 $(TOP)/src/random.c \
168 $(TOP)/src/select.c \
169 $(TOP)/src/shell.c \
170 $(TOP)/src/sqlite.h.in \
171 $(TOP)/src/sqliteInt.h \
172 $(TOP)/src/table.c \
173 $(TOP)/src/tclsqlite.c \
174 $(TOP)/src/tokenize.c \
175 $(TOP)/src/trigger.c \
176 $(TOP)/src/utf.c \
177 $(TOP)/src/update.c \
178 $(TOP)/src/util.c \
179 $(TOP)/src/vacuum.c \
180 $(TOP)/src/vdbe.c \
181 $(TOP)/src/vdbe.h \
182 $(TOP)/src/vdbeapi.c \
183 $(TOP)/src/vdbeaux.c \
drha01f79d2005-07-08 13:07:59 +0000184 $(TOP)/src/vdbefifo.c \
drh376deb12004-06-30 11:41:55 +0000185 $(TOP)/src/vdbemem.c \
186 $(TOP)/src/vdbeInt.h \
drhb9bb7c12006-06-11 23:41:55 +0000187 $(TOP)/src/vtab.c \
drh376deb12004-06-30 11:41:55 +0000188 $(TOP)/src/where.c
189
190# Source code to the test files.
191#
192TESTSRC = \
193 $(TOP)/src/btree.c \
drh6c626082004-11-14 21:56:29 +0000194 $(TOP)/src/date.c \
drh376deb12004-06-30 11:41:55 +0000195 $(TOP)/src/func.c \
drh8e2e2a12006-02-01 01:55:17 +0000196 $(TOP)/src/os.c \
drh376deb12004-06-30 11:41:55 +0000197 $(TOP)/src/os_unix.c \
198 $(TOP)/src/os_win.c \
drh60a1e4b2006-06-03 18:02:15 +0000199 $(TOP)/src/os_os2.c \
drh376deb12004-06-30 11:41:55 +0000200 $(TOP)/src/pager.c \
201 $(TOP)/src/pragma.c \
202 $(TOP)/src/printf.c \
203 $(TOP)/src/test1.c \
204 $(TOP)/src/test2.c \
205 $(TOP)/src/test3.c \
206 $(TOP)/src/test4.c \
207 $(TOP)/src/test5.c \
drh9c06c952005-11-26 00:25:00 +0000208 $(TOP)/src/test6.c \
drh7910e762006-01-09 23:50:11 +0000209 $(TOP)/src/test7.c \
drhb9bb7c12006-06-11 23:41:55 +0000210 $(TOP)/src/test8.c \
drh7910e762006-01-09 23:50:11 +0000211 $(TOP)/src/test_async.c \
drh2d02a672006-01-25 15:55:37 +0000212 $(TOP)/src/test_md5.c \
213 $(TOP)/src/test_server.c \
drh376deb12004-06-30 11:41:55 +0000214 $(TOP)/src/utf.c \
drhed6b3eb2004-09-08 21:12:50 +0000215 $(TOP)/src/util.c \
drh376deb12004-06-30 11:41:55 +0000216 $(TOP)/src/vdbe.c \
drha2b902d2005-08-14 17:53:20 +0000217 $(TOP)/src/where.c
drh376deb12004-06-30 11:41:55 +0000218
219# Header files used by all library source files.
220#
221HDR = \
222 sqlite3.h \
223 $(TOP)/src/btree.h \
drh376deb12004-06-30 11:41:55 +0000224 $(TOP)/src/hash.h \
225 opcodes.h \
226 $(TOP)/src/os.h \
227 $(TOP)/src/os_common.h \
drh1e397f82006-06-08 15:28:43 +0000228 $(TOP)/src/sqlite3ext.h \
drh376deb12004-06-30 11:41:55 +0000229 $(TOP)/src/sqliteInt.h \
230 $(TOP)/src/vdbe.h \
231 parse.h
232
233# Header files used by the VDBE submodule
234#
235VDBEHDR = \
236 $(HDR) \
237 $(TOP)/src/vdbeInt.h
238
239# This is the default Makefile target. The objects listed here
240# are what get build when you type just "make" with no arguments.
241#
drh7b5717e2004-11-25 13:50:01 +0000242all: sqlite3.h libsqlite3.la sqlite3$(TEXE) $(HAVE_TCL:1=libtclsqlite3.la)
drh376deb12004-06-30 11:41:55 +0000243
244Makefile: $(TOP)/Makefile.in
245 ./config.status
246
247# Generate the file "last_change" which contains the date of change
248# of the most recently modified source code file
249#
250last_change: $(SRC)
251 cat $(SRC) | grep '$$Id: ' | sort +4 | tail -1 \
drhf1878b42006-01-23 18:06:52 +0000252 | $(NAWK) '{print $$5,$$6}' >last_change
drh376deb12004-06-30 11:41:55 +0000253
254libsqlite3.la: $(LIBOBJ)
drhcc01bc02004-09-17 21:35:30 +0000255 $(LTLINK) -o libsqlite3.la $(LIBOBJ) $(LIBPTHREAD) \
drh4b2266a2004-11-27 15:52:16 +0000256 ${ALLOWRELEASE} -rpath $(libdir) -version-info "8:6:8"
drh376deb12004-06-30 11:41:55 +0000257
258libtclsqlite3.la: tclsqlite.lo libsqlite3.la
259 $(LTLINK) -o libtclsqlite3.la tclsqlite.lo \
drh4b2266a2004-11-27 15:52:16 +0000260 $(LIBOBJ) @TCL_STUB_LIB_SPEC@ $(LIBPTHREAD) \
drh7b5717e2004-11-25 13:50:01 +0000261 -rpath $(libdir)/sqlite \
drh376deb12004-06-30 11:41:55 +0000262 -version-info "8:6:8"
263
drh7b5717e2004-11-25 13:50:01 +0000264sqlite3$(TEXE): $(TOP)/src/shell.c libsqlite3.la sqlite3.h
drhcc01bc02004-09-17 21:35:30 +0000265 $(LTLINK) $(READLINE_FLAGS) $(LIBPTHREAD) \
drh60a1e4b2006-06-03 18:02:15 +0000266 -o $@ $(TOP)/src/shell.c libsqlite3.la \
drhf1878b42006-01-23 18:06:52 +0000267 $(LIBREADLINE) $(TLIBS)
drh376deb12004-06-30 11:41:55 +0000268
269# This target creates a directory named "tsrc" and fills it with
270# copies of all of the C source code and header files needed to
271# build on the target system. Some of the C source code and header
272# files are automatically generated. This target takes care of
273# all that automatic generation.
274#
drh73b211a2005-01-18 04:00:42 +0000275target_source: $(SRC) parse.c opcodes.c keywordhash.h $(VDBEHDR)
drh376deb12004-06-30 11:41:55 +0000276 rm -rf tsrc
drhd2f397f2004-09-17 20:47:16 +0000277 mkdir -p tsrc
drh376deb12004-06-30 11:41:55 +0000278 cp $(SRC) $(VDBEHDR) tsrc
279 rm tsrc/sqlite.h.in tsrc/parse.y
drh73b211a2005-01-18 04:00:42 +0000280 cp parse.c opcodes.c keywordhash.h tsrc
drh4aec8b62004-08-28 16:19:00 +0000281 cp $(TOP)/sqlite3.def tsrc
drh376deb12004-06-30 11:41:55 +0000282
283# Rules to build the LEMON compiler generator
284#
drh52fb6d72004-11-03 03:59:57 +0000285lemon$(BEXE): $(TOP)/tool/lemon.c $(TOP)/tool/lempar.c
drh376deb12004-06-30 11:41:55 +0000286 $(BCC) -o lemon $(TOP)/tool/lemon.c
287 cp $(TOP)/tool/lempar.c .
288
289
290# Rules to build individual files
291#
drhd0e4a6c2005-02-15 20:47:57 +0000292alter.lo: $(TOP)/src/alter.c $(HDR)
293 $(LTCOMPILE) -c $(TOP)/src/alter.c
294
drh9f18e8a2005-07-08 12:13:04 +0000295analyze.lo: $(TOP)/src/analyze.c $(HDR)
296 $(LTCOMPILE) -c $(TOP)/src/analyze.c
297
drh376deb12004-06-30 11:41:55 +0000298attach.lo: $(TOP)/src/attach.c $(HDR)
299 $(LTCOMPILE) -c $(TOP)/src/attach.c
300
301auth.lo: $(TOP)/src/auth.c $(HDR)
302 $(LTCOMPILE) -c $(TOP)/src/auth.c
303
304btree.lo: $(TOP)/src/btree.c $(HDR) $(TOP)/src/pager.h
305 $(LTCOMPILE) -c $(TOP)/src/btree.c
306
307build.lo: $(TOP)/src/build.c $(HDR)
308 $(LTCOMPILE) -c $(TOP)/src/build.c
309
danielk1977fd9a0a42005-05-24 12:01:00 +0000310callback.lo: $(TOP)/src/callback.c $(HDR)
311 $(LTCOMPILE) -c $(TOP)/src/callback.c
312
drha2b902d2005-08-14 17:53:20 +0000313complete.lo: $(TOP)/src/complete.c $(HDR)
314 $(LTCOMPILE) -c $(TOP)/src/complete.c
315
drh376deb12004-06-30 11:41:55 +0000316date.lo: $(TOP)/src/date.c $(HDR)
317 $(LTCOMPILE) -c $(TOP)/src/date.c
318
319delete.lo: $(TOP)/src/delete.c $(HDR)
320 $(LTCOMPILE) -c $(TOP)/src/delete.c
321
drh376deb12004-06-30 11:41:55 +0000322expr.lo: $(TOP)/src/expr.c $(HDR)
323 $(LTCOMPILE) -c $(TOP)/src/expr.c
324
325func.lo: $(TOP)/src/func.c $(HDR)
326 $(LTCOMPILE) -c $(TOP)/src/func.c
327
328hash.lo: $(TOP)/src/hash.c $(HDR)
329 $(LTCOMPILE) -c $(TOP)/src/hash.c
330
331insert.lo: $(TOP)/src/insert.c $(HDR)
332 $(LTCOMPILE) -c $(TOP)/src/insert.c
333
334legacy.lo: $(TOP)/src/legacy.c $(HDR)
335 $(LTCOMPILE) -c $(TOP)/src/legacy.c
336
drh1e397f82006-06-08 15:28:43 +0000337loadext.lo: $(TOP)/src/loadext.c $(HDR)
338 $(LTCOMPILE) -c $(TOP)/src/loadext.c
339
drh376deb12004-06-30 11:41:55 +0000340main.lo: $(TOP)/src/main.c $(HDR)
341 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/main.c
342
343pager.lo: $(TOP)/src/pager.c $(HDR) $(TOP)/src/pager.h
344 $(LTCOMPILE) -c $(TOP)/src/pager.c
345
346opcodes.lo: opcodes.c
347 $(LTCOMPILE) -c opcodes.c
348
drhb327f772004-10-06 15:03:57 +0000349opcodes.c: opcodes.h $(TOP)/mkopcodec.awk
drhf1878b42006-01-23 18:06:52 +0000350 sort -n -b +2 opcodes.h | $(NAWK) -f $(TOP)/mkopcodec.awk >opcodes.c
drh376deb12004-06-30 11:41:55 +0000351
drhf2bc0132004-10-04 13:19:23 +0000352opcodes.h: parse.h $(TOP)/src/vdbe.c $(TOP)/mkopcodeh.awk
drhf1878b42006-01-23 18:06:52 +0000353 cat parse.h $(TOP)/src/vdbe.c | $(NAWK) -f $(TOP)/mkopcodeh.awk >opcodes.h
drh376deb12004-06-30 11:41:55 +0000354
drh054889e2005-11-30 03:20:31 +0000355os.lo: $(TOP)/src/os.c $(HDR)
356 $(LTCOMPILE) -c $(TOP)/src/os.c
357
drh376deb12004-06-30 11:41:55 +0000358os_unix.lo: $(TOP)/src/os_unix.c $(HDR)
drhcf5f58f2005-06-16 18:47:38 +0000359 $(LTCOMPILE) -c $(TOP)/src/os_unix.c
drh376deb12004-06-30 11:41:55 +0000360
361os_win.lo: $(TOP)/src/os_win.c $(HDR)
drhcf5f58f2005-06-16 18:47:38 +0000362 $(LTCOMPILE) -c $(TOP)/src/os_win.c
drh376deb12004-06-30 11:41:55 +0000363
drh60a1e4b2006-06-03 18:02:15 +0000364os_os2.lo: $(TOP)/src/os_os2.c $(HDR)
365 $(LTCOMPILE) -c $(TOP)/src/os_os2.c
366
drh376deb12004-06-30 11:41:55 +0000367parse.lo: parse.c $(HDR)
368 $(LTCOMPILE) -c parse.c
369
370parse.h: parse.c
371
drhfa3b19e2005-11-24 22:22:29 +0000372parse.c: $(TOP)/src/parse.y lemon$(BEXE) $(TOP)/addopcodes.awk
drh376deb12004-06-30 11:41:55 +0000373 cp $(TOP)/src/parse.y .
drh27d258a2004-10-30 20:23:09 +0000374 ./lemon $(OPTS) parse.y
drhfa3b19e2005-11-24 22:22:29 +0000375 mv parse.h parse.h.temp
376 awk -f $(TOP)/addopcodes.awk parse.h.temp >parse.h
drh376deb12004-06-30 11:41:55 +0000377
378pragma.lo: $(TOP)/src/pragma.c $(HDR)
drh7b5717e2004-11-25 13:50:01 +0000379 $(LTCOMPILE) -c $(TOP)/src/pragma.c
drh376deb12004-06-30 11:41:55 +0000380
danielk1977fa256a32005-05-25 04:11:56 +0000381prepare.lo: $(TOP)/src/prepare.c $(HDR)
382 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/prepare.c
383
drh376deb12004-06-30 11:41:55 +0000384printf.lo: $(TOP)/src/printf.c $(HDR)
drh7b5717e2004-11-25 13:50:01 +0000385 $(LTCOMPILE) -c $(TOP)/src/printf.c
drh376deb12004-06-30 11:41:55 +0000386
387random.lo: $(TOP)/src/random.c $(HDR)
388 $(LTCOMPILE) -c $(TOP)/src/random.c
389
390select.lo: $(TOP)/src/select.c $(HDR)
391 $(LTCOMPILE) -c $(TOP)/src/select.c
392
393sqlite3.h: $(TOP)/src/sqlite.h.in
danielk197799ba19e2005-02-05 07:33:34 +0000394 sed -e s/--VERS--/$(RELEASE)/ $(TOP)/src/sqlite.h.in | \
395 sed -e s/--VERSION-NUMBER--/$(VERSION_NUMBER)/ >sqlite3.h
drh376deb12004-06-30 11:41:55 +0000396
397table.lo: $(TOP)/src/table.c $(HDR)
398 $(LTCOMPILE) -c $(TOP)/src/table.c
399
400tclsqlite.lo: $(TOP)/src/tclsqlite.c $(HDR)
drh7b5717e2004-11-25 13:50:01 +0000401 $(LTCOMPILE) -c $(TOP)/src/tclsqlite.c
drh376deb12004-06-30 11:41:55 +0000402
drh73b211a2005-01-18 04:00:42 +0000403tokenize.lo: $(TOP)/src/tokenize.c keywordhash.h $(HDR)
drh376deb12004-06-30 11:41:55 +0000404 $(LTCOMPILE) -c $(TOP)/src/tokenize.c
405
drh73b211a2005-01-18 04:00:42 +0000406keywordhash.h: $(TOP)/tool/mkkeywordhash.c
drh52fb6d72004-11-03 03:59:57 +0000407 $(BCC) -o mkkeywordhash$(BEXE) $(OPTS) $(TOP)/tool/mkkeywordhash.c
drh73b211a2005-01-18 04:00:42 +0000408 ./mkkeywordhash$(BEXE) >keywordhash.h
drh52fb6d72004-11-03 03:59:57 +0000409
drh376deb12004-06-30 11:41:55 +0000410trigger.lo: $(TOP)/src/trigger.c $(HDR)
411 $(LTCOMPILE) -c $(TOP)/src/trigger.c
412
413update.lo: $(TOP)/src/update.c $(HDR)
414 $(LTCOMPILE) -c $(TOP)/src/update.c
415
416utf.lo: $(TOP)/src/utf.c $(HDR)
417 $(LTCOMPILE) -c $(TOP)/src/utf.c
418
419util.lo: $(TOP)/src/util.c $(HDR)
420 $(LTCOMPILE) -c $(TOP)/src/util.c
421
422vacuum.lo: $(TOP)/src/vacuum.c $(HDR)
423 $(LTCOMPILE) -c $(TOP)/src/vacuum.c
424
425vdbe.lo: $(TOP)/src/vdbe.c $(VDBEHDR)
426 $(LTCOMPILE) -c $(TOP)/src/vdbe.c
427
428vdbeapi.lo: $(TOP)/src/vdbeapi.c $(VDBEHDR)
429 $(LTCOMPILE) -c $(TOP)/src/vdbeapi.c
430
431vdbeaux.lo: $(TOP)/src/vdbeaux.c $(VDBEHDR)
432 $(LTCOMPILE) -c $(TOP)/src/vdbeaux.c
433
drha01f79d2005-07-08 13:07:59 +0000434vdbefifo.lo: $(TOP)/src/vdbefifo.c $(VDBEHDR)
435 $(LTCOMPILE) -c $(TOP)/src/vdbefifo.c
436
drh376deb12004-06-30 11:41:55 +0000437vdbemem.lo: $(TOP)/src/vdbemem.c $(VDBEHDR)
438 $(LTCOMPILE) -c $(TOP)/src/vdbemem.c
439
drhb9bb7c12006-06-11 23:41:55 +0000440vtab.lo: $(TOP)/src/vtab.c $(VDBEHDR)
441 $(LTCOMPILE) -c $(TOP)/src/vtab.c
442
drh376deb12004-06-30 11:41:55 +0000443where.lo: $(TOP)/src/where.c $(HDR)
444 $(LTCOMPILE) -c $(TOP)/src/where.c
445
drh7b5717e2004-11-25 13:50:01 +0000446tclsqlite-shell.lo: $(TOP)/src/tclsqlite.c $(HDR)
447 $(LTCOMPILE) -DTCLSH=1 -o $@ -c $(TOP)/src/tclsqlite.c
drh376deb12004-06-30 11:41:55 +0000448
drh7b5717e2004-11-25 13:50:01 +0000449tclsqlite-stubs.lo: $(TOP)/src/tclsqlite.c $(HDR)
450 $(LTCOMPILE) -DTCL_USE_STUBS=1 -o $@ -c $(TOP)/src/tclsqlite.c
451
452tclsqlite3: tclsqlite-shell.lo libsqlite3.la
453 $(LTLINK) -o tclsqlite3 tclsqlite-shell.lo \
drh376deb12004-06-30 11:41:55 +0000454 libsqlite3.la $(LIBTCL)
455
drh77207ab2005-08-27 09:07:14 +0000456testfixture$(TEXE): $(TOP)/src/tclsqlite.c libsqlite3.la $(TESTSRC)
drh66560ad2006-01-06 14:32:19 +0000457 $(LTLINK) -DTCLSH=1 -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1 \
458 $(TEMP_STORE) -o testfixture $(TESTSRC) $(TOP)/src/tclsqlite.c \
drh77207ab2005-08-27 09:07:14 +0000459 libsqlite3.la $(LIBTCL)
drh376deb12004-06-30 11:41:55 +0000460
drh376deb12004-06-30 11:41:55 +0000461
drh9c06c952005-11-26 00:25:00 +0000462fulltest: testfixture$(TEXE) sqlite3$(TEXE)
drh376deb12004-06-30 11:41:55 +0000463 ./testfixture $(TOP)/test/all.test
464
drh7b5717e2004-11-25 13:50:01 +0000465test: testfixture$(TEXE) sqlite3$(TEXE)
drh376deb12004-06-30 11:41:55 +0000466 ./testfixture $(TOP)/test/quick.test
467
drh61212b62004-12-02 20:17:00 +0000468sqlite3_analyzer$(TEXE): $(TOP)/src/tclsqlite.c libtclsqlite3.la \
469 $(TESTSRC) $(TOP)/tool/spaceanal.tcl
470 sed \
471 -e '/^#/d' \
472 -e 's,\\,\\\\,g' \
473 -e 's,",\\",g' \
474 -e 's,^,",' \
475 -e 's,$$,\\n",' \
476 $(TOP)/tool/spaceanal.tcl >spaceanal_tcl.h
drhcf5f58f2005-06-16 18:47:38 +0000477 $(LTLINK) -DTCLSH=2 -DSQLITE_TEST=1 $(TEMP_STORE)\
drh61212b62004-12-02 20:17:00 +0000478 -o sqlite3_analyzer$(EXE) $(TESTSRC) $(TOP)/src/tclsqlite.c \
479 libtclsqlite3.la $(LIBTCL)
drh376deb12004-06-30 11:41:55 +0000480
481# Rules used to build documentation
482#
483arch.html: $(TOP)/www/arch.tcl
484 tclsh $(TOP)/www/arch.tcl >arch.html
485
486arch2.gif: $(TOP)/www/arch2.gif
487 cp $(TOP)/www/arch2.gif .
488
drhf8565822004-11-21 01:02:00 +0000489autoinc.html: $(TOP)/www/autoinc.tcl
490 tclsh $(TOP)/www/autoinc.tcl >autoinc.html
491
drh376deb12004-06-30 11:41:55 +0000492c_interface.html: $(TOP)/www/c_interface.tcl
493 tclsh $(TOP)/www/c_interface.tcl >c_interface.html
494
495capi3.html: $(TOP)/www/capi3.tcl
496 tclsh $(TOP)/www/capi3.tcl >capi3.html
497
498capi3ref.html: $(TOP)/www/capi3ref.tcl
499 tclsh $(TOP)/www/capi3ref.tcl >capi3ref.html
500
501changes.html: $(TOP)/www/changes.tcl
502 tclsh $(TOP)/www/changes.tcl >changes.html
503
drhf8565822004-11-21 01:02:00 +0000504compile.html: $(TOP)/www/compile.tcl
505 tclsh $(TOP)/www/compile.tcl >compile.html
506
drh376deb12004-06-30 11:41:55 +0000507copyright.html: $(TOP)/www/copyright.tcl
508 tclsh $(TOP)/www/copyright.tcl >copyright.html
509
510copyright-release.html: $(TOP)/www/copyright-release.html
511 cp $(TOP)/www/copyright-release.html .
512
513copyright-release.pdf: $(TOP)/www/copyright-release.pdf
514 cp $(TOP)/www/copyright-release.pdf .
515
516common.tcl: $(TOP)/www/common.tcl
517 cp $(TOP)/www/common.tcl .
518
519conflict.html: $(TOP)/www/conflict.tcl
520 tclsh $(TOP)/www/conflict.tcl >conflict.html
521
522datatypes.html: $(TOP)/www/datatypes.tcl
523 tclsh $(TOP)/www/datatypes.tcl >datatypes.html
524
525datatype3.html: $(TOP)/www/datatype3.tcl
526 tclsh $(TOP)/www/datatype3.tcl >datatype3.html
527
528docs.html: $(TOP)/www/docs.tcl
529 tclsh $(TOP)/www/docs.tcl >docs.html
530
531download.html: $(TOP)/www/download.tcl
drhd2f397f2004-09-17 20:47:16 +0000532 mkdir -p doc
drh376deb12004-06-30 11:41:55 +0000533 tclsh $(TOP)/www/download.tcl >download.html
534
535faq.html: $(TOP)/www/faq.tcl
536 tclsh $(TOP)/www/faq.tcl >faq.html
537
538fileformat.html: $(TOP)/www/fileformat.tcl
539 tclsh $(TOP)/www/fileformat.tcl >fileformat.html
540
541formatchng.html: $(TOP)/www/formatchng.tcl
542 tclsh $(TOP)/www/formatchng.tcl >formatchng.html
543
544index.html: $(TOP)/www/index.tcl last_change
545 tclsh $(TOP)/www/index.tcl >index.html
546
547lang.html: $(TOP)/www/lang.tcl
548 tclsh $(TOP)/www/lang.tcl >lang.html
549
tpoindex9a09a3c2004-12-20 19:01:32 +0000550pragma.html: $(TOP)/www/pragma.tcl
551 tclsh $(TOP)/www/pragma.tcl >pragma.html
552
drh376deb12004-06-30 11:41:55 +0000553lockingv3.html: $(TOP)/www/lockingv3.tcl
554 tclsh $(TOP)/www/lockingv3.tcl >lockingv3.html
555
556oldnews.html: $(TOP)/www/oldnews.tcl
557 tclsh $(TOP)/www/oldnews.tcl >oldnews.html
558
559omitted.html: $(TOP)/www/omitted.tcl
560 tclsh $(TOP)/www/omitted.tcl >omitted.html
561
562opcode.html: $(TOP)/www/opcode.tcl $(TOP)/src/vdbe.c
563 tclsh $(TOP)/www/opcode.tcl $(TOP)/src/vdbe.c >opcode.html
564
565mingw.html: $(TOP)/www/mingw.tcl
566 tclsh $(TOP)/www/mingw.tcl >mingw.html
567
568nulls.html: $(TOP)/www/nulls.tcl
569 tclsh $(TOP)/www/nulls.tcl >nulls.html
570
571quickstart.html: $(TOP)/www/quickstart.tcl
572 tclsh $(TOP)/www/quickstart.tcl >quickstart.html
573
574speed.html: $(TOP)/www/speed.tcl
575 tclsh $(TOP)/www/speed.tcl >speed.html
576
577sqlite.gif: $(TOP)/art/SQLite.gif
578 cp $(TOP)/art/SQLite.gif sqlite.gif
579
580sqlite.html: $(TOP)/www/sqlite.tcl
581 tclsh $(TOP)/www/sqlite.tcl >sqlite.html
582
583support.html: $(TOP)/www/support.tcl
584 tclsh $(TOP)/www/support.tcl >support.html
585
586tclsqlite.html: $(TOP)/www/tclsqlite.tcl
587 tclsh $(TOP)/www/tclsqlite.tcl >tclsqlite.html
588
589vdbe.html: $(TOP)/www/vdbe.tcl
590 tclsh $(TOP)/www/vdbe.tcl >vdbe.html
591
592version3.html: $(TOP)/www/version3.tcl
593 tclsh $(TOP)/www/version3.tcl >version3.html
594
595
596# Files to be published on the website.
597#
598DOC = \
599 arch.html \
drh6eb85772005-06-15 18:07:39 +0000600 arch2.gif \
drhf8565822004-11-21 01:02:00 +0000601 autoinc.html \
drh376deb12004-06-30 11:41:55 +0000602 c_interface.html \
603 capi3.html \
604 capi3ref.html \
605 changes.html \
drhf8565822004-11-21 01:02:00 +0000606 compile.html \
drh376deb12004-06-30 11:41:55 +0000607 copyright.html \
608 copyright-release.html \
609 copyright-release.pdf \
610 conflict.html \
611 datatypes.html \
612 datatype3.html \
613 docs.html \
614 download.html \
615 faq.html \
616 fileformat.html \
617 formatchng.html \
618 index.html \
619 lang.html \
620 lockingv3.html \
621 mingw.html \
622 nulls.html \
623 oldnews.html \
624 omitted.html \
625 opcode.html \
drhf8565822004-11-21 01:02:00 +0000626 pragma.html \
drh376deb12004-06-30 11:41:55 +0000627 quickstart.html \
628 speed.html \
629 sqlite.gif \
630 sqlite.html \
631 support.html \
632 tclsqlite.html \
633 vdbe.html \
drhf8565822004-11-21 01:02:00 +0000634 version3.html
drh376deb12004-06-30 11:41:55 +0000635
636doc: common.tcl $(DOC)
637 mkdir -p doc
638 mv $(DOC) doc
639
drh4b2266a2004-11-27 15:52:16 +0000640install: sqlite3 libsqlite3.la sqlite3.h ${HAVE_TCL:1=tcl_install}
drh8d45ec02004-09-17 21:07:34 +0000641 $(INSTALL) -d $(DESTDIR)$(libdir)
642 $(LTINSTALL) libsqlite3.la $(DESTDIR)$(libdir)
drh376deb12004-06-30 11:41:55 +0000643 $(INSTALL) -d $(DESTDIR)$(exec_prefix)/bin
644 $(LTINSTALL) sqlite3 $(DESTDIR)$(exec_prefix)/bin
645 $(INSTALL) -d $(DESTDIR)$(prefix)/include
646 $(INSTALL) -m 0644 sqlite3.h $(DESTDIR)$(prefix)/include
drh8d45ec02004-09-17 21:07:34 +0000647 $(INSTALL) -d $(DESTDIR)$(libdir)/pkgconfig;
648 $(INSTALL) -m 0644 sqlite3.pc $(DESTDIR)$(libdir)/pkgconfig;
drh376deb12004-06-30 11:41:55 +0000649
drh4b2266a2004-11-27 15:52:16 +0000650tcl_install: libtclsqlite3.la
651 tclsh $(TOP)/tclinstaller.tcl $(VERSION)
652
drh376deb12004-06-30 11:41:55 +0000653clean:
drh7b5717e2004-11-25 13:50:01 +0000654 rm -f *.lo *.la *.o sqlite3$(TEXE) libsqlite3.la
drh376deb12004-06-30 11:41:55 +0000655 rm -f sqlite3.h opcodes.*
656 rm -rf .libs .deps
drh52fb6d72004-11-03 03:59:57 +0000657 rm -f lemon$(BEXE) lempar.c parse.* sqlite*.tar.gz
drh73b211a2005-01-18 04:00:42 +0000658 rm -f mkkeywordhash$(BEXE) keywordhash.h
drh376deb12004-06-30 11:41:55 +0000659 rm -f $(PUBLISH)
660 rm -f *.da *.bb *.bbg gmon.out
drh7b5717e2004-11-25 13:50:01 +0000661 rm -f testfixture$(TEXE) test.db
drh376deb12004-06-30 11:41:55 +0000662 rm -rf doc
663 rm -f common.tcl
664 rm -f sqlite3.dll sqlite3.lib
665
666#
667# Windows section; all this funky .dll stuff ;-)
668#
669dll: sqlite3.dll
670
671REAL_LIBOBJ = $(LIBOBJ:%.lo=.libs/%.o)
672
673sqlite3.dll: $(LIBOBJ) $(TOP)/sqlite3.def
674 dllwrap --dllname sqlite3.dll --def $(TOP)/sqlite3.def $(REAL_LIBOBJ)
675 strip sqlite3.dll
676
677#target for dll import libraries
678implib: sqlite3.lib
679
680#make Borland C++ and/or Microsoft VC import library for the dll
681# ignore any errors (usually due to missing programs)
682sqlite3.lib: sqlite3.dll
drhbf8f1b32005-06-16 16:51:15 +0000683 -impdef -a sqlite3.def sqlite3.dll
684 -implib sqlite3.lib sqlite3.def
drh376deb12004-06-30 11:41:55 +0000685 -lib /machine:i386 /def:$(TOP)/sqlite3.def
686
687distclean: clean
688 rm -f config.log config.status libtool Makefile config.h