blob: 706246e062acbe8d05882ab3e81dafb507ac60f9 [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 \
drh4be8b512006-06-13 23:51:34 +0000214 $(TOP)/src/test_tclvar.c \
drh376deb12004-06-30 11:41:55 +0000215 $(TOP)/src/utf.c \
drhed6b3eb2004-09-08 21:12:50 +0000216 $(TOP)/src/util.c \
drh376deb12004-06-30 11:41:55 +0000217 $(TOP)/src/vdbe.c \
drha2b902d2005-08-14 17:53:20 +0000218 $(TOP)/src/where.c
drh376deb12004-06-30 11:41:55 +0000219
220# Header files used by all library source files.
221#
222HDR = \
223 sqlite3.h \
224 $(TOP)/src/btree.h \
drh376deb12004-06-30 11:41:55 +0000225 $(TOP)/src/hash.h \
226 opcodes.h \
227 $(TOP)/src/os.h \
228 $(TOP)/src/os_common.h \
drh1e397f82006-06-08 15:28:43 +0000229 $(TOP)/src/sqlite3ext.h \
drh376deb12004-06-30 11:41:55 +0000230 $(TOP)/src/sqliteInt.h \
231 $(TOP)/src/vdbe.h \
232 parse.h
233
234# Header files used by the VDBE submodule
235#
236VDBEHDR = \
237 $(HDR) \
238 $(TOP)/src/vdbeInt.h
239
240# This is the default Makefile target. The objects listed here
241# are what get build when you type just "make" with no arguments.
242#
drh7b5717e2004-11-25 13:50:01 +0000243all: sqlite3.h libsqlite3.la sqlite3$(TEXE) $(HAVE_TCL:1=libtclsqlite3.la)
drh376deb12004-06-30 11:41:55 +0000244
245Makefile: $(TOP)/Makefile.in
246 ./config.status
247
248# Generate the file "last_change" which contains the date of change
249# of the most recently modified source code file
250#
251last_change: $(SRC)
252 cat $(SRC) | grep '$$Id: ' | sort +4 | tail -1 \
drhf1878b42006-01-23 18:06:52 +0000253 | $(NAWK) '{print $$5,$$6}' >last_change
drh376deb12004-06-30 11:41:55 +0000254
255libsqlite3.la: $(LIBOBJ)
drhcc01bc02004-09-17 21:35:30 +0000256 $(LTLINK) -o libsqlite3.la $(LIBOBJ) $(LIBPTHREAD) \
drh4b2266a2004-11-27 15:52:16 +0000257 ${ALLOWRELEASE} -rpath $(libdir) -version-info "8:6:8"
drh376deb12004-06-30 11:41:55 +0000258
259libtclsqlite3.la: tclsqlite.lo libsqlite3.la
260 $(LTLINK) -o libtclsqlite3.la tclsqlite.lo \
drh4b2266a2004-11-27 15:52:16 +0000261 $(LIBOBJ) @TCL_STUB_LIB_SPEC@ $(LIBPTHREAD) \
drh7b5717e2004-11-25 13:50:01 +0000262 -rpath $(libdir)/sqlite \
drh376deb12004-06-30 11:41:55 +0000263 -version-info "8:6:8"
264
drh7b5717e2004-11-25 13:50:01 +0000265sqlite3$(TEXE): $(TOP)/src/shell.c libsqlite3.la sqlite3.h
drhcc01bc02004-09-17 21:35:30 +0000266 $(LTLINK) $(READLINE_FLAGS) $(LIBPTHREAD) \
drh60a1e4b2006-06-03 18:02:15 +0000267 -o $@ $(TOP)/src/shell.c libsqlite3.la \
drhf1878b42006-01-23 18:06:52 +0000268 $(LIBREADLINE) $(TLIBS)
drh376deb12004-06-30 11:41:55 +0000269
270# This target creates a directory named "tsrc" and fills it with
271# copies of all of the C source code and header files needed to
272# build on the target system. Some of the C source code and header
273# files are automatically generated. This target takes care of
274# all that automatic generation.
275#
drh73b211a2005-01-18 04:00:42 +0000276target_source: $(SRC) parse.c opcodes.c keywordhash.h $(VDBEHDR)
drh376deb12004-06-30 11:41:55 +0000277 rm -rf tsrc
drhd2f397f2004-09-17 20:47:16 +0000278 mkdir -p tsrc
drh376deb12004-06-30 11:41:55 +0000279 cp $(SRC) $(VDBEHDR) tsrc
280 rm tsrc/sqlite.h.in tsrc/parse.y
drh73b211a2005-01-18 04:00:42 +0000281 cp parse.c opcodes.c keywordhash.h tsrc
drh4aec8b62004-08-28 16:19:00 +0000282 cp $(TOP)/sqlite3.def tsrc
drh376deb12004-06-30 11:41:55 +0000283
284# Rules to build the LEMON compiler generator
285#
drh52fb6d72004-11-03 03:59:57 +0000286lemon$(BEXE): $(TOP)/tool/lemon.c $(TOP)/tool/lempar.c
drh376deb12004-06-30 11:41:55 +0000287 $(BCC) -o lemon $(TOP)/tool/lemon.c
288 cp $(TOP)/tool/lempar.c .
289
290
291# Rules to build individual files
292#
drhd0e4a6c2005-02-15 20:47:57 +0000293alter.lo: $(TOP)/src/alter.c $(HDR)
294 $(LTCOMPILE) -c $(TOP)/src/alter.c
295
drh9f18e8a2005-07-08 12:13:04 +0000296analyze.lo: $(TOP)/src/analyze.c $(HDR)
297 $(LTCOMPILE) -c $(TOP)/src/analyze.c
298
drh376deb12004-06-30 11:41:55 +0000299attach.lo: $(TOP)/src/attach.c $(HDR)
300 $(LTCOMPILE) -c $(TOP)/src/attach.c
301
302auth.lo: $(TOP)/src/auth.c $(HDR)
303 $(LTCOMPILE) -c $(TOP)/src/auth.c
304
305btree.lo: $(TOP)/src/btree.c $(HDR) $(TOP)/src/pager.h
306 $(LTCOMPILE) -c $(TOP)/src/btree.c
307
308build.lo: $(TOP)/src/build.c $(HDR)
309 $(LTCOMPILE) -c $(TOP)/src/build.c
310
danielk1977fd9a0a42005-05-24 12:01:00 +0000311callback.lo: $(TOP)/src/callback.c $(HDR)
312 $(LTCOMPILE) -c $(TOP)/src/callback.c
313
drha2b902d2005-08-14 17:53:20 +0000314complete.lo: $(TOP)/src/complete.c $(HDR)
315 $(LTCOMPILE) -c $(TOP)/src/complete.c
316
drh376deb12004-06-30 11:41:55 +0000317date.lo: $(TOP)/src/date.c $(HDR)
318 $(LTCOMPILE) -c $(TOP)/src/date.c
319
320delete.lo: $(TOP)/src/delete.c $(HDR)
321 $(LTCOMPILE) -c $(TOP)/src/delete.c
322
drh376deb12004-06-30 11:41:55 +0000323expr.lo: $(TOP)/src/expr.c $(HDR)
324 $(LTCOMPILE) -c $(TOP)/src/expr.c
325
326func.lo: $(TOP)/src/func.c $(HDR)
327 $(LTCOMPILE) -c $(TOP)/src/func.c
328
329hash.lo: $(TOP)/src/hash.c $(HDR)
330 $(LTCOMPILE) -c $(TOP)/src/hash.c
331
332insert.lo: $(TOP)/src/insert.c $(HDR)
333 $(LTCOMPILE) -c $(TOP)/src/insert.c
334
335legacy.lo: $(TOP)/src/legacy.c $(HDR)
336 $(LTCOMPILE) -c $(TOP)/src/legacy.c
337
drh1e397f82006-06-08 15:28:43 +0000338loadext.lo: $(TOP)/src/loadext.c $(HDR)
339 $(LTCOMPILE) -c $(TOP)/src/loadext.c
340
drh376deb12004-06-30 11:41:55 +0000341main.lo: $(TOP)/src/main.c $(HDR)
342 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/main.c
343
344pager.lo: $(TOP)/src/pager.c $(HDR) $(TOP)/src/pager.h
345 $(LTCOMPILE) -c $(TOP)/src/pager.c
346
347opcodes.lo: opcodes.c
348 $(LTCOMPILE) -c opcodes.c
349
drhb327f772004-10-06 15:03:57 +0000350opcodes.c: opcodes.h $(TOP)/mkopcodec.awk
drhf1878b42006-01-23 18:06:52 +0000351 sort -n -b +2 opcodes.h | $(NAWK) -f $(TOP)/mkopcodec.awk >opcodes.c
drh376deb12004-06-30 11:41:55 +0000352
drhf2bc0132004-10-04 13:19:23 +0000353opcodes.h: parse.h $(TOP)/src/vdbe.c $(TOP)/mkopcodeh.awk
drhf1878b42006-01-23 18:06:52 +0000354 cat parse.h $(TOP)/src/vdbe.c | $(NAWK) -f $(TOP)/mkopcodeh.awk >opcodes.h
drh376deb12004-06-30 11:41:55 +0000355
drh054889e2005-11-30 03:20:31 +0000356os.lo: $(TOP)/src/os.c $(HDR)
357 $(LTCOMPILE) -c $(TOP)/src/os.c
358
drh376deb12004-06-30 11:41:55 +0000359os_unix.lo: $(TOP)/src/os_unix.c $(HDR)
drhcf5f58f2005-06-16 18:47:38 +0000360 $(LTCOMPILE) -c $(TOP)/src/os_unix.c
drh376deb12004-06-30 11:41:55 +0000361
362os_win.lo: $(TOP)/src/os_win.c $(HDR)
drhcf5f58f2005-06-16 18:47:38 +0000363 $(LTCOMPILE) -c $(TOP)/src/os_win.c
drh376deb12004-06-30 11:41:55 +0000364
drh60a1e4b2006-06-03 18:02:15 +0000365os_os2.lo: $(TOP)/src/os_os2.c $(HDR)
366 $(LTCOMPILE) -c $(TOP)/src/os_os2.c
367
drh376deb12004-06-30 11:41:55 +0000368parse.lo: parse.c $(HDR)
369 $(LTCOMPILE) -c parse.c
370
371parse.h: parse.c
372
drhfa3b19e2005-11-24 22:22:29 +0000373parse.c: $(TOP)/src/parse.y lemon$(BEXE) $(TOP)/addopcodes.awk
drh376deb12004-06-30 11:41:55 +0000374 cp $(TOP)/src/parse.y .
drh27d258a2004-10-30 20:23:09 +0000375 ./lemon $(OPTS) parse.y
drhfa3b19e2005-11-24 22:22:29 +0000376 mv parse.h parse.h.temp
377 awk -f $(TOP)/addopcodes.awk parse.h.temp >parse.h
drh376deb12004-06-30 11:41:55 +0000378
379pragma.lo: $(TOP)/src/pragma.c $(HDR)
drh7b5717e2004-11-25 13:50:01 +0000380 $(LTCOMPILE) -c $(TOP)/src/pragma.c
drh376deb12004-06-30 11:41:55 +0000381
danielk1977fa256a32005-05-25 04:11:56 +0000382prepare.lo: $(TOP)/src/prepare.c $(HDR)
383 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/prepare.c
384
drh376deb12004-06-30 11:41:55 +0000385printf.lo: $(TOP)/src/printf.c $(HDR)
drh7b5717e2004-11-25 13:50:01 +0000386 $(LTCOMPILE) -c $(TOP)/src/printf.c
drh376deb12004-06-30 11:41:55 +0000387
388random.lo: $(TOP)/src/random.c $(HDR)
389 $(LTCOMPILE) -c $(TOP)/src/random.c
390
391select.lo: $(TOP)/src/select.c $(HDR)
392 $(LTCOMPILE) -c $(TOP)/src/select.c
393
394sqlite3.h: $(TOP)/src/sqlite.h.in
danielk197799ba19e2005-02-05 07:33:34 +0000395 sed -e s/--VERS--/$(RELEASE)/ $(TOP)/src/sqlite.h.in | \
396 sed -e s/--VERSION-NUMBER--/$(VERSION_NUMBER)/ >sqlite3.h
drh376deb12004-06-30 11:41:55 +0000397
398table.lo: $(TOP)/src/table.c $(HDR)
399 $(LTCOMPILE) -c $(TOP)/src/table.c
400
401tclsqlite.lo: $(TOP)/src/tclsqlite.c $(HDR)
drh7b5717e2004-11-25 13:50:01 +0000402 $(LTCOMPILE) -c $(TOP)/src/tclsqlite.c
drh376deb12004-06-30 11:41:55 +0000403
drh73b211a2005-01-18 04:00:42 +0000404tokenize.lo: $(TOP)/src/tokenize.c keywordhash.h $(HDR)
drh376deb12004-06-30 11:41:55 +0000405 $(LTCOMPILE) -c $(TOP)/src/tokenize.c
406
drh73b211a2005-01-18 04:00:42 +0000407keywordhash.h: $(TOP)/tool/mkkeywordhash.c
drh52fb6d72004-11-03 03:59:57 +0000408 $(BCC) -o mkkeywordhash$(BEXE) $(OPTS) $(TOP)/tool/mkkeywordhash.c
drh73b211a2005-01-18 04:00:42 +0000409 ./mkkeywordhash$(BEXE) >keywordhash.h
drh52fb6d72004-11-03 03:59:57 +0000410
drh376deb12004-06-30 11:41:55 +0000411trigger.lo: $(TOP)/src/trigger.c $(HDR)
412 $(LTCOMPILE) -c $(TOP)/src/trigger.c
413
414update.lo: $(TOP)/src/update.c $(HDR)
415 $(LTCOMPILE) -c $(TOP)/src/update.c
416
417utf.lo: $(TOP)/src/utf.c $(HDR)
418 $(LTCOMPILE) -c $(TOP)/src/utf.c
419
420util.lo: $(TOP)/src/util.c $(HDR)
421 $(LTCOMPILE) -c $(TOP)/src/util.c
422
423vacuum.lo: $(TOP)/src/vacuum.c $(HDR)
424 $(LTCOMPILE) -c $(TOP)/src/vacuum.c
425
426vdbe.lo: $(TOP)/src/vdbe.c $(VDBEHDR)
427 $(LTCOMPILE) -c $(TOP)/src/vdbe.c
428
429vdbeapi.lo: $(TOP)/src/vdbeapi.c $(VDBEHDR)
430 $(LTCOMPILE) -c $(TOP)/src/vdbeapi.c
431
432vdbeaux.lo: $(TOP)/src/vdbeaux.c $(VDBEHDR)
433 $(LTCOMPILE) -c $(TOP)/src/vdbeaux.c
434
drha01f79d2005-07-08 13:07:59 +0000435vdbefifo.lo: $(TOP)/src/vdbefifo.c $(VDBEHDR)
436 $(LTCOMPILE) -c $(TOP)/src/vdbefifo.c
437
drh376deb12004-06-30 11:41:55 +0000438vdbemem.lo: $(TOP)/src/vdbemem.c $(VDBEHDR)
439 $(LTCOMPILE) -c $(TOP)/src/vdbemem.c
440
drhb9bb7c12006-06-11 23:41:55 +0000441vtab.lo: $(TOP)/src/vtab.c $(VDBEHDR)
442 $(LTCOMPILE) -c $(TOP)/src/vtab.c
443
drh376deb12004-06-30 11:41:55 +0000444where.lo: $(TOP)/src/where.c $(HDR)
445 $(LTCOMPILE) -c $(TOP)/src/where.c
446
drh7b5717e2004-11-25 13:50:01 +0000447tclsqlite-shell.lo: $(TOP)/src/tclsqlite.c $(HDR)
448 $(LTCOMPILE) -DTCLSH=1 -o $@ -c $(TOP)/src/tclsqlite.c
drh376deb12004-06-30 11:41:55 +0000449
drh7b5717e2004-11-25 13:50:01 +0000450tclsqlite-stubs.lo: $(TOP)/src/tclsqlite.c $(HDR)
451 $(LTCOMPILE) -DTCL_USE_STUBS=1 -o $@ -c $(TOP)/src/tclsqlite.c
452
453tclsqlite3: tclsqlite-shell.lo libsqlite3.la
454 $(LTLINK) -o tclsqlite3 tclsqlite-shell.lo \
drh376deb12004-06-30 11:41:55 +0000455 libsqlite3.la $(LIBTCL)
456
drh77207ab2005-08-27 09:07:14 +0000457testfixture$(TEXE): $(TOP)/src/tclsqlite.c libsqlite3.la $(TESTSRC)
drh66560ad2006-01-06 14:32:19 +0000458 $(LTLINK) -DTCLSH=1 -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1 \
459 $(TEMP_STORE) -o testfixture $(TESTSRC) $(TOP)/src/tclsqlite.c \
drh77207ab2005-08-27 09:07:14 +0000460 libsqlite3.la $(LIBTCL)
drh376deb12004-06-30 11:41:55 +0000461
drh376deb12004-06-30 11:41:55 +0000462
drh9c06c952005-11-26 00:25:00 +0000463fulltest: testfixture$(TEXE) sqlite3$(TEXE)
drh376deb12004-06-30 11:41:55 +0000464 ./testfixture $(TOP)/test/all.test
465
drh7b5717e2004-11-25 13:50:01 +0000466test: testfixture$(TEXE) sqlite3$(TEXE)
drh376deb12004-06-30 11:41:55 +0000467 ./testfixture $(TOP)/test/quick.test
468
drh61212b62004-12-02 20:17:00 +0000469sqlite3_analyzer$(TEXE): $(TOP)/src/tclsqlite.c libtclsqlite3.la \
470 $(TESTSRC) $(TOP)/tool/spaceanal.tcl
471 sed \
472 -e '/^#/d' \
473 -e 's,\\,\\\\,g' \
474 -e 's,",\\",g' \
475 -e 's,^,",' \
476 -e 's,$$,\\n",' \
477 $(TOP)/tool/spaceanal.tcl >spaceanal_tcl.h
drhcf5f58f2005-06-16 18:47:38 +0000478 $(LTLINK) -DTCLSH=2 -DSQLITE_TEST=1 $(TEMP_STORE)\
drh61212b62004-12-02 20:17:00 +0000479 -o sqlite3_analyzer$(EXE) $(TESTSRC) $(TOP)/src/tclsqlite.c \
480 libtclsqlite3.la $(LIBTCL)
drh376deb12004-06-30 11:41:55 +0000481
482# Rules used to build documentation
483#
484arch.html: $(TOP)/www/arch.tcl
485 tclsh $(TOP)/www/arch.tcl >arch.html
486
487arch2.gif: $(TOP)/www/arch2.gif
488 cp $(TOP)/www/arch2.gif .
489
drhf8565822004-11-21 01:02:00 +0000490autoinc.html: $(TOP)/www/autoinc.tcl
491 tclsh $(TOP)/www/autoinc.tcl >autoinc.html
492
drh376deb12004-06-30 11:41:55 +0000493c_interface.html: $(TOP)/www/c_interface.tcl
494 tclsh $(TOP)/www/c_interface.tcl >c_interface.html
495
496capi3.html: $(TOP)/www/capi3.tcl
497 tclsh $(TOP)/www/capi3.tcl >capi3.html
498
499capi3ref.html: $(TOP)/www/capi3ref.tcl
500 tclsh $(TOP)/www/capi3ref.tcl >capi3ref.html
501
502changes.html: $(TOP)/www/changes.tcl
503 tclsh $(TOP)/www/changes.tcl >changes.html
504
drhf8565822004-11-21 01:02:00 +0000505compile.html: $(TOP)/www/compile.tcl
506 tclsh $(TOP)/www/compile.tcl >compile.html
507
drh376deb12004-06-30 11:41:55 +0000508copyright.html: $(TOP)/www/copyright.tcl
509 tclsh $(TOP)/www/copyright.tcl >copyright.html
510
511copyright-release.html: $(TOP)/www/copyright-release.html
512 cp $(TOP)/www/copyright-release.html .
513
514copyright-release.pdf: $(TOP)/www/copyright-release.pdf
515 cp $(TOP)/www/copyright-release.pdf .
516
517common.tcl: $(TOP)/www/common.tcl
518 cp $(TOP)/www/common.tcl .
519
520conflict.html: $(TOP)/www/conflict.tcl
521 tclsh $(TOP)/www/conflict.tcl >conflict.html
522
523datatypes.html: $(TOP)/www/datatypes.tcl
524 tclsh $(TOP)/www/datatypes.tcl >datatypes.html
525
526datatype3.html: $(TOP)/www/datatype3.tcl
527 tclsh $(TOP)/www/datatype3.tcl >datatype3.html
528
529docs.html: $(TOP)/www/docs.tcl
530 tclsh $(TOP)/www/docs.tcl >docs.html
531
532download.html: $(TOP)/www/download.tcl
drhd2f397f2004-09-17 20:47:16 +0000533 mkdir -p doc
drh376deb12004-06-30 11:41:55 +0000534 tclsh $(TOP)/www/download.tcl >download.html
535
536faq.html: $(TOP)/www/faq.tcl
537 tclsh $(TOP)/www/faq.tcl >faq.html
538
539fileformat.html: $(TOP)/www/fileformat.tcl
540 tclsh $(TOP)/www/fileformat.tcl >fileformat.html
541
542formatchng.html: $(TOP)/www/formatchng.tcl
543 tclsh $(TOP)/www/formatchng.tcl >formatchng.html
544
545index.html: $(TOP)/www/index.tcl last_change
546 tclsh $(TOP)/www/index.tcl >index.html
547
548lang.html: $(TOP)/www/lang.tcl
549 tclsh $(TOP)/www/lang.tcl >lang.html
550
tpoindex9a09a3c2004-12-20 19:01:32 +0000551pragma.html: $(TOP)/www/pragma.tcl
552 tclsh $(TOP)/www/pragma.tcl >pragma.html
553
drh376deb12004-06-30 11:41:55 +0000554lockingv3.html: $(TOP)/www/lockingv3.tcl
555 tclsh $(TOP)/www/lockingv3.tcl >lockingv3.html
556
557oldnews.html: $(TOP)/www/oldnews.tcl
558 tclsh $(TOP)/www/oldnews.tcl >oldnews.html
559
560omitted.html: $(TOP)/www/omitted.tcl
561 tclsh $(TOP)/www/omitted.tcl >omitted.html
562
563opcode.html: $(TOP)/www/opcode.tcl $(TOP)/src/vdbe.c
564 tclsh $(TOP)/www/opcode.tcl $(TOP)/src/vdbe.c >opcode.html
565
566mingw.html: $(TOP)/www/mingw.tcl
567 tclsh $(TOP)/www/mingw.tcl >mingw.html
568
569nulls.html: $(TOP)/www/nulls.tcl
570 tclsh $(TOP)/www/nulls.tcl >nulls.html
571
572quickstart.html: $(TOP)/www/quickstart.tcl
573 tclsh $(TOP)/www/quickstart.tcl >quickstart.html
574
575speed.html: $(TOP)/www/speed.tcl
576 tclsh $(TOP)/www/speed.tcl >speed.html
577
578sqlite.gif: $(TOP)/art/SQLite.gif
579 cp $(TOP)/art/SQLite.gif sqlite.gif
580
581sqlite.html: $(TOP)/www/sqlite.tcl
582 tclsh $(TOP)/www/sqlite.tcl >sqlite.html
583
584support.html: $(TOP)/www/support.tcl
585 tclsh $(TOP)/www/support.tcl >support.html
586
587tclsqlite.html: $(TOP)/www/tclsqlite.tcl
588 tclsh $(TOP)/www/tclsqlite.tcl >tclsqlite.html
589
590vdbe.html: $(TOP)/www/vdbe.tcl
591 tclsh $(TOP)/www/vdbe.tcl >vdbe.html
592
593version3.html: $(TOP)/www/version3.tcl
594 tclsh $(TOP)/www/version3.tcl >version3.html
595
596
597# Files to be published on the website.
598#
599DOC = \
600 arch.html \
drh6eb85772005-06-15 18:07:39 +0000601 arch2.gif \
drhf8565822004-11-21 01:02:00 +0000602 autoinc.html \
drh376deb12004-06-30 11:41:55 +0000603 c_interface.html \
604 capi3.html \
605 capi3ref.html \
606 changes.html \
drhf8565822004-11-21 01:02:00 +0000607 compile.html \
drh376deb12004-06-30 11:41:55 +0000608 copyright.html \
609 copyright-release.html \
610 copyright-release.pdf \
611 conflict.html \
612 datatypes.html \
613 datatype3.html \
614 docs.html \
615 download.html \
616 faq.html \
617 fileformat.html \
618 formatchng.html \
619 index.html \
620 lang.html \
621 lockingv3.html \
622 mingw.html \
623 nulls.html \
624 oldnews.html \
625 omitted.html \
626 opcode.html \
drhf8565822004-11-21 01:02:00 +0000627 pragma.html \
drh376deb12004-06-30 11:41:55 +0000628 quickstart.html \
629 speed.html \
630 sqlite.gif \
631 sqlite.html \
632 support.html \
633 tclsqlite.html \
634 vdbe.html \
drhf8565822004-11-21 01:02:00 +0000635 version3.html
drh376deb12004-06-30 11:41:55 +0000636
637doc: common.tcl $(DOC)
638 mkdir -p doc
639 mv $(DOC) doc
640
drh4b2266a2004-11-27 15:52:16 +0000641install: sqlite3 libsqlite3.la sqlite3.h ${HAVE_TCL:1=tcl_install}
drh8d45ec02004-09-17 21:07:34 +0000642 $(INSTALL) -d $(DESTDIR)$(libdir)
643 $(LTINSTALL) libsqlite3.la $(DESTDIR)$(libdir)
drh376deb12004-06-30 11:41:55 +0000644 $(INSTALL) -d $(DESTDIR)$(exec_prefix)/bin
645 $(LTINSTALL) sqlite3 $(DESTDIR)$(exec_prefix)/bin
646 $(INSTALL) -d $(DESTDIR)$(prefix)/include
647 $(INSTALL) -m 0644 sqlite3.h $(DESTDIR)$(prefix)/include
drh8d45ec02004-09-17 21:07:34 +0000648 $(INSTALL) -d $(DESTDIR)$(libdir)/pkgconfig;
649 $(INSTALL) -m 0644 sqlite3.pc $(DESTDIR)$(libdir)/pkgconfig;
drh376deb12004-06-30 11:41:55 +0000650
drh4b2266a2004-11-27 15:52:16 +0000651tcl_install: libtclsqlite3.la
652 tclsh $(TOP)/tclinstaller.tcl $(VERSION)
653
drh376deb12004-06-30 11:41:55 +0000654clean:
drh7b5717e2004-11-25 13:50:01 +0000655 rm -f *.lo *.la *.o sqlite3$(TEXE) libsqlite3.la
drh376deb12004-06-30 11:41:55 +0000656 rm -f sqlite3.h opcodes.*
657 rm -rf .libs .deps
drh52fb6d72004-11-03 03:59:57 +0000658 rm -f lemon$(BEXE) lempar.c parse.* sqlite*.tar.gz
drh73b211a2005-01-18 04:00:42 +0000659 rm -f mkkeywordhash$(BEXE) keywordhash.h
drh376deb12004-06-30 11:41:55 +0000660 rm -f $(PUBLISH)
661 rm -f *.da *.bb *.bbg gmon.out
drh7b5717e2004-11-25 13:50:01 +0000662 rm -f testfixture$(TEXE) test.db
drh376deb12004-06-30 11:41:55 +0000663 rm -rf doc
664 rm -f common.tcl
665 rm -f sqlite3.dll sqlite3.lib
666
667#
668# Windows section; all this funky .dll stuff ;-)
669#
670dll: sqlite3.dll
671
672REAL_LIBOBJ = $(LIBOBJ:%.lo=.libs/%.o)
673
674sqlite3.dll: $(LIBOBJ) $(TOP)/sqlite3.def
675 dllwrap --dllname sqlite3.dll --def $(TOP)/sqlite3.def $(REAL_LIBOBJ)
676 strip sqlite3.dll
677
678#target for dll import libraries
679implib: sqlite3.lib
680
681#make Borland C++ and/or Microsoft VC import library for the dll
682# ignore any errors (usually due to missing programs)
683sqlite3.lib: sqlite3.dll
drhbf8f1b32005-06-16 16:51:15 +0000684 -impdef -a sqlite3.def sqlite3.dll
685 -implib sqlite3.lib sqlite3.def
drh376deb12004-06-30 11:41:55 +0000686 -lib /machine:i386 /def:$(TOP)/sqlite3.def
687
688distclean: clean
689 rm -f config.log config.status libtool Makefile config.h