downgrade memory unlock failures to info level and fix function name in log output
[sqlcipher.git] / Makefile.in
blobce2617c70afe2bba6619f111405514134121431c
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@
21 # C Compiler and options for use in building executables that
22 # will run on the platform that is doing the build.
24 BCC = @BUILD_CC@ @BUILD_CFLAGS@
26 # TCC is the C Compile and options for use in building executables that
27 # will run on the target platform. (BCC and TCC are usually the
28 # same unless your are cross-compiling.) Separate CC and CFLAGS macros
29 # are provide so that these aspects of the build process can be changed
30 # on the "make" command-line. Ex: "make CC=clang CFLAGS=-fsanitize=undefined"
32 CC = @CC@
33 CFLAGS = @CPPFLAGS@ @CFLAGS@
34 TCC = ${CC} ${CFLAGS} -I. -I${TOP}/src -I${TOP}/ext/rtree -I${TOP}/ext/icu
35 TCC += -I${TOP}/ext/fts3 -I${TOP}/ext/async -I${TOP}/ext/session
36 TCC += -I${TOP}/ext/userauth
38 # Define this for the autoconf-based build, so that the code knows it can
39 # include the generated sqlite_cfg.h
41 TCC += -D_HAVE_SQLITE_CONFIG_H -DBUILD_sqlite
43 # Define -DNDEBUG to compile without debugging (i.e., for production usage)
44 # Omitting the define will cause extra debugging code to be inserted and
45 # includes extra comments when "EXPLAIN stmt" is used.
47 TCC += @TARGET_DEBUG@
49 # Compiler options needed for programs that use the TCL library.
51 TCC += @TCL_INCLUDE_SPEC@
53 # The library that programs using TCL must link against.
55 LIBTCL = @TCL_LIB_SPEC@
57 # Compiler options needed for programs that use the readline() library.
59 READLINE_FLAGS = -DHAVE_READLINE=@TARGET_HAVE_READLINE@ @TARGET_READLINE_INC@
60 READLINE_FLAGS += -DHAVE_EDITLINE=@TARGET_HAVE_EDITLINE@
61 READLINE_FLAGS += -DHAVE_LINENOISE=@TARGET_HAVE_LINENOISE@
63 # The library that programs using readline() must link against.
65 LIBREADLINE = @TARGET_READLINE_LIBS@
67 # Should the database engine be compiled threadsafe
69 TCC += -DSQLITE_THREADSAFE=@SQLITE_THREADSAFE@
71 # Any target libraries which libsqlite must be linked against
73 TLIBS = @LIBS@ $(LIBS)
75 # Flags controlling use of the in memory btree implementation
77 # SQLITE_TEMP_STORE is 0 to force temporary tables to be in a file, 1 to
78 # default to file, 2 to default to memory, and 3 to force temporary
79 # tables to always be in memory.
81 TEMP_STORE = -DSQLITE_TEMP_STORE=@TEMP_STORE@
83 # Enable/disable loadable extensions, and other optional features
84 # based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*).
85 # The same set of OMIT and ENABLE flags should be passed to the
86 # LEMON parser generator and the mkkeywordhash tool as well.
87 OPT_FEATURE_FLAGS = @OPT_FEATURE_FLAGS@
89 TCC += $(OPT_FEATURE_FLAGS)
91 # Add in any optional parameters specified on the make commane line
92 # ie. make "OPTS=-DSQLITE_ENABLE_FOO=1 -DSQLITE_OMIT_FOO=1".
93 TCC += $(OPTS)
95 # Add in compile-time options for some libraries used by extensions
96 TCC += @HAVE_ZLIB@
98 # Version numbers and release number for the SQLite being compiled.
100 VERSION = @VERSION@
101 VERSION_NUMBER = @VERSION_NUMBER@
102 RELEASE = @RELEASE@
104 # Filename extensions
106 BEXE = @BUILD_EXEEXT@
107 TEXE = @TARGET_EXEEXT@
109 # The following variable is "1" if the configure script was able to locate
110 # the tclConfig.sh file. It is an empty string otherwise. When this
111 # variable is "1", the TCL extension library (libtclsqlite3.so) is built
112 # and installed.
114 HAVE_TCL = @HAVE_TCL@
116 # This is the command to use for tclsh - normally just "tclsh", but we may
117 # know the specific version we want to use
119 TCLSH_CMD = @TCLSH_CMD@
121 # Where do we want to install the tcl plugin
123 TCLLIBDIR = @TCLLIBDIR@
125 # The suffix used on shared libraries. Ex: ".dll", ".so", ".dylib"
127 SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@
129 # If gcov support was enabled by the configure script, add the appropriate
130 # flags here. It's not always as easy as just having the user add the right
131 # CFLAGS / LDFLAGS, because libtool wants to use CFLAGS when linking, which
132 # causes build errors with -fprofile-arcs -ftest-coverage with some GCCs.
133 # Supposedly GCC does the right thing if you use --coverage, but in
134 # practice it still fails. See:
136 # http://www.mail-archive.com/debian-gcc@lists.debian.org/msg26197.html
138 # for more info.
140 GCOV_CFLAGS1 = -DSQLITE_COVERAGE_TEST=1 -fprofile-arcs -ftest-coverage
141 GCOV_LDFLAGS1 = -lgcov
142 USE_GCOV = @USE_GCOV@
143 LTCOMPILE_EXTRAS += $(GCOV_CFLAGS$(USE_GCOV))
144 LTLINK_EXTRAS += $(GCOV_LDFLAGS$(USE_GCOV))
146 # BEGIN CRYPTO
147 CRYPTOLIBOBJ = \
148 crypto.lo \
149 crypto_impl.lo \
150 crypto_openssl.lo \
151 crypto_libtomcrypt.lo \
152 crypto_nss.lo \
153 crypto_cc.lo
155 CRYPTOSRC = \
156 $(TOP)/src/crypto.h \
157 $(TOP)/src/sqlcipher.h \
158 $(TOP)/src/crypto.c \
159 $(TOP)/src/crypto_impl.c \
160 $(TOP)/src/crypto_libtomcrypt.c \
161 $(TOP)/src/crypto_nss.c \
162 $(TOP)/src/crypto_openssl.c \
163 $(TOP)/src/crypto_cc.c
165 # END CRYPTO
167 # The directory into which to store package information for
169 # Some standard variables and programs
171 prefix = @prefix@
172 exec_prefix = @exec_prefix@
173 libdir = @libdir@
174 pkgconfigdir = $(libdir)/pkgconfig
175 bindir = @bindir@
176 includedir = @includedir@/sqlcipher
177 INSTALL = @INSTALL@
178 LIBTOOL = ./libtool
179 ALLOWRELEASE = @ALLOWRELEASE@
181 # libtool compile/link/install
182 LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(TCC) $(LTCOMPILE_EXTRAS)
183 LTLINK = $(LIBTOOL) --mode=link $(TCC) $(LTCOMPILE_EXTRAS) @LDFLAGS@ $(LTLINK_EXTRAS)
184 LTINSTALL = $(LIBTOOL) --mode=install $(INSTALL)
186 # You should not have to change anything below this line
187 ###############################################################################
189 USE_AMALGAMATION = @USE_AMALGAMATION@
190 AMALGAMATION_LINE_MACROS = @AMALGAMATION_LINE_MACROS@
192 # Object files for the SQLite library (non-amalgamation).
194 LIBOBJS0 = alter.lo analyze.lo attach.lo auth.lo \
195 backup.lo bitvec.lo btmutex.lo btree.lo build.lo \
196 callback.lo complete.lo ctime.lo \
197 date.lo dbpage.lo dbstat.lo delete.lo \
198 expr.lo fault.lo fkey.lo \
199 fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo \
200 fts3_porter.lo fts3_snippet.lo fts3_tokenizer.lo fts3_tokenizer1.lo \
201 fts3_tokenize_vtab.lo \
202 fts3_unicode.lo fts3_unicode2.lo fts3_write.lo \
203 fts5.lo \
204 func.lo global.lo hash.lo \
205 icu.lo insert.lo json.lo legacy.lo loadext.lo \
206 main.lo malloc.lo mem0.lo mem1.lo mem2.lo mem3.lo mem5.lo \
207 memdb.lo memjournal.lo \
208 mutex.lo mutex_noop.lo mutex_unix.lo mutex_w32.lo \
209 notify.lo opcodes.lo os.lo os_kv.lo os_unix.lo os_win.lo \
210 pager.lo parse.lo pcache.lo pcache1.lo pragma.lo prepare.lo printf.lo \
211 random.lo resolve.lo rowset.lo rtree.lo \
212 sqlite3session.lo select.lo sqlite3rbu.lo status.lo stmt.lo \
213 table.lo threads.lo tokenize.lo treeview.lo trigger.lo \
214 update.lo userauth.lo upsert.lo util.lo vacuum.lo \
215 vdbe.lo vdbeapi.lo vdbeaux.lo vdbeblob.lo vdbemem.lo vdbesort.lo \
216 vdbetrace.lo vdbevtab.lo \
217 wal.lo walker.lo where.lo wherecode.lo whereexpr.lo \
218 window.lo utf.lo vtab.lo $(CRYPTOLIBOBJ)
220 # Object files for the amalgamation.
222 LIBOBJS1 = sqlite3.lo
224 # Determine the real value of LIBOBJ based on the 'configure' script
226 LIBOBJ = $(LIBOBJS$(USE_AMALGAMATION))
229 # All of the source code files.
231 SRC = \
232 $(CRYPTOSRC) \
233 $(TOP)/src/alter.c \
234 $(TOP)/src/analyze.c \
235 $(TOP)/src/attach.c \
236 $(TOP)/src/auth.c \
237 $(TOP)/src/backup.c \
238 $(TOP)/src/bitvec.c \
239 $(TOP)/src/btmutex.c \
240 $(TOP)/src/btree.c \
241 $(TOP)/src/btree.h \
242 $(TOP)/src/btreeInt.h \
243 $(TOP)/src/build.c \
244 $(TOP)/src/callback.c \
245 $(TOP)/src/complete.c \
246 $(TOP)/src/ctime.c \
247 $(TOP)/src/date.c \
248 $(TOP)/src/dbpage.c \
249 $(TOP)/src/dbstat.c \
250 $(TOP)/src/delete.c \
251 $(TOP)/src/expr.c \
252 $(TOP)/src/fault.c \
253 $(TOP)/src/fkey.c \
254 $(TOP)/src/func.c \
255 $(TOP)/src/global.c \
256 $(TOP)/src/hash.c \
257 $(TOP)/src/hash.h \
258 $(TOP)/src/hwtime.h \
259 $(TOP)/src/insert.c \
260 $(TOP)/src/json.c \
261 $(TOP)/src/legacy.c \
262 $(TOP)/src/loadext.c \
263 $(TOP)/src/main.c \
264 $(TOP)/src/malloc.c \
265 $(TOP)/src/mem0.c \
266 $(TOP)/src/mem1.c \
267 $(TOP)/src/mem2.c \
268 $(TOP)/src/mem3.c \
269 $(TOP)/src/mem5.c \
270 $(TOP)/src/memdb.c \
271 $(TOP)/src/memjournal.c \
272 $(TOP)/src/msvc.h \
273 $(TOP)/src/mutex.c \
274 $(TOP)/src/mutex.h \
275 $(TOP)/src/mutex_noop.c \
276 $(TOP)/src/mutex_unix.c \
277 $(TOP)/src/mutex_w32.c \
278 $(TOP)/src/notify.c \
279 $(TOP)/src/os.c \
280 $(TOP)/src/os.h \
281 $(TOP)/src/os_common.h \
282 $(TOP)/src/os_setup.h \
283 $(TOP)/src/os_kv.c \
284 $(TOP)/src/os_unix.c \
285 $(TOP)/src/os_win.c \
286 $(TOP)/src/os_win.h \
287 $(TOP)/src/pager.c \
288 $(TOP)/src/pager.h \
289 $(TOP)/src/parse.y \
290 $(TOP)/src/pcache.c \
291 $(TOP)/src/pcache.h \
292 $(TOP)/src/pcache1.c \
293 $(TOP)/src/pragma.c \
294 $(TOP)/src/pragma.h \
295 $(TOP)/src/prepare.c \
296 $(TOP)/src/printf.c \
297 $(TOP)/src/random.c \
298 $(TOP)/src/resolve.c \
299 $(TOP)/src/rowset.c \
300 $(TOP)/src/select.c \
301 $(TOP)/src/status.c \
302 $(TOP)/src/shell.c.in \
303 $(TOP)/src/sqlite.h.in \
304 $(TOP)/src/sqlite3ext.h \
305 $(TOP)/src/sqliteInt.h \
306 $(TOP)/src/sqliteLimit.h \
307 $(TOP)/src/table.c \
308 $(TOP)/src/tclsqlite.c \
309 $(TOP)/src/threads.c \
310 $(TOP)/src/tokenize.c \
311 $(TOP)/src/treeview.c \
312 $(TOP)/src/trigger.c \
313 $(TOP)/src/utf.c \
314 $(TOP)/src/update.c \
315 $(TOP)/src/upsert.c \
316 $(TOP)/src/util.c \
317 $(TOP)/src/vacuum.c \
318 $(TOP)/src/vdbe.c \
319 $(TOP)/src/vdbe.h \
320 $(TOP)/src/vdbeapi.c \
321 $(TOP)/src/vdbeaux.c \
322 $(TOP)/src/vdbeblob.c \
323 $(TOP)/src/vdbemem.c \
324 $(TOP)/src/vdbesort.c \
325 $(TOP)/src/vdbetrace.c \
326 $(TOP)/src/vdbevtab.c \
327 $(TOP)/src/vdbeInt.h \
328 $(TOP)/src/vtab.c \
329 $(TOP)/src/vxworks.h \
330 $(TOP)/src/wal.c \
331 $(TOP)/src/wal.h \
332 $(TOP)/src/walker.c \
333 $(TOP)/src/where.c \
334 $(TOP)/src/wherecode.c \
335 $(TOP)/src/whereexpr.c \
336 $(TOP)/src/whereInt.h \
337 $(TOP)/src/window.c
339 # Source code for extensions
341 SRC += \
342 $(TOP)/ext/fts3/fts3.c \
343 $(TOP)/ext/fts3/fts3.h \
344 $(TOP)/ext/fts3/fts3Int.h \
345 $(TOP)/ext/fts3/fts3_aux.c \
346 $(TOP)/ext/fts3/fts3_expr.c \
347 $(TOP)/ext/fts3/fts3_hash.c \
348 $(TOP)/ext/fts3/fts3_hash.h \
349 $(TOP)/ext/fts3/fts3_icu.c \
350 $(TOP)/ext/fts3/fts3_porter.c \
351 $(TOP)/ext/fts3/fts3_snippet.c \
352 $(TOP)/ext/fts3/fts3_tokenizer.h \
353 $(TOP)/ext/fts3/fts3_tokenizer.c \
354 $(TOP)/ext/fts3/fts3_tokenizer1.c \
355 $(TOP)/ext/fts3/fts3_tokenize_vtab.c \
356 $(TOP)/ext/fts3/fts3_unicode.c \
357 $(TOP)/ext/fts3/fts3_unicode2.c \
358 $(TOP)/ext/fts3/fts3_write.c
359 SRC += \
360 $(TOP)/ext/icu/sqliteicu.h \
361 $(TOP)/ext/icu/icu.c
362 SRC += \
363 $(TOP)/ext/rtree/rtree.h \
364 $(TOP)/ext/rtree/rtree.c \
365 $(TOP)/ext/rtree/geopoly.c
366 SRC += \
367 $(TOP)/ext/session/sqlite3session.c \
368 $(TOP)/ext/session/sqlite3session.h
369 SRC += \
370 $(TOP)/ext/userauth/userauth.c \
371 $(TOP)/ext/userauth/sqlite3userauth.h
372 SRC += \
373 $(TOP)/ext/rbu/sqlite3rbu.h \
374 $(TOP)/ext/rbu/sqlite3rbu.c
375 SRC += \
376 $(TOP)/ext/misc/stmt.c
378 # Generated source code files
380 SRC += \
381 keywordhash.h \
382 opcodes.c \
383 opcodes.h \
384 parse.c \
385 parse.h \
386 sqlite_cfg.h \
387 shell.c \
388 sqlite3.h
390 # Source code to the test files.
392 TESTSRC = \
393 $(TOP)/src/test1.c \
394 $(TOP)/src/test2.c \
395 $(TOP)/src/test3.c \
396 $(TOP)/src/test4.c \
397 $(TOP)/src/test5.c \
398 $(TOP)/src/test6.c \
399 $(TOP)/src/test8.c \
400 $(TOP)/src/test9.c \
401 $(TOP)/src/test_autoext.c \
402 $(TOP)/src/test_async.c \
403 $(TOP)/src/test_backup.c \
404 $(TOP)/src/test_bestindex.c \
405 $(TOP)/src/test_blob.c \
406 $(TOP)/src/test_btree.c \
407 $(TOP)/src/test_config.c \
408 $(TOP)/src/test_delete.c \
409 $(TOP)/src/test_demovfs.c \
410 $(TOP)/src/test_devsym.c \
411 $(TOP)/src/test_fs.c \
412 $(TOP)/src/test_func.c \
413 $(TOP)/src/test_hexio.c \
414 $(TOP)/src/test_init.c \
415 $(TOP)/src/test_intarray.c \
416 $(TOP)/src/test_journal.c \
417 $(TOP)/src/test_malloc.c \
418 $(TOP)/src/test_md5.c \
419 $(TOP)/src/test_multiplex.c \
420 $(TOP)/src/test_mutex.c \
421 $(TOP)/src/test_onefile.c \
422 $(TOP)/src/test_osinst.c \
423 $(TOP)/src/test_pcache.c \
424 $(TOP)/src/test_quota.c \
425 $(TOP)/src/test_rtree.c \
426 $(TOP)/src/test_schema.c \
427 $(TOP)/src/test_superlock.c \
428 $(TOP)/src/test_syscall.c \
429 $(TOP)/src/test_tclsh.c \
430 $(TOP)/src/test_tclvar.c \
431 $(TOP)/src/test_thread.c \
432 $(TOP)/src/test_vdbecov.c \
433 $(TOP)/src/test_vfs.c \
434 $(TOP)/src/test_windirent.c \
435 $(TOP)/src/test_window.c \
436 $(TOP)/src/test_wsd.c \
437 $(TOP)/ext/fts3/fts3_term.c \
438 $(TOP)/ext/fts3/fts3_test.c \
439 $(TOP)/ext/session/test_session.c \
440 $(TOP)/ext/recover/sqlite3recover.c \
441 $(TOP)/ext/recover/dbdata.c \
442 $(TOP)/ext/recover/test_recover.c \
443 $(TOP)/ext/rbu/test_rbu.c
445 # Statically linked extensions
447 TESTSRC += \
448 $(TOP)/ext/expert/sqlite3expert.c \
449 $(TOP)/ext/expert/test_expert.c \
450 $(TOP)/ext/misc/amatch.c \
451 $(TOP)/ext/misc/appendvfs.c \
452 $(TOP)/ext/misc/basexx.c \
453 $(TOP)/ext/misc/carray.c \
454 $(TOP)/ext/misc/cksumvfs.c \
455 $(TOP)/ext/misc/closure.c \
456 $(TOP)/ext/misc/csv.c \
457 $(TOP)/ext/misc/decimal.c \
458 $(TOP)/ext/misc/eval.c \
459 $(TOP)/ext/misc/explain.c \
460 $(TOP)/ext/misc/fileio.c \
461 $(TOP)/ext/misc/fuzzer.c \
462 $(TOP)/ext/fts5/fts5_tcl.c \
463 $(TOP)/ext/fts5/fts5_test_mi.c \
464 $(TOP)/ext/fts5/fts5_test_tok.c \
465 $(TOP)/ext/misc/ieee754.c \
466 $(TOP)/ext/misc/mmapwarm.c \
467 $(TOP)/ext/misc/nextchar.c \
468 $(TOP)/ext/misc/normalize.c \
469 $(TOP)/ext/misc/percentile.c \
470 $(TOP)/ext/misc/prefixes.c \
471 $(TOP)/ext/misc/qpvtab.c \
472 $(TOP)/ext/misc/randomjson.c \
473 $(TOP)/ext/misc/regexp.c \
474 $(TOP)/ext/misc/remember.c \
475 $(TOP)/ext/misc/series.c \
476 $(TOP)/ext/misc/spellfix.c \
477 $(TOP)/ext/misc/totype.c \
478 $(TOP)/ext/misc/unionvtab.c \
479 $(TOP)/ext/misc/wholenumber.c \
480 $(TOP)/ext/misc/zipfile.c \
481 $(TOP)/ext/userauth/userauth.c \
482 $(TOP)/ext/rtree/test_rtreedoc.c
484 # Source code to the library files needed by the test fixture
486 TESTSRC2 = \
487 $(TOP)/src/attach.c \
488 $(TOP)/src/backup.c \
489 $(TOP)/src/bitvec.c \
490 $(TOP)/src/btree.c \
491 $(TOP)/src/build.c \
492 $(TOP)/src/ctime.c \
493 $(TOP)/src/date.c \
494 $(TOP)/src/dbpage.c \
495 $(TOP)/src/dbstat.c \
496 $(TOP)/src/expr.c \
497 $(TOP)/src/func.c \
498 $(TOP)/src/global.c \
499 $(TOP)/src/insert.c \
500 $(TOP)/src/wal.c \
501 $(TOP)/src/main.c \
502 $(TOP)/src/mem5.c \
503 $(TOP)/src/os.c \
504 $(TOP)/src/os_kv.c \
505 $(TOP)/src/os_unix.c \
506 $(TOP)/src/os_win.c \
507 $(TOP)/src/pager.c \
508 $(TOP)/src/pragma.c \
509 $(TOP)/src/prepare.c \
510 $(TOP)/src/printf.c \
511 $(TOP)/src/random.c \
512 $(TOP)/src/pcache.c \
513 $(TOP)/src/pcache1.c \
514 $(TOP)/src/select.c \
515 $(TOP)/src/tokenize.c \
516 $(TOP)/src/treeview.c \
517 $(TOP)/src/utf.c \
518 $(TOP)/src/util.c \
519 $(TOP)/src/vdbeapi.c \
520 $(TOP)/src/vdbeaux.c \
521 $(TOP)/src/vdbe.c \
522 $(TOP)/src/vdbemem.c \
523 $(TOP)/src/vdbetrace.c \
524 $(TOP)/src/vdbevtab.c \
525 $(TOP)/src/where.c \
526 $(TOP)/src/wherecode.c \
527 $(TOP)/src/whereexpr.c \
528 $(TOP)/src/window.c \
529 parse.c \
530 $(TOP)/ext/fts3/fts3.c \
531 $(TOP)/ext/fts3/fts3_aux.c \
532 $(TOP)/ext/fts3/fts3_expr.c \
533 $(TOP)/ext/fts3/fts3_term.c \
534 $(TOP)/ext/fts3/fts3_tokenizer.c \
535 $(TOP)/ext/fts3/fts3_write.c \
536 $(TOP)/ext/async/sqlite3async.c \
537 $(TOP)/ext/session/sqlite3session.c \
538 $(TOP)/ext/misc/stmt.c \
539 fts5.c
541 # Header files used by all library source files.
543 HDR = \
544 $(TOP)/src/btree.h \
545 $(TOP)/src/btreeInt.h \
546 $(TOP)/src/hash.h \
547 $(TOP)/src/hwtime.h \
548 keywordhash.h \
549 $(TOP)/src/msvc.h \
550 $(TOP)/src/mutex.h \
551 opcodes.h \
552 $(TOP)/src/os.h \
553 $(TOP)/src/os_common.h \
554 $(TOP)/src/os_setup.h \
555 $(TOP)/src/os_win.h \
556 $(TOP)/src/pager.h \
557 $(TOP)/src/pcache.h \
558 parse.h \
559 $(TOP)/src/pragma.h \
560 sqlite3.h \
561 $(TOP)/src/sqlite3ext.h \
562 $(TOP)/src/sqliteInt.h \
563 $(TOP)/src/sqliteLimit.h \
564 $(TOP)/src/vdbe.h \
565 $(TOP)/src/vdbeInt.h \
566 $(TOP)/src/vxworks.h \
567 $(TOP)/src/whereInt.h \
568 sqlite_cfg.h
570 # Header files used by extensions
572 EXTHDR += \
573 $(TOP)/ext/fts3/fts3.h \
574 $(TOP)/ext/fts3/fts3Int.h \
575 $(TOP)/ext/fts3/fts3_hash.h \
576 $(TOP)/ext/fts3/fts3_tokenizer.h
577 EXTHDR += \
578 $(TOP)/ext/rtree/rtree.h \
579 $(TOP)/ext/rtree/geopoly.c
580 EXTHDR += \
581 $(TOP)/ext/icu/sqliteicu.h
582 EXTHDR += \
583 $(TOP)/ext/rtree/sqlite3rtree.h
584 EXTHDR += \
585 $(TOP)/ext/userauth/sqlite3userauth.h
587 # executables needed for testing
589 TESTPROGS = \
590 testfixture$(TEXE) \
591 sqlite3$(TEXE) \
592 sqlite3_analyzer$(TEXE) \
593 sqldiff$(TEXE) \
594 dbhash$(TEXE) \
595 sqltclsh$(TEXE)
597 # Databases containing fuzzer test cases
599 FUZZDATA = \
600 $(TOP)/test/fuzzdata1.db \
601 $(TOP)/test/fuzzdata2.db \
602 $(TOP)/test/fuzzdata3.db \
603 $(TOP)/test/fuzzdata4.db \
604 $(TOP)/test/fuzzdata5.db \
605 $(TOP)/test/fuzzdata6.db \
606 $(TOP)/test/fuzzdata7.db \
607 $(TOP)/test/fuzzdata8.db
609 # Standard options to testfixture
611 TESTOPTS = --verbose=file --output=test-out.txt
613 # Extra compiler options for various shell tools
615 SHELL_OPT += -DSQLITE_DQS=0
616 SHELL_OPT += -DSQLITE_ENABLE_FTS4
617 #SHELL_OPT += -DSQLITE_ENABLE_FTS5
618 SHELL_OPT += -DSQLITE_ENABLE_RTREE
619 SHELL_OPT += -DSQLITE_ENABLE_EXPLAIN_COMMENTS
620 SHELL_OPT += -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
621 SHELL_OPT += -DSQLITE_ENABLE_STMTVTAB
622 SHELL_OPT += -DSQLITE_ENABLE_DBPAGE_VTAB
623 SHELL_OPT += -DSQLITE_ENABLE_DBSTAT_VTAB
624 SHELL_OPT += -DSQLITE_ENABLE_BYTECODE_VTAB
625 SHELL_OPT += -DSQLITE_ENABLE_OFFSET_SQL_FUNC
626 SHELL_OPT += -DSQLITE_STRICT_SUBTYPE=1
627 FUZZERSHELL_OPT =
628 FUZZCHECK_OPT += -I$(TOP)/test
629 FUZZCHECK_OPT += -I$(TOP)/ext/recover
630 FUZZCHECK_OPT += \
631 -DSQLITE_OSS_FUZZ \
632 -DSQLITE_ENABLE_BYTECODE_VTAB \
633 -DSQLITE_ENABLE_DBPAGE_VTAB \
634 -DSQLITE_ENABLE_DBSTAT_VTAB \
635 -DSQLITE_ENABLE_BYTECODE_VTAB \
636 -DSQLITE_ENABLE_DESERIALIZE \
637 -DSQLITE_ENABLE_EXPLAIN_COMMENTS \
638 -DSQLITE_ENABLE_FTS3_PARENTHESIS \
639 -DSQLITE_ENABLE_FTS4 \
640 -DSQLITE_ENABLE_FTS5 \
641 -DSQLITE_ENABLE_GEOPOLY \
642 -DSQLITE_ENABLE_MATH_FUNCTIONS \
643 -DSQLITE_ENABLE_MEMSYS5 \
644 -DSQLITE_ENABLE_NORMALIZE \
645 -DSQLITE_ENABLE_OFFSET_SQL_FUNC \
646 -DSQLITE_ENABLE_PREUPDATE_HOOK \
647 -DSQLITE_ENABLE_RTREE \
648 -DSQLITE_ENABLE_SESSION \
649 -DSQLITE_ENABLE_STMTVTAB \
650 -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION \
651 -DSQLITE_ENABLE_STAT4 \
652 -DSQLITE_ENABLE_STMT_SCANSTATUS \
653 -DSQLITE_MAX_MEMORY=50000000 \
654 -DSQLITE_MAX_MMAP_SIZE=0 \
655 -DSQLITE_OMIT_LOAD_EXTENSION \
656 -DSQLITE_PRINTF_PRECISION_LIMIT=1000 \
657 -DSQLITE_PRIVATE="" \
658 -DSQLITE_STRICT_SUBTYPE=1 \
659 -DSQLITE_STATIC_RANDOMJSON
661 FUZZCHECK_SRC += $(TOP)/test/fuzzcheck.c
662 FUZZCHECK_SRC += $(TOP)/test/ossfuzz.c
663 FUZZCHECK_SRC += $(TOP)/test/fuzzinvariants.c
664 FUZZCHECK_SRC += $(TOP)/ext/recover/dbdata.c
665 FUZZCHECK_SRC += $(TOP)/ext/recover/sqlite3recover.c
666 FUZZCHECK_SRC += $(TOP)/test/vt02.c
667 FUZZCHECK_SRC += $(TOP)/ext/misc/randomjson.c
668 DBFUZZ_OPT =
669 ST_OPT = -DSQLITE_OS_KV_OPTIONAL
672 # In wasi-sdk builds, disable the CLI shell build in the "all" target.
673 SQLITE3_SHELL_TARGET_ = sqlcipher$(TEXE)
674 SQLITE3_SHELL_TARGET_1 =
675 SQLITE3_SHELL_TARGET = $(SQLITE3_SHELL_TARGET_@HAVE_WASI_SDK@)
677 # This is the default Makefile target. The objects listed here
678 # are what get build when you type just "make" with no arguments.
680 all: sqlite3.h libsqlcipher.la $(SQLITE3_SHELL_TARGET) \
681 $(HAVE_TCL:1=libtclsqlite3.la)
683 Makefile: $(TOP)/Makefile.in
684 ./config.status
686 sqlcipher.pc: $(TOP)/sqlcipher.pc.in
687 ./config.status
689 libsqlcipher.la: $(LIBOBJ)
690 $(LTLINK) -no-undefined -o $@ $(LIBOBJ) $(TLIBS) \
691 ${ALLOWRELEASE} -rpath "$(libdir)" -version-info "8:6:8"
693 libtclsqlite3.la: tclsqlite.lo libsqlcipher.la
694 $(LTLINK) -no-undefined -o $@ tclsqlite.lo \
695 libsqlcipher.la @TCL_STUB_LIB_SPEC@ $(TLIBS) \
696 -rpath "$(TCLLIBDIR)" \
697 -version-info "8:6:8" \
698 -avoid-version
700 sqlcipher$(TEXE): shell.c sqlite3.c
701 $(LTLINK) $(READLINE_FLAGS) $(SHELL_OPT) -o $@ \
702 shell.c sqlite3.c \
703 $(LIBREADLINE) $(TLIBS) -rpath "$(libdir)"
705 sqldiff$(TEXE): $(TOP)/tool/sqldiff.c sqlite3.lo sqlite3.h
706 $(LTLINK) -o $@ $(TOP)/tool/sqldiff.c sqlite3.lo $(TLIBS)
708 dbhash$(TEXE): $(TOP)/tool/dbhash.c sqlite3.lo sqlite3.h
709 $(LTLINK) -o $@ $(TOP)/tool/dbhash.c sqlite3.lo $(TLIBS)
711 scrub$(TEXE): $(TOP)/ext/misc/scrub.c sqlite3.lo
712 $(LTLINK) -o $@ -I. -DSCRUB_STANDALONE \
713 $(TOP)/ext/misc/scrub.c sqlite3.lo $(TLIBS)
715 srcck1$(BEXE): $(TOP)/tool/srcck1.c
716 $(BCC) -o srcck1$(BEXE) $(TOP)/tool/srcck1.c
718 sourcetest: srcck1$(BEXE) sqlite3.c
719 ./srcck1 sqlite3.c
721 src-verify: $(TOP)/tool/src-verify.c
722 $(BCC) -o src-verify$(BEXE) $(TOP)/tool/src-verify.c
724 verify-source: ./src-verify
725 ./src-verify $(TOP)
727 fuzzershell$(TEXE): $(TOP)/tool/fuzzershell.c sqlite3.c sqlite3.h
728 $(LTLINK) -o $@ $(FUZZERSHELL_OPT) \
729 $(TOP)/tool/fuzzershell.c sqlite3.c $(TLIBS)
731 fuzzcheck$(TEXE): $(FUZZCHECK_SRC) sqlite3.c sqlite3.h $(FUZZCHECK_DEP)
732 $(LTLINK) -o $@ $(FUZZCHECK_OPT) $(FUZZCHECK_SRC) sqlite3.c $(TLIBS)
734 fuzzcheck-asan$(TEXE): $(FUZZCHECK_SRC) sqlite3.c sqlite3.h $(FUZZCHECK_DEP)
735 $(LTLINK) -o $@ -fsanitize=address $(FUZZCHECK_OPT) $(FUZZCHECK_SRC) sqlite3.c $(TLIBS)
737 fuzzcheck-ubsan$(TEXE): $(FUZZCHECK_SRC) sqlite3.c sqlite3.h $(FUZZCHECK_DEP)
738 $(LTLINK) -o $@ -fsanitize=undefined $(FUZZCHECK_OPT) $(FUZZCHECK_SRC) sqlite3.c $(TLIBS)
740 # Usage: FUZZDB=filename make run-fuzzcheck
742 # Where filename is a fuzzcheck database, this target builds and runs
743 # fuzzcheck, fuzzcheck-asan, and fuzzcheck-ubsan on that database.
745 # FUZZDB can be a glob pattern of two or more databases. Example:
747 # FUZZDB=test/fuzzdata*.db make run-fuzzcheck
749 run-fuzzcheck: fuzzcheck$(TEXE) fuzzcheck-asan$(TEXE) fuzzcheck-ubsan$(TEXE)
750 @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi
751 ./fuzzcheck$(TEXE) --spinner $(FUZZDB)
752 ./fuzzcheck-asan$(TEXE) --spinner $(FUZZDB)
753 ./fuzzcheck-ubsan$(TEXE) --spinner $(FUZZDB)
755 ossshell$(TEXE): $(TOP)/test/ossfuzz.c $(TOP)/test/ossshell.c sqlite3.c sqlite3.h
756 $(LTLINK) -o $@ $(FUZZCHECK_OPT) $(TOP)/test/ossshell.c \
757 $(TOP)/test/ossfuzz.c sqlite3.c $(TLIBS)
759 sessionfuzz$(TEXE): $(TOP)/test/sessionfuzz.c sqlite3.c sqlite3.h
760 $(LTLINK) -o $@ $(TOP)/test/sessionfuzz.c $(TLIBS)
762 dbfuzz$(TEXE): $(TOP)/test/dbfuzz.c sqlite3.c sqlite3.h
763 $(LTLINK) -o $@ $(DBFUZZ_OPT) $(TOP)/test/dbfuzz.c sqlite3.c $(TLIBS)
765 DBFUZZ2_OPTS = \
766 -DSQLITE_THREADSAFE=0 \
767 -DSQLITE_OMIT_LOAD_EXTENSION \
768 -DSQLITE_DEBUG \
769 -DSQLITE_ENABLE_DBSTAT_VTAB \
770 -DSQLITE_ENABLE_BYTECODE_VTAB \
771 -DSQLITE_ENABLE_RTREE \
772 -DSQLITE_ENABLE_FTS4 \
773 -DSQLITE_ENABLE_FTS5
775 dbfuzz2$(TEXE): $(TOP)/test/dbfuzz2.c sqlite3.c sqlite3.h
776 $(CC) $(OPT_FEATURE_FLAGS) $(OPTS) -I. -g -O0 \
777 -DSTANDALONE -o dbfuzz2 \
778 $(DBFUZZ2_OPTS) $(TOP)/test/dbfuzz2.c sqlite3.c $(TLIBS)
779 mkdir -p dbfuzz2-dir
780 cp $(TOP)/test/dbfuzz2-seed* dbfuzz2-dir
782 dbfuzz2-asan: $(TOP)/test/dbfuzz2.c sqlite3.c sqlite3.h
783 clang-6.0 $(OPT_FEATURE_FLAGS) $(OPTS) -I. -g -O0 \
784 -fsanitize=fuzzer,undefined,address -o dbfuzz2-asan \
785 $(DBFUZZ2_OPTS) $(TOP)/test/dbfuzz2.c sqlite3.c $(TLIBS)
786 mkdir -p dbfuzz2-dir
787 cp $(TOP)/test/dbfuzz2-seed* dbfuzz2-dir
789 dbfuzz2-msan: $(TOP)/test/dbfuzz2.c sqlite3.c sqlite3.h
790 clang-6.0 $(OPT_FEATURE_FLAGS) $(OPTS) -I. -g -O0 \
791 -fsanitize=fuzzer,undefined,memory -o dbfuzz2-msan \
792 $(DBFUZZ2_OPTS) $(TOP)/test/dbfuzz2.c sqlite3.c $(TLIBS)
793 mkdir -p dbfuzz2-dir
794 cp $(TOP)/test/dbfuzz2-seed* dbfuzz2-dir
796 mptester$(TEXE): sqlite3.lo $(TOP)/mptest/mptest.c
797 $(LTLINK) -o $@ -I. $(TOP)/mptest/mptest.c sqlite3.lo \
798 $(TLIBS) -rpath "$(libdir)"
800 MPTEST1=./mptester$(TEXE) mptest.db $(TOP)/mptest/crash01.test --repeat 20
801 MPTEST2=./mptester$(TEXE) mptest.db $(TOP)/mptest/multiwrite01.test --repeat 20
802 mptest: mptester$(TEXE)
803 rm -f mptest.db
804 $(MPTEST1) --journalmode DELETE
805 $(MPTEST2) --journalmode WAL
806 $(MPTEST1) --journalmode WAL
807 $(MPTEST2) --journalmode PERSIST
808 $(MPTEST1) --journalmode PERSIST
809 $(MPTEST2) --journalmode TRUNCATE
810 $(MPTEST1) --journalmode TRUNCATE
811 $(MPTEST2) --journalmode DELETE
814 has_tclsh84:
815 sh $(TOP)/tool/cktclsh.sh 8.4 $(TCLSH_CMD)
816 touch has_tclsh84
818 has_tclsh85:
819 sh $(TOP)/tool/cktclsh.sh 8.5 $(TCLSH_CMD)
820 touch has_tclsh85
823 # This target creates a directory named "tsrc" and fills it with
824 # copies of all of the C source code and header files needed to
825 # build on the target system. Some of the C source code and header
826 # files are automatically generated. This target takes care of
827 # all that automatic generation.
829 .target_source: $(SRC) $(TOP)/tool/vdbe-compress.tcl has_tclsh84 fts5.c
830 rm -rf tsrc
831 mkdir tsrc
832 cp -f $(SRC) tsrc
833 rm tsrc/sqlite.h.in tsrc/parse.y
834 $(TCLSH_CMD) $(TOP)/tool/vdbe-compress.tcl $(OPTS) <tsrc/vdbe.c >vdbe.new
835 mv vdbe.new tsrc/vdbe.c
836 cp fts5.c fts5.h tsrc
837 touch .target_source
839 sqlite3.c: .target_source $(TOP)/tool/mksqlite3c.tcl src-verify has_tclsh84
840 $(TCLSH_CMD) $(TOP)/tool/mksqlite3c.tcl $(AMALGAMATION_LINE_MACROS)
841 cp tsrc/sqlite3ext.h .
842 cp $(TOP)/ext/session/sqlite3session.h .
844 sqlite3r.h: sqlite3.h has_tclsh84
845 $(TCLSH_CMD) $(TOP)/tool/mksqlite3h.tcl $(TOP) --enable-recover >sqlite3r.h
847 sqlite3r.c: sqlite3.c sqlite3r.h has_tclsh84
848 cp $(TOP)/ext/recover/sqlite3recover.c tsrc/
849 cp $(TOP)/ext/recover/sqlite3recover.h tsrc/
850 cp $(TOP)/ext/recover/dbdata.c tsrc/
851 $(TCLSH_CMD) $(TOP)/tool/mksqlite3c.tcl --enable-recover $(AMALGAMATION_LINE_MACROS)
853 sqlite3ext.h: .target_source
854 cp tsrc/sqlite3ext.h .
856 tclsqlite3.c: sqlite3.c
857 echo '#ifndef USE_SYSTEM_SQLITE' >tclsqlite3.c
858 cat sqlite3.c >>tclsqlite3.c
859 echo '#endif /* USE_SYSTEM_SQLITE */' >>tclsqlite3.c
860 cat $(TOP)/src/tclsqlite.c >>tclsqlite3.c
862 sqlite3-all.c: sqlite3.c $(TOP)/tool/split-sqlite3c.tcl has_tclsh84
863 $(TCLSH_CMD) $(TOP)/tool/split-sqlite3c.tcl
865 # Rule to build the amalgamation
867 sqlite3.lo: sqlite3.c
868 $(LTCOMPILE) $(TEMP_STORE) -c sqlite3.c
870 # Rules to build the LEMON compiler generator
872 lemon$(BEXE): $(TOP)/tool/lemon.c $(TOP)/tool/lempar.c
873 $(BCC) -o $@ $(TOP)/tool/lemon.c
874 cp $(TOP)/tool/lempar.c .
876 # Rules to build the program that generates the source-id
878 mksourceid$(BEXE): $(TOP)/tool/mksourceid.c
879 $(BCC) -o $@ $(TOP)/tool/mksourceid.c
881 # Rules to build individual *.o files from generated *.c files. This
882 # applies to:
884 # parse.o
885 # opcodes.o
887 parse.lo: parse.c $(HDR)
888 $(LTCOMPILE) $(TEMP_STORE) -c parse.c
890 opcodes.lo: opcodes.c
891 $(LTCOMPILE) $(TEMP_STORE) -c opcodes.c
893 # BEGIN CRYPTO
894 crypto.lo: $(TOP)/src/crypto.c $(HDR)
895 $(LTCOMPILE) -c $(TOP)/src/crypto.c
896 crypto_impl.lo: $(TOP)/src/crypto_impl.c $(HDR)
897 $(LTCOMPILE) -c $(TOP)/src/crypto_impl.c
898 crypto_openssl.lo: $(TOP)/src/crypto_openssl.c $(HDR)
899 $(LTCOMPILE) -c $(TOP)/src/crypto_openssl.c
900 crypto_nss.lo: $(TOP)/src/crypto_nss.c $(HDR)
901 $(LTCOMPILE) -c $(TOP)/src/crypto_nss.c
902 crypto_libtomcrypt.lo: $(TOP)/src/crypto_libtomcrypt.c $(HDR)
903 $(LTCOMPILE) -c $(TOP)/src/crypto_libtomcrypt.c
904 crypto_cc.lo: $(TOP)/src/crypto_cc.c $(HDR)
905 $(LTCOMPILE) -c $(TOP)/src/crypto_cc.c
906 # END CRYPTO
908 # Rules to build individual *.o files from files in the src directory.
910 alter.lo: $(TOP)/src/alter.c $(HDR)
911 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/alter.c
913 analyze.lo: $(TOP)/src/analyze.c $(HDR)
914 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/analyze.c
916 attach.lo: $(TOP)/src/attach.c $(HDR)
917 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/attach.c
919 auth.lo: $(TOP)/src/auth.c $(HDR)
920 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/auth.c
922 backup.lo: $(TOP)/src/backup.c $(HDR)
923 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/backup.c
925 bitvec.lo: $(TOP)/src/bitvec.c $(HDR)
926 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/bitvec.c
928 btmutex.lo: $(TOP)/src/btmutex.c $(HDR)
929 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/btmutex.c
931 btree.lo: $(TOP)/src/btree.c $(HDR) $(TOP)/src/pager.h
932 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/btree.c
934 build.lo: $(TOP)/src/build.c $(HDR)
935 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/build.c
937 callback.lo: $(TOP)/src/callback.c $(HDR)
938 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/callback.c
940 complete.lo: $(TOP)/src/complete.c $(HDR)
941 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/complete.c
943 ctime.lo: $(TOP)/src/ctime.c $(HDR)
944 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/ctime.c
946 date.lo: $(TOP)/src/date.c $(HDR)
947 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/date.c
949 dbpage.lo: $(TOP)/src/dbpage.c $(HDR)
950 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/dbpage.c
952 dbstat.lo: $(TOP)/src/dbstat.c $(HDR)
953 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/dbstat.c
955 delete.lo: $(TOP)/src/delete.c $(HDR)
956 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/delete.c
958 expr.lo: $(TOP)/src/expr.c $(HDR)
959 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/expr.c
961 fault.lo: $(TOP)/src/fault.c $(HDR)
962 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/fault.c
964 fkey.lo: $(TOP)/src/fkey.c $(HDR)
965 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/fkey.c
967 func.lo: $(TOP)/src/func.c $(HDR)
968 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/func.c
970 global.lo: $(TOP)/src/global.c $(HDR)
971 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/global.c
973 hash.lo: $(TOP)/src/hash.c $(HDR)
974 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/hash.c
976 insert.lo: $(TOP)/src/insert.c $(HDR)
977 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/insert.c
979 json.lo: $(TOP)/src/json.c $(HDR)
980 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/json.c
982 legacy.lo: $(TOP)/src/legacy.c $(HDR)
983 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/legacy.c
985 loadext.lo: $(TOP)/src/loadext.c $(HDR)
986 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/loadext.c
988 main.lo: $(TOP)/src/main.c $(HDR)
989 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/main.c
991 malloc.lo: $(TOP)/src/malloc.c $(HDR)
992 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/malloc.c
994 mem0.lo: $(TOP)/src/mem0.c $(HDR)
995 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem0.c
997 mem1.lo: $(TOP)/src/mem1.c $(HDR)
998 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem1.c
1000 mem2.lo: $(TOP)/src/mem2.c $(HDR)
1001 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem2.c
1003 mem3.lo: $(TOP)/src/mem3.c $(HDR)
1004 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem3.c
1006 mem5.lo: $(TOP)/src/mem5.c $(HDR)
1007 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem5.c
1009 memdb.lo: $(TOP)/src/memdb.c $(HDR)
1010 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/memdb.c
1012 memjournal.lo: $(TOP)/src/memjournal.c $(HDR)
1013 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/memjournal.c
1015 mutex.lo: $(TOP)/src/mutex.c $(HDR)
1016 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex.c
1018 mutex_noop.lo: $(TOP)/src/mutex_noop.c $(HDR)
1019 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex_noop.c
1021 mutex_unix.lo: $(TOP)/src/mutex_unix.c $(HDR)
1022 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex_unix.c
1024 mutex_w32.lo: $(TOP)/src/mutex_w32.c $(HDR)
1025 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex_w32.c
1027 notify.lo: $(TOP)/src/notify.c $(HDR)
1028 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/notify.c
1030 pager.lo: $(TOP)/src/pager.c $(HDR) $(TOP)/src/pager.h
1031 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pager.c
1033 pcache.lo: $(TOP)/src/pcache.c $(HDR) $(TOP)/src/pcache.h
1034 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pcache.c
1036 pcache1.lo: $(TOP)/src/pcache1.c $(HDR) $(TOP)/src/pcache.h
1037 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pcache1.c
1039 os.lo: $(TOP)/src/os.c $(HDR)
1040 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os.c
1042 os_kv.lo: $(TOP)/src/os_kv.c $(HDR)
1043 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os_kv.c
1045 os_unix.lo: $(TOP)/src/os_unix.c $(HDR)
1046 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os_unix.c
1048 os_win.lo: $(TOP)/src/os_win.c $(HDR)
1049 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os_win.c
1051 pragma.lo: $(TOP)/src/pragma.c $(HDR)
1052 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pragma.c
1054 prepare.lo: $(TOP)/src/prepare.c $(HDR)
1055 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/prepare.c
1057 printf.lo: $(TOP)/src/printf.c $(HDR)
1058 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/printf.c
1060 random.lo: $(TOP)/src/random.c $(HDR)
1061 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/random.c
1063 resolve.lo: $(TOP)/src/resolve.c $(HDR)
1064 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/resolve.c
1066 rowset.lo: $(TOP)/src/rowset.c $(HDR)
1067 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/rowset.c
1069 select.lo: $(TOP)/src/select.c $(HDR)
1070 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/select.c
1072 status.lo: $(TOP)/src/status.c $(HDR)
1073 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/status.c
1075 table.lo: $(TOP)/src/table.c $(HDR)
1076 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/table.c
1078 threads.lo: $(TOP)/src/threads.c $(HDR)
1079 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/threads.c
1081 tokenize.lo: $(TOP)/src/tokenize.c keywordhash.h $(HDR)
1082 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/tokenize.c
1084 treeview.lo: $(TOP)/src/treeview.c $(HDR)
1085 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/treeview.c
1087 trigger.lo: $(TOP)/src/trigger.c $(HDR)
1088 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/trigger.c
1090 update.lo: $(TOP)/src/update.c $(HDR)
1091 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/update.c
1093 upsert.lo: $(TOP)/src/upsert.c $(HDR)
1094 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/upsert.c
1096 utf.lo: $(TOP)/src/utf.c $(HDR)
1097 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/utf.c
1099 util.lo: $(TOP)/src/util.c $(HDR)
1100 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/util.c
1102 vacuum.lo: $(TOP)/src/vacuum.c $(HDR)
1103 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vacuum.c
1105 vdbe.lo: $(TOP)/src/vdbe.c $(HDR)
1106 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbe.c
1108 vdbeapi.lo: $(TOP)/src/vdbeapi.c $(HDR)
1109 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbeapi.c
1111 vdbeaux.lo: $(TOP)/src/vdbeaux.c $(HDR)
1112 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbeaux.c
1114 vdbeblob.lo: $(TOP)/src/vdbeblob.c $(HDR)
1115 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbeblob.c
1117 vdbemem.lo: $(TOP)/src/vdbemem.c $(HDR)
1118 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbemem.c
1120 vdbesort.lo: $(TOP)/src/vdbesort.c $(HDR)
1121 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbesort.c
1123 vdbetrace.lo: $(TOP)/src/vdbetrace.c $(HDR)
1124 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbetrace.c
1126 vdbevtab.lo: $(TOP)/src/vdbevtab.c $(HDR)
1127 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbevtab.c
1129 vtab.lo: $(TOP)/src/vtab.c $(HDR)
1130 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vtab.c
1132 wal.lo: $(TOP)/src/wal.c $(HDR)
1133 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/wal.c
1135 walker.lo: $(TOP)/src/walker.c $(HDR)
1136 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/walker.c
1138 where.lo: $(TOP)/src/where.c $(HDR)
1139 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/where.c
1141 wherecode.lo: $(TOP)/src/wherecode.c $(HDR)
1142 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/wherecode.c
1144 whereexpr.lo: $(TOP)/src/whereexpr.c $(HDR)
1145 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/whereexpr.c
1147 window.lo: $(TOP)/src/window.c $(HDR)
1148 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/window.c
1150 tclsqlite.lo: $(TOP)/src/tclsqlite.c $(HDR)
1151 $(LTCOMPILE) -DUSE_TCL_STUBS=1 -c $(TOP)/src/tclsqlite.c
1153 tclsqlite-shell.lo: $(TOP)/src/tclsqlite.c $(HDR)
1154 $(LTCOMPILE) -DTCLSH -o $@ -c $(TOP)/src/tclsqlite.c
1156 tclsqlite-stubs.lo: $(TOP)/src/tclsqlite.c $(HDR)
1157 $(LTCOMPILE) -DUSE_TCL_STUBS=1 -o $@ -c $(TOP)/src/tclsqlite.c
1159 tclsqlcipher$(TEXE): tclsqlite-shell.lo libsqlcipher.la
1160 $(LTLINK) -o $@ tclsqlite-shell.lo \
1161 libsqlcipher.la $(LIBTCL)
1163 # Rules to build opcodes.c and opcodes.h
1165 opcodes.c: opcodes.h $(TOP)/tool/mkopcodec.tcl has_tclsh84
1166 $(TCLSH_CMD) $(TOP)/tool/mkopcodec.tcl opcodes.h >opcodes.c
1168 opcodes.h: parse.h $(TOP)/src/vdbe.c $(TOP)/tool/mkopcodeh.tcl has_tclsh84
1169 cat parse.h $(TOP)/src/vdbe.c | $(TCLSH_CMD) $(TOP)/tool/mkopcodeh.tcl >opcodes.h
1171 # Rules to build parse.c and parse.h - the outputs of lemon.
1173 parse.h: parse.c
1175 parse.c: $(TOP)/src/parse.y lemon$(BEXE)
1176 cp $(TOP)/src/parse.y .
1177 ./lemon$(BEXE) $(OPT_FEATURE_FLAGS) $(OPTS) -S parse.y
1179 sqlite3.h: $(TOP)/src/sqlite.h.in $(TOP)/manifest mksourceid$(BEXE) $(TOP)/VERSION has_tclsh84
1180 $(TCLSH_CMD) $(TOP)/tool/mksqlite3h.tcl $(TOP) >sqlite3.h
1182 sqlite3rc.h: $(TOP)/src/sqlite3.rc $(TOP)/VERSION has_tclsh84
1183 echo '#ifndef SQLITE_RESOURCE_VERSION' >$@
1184 echo -n '#define SQLITE_RESOURCE_VERSION ' >>$@
1185 cat $(TOP)/VERSION | $(TCLSH_CMD) $(TOP)/tool/replace.tcl exact . , >>$@
1186 echo '#endif' >>sqlite3rc.h
1188 keywordhash.h: $(TOP)/tool/mkkeywordhash.c
1189 $(BCC) -o mkkeywordhash$(BEXE) $(OPT_FEATURE_FLAGS) $(OPTS) $(TOP)/tool/mkkeywordhash.c
1190 ./mkkeywordhash$(BEXE) >keywordhash.h
1192 # Source files that go into making shell.c
1193 SHELL_SRC = \
1194 $(TOP)/src/shell.c.in \
1195 $(TOP)/ext/consio/console_io.c \
1196 $(TOP)/ext/consio/console_io.h \
1197 $(TOP)/ext/misc/appendvfs.c \
1198 $(TOP)/ext/misc/completion.c \
1199 $(TOP)/ext/misc/decimal.c \
1200 $(TOP)/ext/misc/basexx.c \
1201 $(TOP)/ext/misc/base64.c \
1202 $(TOP)/ext/misc/base85.c \
1203 $(TOP)/ext/misc/fileio.c \
1204 $(TOP)/ext/misc/ieee754.c \
1205 $(TOP)/ext/misc/regexp.c \
1206 $(TOP)/ext/misc/series.c \
1207 $(TOP)/ext/misc/shathree.c \
1208 $(TOP)/ext/misc/sqlar.c \
1209 $(TOP)/ext/misc/uint.c \
1210 $(TOP)/ext/expert/sqlite3expert.c \
1211 $(TOP)/ext/expert/sqlite3expert.h \
1212 $(TOP)/ext/misc/zipfile.c \
1213 $(TOP)/ext/misc/memtrace.c \
1214 $(TOP)/ext/misc/pcachetrace.c \
1215 $(TOP)/ext/recover/dbdata.c \
1216 $(TOP)/ext/recover/sqlite3recover.c \
1217 $(TOP)/ext/recover/sqlite3recover.h \
1218 $(TOP)/src/test_windirent.c
1220 shell.c: $(SHELL_SRC) $(TOP)/tool/mkshellc.tcl has_tclsh84
1221 $(TCLSH_CMD) $(TOP)/tool/mkshellc.tcl >shell.c
1226 # Rules to build the extension objects.
1228 icu.lo: $(TOP)/ext/icu/icu.c $(HDR) $(EXTHDR)
1229 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/icu/icu.c
1231 fts3.lo: $(TOP)/ext/fts3/fts3.c $(HDR) $(EXTHDR)
1232 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3.c
1234 fts3_aux.lo: $(TOP)/ext/fts3/fts3_aux.c $(HDR) $(EXTHDR)
1235 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_aux.c
1237 fts3_expr.lo: $(TOP)/ext/fts3/fts3_expr.c $(HDR) $(EXTHDR)
1238 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_expr.c
1240 fts3_hash.lo: $(TOP)/ext/fts3/fts3_hash.c $(HDR) $(EXTHDR)
1241 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_hash.c
1243 fts3_icu.lo: $(TOP)/ext/fts3/fts3_icu.c $(HDR) $(EXTHDR)
1244 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_icu.c
1246 fts3_porter.lo: $(TOP)/ext/fts3/fts3_porter.c $(HDR) $(EXTHDR)
1247 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_porter.c
1249 fts3_snippet.lo: $(TOP)/ext/fts3/fts3_snippet.c $(HDR) $(EXTHDR)
1250 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_snippet.c
1252 fts3_tokenizer.lo: $(TOP)/ext/fts3/fts3_tokenizer.c $(HDR) $(EXTHDR)
1253 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer.c
1255 fts3_tokenizer1.lo: $(TOP)/ext/fts3/fts3_tokenizer1.c $(HDR) $(EXTHDR)
1256 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer1.c
1258 fts3_tokenize_vtab.lo: $(TOP)/ext/fts3/fts3_tokenize_vtab.c $(HDR) $(EXTHDR)
1259 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenize_vtab.c
1261 fts3_unicode.lo: $(TOP)/ext/fts3/fts3_unicode.c $(HDR) $(EXTHDR)
1262 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_unicode.c
1264 fts3_unicode2.lo: $(TOP)/ext/fts3/fts3_unicode2.c $(HDR) $(EXTHDR)
1265 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_unicode2.c
1267 fts3_write.lo: $(TOP)/ext/fts3/fts3_write.c $(HDR) $(EXTHDR)
1268 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_write.c
1270 rtree.lo: $(TOP)/ext/rtree/rtree.c $(HDR) $(EXTHDR)
1271 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/rtree/rtree.c
1273 userauth.lo: $(TOP)/ext/userauth/userauth.c $(HDR) $(EXTHDR)
1274 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/userauth/userauth.c
1276 sqlite3session.lo: $(TOP)/ext/session/sqlite3session.c $(HDR) $(EXTHDR)
1277 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/session/sqlite3session.c
1279 stmt.lo: $(TOP)/ext/misc/stmt.c
1280 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/misc/stmt.c
1282 # FTS5 things
1284 FTS5_SRC = \
1285 $(TOP)/ext/fts5/fts5.h \
1286 $(TOP)/ext/fts5/fts5Int.h \
1287 $(TOP)/ext/fts5/fts5_aux.c \
1288 $(TOP)/ext/fts5/fts5_buffer.c \
1289 $(TOP)/ext/fts5/fts5_main.c \
1290 $(TOP)/ext/fts5/fts5_config.c \
1291 $(TOP)/ext/fts5/fts5_expr.c \
1292 $(TOP)/ext/fts5/fts5_hash.c \
1293 $(TOP)/ext/fts5/fts5_index.c \
1294 fts5parse.c fts5parse.h \
1295 $(TOP)/ext/fts5/fts5_storage.c \
1296 $(TOP)/ext/fts5/fts5_tokenize.c \
1297 $(TOP)/ext/fts5/fts5_unicode2.c \
1298 $(TOP)/ext/fts5/fts5_varint.c \
1299 $(TOP)/ext/fts5/fts5_vocab.c \
1301 fts5parse.c: $(TOP)/ext/fts5/fts5parse.y lemon$(BEXE)
1302 cp $(TOP)/ext/fts5/fts5parse.y .
1303 rm -f fts5parse.h
1304 ./lemon$(BEXE) $(OPTS) -S fts5parse.y
1306 fts5parse.h: fts5parse.c
1308 fts5.c: $(FTS5_SRC) has_tclsh84
1309 $(TCLSH_CMD) $(TOP)/ext/fts5/tool/mkfts5c.tcl
1310 cp $(TOP)/ext/fts5/fts5.h .
1312 fts5.lo: fts5.c $(HDR) $(EXTHDR)
1313 $(LTCOMPILE) -DSQLITE_CORE -c fts5.c
1315 sqlite3rbu.lo: $(TOP)/ext/rbu/sqlite3rbu.c $(HDR) $(EXTHDR)
1316 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/rbu/sqlite3rbu.c
1319 # Rules to build the 'testfixture' application.
1321 # If using the amalgamation, use sqlite3.c directly to build the test
1322 # fixture. Otherwise link against libsqlcipher.la. (This distinction is
1323 # necessary because the test fixture requires non-API symbols which are
1324 # hidden when the library is built via the amalgamation).
1326 TESTFIXTURE_FLAGS = -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
1327 TESTFIXTURE_FLAGS += -DTCLSH_INIT_PROC=sqlite3TestInit
1328 TESTFIXTURE_FLAGS += -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE
1329 TESTFIXTURE_FLAGS += -DBUILD_sqlite
1330 TESTFIXTURE_FLAGS += -DSQLITE_SERIES_CONSTRAINT_VERIFY=1
1331 TESTFIXTURE_FLAGS += -DSQLITE_DEFAULT_PAGE_SIZE=1024
1332 TESTFIXTURE_FLAGS += -DSQLITE_ENABLE_STMTVTAB
1333 TESTFIXTURE_FLAGS += -DSQLITE_ENABLE_DBPAGE_VTAB
1334 TESTFIXTURE_FLAGS += -DSQLITE_ENABLE_BYTECODE_VTAB
1335 TESTFIXTURE_FLAGS += -DSQLITE_CKSUMVFS_STATIC
1336 TESTFIXTURE_FLAGS += -DSQLITE_STATIC_RANDOMJSON
1337 TESTFIXTURE_FLAGS += -DSQLITE_STRICT_SUBTYPE=1
1339 TESTFIXTURE_SRC0 = $(TESTSRC2) libsqlcipher.la
1340 TESTFIXTURE_SRC1 = sqlite3.c
1341 TESTFIXTURE_SRC = $(TESTSRC) $(TOP)/src/tclsqlite.c
1342 TESTFIXTURE_SRC += $(TESTFIXTURE_SRC$(USE_AMALGAMATION))
1344 testfixture$(TEXE): has_tclsh85 $(TESTFIXTURE_SRC)
1345 $(LTLINK) -DSQLITE_NO_SYNC=1 $(TEMP_STORE) $(TESTFIXTURE_FLAGS) \
1346 -o $@ $(TESTFIXTURE_SRC) $(LIBTCL) $(TLIBS)
1348 coretestprogs: $(TESTPROGS)
1350 testprogs: coretestprogs srcck1$(BEXE) fuzzcheck$(TEXE) sessionfuzz$(TEXE)
1352 # A very detailed test running most or all test cases
1353 fulltest: alltest fuzztest
1355 # Run most or all tcl test cases
1356 alltest: $(TESTPROGS)
1357 ./testfixture$(TEXE) $(TOP)/test/all.test $(TESTOPTS)
1359 # Really really long testing
1360 soaktest: $(TESTPROGS)
1361 ./testfixture$(TEXE) $(TOP)/test/all.test -soak=1 $(TESTOPTS)
1363 # Do extra testing but not everything.
1364 fulltestonly: $(TESTPROGS) fuzztest
1365 ./testfixture$(TEXE) $(TOP)/test/full.test
1367 # Fuzz testing
1369 # WARNING: When the "fuzztest" target is run by the testrunner.tcl script,
1370 # it does not actually run this code. Instead, it schedules equivalent
1371 # commands. Therefore, if this target is updated, then code in
1372 # testrunner_data.tcl (search for "trd_fuzztest_data") must also be updated.
1374 fuzztest: fuzzcheck$(TEXE) $(FUZZDATA) sessionfuzz$(TEXE)
1375 ./fuzzcheck$(TEXE) $(FUZZDATA)
1376 ./sessionfuzz$(TEXE) run $(TOP)/test/sessionfuzz-data1.db
1378 valgrindfuzz: fuzzcheck$(TEXT) $(FUZZDATA) sessionfuzz$(TEXE)
1379 valgrind ./fuzzcheck$(TEXE) --cell-size-check --limit-mem 10M $(FUZZDATA)
1380 valgrind ./sessionfuzz$(TEXE) run $(TOP)/test/sessionfuzz-data1.db
1382 # The veryquick.test TCL tests.
1384 tcltest: ./testfixture$(TEXE)
1385 ./testfixture$(TEXE) $(TOP)/test/veryquick.test $(TESTOPTS)
1387 # Runs all the same tests cases as the "tcltest" target but uses
1388 # the testrunner.tcl script to run them in multiple cores
1389 # concurrently.
1390 testrunner: testfixture$(TEXE)
1391 ./testfixture$(TEXE) $(TOP)/test/testrunner.tcl
1393 # Runs both fuzztest and testrunner, consecutively.
1395 devtest: srctree-check testfixture$(TEXE) fuzztest testrunner
1397 mdevtest: srctree-check has_tclsh85
1398 $(TCLSH_CMD) $(TOP)/test/testrunner.tcl mdevtest
1400 sdevtest: has_tclsh85
1401 $(TCLSH_CMD) $(TOP)/test/testrunner.tcl sdevtest
1403 # Validate that various generated files in the source tree
1404 # are up-to-date.
1406 srctree-check: $(TOP)/tool/srctree-check.tcl
1407 $(TCLSH_CMD) $(TOP)/tool/srctree-check.tcl
1409 # Testing for a release
1411 releasetest: srctree-check testfixture$(TEXE)
1412 ./testfixture$(TEXE) $(TOP)/test/testrunner.tcl release
1414 # Minimal testing that runs in less than 3 minutes
1416 quicktest: ./testfixture$(TEXE)
1417 ./testfixture$(TEXE) $(TOP)/test/extraquick.test $(TESTOPTS)
1419 # This is the common case. Run many tests that do not take too long,
1420 # including fuzzcheck, sqlite3_analyzer, and sqldiff tests.
1422 test: srctree-check fuzztest sourcetest $(TESTPROGS) tcltest
1424 # Run a test using valgrind. This can take a really long time
1425 # because valgrind is so much slower than a native machine.
1427 valgrindtest: $(TESTPROGS) valgrindfuzz
1428 OMIT_MISUSE=1 valgrind -v ./testfixture$(TEXE) $(TOP)/test/permutations.test valgrind $(TESTOPTS)
1430 # A very fast test that checks basic sanity. The name comes from
1431 # the 60s-era electronics testing: "Turn it on and see if smoke
1432 # comes out."
1434 smoketest: $(TESTPROGS) fuzzcheck$(TEXE)
1435 ./testfixture$(TEXE) $(TOP)/test/main.test $(TESTOPTS)
1437 shelltest: $(TESTPROGS)
1438 ./testfixture$(TEXT) $(TOP)/test/permutations.test shell
1440 sqlite3_analyzer.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqlite3_analyzer.c.in has_tclsh85
1441 $(TCLSH_CMD) $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqlite3_analyzer.c.in >sqlite3_analyzer.c
1443 sqlite3_analyzer$(TEXE): sqlite3_analyzer.c
1444 $(LTLINK) sqlite3_analyzer.c -o $@ $(LIBTCL) $(TLIBS)
1446 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 has_tclsh85
1447 $(TCLSH_CMD) $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqltclsh.c.in >sqltclsh.c
1449 sqltclsh$(TEXE): sqltclsh.c
1450 $(LTLINK) sqltclsh.c -o $@ $(LIBTCL) $(TLIBS)
1452 sqlite3_expert$(TEXE): $(TOP)/ext/expert/sqlite3expert.h $(TOP)/ext/expert/sqlite3expert.c $(TOP)/ext/expert/expert.c sqlite3.c
1453 $(LTLINK) $(TOP)/ext/expert/sqlite3expert.h $(TOP)/ext/expert/sqlite3expert.c $(TOP)/ext/expert/expert.c sqlite3.c -o sqlite3_expert $(TLIBS)
1455 CHECKER_DEPS =\
1456 $(TOP)/tool/mkccode.tcl \
1457 sqlite3.c \
1458 $(TOP)/src/tclsqlite.c \
1459 $(TOP)/ext/repair/sqlite3_checker.tcl \
1460 $(TOP)/ext/repair/checkindex.c \
1461 $(TOP)/ext/repair/checkfreelist.c \
1462 $(TOP)/ext/misc/btreeinfo.c \
1463 $(TOP)/ext/repair/sqlite3_checker.c.in
1465 sqlite3_checker.c: $(CHECKER_DEPS) has_tclsh85
1466 $(TCLSH_CMD) $(TOP)/tool/mkccode.tcl $(TOP)/ext/repair/sqlite3_checker.c.in >$@
1468 sqlite3_checker$(TEXE): sqlite3_checker.c
1469 $(LTLINK) sqlite3_checker.c -o $@ $(LIBTCL) $(TLIBS)
1471 dbdump$(TEXE): $(TOP)/ext/misc/dbdump.c sqlite3.lo
1472 $(LTLINK) -DDBDUMP_STANDALONE -o $@ \
1473 $(TOP)/ext/misc/dbdump.c sqlite3.lo $(TLIBS)
1475 dbtotxt$(TEXE): $(TOP)/tool/dbtotxt.c
1476 $(LTLINK)-o $@ $(TOP)/tool/dbtotxt.c
1478 showdb$(TEXE): $(TOP)/tool/showdb.c sqlite3.lo
1479 $(LTLINK) -o $@ $(TOP)/tool/showdb.c sqlite3.lo $(TLIBS)
1481 showstat4$(TEXE): $(TOP)/tool/showstat4.c sqlite3.lo
1482 $(LTLINK) -o $@ $(TOP)/tool/showstat4.c sqlite3.lo $(TLIBS)
1484 showjournal$(TEXE): $(TOP)/tool/showjournal.c sqlite3.lo
1485 $(LTLINK) -o $@ $(TOP)/tool/showjournal.c sqlite3.lo $(TLIBS)
1487 showwal$(TEXE): $(TOP)/tool/showwal.c sqlite3.lo
1488 $(LTLINK) -o $@ $(TOP)/tool/showwal.c sqlite3.lo $(TLIBS)
1490 showshm$(TEXE): $(TOP)/tool/showshm.c
1491 $(LTLINK) -o $@ $(TOP)/tool/showshm.c
1493 index_usage$(TEXE): $(TOP)/tool/index_usage.c sqlite3.lo
1494 $(LTLINK) $(SHELL_OPT) -o $@ $(TOP)/tool/index_usage.c sqlite3.lo $(TLIBS)
1496 changeset$(TEXE): $(TOP)/ext/session/changeset.c sqlite3.lo
1497 $(LTLINK) -o $@ $(TOP)/ext/session/changeset.c sqlite3.lo $(TLIBS)
1499 changesetfuzz$(TEXE): $(TOP)/ext/session/changesetfuzz.c sqlite3.lo
1500 $(LTLINK) -o $@ $(TOP)/ext/session/changesetfuzz.c sqlite3.lo $(TLIBS)
1502 rollback-test$(TEXE): $(TOP)/tool/rollback-test.c sqlite3.lo
1503 $(LTLINK) -o $@ $(TOP)/tool/rollback-test.c sqlite3.lo $(TLIBS)
1505 atrc$(TEXX): $(TOP)/test/atrc.c sqlite3.lo
1506 $(LTLINK) -o $@ $(TOP)/test/atrc.c sqlite3.lo $(TLIBS)
1508 LogEst$(TEXE): $(TOP)/tool/logest.c sqlite3.h
1509 $(LTLINK) -I. -o $@ $(TOP)/tool/logest.c
1511 wordcount$(TEXE): $(TOP)/test/wordcount.c sqlite3.lo
1512 $(LTLINK) -o $@ $(TOP)/test/wordcount.c sqlite3.lo $(TLIBS)
1514 speedtest1$(TEXE): $(TOP)/test/speedtest1.c sqlite3.c Makefile
1515 $(LTLINK) $(ST_OPT) -o $@ $(TOP)/test/speedtest1.c sqlite3.c $(TLIBS)
1517 startup$(TEXE): $(TOP)/test/startup.c sqlite3.c
1518 $(CC) -Os -g -DSQLITE_THREADSAFE=0 -o $@ $(TOP)/test/startup.c sqlite3.c $(TLIBS)
1520 KV_OPT += -DSQLITE_DIRECT_OVERFLOW_READ
1522 kvtest$(TEXE): $(TOP)/test/kvtest.c sqlite3.c
1523 $(LTLINK) $(KV_OPT) -o $@ $(TOP)/test/kvtest.c sqlite3.c $(TLIBS)
1525 rbu$(EXE): $(TOP)/ext/rbu/rbu.c $(TOP)/ext/rbu/sqlite3rbu.c sqlite3.lo
1526 $(LTLINK) -I. -o $@ $(TOP)/ext/rbu/rbu.c sqlite3.lo $(TLIBS)
1528 loadfts$(EXE): $(TOP)/tool/loadfts.c libsqlite3.la
1529 $(LTLINK) $(TOP)/tool/loadfts.c libsqlite3.la -o $@ $(TLIBS)
1531 # This target will fail if the SQLite amalgamation contains any exported
1532 # symbols that do not begin with "sqlite3_". It is run as part of the
1533 # releasetest.tcl script.
1535 VALIDIDS=' sqlite3(changeset|changegroup|session)?_'
1536 checksymbols: sqlite3.o
1537 nm -g --defined-only sqlite3.o
1538 nm -g --defined-only sqlite3.o | egrep -v $(VALIDIDS); test $$? -ne 0
1539 echo '0 errors out of 1 tests'
1541 # Build the amalgamation-autoconf package. The amalamgation-tarball target builds
1542 # a tarball named for the version number. Ex: sqlite-autoconf-3110000.tar.gz.
1543 # The snapshot-tarball target builds a tarball named by the SHA1 hash
1545 amalgamation-tarball: sqlite3.c sqlite3rc.h
1546 TOP=$(TOP) sh $(TOP)/tool/mkautoconfamal.sh --normal
1548 snapshot-tarball: sqlite3.c sqlite3rc.h
1549 TOP=$(TOP) sh $(TOP)/tool/mkautoconfamal.sh --snapshot
1551 # Build a ZIP archive containing various command-line tools.
1553 tool-zip: testfixture sqlite3 sqldiff sqlite3_analyzer $(TOP)/tool/mktoolzip.tcl
1554 ./testfixture $(TOP)/tool/mktoolzip.tcl
1556 # The next two rules are used to support the "threadtest" target. Building
1557 # threadtest runs a few thread-safety tests that are implemented in C. This
1558 # target is invoked by the releasetest.tcl script.
1560 THREADTEST3_SRC = $(TOP)/test/threadtest3.c \
1561 $(TOP)/test/tt3_checkpoint.c \
1562 $(TOP)/test/tt3_index.c \
1563 $(TOP)/test/tt3_vacuum.c \
1564 $(TOP)/test/tt3_stress.c \
1565 $(TOP)/test/tt3_lookaside1.c
1567 threadtest3$(TEXE): sqlite3.lo $(THREADTEST3_SRC)
1568 $(LTLINK) $(TOP)/test/threadtest3.c $(TOP)/src/test_multiplex.c sqlite3.lo -o $@ $(TLIBS)
1570 threadtest: threadtest3$(TEXE)
1571 ./threadtest3$(TEXE)
1573 threadtest5: sqlite3.c $(TOP)/test/threadtest5.c
1574 $(LTLINK) $(TOP)/test/threadtest5.c sqlite3.c -o $@ $(TLIBS)
1576 # Standard install and cleanup targets
1578 lib_install: libsqlcipher.la
1579 $(INSTALL) -d $(DESTDIR)$(libdir)
1580 $(LTINSTALL) libsqlcipher.la $(DESTDIR)$(libdir)
1582 install: sqlcipher$(TEXE) lib_install sqlite3.h sqlcipher.pc ${HAVE_TCL:1=tcl_install}
1583 $(INSTALL) -d $(DESTDIR)$(bindir)
1584 $(LTINSTALL) sqlcipher$(TEXE) $(DESTDIR)$(bindir)
1585 $(INSTALL) -d $(DESTDIR)$(includedir)
1586 $(INSTALL) -m 0644 sqlite3.h $(DESTDIR)$(includedir)
1587 $(INSTALL) -m 0644 $(TOP)/src/sqlite3ext.h $(DESTDIR)$(includedir)
1588 $(INSTALL) -d $(DESTDIR)$(pkgconfigdir)
1589 $(INSTALL) -m 0644 sqlcipher.pc $(DESTDIR)$(pkgconfigdir)
1591 pkgIndex.tcl:
1592 echo 'package ifneeded sqlite3 $(RELEASE) [list load [file join $$dir libtclsqlite3[info sharedlibextension]] sqlite3]' > $@
1593 tcl_install: lib_install libtclsqlite3.la pkgIndex.tcl
1594 $(INSTALL) -d $(DESTDIR)$(TCLLIBDIR)
1595 $(LTINSTALL) libtclsqlite3.la $(DESTDIR)$(TCLLIBDIR)
1596 rm -f $(DESTDIR)$(TCLLIBDIR)/libtclsqlite3.la $(DESTDIR)$(TCLLIBDIR)/libtclsqlite3.a
1597 $(INSTALL) -m 0644 pkgIndex.tcl $(DESTDIR)$(TCLLIBDIR)
1599 clean:
1600 rm -f *.lo *.la *.o sqlcipher$(TEXE) libsqlcipher.la
1601 rm -f sqlite3.h opcodes.*
1602 rm -rf .libs .deps
1603 rm -f lemon$(BEXE) lempar.c parse.* sqlite*.tar.gz
1604 rm -f mkkeywordhash$(BEXE) keywordhash.h
1605 rm -f mksourceid$(BEXE)
1606 rm -f *.da *.bb *.bbg gmon.out
1607 rm -rf tsrc .target_source
1608 rm -f tclsqlcipher$(TEXE)
1609 rm -f testfixture$(TEXE) test.db
1610 rm -f LogEst$(TEXE) fts3view$(TEXE) rollback-test$(TEXE) showdb$(TEXE)
1611 rm -f showjournal$(TEXE) showstat4$(TEXE) showwal$(TEXE) speedtest1$(TEXE)
1612 rm -f wordcount$(TEXE) changeset$(TEXE)
1613 rm -f version-info$(TEXT)
1614 rm -f sqlite3.dll sqlite3.lib sqlite3.exp sqlite3.def
1615 rm -f sqlite3.c
1616 rm -f sqlite3rc.h
1617 rm -f shell.c sqlite3ext.h
1618 rm -f sqlite3_analyzer$(TEXE) sqlite3_analyzer.c
1619 rm -f sqlite-*-output.vsix
1620 rm -f mptester mptester.exe
1621 rm -f rbu rbu.exe
1622 rm -f srcck1 srcck1.exe
1623 rm -f fuzzershell fuzzershell.exe
1624 rm -f fuzzcheck fuzzcheck.exe
1625 rm -f sqldiff sqldiff.exe
1626 rm -f dbhash dbhash.exe
1627 rm -f fts5.* fts5parse.*
1628 rm -f threadtest5
1629 rm -f src-verify
1630 rm -f custom.rws
1631 rm -f has_tclsh84 has_tclsh85
1633 distclean: clean
1634 rm -f sqlite_cfg.h config.log config.status libtool Makefile sqlcipher.pc \
1635 $(TESTPROGS)
1638 # Windows section
1640 dll: sqlite3.dll
1642 REAL_LIBOBJ = $(LIBOBJ:%.lo=.libs/%.o)
1644 $(REAL_LIBOBJ): $(LIBOBJ)
1646 sqlite3.def: $(REAL_LIBOBJ)
1647 echo 'EXPORTS' >sqlite3.def
1648 nm $(REAL_LIBOBJ) | grep ' T ' | grep ' _sqlite3_' \
1649 | sed 's/^.* _//' >>sqlite3.def
1651 sqlite3.dll: $(REAL_LIBOBJ) sqlite3.def
1652 $(TCC) -shared -o $@ sqlite3.def \
1653 -Wl,"--strip-all" $(REAL_LIBOBJ)
1656 # Fiddle app
1658 fiddle: sqlite3.c shell.c
1659 make -C ext/wasm fiddle emcc_opt=-Os
1662 # Spell-checking for source comments
1663 # The sources checked are either C sources or C source templates.
1664 # Their comments are extracted and processed through aspell using
1665 # a custom dictionary that contains scads of odd identifiers that
1666 # find their way into the comments.
1668 # Currently, this target is setup to be "made" in-tree only.
1669 # The output is ephemeral. Redirect it to guide spelling fixups,
1670 # either to correct spelling or add words to tool/custom.txt.
1672 ./custom.rws: ./tool/custom.txt
1673 @echo 'Updating custom dictionary from tool/custom.txt'
1674 aspell --lang=en create master ./custom.rws < $<
1676 misspell: ./custom.rws has_tclsh84
1677 $(TCLSH_CMD) ./tool/spellsift.tcl ./src/*.c ./src/*.h ./src/*.in
1680 # tool/version-info: a utility for emitting sqlite3 version info
1681 # in various forms.
1683 version-info$(TEXE): $(TOP)/tool/version-info.c Makefile sqlite3.h
1684 $(LTLINK) $(ST_OPT) -o $@ $(TOP)/tool/version-info.c