Merges crypto.h, crypto.c, and crypto_impl.c into sqlcipher.c
[sqlcipher.git] / Makefile.in
blob8431c25a619e534b81682877019426c7f050431b
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 sqlcipher.lo \
149 crypto_openssl.lo \
150 crypto_libtomcrypt.lo \
151 crypto_nss.lo \
152 crypto_cc.lo
154 CRYPTOSRC = \
155 $(TOP)/src/sqlcipher.h \
156 $(TOP)/src/sqlcipher.c \
157 $(TOP)/src/crypto_libtomcrypt.c \
158 $(TOP)/src/crypto_nss.c \
159 $(TOP)/src/crypto_openssl.c \
160 $(TOP)/src/crypto_cc.c
162 # END CRYPTO
164 # The directory into which to store package information for
166 # Some standard variables and programs
168 prefix = @prefix@
169 exec_prefix = @exec_prefix@
170 libdir = @libdir@
171 pkgconfigdir = $(libdir)/pkgconfig
172 bindir = @bindir@
173 includedir = @includedir@/sqlcipher
174 INSTALL = @INSTALL@
175 LIBTOOL = ./libtool
176 ALLOWRELEASE = @ALLOWRELEASE@
178 # libtool compile/link/install
179 LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(TCC) $(LTCOMPILE_EXTRAS)
180 LTLINK = $(LIBTOOL) --mode=link $(TCC) $(LTCOMPILE_EXTRAS) @LDFLAGS@ $(LTLINK_EXTRAS)
181 LTINSTALL = $(LIBTOOL) --mode=install $(INSTALL)
183 # You should not have to change anything below this line
184 ###############################################################################
186 USE_AMALGAMATION = @USE_AMALGAMATION@
187 AMALGAMATION_LINE_MACROS = @AMALGAMATION_LINE_MACROS@
189 # Object files for the SQLite library (non-amalgamation).
191 LIBOBJS0 = alter.lo analyze.lo attach.lo auth.lo \
192 backup.lo bitvec.lo btmutex.lo btree.lo build.lo \
193 callback.lo complete.lo ctime.lo \
194 date.lo dbpage.lo dbstat.lo delete.lo \
195 expr.lo fault.lo fkey.lo \
196 fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo \
197 fts3_porter.lo fts3_snippet.lo fts3_tokenizer.lo fts3_tokenizer1.lo \
198 fts3_tokenize_vtab.lo \
199 fts3_unicode.lo fts3_unicode2.lo fts3_write.lo \
200 fts5.lo \
201 func.lo global.lo hash.lo \
202 icu.lo insert.lo json.lo legacy.lo loadext.lo \
203 main.lo malloc.lo mem0.lo mem1.lo mem2.lo mem3.lo mem5.lo \
204 memdb.lo memjournal.lo \
205 mutex.lo mutex_noop.lo mutex_unix.lo mutex_w32.lo \
206 notify.lo opcodes.lo os.lo os_kv.lo os_unix.lo os_win.lo \
207 pager.lo parse.lo pcache.lo pcache1.lo pragma.lo prepare.lo printf.lo \
208 random.lo resolve.lo rowset.lo rtree.lo \
209 sqlite3session.lo select.lo sqlite3rbu.lo status.lo stmt.lo \
210 table.lo threads.lo tokenize.lo treeview.lo trigger.lo \
211 update.lo userauth.lo upsert.lo util.lo vacuum.lo \
212 vdbe.lo vdbeapi.lo vdbeaux.lo vdbeblob.lo vdbemem.lo vdbesort.lo \
213 vdbetrace.lo vdbevtab.lo \
214 wal.lo walker.lo where.lo wherecode.lo whereexpr.lo \
215 window.lo utf.lo vtab.lo $(CRYPTOLIBOBJ)
217 # Object files for the amalgamation.
219 LIBOBJS1 = sqlite3.lo
221 # Determine the real value of LIBOBJ based on the 'configure' script
223 LIBOBJ = $(LIBOBJS$(USE_AMALGAMATION))
226 # All of the source code files.
228 SRC = \
229 $(CRYPTOSRC) \
230 $(TOP)/src/alter.c \
231 $(TOP)/src/analyze.c \
232 $(TOP)/src/attach.c \
233 $(TOP)/src/auth.c \
234 $(TOP)/src/backup.c \
235 $(TOP)/src/bitvec.c \
236 $(TOP)/src/btmutex.c \
237 $(TOP)/src/btree.c \
238 $(TOP)/src/btree.h \
239 $(TOP)/src/btreeInt.h \
240 $(TOP)/src/build.c \
241 $(TOP)/src/callback.c \
242 $(TOP)/src/complete.c \
243 $(TOP)/src/ctime.c \
244 $(TOP)/src/date.c \
245 $(TOP)/src/dbpage.c \
246 $(TOP)/src/dbstat.c \
247 $(TOP)/src/delete.c \
248 $(TOP)/src/expr.c \
249 $(TOP)/src/fault.c \
250 $(TOP)/src/fkey.c \
251 $(TOP)/src/func.c \
252 $(TOP)/src/global.c \
253 $(TOP)/src/hash.c \
254 $(TOP)/src/hash.h \
255 $(TOP)/src/hwtime.h \
256 $(TOP)/src/insert.c \
257 $(TOP)/src/json.c \
258 $(TOP)/src/legacy.c \
259 $(TOP)/src/loadext.c \
260 $(TOP)/src/main.c \
261 $(TOP)/src/malloc.c \
262 $(TOP)/src/mem0.c \
263 $(TOP)/src/mem1.c \
264 $(TOP)/src/mem2.c \
265 $(TOP)/src/mem3.c \
266 $(TOP)/src/mem5.c \
267 $(TOP)/src/memdb.c \
268 $(TOP)/src/memjournal.c \
269 $(TOP)/src/msvc.h \
270 $(TOP)/src/mutex.c \
271 $(TOP)/src/mutex.h \
272 $(TOP)/src/mutex_noop.c \
273 $(TOP)/src/mutex_unix.c \
274 $(TOP)/src/mutex_w32.c \
275 $(TOP)/src/notify.c \
276 $(TOP)/src/os.c \
277 $(TOP)/src/os.h \
278 $(TOP)/src/os_common.h \
279 $(TOP)/src/os_setup.h \
280 $(TOP)/src/os_kv.c \
281 $(TOP)/src/os_unix.c \
282 $(TOP)/src/os_win.c \
283 $(TOP)/src/os_win.h \
284 $(TOP)/src/pager.c \
285 $(TOP)/src/pager.h \
286 $(TOP)/src/parse.y \
287 $(TOP)/src/pcache.c \
288 $(TOP)/src/pcache.h \
289 $(TOP)/src/pcache1.c \
290 $(TOP)/src/pragma.c \
291 $(TOP)/src/pragma.h \
292 $(TOP)/src/prepare.c \
293 $(TOP)/src/printf.c \
294 $(TOP)/src/random.c \
295 $(TOP)/src/resolve.c \
296 $(TOP)/src/rowset.c \
297 $(TOP)/src/select.c \
298 $(TOP)/src/status.c \
299 $(TOP)/src/shell.c.in \
300 $(TOP)/src/sqlite.h.in \
301 $(TOP)/src/sqlite3ext.h \
302 $(TOP)/src/sqliteInt.h \
303 $(TOP)/src/sqliteLimit.h \
304 $(TOP)/src/table.c \
305 $(TOP)/src/tclsqlite.c \
306 $(TOP)/src/threads.c \
307 $(TOP)/src/tokenize.c \
308 $(TOP)/src/treeview.c \
309 $(TOP)/src/trigger.c \
310 $(TOP)/src/utf.c \
311 $(TOP)/src/update.c \
312 $(TOP)/src/upsert.c \
313 $(TOP)/src/util.c \
314 $(TOP)/src/vacuum.c \
315 $(TOP)/src/vdbe.c \
316 $(TOP)/src/vdbe.h \
317 $(TOP)/src/vdbeapi.c \
318 $(TOP)/src/vdbeaux.c \
319 $(TOP)/src/vdbeblob.c \
320 $(TOP)/src/vdbemem.c \
321 $(TOP)/src/vdbesort.c \
322 $(TOP)/src/vdbetrace.c \
323 $(TOP)/src/vdbevtab.c \
324 $(TOP)/src/vdbeInt.h \
325 $(TOP)/src/vtab.c \
326 $(TOP)/src/vxworks.h \
327 $(TOP)/src/wal.c \
328 $(TOP)/src/wal.h \
329 $(TOP)/src/walker.c \
330 $(TOP)/src/where.c \
331 $(TOP)/src/wherecode.c \
332 $(TOP)/src/whereexpr.c \
333 $(TOP)/src/whereInt.h \
334 $(TOP)/src/window.c
336 # Source code for extensions
338 SRC += \
339 $(TOP)/ext/fts3/fts3.c \
340 $(TOP)/ext/fts3/fts3.h \
341 $(TOP)/ext/fts3/fts3Int.h \
342 $(TOP)/ext/fts3/fts3_aux.c \
343 $(TOP)/ext/fts3/fts3_expr.c \
344 $(TOP)/ext/fts3/fts3_hash.c \
345 $(TOP)/ext/fts3/fts3_hash.h \
346 $(TOP)/ext/fts3/fts3_icu.c \
347 $(TOP)/ext/fts3/fts3_porter.c \
348 $(TOP)/ext/fts3/fts3_snippet.c \
349 $(TOP)/ext/fts3/fts3_tokenizer.h \
350 $(TOP)/ext/fts3/fts3_tokenizer.c \
351 $(TOP)/ext/fts3/fts3_tokenizer1.c \
352 $(TOP)/ext/fts3/fts3_tokenize_vtab.c \
353 $(TOP)/ext/fts3/fts3_unicode.c \
354 $(TOP)/ext/fts3/fts3_unicode2.c \
355 $(TOP)/ext/fts3/fts3_write.c
356 SRC += \
357 $(TOP)/ext/icu/sqliteicu.h \
358 $(TOP)/ext/icu/icu.c
359 SRC += \
360 $(TOP)/ext/rtree/rtree.h \
361 $(TOP)/ext/rtree/rtree.c \
362 $(TOP)/ext/rtree/geopoly.c
363 SRC += \
364 $(TOP)/ext/session/sqlite3session.c \
365 $(TOP)/ext/session/sqlite3session.h
366 SRC += \
367 $(TOP)/ext/userauth/userauth.c \
368 $(TOP)/ext/userauth/sqlite3userauth.h
369 SRC += \
370 $(TOP)/ext/rbu/sqlite3rbu.h \
371 $(TOP)/ext/rbu/sqlite3rbu.c
372 SRC += \
373 $(TOP)/ext/misc/stmt.c
375 # Generated source code files
377 SRC += \
378 keywordhash.h \
379 opcodes.c \
380 opcodes.h \
381 parse.c \
382 parse.h \
383 sqlite_cfg.h \
384 shell.c \
385 sqlite3.h
387 # Source code to the test files.
389 TESTSRC = \
390 $(TOP)/src/test1.c \
391 $(TOP)/src/test2.c \
392 $(TOP)/src/test3.c \
393 $(TOP)/src/test4.c \
394 $(TOP)/src/test5.c \
395 $(TOP)/src/test6.c \
396 $(TOP)/src/test8.c \
397 $(TOP)/src/test9.c \
398 $(TOP)/src/test_autoext.c \
399 $(TOP)/src/test_async.c \
400 $(TOP)/src/test_backup.c \
401 $(TOP)/src/test_bestindex.c \
402 $(TOP)/src/test_blob.c \
403 $(TOP)/src/test_btree.c \
404 $(TOP)/src/test_config.c \
405 $(TOP)/src/test_delete.c \
406 $(TOP)/src/test_demovfs.c \
407 $(TOP)/src/test_devsym.c \
408 $(TOP)/src/test_fs.c \
409 $(TOP)/src/test_func.c \
410 $(TOP)/src/test_hexio.c \
411 $(TOP)/src/test_init.c \
412 $(TOP)/src/test_intarray.c \
413 $(TOP)/src/test_journal.c \
414 $(TOP)/src/test_malloc.c \
415 $(TOP)/src/test_md5.c \
416 $(TOP)/src/test_multiplex.c \
417 $(TOP)/src/test_mutex.c \
418 $(TOP)/src/test_onefile.c \
419 $(TOP)/src/test_osinst.c \
420 $(TOP)/src/test_pcache.c \
421 $(TOP)/src/test_quota.c \
422 $(TOP)/src/test_rtree.c \
423 $(TOP)/src/test_schema.c \
424 $(TOP)/src/test_superlock.c \
425 $(TOP)/src/test_syscall.c \
426 $(TOP)/src/test_tclsh.c \
427 $(TOP)/src/test_tclvar.c \
428 $(TOP)/src/test_thread.c \
429 $(TOP)/src/test_vdbecov.c \
430 $(TOP)/src/test_vfs.c \
431 $(TOP)/src/test_windirent.c \
432 $(TOP)/src/test_window.c \
433 $(TOP)/src/test_wsd.c \
434 $(TOP)/ext/fts3/fts3_term.c \
435 $(TOP)/ext/fts3/fts3_test.c \
436 $(TOP)/ext/session/test_session.c \
437 $(TOP)/ext/recover/sqlite3recover.c \
438 $(TOP)/ext/recover/dbdata.c \
439 $(TOP)/ext/recover/test_recover.c \
440 $(TOP)/ext/intck/test_intck.c \
441 $(TOP)/ext/intck/sqlite3intck.c \
442 $(TOP)/ext/rbu/test_rbu.c
444 # Statically linked extensions
446 TESTSRC += \
447 $(TOP)/ext/expert/sqlite3expert.c \
448 $(TOP)/ext/expert/test_expert.c \
449 $(TOP)/ext/misc/amatch.c \
450 $(TOP)/ext/misc/appendvfs.c \
451 $(TOP)/ext/misc/basexx.c \
452 $(TOP)/ext/misc/carray.c \
453 $(TOP)/ext/misc/cksumvfs.c \
454 $(TOP)/ext/misc/closure.c \
455 $(TOP)/ext/misc/csv.c \
456 $(TOP)/ext/misc/decimal.c \
457 $(TOP)/ext/misc/eval.c \
458 $(TOP)/ext/misc/explain.c \
459 $(TOP)/ext/misc/fileio.c \
460 $(TOP)/ext/misc/fuzzer.c \
461 $(TOP)/ext/fts5/fts5_tcl.c \
462 $(TOP)/ext/fts5/fts5_test_mi.c \
463 $(TOP)/ext/fts5/fts5_test_tok.c \
464 $(TOP)/ext/misc/ieee754.c \
465 $(TOP)/ext/misc/mmapwarm.c \
466 $(TOP)/ext/misc/nextchar.c \
467 $(TOP)/ext/misc/normalize.c \
468 $(TOP)/ext/misc/percentile.c \
469 $(TOP)/ext/misc/prefixes.c \
470 $(TOP)/ext/misc/qpvtab.c \
471 $(TOP)/ext/misc/randomjson.c \
472 $(TOP)/ext/misc/regexp.c \
473 $(TOP)/ext/misc/remember.c \
474 $(TOP)/ext/misc/series.c \
475 $(TOP)/ext/misc/spellfix.c \
476 $(TOP)/ext/misc/totype.c \
477 $(TOP)/ext/misc/unionvtab.c \
478 $(TOP)/ext/misc/wholenumber.c \
479 $(TOP)/ext/misc/zipfile.c \
480 $(TOP)/ext/userauth/userauth.c \
481 $(TOP)/ext/rtree/test_rtreedoc.c
483 # Source code to the library files needed by the test fixture
485 TESTSRC2 = \
486 $(TOP)/src/attach.c \
487 $(TOP)/src/backup.c \
488 $(TOP)/src/bitvec.c \
489 $(TOP)/src/btree.c \
490 $(TOP)/src/build.c \
491 $(TOP)/src/ctime.c \
492 $(TOP)/src/date.c \
493 $(TOP)/src/dbpage.c \
494 $(TOP)/src/dbstat.c \
495 $(TOP)/src/expr.c \
496 $(TOP)/src/func.c \
497 $(TOP)/src/global.c \
498 $(TOP)/src/insert.c \
499 $(TOP)/src/wal.c \
500 $(TOP)/src/main.c \
501 $(TOP)/src/mem5.c \
502 $(TOP)/src/os.c \
503 $(TOP)/src/os_kv.c \
504 $(TOP)/src/os_unix.c \
505 $(TOP)/src/os_win.c \
506 $(TOP)/src/pager.c \
507 $(TOP)/src/pragma.c \
508 $(TOP)/src/prepare.c \
509 $(TOP)/src/printf.c \
510 $(TOP)/src/random.c \
511 $(TOP)/src/pcache.c \
512 $(TOP)/src/pcache1.c \
513 $(TOP)/src/select.c \
514 $(TOP)/src/tokenize.c \
515 $(TOP)/src/treeview.c \
516 $(TOP)/src/utf.c \
517 $(TOP)/src/util.c \
518 $(TOP)/src/vdbeapi.c \
519 $(TOP)/src/vdbeaux.c \
520 $(TOP)/src/vdbe.c \
521 $(TOP)/src/vdbemem.c \
522 $(TOP)/src/vdbetrace.c \
523 $(TOP)/src/vdbevtab.c \
524 $(TOP)/src/where.c \
525 $(TOP)/src/wherecode.c \
526 $(TOP)/src/whereexpr.c \
527 $(TOP)/src/window.c \
528 parse.c \
529 $(TOP)/ext/fts3/fts3.c \
530 $(TOP)/ext/fts3/fts3_aux.c \
531 $(TOP)/ext/fts3/fts3_expr.c \
532 $(TOP)/ext/fts3/fts3_term.c \
533 $(TOP)/ext/fts3/fts3_tokenizer.c \
534 $(TOP)/ext/fts3/fts3_write.c \
535 $(TOP)/ext/async/sqlite3async.c \
536 $(TOP)/ext/session/sqlite3session.c \
537 $(TOP)/ext/misc/stmt.c \
538 fts5.c
540 # Header files used by all library source files.
542 HDR = \
543 $(TOP)/src/btree.h \
544 $(TOP)/src/btreeInt.h \
545 $(TOP)/src/hash.h \
546 $(TOP)/src/hwtime.h \
547 keywordhash.h \
548 $(TOP)/src/msvc.h \
549 $(TOP)/src/mutex.h \
550 opcodes.h \
551 $(TOP)/src/os.h \
552 $(TOP)/src/os_common.h \
553 $(TOP)/src/os_setup.h \
554 $(TOP)/src/os_win.h \
555 $(TOP)/src/pager.h \
556 $(TOP)/src/pcache.h \
557 parse.h \
558 $(TOP)/src/pragma.h \
559 sqlite3.h \
560 $(TOP)/src/sqlite3ext.h \
561 $(TOP)/src/sqliteInt.h \
562 $(TOP)/src/sqliteLimit.h \
563 $(TOP)/src/vdbe.h \
564 $(TOP)/src/vdbeInt.h \
565 $(TOP)/src/vxworks.h \
566 $(TOP)/src/whereInt.h \
567 sqlite_cfg.h
569 # Header files used by extensions
571 EXTHDR += \
572 $(TOP)/ext/fts3/fts3.h \
573 $(TOP)/ext/fts3/fts3Int.h \
574 $(TOP)/ext/fts3/fts3_hash.h \
575 $(TOP)/ext/fts3/fts3_tokenizer.h
576 EXTHDR += \
577 $(TOP)/ext/rtree/rtree.h \
578 $(TOP)/ext/rtree/geopoly.c
579 EXTHDR += \
580 $(TOP)/ext/icu/sqliteicu.h
581 EXTHDR += \
582 $(TOP)/ext/rtree/sqlite3rtree.h
583 EXTHDR += \
584 $(TOP)/ext/userauth/sqlite3userauth.h
586 # executables needed for testing
588 TESTPROGS = \
589 testfixture$(TEXE) \
590 sqlite3$(TEXE) \
591 sqlite3_analyzer$(TEXE) \
592 sqldiff$(TEXE) \
593 dbhash$(TEXE) \
594 sqltclsh$(TEXE)
596 # Databases containing fuzzer test cases
598 FUZZDATA = \
599 $(TOP)/test/fuzzdata1.db \
600 $(TOP)/test/fuzzdata2.db \
601 $(TOP)/test/fuzzdata3.db \
602 $(TOP)/test/fuzzdata4.db \
603 $(TOP)/test/fuzzdata5.db \
604 $(TOP)/test/fuzzdata6.db \
605 $(TOP)/test/fuzzdata7.db \
606 $(TOP)/test/fuzzdata8.db
608 # Standard options to testfixture
610 TESTOPTS = --verbose=file --output=test-out.txt
612 # Extra compiler options for various shell tools
614 SHELL_OPT += -DSQLITE_DQS=0
615 SHELL_OPT += -DSQLITE_ENABLE_FTS4
616 #SHELL_OPT += -DSQLITE_ENABLE_FTS5
617 SHELL_OPT += -DSQLITE_ENABLE_RTREE
618 SHELL_OPT += -DSQLITE_ENABLE_EXPLAIN_COMMENTS
619 SHELL_OPT += -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
620 SHELL_OPT += -DSQLITE_ENABLE_STMTVTAB
621 SHELL_OPT += -DSQLITE_ENABLE_DBPAGE_VTAB
622 SHELL_OPT += -DSQLITE_ENABLE_DBSTAT_VTAB
623 SHELL_OPT += -DSQLITE_ENABLE_BYTECODE_VTAB
624 SHELL_OPT += -DSQLITE_ENABLE_OFFSET_SQL_FUNC
625 SHELL_OPT += -DSQLITE_STRICT_SUBTYPE=1
626 FUZZERSHELL_OPT =
627 FUZZCHECK_OPT += -I$(TOP)/test
628 FUZZCHECK_OPT += -I$(TOP)/ext/recover
629 FUZZCHECK_OPT += \
630 -DSQLITE_OSS_FUZZ \
631 -DSQLITE_ENABLE_BYTECODE_VTAB \
632 -DSQLITE_ENABLE_DBPAGE_VTAB \
633 -DSQLITE_ENABLE_DBSTAT_VTAB \
634 -DSQLITE_ENABLE_BYTECODE_VTAB \
635 -DSQLITE_ENABLE_DESERIALIZE \
636 -DSQLITE_ENABLE_EXPLAIN_COMMENTS \
637 -DSQLITE_ENABLE_FTS3_PARENTHESIS \
638 -DSQLITE_ENABLE_FTS4 \
639 -DSQLITE_ENABLE_FTS5 \
640 -DSQLITE_ENABLE_GEOPOLY \
641 -DSQLITE_ENABLE_MATH_FUNCTIONS \
642 -DSQLITE_ENABLE_MEMSYS5 \
643 -DSQLITE_ENABLE_NORMALIZE \
644 -DSQLITE_ENABLE_OFFSET_SQL_FUNC \
645 -DSQLITE_ENABLE_PREUPDATE_HOOK \
646 -DSQLITE_ENABLE_RTREE \
647 -DSQLITE_ENABLE_SESSION \
648 -DSQLITE_ENABLE_STMTVTAB \
649 -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION \
650 -DSQLITE_ENABLE_STAT4 \
651 -DSQLITE_ENABLE_STMT_SCANSTATUS \
652 -DSQLITE_MAX_MEMORY=50000000 \
653 -DSQLITE_MAX_MMAP_SIZE=0 \
654 -DSQLITE_OMIT_LOAD_EXTENSION \
655 -DSQLITE_PRINTF_PRECISION_LIMIT=1000 \
656 -DSQLITE_PRIVATE="" \
657 -DSQLITE_STRICT_SUBTYPE=1 \
658 -DSQLITE_STATIC_RANDOMJSON
660 FUZZCHECK_SRC += $(TOP)/test/fuzzcheck.c
661 FUZZCHECK_SRC += $(TOP)/test/ossfuzz.c
662 FUZZCHECK_SRC += $(TOP)/test/fuzzinvariants.c
663 FUZZCHECK_SRC += $(TOP)/ext/recover/dbdata.c
664 FUZZCHECK_SRC += $(TOP)/ext/recover/sqlite3recover.c
665 FUZZCHECK_SRC += $(TOP)/test/vt02.c
666 FUZZCHECK_SRC += $(TOP)/ext/misc/randomjson.c
667 DBFUZZ_OPT =
668 ST_OPT = -DSQLITE_OS_KV_OPTIONAL
671 # In wasi-sdk builds, disable the CLI shell build in the "all" target.
672 SQLITE3_SHELL_TARGET_ = sqlcipher$(TEXE)
673 SQLITE3_SHELL_TARGET_1 =
674 SQLITE3_SHELL_TARGET = $(SQLITE3_SHELL_TARGET_@HAVE_WASI_SDK@)
676 # This is the default Makefile target. The objects listed here
677 # are what get build when you type just "make" with no arguments.
679 all: sqlite3.h libsqlcipher.la $(SQLITE3_SHELL_TARGET) \
680 $(HAVE_TCL:1=libtclsqlite3.la)
682 Makefile: $(TOP)/Makefile.in
683 ./config.status
685 sqlcipher.pc: $(TOP)/sqlcipher.pc.in
686 ./config.status
688 libsqlcipher.la: $(LIBOBJ)
689 $(LTLINK) -no-undefined -o $@ $(LIBOBJ) $(TLIBS) \
690 ${ALLOWRELEASE} -rpath "$(libdir)" -version-info "8:6:8"
692 libtclsqlite3.la: tclsqlite.lo libsqlcipher.la
693 $(LTLINK) -no-undefined -o $@ tclsqlite.lo \
694 libsqlcipher.la @TCL_STUB_LIB_SPEC@ $(TLIBS) \
695 -rpath "$(TCLLIBDIR)" \
696 -version-info "8:6:8" \
697 -avoid-version
699 sqlcipher$(TEXE): shell.c sqlite3.c
700 $(LTLINK) $(READLINE_FLAGS) $(SHELL_OPT) -o $@ \
701 shell.c sqlite3.c \
702 $(LIBREADLINE) $(TLIBS) -rpath "$(libdir)"
704 sqldiff$(TEXE): $(TOP)/tool/sqldiff.c sqlite3.lo sqlite3.h
705 $(LTLINK) -o $@ $(TOP)/tool/sqldiff.c sqlite3.lo $(TLIBS)
707 dbhash$(TEXE): $(TOP)/tool/dbhash.c sqlite3.lo sqlite3.h
708 $(LTLINK) -o $@ $(TOP)/tool/dbhash.c sqlite3.lo $(TLIBS)
710 scrub$(TEXE): $(TOP)/ext/misc/scrub.c sqlite3.lo
711 $(LTLINK) -o $@ -I. -DSCRUB_STANDALONE \
712 $(TOP)/ext/misc/scrub.c sqlite3.lo $(TLIBS)
714 srcck1$(BEXE): $(TOP)/tool/srcck1.c
715 $(BCC) -o srcck1$(BEXE) $(TOP)/tool/srcck1.c
717 sourcetest: srcck1$(BEXE) sqlite3.c
718 ./srcck1 sqlite3.c
720 src-verify: $(TOP)/tool/src-verify.c
721 $(BCC) -o src-verify$(BEXE) $(TOP)/tool/src-verify.c
723 verify-source: ./src-verify
724 ./src-verify $(TOP)
726 fuzzershell$(TEXE): $(TOP)/tool/fuzzershell.c sqlite3.c sqlite3.h
727 $(LTLINK) -o $@ $(FUZZERSHELL_OPT) \
728 $(TOP)/tool/fuzzershell.c sqlite3.c $(TLIBS)
730 fuzzcheck$(TEXE): $(FUZZCHECK_SRC) sqlite3.c sqlite3.h $(FUZZCHECK_DEP)
731 $(LTLINK) -o $@ $(FUZZCHECK_OPT) $(FUZZCHECK_SRC) sqlite3.c $(TLIBS)
733 fuzzcheck-asan$(TEXE): $(FUZZCHECK_SRC) sqlite3.c sqlite3.h $(FUZZCHECK_DEP)
734 $(LTLINK) -o $@ -fsanitize=address $(FUZZCHECK_OPT) $(FUZZCHECK_SRC) sqlite3.c $(TLIBS)
736 fuzzcheck-ubsan$(TEXE): $(FUZZCHECK_SRC) sqlite3.c sqlite3.h $(FUZZCHECK_DEP)
737 $(LTLINK) -o $@ -fsanitize=undefined $(FUZZCHECK_OPT) $(FUZZCHECK_SRC) sqlite3.c $(TLIBS)
739 # Usage: FUZZDB=filename make run-fuzzcheck
741 # Where filename is a fuzzcheck database, this target builds and runs
742 # fuzzcheck, fuzzcheck-asan, and fuzzcheck-ubsan on that database.
744 # FUZZDB can be a glob pattern of two or more databases. Example:
746 # FUZZDB=test/fuzzdata*.db make run-fuzzcheck
748 run-fuzzcheck: fuzzcheck$(TEXE) fuzzcheck-asan$(TEXE) fuzzcheck-ubsan$(TEXE)
749 @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi
750 ./fuzzcheck$(TEXE) --spinner $(FUZZDB)
751 ./fuzzcheck-asan$(TEXE) --spinner $(FUZZDB)
752 ./fuzzcheck-ubsan$(TEXE) --spinner $(FUZZDB)
754 ossshell$(TEXE): $(TOP)/test/ossfuzz.c $(TOP)/test/ossshell.c sqlite3.c sqlite3.h
755 $(LTLINK) -o $@ $(FUZZCHECK_OPT) $(TOP)/test/ossshell.c \
756 $(TOP)/test/ossfuzz.c sqlite3.c $(TLIBS)
758 sessionfuzz$(TEXE): $(TOP)/test/sessionfuzz.c sqlite3.c sqlite3.h
759 $(LTLINK) -o $@ $(TOP)/test/sessionfuzz.c $(TLIBS)
761 dbfuzz$(TEXE): $(TOP)/test/dbfuzz.c sqlite3.c sqlite3.h
762 $(LTLINK) -o $@ $(DBFUZZ_OPT) $(TOP)/test/dbfuzz.c sqlite3.c $(TLIBS)
764 DBFUZZ2_OPTS = \
765 -DSQLITE_THREADSAFE=0 \
766 -DSQLITE_OMIT_LOAD_EXTENSION \
767 -DSQLITE_DEBUG \
768 -DSQLITE_ENABLE_DBSTAT_VTAB \
769 -DSQLITE_ENABLE_BYTECODE_VTAB \
770 -DSQLITE_ENABLE_RTREE \
771 -DSQLITE_ENABLE_FTS4 \
772 -DSQLITE_ENABLE_FTS5
774 dbfuzz2$(TEXE): $(TOP)/test/dbfuzz2.c sqlite3.c sqlite3.h
775 $(CC) $(OPT_FEATURE_FLAGS) $(OPTS) -I. -g -O0 \
776 -DSTANDALONE -o dbfuzz2 \
777 $(DBFUZZ2_OPTS) $(TOP)/test/dbfuzz2.c sqlite3.c $(TLIBS)
778 mkdir -p dbfuzz2-dir
779 cp $(TOP)/test/dbfuzz2-seed* dbfuzz2-dir
781 dbfuzz2-asan: $(TOP)/test/dbfuzz2.c sqlite3.c sqlite3.h
782 clang-6.0 $(OPT_FEATURE_FLAGS) $(OPTS) -I. -g -O0 \
783 -fsanitize=fuzzer,undefined,address -o dbfuzz2-asan \
784 $(DBFUZZ2_OPTS) $(TOP)/test/dbfuzz2.c sqlite3.c $(TLIBS)
785 mkdir -p dbfuzz2-dir
786 cp $(TOP)/test/dbfuzz2-seed* dbfuzz2-dir
788 dbfuzz2-msan: $(TOP)/test/dbfuzz2.c sqlite3.c sqlite3.h
789 clang-6.0 $(OPT_FEATURE_FLAGS) $(OPTS) -I. -g -O0 \
790 -fsanitize=fuzzer,undefined,memory -o dbfuzz2-msan \
791 $(DBFUZZ2_OPTS) $(TOP)/test/dbfuzz2.c sqlite3.c $(TLIBS)
792 mkdir -p dbfuzz2-dir
793 cp $(TOP)/test/dbfuzz2-seed* dbfuzz2-dir
795 mptester$(TEXE): sqlite3.lo $(TOP)/mptest/mptest.c
796 $(LTLINK) -o $@ -I. $(TOP)/mptest/mptest.c sqlite3.lo \
797 $(TLIBS) -rpath "$(libdir)"
799 MPTEST1=./mptester$(TEXE) mptest.db $(TOP)/mptest/crash01.test --repeat 20
800 MPTEST2=./mptester$(TEXE) mptest.db $(TOP)/mptest/multiwrite01.test --repeat 20
801 mptest: mptester$(TEXE)
802 rm -f mptest.db
803 $(MPTEST1) --journalmode DELETE
804 $(MPTEST2) --journalmode WAL
805 $(MPTEST1) --journalmode WAL
806 $(MPTEST2) --journalmode PERSIST
807 $(MPTEST1) --journalmode PERSIST
808 $(MPTEST2) --journalmode TRUNCATE
809 $(MPTEST1) --journalmode TRUNCATE
810 $(MPTEST2) --journalmode DELETE
813 has_tclsh84:
814 sh $(TOP)/tool/cktclsh.sh 8.4 $(TCLSH_CMD)
815 touch has_tclsh84
817 has_tclsh85:
818 sh $(TOP)/tool/cktclsh.sh 8.5 $(TCLSH_CMD)
819 touch has_tclsh85
822 # This target creates a directory named "tsrc" and fills it with
823 # copies of all of the C source code and header files needed to
824 # build on the target system. Some of the C source code and header
825 # files are automatically generated. This target takes care of
826 # all that automatic generation.
828 .target_source: $(SRC) $(TOP)/tool/vdbe-compress.tcl has_tclsh84 fts5.c
829 rm -rf tsrc
830 mkdir tsrc
831 cp -f $(SRC) tsrc
832 rm tsrc/sqlite.h.in tsrc/parse.y
833 $(TCLSH_CMD) $(TOP)/tool/vdbe-compress.tcl $(OPTS) <tsrc/vdbe.c >vdbe.new
834 mv vdbe.new tsrc/vdbe.c
835 cp fts5.c fts5.h tsrc
836 touch .target_source
838 sqlite3.c: .target_source $(TOP)/tool/mksqlite3c.tcl src-verify has_tclsh84
839 $(TCLSH_CMD) $(TOP)/tool/mksqlite3c.tcl $(AMALGAMATION_LINE_MACROS) $(EXTRA_SRC)
840 cp tsrc/sqlite3ext.h .
841 cp $(TOP)/ext/session/sqlite3session.h .
843 sqlite3r.h: sqlite3.h has_tclsh84
844 $(TCLSH_CMD) $(TOP)/tool/mksqlite3h.tcl $(TOP) --enable-recover >sqlite3r.h
846 sqlite3r.c: sqlite3.c sqlite3r.h has_tclsh84
847 cp $(TOP)/ext/recover/sqlite3recover.c tsrc/
848 cp $(TOP)/ext/recover/sqlite3recover.h tsrc/
849 cp $(TOP)/ext/recover/dbdata.c tsrc/
850 $(TCLSH_CMD) $(TOP)/tool/mksqlite3c.tcl --enable-recover $(AMALGAMATION_LINE_MACROS) $(EXTRA_SRC)
852 sqlite3ext.h: .target_source
853 cp tsrc/sqlite3ext.h .
855 tclsqlite3.c: sqlite3.c
856 echo '#ifndef USE_SYSTEM_SQLITE' >tclsqlite3.c
857 cat sqlite3.c >>tclsqlite3.c
858 echo '#endif /* USE_SYSTEM_SQLITE */' >>tclsqlite3.c
859 cat $(TOP)/src/tclsqlite.c >>tclsqlite3.c
861 sqlite3-all.c: sqlite3.c $(TOP)/tool/split-sqlite3c.tcl has_tclsh84
862 $(TCLSH_CMD) $(TOP)/tool/split-sqlite3c.tcl
864 # Rule to build the amalgamation
866 sqlite3.lo: sqlite3.c
867 $(LTCOMPILE) $(TEMP_STORE) -c sqlite3.c
869 # Rules to build the LEMON compiler generator
871 lemon$(BEXE): $(TOP)/tool/lemon.c $(TOP)/tool/lempar.c
872 $(BCC) -o $@ $(TOP)/tool/lemon.c
873 cp $(TOP)/tool/lempar.c .
875 # Rules to build the program that generates the source-id
877 mksourceid$(BEXE): $(TOP)/tool/mksourceid.c
878 $(BCC) -o $@ $(TOP)/tool/mksourceid.c
880 # Rules to build individual *.o files from generated *.c files. This
881 # applies to:
883 # parse.o
884 # opcodes.o
886 parse.lo: parse.c $(HDR)
887 $(LTCOMPILE) $(TEMP_STORE) -c parse.c
889 opcodes.lo: opcodes.c
890 $(LTCOMPILE) $(TEMP_STORE) -c opcodes.c
892 # BEGIN CRYPTO
893 sqlcipher.lo: $(TOP)/src/sqlcipher.c $(HDR)
894 $(LTCOMPILE) -c $(TOP)/src/sqlcipher.c
895 crypto_openssl.lo: $(TOP)/src/crypto_openssl.c $(HDR)
896 $(LTCOMPILE) -c $(TOP)/src/crypto_openssl.c
897 crypto_nss.lo: $(TOP)/src/crypto_nss.c $(HDR)
898 $(LTCOMPILE) -c $(TOP)/src/crypto_nss.c
899 crypto_libtomcrypt.lo: $(TOP)/src/crypto_libtomcrypt.c $(HDR)
900 $(LTCOMPILE) -c $(TOP)/src/crypto_libtomcrypt.c
901 crypto_cc.lo: $(TOP)/src/crypto_cc.c $(HDR)
902 $(LTCOMPILE) -c $(TOP)/src/crypto_cc.c
903 # END CRYPTO
905 # Rules to build individual *.o files from files in the src directory.
907 alter.lo: $(TOP)/src/alter.c $(HDR)
908 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/alter.c
910 analyze.lo: $(TOP)/src/analyze.c $(HDR)
911 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/analyze.c
913 attach.lo: $(TOP)/src/attach.c $(HDR)
914 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/attach.c
916 auth.lo: $(TOP)/src/auth.c $(HDR)
917 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/auth.c
919 backup.lo: $(TOP)/src/backup.c $(HDR)
920 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/backup.c
922 bitvec.lo: $(TOP)/src/bitvec.c $(HDR)
923 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/bitvec.c
925 btmutex.lo: $(TOP)/src/btmutex.c $(HDR)
926 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/btmutex.c
928 btree.lo: $(TOP)/src/btree.c $(HDR) $(TOP)/src/pager.h
929 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/btree.c
931 build.lo: $(TOP)/src/build.c $(HDR)
932 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/build.c
934 callback.lo: $(TOP)/src/callback.c $(HDR)
935 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/callback.c
937 complete.lo: $(TOP)/src/complete.c $(HDR)
938 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/complete.c
940 ctime.lo: $(TOP)/src/ctime.c $(HDR)
941 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/ctime.c
943 date.lo: $(TOP)/src/date.c $(HDR)
944 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/date.c
946 dbpage.lo: $(TOP)/src/dbpage.c $(HDR)
947 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/dbpage.c
949 dbstat.lo: $(TOP)/src/dbstat.c $(HDR)
950 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/dbstat.c
952 delete.lo: $(TOP)/src/delete.c $(HDR)
953 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/delete.c
955 expr.lo: $(TOP)/src/expr.c $(HDR)
956 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/expr.c
958 fault.lo: $(TOP)/src/fault.c $(HDR)
959 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/fault.c
961 fkey.lo: $(TOP)/src/fkey.c $(HDR)
962 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/fkey.c
964 func.lo: $(TOP)/src/func.c $(HDR)
965 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/func.c
967 global.lo: $(TOP)/src/global.c $(HDR)
968 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/global.c
970 hash.lo: $(TOP)/src/hash.c $(HDR)
971 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/hash.c
973 insert.lo: $(TOP)/src/insert.c $(HDR)
974 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/insert.c
976 json.lo: $(TOP)/src/json.c $(HDR)
977 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/json.c
979 legacy.lo: $(TOP)/src/legacy.c $(HDR)
980 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/legacy.c
982 loadext.lo: $(TOP)/src/loadext.c $(HDR)
983 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/loadext.c
985 main.lo: $(TOP)/src/main.c $(HDR)
986 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/main.c
988 malloc.lo: $(TOP)/src/malloc.c $(HDR)
989 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/malloc.c
991 mem0.lo: $(TOP)/src/mem0.c $(HDR)
992 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem0.c
994 mem1.lo: $(TOP)/src/mem1.c $(HDR)
995 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem1.c
997 mem2.lo: $(TOP)/src/mem2.c $(HDR)
998 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem2.c
1000 mem3.lo: $(TOP)/src/mem3.c $(HDR)
1001 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem3.c
1003 mem5.lo: $(TOP)/src/mem5.c $(HDR)
1004 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem5.c
1006 memdb.lo: $(TOP)/src/memdb.c $(HDR)
1007 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/memdb.c
1009 memjournal.lo: $(TOP)/src/memjournal.c $(HDR)
1010 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/memjournal.c
1012 mutex.lo: $(TOP)/src/mutex.c $(HDR)
1013 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex.c
1015 mutex_noop.lo: $(TOP)/src/mutex_noop.c $(HDR)
1016 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex_noop.c
1018 mutex_unix.lo: $(TOP)/src/mutex_unix.c $(HDR)
1019 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex_unix.c
1021 mutex_w32.lo: $(TOP)/src/mutex_w32.c $(HDR)
1022 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex_w32.c
1024 notify.lo: $(TOP)/src/notify.c $(HDR)
1025 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/notify.c
1027 pager.lo: $(TOP)/src/pager.c $(HDR) $(TOP)/src/pager.h
1028 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pager.c
1030 pcache.lo: $(TOP)/src/pcache.c $(HDR) $(TOP)/src/pcache.h
1031 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pcache.c
1033 pcache1.lo: $(TOP)/src/pcache1.c $(HDR) $(TOP)/src/pcache.h
1034 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pcache1.c
1036 os.lo: $(TOP)/src/os.c $(HDR)
1037 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os.c
1039 os_kv.lo: $(TOP)/src/os_kv.c $(HDR)
1040 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os_kv.c
1042 os_unix.lo: $(TOP)/src/os_unix.c $(HDR)
1043 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os_unix.c
1045 os_win.lo: $(TOP)/src/os_win.c $(HDR)
1046 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os_win.c
1048 pragma.lo: $(TOP)/src/pragma.c $(HDR)
1049 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pragma.c
1051 prepare.lo: $(TOP)/src/prepare.c $(HDR)
1052 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/prepare.c
1054 printf.lo: $(TOP)/src/printf.c $(HDR)
1055 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/printf.c
1057 random.lo: $(TOP)/src/random.c $(HDR)
1058 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/random.c
1060 resolve.lo: $(TOP)/src/resolve.c $(HDR)
1061 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/resolve.c
1063 rowset.lo: $(TOP)/src/rowset.c $(HDR)
1064 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/rowset.c
1066 select.lo: $(TOP)/src/select.c $(HDR)
1067 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/select.c
1069 status.lo: $(TOP)/src/status.c $(HDR)
1070 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/status.c
1072 table.lo: $(TOP)/src/table.c $(HDR)
1073 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/table.c
1075 threads.lo: $(TOP)/src/threads.c $(HDR)
1076 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/threads.c
1078 tokenize.lo: $(TOP)/src/tokenize.c keywordhash.h $(HDR)
1079 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/tokenize.c
1081 treeview.lo: $(TOP)/src/treeview.c $(HDR)
1082 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/treeview.c
1084 trigger.lo: $(TOP)/src/trigger.c $(HDR)
1085 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/trigger.c
1087 update.lo: $(TOP)/src/update.c $(HDR)
1088 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/update.c
1090 upsert.lo: $(TOP)/src/upsert.c $(HDR)
1091 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/upsert.c
1093 utf.lo: $(TOP)/src/utf.c $(HDR)
1094 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/utf.c
1096 util.lo: $(TOP)/src/util.c $(HDR)
1097 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/util.c
1099 vacuum.lo: $(TOP)/src/vacuum.c $(HDR)
1100 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vacuum.c
1102 vdbe.lo: $(TOP)/src/vdbe.c $(HDR)
1103 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbe.c
1105 vdbeapi.lo: $(TOP)/src/vdbeapi.c $(HDR)
1106 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbeapi.c
1108 vdbeaux.lo: $(TOP)/src/vdbeaux.c $(HDR)
1109 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbeaux.c
1111 vdbeblob.lo: $(TOP)/src/vdbeblob.c $(HDR)
1112 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbeblob.c
1114 vdbemem.lo: $(TOP)/src/vdbemem.c $(HDR)
1115 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbemem.c
1117 vdbesort.lo: $(TOP)/src/vdbesort.c $(HDR)
1118 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbesort.c
1120 vdbetrace.lo: $(TOP)/src/vdbetrace.c $(HDR)
1121 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbetrace.c
1123 vdbevtab.lo: $(TOP)/src/vdbevtab.c $(HDR)
1124 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbevtab.c
1126 vtab.lo: $(TOP)/src/vtab.c $(HDR)
1127 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vtab.c
1129 wal.lo: $(TOP)/src/wal.c $(HDR)
1130 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/wal.c
1132 walker.lo: $(TOP)/src/walker.c $(HDR)
1133 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/walker.c
1135 where.lo: $(TOP)/src/where.c $(HDR)
1136 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/where.c
1138 wherecode.lo: $(TOP)/src/wherecode.c $(HDR)
1139 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/wherecode.c
1141 whereexpr.lo: $(TOP)/src/whereexpr.c $(HDR)
1142 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/whereexpr.c
1144 window.lo: $(TOP)/src/window.c $(HDR)
1145 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/window.c
1147 tclsqlite.lo: $(TOP)/src/tclsqlite.c $(HDR)
1148 $(LTCOMPILE) -DUSE_TCL_STUBS=1 -c $(TOP)/src/tclsqlite.c
1150 tclsqlite-shell.lo: $(TOP)/src/tclsqlite.c $(HDR)
1151 $(LTCOMPILE) -DTCLSH -o $@ -c $(TOP)/src/tclsqlite.c
1153 tclsqlite-stubs.lo: $(TOP)/src/tclsqlite.c $(HDR)
1154 $(LTCOMPILE) -DUSE_TCL_STUBS=1 -o $@ -c $(TOP)/src/tclsqlite.c
1156 tclsqlcipher$(TEXE): tclsqlite-shell.lo libsqlcipher.la
1157 $(LTLINK) -o $@ tclsqlite-shell.lo \
1158 libsqlcipher.la $(LIBTCL)
1160 # Rules to build opcodes.c and opcodes.h
1162 opcodes.c: opcodes.h $(TOP)/tool/mkopcodec.tcl has_tclsh84
1163 $(TCLSH_CMD) $(TOP)/tool/mkopcodec.tcl opcodes.h >opcodes.c
1165 opcodes.h: parse.h $(TOP)/src/vdbe.c $(TOP)/tool/mkopcodeh.tcl has_tclsh84
1166 cat parse.h $(TOP)/src/vdbe.c | $(TCLSH_CMD) $(TOP)/tool/mkopcodeh.tcl >opcodes.h
1168 # Rules to build parse.c and parse.h - the outputs of lemon.
1170 parse.h: parse.c
1172 parse.c: $(TOP)/src/parse.y lemon$(BEXE)
1173 cp $(TOP)/src/parse.y .
1174 ./lemon$(BEXE) $(OPT_FEATURE_FLAGS) $(OPTS) -S parse.y
1176 sqlite3.h: $(TOP)/src/sqlite.h.in $(TOP)/manifest mksourceid$(BEXE) $(TOP)/VERSION has_tclsh84
1177 $(TCLSH_CMD) $(TOP)/tool/mksqlite3h.tcl $(TOP) >sqlite3.h
1179 sqlite3rc.h: $(TOP)/src/sqlite3.rc $(TOP)/VERSION has_tclsh84
1180 echo '#ifndef SQLITE_RESOURCE_VERSION' >$@
1181 echo -n '#define SQLITE_RESOURCE_VERSION ' >>$@
1182 cat $(TOP)/VERSION | $(TCLSH_CMD) $(TOP)/tool/replace.tcl exact . , >>$@
1183 echo '#endif' >>sqlite3rc.h
1185 keywordhash.h: $(TOP)/tool/mkkeywordhash.c
1186 $(BCC) -o mkkeywordhash$(BEXE) $(OPT_FEATURE_FLAGS) $(OPTS) $(TOP)/tool/mkkeywordhash.c
1187 ./mkkeywordhash$(BEXE) >keywordhash.h
1189 # Source and header files that shell.c depends on
1190 SHELL_DEP = \
1191 $(TOP)/src/shell.c.in \
1192 $(TOP)/ext/consio/console_io.c \
1193 $(TOP)/ext/consio/console_io.h \
1194 $(TOP)/ext/expert/sqlite3expert.c \
1195 $(TOP)/ext/expert/sqlite3expert.h \
1196 $(TOP)/ext/intck/sqlite3intck.c \
1197 $(TOP)/ext/intck/sqlite3intck.h \
1198 $(TOP)/ext/misc/appendvfs.c \
1199 $(TOP)/ext/misc/base64.c \
1200 $(TOP)/ext/misc/base85.c \
1201 $(TOP)/ext/misc/completion.c \
1202 $(TOP)/ext/misc/decimal.c \
1203 $(TOP)/ext/misc/fileio.c \
1204 $(TOP)/ext/misc/ieee754.c \
1205 $(TOP)/ext/misc/memtrace.c \
1206 $(TOP)/ext/misc/pcachetrace.c \
1207 $(TOP)/ext/misc/regexp.c \
1208 $(TOP)/ext/misc/series.c \
1209 $(TOP)/ext/misc/shathree.c \
1210 $(TOP)/ext/misc/sqlar.c \
1211 $(TOP)/ext/misc/uint.c \
1212 $(TOP)/ext/misc/zipfile.c \
1213 $(TOP)/ext/recover/dbdata.c \
1214 $(TOP)/ext/recover/sqlite3recover.c \
1215 $(TOP)/ext/recover/sqlite3recover.h \
1216 $(TOP)/src/test_windirent.c \
1217 $(TOP)/src/test_windirent.h
1219 shell.c: $(SHELL_DEP) $(TOP)/tool/mkshellc.tcl has_tclsh84
1220 $(TCLSH_CMD) $(TOP)/tool/mkshellc.tcl >shell.c
1225 # Rules to build the extension objects.
1227 icu.lo: $(TOP)/ext/icu/icu.c $(HDR) $(EXTHDR)
1228 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/icu/icu.c
1230 fts3.lo: $(TOP)/ext/fts3/fts3.c $(HDR) $(EXTHDR)
1231 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3.c
1233 fts3_aux.lo: $(TOP)/ext/fts3/fts3_aux.c $(HDR) $(EXTHDR)
1234 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_aux.c
1236 fts3_expr.lo: $(TOP)/ext/fts3/fts3_expr.c $(HDR) $(EXTHDR)
1237 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_expr.c
1239 fts3_hash.lo: $(TOP)/ext/fts3/fts3_hash.c $(HDR) $(EXTHDR)
1240 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_hash.c
1242 fts3_icu.lo: $(TOP)/ext/fts3/fts3_icu.c $(HDR) $(EXTHDR)
1243 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_icu.c
1245 fts3_porter.lo: $(TOP)/ext/fts3/fts3_porter.c $(HDR) $(EXTHDR)
1246 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_porter.c
1248 fts3_snippet.lo: $(TOP)/ext/fts3/fts3_snippet.c $(HDR) $(EXTHDR)
1249 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_snippet.c
1251 fts3_tokenizer.lo: $(TOP)/ext/fts3/fts3_tokenizer.c $(HDR) $(EXTHDR)
1252 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer.c
1254 fts3_tokenizer1.lo: $(TOP)/ext/fts3/fts3_tokenizer1.c $(HDR) $(EXTHDR)
1255 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer1.c
1257 fts3_tokenize_vtab.lo: $(TOP)/ext/fts3/fts3_tokenize_vtab.c $(HDR) $(EXTHDR)
1258 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenize_vtab.c
1260 fts3_unicode.lo: $(TOP)/ext/fts3/fts3_unicode.c $(HDR) $(EXTHDR)
1261 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_unicode.c
1263 fts3_unicode2.lo: $(TOP)/ext/fts3/fts3_unicode2.c $(HDR) $(EXTHDR)
1264 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_unicode2.c
1266 fts3_write.lo: $(TOP)/ext/fts3/fts3_write.c $(HDR) $(EXTHDR)
1267 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_write.c
1269 rtree.lo: $(TOP)/ext/rtree/rtree.c $(HDR) $(EXTHDR)
1270 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/rtree/rtree.c
1272 userauth.lo: $(TOP)/ext/userauth/userauth.c $(HDR) $(EXTHDR)
1273 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/userauth/userauth.c
1275 sqlite3session.lo: $(TOP)/ext/session/sqlite3session.c $(HDR) $(EXTHDR)
1276 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/session/sqlite3session.c
1278 stmt.lo: $(TOP)/ext/misc/stmt.c
1279 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/misc/stmt.c
1281 # FTS5 things
1283 FTS5_SRC = \
1284 $(TOP)/ext/fts5/fts5.h \
1285 $(TOP)/ext/fts5/fts5Int.h \
1286 $(TOP)/ext/fts5/fts5_aux.c \
1287 $(TOP)/ext/fts5/fts5_buffer.c \
1288 $(TOP)/ext/fts5/fts5_main.c \
1289 $(TOP)/ext/fts5/fts5_config.c \
1290 $(TOP)/ext/fts5/fts5_expr.c \
1291 $(TOP)/ext/fts5/fts5_hash.c \
1292 $(TOP)/ext/fts5/fts5_index.c \
1293 fts5parse.c fts5parse.h \
1294 $(TOP)/ext/fts5/fts5_storage.c \
1295 $(TOP)/ext/fts5/fts5_tokenize.c \
1296 $(TOP)/ext/fts5/fts5_unicode2.c \
1297 $(TOP)/ext/fts5/fts5_varint.c \
1298 $(TOP)/ext/fts5/fts5_vocab.c \
1300 fts5parse.c: $(TOP)/ext/fts5/fts5parse.y lemon$(BEXE)
1301 cp $(TOP)/ext/fts5/fts5parse.y .
1302 rm -f fts5parse.h
1303 ./lemon$(BEXE) $(OPTS) -S fts5parse.y
1305 fts5parse.h: fts5parse.c
1307 fts5.c: $(FTS5_SRC) has_tclsh84
1308 $(TCLSH_CMD) $(TOP)/ext/fts5/tool/mkfts5c.tcl
1309 cp $(TOP)/ext/fts5/fts5.h .
1311 fts5.lo: fts5.c $(HDR) $(EXTHDR)
1312 $(LTCOMPILE) -DSQLITE_CORE -c fts5.c
1314 sqlite3rbu.lo: $(TOP)/ext/rbu/sqlite3rbu.c $(HDR) $(EXTHDR)
1315 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/rbu/sqlite3rbu.c
1318 # Rules to build the 'testfixture' application.
1320 # If using the amalgamation, use sqlite3.c directly to build the test
1321 # fixture. Otherwise link against libsqlcipher.la. (This distinction is
1322 # necessary because the test fixture requires non-API symbols which are
1323 # hidden when the library is built via the amalgamation).
1325 TESTFIXTURE_FLAGS = -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
1326 TESTFIXTURE_FLAGS += -DTCLSH_INIT_PROC=sqlite3TestInit
1327 TESTFIXTURE_FLAGS += -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE
1328 TESTFIXTURE_FLAGS += -DBUILD_sqlite
1329 TESTFIXTURE_FLAGS += -DSQLITE_SERIES_CONSTRAINT_VERIFY=1
1330 TESTFIXTURE_FLAGS += -DSQLITE_DEFAULT_PAGE_SIZE=1024
1331 TESTFIXTURE_FLAGS += -DSQLITE_ENABLE_STMTVTAB
1332 TESTFIXTURE_FLAGS += -DSQLITE_ENABLE_DBPAGE_VTAB
1333 TESTFIXTURE_FLAGS += -DSQLITE_ENABLE_BYTECODE_VTAB
1334 TESTFIXTURE_FLAGS += -DSQLITE_CKSUMVFS_STATIC
1335 TESTFIXTURE_FLAGS += -DSQLITE_STATIC_RANDOMJSON
1336 TESTFIXTURE_FLAGS += -DSQLITE_STRICT_SUBTYPE=1
1338 TESTFIXTURE_SRC0 = $(TESTSRC2) libsqlcipher.la
1339 TESTFIXTURE_SRC1 = sqlite3.c
1340 TESTFIXTURE_SRC = $(TESTSRC) $(TOP)/src/tclsqlite.c
1341 TESTFIXTURE_SRC += $(TESTFIXTURE_SRC$(USE_AMALGAMATION))
1343 testfixture$(TEXE): has_tclsh85 $(TESTFIXTURE_SRC)
1344 $(LTLINK) -DSQLITE_NO_SYNC=1 $(TEMP_STORE) $(TESTFIXTURE_FLAGS) \
1345 -o $@ $(TESTFIXTURE_SRC) $(LIBTCL) $(TLIBS)
1347 coretestprogs: testfixture$(BEXE) sqlite3$(BEXE)
1349 testprogs: $(TESTPROGS) srcck1$(BEXE) fuzzcheck$(TEXE) sessionfuzz$(TEXE)
1351 # A very detailed test running most or all test cases
1352 fulltest: alltest fuzztest
1354 # Run most or all tcl test cases
1355 alltest: $(TESTPROGS)
1356 ./testfixture$(TEXE) $(TOP)/test/all.test $(TESTOPTS)
1358 # Really really long testing
1359 soaktest: $(TESTPROGS)
1360 ./testfixture$(TEXE) $(TOP)/test/all.test -soak=1 $(TESTOPTS)
1362 # Do extra testing but not everything.
1363 fulltestonly: $(TESTPROGS) fuzztest
1364 ./testfixture$(TEXE) $(TOP)/test/full.test
1366 # Fuzz testing
1368 # WARNING: When the "fuzztest" target is run by the testrunner.tcl script,
1369 # it does not actually run this code. Instead, it schedules equivalent
1370 # commands. Therefore, if this target is updated, then code in
1371 # testrunner_data.tcl (search for "trd_fuzztest_data") must also be updated.
1373 fuzztest: fuzzcheck$(TEXE) $(FUZZDATA) sessionfuzz$(TEXE)
1374 ./fuzzcheck$(TEXE) $(FUZZDATA)
1375 ./sessionfuzz$(TEXE) run $(TOP)/test/sessionfuzz-data1.db
1377 valgrindfuzz: fuzzcheck$(TEXT) $(FUZZDATA) sessionfuzz$(TEXE)
1378 valgrind ./fuzzcheck$(TEXE) --cell-size-check --limit-mem 10M $(FUZZDATA)
1379 valgrind ./sessionfuzz$(TEXE) run $(TOP)/test/sessionfuzz-data1.db
1381 # The veryquick.test TCL tests.
1383 tcltest: ./testfixture$(TEXE)
1384 ./testfixture$(TEXE) $(TOP)/test/veryquick.test $(TESTOPTS)
1386 # Runs all the same tests cases as the "tcltest" target but uses
1387 # the testrunner.tcl script to run them in multiple cores
1388 # concurrently.
1389 testrunner: testfixture$(TEXE)
1390 ./testfixture$(TEXE) $(TOP)/test/testrunner.tcl
1392 # Runs both fuzztest and testrunner, consecutively.
1394 devtest: srctree-check testfixture$(TEXE) fuzztest testrunner
1396 mdevtest: srctree-check has_tclsh85
1397 $(TCLSH_CMD) $(TOP)/test/testrunner.tcl mdevtest
1399 sdevtest: has_tclsh85
1400 $(TCLSH_CMD) $(TOP)/test/testrunner.tcl sdevtest
1402 # Validate that various generated files in the source tree
1403 # are up-to-date.
1405 srctree-check: $(TOP)/tool/srctree-check.tcl
1406 $(TCLSH_CMD) $(TOP)/tool/srctree-check.tcl
1408 # Testing for a release
1410 releasetest: srctree-check testfixture$(TEXE)
1411 ./testfixture$(TEXE) $(TOP)/test/testrunner.tcl release
1413 # Minimal testing that runs in less than 3 minutes
1415 quicktest: ./testfixture$(TEXE)
1416 ./testfixture$(TEXE) $(TOP)/test/extraquick.test $(TESTOPTS)
1418 # This is the common case. Run many tests that do not take too long,
1419 # including fuzzcheck, sqlite3_analyzer, and sqldiff tests.
1421 test: srctree-check fuzztest sourcetest $(TESTPROGS) tcltest
1423 # Run a test using valgrind. This can take a really long time
1424 # because valgrind is so much slower than a native machine.
1426 valgrindtest: $(TESTPROGS) valgrindfuzz
1427 OMIT_MISUSE=1 valgrind -v ./testfixture$(TEXE) $(TOP)/test/permutations.test valgrind $(TESTOPTS)
1429 # A very fast test that checks basic sanity. The name comes from
1430 # the 60s-era electronics testing: "Turn it on and see if smoke
1431 # comes out."
1433 smoketest: $(TESTPROGS) fuzzcheck$(TEXE)
1434 ./testfixture$(TEXE) $(TOP)/test/main.test $(TESTOPTS)
1436 shelltest: $(TESTPROGS)
1437 ./testfixture$(TEXT) $(TOP)/test/permutations.test shell
1439 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
1440 $(TCLSH_CMD) $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqlite3_analyzer.c.in >sqlite3_analyzer.c
1442 sqlite3_analyzer$(TEXE): sqlite3_analyzer.c
1443 $(LTLINK) sqlite3_analyzer.c -o $@ $(LIBTCL) $(TLIBS)
1445 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
1446 $(TCLSH_CMD) $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqltclsh.c.in >sqltclsh.c
1448 sqltclsh$(TEXE): sqltclsh.c
1449 $(LTLINK) sqltclsh.c -o $@ $(LIBTCL) $(TLIBS)
1451 sqlite3_expert$(TEXE): $(TOP)/ext/expert/sqlite3expert.h $(TOP)/ext/expert/sqlite3expert.c $(TOP)/ext/expert/expert.c sqlite3.c
1452 $(LTLINK) $(TOP)/ext/expert/sqlite3expert.h $(TOP)/ext/expert/sqlite3expert.c $(TOP)/ext/expert/expert.c sqlite3.c -o sqlite3_expert $(TLIBS)
1454 CHECKER_DEPS =\
1455 $(TOP)/tool/mkccode.tcl \
1456 sqlite3.c \
1457 $(TOP)/src/tclsqlite.c \
1458 $(TOP)/ext/repair/sqlite3_checker.tcl \
1459 $(TOP)/ext/repair/checkindex.c \
1460 $(TOP)/ext/repair/checkfreelist.c \
1461 $(TOP)/ext/misc/btreeinfo.c \
1462 $(TOP)/ext/repair/sqlite3_checker.c.in
1464 sqlite3_checker.c: $(CHECKER_DEPS) has_tclsh85
1465 $(TCLSH_CMD) $(TOP)/tool/mkccode.tcl $(TOP)/ext/repair/sqlite3_checker.c.in >$@
1467 sqlite3_checker$(TEXE): sqlite3_checker.c
1468 $(LTLINK) sqlite3_checker.c -o $@ $(LIBTCL) $(TLIBS)
1470 dbdump$(TEXE): $(TOP)/ext/misc/dbdump.c sqlite3.lo
1471 $(LTLINK) -DDBDUMP_STANDALONE -o $@ \
1472 $(TOP)/ext/misc/dbdump.c sqlite3.lo $(TLIBS)
1474 dbtotxt$(TEXE): $(TOP)/tool/dbtotxt.c
1475 $(LTLINK)-o $@ $(TOP)/tool/dbtotxt.c
1477 showdb$(TEXE): $(TOP)/tool/showdb.c sqlite3.lo
1478 $(LTLINK) -o $@ $(TOP)/tool/showdb.c sqlite3.lo $(TLIBS)
1480 showstat4$(TEXE): $(TOP)/tool/showstat4.c sqlite3.lo
1481 $(LTLINK) -o $@ $(TOP)/tool/showstat4.c sqlite3.lo $(TLIBS)
1483 showjournal$(TEXE): $(TOP)/tool/showjournal.c sqlite3.lo
1484 $(LTLINK) -o $@ $(TOP)/tool/showjournal.c sqlite3.lo $(TLIBS)
1486 showwal$(TEXE): $(TOP)/tool/showwal.c sqlite3.lo
1487 $(LTLINK) -o $@ $(TOP)/tool/showwal.c sqlite3.lo $(TLIBS)
1489 showshm$(TEXE): $(TOP)/tool/showshm.c
1490 $(LTLINK) -o $@ $(TOP)/tool/showshm.c
1492 index_usage$(TEXE): $(TOP)/tool/index_usage.c sqlite3.lo
1493 $(LTLINK) $(SHELL_OPT) -o $@ $(TOP)/tool/index_usage.c sqlite3.lo $(TLIBS)
1495 changeset$(TEXE): $(TOP)/ext/session/changeset.c sqlite3.lo
1496 $(LTLINK) -o $@ $(TOP)/ext/session/changeset.c sqlite3.lo $(TLIBS)
1498 changesetfuzz$(TEXE): $(TOP)/ext/session/changesetfuzz.c sqlite3.lo
1499 $(LTLINK) -o $@ $(TOP)/ext/session/changesetfuzz.c sqlite3.lo $(TLIBS)
1501 rollback-test$(TEXE): $(TOP)/tool/rollback-test.c sqlite3.lo
1502 $(LTLINK) -o $@ $(TOP)/tool/rollback-test.c sqlite3.lo $(TLIBS)
1504 atrc$(TEXX): $(TOP)/test/atrc.c sqlite3.lo
1505 $(LTLINK) -o $@ $(TOP)/test/atrc.c sqlite3.lo $(TLIBS)
1507 LogEst$(TEXE): $(TOP)/tool/logest.c sqlite3.h
1508 $(LTLINK) -I. -o $@ $(TOP)/tool/logest.c
1510 wordcount$(TEXE): $(TOP)/test/wordcount.c sqlite3.lo
1511 $(LTLINK) -o $@ $(TOP)/test/wordcount.c sqlite3.lo $(TLIBS)
1513 speedtest1$(TEXE): $(TOP)/test/speedtest1.c sqlite3.c Makefile
1514 $(LTLINK) $(ST_OPT) -o $@ $(TOP)/test/speedtest1.c sqlite3.c $(TLIBS)
1516 startup$(TEXE): $(TOP)/test/startup.c sqlite3.c
1517 $(CC) -Os -g -DSQLITE_THREADSAFE=0 -o $@ $(TOP)/test/startup.c sqlite3.c $(TLIBS)
1519 KV_OPT += -DSQLITE_DIRECT_OVERFLOW_READ
1521 kvtest$(TEXE): $(TOP)/test/kvtest.c sqlite3.c
1522 $(LTLINK) $(KV_OPT) -o $@ $(TOP)/test/kvtest.c sqlite3.c $(TLIBS)
1524 rbu$(EXE): $(TOP)/ext/rbu/rbu.c $(TOP)/ext/rbu/sqlite3rbu.c sqlite3.lo
1525 $(LTLINK) -I. -o $@ $(TOP)/ext/rbu/rbu.c sqlite3.lo $(TLIBS)
1527 loadfts$(EXE): $(TOP)/tool/loadfts.c libsqlite3.la
1528 $(LTLINK) $(TOP)/tool/loadfts.c libsqlite3.la -o $@ $(TLIBS)
1530 # This target will fail if the SQLite amalgamation contains any exported
1531 # symbols that do not begin with "sqlite3_". It is run as part of the
1532 # releasetest.tcl script.
1534 VALIDIDS=' sqlite3(changeset|changegroup|session)?_'
1535 checksymbols: sqlite3.o
1536 nm -g --defined-only sqlite3.o
1537 nm -g --defined-only sqlite3.o | egrep -v $(VALIDIDS); test $$? -ne 0
1538 echo '0 errors out of 1 tests'
1540 # Build the amalgamation-autoconf package. The amalamgation-tarball target builds
1541 # a tarball named for the version number. Ex: sqlite-autoconf-3110000.tar.gz.
1542 # The snapshot-tarball target builds a tarball named by the SHA1 hash
1544 amalgamation-tarball: sqlite3.c sqlite3rc.h
1545 TOP=$(TOP) sh $(TOP)/tool/mkautoconfamal.sh --normal
1547 snapshot-tarball: sqlite3.c sqlite3rc.h
1548 TOP=$(TOP) sh $(TOP)/tool/mkautoconfamal.sh --snapshot
1550 # Build a ZIP archive containing various command-line tools.
1552 tool-zip: testfixture sqlite3 sqldiff sqlite3_analyzer $(TOP)/tool/mktoolzip.tcl
1553 ./testfixture $(TOP)/tool/mktoolzip.tcl
1555 # The next two rules are used to support the "threadtest" target. Building
1556 # threadtest runs a few thread-safety tests that are implemented in C. This
1557 # target is invoked by the releasetest.tcl script.
1559 THREADTEST3_SRC = $(TOP)/test/threadtest3.c \
1560 $(TOP)/test/tt3_checkpoint.c \
1561 $(TOP)/test/tt3_index.c \
1562 $(TOP)/test/tt3_vacuum.c \
1563 $(TOP)/test/tt3_stress.c \
1564 $(TOP)/test/tt3_lookaside1.c
1566 threadtest3$(TEXE): sqlite3.lo $(THREADTEST3_SRC)
1567 $(LTLINK) $(TOP)/test/threadtest3.c $(TOP)/src/test_multiplex.c sqlite3.lo -o $@ $(TLIBS)
1569 threadtest: threadtest3$(TEXE)
1570 ./threadtest3$(TEXE)
1572 threadtest5: sqlite3.c $(TOP)/test/threadtest5.c
1573 $(LTLINK) $(TOP)/test/threadtest5.c sqlite3.c -o $@ $(TLIBS)
1575 # Standard install and cleanup targets
1577 lib_install: libsqlcipher.la
1578 $(INSTALL) -d $(DESTDIR)$(libdir)
1579 $(LTINSTALL) libsqlcipher.la $(DESTDIR)$(libdir)
1581 install: sqlcipher$(TEXE) lib_install sqlite3.h sqlcipher.pc ${HAVE_TCL:1=tcl_install}
1582 $(INSTALL) -d $(DESTDIR)$(bindir)
1583 $(LTINSTALL) sqlcipher$(TEXE) $(DESTDIR)$(bindir)
1584 $(INSTALL) -d $(DESTDIR)$(includedir)
1585 $(INSTALL) -m 0644 sqlite3.h $(DESTDIR)$(includedir)
1586 $(INSTALL) -m 0644 $(TOP)/src/sqlite3ext.h $(DESTDIR)$(includedir)
1587 $(INSTALL) -d $(DESTDIR)$(pkgconfigdir)
1588 $(INSTALL) -m 0644 sqlcipher.pc $(DESTDIR)$(pkgconfigdir)
1590 pkgIndex.tcl:
1591 echo 'package ifneeded sqlite3 $(RELEASE) [list load [file join $$dir libtclsqlite3[info sharedlibextension]] sqlite3]' > $@
1592 tcl_install: lib_install libtclsqlite3.la pkgIndex.tcl
1593 $(INSTALL) -d $(DESTDIR)$(TCLLIBDIR)
1594 $(LTINSTALL) libtclsqlite3.la $(DESTDIR)$(TCLLIBDIR)
1595 rm -f $(DESTDIR)$(TCLLIBDIR)/libtclsqlite3.la $(DESTDIR)$(TCLLIBDIR)/libtclsqlite3.a
1596 $(INSTALL) -m 0644 pkgIndex.tcl $(DESTDIR)$(TCLLIBDIR)
1598 clean:
1599 rm -f *.lo *.la *.o sqlcipher$(TEXE) libsqlcipher.la
1600 rm -f sqlite3.h opcodes.*
1601 rm -rf .libs .deps
1602 rm -f lemon$(BEXE) lempar.c parse.* sqlite*.tar.gz
1603 rm -f mkkeywordhash$(BEXE) keywordhash.h
1604 rm -f mksourceid$(BEXE)
1605 rm -f *.da *.bb *.bbg gmon.out
1606 rm -rf tsrc .target_source
1607 rm -f tclsqlcipher$(TEXE)
1608 rm -f testfixture$(TEXE) test.db
1609 rm -f LogEst$(TEXE) fts3view$(TEXE) rollback-test$(TEXE) showdb$(TEXE)
1610 rm -f showjournal$(TEXE) showstat4$(TEXE) showwal$(TEXE) speedtest1$(TEXE)
1611 rm -f wordcount$(TEXE) changeset$(TEXE)
1612 rm -f version-info$(TEXT)
1613 rm -f sqlite3.dll sqlite3.lib sqlite3.exp sqlite3.def
1614 rm -f sqlite3.c
1615 rm -f sqlite3rc.h
1616 rm -f shell.c sqlite3ext.h
1617 rm -f sqlite3_analyzer$(TEXE) sqlite3_analyzer.c
1618 rm -f sqlite-*-output.vsix
1619 rm -f mptester mptester.exe
1620 rm -f rbu rbu.exe
1621 rm -f srcck1 srcck1.exe
1622 rm -f fuzzershell fuzzershell.exe
1623 rm -f fuzzcheck fuzzcheck.exe
1624 rm -f sqldiff sqldiff.exe
1625 rm -f dbhash dbhash.exe
1626 rm -f fts5.* fts5parse.*
1627 rm -f threadtest5
1628 rm -f src-verify
1629 rm -f custom.rws
1630 rm -f has_tclsh84 has_tclsh85
1632 distclean: clean
1633 rm -f sqlite_cfg.h config.log config.status libtool Makefile sqlcipher.pc \
1634 $(TESTPROGS)
1637 # Windows section
1639 dll: sqlite3.dll
1641 REAL_LIBOBJ = $(LIBOBJ:%.lo=.libs/%.o)
1643 $(REAL_LIBOBJ): $(LIBOBJ)
1645 sqlite3.def: $(REAL_LIBOBJ)
1646 echo 'EXPORTS' >sqlite3.def
1647 nm $(REAL_LIBOBJ) | grep ' T ' | grep ' _sqlite3_' \
1648 | sed 's/^.* _//' >>sqlite3.def
1650 sqlite3.dll: $(REAL_LIBOBJ) sqlite3.def
1651 $(TCC) -shared -o $@ sqlite3.def \
1652 -Wl,"--strip-all" $(REAL_LIBOBJ)
1655 # Fiddle app
1657 fiddle: sqlite3.c shell.c
1658 make -C ext/wasm fiddle emcc_opt=-Os
1661 # Spell-checking for source comments
1662 # The sources checked are either C sources or C source templates.
1663 # Their comments are extracted and processed through aspell using
1664 # a custom dictionary that contains scads of odd identifiers that
1665 # find their way into the comments.
1667 # Currently, this target is setup to be "made" in-tree only.
1668 # The output is ephemeral. Redirect it to guide spelling fixups,
1669 # either to correct spelling or add words to tool/custom.txt.
1671 ./custom.rws: ./tool/custom.txt
1672 @echo 'Updating custom dictionary from tool/custom.txt'
1673 aspell --lang=en create master ./custom.rws < $<
1675 misspell: ./custom.rws has_tclsh84
1676 $(TCLSH_CMD) ./tool/spellsift.tcl ./src/*.c ./src/*.h ./src/*.in
1679 # tool/version-info: a utility for emitting sqlite3 version info
1680 # in various forms.
1682 version-info$(TEXE): $(TOP)/tool/version-info.c Makefile sqlite3.h
1683 $(LTLINK) $(ST_OPT) -o $@ $(TOP)/tool/version-info.c