Snapshot of upstream SQLite 3.33.0
[sqlcipher.git] / Makefile.in
blob3fc984cff7a091b3842e7308d36906ecdf5b7406
1 #!/usr/make
3 # Makefile for SQLITE
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.
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.
15 # The toplevel directory of the source tree. This is the directory
16 # that contains this "Makefile.in" and the "configure.in" script.
18 TOP = @abs_srcdir@
20 # C Compiler and options for use in building executables that
21 # will run on the platform that is doing the build.
23 BCC = @BUILD_CC@ @BUILD_CFLAGS@
25 # TCC is the 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.) Separate CC and CFLAGS macros
28 # are provide so that these aspects of the build process can be changed
29 # on the "make" command-line. Ex: "make CC=clang CFLAGS=-fsanitize=undefined"
31 CC = @CC@
32 CFLAGS = @CPPFLAGS@ @CFLAGS@
33 TCC = ${CC} ${CFLAGS} -I. -I${TOP}/src -I${TOP}/ext/rtree -I${TOP}/ext/icu
34 TCC += -I${TOP}/ext/fts3 -I${TOP}/ext/async -I${TOP}/ext/session
35 TCC += -I${TOP}/ext/userauth
37 # Define this for the autoconf-based build, so that the code knows it can
38 # include the generated config.h
40 TCC += -D_HAVE_SQLITE_CONFIG_H -DBUILD_sqlite
42 # Define -DNDEBUG to compile without debugging (i.e., for production usage)
43 # Omitting the define will cause extra debugging code to be inserted and
44 # includes extra comments when "EXPLAIN stmt" is used.
46 TCC += @TARGET_DEBUG@
48 # Compiler options needed for programs that use the TCL library.
50 TCC += @TCL_INCLUDE_SPEC@
52 # The library that programs using TCL must link against.
54 LIBTCL = @TCL_LIB_SPEC@
56 # Compiler options needed for programs that use the readline() library.
58 READLINE_FLAGS = -DHAVE_READLINE=@TARGET_HAVE_READLINE@ @TARGET_READLINE_INC@
59 READLINE_FLAGS += -DHAVE_EDITLINE=@TARGET_HAVE_EDITLINE@
61 # The library that programs using readline() must link against.
63 LIBREADLINE = @TARGET_READLINE_LIBS@
65 # Should the database engine be compiled threadsafe
67 TCC += -DSQLITE_THREADSAFE=@SQLITE_THREADSAFE@
69 # Any target libraries which libsqlite must be linked against
71 TLIBS = @LIBS@ $(LIBS)
73 # Flags controlling use of the in memory btree implementation
75 # SQLITE_TEMP_STORE is 0 to force temporary tables to be in a file, 1 to
76 # default to file, 2 to default to memory, and 3 to force temporary
77 # tables to always be in memory.
79 TEMP_STORE = -DSQLITE_TEMP_STORE=@TEMP_STORE@
81 # Enable/disable loadable extensions, and other optional features
82 # based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*).
83 # The same set of OMIT and ENABLE flags should be passed to the
84 # LEMON parser generator and the mkkeywordhash tool as well.
85 OPT_FEATURE_FLAGS = @OPT_FEATURE_FLAGS@
87 TCC += $(OPT_FEATURE_FLAGS)
89 # Add in any optional parameters specified on the make commane line
90 # ie. make "OPTS=-DSQLITE_ENABLE_FOO=1 -DSQLITE_OMIT_FOO=1".
91 TCC += $(OPTS)
93 # Add in compile-time options for some libraries used by extensions
94 TCC += @HAVE_ZLIB@
96 # Version numbers and release number for the SQLite being compiled.
98 VERSION = @VERSION@
99 VERSION_NUMBER = @VERSION_NUMBER@
100 RELEASE = @RELEASE@
102 # Filename extensions
104 BEXE = @BUILD_EXEEXT@
105 TEXE = @TARGET_EXEEXT@
107 # The following variable is "1" if the configure script was able to locate
108 # the tclConfig.sh file. It is an empty string otherwise. When this
109 # variable is "1", the TCL extension library (libtclsqlite3.so) is built
110 # and installed.
112 HAVE_TCL = @HAVE_TCL@
114 # This is the command to use for tclsh - normally just "tclsh", but we may
115 # know the specific version we want to use
117 TCLSH_CMD = @TCLSH_CMD@
119 # Where do we want to install the tcl plugin
121 TCLLIBDIR = @TCLLIBDIR@
123 # The suffix used on shared libraries. Ex: ".dll", ".so", ".dylib"
125 SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@
127 # If gcov support was enabled by the configure script, add the appropriate
128 # flags here. It's not always as easy as just having the user add the right
129 # CFLAGS / LDFLAGS, because libtool wants to use CFLAGS when linking, which
130 # causes build errors with -fprofile-arcs -ftest-coverage with some GCCs.
131 # Supposedly GCC does the right thing if you use --coverage, but in
132 # practice it still fails. See:
134 # http://www.mail-archive.com/debian-gcc@lists.debian.org/msg26197.html
136 # for more info.
138 GCOV_CFLAGS1 = -DSQLITE_COVERAGE_TEST=1 -fprofile-arcs -ftest-coverage
139 GCOV_LDFLAGS1 = -lgcov
140 USE_GCOV = @USE_GCOV@
141 LTCOMPILE_EXTRAS += $(GCOV_CFLAGS$(USE_GCOV))
142 LTLINK_EXTRAS += $(GCOV_LDFLAGS$(USE_GCOV))
145 # The directory into which to store package information for
147 # Some standard variables and programs
149 prefix = @prefix@
150 exec_prefix = @exec_prefix@
151 libdir = @libdir@
152 pkgconfigdir = $(libdir)/pkgconfig
153 bindir = @bindir@
154 includedir = @includedir@
155 INSTALL = @INSTALL@
156 LIBTOOL = ./libtool
157 ALLOWRELEASE = @ALLOWRELEASE@
159 # libtool compile/link/install
160 LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(TCC) $(LTCOMPILE_EXTRAS)
161 LTLINK = $(LIBTOOL) --mode=link $(TCC) $(LTCOMPILE_EXTRAS) @LDFLAGS@ $(LTLINK_EXTRAS)
162 LTINSTALL = $(LIBTOOL) --mode=install $(INSTALL)
164 # You should not have to change anything below this line
165 ###############################################################################
167 USE_AMALGAMATION = @USE_AMALGAMATION@
169 # Object files for the SQLite library (non-amalgamation).
171 LIBOBJS0 = alter.lo analyze.lo attach.lo auth.lo \
172 backup.lo bitvec.lo btmutex.lo btree.lo build.lo \
173 callback.lo complete.lo ctime.lo \
174 date.lo dbpage.lo dbstat.lo delete.lo \
175 expr.lo fault.lo fkey.lo \
176 fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo \
177 fts3_porter.lo fts3_snippet.lo fts3_tokenizer.lo fts3_tokenizer1.lo \
178 fts3_tokenize_vtab.lo \
179 fts3_unicode.lo fts3_unicode2.lo fts3_write.lo \
180 fts5.lo \
181 func.lo global.lo hash.lo \
182 icu.lo insert.lo json1.lo legacy.lo loadext.lo \
183 main.lo malloc.lo mem0.lo mem1.lo mem2.lo mem3.lo mem5.lo \
184 memdb.lo memjournal.lo \
185 mutex.lo mutex_noop.lo mutex_unix.lo mutex_w32.lo \
186 notify.lo opcodes.lo os.lo os_unix.lo os_win.lo \
187 pager.lo parse.lo pcache.lo pcache1.lo pragma.lo prepare.lo printf.lo \
188 random.lo resolve.lo rowset.lo rtree.lo \
189 sqlite3session.lo select.lo sqlite3rbu.lo status.lo stmt.lo \
190 table.lo threads.lo tokenize.lo treeview.lo trigger.lo \
191 update.lo userauth.lo upsert.lo util.lo vacuum.lo \
192 vdbe.lo vdbeapi.lo vdbeaux.lo vdbeblob.lo vdbemem.lo vdbesort.lo \
193 vdbetrace.lo vdbevtab.lo \
194 wal.lo walker.lo where.lo wherecode.lo whereexpr.lo \
195 window.lo utf.lo vtab.lo
197 # Object files for the amalgamation.
199 LIBOBJS1 = sqlite3.lo
201 # Determine the real value of LIBOBJ based on the 'configure' script
203 LIBOBJ = $(LIBOBJS$(USE_AMALGAMATION))
206 # All of the source code files.
208 SRC = \
209 $(TOP)/src/alter.c \
210 $(TOP)/src/analyze.c \
211 $(TOP)/src/attach.c \
212 $(TOP)/src/auth.c \
213 $(TOP)/src/backup.c \
214 $(TOP)/src/bitvec.c \
215 $(TOP)/src/btmutex.c \
216 $(TOP)/src/btree.c \
217 $(TOP)/src/btree.h \
218 $(TOP)/src/btreeInt.h \
219 $(TOP)/src/build.c \
220 $(TOP)/src/callback.c \
221 $(TOP)/src/complete.c \
222 $(TOP)/src/ctime.c \
223 $(TOP)/src/date.c \
224 $(TOP)/src/dbpage.c \
225 $(TOP)/src/dbstat.c \
226 $(TOP)/src/delete.c \
227 $(TOP)/src/expr.c \
228 $(TOP)/src/fault.c \
229 $(TOP)/src/fkey.c \
230 $(TOP)/src/func.c \
231 $(TOP)/src/global.c \
232 $(TOP)/src/hash.c \
233 $(TOP)/src/hash.h \
234 $(TOP)/src/hwtime.h \
235 $(TOP)/src/insert.c \
236 $(TOP)/src/legacy.c \
237 $(TOP)/src/loadext.c \
238 $(TOP)/src/main.c \
239 $(TOP)/src/malloc.c \
240 $(TOP)/src/mem0.c \
241 $(TOP)/src/mem1.c \
242 $(TOP)/src/mem2.c \
243 $(TOP)/src/mem3.c \
244 $(TOP)/src/mem5.c \
245 $(TOP)/src/memdb.c \
246 $(TOP)/src/memjournal.c \
247 $(TOP)/src/msvc.h \
248 $(TOP)/src/mutex.c \
249 $(TOP)/src/mutex.h \
250 $(TOP)/src/mutex_noop.c \
251 $(TOP)/src/mutex_unix.c \
252 $(TOP)/src/mutex_w32.c \
253 $(TOP)/src/notify.c \
254 $(TOP)/src/os.c \
255 $(TOP)/src/os.h \
256 $(TOP)/src/os_common.h \
257 $(TOP)/src/os_setup.h \
258 $(TOP)/src/os_unix.c \
259 $(TOP)/src/os_win.c \
260 $(TOP)/src/os_win.h \
261 $(TOP)/src/pager.c \
262 $(TOP)/src/pager.h \
263 $(TOP)/src/parse.y \
264 $(TOP)/src/pcache.c \
265 $(TOP)/src/pcache.h \
266 $(TOP)/src/pcache1.c \
267 $(TOP)/src/pragma.c \
268 $(TOP)/src/pragma.h \
269 $(TOP)/src/prepare.c \
270 $(TOP)/src/printf.c \
271 $(TOP)/src/random.c \
272 $(TOP)/src/resolve.c \
273 $(TOP)/src/rowset.c \
274 $(TOP)/src/select.c \
275 $(TOP)/src/status.c \
276 $(TOP)/src/shell.c.in \
277 $(TOP)/src/sqlite.h.in \
278 $(TOP)/src/sqlite3ext.h \
279 $(TOP)/src/sqliteInt.h \
280 $(TOP)/src/sqliteLimit.h \
281 $(TOP)/src/table.c \
282 $(TOP)/src/tclsqlite.c \
283 $(TOP)/src/threads.c \
284 $(TOP)/src/tokenize.c \
285 $(TOP)/src/treeview.c \
286 $(TOP)/src/trigger.c \
287 $(TOP)/src/utf.c \
288 $(TOP)/src/update.c \
289 $(TOP)/src/upsert.c \
290 $(TOP)/src/util.c \
291 $(TOP)/src/vacuum.c \
292 $(TOP)/src/vdbe.c \
293 $(TOP)/src/vdbe.h \
294 $(TOP)/src/vdbeapi.c \
295 $(TOP)/src/vdbeaux.c \
296 $(TOP)/src/vdbeblob.c \
297 $(TOP)/src/vdbemem.c \
298 $(TOP)/src/vdbesort.c \
299 $(TOP)/src/vdbetrace.c \
300 $(TOP)/src/vdbevtab.c \
301 $(TOP)/src/vdbeInt.h \
302 $(TOP)/src/vtab.c \
303 $(TOP)/src/vxworks.h \
304 $(TOP)/src/wal.c \
305 $(TOP)/src/wal.h \
306 $(TOP)/src/walker.c \
307 $(TOP)/src/where.c \
308 $(TOP)/src/wherecode.c \
309 $(TOP)/src/whereexpr.c \
310 $(TOP)/src/whereInt.h \
311 $(TOP)/src/window.c
313 # Source code for extensions
315 SRC += \
316 $(TOP)/ext/fts1/fts1.c \
317 $(TOP)/ext/fts1/fts1.h \
318 $(TOP)/ext/fts1/fts1_hash.c \
319 $(TOP)/ext/fts1/fts1_hash.h \
320 $(TOP)/ext/fts1/fts1_porter.c \
321 $(TOP)/ext/fts1/fts1_tokenizer.h \
322 $(TOP)/ext/fts1/fts1_tokenizer1.c
323 SRC += \
324 $(TOP)/ext/fts2/fts2.c \
325 $(TOP)/ext/fts2/fts2.h \
326 $(TOP)/ext/fts2/fts2_hash.c \
327 $(TOP)/ext/fts2/fts2_hash.h \
328 $(TOP)/ext/fts2/fts2_icu.c \
329 $(TOP)/ext/fts2/fts2_porter.c \
330 $(TOP)/ext/fts2/fts2_tokenizer.h \
331 $(TOP)/ext/fts2/fts2_tokenizer.c \
332 $(TOP)/ext/fts2/fts2_tokenizer1.c
333 SRC += \
334 $(TOP)/ext/fts3/fts3.c \
335 $(TOP)/ext/fts3/fts3.h \
336 $(TOP)/ext/fts3/fts3Int.h \
337 $(TOP)/ext/fts3/fts3_aux.c \
338 $(TOP)/ext/fts3/fts3_expr.c \
339 $(TOP)/ext/fts3/fts3_hash.c \
340 $(TOP)/ext/fts3/fts3_hash.h \
341 $(TOP)/ext/fts3/fts3_icu.c \
342 $(TOP)/ext/fts3/fts3_porter.c \
343 $(TOP)/ext/fts3/fts3_snippet.c \
344 $(TOP)/ext/fts3/fts3_tokenizer.h \
345 $(TOP)/ext/fts3/fts3_tokenizer.c \
346 $(TOP)/ext/fts3/fts3_tokenizer1.c \
347 $(TOP)/ext/fts3/fts3_tokenize_vtab.c \
348 $(TOP)/ext/fts3/fts3_unicode.c \
349 $(TOP)/ext/fts3/fts3_unicode2.c \
350 $(TOP)/ext/fts3/fts3_write.c
351 SRC += \
352 $(TOP)/ext/icu/sqliteicu.h \
353 $(TOP)/ext/icu/icu.c
354 SRC += \
355 $(TOP)/ext/rtree/rtree.h \
356 $(TOP)/ext/rtree/rtree.c \
357 $(TOP)/ext/rtree/geopoly.c
358 SRC += \
359 $(TOP)/ext/session/sqlite3session.c \
360 $(TOP)/ext/session/sqlite3session.h
361 SRC += \
362 $(TOP)/ext/userauth/userauth.c \
363 $(TOP)/ext/userauth/sqlite3userauth.h
364 SRC += \
365 $(TOP)/ext/rbu/sqlite3rbu.h \
366 $(TOP)/ext/rbu/sqlite3rbu.c
367 SRC += \
368 $(TOP)/ext/misc/json1.c \
369 $(TOP)/ext/misc/stmt.c
371 # Generated source code files
373 SRC += \
374 keywordhash.h \
375 opcodes.c \
376 opcodes.h \
377 parse.c \
378 parse.h \
379 config.h \
380 shell.c \
381 sqlite3.h
383 # Source code to the test files.
385 TESTSRC = \
386 $(TOP)/src/test1.c \
387 $(TOP)/src/test2.c \
388 $(TOP)/src/test3.c \
389 $(TOP)/src/test4.c \
390 $(TOP)/src/test5.c \
391 $(TOP)/src/test6.c \
392 $(TOP)/src/test7.c \
393 $(TOP)/src/test8.c \
394 $(TOP)/src/test9.c \
395 $(TOP)/src/test_autoext.c \
396 $(TOP)/src/test_async.c \
397 $(TOP)/src/test_backup.c \
398 $(TOP)/src/test_bestindex.c \
399 $(TOP)/src/test_blob.c \
400 $(TOP)/src/test_btree.c \
401 $(TOP)/src/test_config.c \
402 $(TOP)/src/test_delete.c \
403 $(TOP)/src/test_demovfs.c \
404 $(TOP)/src/test_devsym.c \
405 $(TOP)/src/test_fs.c \
406 $(TOP)/src/test_func.c \
407 $(TOP)/src/test_hexio.c \
408 $(TOP)/src/test_init.c \
409 $(TOP)/src/test_intarray.c \
410 $(TOP)/src/test_journal.c \
411 $(TOP)/src/test_malloc.c \
412 $(TOP)/src/test_md5.c \
413 $(TOP)/src/test_multiplex.c \
414 $(TOP)/src/test_mutex.c \
415 $(TOP)/src/test_onefile.c \
416 $(TOP)/src/test_osinst.c \
417 $(TOP)/src/test_pcache.c \
418 $(TOP)/src/test_quota.c \
419 $(TOP)/src/test_rtree.c \
420 $(TOP)/src/test_schema.c \
421 $(TOP)/src/test_server.c \
422 $(TOP)/src/test_superlock.c \
423 $(TOP)/src/test_syscall.c \
424 $(TOP)/src/test_tclsh.c \
425 $(TOP)/src/test_tclvar.c \
426 $(TOP)/src/test_thread.c \
427 $(TOP)/src/test_vdbecov.c \
428 $(TOP)/src/test_vfs.c \
429 $(TOP)/src/test_windirent.c \
430 $(TOP)/src/test_window.c \
431 $(TOP)/src/test_wsd.c \
432 $(TOP)/ext/fts3/fts3_term.c \
433 $(TOP)/ext/fts3/fts3_test.c \
434 $(TOP)/ext/session/test_session.c \
435 $(TOP)/ext/rbu/test_rbu.c
437 # Statically linked extensions
439 TESTSRC += \
440 $(TOP)/ext/expert/sqlite3expert.c \
441 $(TOP)/ext/expert/test_expert.c \
442 $(TOP)/ext/misc/amatch.c \
443 $(TOP)/ext/misc/carray.c \
444 $(TOP)/ext/misc/closure.c \
445 $(TOP)/ext/misc/csv.c \
446 $(TOP)/ext/misc/decimal.c \
447 $(TOP)/ext/misc/eval.c \
448 $(TOP)/ext/misc/explain.c \
449 $(TOP)/ext/misc/fileio.c \
450 $(TOP)/ext/misc/fuzzer.c \
451 $(TOP)/ext/fts5/fts5_tcl.c \
452 $(TOP)/ext/fts5/fts5_test_mi.c \
453 $(TOP)/ext/fts5/fts5_test_tok.c \
454 $(TOP)/ext/misc/ieee754.c \
455 $(TOP)/ext/misc/mmapwarm.c \
456 $(TOP)/ext/misc/nextchar.c \
457 $(TOP)/ext/misc/normalize.c \
458 $(TOP)/ext/misc/percentile.c \
459 $(TOP)/ext/misc/prefixes.c \
460 $(TOP)/ext/misc/regexp.c \
461 $(TOP)/ext/misc/remember.c \
462 $(TOP)/ext/misc/series.c \
463 $(TOP)/ext/misc/spellfix.c \
464 $(TOP)/ext/misc/totype.c \
465 $(TOP)/ext/misc/unionvtab.c \
466 $(TOP)/ext/misc/wholenumber.c \
467 $(TOP)/ext/misc/zipfile.c \
468 $(TOP)/ext/userauth/userauth.c
470 # Source code to the library files needed by the test fixture
472 TESTSRC2 = \
473 $(TOP)/src/attach.c \
474 $(TOP)/src/backup.c \
475 $(TOP)/src/bitvec.c \
476 $(TOP)/src/btree.c \
477 $(TOP)/src/build.c \
478 $(TOP)/src/ctime.c \
479 $(TOP)/src/date.c \
480 $(TOP)/src/dbpage.c \
481 $(TOP)/src/dbstat.c \
482 $(TOP)/src/expr.c \
483 $(TOP)/src/func.c \
484 $(TOP)/src/global.c \
485 $(TOP)/src/insert.c \
486 $(TOP)/src/wal.c \
487 $(TOP)/src/main.c \
488 $(TOP)/src/mem5.c \
489 $(TOP)/src/os.c \
490 $(TOP)/src/os_unix.c \
491 $(TOP)/src/os_win.c \
492 $(TOP)/src/pager.c \
493 $(TOP)/src/pragma.c \
494 $(TOP)/src/prepare.c \
495 $(TOP)/src/printf.c \
496 $(TOP)/src/random.c \
497 $(TOP)/src/pcache.c \
498 $(TOP)/src/pcache1.c \
499 $(TOP)/src/select.c \
500 $(TOP)/src/tokenize.c \
501 $(TOP)/src/utf.c \
502 $(TOP)/src/util.c \
503 $(TOP)/src/vdbeapi.c \
504 $(TOP)/src/vdbeaux.c \
505 $(TOP)/src/vdbe.c \
506 $(TOP)/src/vdbemem.c \
507 $(TOP)/src/vdbetrace.c \
508 $(TOP)/src/vdbevtab.c \
509 $(TOP)/src/where.c \
510 $(TOP)/src/wherecode.c \
511 $(TOP)/src/whereexpr.c \
512 $(TOP)/src/window.c \
513 parse.c \
514 $(TOP)/ext/fts3/fts3.c \
515 $(TOP)/ext/fts3/fts3_aux.c \
516 $(TOP)/ext/fts3/fts3_expr.c \
517 $(TOP)/ext/fts3/fts3_term.c \
518 $(TOP)/ext/fts3/fts3_tokenizer.c \
519 $(TOP)/ext/fts3/fts3_write.c \
520 $(TOP)/ext/async/sqlite3async.c \
521 $(TOP)/ext/session/sqlite3session.c \
522 $(TOP)/ext/misc/stmt.c
524 # Header files used by all library source files.
526 HDR = \
527 $(TOP)/src/btree.h \
528 $(TOP)/src/btreeInt.h \
529 $(TOP)/src/hash.h \
530 $(TOP)/src/hwtime.h \
531 keywordhash.h \
532 $(TOP)/src/msvc.h \
533 $(TOP)/src/mutex.h \
534 opcodes.h \
535 $(TOP)/src/os.h \
536 $(TOP)/src/os_common.h \
537 $(TOP)/src/os_setup.h \
538 $(TOP)/src/os_win.h \
539 $(TOP)/src/pager.h \
540 $(TOP)/src/pcache.h \
541 parse.h \
542 $(TOP)/src/pragma.h \
543 sqlite3.h \
544 $(TOP)/src/sqlite3ext.h \
545 $(TOP)/src/sqliteInt.h \
546 $(TOP)/src/sqliteLimit.h \
547 $(TOP)/src/vdbe.h \
548 $(TOP)/src/vdbeInt.h \
549 $(TOP)/src/vxworks.h \
550 $(TOP)/src/whereInt.h \
551 config.h
553 # Header files used by extensions
555 EXTHDR += \
556 $(TOP)/ext/fts1/fts1.h \
557 $(TOP)/ext/fts1/fts1_hash.h \
558 $(TOP)/ext/fts1/fts1_tokenizer.h
559 EXTHDR += \
560 $(TOP)/ext/fts2/fts2.h \
561 $(TOP)/ext/fts2/fts2_hash.h \
562 $(TOP)/ext/fts2/fts2_tokenizer.h
563 EXTHDR += \
564 $(TOP)/ext/fts3/fts3.h \
565 $(TOP)/ext/fts3/fts3Int.h \
566 $(TOP)/ext/fts3/fts3_hash.h \
567 $(TOP)/ext/fts3/fts3_tokenizer.h
568 EXTHDR += \
569 $(TOP)/ext/rtree/rtree.h \
570 $(TOP)/ext/rtree/geopoly.c
571 EXTHDR += \
572 $(TOP)/ext/icu/sqliteicu.h
573 EXTHDR += \
574 $(TOP)/ext/rtree/sqlite3rtree.h
575 EXTHDR += \
576 $(TOP)/ext/userauth/sqlite3userauth.h
578 # executables needed for testing
580 TESTPROGS = \
581 testfixture$(TEXE) \
582 sqlite3$(TEXE) \
583 sqlite3_analyzer$(TEXE) \
584 sqldiff$(TEXE) \
585 dbhash$(TEXE) \
586 sqltclsh$(TEXE)
588 # Databases containing fuzzer test cases
590 FUZZDATA = \
591 $(TOP)/test/fuzzdata1.db \
592 $(TOP)/test/fuzzdata2.db \
593 $(TOP)/test/fuzzdata3.db \
594 $(TOP)/test/fuzzdata4.db \
595 $(TOP)/test/fuzzdata5.db \
596 $(TOP)/test/fuzzdata6.db \
597 $(TOP)/test/fuzzdata7.db \
598 $(TOP)/test/fuzzdata8.db
600 # Standard options to testfixture
602 TESTOPTS = --verbose=file --output=test-out.txt
604 # Extra compiler options for various shell tools
606 SHELL_OPT = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS4
607 #SHELL_OPT += -DSQLITE_ENABLE_FTS5
608 SHELL_OPT += -DSQLITE_ENABLE_RTREE
609 SHELL_OPT += -DSQLITE_ENABLE_EXPLAIN_COMMENTS
610 SHELL_OPT += -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
611 SHELL_OPT += -DSQLITE_ENABLE_STMTVTAB
612 SHELL_OPT += -DSQLITE_ENABLE_DBPAGE_VTAB
613 SHELL_OPT += -DSQLITE_ENABLE_DBSTAT_VTAB
614 SHELL_OPT += -DSQLITE_ENABLE_BYTECODE_VTAB
615 SHELL_OPT += -DSQLITE_ENABLE_OFFSET_SQL_FUNC
616 SHELL_OPT += -DSQLITE_ENABLE_DESERIALIZE
617 FUZZERSHELL_OPT = -DSQLITE_ENABLE_JSON1
618 FUZZCHECK_OPT = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMSYS5 -DSQLITE_OSS_FUZZ
619 FUZZCHECK_OPT += -DSQLITE_MAX_MEMORY=50000000
620 FUZZCHECK_OPT += -DSQLITE_PRINTF_PRECISION_LIMIT=1000
621 FUZZCHECK_OPT += -DSQLITE_ENABLE_DESERIALIZE
622 FUZZCHECK_OPT += -DSQLITE_ENABLE_FTS4
623 FUZZCHECK_OPT += -DSQLITE_ENABLE_FTS3_PARENTHESIS
624 #FUZZCHECK_OPT += -DSQLITE_ENABLE_FTS5
625 FUZZCHECK_OPT += -DSQLITE_ENABLE_RTREE
626 FUZZCHECK_OPT += -DSQLITE_ENABLE_GEOPOLY
627 FUZZCHECK_OPT += -DSQLITE_ENABLE_DBSTAT_VTAB
628 FUZZCHECK_OPT += -DSQLITE_ENABLE_BYTECODE_VTAB
629 FUZZCHECK_SRC = $(TOP)/test/fuzzcheck.c $(TOP)/test/ossfuzz.c
630 DBFUZZ_OPT =
632 # This is the default Makefile target. The objects listed here
633 # are what get build when you type just "make" with no arguments.
635 all: sqlite3.h libsqlite3.la sqlite3$(TEXE) $(HAVE_TCL:1=libtclsqlite3.la)
637 Makefile: $(TOP)/Makefile.in
638 ./config.status
640 sqlite3.pc: $(TOP)/sqlite3.pc.in
641 ./config.status
643 libsqlite3.la: $(LIBOBJ)
644 $(LTLINK) -no-undefined -o $@ $(LIBOBJ) $(TLIBS) \
645 ${ALLOWRELEASE} -rpath "$(libdir)" -version-info "8:6:8"
647 libtclsqlite3.la: tclsqlite.lo libsqlite3.la
648 $(LTLINK) -no-undefined -o $@ tclsqlite.lo \
649 libsqlite3.la @TCL_STUB_LIB_SPEC@ $(TLIBS) \
650 -rpath "$(TCLLIBDIR)" \
651 -version-info "8:6:8" \
652 -avoid-version
654 sqlite3$(TEXE): shell.c sqlite3.c
655 $(LTLINK) $(READLINE_FLAGS) $(SHELL_OPT) -o $@ \
656 shell.c sqlite3.c \
657 $(LIBREADLINE) $(TLIBS) -rpath "$(libdir)"
659 sqldiff$(TEXE): $(TOP)/tool/sqldiff.c sqlite3.lo sqlite3.h
660 $(LTLINK) -o $@ $(TOP)/tool/sqldiff.c sqlite3.lo $(TLIBS)
662 dbhash$(TEXE): $(TOP)/tool/dbhash.c sqlite3.lo sqlite3.h
663 $(LTLINK) -o $@ $(TOP)/tool/dbhash.c sqlite3.lo $(TLIBS)
665 scrub$(TEXE): $(TOP)/ext/misc/scrub.c sqlite3.lo
666 $(LTLINK) -o $@ -I. -DSCRUB_STANDALONE \
667 $(TOP)/ext/misc/scrub.c sqlite3.lo $(TLIBS)
669 srcck1$(BEXE): $(TOP)/tool/srcck1.c
670 $(BCC) -o srcck1$(BEXE) $(TOP)/tool/srcck1.c
672 sourcetest: srcck1$(BEXE) sqlite3.c
673 ./srcck1 sqlite3.c
675 fuzzershell$(TEXE): $(TOP)/tool/fuzzershell.c sqlite3.c sqlite3.h
676 $(LTLINK) -o $@ $(FUZZERSHELL_OPT) \
677 $(TOP)/tool/fuzzershell.c sqlite3.c $(TLIBS)
679 fuzzcheck$(TEXE): $(FUZZCHECK_SRC) sqlite3.c sqlite3.h
680 $(LTLINK) -o $@ $(FUZZCHECK_OPT) $(FUZZCHECK_SRC) sqlite3.c $(TLIBS)
682 ossshell$(TEXE): $(TOP)/test/ossfuzz.c $(TOP)/test/ossshell.c sqlite3.c sqlite3.h
683 $(LTLINK) -o $@ $(FUZZCHECK_OPT) $(TOP)/test/ossshell.c \
684 $(TOP)/test/ossfuzz.c sqlite3.c $(TLIBS)
686 sessionfuzz$(TEXE): $(TOP)/test/sessionfuzz.c sqlite3.c sqlite3.h
687 $(LTLINK) -o $@ $(TOP)/test/sessionfuzz.c $(TLIBS)
689 dbfuzz$(TEXE): $(TOP)/test/dbfuzz.c sqlite3.c sqlite3.h
690 $(LTLINK) -o $@ $(DBFUZZ_OPT) $(TOP)/test/dbfuzz.c sqlite3.c $(TLIBS)
692 DBFUZZ2_OPTS = \
693 -DSQLITE_THREADSAFE=0 \
694 -DSQLITE_OMIT_LOAD_EXTENSION \
695 -DSQLITE_ENABLE_DESERIALIZE \
696 -DSQLITE_DEBUG \
697 -DSQLITE_ENABLE_DBSTAT_VTAB \
698 -DSQLITE_ENABLE_BYTECODE_VTAB \
699 -DSQLITE_ENABLE_RTREE \
700 -DSQLITE_ENABLE_FTS4 \
701 -DSQLITE_ENABLE_FTS5
703 dbfuzz2$(TEXE): $(TOP)/test/dbfuzz2.c sqlite3.c sqlite3.h
704 $(CC) $(OPT_FEATURE_FLAGS) $(OPTS) -I. -g -O0 \
705 -DSTANDALONE -o dbfuzz2 \
706 $(DBFUZZ2_OPTS) $(TOP)/test/dbfuzz2.c sqlite3.c $(TLIBS)
707 mkdir -p dbfuzz2-dir
708 cp $(TOP)/test/dbfuzz2-seed* dbfuzz2-dir
710 dbfuzz2-asan: $(TOP)/test/dbfuzz2.c sqlite3.c sqlite3.h
711 clang-6.0 $(OPT_FEATURE_FLAGS) $(OPTS) -I. -g -O0 \
712 -fsanitize=fuzzer,undefined,address -o dbfuzz2-asan \
713 $(DBFUZZ2_OPTS) $(TOP)/test/dbfuzz2.c sqlite3.c $(TLIBS)
714 mkdir -p dbfuzz2-dir
715 cp $(TOP)/test/dbfuzz2-seed* dbfuzz2-dir
717 dbfuzz2-msan: $(TOP)/test/dbfuzz2.c sqlite3.c sqlite3.h
718 clang-6.0 $(OPT_FEATURE_FLAGS) $(OPTS) -I. -g -O0 \
719 -fsanitize=fuzzer,undefined,memory -o dbfuzz2-msan \
720 $(DBFUZZ2_OPTS) $(TOP)/test/dbfuzz2.c sqlite3.c $(TLIBS)
721 mkdir -p dbfuzz2-dir
722 cp $(TOP)/test/dbfuzz2-seed* dbfuzz2-dir
724 mptester$(TEXE): sqlite3.lo $(TOP)/mptest/mptest.c
725 $(LTLINK) -o $@ -I. $(TOP)/mptest/mptest.c sqlite3.lo \
726 $(TLIBS) -rpath "$(libdir)"
728 MPTEST1=./mptester$(TEXE) mptest.db $(TOP)/mptest/crash01.test --repeat 20
729 MPTEST2=./mptester$(TEXE) mptest.db $(TOP)/mptest/multiwrite01.test --repeat 20
730 mptest: mptester$(TEXE)
731 rm -f mptest.db
732 $(MPTEST1) --journalmode DELETE
733 $(MPTEST2) --journalmode WAL
734 $(MPTEST1) --journalmode WAL
735 $(MPTEST2) --journalmode PERSIST
736 $(MPTEST1) --journalmode PERSIST
737 $(MPTEST2) --journalmode TRUNCATE
738 $(MPTEST1) --journalmode TRUNCATE
739 $(MPTEST2) --journalmode DELETE
742 # This target creates a directory named "tsrc" and fills it with
743 # copies of all of the C source code and header files needed to
744 # build on the target system. Some of the C source code and header
745 # files are automatically generated. This target takes care of
746 # all that automatic generation.
748 .target_source: $(SRC) $(TOP)/tool/vdbe-compress.tcl fts5.c
749 rm -rf tsrc
750 mkdir tsrc
751 cp -f $(SRC) tsrc
752 rm tsrc/sqlite.h.in tsrc/parse.y
753 $(TCLSH_CMD) $(TOP)/tool/vdbe-compress.tcl $(OPTS) <tsrc/vdbe.c >vdbe.new
754 mv vdbe.new tsrc/vdbe.c
755 cp fts5.c fts5.h tsrc
756 touch .target_source
758 sqlite3.c: .target_source $(TOP)/tool/mksqlite3c.tcl
759 $(TCLSH_CMD) $(TOP)/tool/mksqlite3c.tcl
760 cp tsrc/sqlite3ext.h .
761 cp $(TOP)/ext/session/sqlite3session.h .
763 sqlite3ext.h: .target_source
764 cp tsrc/sqlite3ext.h .
766 tclsqlite3.c: sqlite3.c
767 echo '#ifndef USE_SYSTEM_SQLITE' >tclsqlite3.c
768 cat sqlite3.c >>tclsqlite3.c
769 echo '#endif /* USE_SYSTEM_SQLITE */' >>tclsqlite3.c
770 cat $(TOP)/src/tclsqlite.c >>tclsqlite3.c
772 sqlite3-all.c: sqlite3.c $(TOP)/tool/split-sqlite3c.tcl
773 $(TCLSH_CMD) $(TOP)/tool/split-sqlite3c.tcl
775 # Rule to build the amalgamation
777 sqlite3.lo: sqlite3.c
778 $(LTCOMPILE) $(TEMP_STORE) -c sqlite3.c
780 # Rules to build the LEMON compiler generator
782 lemon$(BEXE): $(TOP)/tool/lemon.c $(TOP)/tool/lempar.c
783 $(BCC) -o $@ $(TOP)/tool/lemon.c
784 cp $(TOP)/tool/lempar.c .
786 # Rules to build the program that generates the source-id
788 mksourceid$(BEXE): $(TOP)/tool/mksourceid.c
789 $(BCC) -o $@ $(TOP)/tool/mksourceid.c
791 # Rules to build individual *.o files from generated *.c files. This
792 # applies to:
794 # parse.o
795 # opcodes.o
797 parse.lo: parse.c $(HDR)
798 $(LTCOMPILE) $(TEMP_STORE) -c parse.c
800 opcodes.lo: opcodes.c
801 $(LTCOMPILE) $(TEMP_STORE) -c opcodes.c
803 # Rules to build individual *.o files from files in the src directory.
805 alter.lo: $(TOP)/src/alter.c $(HDR)
806 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/alter.c
808 analyze.lo: $(TOP)/src/analyze.c $(HDR)
809 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/analyze.c
811 attach.lo: $(TOP)/src/attach.c $(HDR)
812 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/attach.c
814 auth.lo: $(TOP)/src/auth.c $(HDR)
815 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/auth.c
817 backup.lo: $(TOP)/src/backup.c $(HDR)
818 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/backup.c
820 bitvec.lo: $(TOP)/src/bitvec.c $(HDR)
821 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/bitvec.c
823 btmutex.lo: $(TOP)/src/btmutex.c $(HDR)
824 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/btmutex.c
826 btree.lo: $(TOP)/src/btree.c $(HDR) $(TOP)/src/pager.h
827 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/btree.c
829 build.lo: $(TOP)/src/build.c $(HDR)
830 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/build.c
832 callback.lo: $(TOP)/src/callback.c $(HDR)
833 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/callback.c
835 complete.lo: $(TOP)/src/complete.c $(HDR)
836 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/complete.c
838 ctime.lo: $(TOP)/src/ctime.c $(HDR)
839 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/ctime.c
841 date.lo: $(TOP)/src/date.c $(HDR)
842 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/date.c
844 dbpage.lo: $(TOP)/src/dbpage.c $(HDR)
845 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/dbpage.c
847 dbstat.lo: $(TOP)/src/dbstat.c $(HDR)
848 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/dbstat.c
850 delete.lo: $(TOP)/src/delete.c $(HDR)
851 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/delete.c
853 expr.lo: $(TOP)/src/expr.c $(HDR)
854 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/expr.c
856 fault.lo: $(TOP)/src/fault.c $(HDR)
857 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/fault.c
859 fkey.lo: $(TOP)/src/fkey.c $(HDR)
860 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/fkey.c
862 func.lo: $(TOP)/src/func.c $(HDR)
863 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/func.c
865 global.lo: $(TOP)/src/global.c $(HDR)
866 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/global.c
868 hash.lo: $(TOP)/src/hash.c $(HDR)
869 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/hash.c
871 insert.lo: $(TOP)/src/insert.c $(HDR)
872 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/insert.c
874 legacy.lo: $(TOP)/src/legacy.c $(HDR)
875 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/legacy.c
877 loadext.lo: $(TOP)/src/loadext.c $(HDR)
878 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/loadext.c
880 main.lo: $(TOP)/src/main.c $(HDR)
881 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/main.c
883 malloc.lo: $(TOP)/src/malloc.c $(HDR)
884 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/malloc.c
886 mem0.lo: $(TOP)/src/mem0.c $(HDR)
887 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem0.c
889 mem1.lo: $(TOP)/src/mem1.c $(HDR)
890 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem1.c
892 mem2.lo: $(TOP)/src/mem2.c $(HDR)
893 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem2.c
895 mem3.lo: $(TOP)/src/mem3.c $(HDR)
896 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem3.c
898 mem5.lo: $(TOP)/src/mem5.c $(HDR)
899 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem5.c
901 memdb.lo: $(TOP)/src/memdb.c $(HDR)
902 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/memdb.c
904 memjournal.lo: $(TOP)/src/memjournal.c $(HDR)
905 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/memjournal.c
907 mutex.lo: $(TOP)/src/mutex.c $(HDR)
908 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex.c
910 mutex_noop.lo: $(TOP)/src/mutex_noop.c $(HDR)
911 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex_noop.c
913 mutex_unix.lo: $(TOP)/src/mutex_unix.c $(HDR)
914 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex_unix.c
916 mutex_w32.lo: $(TOP)/src/mutex_w32.c $(HDR)
917 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex_w32.c
919 notify.lo: $(TOP)/src/notify.c $(HDR)
920 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/notify.c
922 pager.lo: $(TOP)/src/pager.c $(HDR) $(TOP)/src/pager.h
923 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pager.c
925 pcache.lo: $(TOP)/src/pcache.c $(HDR) $(TOP)/src/pcache.h
926 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pcache.c
928 pcache1.lo: $(TOP)/src/pcache1.c $(HDR) $(TOP)/src/pcache.h
929 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pcache1.c
931 os.lo: $(TOP)/src/os.c $(HDR)
932 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os.c
934 os_unix.lo: $(TOP)/src/os_unix.c $(HDR)
935 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os_unix.c
937 os_win.lo: $(TOP)/src/os_win.c $(HDR)
938 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os_win.c
940 pragma.lo: $(TOP)/src/pragma.c $(HDR)
941 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pragma.c
943 prepare.lo: $(TOP)/src/prepare.c $(HDR)
944 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/prepare.c
946 printf.lo: $(TOP)/src/printf.c $(HDR)
947 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/printf.c
949 random.lo: $(TOP)/src/random.c $(HDR)
950 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/random.c
952 resolve.lo: $(TOP)/src/resolve.c $(HDR)
953 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/resolve.c
955 rowset.lo: $(TOP)/src/rowset.c $(HDR)
956 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/rowset.c
958 select.lo: $(TOP)/src/select.c $(HDR)
959 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/select.c
961 status.lo: $(TOP)/src/status.c $(HDR)
962 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/status.c
964 table.lo: $(TOP)/src/table.c $(HDR)
965 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/table.c
967 threads.lo: $(TOP)/src/threads.c $(HDR)
968 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/threads.c
970 tokenize.lo: $(TOP)/src/tokenize.c keywordhash.h $(HDR)
971 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/tokenize.c
973 treeview.lo: $(TOP)/src/treeview.c $(HDR)
974 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/treeview.c
976 trigger.lo: $(TOP)/src/trigger.c $(HDR)
977 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/trigger.c
979 update.lo: $(TOP)/src/update.c $(HDR)
980 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/update.c
982 upsert.lo: $(TOP)/src/upsert.c $(HDR)
983 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/upsert.c
985 utf.lo: $(TOP)/src/utf.c $(HDR)
986 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/utf.c
988 util.lo: $(TOP)/src/util.c $(HDR)
989 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/util.c
991 vacuum.lo: $(TOP)/src/vacuum.c $(HDR)
992 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vacuum.c
994 vdbe.lo: $(TOP)/src/vdbe.c $(HDR)
995 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbe.c
997 vdbeapi.lo: $(TOP)/src/vdbeapi.c $(HDR)
998 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbeapi.c
1000 vdbeaux.lo: $(TOP)/src/vdbeaux.c $(HDR)
1001 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbeaux.c
1003 vdbeblob.lo: $(TOP)/src/vdbeblob.c $(HDR)
1004 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbeblob.c
1006 vdbemem.lo: $(TOP)/src/vdbemem.c $(HDR)
1007 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbemem.c
1009 vdbesort.lo: $(TOP)/src/vdbesort.c $(HDR)
1010 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbesort.c
1012 vdbetrace.lo: $(TOP)/src/vdbetrace.c $(HDR)
1013 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbetrace.c
1015 vdbevtab.lo: $(TOP)/src/vdbevtab.c $(HDR)
1016 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbevtab.c
1018 vtab.lo: $(TOP)/src/vtab.c $(HDR)
1019 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vtab.c
1021 wal.lo: $(TOP)/src/wal.c $(HDR)
1022 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/wal.c
1024 walker.lo: $(TOP)/src/walker.c $(HDR)
1025 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/walker.c
1027 where.lo: $(TOP)/src/where.c $(HDR)
1028 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/where.c
1030 wherecode.lo: $(TOP)/src/wherecode.c $(HDR)
1031 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/wherecode.c
1033 whereexpr.lo: $(TOP)/src/whereexpr.c $(HDR)
1034 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/whereexpr.c
1036 window.lo: $(TOP)/src/window.c $(HDR)
1037 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/window.c
1039 tclsqlite.lo: $(TOP)/src/tclsqlite.c $(HDR)
1040 $(LTCOMPILE) -DUSE_TCL_STUBS=1 -c $(TOP)/src/tclsqlite.c
1042 tclsqlite-shell.lo: $(TOP)/src/tclsqlite.c $(HDR)
1043 $(LTCOMPILE) -DTCLSH -o $@ -c $(TOP)/src/tclsqlite.c
1045 tclsqlite-stubs.lo: $(TOP)/src/tclsqlite.c $(HDR)
1046 $(LTCOMPILE) -DUSE_TCL_STUBS=1 -o $@ -c $(TOP)/src/tclsqlite.c
1048 tclsqlite3$(TEXE): tclsqlite-shell.lo libsqlite3.la
1049 $(LTLINK) -o $@ tclsqlite-shell.lo \
1050 libsqlite3.la $(LIBTCL)
1052 # Rules to build opcodes.c and opcodes.h
1054 opcodes.c: opcodes.h $(TOP)/tool/mkopcodec.tcl
1055 $(TCLSH_CMD) $(TOP)/tool/mkopcodec.tcl opcodes.h >opcodes.c
1057 opcodes.h: parse.h $(TOP)/src/vdbe.c $(TOP)/tool/mkopcodeh.tcl
1058 cat parse.h $(TOP)/src/vdbe.c | $(TCLSH_CMD) $(TOP)/tool/mkopcodeh.tcl >opcodes.h
1060 # Rules to build parse.c and parse.h - the outputs of lemon.
1062 parse.h: parse.c
1064 parse.c: $(TOP)/src/parse.y lemon$(BEXE)
1065 cp $(TOP)/src/parse.y .
1066 ./lemon$(BEXE) $(OPT_FEATURE_FLAGS) $(OPTS) -S parse.y
1068 sqlite3.h: $(TOP)/src/sqlite.h.in $(TOP)/manifest mksourceid$(BEXE) $(TOP)/VERSION
1069 $(TCLSH_CMD) $(TOP)/tool/mksqlite3h.tcl $(TOP) >sqlite3.h
1071 sqlite3rc.h: $(TOP)/src/sqlite3.rc $(TOP)/VERSION
1072 echo '#ifndef SQLITE_RESOURCE_VERSION' >$@
1073 echo -n '#define SQLITE_RESOURCE_VERSION ' >>$@
1074 cat $(TOP)/VERSION | $(TCLSH_CMD) $(TOP)/tool/replace.tcl exact . , >>$@
1075 echo '#endif' >>sqlite3rc.h
1077 keywordhash.h: $(TOP)/tool/mkkeywordhash.c
1078 $(BCC) -o mkkeywordhash$(BEXE) $(OPT_FEATURE_FLAGS) $(OPTS) $(TOP)/tool/mkkeywordhash.c
1079 ./mkkeywordhash$(BEXE) >keywordhash.h
1081 # Source files that go into making shell.c
1082 SHELL_SRC = \
1083 $(TOP)/src/shell.c.in \
1084 $(TOP)/ext/misc/appendvfs.c \
1085 $(TOP)/ext/misc/completion.c \
1086 $(TOP)/ext/misc/decimal.c \
1087 $(TOP)/ext/misc/fileio.c \
1088 $(TOP)/ext/misc/ieee754.c \
1089 $(TOP)/ext/misc/shathree.c \
1090 $(TOP)/ext/misc/sqlar.c \
1091 $(TOP)/ext/misc/uint.c \
1092 $(TOP)/ext/expert/sqlite3expert.c \
1093 $(TOP)/ext/expert/sqlite3expert.h \
1094 $(TOP)/ext/misc/zipfile.c \
1095 $(TOP)/ext/misc/memtrace.c \
1096 $(TOP)/src/test_windirent.c
1098 shell.c: $(SHELL_SRC) $(TOP)/tool/mkshellc.tcl
1099 $(TCLSH_CMD) $(TOP)/tool/mkshellc.tcl >shell.c
1104 # Rules to build the extension objects.
1106 icu.lo: $(TOP)/ext/icu/icu.c $(HDR) $(EXTHDR)
1107 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/icu/icu.c
1109 fts2.lo: $(TOP)/ext/fts2/fts2.c $(HDR) $(EXTHDR)
1110 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2.c
1112 fts2_hash.lo: $(TOP)/ext/fts2/fts2_hash.c $(HDR) $(EXTHDR)
1113 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_hash.c
1115 fts2_icu.lo: $(TOP)/ext/fts2/fts2_icu.c $(HDR) $(EXTHDR)
1116 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_icu.c
1118 fts2_porter.lo: $(TOP)/ext/fts2/fts2_porter.c $(HDR) $(EXTHDR)
1119 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_porter.c
1121 fts2_tokenizer.lo: $(TOP)/ext/fts2/fts2_tokenizer.c $(HDR) $(EXTHDR)
1122 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_tokenizer.c
1124 fts2_tokenizer1.lo: $(TOP)/ext/fts2/fts2_tokenizer1.c $(HDR) $(EXTHDR)
1125 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_tokenizer1.c
1127 fts3.lo: $(TOP)/ext/fts3/fts3.c $(HDR) $(EXTHDR)
1128 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3.c
1130 fts3_aux.lo: $(TOP)/ext/fts3/fts3_aux.c $(HDR) $(EXTHDR)
1131 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_aux.c
1133 fts3_expr.lo: $(TOP)/ext/fts3/fts3_expr.c $(HDR) $(EXTHDR)
1134 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_expr.c
1136 fts3_hash.lo: $(TOP)/ext/fts3/fts3_hash.c $(HDR) $(EXTHDR)
1137 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_hash.c
1139 fts3_icu.lo: $(TOP)/ext/fts3/fts3_icu.c $(HDR) $(EXTHDR)
1140 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_icu.c
1142 fts3_porter.lo: $(TOP)/ext/fts3/fts3_porter.c $(HDR) $(EXTHDR)
1143 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_porter.c
1145 fts3_snippet.lo: $(TOP)/ext/fts3/fts3_snippet.c $(HDR) $(EXTHDR)
1146 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_snippet.c
1148 fts3_tokenizer.lo: $(TOP)/ext/fts3/fts3_tokenizer.c $(HDR) $(EXTHDR)
1149 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer.c
1151 fts3_tokenizer1.lo: $(TOP)/ext/fts3/fts3_tokenizer1.c $(HDR) $(EXTHDR)
1152 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer1.c
1154 fts3_tokenize_vtab.lo: $(TOP)/ext/fts3/fts3_tokenize_vtab.c $(HDR) $(EXTHDR)
1155 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenize_vtab.c
1157 fts3_unicode.lo: $(TOP)/ext/fts3/fts3_unicode.c $(HDR) $(EXTHDR)
1158 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_unicode.c
1160 fts3_unicode2.lo: $(TOP)/ext/fts3/fts3_unicode2.c $(HDR) $(EXTHDR)
1161 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_unicode2.c
1163 fts3_write.lo: $(TOP)/ext/fts3/fts3_write.c $(HDR) $(EXTHDR)
1164 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_write.c
1166 rtree.lo: $(TOP)/ext/rtree/rtree.c $(HDR) $(EXTHDR)
1167 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/rtree/rtree.c
1169 userauth.lo: $(TOP)/ext/userauth/userauth.c $(HDR) $(EXTHDR)
1170 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/userauth/userauth.c
1172 sqlite3session.lo: $(TOP)/ext/session/sqlite3session.c $(HDR) $(EXTHDR)
1173 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/session/sqlite3session.c
1175 json1.lo: $(TOP)/ext/misc/json1.c
1176 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/misc/json1.c
1178 stmt.lo: $(TOP)/ext/misc/stmt.c
1179 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/misc/stmt.c
1181 # FTS5 things
1183 FTS5_SRC = \
1184 $(TOP)/ext/fts5/fts5.h \
1185 $(TOP)/ext/fts5/fts5Int.h \
1186 $(TOP)/ext/fts5/fts5_aux.c \
1187 $(TOP)/ext/fts5/fts5_buffer.c \
1188 $(TOP)/ext/fts5/fts5_main.c \
1189 $(TOP)/ext/fts5/fts5_config.c \
1190 $(TOP)/ext/fts5/fts5_expr.c \
1191 $(TOP)/ext/fts5/fts5_hash.c \
1192 $(TOP)/ext/fts5/fts5_index.c \
1193 fts5parse.c fts5parse.h \
1194 $(TOP)/ext/fts5/fts5_storage.c \
1195 $(TOP)/ext/fts5/fts5_tokenize.c \
1196 $(TOP)/ext/fts5/fts5_unicode2.c \
1197 $(TOP)/ext/fts5/fts5_varint.c \
1198 $(TOP)/ext/fts5/fts5_vocab.c \
1200 fts5parse.c: $(TOP)/ext/fts5/fts5parse.y lemon$(BEXE)
1201 cp $(TOP)/ext/fts5/fts5parse.y .
1202 rm -f fts5parse.h
1203 ./lemon$(BEXE) $(OPTS) -S fts5parse.y
1205 fts5parse.h: fts5parse.c
1207 fts5.c: $(FTS5_SRC)
1208 $(TCLSH_CMD) $(TOP)/ext/fts5/tool/mkfts5c.tcl
1209 cp $(TOP)/ext/fts5/fts5.h .
1211 fts5.lo: fts5.c $(HDR) $(EXTHDR)
1212 $(LTCOMPILE) -DSQLITE_CORE -c fts5.c
1214 sqlite3rbu.lo: $(TOP)/ext/rbu/sqlite3rbu.c $(HDR) $(EXTHDR)
1215 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/rbu/sqlite3rbu.c
1218 # Rules to build the 'testfixture' application.
1220 # If using the amalgamation, use sqlite3.c directly to build the test
1221 # fixture. Otherwise link against libsqlite3.la. (This distinction is
1222 # necessary because the test fixture requires non-API symbols which are
1223 # hidden when the library is built via the amalgamation).
1225 TESTFIXTURE_FLAGS = -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
1226 TESTFIXTURE_FLAGS += -DTCLSH_INIT_PROC=sqlite3TestInit
1227 TESTFIXTURE_FLAGS += -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE
1228 TESTFIXTURE_FLAGS += -DBUILD_sqlite
1229 TESTFIXTURE_FLAGS += -DSQLITE_SERIES_CONSTRAINT_VERIFY=1
1230 TESTFIXTURE_FLAGS += -DSQLITE_DEFAULT_PAGE_SIZE=1024
1231 TESTFIXTURE_FLAGS += -DSQLITE_ENABLE_STMTVTAB
1232 TESTFIXTURE_FLAGS += -DSQLITE_ENABLE_DBPAGE_VTAB
1233 TESTFIXTURE_FLAGS += -DSQLITE_ENABLE_BYTECODE_VTAB
1234 TESTFIXTURE_FLAGS += -DSQLITE_ENABLE_DESERIALIZE
1236 TESTFIXTURE_SRC0 = $(TESTSRC2) libsqlite3.la
1237 TESTFIXTURE_SRC1 = sqlite3.c
1238 TESTFIXTURE_SRC = $(TESTSRC) $(TOP)/src/tclsqlite.c
1239 TESTFIXTURE_SRC += $(TESTFIXTURE_SRC$(USE_AMALGAMATION))
1241 testfixture$(TEXE): $(TESTFIXTURE_SRC)
1242 $(LTLINK) -DSQLITE_NO_SYNC=1 $(TEMP_STORE) $(TESTFIXTURE_FLAGS) \
1243 -o $@ $(TESTFIXTURE_SRC) $(LIBTCL) $(TLIBS)
1245 coretestprogs: $(TESTPROGS)
1247 testprogs: coretestprogs srcck1$(BEXE) fuzzcheck$(TEXE) sessionfuzz$(TEXE)
1249 # A very detailed test running most or all test cases
1250 fulltest: $(TESTPROGS) fuzztest
1251 ./testfixture$(TEXE) $(TOP)/test/all.test $(TESTOPTS)
1253 # Really really long testing
1254 soaktest: $(TESTPROGS)
1255 ./testfixture$(TEXE) $(TOP)/test/all.test -soak=1 $(TESTOPTS)
1257 # Do extra testing but not everything.
1258 fulltestonly: $(TESTPROGS) fuzztest
1259 ./testfixture$(TEXE) $(TOP)/test/full.test
1261 # Fuzz testing
1262 fuzztest: fuzzcheck$(TEXE) $(FUZZDATA) sessionfuzz$(TEXE) $(TOP)/test/sessionfuzz-data1.db
1263 ./fuzzcheck$(TEXE) $(FUZZDATA)
1264 ./sessionfuzz$(TEXE) run $(TOP)/test/sessionfuzz-data1.db
1266 valgrindfuzz: fuzzcheck$(TEXT) $(FUZZDATA) sessionfuzz$(TEXE) $(TOP)/test/sessionfuzz-data1.db
1267 valgrind ./fuzzcheck$(TEXE) --cell-size-check --limit-mem 10M --timeout 600 $(FUZZDATA)
1268 valgrind ./sessionfuzz$(TEXE) run $(TOP)/test/sessionfuzz-data1.db
1270 # The veryquick.test TCL tests.
1272 tcltest: ./testfixture$(TEXE)
1273 ./testfixture$(TEXE) $(TOP)/test/veryquick.test $(TESTOPTS)
1275 # Minimal testing that runs in less than 3 minutes
1277 quicktest: ./testfixture$(TEXE)
1278 ./testfixture$(TEXE) $(TOP)/test/extraquick.test $(TESTOPTS)
1280 # This is the common case. Run many tests that do not take too long,
1281 # including fuzzcheck, sqlite3_analyzer, and sqldiff tests.
1283 test: fuzztest sourcetest $(TESTPROGS) tcltest
1285 # Run a test using valgrind. This can take a really long time
1286 # because valgrind is so much slower than a native machine.
1288 valgrindtest: $(TESTPROGS) valgrindfuzz
1289 OMIT_MISUSE=1 valgrind -v ./testfixture$(TEXE) $(TOP)/test/permutations.test valgrind $(TESTOPTS)
1291 # A very fast test that checks basic sanity. The name comes from
1292 # the 60s-era electronics testing: "Turn it on and see if smoke
1293 # comes out."
1295 smoketest: $(TESTPROGS) fuzzcheck$(TEXE)
1296 ./testfixture$(TEXE) $(TOP)/test/main.test $(TESTOPTS)
1298 shelltest: $(TESTPROGS)
1299 ./testfixture$(TEXT) $(TOP)/test/permutations.test shell
1301 sqlite3_analyzer.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqlite3_analyzer.c.in
1302 $(TCLSH_CMD) $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqlite3_analyzer.c.in >sqlite3_analyzer.c
1304 sqlite3_analyzer$(TEXE): sqlite3_analyzer.c
1305 $(LTLINK) sqlite3_analyzer.c -o $@ $(LIBTCL) $(TLIBS)
1307 sqltclsh.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/sqltclsh.tcl $(TOP)/ext/misc/appendvfs.c $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqltclsh.c.in
1308 $(TCLSH_CMD) $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqltclsh.c.in >sqltclsh.c
1310 sqltclsh$(TEXE): sqltclsh.c
1311 $(LTLINK) sqltclsh.c -o $@ $(LIBTCL) $(TLIBS)
1313 sqlite3_expert$(TEXE): $(TOP)/ext/expert/sqlite3expert.h $(TOP)/ext/expert/sqlite3expert.c $(TOP)/ext/expert/expert.c sqlite3.c
1314 $(LTLINK) $(TOP)/ext/expert/sqlite3expert.h $(TOP)/ext/expert/sqlite3expert.c $(TOP)/ext/expert/expert.c sqlite3.c -o sqlite3_expert $(TLIBS)
1316 CHECKER_DEPS =\
1317 $(TOP)/tool/mkccode.tcl \
1318 sqlite3.c \
1319 $(TOP)/src/tclsqlite.c \
1320 $(TOP)/ext/repair/sqlite3_checker.tcl \
1321 $(TOP)/ext/repair/checkindex.c \
1322 $(TOP)/ext/repair/checkfreelist.c \
1323 $(TOP)/ext/misc/btreeinfo.c \
1324 $(TOP)/ext/repair/sqlite3_checker.c.in
1326 sqlite3_checker.c: $(CHECKER_DEPS)
1327 $(TCLSH_CMD) $(TOP)/tool/mkccode.tcl $(TOP)/ext/repair/sqlite3_checker.c.in >$@
1329 sqlite3_checker$(TEXE): sqlite3_checker.c
1330 $(LTLINK) sqlite3_checker.c -o $@ $(LIBTCL) $(TLIBS)
1332 dbdump$(TEXE): $(TOP)/ext/misc/dbdump.c sqlite3.lo
1333 $(LTLINK) -DDBDUMP_STANDALONE -o $@ \
1334 $(TOP)/ext/misc/dbdump.c sqlite3.lo $(TLIBS)
1336 dbtotxt$(TEXE): $(TOP)/tool/dbtotxt.c
1337 $(LTLINK)-o $@ $(TOP)/tool/dbtotxt.c
1339 showdb$(TEXE): $(TOP)/tool/showdb.c sqlite3.lo
1340 $(LTLINK) -o $@ $(TOP)/tool/showdb.c sqlite3.lo $(TLIBS)
1342 showstat4$(TEXE): $(TOP)/tool/showstat4.c sqlite3.lo
1343 $(LTLINK) -o $@ $(TOP)/tool/showstat4.c sqlite3.lo $(TLIBS)
1345 showjournal$(TEXE): $(TOP)/tool/showjournal.c sqlite3.lo
1346 $(LTLINK) -o $@ $(TOP)/tool/showjournal.c sqlite3.lo $(TLIBS)
1348 showwal$(TEXE): $(TOP)/tool/showwal.c sqlite3.lo
1349 $(LTLINK) -o $@ $(TOP)/tool/showwal.c sqlite3.lo $(TLIBS)
1351 showshm$(TEXE): $(TOP)/tool/showshm.c
1352 $(LTLINK) -o $@ $(TOP)/tool/showshm.c
1354 index_usage$(TEXE): $(TOP)/tool/index_usage.c sqlite3.lo
1355 $(LTLINK) $(SHELL_OPT) -o $@ $(TOP)/tool/index_usage.c sqlite3.lo $(TLIBS)
1357 changeset$(TEXE): $(TOP)/ext/session/changeset.c sqlite3.lo
1358 $(LTLINK) -o $@ $(TOP)/ext/session/changeset.c sqlite3.lo $(TLIBS)
1360 changesetfuzz$(TEXE): $(TOP)/ext/session/changesetfuzz.c sqlite3.lo
1361 $(LTLINK) -o $@ $(TOP)/ext/session/changesetfuzz.c sqlite3.lo $(TLIBS)
1363 rollback-test$(TEXE): $(TOP)/tool/rollback-test.c sqlite3.lo
1364 $(LTLINK) -o $@ $(TOP)/tool/rollback-test.c sqlite3.lo $(TLIBS)
1366 atrc$(TEXX): $(TOP)/test/atrc.c sqlite3.lo
1367 $(LTLINK) -o $@ $(TOP)/test/atrc.c sqlite3.lo $(TLIBS)
1369 LogEst$(TEXE): $(TOP)/tool/logest.c sqlite3.h
1370 $(LTLINK) -I. -o $@ $(TOP)/tool/logest.c
1372 wordcount$(TEXE): $(TOP)/test/wordcount.c sqlite3.lo
1373 $(LTLINK) -o $@ $(TOP)/test/wordcount.c sqlite3.lo $(TLIBS)
1375 speedtest1$(TEXE): $(TOP)/test/speedtest1.c sqlite3.c
1376 $(LTLINK) $(ST_OPT) -o $@ $(TOP)/test/speedtest1.c sqlite3.c $(TLIBS)
1378 KV_OPT += -DSQLITE_DIRECT_OVERFLOW_READ
1380 kvtest$(TEXE): $(TOP)/test/kvtest.c sqlite3.c
1381 $(LTLINK) $(KV_OPT) -o $@ $(TOP)/test/kvtest.c sqlite3.c $(TLIBS)
1383 rbu$(EXE): $(TOP)/ext/rbu/rbu.c $(TOP)/ext/rbu/sqlite3rbu.c sqlite3.lo
1384 $(LTLINK) -I. -o $@ $(TOP)/ext/rbu/rbu.c sqlite3.lo $(TLIBS)
1386 loadfts$(EXE): $(TOP)/tool/loadfts.c libsqlite3.la
1387 $(LTLINK) $(TOP)/tool/loadfts.c libsqlite3.la -o $@ $(TLIBS)
1389 # This target will fail if the SQLite amalgamation contains any exported
1390 # symbols that do not begin with "sqlite3_". It is run as part of the
1391 # releasetest.tcl script.
1393 VALIDIDS=' sqlite3(changeset|changegroup|session)?_'
1394 checksymbols: sqlite3.o
1395 nm -g --defined-only sqlite3.o
1396 nm -g --defined-only sqlite3.o | egrep -v $(VALIDIDS); test $$? -ne 0
1397 echo '0 errors out of 1 tests'
1399 # Build the amalgamation-autoconf package. The amalamgation-tarball target builds
1400 # a tarball named for the version number. Ex: sqlite-autoconf-3110000.tar.gz.
1401 # The snapshot-tarball target builds a tarball named by the SHA1 hash
1403 amalgamation-tarball: sqlite3.c sqlite3rc.h
1404 TOP=$(TOP) sh $(TOP)/tool/mkautoconfamal.sh --normal
1406 snapshot-tarball: sqlite3.c sqlite3rc.h
1407 TOP=$(TOP) sh $(TOP)/tool/mkautoconfamal.sh --snapshot
1409 # The next two rules are used to support the "threadtest" target. Building
1410 # threadtest runs a few thread-safety tests that are implemented in C. This
1411 # target is invoked by the releasetest.tcl script.
1413 THREADTEST3_SRC = $(TOP)/test/threadtest3.c \
1414 $(TOP)/test/tt3_checkpoint.c \
1415 $(TOP)/test/tt3_index.c \
1416 $(TOP)/test/tt3_vacuum.c \
1417 $(TOP)/test/tt3_stress.c \
1418 $(TOP)/test/tt3_lookaside1.c
1420 threadtest3$(TEXE): sqlite3.lo $(THREADTEST3_SRC)
1421 $(LTLINK) $(TOP)/test/threadtest3.c $(TOP)/src/test_multiplex.c sqlite3.lo -o $@ $(TLIBS)
1423 threadtest: threadtest3$(TEXE)
1424 ./threadtest3$(TEXE)
1426 releasetest:
1427 $(TCLSH_CMD) $(TOP)/test/releasetest.tcl
1429 # Standard install and cleanup targets
1431 lib_install: libsqlite3.la
1432 $(INSTALL) -d $(DESTDIR)$(libdir)
1433 $(LTINSTALL) libsqlite3.la $(DESTDIR)$(libdir)
1435 install: sqlite3$(TEXE) lib_install sqlite3.h sqlite3.pc ${HAVE_TCL:1=tcl_install}
1436 $(INSTALL) -d $(DESTDIR)$(bindir)
1437 $(LTINSTALL) sqlite3$(TEXE) $(DESTDIR)$(bindir)
1438 $(INSTALL) -d $(DESTDIR)$(includedir)
1439 $(INSTALL) -m 0644 sqlite3.h $(DESTDIR)$(includedir)
1440 $(INSTALL) -m 0644 $(TOP)/src/sqlite3ext.h $(DESTDIR)$(includedir)
1441 $(INSTALL) -d $(DESTDIR)$(pkgconfigdir)
1442 $(INSTALL) -m 0644 sqlite3.pc $(DESTDIR)$(pkgconfigdir)
1444 pkgIndex.tcl:
1445 echo 'package ifneeded sqlite3 $(RELEASE) [list load [file join $$dir libtclsqlite3[info sharedlibextension]] sqlite3]' > $@
1446 tcl_install: lib_install libtclsqlite3.la pkgIndex.tcl
1447 $(INSTALL) -d $(DESTDIR)$(TCLLIBDIR)
1448 $(LTINSTALL) libtclsqlite3.la $(DESTDIR)$(TCLLIBDIR)
1449 rm -f $(DESTDIR)$(TCLLIBDIR)/libtclsqlite3.la $(DESTDIR)$(TCLLIBDIR)/libtclsqlite3.a
1450 $(INSTALL) -m 0644 pkgIndex.tcl $(DESTDIR)$(TCLLIBDIR)
1452 clean:
1453 rm -f *.lo *.la *.o sqlite3$(TEXE) libsqlite3.la
1454 rm -f sqlite3.h opcodes.*
1455 rm -rf .libs .deps
1456 rm -f lemon$(BEXE) lempar.c parse.* sqlite*.tar.gz
1457 rm -f mkkeywordhash$(BEXE) keywordhash.h
1458 rm -f *.da *.bb *.bbg gmon.out
1459 rm -rf tsrc .target_source
1460 rm -f tclsqlite3$(TEXE)
1461 rm -f testfixture$(TEXE) test.db
1462 rm -f LogEst$(TEXE) fts3view$(TEXE) rollback-test$(TEXE) showdb$(TEXE)
1463 rm -f showjournal$(TEXE) showstat4$(TEXE) showwal$(TEXE) speedtest1$(TEXE)
1464 rm -f wordcount$(TEXE) changeset$(TEXE)
1465 rm -f sqlite3.dll sqlite3.lib sqlite3.exp sqlite3.def
1466 rm -f sqlite3.c
1467 rm -f sqlite3rc.h
1468 rm -f shell.c sqlite3ext.h
1469 rm -f sqlite3_analyzer$(TEXE) sqlite3_analyzer.c
1470 rm -f sqlite-*-output.vsix
1471 rm -f mptester mptester.exe
1472 rm -f rbu rbu.exe
1473 rm -f srcck1 srcck1.exe
1474 rm -f fuzzershell fuzzershell.exe
1475 rm -f fuzzcheck fuzzcheck.exe
1476 rm -f sqldiff sqldiff.exe
1477 rm -f dbhash dbhash.exe
1478 rm -f fts5.* fts5parse.*
1480 distclean: clean
1481 rm -f config.h config.log config.status libtool Makefile sqlite3.pc
1484 # Windows section
1486 dll: sqlite3.dll
1488 REAL_LIBOBJ = $(LIBOBJ:%.lo=.libs/%.o)
1490 $(REAL_LIBOBJ): $(LIBOBJ)
1492 sqlite3.def: $(REAL_LIBOBJ)
1493 echo 'EXPORTS' >sqlite3.def
1494 nm $(REAL_LIBOBJ) | grep ' T ' | grep ' _sqlite3_' \
1495 | sed 's/^.* _//' >>sqlite3.def
1497 sqlite3.dll: $(REAL_LIBOBJ) sqlite3.def
1498 $(TCC) -shared -o $@ sqlite3.def \
1499 -Wl,"--strip-all" $(REAL_LIBOBJ)