Revert "resolve upstream merge conflict in distclean"
[sqlcipher.git] / Makefile.in
blob2a1d6baebebf471e42c9ee7c4fb5d7f5c8fe48fb
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 config.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@
62 # The library that programs using readline() must link against.
64 LIBREADLINE = @TARGET_READLINE_LIBS@
66 # Should the database engine be compiled threadsafe
68 TCC += -DSQLITE_THREADSAFE=@SQLITE_THREADSAFE@
70 # Any target libraries which libsqlite must be linked against
72 TLIBS = @LIBS@ $(LIBS)
74 # Flags controlling use of the in memory btree implementation
76 # SQLITE_TEMP_STORE is 0 to force temporary tables to be in a file, 1 to
77 # default to file, 2 to default to memory, and 3 to force temporary
78 # tables to always be in memory.
80 TEMP_STORE = -DSQLITE_TEMP_STORE=@TEMP_STORE@
82 # Enable/disable loadable extensions, and other optional features
83 # based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*).
84 # The same set of OMIT and ENABLE flags should be passed to the
85 # LEMON parser generator and the mkkeywordhash tool as well.
86 OPT_FEATURE_FLAGS = @OPT_FEATURE_FLAGS@
88 TCC += $(OPT_FEATURE_FLAGS)
90 # Add in any optional parameters specified on the make commane line
91 # ie. make "OPTS=-DSQLITE_ENABLE_FOO=1 -DSQLITE_OMIT_FOO=1".
92 TCC += $(OPTS)
94 # Add in compile-time options for some libraries used by extensions
95 TCC += @HAVE_ZLIB@
97 # Version numbers and release number for the SQLite being compiled.
99 VERSION = @VERSION@
100 VERSION_NUMBER = @VERSION_NUMBER@
101 RELEASE = @RELEASE@
103 # Filename extensions
105 BEXE = @BUILD_EXEEXT@
106 TEXE = @TARGET_EXEEXT@
108 # The following variable is "1" if the configure script was able to locate
109 # the tclConfig.sh file. It is an empty string otherwise. When this
110 # variable is "1", the TCL extension library (libtclsqlite3.so) is built
111 # and installed.
113 HAVE_TCL = @HAVE_TCL@
115 # This is the command to use for tclsh - normally just "tclsh", but we may
116 # know the specific version we want to use
118 TCLSH_CMD = @TCLSH_CMD@
120 # Where do we want to install the tcl plugin
122 TCLLIBDIR = @TCLLIBDIR@
124 # The suffix used on shared libraries. Ex: ".dll", ".so", ".dylib"
126 SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@
128 # If gcov support was enabled by the configure script, add the appropriate
129 # flags here. It's not always as easy as just having the user add the right
130 # CFLAGS / LDFLAGS, because libtool wants to use CFLAGS when linking, which
131 # causes build errors with -fprofile-arcs -ftest-coverage with some GCCs.
132 # Supposedly GCC does the right thing if you use --coverage, but in
133 # practice it still fails. See:
135 # http://www.mail-archive.com/debian-gcc@lists.debian.org/msg26197.html
137 # for more info.
139 GCOV_CFLAGS1 = -DSQLITE_COVERAGE_TEST=1 -fprofile-arcs -ftest-coverage
140 GCOV_LDFLAGS1 = -lgcov
141 USE_GCOV = @USE_GCOV@
142 LTCOMPILE_EXTRAS += $(GCOV_CFLAGS$(USE_GCOV))
143 LTLINK_EXTRAS += $(GCOV_LDFLAGS$(USE_GCOV))
145 # BEGIN CRYPTO
146 CRYPTOLIBOBJ = \
147 crypto.lo \
148 crypto_impl.lo \
149 crypto_openssl.lo \
150 crypto_libtomcrypt.lo \
151 crypto_nss.lo \
152 crypto_cc.lo
154 CRYPTOSRC = \
155 $(TOP)/src/crypto.h \
156 $(TOP)/src/sqlcipher.h \
157 $(TOP)/src/crypto.c \
158 $(TOP)/src/crypto_impl.c \
159 $(TOP)/src/crypto_libtomcrypt.c \
160 $(TOP)/src/crypto_nss.c \
161 $(TOP)/src/crypto_openssl.c \
162 $(TOP)/src/crypto_cc.c
164 # END CRYPTO
166 # The directory into which to store package information for
168 # Some standard variables and programs
170 prefix = @prefix@
171 exec_prefix = @exec_prefix@
172 libdir = @libdir@
173 pkgconfigdir = $(libdir)/pkgconfig
174 bindir = @bindir@
175 includedir = @includedir@/sqlcipher
176 INSTALL = @INSTALL@
177 LIBTOOL = ./libtool
178 ALLOWRELEASE = @ALLOWRELEASE@
180 # libtool compile/link/install
181 LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(TCC) $(LTCOMPILE_EXTRAS)
182 LTLINK = $(LIBTOOL) --mode=link $(TCC) $(LTCOMPILE_EXTRAS) @LDFLAGS@ $(LTLINK_EXTRAS)
183 LTINSTALL = $(LIBTOOL) --mode=install $(INSTALL)
185 # You should not have to change anything below this line
186 ###############################################################################
188 USE_AMALGAMATION = @USE_AMALGAMATION@
189 AMALGAMATION_LINE_MACROS = @AMALGAMATION_LINE_MACROS@
191 # Object files for the SQLite library (non-amalgamation).
193 LIBOBJS0 = alter.lo analyze.lo attach.lo auth.lo \
194 backup.lo bitvec.lo btmutex.lo btree.lo build.lo \
195 callback.lo complete.lo ctime.lo \
196 date.lo dbpage.lo dbstat.lo delete.lo \
197 expr.lo fault.lo fkey.lo \
198 fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo \
199 fts3_porter.lo fts3_snippet.lo fts3_tokenizer.lo fts3_tokenizer1.lo \
200 fts3_tokenize_vtab.lo \
201 fts3_unicode.lo fts3_unicode2.lo fts3_write.lo \
202 fts5.lo \
203 func.lo global.lo hash.lo \
204 icu.lo insert.lo json.lo legacy.lo loadext.lo \
205 main.lo malloc.lo mem0.lo mem1.lo mem2.lo mem3.lo mem5.lo \
206 memdb.lo memjournal.lo \
207 mutex.lo mutex_noop.lo mutex_unix.lo mutex_w32.lo \
208 notify.lo opcodes.lo os.lo os_unix.lo os_win.lo \
209 pager.lo parse.lo pcache.lo pcache1.lo pragma.lo prepare.lo printf.lo \
210 random.lo resolve.lo rowset.lo rtree.lo \
211 sqlite3session.lo select.lo sqlite3rbu.lo status.lo stmt.lo \
212 table.lo threads.lo tokenize.lo treeview.lo trigger.lo \
213 update.lo userauth.lo upsert.lo util.lo vacuum.lo \
214 vdbe.lo vdbeapi.lo vdbeaux.lo vdbeblob.lo vdbemem.lo vdbesort.lo \
215 vdbetrace.lo vdbevtab.lo \
216 wal.lo walker.lo where.lo wherecode.lo whereexpr.lo \
217 window.lo utf.lo vtab.lo $(CRYPTOLIBOBJ)
219 # Object files for the amalgamation.
221 LIBOBJS1 = sqlite3.lo
223 # Determine the real value of LIBOBJ based on the 'configure' script
225 LIBOBJ = $(LIBOBJS$(USE_AMALGAMATION))
228 # All of the source code files.
230 SRC = \
231 $(CRYPTOSRC) \
232 $(TOP)/src/alter.c \
233 $(TOP)/src/analyze.c \
234 $(TOP)/src/attach.c \
235 $(TOP)/src/auth.c \
236 $(TOP)/src/backup.c \
237 $(TOP)/src/bitvec.c \
238 $(TOP)/src/btmutex.c \
239 $(TOP)/src/btree.c \
240 $(TOP)/src/btree.h \
241 $(TOP)/src/btreeInt.h \
242 $(TOP)/src/build.c \
243 $(TOP)/src/callback.c \
244 $(TOP)/src/complete.c \
245 $(TOP)/src/ctime.c \
246 $(TOP)/src/date.c \
247 $(TOP)/src/dbpage.c \
248 $(TOP)/src/dbstat.c \
249 $(TOP)/src/delete.c \
250 $(TOP)/src/expr.c \
251 $(TOP)/src/fault.c \
252 $(TOP)/src/fkey.c \
253 $(TOP)/src/func.c \
254 $(TOP)/src/global.c \
255 $(TOP)/src/hash.c \
256 $(TOP)/src/hash.h \
257 $(TOP)/src/hwtime.h \
258 $(TOP)/src/insert.c \
259 $(TOP)/src/json.c \
260 $(TOP)/src/legacy.c \
261 $(TOP)/src/loadext.c \
262 $(TOP)/src/main.c \
263 $(TOP)/src/malloc.c \
264 $(TOP)/src/mem0.c \
265 $(TOP)/src/mem1.c \
266 $(TOP)/src/mem2.c \
267 $(TOP)/src/mem3.c \
268 $(TOP)/src/mem5.c \
269 $(TOP)/src/memdb.c \
270 $(TOP)/src/memjournal.c \
271 $(TOP)/src/msvc.h \
272 $(TOP)/src/mutex.c \
273 $(TOP)/src/mutex.h \
274 $(TOP)/src/mutex_noop.c \
275 $(TOP)/src/mutex_unix.c \
276 $(TOP)/src/mutex_w32.c \
277 $(TOP)/src/notify.c \
278 $(TOP)/src/os.c \
279 $(TOP)/src/os.h \
280 $(TOP)/src/os_common.h \
281 $(TOP)/src/os_setup.h \
282 $(TOP)/src/os_unix.c \
283 $(TOP)/src/os_win.c \
284 $(TOP)/src/os_win.h \
285 $(TOP)/src/pager.c \
286 $(TOP)/src/pager.h \
287 $(TOP)/src/parse.y \
288 $(TOP)/src/pcache.c \
289 $(TOP)/src/pcache.h \
290 $(TOP)/src/pcache1.c \
291 $(TOP)/src/pragma.c \
292 $(TOP)/src/pragma.h \
293 $(TOP)/src/prepare.c \
294 $(TOP)/src/printf.c \
295 $(TOP)/src/random.c \
296 $(TOP)/src/resolve.c \
297 $(TOP)/src/rowset.c \
298 $(TOP)/src/select.c \
299 $(TOP)/src/status.c \
300 $(TOP)/src/shell.c.in \
301 $(TOP)/src/sqlite.h.in \
302 $(TOP)/src/sqlite3ext.h \
303 $(TOP)/src/sqliteInt.h \
304 $(TOP)/src/sqliteLimit.h \
305 $(TOP)/src/table.c \
306 $(TOP)/src/tclsqlite.c \
307 $(TOP)/src/threads.c \
308 $(TOP)/src/tokenize.c \
309 $(TOP)/src/treeview.c \
310 $(TOP)/src/trigger.c \
311 $(TOP)/src/utf.c \
312 $(TOP)/src/update.c \
313 $(TOP)/src/upsert.c \
314 $(TOP)/src/util.c \
315 $(TOP)/src/vacuum.c \
316 $(TOP)/src/vdbe.c \
317 $(TOP)/src/vdbe.h \
318 $(TOP)/src/vdbeapi.c \
319 $(TOP)/src/vdbeaux.c \
320 $(TOP)/src/vdbeblob.c \
321 $(TOP)/src/vdbemem.c \
322 $(TOP)/src/vdbesort.c \
323 $(TOP)/src/vdbetrace.c \
324 $(TOP)/src/vdbevtab.c \
325 $(TOP)/src/vdbeInt.h \
326 $(TOP)/src/vtab.c \
327 $(TOP)/src/vxworks.h \
328 $(TOP)/src/wal.c \
329 $(TOP)/src/wal.h \
330 $(TOP)/src/walker.c \
331 $(TOP)/src/where.c \
332 $(TOP)/src/wherecode.c \
333 $(TOP)/src/whereexpr.c \
334 $(TOP)/src/whereInt.h \
335 $(TOP)/src/window.c
337 # Source code for extensions
339 SRC += \
340 $(TOP)/ext/fts1/fts1.c \
341 $(TOP)/ext/fts1/fts1.h \
342 $(TOP)/ext/fts1/fts1_hash.c \
343 $(TOP)/ext/fts1/fts1_hash.h \
344 $(TOP)/ext/fts1/fts1_porter.c \
345 $(TOP)/ext/fts1/fts1_tokenizer.h \
346 $(TOP)/ext/fts1/fts1_tokenizer1.c
347 SRC += \
348 $(TOP)/ext/fts2/fts2.c \
349 $(TOP)/ext/fts2/fts2.h \
350 $(TOP)/ext/fts2/fts2_hash.c \
351 $(TOP)/ext/fts2/fts2_hash.h \
352 $(TOP)/ext/fts2/fts2_icu.c \
353 $(TOP)/ext/fts2/fts2_porter.c \
354 $(TOP)/ext/fts2/fts2_tokenizer.h \
355 $(TOP)/ext/fts2/fts2_tokenizer.c \
356 $(TOP)/ext/fts2/fts2_tokenizer1.c
357 SRC += \
358 $(TOP)/ext/fts3/fts3.c \
359 $(TOP)/ext/fts3/fts3.h \
360 $(TOP)/ext/fts3/fts3Int.h \
361 $(TOP)/ext/fts3/fts3_aux.c \
362 $(TOP)/ext/fts3/fts3_expr.c \
363 $(TOP)/ext/fts3/fts3_hash.c \
364 $(TOP)/ext/fts3/fts3_hash.h \
365 $(TOP)/ext/fts3/fts3_icu.c \
366 $(TOP)/ext/fts3/fts3_porter.c \
367 $(TOP)/ext/fts3/fts3_snippet.c \
368 $(TOP)/ext/fts3/fts3_tokenizer.h \
369 $(TOP)/ext/fts3/fts3_tokenizer.c \
370 $(TOP)/ext/fts3/fts3_tokenizer1.c \
371 $(TOP)/ext/fts3/fts3_tokenize_vtab.c \
372 $(TOP)/ext/fts3/fts3_unicode.c \
373 $(TOP)/ext/fts3/fts3_unicode2.c \
374 $(TOP)/ext/fts3/fts3_write.c
375 SRC += \
376 $(TOP)/ext/icu/sqliteicu.h \
377 $(TOP)/ext/icu/icu.c
378 SRC += \
379 $(TOP)/ext/rtree/rtree.h \
380 $(TOP)/ext/rtree/rtree.c \
381 $(TOP)/ext/rtree/geopoly.c
382 SRC += \
383 $(TOP)/ext/session/sqlite3session.c \
384 $(TOP)/ext/session/sqlite3session.h
385 SRC += \
386 $(TOP)/ext/userauth/userauth.c \
387 $(TOP)/ext/userauth/sqlite3userauth.h
388 SRC += \
389 $(TOP)/ext/rbu/sqlite3rbu.h \
390 $(TOP)/ext/rbu/sqlite3rbu.c
391 SRC += \
392 $(TOP)/ext/misc/stmt.c
394 # Generated source code files
396 SRC += \
397 keywordhash.h \
398 opcodes.c \
399 opcodes.h \
400 parse.c \
401 parse.h \
402 config.h \
403 shell.c \
404 sqlite3.h
406 # Source code to the test files.
408 TESTSRC = \
409 $(TOP)/src/test1.c \
410 $(TOP)/src/test2.c \
411 $(TOP)/src/test3.c \
412 $(TOP)/src/test4.c \
413 $(TOP)/src/test5.c \
414 $(TOP)/src/test6.c \
415 $(TOP)/src/test7.c \
416 $(TOP)/src/test8.c \
417 $(TOP)/src/test9.c \
418 $(TOP)/src/test_autoext.c \
419 $(TOP)/src/test_async.c \
420 $(TOP)/src/test_backup.c \
421 $(TOP)/src/test_bestindex.c \
422 $(TOP)/src/test_blob.c \
423 $(TOP)/src/test_btree.c \
424 $(TOP)/src/test_config.c \
425 $(TOP)/src/test_delete.c \
426 $(TOP)/src/test_demovfs.c \
427 $(TOP)/src/test_devsym.c \
428 $(TOP)/src/test_fs.c \
429 $(TOP)/src/test_func.c \
430 $(TOP)/src/test_hexio.c \
431 $(TOP)/src/test_init.c \
432 $(TOP)/src/test_intarray.c \
433 $(TOP)/src/test_journal.c \
434 $(TOP)/src/test_malloc.c \
435 $(TOP)/src/test_md5.c \
436 $(TOP)/src/test_multiplex.c \
437 $(TOP)/src/test_mutex.c \
438 $(TOP)/src/test_onefile.c \
439 $(TOP)/src/test_osinst.c \
440 $(TOP)/src/test_pcache.c \
441 $(TOP)/src/test_quota.c \
442 $(TOP)/src/test_rtree.c \
443 $(TOP)/src/test_schema.c \
444 $(TOP)/src/test_server.c \
445 $(TOP)/src/test_superlock.c \
446 $(TOP)/src/test_syscall.c \
447 $(TOP)/src/test_tclsh.c \
448 $(TOP)/src/test_tclvar.c \
449 $(TOP)/src/test_thread.c \
450 $(TOP)/src/test_vdbecov.c \
451 $(TOP)/src/test_vfs.c \
452 $(TOP)/src/test_windirent.c \
453 $(TOP)/src/test_window.c \
454 $(TOP)/src/test_wsd.c \
455 $(TOP)/ext/fts3/fts3_term.c \
456 $(TOP)/ext/fts3/fts3_test.c \
457 $(TOP)/ext/session/test_session.c \
458 $(TOP)/ext/rbu/test_rbu.c
460 # Statically linked extensions
462 TESTSRC += \
463 $(TOP)/ext/expert/sqlite3expert.c \
464 $(TOP)/ext/expert/test_expert.c \
465 $(TOP)/ext/misc/amatch.c \
466 $(TOP)/ext/misc/appendvfs.c \
467 $(TOP)/ext/misc/carray.c \
468 $(TOP)/ext/misc/cksumvfs.c \
469 $(TOP)/ext/misc/closure.c \
470 $(TOP)/ext/misc/csv.c \
471 $(TOP)/ext/misc/decimal.c \
472 $(TOP)/ext/misc/eval.c \
473 $(TOP)/ext/misc/explain.c \
474 $(TOP)/ext/misc/fileio.c \
475 $(TOP)/ext/misc/fuzzer.c \
476 $(TOP)/ext/fts5/fts5_tcl.c \
477 $(TOP)/ext/fts5/fts5_test_mi.c \
478 $(TOP)/ext/fts5/fts5_test_tok.c \
479 $(TOP)/ext/misc/ieee754.c \
480 $(TOP)/ext/misc/mmapwarm.c \
481 $(TOP)/ext/misc/nextchar.c \
482 $(TOP)/ext/misc/normalize.c \
483 $(TOP)/ext/misc/percentile.c \
484 $(TOP)/ext/misc/prefixes.c \
485 $(TOP)/ext/misc/qpvtab.c \
486 $(TOP)/ext/misc/regexp.c \
487 $(TOP)/ext/misc/remember.c \
488 $(TOP)/ext/misc/series.c \
489 $(TOP)/ext/misc/spellfix.c \
490 $(TOP)/ext/misc/totype.c \
491 $(TOP)/ext/misc/unionvtab.c \
492 $(TOP)/ext/misc/wholenumber.c \
493 $(TOP)/ext/misc/zipfile.c \
494 $(TOP)/ext/userauth/userauth.c \
495 $(TOP)/ext/rtree/test_rtreedoc.c
497 # Source code to the library files needed by the test fixture
499 TESTSRC2 = \
500 $(TOP)/src/attach.c \
501 $(TOP)/src/backup.c \
502 $(TOP)/src/bitvec.c \
503 $(TOP)/src/btree.c \
504 $(TOP)/src/build.c \
505 $(TOP)/src/ctime.c \
506 $(TOP)/src/date.c \
507 $(TOP)/src/dbpage.c \
508 $(TOP)/src/dbstat.c \
509 $(TOP)/src/expr.c \
510 $(TOP)/src/func.c \
511 $(TOP)/src/global.c \
512 $(TOP)/src/insert.c \
513 $(TOP)/src/wal.c \
514 $(TOP)/src/main.c \
515 $(TOP)/src/mem5.c \
516 $(TOP)/src/os.c \
517 $(TOP)/src/os_unix.c \
518 $(TOP)/src/os_win.c \
519 $(TOP)/src/pager.c \
520 $(TOP)/src/pragma.c \
521 $(TOP)/src/prepare.c \
522 $(TOP)/src/printf.c \
523 $(TOP)/src/random.c \
524 $(TOP)/src/pcache.c \
525 $(TOP)/src/pcache1.c \
526 $(TOP)/src/select.c \
527 $(TOP)/src/tokenize.c \
528 $(TOP)/src/treeview.c \
529 $(TOP)/src/utf.c \
530 $(TOP)/src/util.c \
531 $(TOP)/src/vdbeapi.c \
532 $(TOP)/src/vdbeaux.c \
533 $(TOP)/src/vdbe.c \
534 $(TOP)/src/vdbemem.c \
535 $(TOP)/src/vdbetrace.c \
536 $(TOP)/src/vdbevtab.c \
537 $(TOP)/src/where.c \
538 $(TOP)/src/wherecode.c \
539 $(TOP)/src/whereexpr.c \
540 $(TOP)/src/window.c \
541 parse.c \
542 $(TOP)/ext/fts3/fts3.c \
543 $(TOP)/ext/fts3/fts3_aux.c \
544 $(TOP)/ext/fts3/fts3_expr.c \
545 $(TOP)/ext/fts3/fts3_term.c \
546 $(TOP)/ext/fts3/fts3_tokenizer.c \
547 $(TOP)/ext/fts3/fts3_write.c \
548 $(TOP)/ext/async/sqlite3async.c \
549 $(TOP)/ext/session/sqlite3session.c \
550 $(TOP)/ext/misc/stmt.c \
551 fts5.c
553 # Header files used by all library source files.
555 HDR = \
556 $(TOP)/src/btree.h \
557 $(TOP)/src/btreeInt.h \
558 $(TOP)/src/hash.h \
559 $(TOP)/src/hwtime.h \
560 keywordhash.h \
561 $(TOP)/src/msvc.h \
562 $(TOP)/src/mutex.h \
563 opcodes.h \
564 $(TOP)/src/os.h \
565 $(TOP)/src/os_common.h \
566 $(TOP)/src/os_setup.h \
567 $(TOP)/src/os_win.h \
568 $(TOP)/src/pager.h \
569 $(TOP)/src/pcache.h \
570 parse.h \
571 $(TOP)/src/pragma.h \
572 sqlite3.h \
573 $(TOP)/src/sqlite3ext.h \
574 $(TOP)/src/sqliteInt.h \
575 $(TOP)/src/sqliteLimit.h \
576 $(TOP)/src/vdbe.h \
577 $(TOP)/src/vdbeInt.h \
578 $(TOP)/src/vxworks.h \
579 $(TOP)/src/whereInt.h \
580 config.h
582 # Header files used by extensions
584 EXTHDR += \
585 $(TOP)/ext/fts1/fts1.h \
586 $(TOP)/ext/fts1/fts1_hash.h \
587 $(TOP)/ext/fts1/fts1_tokenizer.h
588 EXTHDR += \
589 $(TOP)/ext/fts2/fts2.h \
590 $(TOP)/ext/fts2/fts2_hash.h \
591 $(TOP)/ext/fts2/fts2_tokenizer.h
592 EXTHDR += \
593 $(TOP)/ext/fts3/fts3.h \
594 $(TOP)/ext/fts3/fts3Int.h \
595 $(TOP)/ext/fts3/fts3_hash.h \
596 $(TOP)/ext/fts3/fts3_tokenizer.h
597 EXTHDR += \
598 $(TOP)/ext/rtree/rtree.h \
599 $(TOP)/ext/rtree/geopoly.c
600 EXTHDR += \
601 $(TOP)/ext/icu/sqliteicu.h
602 EXTHDR += \
603 $(TOP)/ext/rtree/sqlite3rtree.h
604 EXTHDR += \
605 $(TOP)/ext/userauth/sqlite3userauth.h
607 # executables needed for testing
609 TESTPROGS = \
610 testfixture$(TEXE) \
611 sqlite3$(TEXE) \
612 sqlite3_analyzer$(TEXE) \
613 sqldiff$(TEXE) \
614 dbhash$(TEXE) \
615 sqltclsh$(TEXE)
617 # Databases containing fuzzer test cases
619 FUZZDATA = \
620 $(TOP)/test/fuzzdata1.db \
621 $(TOP)/test/fuzzdata2.db \
622 $(TOP)/test/fuzzdata3.db \
623 $(TOP)/test/fuzzdata4.db \
624 $(TOP)/test/fuzzdata5.db \
625 $(TOP)/test/fuzzdata6.db \
626 $(TOP)/test/fuzzdata7.db \
627 $(TOP)/test/fuzzdata8.db
629 # Standard options to testfixture
631 TESTOPTS = --verbose=file --output=test-out.txt
633 # Extra compiler options for various shell tools
635 SHELL_OPT = -DSQLITE_ENABLE_FTS4
636 #SHELL_OPT += -DSQLITE_ENABLE_FTS5
637 SHELL_OPT += -DSQLITE_ENABLE_RTREE
638 SHELL_OPT += -DSQLITE_ENABLE_EXPLAIN_COMMENTS
639 SHELL_OPT += -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
640 SHELL_OPT += -DSQLITE_ENABLE_STMTVTAB
641 SHELL_OPT += -DSQLITE_ENABLE_DBPAGE_VTAB
642 SHELL_OPT += -DSQLITE_ENABLE_DBSTAT_VTAB
643 SHELL_OPT += -DSQLITE_ENABLE_BYTECODE_VTAB
644 SHELL_OPT += -DSQLITE_ENABLE_OFFSET_SQL_FUNC
645 FUZZERSHELL_OPT =
646 FUZZCHECK_OPT = -DSQLITE_ENABLE_MEMSYS5 -DSQLITE_OSS_FUZZ
647 FUZZCHECK_OPT += -DSQLITE_MAX_MEMORY=50000000
648 FUZZCHECK_OPT += -DSQLITE_PRINTF_PRECISION_LIMIT=1000
649 FUZZCHECK_OPT += -DSQLITE_ENABLE_FTS4
650 FUZZCHECK_OPT += -DSQLITE_ENABLE_FTS3_PARENTHESIS
651 FUZZCHECK_OPT += -DSQLITE_ENABLE_FTS5
652 FUZZCHECK_OPT += -DSQLITE_ENABLE_RTREE
653 FUZZCHECK_OPT += -DSQLITE_ENABLE_GEOPOLY
654 FUZZCHECK_OPT += -DSQLITE_ENABLE_DBSTAT_VTAB
655 FUZZCHECK_OPT += -DSQLITE_ENABLE_BYTECODE_VTAB
656 FUZZCHECK_SRC = $(TOP)/test/fuzzcheck.c $(TOP)/test/ossfuzz.c $(TOP)/test/fuzzinvariants.c
657 DBFUZZ_OPT =
659 # This is the default Makefile target. The objects listed here
660 # are what get build when you type just "make" with no arguments.
662 all: sqlite3.h libsqlcipher.la sqlcipher$(TEXE) $(HAVE_TCL:1=libtclsqlite3.la)
664 Makefile: $(TOP)/Makefile.in
665 ./config.status
667 sqlcipher.pc: $(TOP)/sqlcipher.pc.in
668 ./config.status
670 libsqlcipher.la: $(LIBOBJ)
671 $(LTLINK) -no-undefined -o $@ $(LIBOBJ) $(TLIBS) \
672 ${ALLOWRELEASE} -rpath "$(libdir)" -version-info "8:6:8"
674 libtclsqlite3.la: tclsqlite.lo libsqlcipher.la
675 $(LTLINK) -no-undefined -o $@ tclsqlite.lo \
676 libsqlcipher.la @TCL_STUB_LIB_SPEC@ $(TLIBS) \
677 -rpath "$(TCLLIBDIR)" \
678 -version-info "8:6:8" \
679 -avoid-version
681 sqlcipher$(TEXE): shell.c sqlite3.c
682 $(LTLINK) $(READLINE_FLAGS) $(SHELL_OPT) -o $@ \
683 shell.c sqlite3.c \
684 $(LIBREADLINE) $(TLIBS) -rpath "$(libdir)"
686 sqldiff$(TEXE): $(TOP)/tool/sqldiff.c sqlite3.lo sqlite3.h
687 $(LTLINK) -o $@ $(TOP)/tool/sqldiff.c sqlite3.lo $(TLIBS)
689 dbhash$(TEXE): $(TOP)/tool/dbhash.c sqlite3.lo sqlite3.h
690 $(LTLINK) -o $@ $(TOP)/tool/dbhash.c sqlite3.lo $(TLIBS)
692 scrub$(TEXE): $(TOP)/ext/misc/scrub.c sqlite3.lo
693 $(LTLINK) -o $@ -I. -DSCRUB_STANDALONE \
694 $(TOP)/ext/misc/scrub.c sqlite3.lo $(TLIBS)
696 srcck1$(BEXE): $(TOP)/tool/srcck1.c
697 $(BCC) -o srcck1$(BEXE) $(TOP)/tool/srcck1.c
699 sourcetest: srcck1$(BEXE) sqlite3.c
700 ./srcck1 sqlite3.c
702 fuzzershell$(TEXE): $(TOP)/tool/fuzzershell.c sqlite3.c sqlite3.h
703 $(LTLINK) -o $@ $(FUZZERSHELL_OPT) \
704 $(TOP)/tool/fuzzershell.c sqlite3.c $(TLIBS)
706 fuzzcheck$(TEXE): $(FUZZCHECK_SRC) sqlite3.c sqlite3.h
707 $(LTLINK) -o $@ $(FUZZCHECK_OPT) $(FUZZCHECK_SRC) sqlite3.c $(TLIBS)
709 ossshell$(TEXE): $(TOP)/test/ossfuzz.c $(TOP)/test/ossshell.c sqlite3.c sqlite3.h
710 $(LTLINK) -o $@ $(FUZZCHECK_OPT) $(TOP)/test/ossshell.c \
711 $(TOP)/test/ossfuzz.c sqlite3.c $(TLIBS)
713 sessionfuzz$(TEXE): $(TOP)/test/sessionfuzz.c sqlite3.c sqlite3.h
714 $(LTLINK) -o $@ $(TOP)/test/sessionfuzz.c $(TLIBS)
716 dbfuzz$(TEXE): $(TOP)/test/dbfuzz.c sqlite3.c sqlite3.h
717 $(LTLINK) -o $@ $(DBFUZZ_OPT) $(TOP)/test/dbfuzz.c sqlite3.c $(TLIBS)
719 DBFUZZ2_OPTS = \
720 -DSQLITE_THREADSAFE=0 \
721 -DSQLITE_OMIT_LOAD_EXTENSION \
722 -DSQLITE_DEBUG \
723 -DSQLITE_ENABLE_DBSTAT_VTAB \
724 -DSQLITE_ENABLE_BYTECODE_VTAB \
725 -DSQLITE_ENABLE_RTREE \
726 -DSQLITE_ENABLE_FTS4 \
727 -DSQLITE_ENABLE_FTS5
729 dbfuzz2$(TEXE): $(TOP)/test/dbfuzz2.c sqlite3.c sqlite3.h
730 $(CC) $(OPT_FEATURE_FLAGS) $(OPTS) -I. -g -O0 \
731 -DSTANDALONE -o dbfuzz2 \
732 $(DBFUZZ2_OPTS) $(TOP)/test/dbfuzz2.c sqlite3.c $(TLIBS)
733 mkdir -p dbfuzz2-dir
734 cp $(TOP)/test/dbfuzz2-seed* dbfuzz2-dir
736 dbfuzz2-asan: $(TOP)/test/dbfuzz2.c sqlite3.c sqlite3.h
737 clang-6.0 $(OPT_FEATURE_FLAGS) $(OPTS) -I. -g -O0 \
738 -fsanitize=fuzzer,undefined,address -o dbfuzz2-asan \
739 $(DBFUZZ2_OPTS) $(TOP)/test/dbfuzz2.c sqlite3.c $(TLIBS)
740 mkdir -p dbfuzz2-dir
741 cp $(TOP)/test/dbfuzz2-seed* dbfuzz2-dir
743 dbfuzz2-msan: $(TOP)/test/dbfuzz2.c sqlite3.c sqlite3.h
744 clang-6.0 $(OPT_FEATURE_FLAGS) $(OPTS) -I. -g -O0 \
745 -fsanitize=fuzzer,undefined,memory -o dbfuzz2-msan \
746 $(DBFUZZ2_OPTS) $(TOP)/test/dbfuzz2.c sqlite3.c $(TLIBS)
747 mkdir -p dbfuzz2-dir
748 cp $(TOP)/test/dbfuzz2-seed* dbfuzz2-dir
750 mptester$(TEXE): sqlite3.lo $(TOP)/mptest/mptest.c
751 $(LTLINK) -o $@ -I. $(TOP)/mptest/mptest.c sqlite3.lo \
752 $(TLIBS) -rpath "$(libdir)"
754 MPTEST1=./mptester$(TEXE) mptest.db $(TOP)/mptest/crash01.test --repeat 20
755 MPTEST2=./mptester$(TEXE) mptest.db $(TOP)/mptest/multiwrite01.test --repeat 20
756 mptest: mptester$(TEXE)
757 rm -f mptest.db
758 $(MPTEST1) --journalmode DELETE
759 $(MPTEST2) --journalmode WAL
760 $(MPTEST1) --journalmode WAL
761 $(MPTEST2) --journalmode PERSIST
762 $(MPTEST1) --journalmode PERSIST
763 $(MPTEST2) --journalmode TRUNCATE
764 $(MPTEST1) --journalmode TRUNCATE
765 $(MPTEST2) --journalmode DELETE
768 # This target creates a directory named "tsrc" and fills it with
769 # copies of all of the C source code and header files needed to
770 # build on the target system. Some of the C source code and header
771 # files are automatically generated. This target takes care of
772 # all that automatic generation.
774 .target_source: $(SRC) $(TOP)/tool/vdbe-compress.tcl fts5.c
775 rm -rf tsrc
776 mkdir tsrc
777 cp -f $(SRC) tsrc
778 rm tsrc/sqlite.h.in tsrc/parse.y
779 $(TCLSH_CMD) $(TOP)/tool/vdbe-compress.tcl $(OPTS) <tsrc/vdbe.c >vdbe.new
780 mv vdbe.new tsrc/vdbe.c
781 cp fts5.c fts5.h tsrc
782 touch .target_source
784 sqlite3.c: .target_source $(TOP)/tool/mksqlite3c.tcl
785 $(TCLSH_CMD) $(TOP)/tool/mksqlite3c.tcl $(AMALGAMATION_LINE_MACROS)
786 cp tsrc/sqlite3ext.h .
787 cp $(TOP)/ext/session/sqlite3session.h .
789 sqlite3ext.h: .target_source
790 cp tsrc/sqlite3ext.h .
792 tclsqlite3.c: sqlite3.c
793 echo '#ifndef USE_SYSTEM_SQLITE' >tclsqlite3.c
794 cat sqlite3.c >>tclsqlite3.c
795 echo '#endif /* USE_SYSTEM_SQLITE */' >>tclsqlite3.c
796 cat $(TOP)/src/tclsqlite.c >>tclsqlite3.c
798 sqlite3-all.c: sqlite3.c $(TOP)/tool/split-sqlite3c.tcl
799 $(TCLSH_CMD) $(TOP)/tool/split-sqlite3c.tcl
801 # Rule to build the amalgamation
803 sqlite3.lo: sqlite3.c
804 $(LTCOMPILE) $(TEMP_STORE) -c sqlite3.c
806 # Rules to build the LEMON compiler generator
808 lemon$(BEXE): $(TOP)/tool/lemon.c $(TOP)/tool/lempar.c
809 $(BCC) -o $@ $(TOP)/tool/lemon.c
810 cp $(TOP)/tool/lempar.c .
812 # Rules to build the program that generates the source-id
814 mksourceid$(BEXE): $(TOP)/tool/mksourceid.c
815 $(BCC) -o $@ $(TOP)/tool/mksourceid.c
817 # Rules to build individual *.o files from generated *.c files. This
818 # applies to:
820 # parse.o
821 # opcodes.o
823 parse.lo: parse.c $(HDR)
824 $(LTCOMPILE) $(TEMP_STORE) -c parse.c
826 opcodes.lo: opcodes.c
827 $(LTCOMPILE) $(TEMP_STORE) -c opcodes.c
829 # BEGIN CRYPTO
830 crypto.lo: $(TOP)/src/crypto.c $(HDR)
831 $(LTCOMPILE) -c $(TOP)/src/crypto.c
832 crypto_impl.lo: $(TOP)/src/crypto_impl.c $(HDR)
833 $(LTCOMPILE) -c $(TOP)/src/crypto_impl.c
834 crypto_openssl.lo: $(TOP)/src/crypto_openssl.c $(HDR)
835 $(LTCOMPILE) -c $(TOP)/src/crypto_openssl.c
836 crypto_nss.lo: $(TOP)/src/crypto_nss.c $(HDR)
837 $(LTCOMPILE) -c $(TOP)/src/crypto_nss.c
838 crypto_libtomcrypt.lo: $(TOP)/src/crypto_libtomcrypt.c $(HDR)
839 $(LTCOMPILE) -c $(TOP)/src/crypto_libtomcrypt.c
840 crypto_cc.lo: $(TOP)/src/crypto_cc.c $(HDR)
841 $(LTCOMPILE) -c $(TOP)/src/crypto_cc.c
842 # END CRYPTO
844 # Rules to build individual *.o files from files in the src directory.
846 alter.lo: $(TOP)/src/alter.c $(HDR)
847 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/alter.c
849 analyze.lo: $(TOP)/src/analyze.c $(HDR)
850 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/analyze.c
852 attach.lo: $(TOP)/src/attach.c $(HDR)
853 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/attach.c
855 auth.lo: $(TOP)/src/auth.c $(HDR)
856 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/auth.c
858 backup.lo: $(TOP)/src/backup.c $(HDR)
859 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/backup.c
861 bitvec.lo: $(TOP)/src/bitvec.c $(HDR)
862 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/bitvec.c
864 btmutex.lo: $(TOP)/src/btmutex.c $(HDR)
865 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/btmutex.c
867 btree.lo: $(TOP)/src/btree.c $(HDR) $(TOP)/src/pager.h
868 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/btree.c
870 build.lo: $(TOP)/src/build.c $(HDR)
871 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/build.c
873 callback.lo: $(TOP)/src/callback.c $(HDR)
874 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/callback.c
876 complete.lo: $(TOP)/src/complete.c $(HDR)
877 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/complete.c
879 ctime.lo: $(TOP)/src/ctime.c $(HDR)
880 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/ctime.c
882 date.lo: $(TOP)/src/date.c $(HDR)
883 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/date.c
885 dbpage.lo: $(TOP)/src/dbpage.c $(HDR)
886 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/dbpage.c
888 dbstat.lo: $(TOP)/src/dbstat.c $(HDR)
889 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/dbstat.c
891 delete.lo: $(TOP)/src/delete.c $(HDR)
892 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/delete.c
894 expr.lo: $(TOP)/src/expr.c $(HDR)
895 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/expr.c
897 fault.lo: $(TOP)/src/fault.c $(HDR)
898 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/fault.c
900 fkey.lo: $(TOP)/src/fkey.c $(HDR)
901 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/fkey.c
903 func.lo: $(TOP)/src/func.c $(HDR)
904 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/func.c
906 global.lo: $(TOP)/src/global.c $(HDR)
907 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/global.c
909 hash.lo: $(TOP)/src/hash.c $(HDR)
910 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/hash.c
912 insert.lo: $(TOP)/src/insert.c $(HDR)
913 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/insert.c
915 json.lo: $(TOP)/src/json.c $(HDR)
916 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/json.c
918 legacy.lo: $(TOP)/src/legacy.c $(HDR)
919 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/legacy.c
921 loadext.lo: $(TOP)/src/loadext.c $(HDR)
922 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/loadext.c
924 main.lo: $(TOP)/src/main.c $(HDR)
925 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/main.c
927 malloc.lo: $(TOP)/src/malloc.c $(HDR)
928 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/malloc.c
930 mem0.lo: $(TOP)/src/mem0.c $(HDR)
931 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem0.c
933 mem1.lo: $(TOP)/src/mem1.c $(HDR)
934 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem1.c
936 mem2.lo: $(TOP)/src/mem2.c $(HDR)
937 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem2.c
939 mem3.lo: $(TOP)/src/mem3.c $(HDR)
940 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem3.c
942 mem5.lo: $(TOP)/src/mem5.c $(HDR)
943 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem5.c
945 memdb.lo: $(TOP)/src/memdb.c $(HDR)
946 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/memdb.c
948 memjournal.lo: $(TOP)/src/memjournal.c $(HDR)
949 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/memjournal.c
951 mutex.lo: $(TOP)/src/mutex.c $(HDR)
952 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex.c
954 mutex_noop.lo: $(TOP)/src/mutex_noop.c $(HDR)
955 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex_noop.c
957 mutex_unix.lo: $(TOP)/src/mutex_unix.c $(HDR)
958 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex_unix.c
960 mutex_w32.lo: $(TOP)/src/mutex_w32.c $(HDR)
961 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex_w32.c
963 notify.lo: $(TOP)/src/notify.c $(HDR)
964 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/notify.c
966 pager.lo: $(TOP)/src/pager.c $(HDR) $(TOP)/src/pager.h
967 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pager.c
969 pcache.lo: $(TOP)/src/pcache.c $(HDR) $(TOP)/src/pcache.h
970 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pcache.c
972 pcache1.lo: $(TOP)/src/pcache1.c $(HDR) $(TOP)/src/pcache.h
973 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pcache1.c
975 os.lo: $(TOP)/src/os.c $(HDR)
976 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os.c
978 os_unix.lo: $(TOP)/src/os_unix.c $(HDR)
979 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os_unix.c
981 os_win.lo: $(TOP)/src/os_win.c $(HDR)
982 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os_win.c
984 pragma.lo: $(TOP)/src/pragma.c $(HDR)
985 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pragma.c
987 prepare.lo: $(TOP)/src/prepare.c $(HDR)
988 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/prepare.c
990 printf.lo: $(TOP)/src/printf.c $(HDR)
991 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/printf.c
993 random.lo: $(TOP)/src/random.c $(HDR)
994 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/random.c
996 resolve.lo: $(TOP)/src/resolve.c $(HDR)
997 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/resolve.c
999 rowset.lo: $(TOP)/src/rowset.c $(HDR)
1000 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/rowset.c
1002 select.lo: $(TOP)/src/select.c $(HDR)
1003 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/select.c
1005 status.lo: $(TOP)/src/status.c $(HDR)
1006 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/status.c
1008 table.lo: $(TOP)/src/table.c $(HDR)
1009 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/table.c
1011 threads.lo: $(TOP)/src/threads.c $(HDR)
1012 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/threads.c
1014 tokenize.lo: $(TOP)/src/tokenize.c keywordhash.h $(HDR)
1015 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/tokenize.c
1017 treeview.lo: $(TOP)/src/treeview.c $(HDR)
1018 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/treeview.c
1020 trigger.lo: $(TOP)/src/trigger.c $(HDR)
1021 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/trigger.c
1023 update.lo: $(TOP)/src/update.c $(HDR)
1024 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/update.c
1026 upsert.lo: $(TOP)/src/upsert.c $(HDR)
1027 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/upsert.c
1029 utf.lo: $(TOP)/src/utf.c $(HDR)
1030 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/utf.c
1032 util.lo: $(TOP)/src/util.c $(HDR)
1033 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/util.c
1035 vacuum.lo: $(TOP)/src/vacuum.c $(HDR)
1036 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vacuum.c
1038 vdbe.lo: $(TOP)/src/vdbe.c $(HDR)
1039 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbe.c
1041 vdbeapi.lo: $(TOP)/src/vdbeapi.c $(HDR)
1042 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbeapi.c
1044 vdbeaux.lo: $(TOP)/src/vdbeaux.c $(HDR)
1045 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbeaux.c
1047 vdbeblob.lo: $(TOP)/src/vdbeblob.c $(HDR)
1048 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbeblob.c
1050 vdbemem.lo: $(TOP)/src/vdbemem.c $(HDR)
1051 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbemem.c
1053 vdbesort.lo: $(TOP)/src/vdbesort.c $(HDR)
1054 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbesort.c
1056 vdbetrace.lo: $(TOP)/src/vdbetrace.c $(HDR)
1057 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbetrace.c
1059 vdbevtab.lo: $(TOP)/src/vdbevtab.c $(HDR)
1060 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbevtab.c
1062 vtab.lo: $(TOP)/src/vtab.c $(HDR)
1063 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vtab.c
1065 wal.lo: $(TOP)/src/wal.c $(HDR)
1066 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/wal.c
1068 walker.lo: $(TOP)/src/walker.c $(HDR)
1069 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/walker.c
1071 where.lo: $(TOP)/src/where.c $(HDR)
1072 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/where.c
1074 wherecode.lo: $(TOP)/src/wherecode.c $(HDR)
1075 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/wherecode.c
1077 whereexpr.lo: $(TOP)/src/whereexpr.c $(HDR)
1078 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/whereexpr.c
1080 window.lo: $(TOP)/src/window.c $(HDR)
1081 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/window.c
1083 tclsqlite.lo: $(TOP)/src/tclsqlite.c $(HDR)
1084 $(LTCOMPILE) -DUSE_TCL_STUBS=1 -c $(TOP)/src/tclsqlite.c
1086 tclsqlite-shell.lo: $(TOP)/src/tclsqlite.c $(HDR)
1087 $(LTCOMPILE) -DTCLSH -o $@ -c $(TOP)/src/tclsqlite.c
1089 tclsqlite-stubs.lo: $(TOP)/src/tclsqlite.c $(HDR)
1090 $(LTCOMPILE) -DUSE_TCL_STUBS=1 -o $@ -c $(TOP)/src/tclsqlite.c
1092 tclsqlcipher$(TEXE): tclsqlite-shell.lo libsqlcipher.la
1093 $(LTLINK) -o $@ tclsqlite-shell.lo \
1094 libsqlcipher.la $(LIBTCL)
1096 # Rules to build opcodes.c and opcodes.h
1098 opcodes.c: opcodes.h $(TOP)/tool/mkopcodec.tcl
1099 $(TCLSH_CMD) $(TOP)/tool/mkopcodec.tcl opcodes.h >opcodes.c
1101 opcodes.h: parse.h $(TOP)/src/vdbe.c $(TOP)/tool/mkopcodeh.tcl
1102 cat parse.h $(TOP)/src/vdbe.c | $(TCLSH_CMD) $(TOP)/tool/mkopcodeh.tcl >opcodes.h
1104 # Rules to build parse.c and parse.h - the outputs of lemon.
1106 parse.h: parse.c
1108 parse.c: $(TOP)/src/parse.y lemon$(BEXE)
1109 cp $(TOP)/src/parse.y .
1110 ./lemon$(BEXE) $(OPT_FEATURE_FLAGS) $(OPTS) -S parse.y
1112 sqlite3.h: $(TOP)/src/sqlite.h.in $(TOP)/manifest mksourceid$(BEXE) $(TOP)/VERSION
1113 $(TCLSH_CMD) $(TOP)/tool/mksqlite3h.tcl $(TOP) >sqlite3.h
1115 sqlite3rc.h: $(TOP)/src/sqlite3.rc $(TOP)/VERSION
1116 echo '#ifndef SQLITE_RESOURCE_VERSION' >$@
1117 echo -n '#define SQLITE_RESOURCE_VERSION ' >>$@
1118 cat $(TOP)/VERSION | $(TCLSH_CMD) $(TOP)/tool/replace.tcl exact . , >>$@
1119 echo '#endif' >>sqlite3rc.h
1121 keywordhash.h: $(TOP)/tool/mkkeywordhash.c
1122 $(BCC) -o mkkeywordhash$(BEXE) $(OPT_FEATURE_FLAGS) $(OPTS) $(TOP)/tool/mkkeywordhash.c
1123 ./mkkeywordhash$(BEXE) >keywordhash.h
1125 # Source files that go into making shell.c
1126 SHELL_SRC = \
1127 $(TOP)/src/shell.c.in \
1128 $(TOP)/ext/misc/appendvfs.c \
1129 $(TOP)/ext/misc/completion.c \
1130 $(TOP)/ext/misc/decimal.c \
1131 $(TOP)/ext/misc/fileio.c \
1132 $(TOP)/ext/misc/ieee754.c \
1133 $(TOP)/ext/misc/regexp.c \
1134 $(TOP)/ext/misc/series.c \
1135 $(TOP)/ext/misc/shathree.c \
1136 $(TOP)/ext/misc/sqlar.c \
1137 $(TOP)/ext/misc/uint.c \
1138 $(TOP)/ext/expert/sqlite3expert.c \
1139 $(TOP)/ext/expert/sqlite3expert.h \
1140 $(TOP)/ext/misc/zipfile.c \
1141 $(TOP)/ext/misc/memtrace.c \
1142 $(TOP)/src/test_windirent.c
1144 shell.c: $(SHELL_SRC) $(TOP)/tool/mkshellc.tcl
1145 $(TCLSH_CMD) $(TOP)/tool/mkshellc.tcl >shell.c
1150 # Rules to build the extension objects.
1152 icu.lo: $(TOP)/ext/icu/icu.c $(HDR) $(EXTHDR)
1153 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/icu/icu.c
1155 fts2.lo: $(TOP)/ext/fts2/fts2.c $(HDR) $(EXTHDR)
1156 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2.c
1158 fts2_hash.lo: $(TOP)/ext/fts2/fts2_hash.c $(HDR) $(EXTHDR)
1159 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_hash.c
1161 fts2_icu.lo: $(TOP)/ext/fts2/fts2_icu.c $(HDR) $(EXTHDR)
1162 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_icu.c
1164 fts2_porter.lo: $(TOP)/ext/fts2/fts2_porter.c $(HDR) $(EXTHDR)
1165 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_porter.c
1167 fts2_tokenizer.lo: $(TOP)/ext/fts2/fts2_tokenizer.c $(HDR) $(EXTHDR)
1168 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_tokenizer.c
1170 fts2_tokenizer1.lo: $(TOP)/ext/fts2/fts2_tokenizer1.c $(HDR) $(EXTHDR)
1171 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_tokenizer1.c
1173 fts3.lo: $(TOP)/ext/fts3/fts3.c $(HDR) $(EXTHDR)
1174 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3.c
1176 fts3_aux.lo: $(TOP)/ext/fts3/fts3_aux.c $(HDR) $(EXTHDR)
1177 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_aux.c
1179 fts3_expr.lo: $(TOP)/ext/fts3/fts3_expr.c $(HDR) $(EXTHDR)
1180 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_expr.c
1182 fts3_hash.lo: $(TOP)/ext/fts3/fts3_hash.c $(HDR) $(EXTHDR)
1183 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_hash.c
1185 fts3_icu.lo: $(TOP)/ext/fts3/fts3_icu.c $(HDR) $(EXTHDR)
1186 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_icu.c
1188 fts3_porter.lo: $(TOP)/ext/fts3/fts3_porter.c $(HDR) $(EXTHDR)
1189 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_porter.c
1191 fts3_snippet.lo: $(TOP)/ext/fts3/fts3_snippet.c $(HDR) $(EXTHDR)
1192 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_snippet.c
1194 fts3_tokenizer.lo: $(TOP)/ext/fts3/fts3_tokenizer.c $(HDR) $(EXTHDR)
1195 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer.c
1197 fts3_tokenizer1.lo: $(TOP)/ext/fts3/fts3_tokenizer1.c $(HDR) $(EXTHDR)
1198 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer1.c
1200 fts3_tokenize_vtab.lo: $(TOP)/ext/fts3/fts3_tokenize_vtab.c $(HDR) $(EXTHDR)
1201 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenize_vtab.c
1203 fts3_unicode.lo: $(TOP)/ext/fts3/fts3_unicode.c $(HDR) $(EXTHDR)
1204 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_unicode.c
1206 fts3_unicode2.lo: $(TOP)/ext/fts3/fts3_unicode2.c $(HDR) $(EXTHDR)
1207 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_unicode2.c
1209 fts3_write.lo: $(TOP)/ext/fts3/fts3_write.c $(HDR) $(EXTHDR)
1210 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_write.c
1212 rtree.lo: $(TOP)/ext/rtree/rtree.c $(HDR) $(EXTHDR)
1213 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/rtree/rtree.c
1215 userauth.lo: $(TOP)/ext/userauth/userauth.c $(HDR) $(EXTHDR)
1216 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/userauth/userauth.c
1218 sqlite3session.lo: $(TOP)/ext/session/sqlite3session.c $(HDR) $(EXTHDR)
1219 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/session/sqlite3session.c
1221 stmt.lo: $(TOP)/ext/misc/stmt.c
1222 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/misc/stmt.c
1224 # FTS5 things
1226 FTS5_SRC = \
1227 $(TOP)/ext/fts5/fts5.h \
1228 $(TOP)/ext/fts5/fts5Int.h \
1229 $(TOP)/ext/fts5/fts5_aux.c \
1230 $(TOP)/ext/fts5/fts5_buffer.c \
1231 $(TOP)/ext/fts5/fts5_main.c \
1232 $(TOP)/ext/fts5/fts5_config.c \
1233 $(TOP)/ext/fts5/fts5_expr.c \
1234 $(TOP)/ext/fts5/fts5_hash.c \
1235 $(TOP)/ext/fts5/fts5_index.c \
1236 fts5parse.c fts5parse.h \
1237 $(TOP)/ext/fts5/fts5_storage.c \
1238 $(TOP)/ext/fts5/fts5_tokenize.c \
1239 $(TOP)/ext/fts5/fts5_unicode2.c \
1240 $(TOP)/ext/fts5/fts5_varint.c \
1241 $(TOP)/ext/fts5/fts5_vocab.c \
1243 fts5parse.c: $(TOP)/ext/fts5/fts5parse.y lemon$(BEXE)
1244 cp $(TOP)/ext/fts5/fts5parse.y .
1245 rm -f fts5parse.h
1246 ./lemon$(BEXE) $(OPTS) -S fts5parse.y
1248 fts5parse.h: fts5parse.c
1250 fts5.c: $(FTS5_SRC)
1251 $(TCLSH_CMD) $(TOP)/ext/fts5/tool/mkfts5c.tcl
1252 cp $(TOP)/ext/fts5/fts5.h .
1254 fts5.lo: fts5.c $(HDR) $(EXTHDR)
1255 $(LTCOMPILE) -DSQLITE_CORE -c fts5.c
1257 sqlite3rbu.lo: $(TOP)/ext/rbu/sqlite3rbu.c $(HDR) $(EXTHDR)
1258 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/rbu/sqlite3rbu.c
1261 # Rules to build the 'testfixture' application.
1263 # If using the amalgamation, use sqlite3.c directly to build the test
1264 # fixture. Otherwise link against libsqlcipher.la. (This distinction is
1265 # necessary because the test fixture requires non-API symbols which are
1266 # hidden when the library is built via the amalgamation).
1268 TESTFIXTURE_FLAGS = -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
1269 TESTFIXTURE_FLAGS += -DTCLSH_INIT_PROC=sqlite3TestInit
1270 TESTFIXTURE_FLAGS += -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE
1271 TESTFIXTURE_FLAGS += -DBUILD_sqlite
1272 TESTFIXTURE_FLAGS += -DSQLITE_SERIES_CONSTRAINT_VERIFY=1
1273 TESTFIXTURE_FLAGS += -DSQLITE_DEFAULT_PAGE_SIZE=1024
1274 TESTFIXTURE_FLAGS += -DSQLITE_ENABLE_STMTVTAB
1275 TESTFIXTURE_FLAGS += -DSQLITE_ENABLE_DBPAGE_VTAB
1276 TESTFIXTURE_FLAGS += -DSQLITE_ENABLE_BYTECODE_VTAB
1277 TESTFIXTURE_FLAGS += -DSQLITE_CKSUMVFS_STATIC
1279 TESTFIXTURE_SRC0 = $(TESTSRC2) libsqlcipher.la
1280 TESTFIXTURE_SRC1 = sqlite3.c
1281 TESTFIXTURE_SRC = $(TESTSRC) $(TOP)/src/tclsqlite.c
1282 TESTFIXTURE_SRC += $(TESTFIXTURE_SRC$(USE_AMALGAMATION))
1284 testfixture$(TEXE): $(TESTFIXTURE_SRC)
1285 $(LTLINK) -DSQLITE_NO_SYNC=1 $(TEMP_STORE) $(TESTFIXTURE_FLAGS) \
1286 -o $@ $(TESTFIXTURE_SRC) $(LIBTCL) $(TLIBS)
1288 coretestprogs: $(TESTPROGS)
1290 testprogs: coretestprogs srcck1$(BEXE) fuzzcheck$(TEXE) sessionfuzz$(TEXE)
1292 # A very detailed test running most or all test cases
1293 fulltest: alltest fuzztest
1295 # Run most or all tcl test cases
1296 alltest: $(TESTPROGS)
1297 ./testfixture$(TEXE) $(TOP)/test/all.test $(TESTOPTS)
1299 # Really really long testing
1300 soaktest: $(TESTPROGS)
1301 ./testfixture$(TEXE) $(TOP)/test/all.test -soak=1 $(TESTOPTS)
1303 # Do extra testing but not everything.
1304 fulltestonly: $(TESTPROGS) fuzztest
1305 ./testfixture$(TEXE) $(TOP)/test/full.test
1307 # Fuzz testing
1308 fuzztest: fuzzcheck$(TEXE) $(FUZZDATA) sessionfuzz$(TEXE) $(TOP)/test/sessionfuzz-data1.db
1309 ./fuzzcheck$(TEXE) $(FUZZDATA)
1310 ./sessionfuzz$(TEXE) run $(TOP)/test/sessionfuzz-data1.db
1312 valgrindfuzz: fuzzcheck$(TEXT) $(FUZZDATA) sessionfuzz$(TEXE) $(TOP)/test/sessionfuzz-data1.db
1313 valgrind ./fuzzcheck$(TEXE) --cell-size-check --limit-mem 10M $(FUZZDATA)
1314 valgrind ./sessionfuzz$(TEXE) run $(TOP)/test/sessionfuzz-data1.db
1316 # The veryquick.test TCL tests.
1318 tcltest: ./testfixture$(TEXE)
1319 ./testfixture$(TEXE) $(TOP)/test/veryquick.test $(TESTOPTS)
1321 # Minimal testing that runs in less than 3 minutes
1323 quicktest: ./testfixture$(TEXE)
1324 ./testfixture$(TEXE) $(TOP)/test/extraquick.test $(TESTOPTS)
1326 # This is the common case. Run many tests that do not take too long,
1327 # including fuzzcheck, sqlite3_analyzer, and sqldiff tests.
1329 test: fuzztest sourcetest $(TESTPROGS) tcltest
1331 # Run a test using valgrind. This can take a really long time
1332 # because valgrind is so much slower than a native machine.
1334 valgrindtest: $(TESTPROGS) valgrindfuzz
1335 OMIT_MISUSE=1 valgrind -v ./testfixture$(TEXE) $(TOP)/test/permutations.test valgrind $(TESTOPTS)
1337 # A very fast test that checks basic sanity. The name comes from
1338 # the 60s-era electronics testing: "Turn it on and see if smoke
1339 # comes out."
1341 smoketest: $(TESTPROGS) fuzzcheck$(TEXE)
1342 ./testfixture$(TEXE) $(TOP)/test/main.test $(TESTOPTS)
1344 shelltest: $(TESTPROGS)
1345 ./testfixture$(TEXT) $(TOP)/test/permutations.test shell
1347 sqlite3_analyzer.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqlite3_analyzer.c.in
1348 $(TCLSH_CMD) $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqlite3_analyzer.c.in >sqlite3_analyzer.c
1350 sqlite3_analyzer$(TEXE): sqlite3_analyzer.c
1351 $(LTLINK) sqlite3_analyzer.c -o $@ $(LIBTCL) $(TLIBS)
1353 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
1354 $(TCLSH_CMD) $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqltclsh.c.in >sqltclsh.c
1356 sqltclsh$(TEXE): sqltclsh.c
1357 $(LTLINK) sqltclsh.c -o $@ $(LIBTCL) $(TLIBS)
1359 sqlite3_expert$(TEXE): $(TOP)/ext/expert/sqlite3expert.h $(TOP)/ext/expert/sqlite3expert.c $(TOP)/ext/expert/expert.c sqlite3.c
1360 $(LTLINK) $(TOP)/ext/expert/sqlite3expert.h $(TOP)/ext/expert/sqlite3expert.c $(TOP)/ext/expert/expert.c sqlite3.c -o sqlite3_expert $(TLIBS)
1362 CHECKER_DEPS =\
1363 $(TOP)/tool/mkccode.tcl \
1364 sqlite3.c \
1365 $(TOP)/src/tclsqlite.c \
1366 $(TOP)/ext/repair/sqlite3_checker.tcl \
1367 $(TOP)/ext/repair/checkindex.c \
1368 $(TOP)/ext/repair/checkfreelist.c \
1369 $(TOP)/ext/misc/btreeinfo.c \
1370 $(TOP)/ext/repair/sqlite3_checker.c.in
1372 sqlite3_checker.c: $(CHECKER_DEPS)
1373 $(TCLSH_CMD) $(TOP)/tool/mkccode.tcl $(TOP)/ext/repair/sqlite3_checker.c.in >$@
1375 sqlite3_checker$(TEXE): sqlite3_checker.c
1376 $(LTLINK) sqlite3_checker.c -o $@ $(LIBTCL) $(TLIBS)
1378 dbdump$(TEXE): $(TOP)/ext/misc/dbdump.c sqlite3.lo
1379 $(LTLINK) -DDBDUMP_STANDALONE -o $@ \
1380 $(TOP)/ext/misc/dbdump.c sqlite3.lo $(TLIBS)
1382 dbtotxt$(TEXE): $(TOP)/tool/dbtotxt.c
1383 $(LTLINK)-o $@ $(TOP)/tool/dbtotxt.c
1385 showdb$(TEXE): $(TOP)/tool/showdb.c sqlite3.lo
1386 $(LTLINK) -o $@ $(TOP)/tool/showdb.c sqlite3.lo $(TLIBS)
1388 showstat4$(TEXE): $(TOP)/tool/showstat4.c sqlite3.lo
1389 $(LTLINK) -o $@ $(TOP)/tool/showstat4.c sqlite3.lo $(TLIBS)
1391 showjournal$(TEXE): $(TOP)/tool/showjournal.c sqlite3.lo
1392 $(LTLINK) -o $@ $(TOP)/tool/showjournal.c sqlite3.lo $(TLIBS)
1394 showwal$(TEXE): $(TOP)/tool/showwal.c sqlite3.lo
1395 $(LTLINK) -o $@ $(TOP)/tool/showwal.c sqlite3.lo $(TLIBS)
1397 showshm$(TEXE): $(TOP)/tool/showshm.c
1398 $(LTLINK) -o $@ $(TOP)/tool/showshm.c
1400 index_usage$(TEXE): $(TOP)/tool/index_usage.c sqlite3.lo
1401 $(LTLINK) $(SHELL_OPT) -o $@ $(TOP)/tool/index_usage.c sqlite3.lo $(TLIBS)
1403 changeset$(TEXE): $(TOP)/ext/session/changeset.c sqlite3.lo
1404 $(LTLINK) -o $@ $(TOP)/ext/session/changeset.c sqlite3.lo $(TLIBS)
1406 changesetfuzz$(TEXE): $(TOP)/ext/session/changesetfuzz.c sqlite3.lo
1407 $(LTLINK) -o $@ $(TOP)/ext/session/changesetfuzz.c sqlite3.lo $(TLIBS)
1409 rollback-test$(TEXE): $(TOP)/tool/rollback-test.c sqlite3.lo
1410 $(LTLINK) -o $@ $(TOP)/tool/rollback-test.c sqlite3.lo $(TLIBS)
1412 atrc$(TEXX): $(TOP)/test/atrc.c sqlite3.lo
1413 $(LTLINK) -o $@ $(TOP)/test/atrc.c sqlite3.lo $(TLIBS)
1415 LogEst$(TEXE): $(TOP)/tool/logest.c sqlite3.h
1416 $(LTLINK) -I. -o $@ $(TOP)/tool/logest.c
1418 wordcount$(TEXE): $(TOP)/test/wordcount.c sqlite3.lo
1419 $(LTLINK) -o $@ $(TOP)/test/wordcount.c sqlite3.lo $(TLIBS)
1421 speedtest1$(TEXE): $(TOP)/test/speedtest1.c sqlite3.c
1422 $(LTLINK) $(ST_OPT) -o $@ $(TOP)/test/speedtest1.c sqlite3.c $(TLIBS)
1424 startup$(TEXE): $(TOP)/test/startup.c sqlite3.c
1425 $(CC) -Os -g -DSQLITE_THREADSAFE=0 -o $@ $(TOP)/test/startup.c sqlite3.c $(TLIBS)
1427 KV_OPT += -DSQLITE_DIRECT_OVERFLOW_READ
1429 kvtest$(TEXE): $(TOP)/test/kvtest.c sqlite3.c
1430 $(LTLINK) $(KV_OPT) -o $@ $(TOP)/test/kvtest.c sqlite3.c $(TLIBS)
1432 rbu$(EXE): $(TOP)/ext/rbu/rbu.c $(TOP)/ext/rbu/sqlite3rbu.c sqlite3.lo
1433 $(LTLINK) -I. -o $@ $(TOP)/ext/rbu/rbu.c sqlite3.lo $(TLIBS)
1435 loadfts$(EXE): $(TOP)/tool/loadfts.c libsqlite3.la
1436 $(LTLINK) $(TOP)/tool/loadfts.c libsqlite3.la -o $@ $(TLIBS)
1438 # This target will fail if the SQLite amalgamation contains any exported
1439 # symbols that do not begin with "sqlite3_". It is run as part of the
1440 # releasetest.tcl script.
1442 VALIDIDS=' sqlite3(changeset|changegroup|session)?_'
1443 checksymbols: sqlite3.o
1444 nm -g --defined-only sqlite3.o
1445 nm -g --defined-only sqlite3.o | egrep -v $(VALIDIDS); test $$? -ne 0
1446 echo '0 errors out of 1 tests'
1448 # Build the amalgamation-autoconf package. The amalamgation-tarball target builds
1449 # a tarball named for the version number. Ex: sqlite-autoconf-3110000.tar.gz.
1450 # The snapshot-tarball target builds a tarball named by the SHA1 hash
1452 amalgamation-tarball: sqlite3.c sqlite3rc.h
1453 TOP=$(TOP) sh $(TOP)/tool/mkautoconfamal.sh --normal
1455 snapshot-tarball: sqlite3.c sqlite3rc.h
1456 TOP=$(TOP) sh $(TOP)/tool/mkautoconfamal.sh --snapshot
1458 # The next two rules are used to support the "threadtest" target. Building
1459 # threadtest runs a few thread-safety tests that are implemented in C. This
1460 # target is invoked by the releasetest.tcl script.
1462 THREADTEST3_SRC = $(TOP)/test/threadtest3.c \
1463 $(TOP)/test/tt3_checkpoint.c \
1464 $(TOP)/test/tt3_index.c \
1465 $(TOP)/test/tt3_vacuum.c \
1466 $(TOP)/test/tt3_stress.c \
1467 $(TOP)/test/tt3_lookaside1.c
1469 threadtest3$(TEXE): sqlite3.lo $(THREADTEST3_SRC)
1470 $(LTLINK) $(TOP)/test/threadtest3.c $(TOP)/src/test_multiplex.c sqlite3.lo -o $@ $(TLIBS)
1472 threadtest: threadtest3$(TEXE)
1473 ./threadtest3$(TEXE)
1475 threadtest5: sqlite3.c $(TOP)/test/threadtest5.c
1476 $(LTLINK) $(TOP)/test/threadtest5.c sqlite3.c -o $@ $(TLIBS)
1478 releasetest:
1479 $(TCLSH_CMD) $(TOP)/test/releasetest.tcl
1481 # Standard install and cleanup targets
1483 lib_install: libsqlcipher.la
1484 $(INSTALL) -d $(DESTDIR)$(libdir)
1485 $(LTINSTALL) libsqlcipher.la $(DESTDIR)$(libdir)
1487 install: sqlcipher$(TEXE) lib_install sqlite3.h sqlcipher.pc ${HAVE_TCL:1=tcl_install}
1488 $(INSTALL) -d $(DESTDIR)$(bindir)
1489 $(LTINSTALL) sqlcipher$(TEXE) $(DESTDIR)$(bindir)
1490 $(INSTALL) -d $(DESTDIR)$(includedir)
1491 $(INSTALL) -m 0644 sqlite3.h $(DESTDIR)$(includedir)
1492 $(INSTALL) -m 0644 $(TOP)/src/sqlite3ext.h $(DESTDIR)$(includedir)
1493 $(INSTALL) -d $(DESTDIR)$(pkgconfigdir)
1494 $(INSTALL) -m 0644 sqlcipher.pc $(DESTDIR)$(pkgconfigdir)
1496 pkgIndex.tcl:
1497 echo 'package ifneeded sqlite3 $(RELEASE) [list load [file join $$dir libtclsqlite3[info sharedlibextension]] sqlite3]' > $@
1498 tcl_install: lib_install libtclsqlite3.la pkgIndex.tcl
1499 $(INSTALL) -d $(DESTDIR)$(TCLLIBDIR)
1500 $(LTINSTALL) libtclsqlite3.la $(DESTDIR)$(TCLLIBDIR)
1501 rm -f $(DESTDIR)$(TCLLIBDIR)/libtclsqlite3.la $(DESTDIR)$(TCLLIBDIR)/libtclsqlite3.a
1502 $(INSTALL) -m 0644 pkgIndex.tcl $(DESTDIR)$(TCLLIBDIR)
1504 clean:
1505 rm -f *.lo *.la *.o sqlcipher$(TEXE) libsqlcipher.la
1506 rm -f sqlite3.h opcodes.*
1507 rm -rf .libs .deps
1508 rm -f lemon$(BEXE) lempar.c parse.* sqlite*.tar.gz
1509 rm -f mkkeywordhash$(BEXE) keywordhash.h
1510 rm -f *.da *.bb *.bbg gmon.out
1511 rm -rf tsrc .target_source
1512 rm -f tclsqlcipher$(TEXE)
1513 rm -f testfixture$(TEXE) test.db
1514 rm -f LogEst$(TEXE) fts3view$(TEXE) rollback-test$(TEXE) showdb$(TEXE)
1515 rm -f showjournal$(TEXE) showstat4$(TEXE) showwal$(TEXE) speedtest1$(TEXE)
1516 rm -f wordcount$(TEXE) changeset$(TEXE)
1517 rm -f sqlite3.dll sqlite3.lib sqlite3.exp sqlite3.def
1518 rm -f sqlite3.c
1519 rm -f sqlite3rc.h
1520 rm -f shell.c sqlite3ext.h
1521 rm -f sqlite3_analyzer$(TEXE) sqlite3_analyzer.c
1522 rm -f sqlite-*-output.vsix
1523 rm -f mptester mptester.exe
1524 rm -f rbu rbu.exe
1525 rm -f srcck1 srcck1.exe
1526 rm -f fuzzershell fuzzershell.exe
1527 rm -f fuzzcheck fuzzcheck.exe
1528 rm -f sqldiff sqldiff.exe
1529 rm -f dbhash dbhash.exe
1530 rm -f fts5.* fts5parse.*
1531 rm -f threadtest5
1533 distclean: clean
1534 rm -f config.h config.log config.status libtool Makefile sqlite3.pc \
1535 $(TESTPROGS)
1538 # Windows section
1540 dll: sqlite3.dll
1542 REAL_LIBOBJ = $(LIBOBJ:%.lo=.libs/%.o)
1544 $(REAL_LIBOBJ): $(LIBOBJ)
1546 sqlite3.def: $(REAL_LIBOBJ)
1547 echo 'EXPORTS' >sqlite3.def
1548 nm $(REAL_LIBOBJ) | grep ' T ' | grep ' _sqlite3_' \
1549 | sed 's/^.* _//' >>sqlite3.def
1551 sqlite3.dll: $(REAL_LIBOBJ) sqlite3.def
1552 $(TCC) -shared -o $@ sqlite3.def \
1553 -Wl,"--strip-all" $(REAL_LIBOBJ)
1557 # fiddle/wasm section
1559 fiddle_dir = ext/fiddle
1560 fiddle_dir_abs = $(TOP)/$(fiddle_dir)
1561 # ^^^ some emcc opts require absolute paths
1562 fiddle_html = $(fiddle_dir)/fiddle.html
1563 fiddle_module_js = $(fiddle_dir)/fiddle-module.js
1564 sqlite3_wasm_js = $(fiddle_dir)/sqlite3.js
1565 sqlite3_wasm = $(fiddle_dir)/sqlite3.wasm
1566 #emcc_opt = -O0
1567 #emcc_opt = -O1
1568 #emcc_opt = -O2
1569 #emcc_opt = -O3
1570 emcc_opt = -Oz
1571 emcc_flags = $(emcc_opt) -sALLOW_TABLE_GROWTH -sSTRICT_JS \
1572 -sENVIRONMENT=web -sMODULARIZE \
1573 -sEXPORTED_RUNTIME_METHODS=@$(fiddle_dir_abs)/EXPORTED_RUNTIME_METHODS \
1574 -sDYNAMIC_EXECUTION=0 \
1575 -I. $(SHELL_OPT)
1576 $(fiddle_module_js): Makefile sqlite3.c shell.c \
1577 $(fiddle_dir)/EXPORTED_RUNTIME_METHODS \
1578 $(fiddle_dir)/EXPORTED_FUNCTIONS.fiddle
1579 emcc -o $@ $(emcc_flags) \
1580 -sEXPORT_NAME=initFiddleModule \
1581 -sEXPORTED_FUNCTIONS=@$(fiddle_dir_abs)/EXPORTED_FUNCTIONS.fiddle \
1582 sqlite3.c shell.c
1583 gzip < $@ > $@.gz
1584 gzip < $(fiddle_dir)/fiddle-module.wasm > $(fiddle_dir)/fiddle-module.wasm.gz
1585 $(sqlite3_wasm_js): Makefile sqlite3.c \
1586 $(fiddle_dir)/sqlite3-api.js \
1587 $(fiddle_dir)/EXPORTED_RUNTIME_METHODS \
1588 $(fiddle_dir)/EXPORTED_FUNCTIONS.sqlite3-api
1589 emcc -o $@ $(emcc_flags) \
1590 -sEXPORT_NAME=initSqlite3Module \
1591 -sEXPORTED_FUNCTIONS=@$(fiddle_dir_abs)/EXPORTED_FUNCTIONS.sqlite3-api \
1592 --post-js=$(fiddle_dir)/sqlite3-api.js \
1593 --no-entry \
1594 sqlite3.c
1595 gzip < $@ > $@.gz
1596 gzip < $(sqlite3_wasm) > $(sqlite3_wasm).gz
1597 gzip < $(fiddle_dir)/sqlite3-api.js > $(fiddle_dir)/sqlite3-api.js.gz
1598 $(fiddle_dir)/fiddle.js.gz: $(fiddle_dir)/fiddle.js
1599 gzip < $< > $@
1600 $(fiddle_dir)/sqlite3-api.js.gz: $(fiddle_dir)/sqlite3-api.js
1601 gzip < $< > $@
1603 fiddle_generated = $(fiddle_module_js) $(fiddle_module_js).gz \
1604 $(fiddle_dir)/fiddle-module.wasm \
1605 $(fiddle_dir)/fiddle-module.wasm.gz \
1606 $(fiddle_dir)/fiddle.js.gz
1607 sqlite3_wasm_generated = \
1608 $(sqlite3_wasm) $(sqlite3_wasm).gz \
1609 $(sqlite3_wasm_js) $(sqlite3_wasm_js).gz \
1610 $(fiddle_dir)/sqlite3.js.gz \
1611 $(fiddle_dir)/sqlite3-api.js.gz
1613 clean-wasm:
1614 rm -f $(fiddle_generated) $(sqlite3_wasm_generated)
1615 clean: clean-wasm
1616 fiddle: $(fiddle_module_js) $(fiddle_dir)/fiddle.js.gz
1617 sqlite3-wasm: $(sqlite3_wasm_js)
1618 wasm: fiddle sqlite3-wasm
1619 ########################################################################
1620 # Explanation of the emcc build flags follows. Full docs for these can
1621 # be found at:
1623 # https://github.com/emscripten-core/emscripten/blob/main/src/settings.js
1625 # -sENVIRONMENT=web: elides bootstrap code related to non-web JS
1626 # environments like node.js. Removing this makes the output a tiny
1627 # tick larger but hypothetically makes it more portable to
1628 # non-browser JS environments.
1630 # -sMODULARIZE: changes how the generated code is structured to avoid
1631 # declaring a global Module object and instead installing a function
1632 # which loads and initialized the module. The function is named...
1634 # -sEXPORT_NAME=jsFunctionName (see -sMODULARIZE)
1636 # -sEXPORTED_RUNTIME_METHODS=@/absolute/path/to/file: a file
1637 # containing a list of emscripten-supplied APIs, one per line, which
1638 # must be exported into the generated JS. Must be an absolute path!
1640 # -sEXPORTED_FUNCTIONS=@/absolute/path/to/file: a file containing a
1641 # list of C functions, one per line, which must be exported via wasm
1642 # so they're visible to JS. C symbols names in that file must all
1643 # start with an underscore for reasons known only to the emcc
1644 # developers. e.g., _sqlite3_open_v2 and _sqlite3_finalize. Must be
1645 # an absolute path!
1647 # -sSTRICT_JS ensures that the emitted JS code includes the 'use
1648 # strict' option. Note that -sSTRICT is more broadly-scoped and
1649 # results in build errors.
1651 # -sALLOW_TABLE_GROWTH is required for (at a minimum) the UDF-binding
1652 # feature.
1654 # -sDYNAMIC_EXECUTION=0 disables eval() and the Function constructor.
1655 # If the build runs without these, it's preferable to use this flag
1656 # because certain execution environments disallow those constructs.
1657 # This flag is not strictly necessary, however.
1659 # -sWASM_BIGINT is UNTESTED but "should" allow the int64-using C APIs
1660 # to work with JS/wasm, insofar as the JS environment supports the
1661 # BigInt type. That support requires an extremely recent browser:
1662 # Safari didn't get that support until late 2020.
1664 # --no-entry: for compiling library code with no main(). If this is
1665 # not supplied and the code has a main(), it is called as part of the
1666 # module init process. Note that main() is #if'd out of shell.c
1667 # (renamed) when building in wasm mode.
1669 # --pre-js/--post-js=FILE relative or absolute paths to JS files to
1670 # prepend/append to the emcc-generated bootstrapping JS. It's
1671 # easier/faster to develop with separate JS files (reduces rebuilding
1672 # requirements) but certain configurations, namely -sMODULARIZE, may
1673 # require using at least a --pre-js file. They can be used
1674 # individually and need not be paired.
1676 # -O0..-O3 and -Oz: optimization levels affect not only C-style
1677 # optimization but whether or not the resulting generated JS code
1678 # gets minified. -O0 compiles _much_ more quickly than -O3 or -Oz,
1679 # and doesn't minimize any JS code, so is recommended for
1680 # development. -O3 or -Oz are recommended for deployment, but
1681 # primarily because -Oz will shrink the wasm file notably. JS-side
1682 # minification makes little difference in terms of overall
1683 # distributable size.
1684 ########################################################################