update README with description of SQLCipher as a fork of SQLite
[sqlcipher.git] / Makefile.in
blobad4be7b8679f54941d7b91071ce37ad947555b30
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 json1.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/legacy.c \
260 $(TOP)/src/loadext.c \
261 $(TOP)/src/main.c \
262 $(TOP)/src/malloc.c \
263 $(TOP)/src/mem0.c \
264 $(TOP)/src/mem1.c \
265 $(TOP)/src/mem2.c \
266 $(TOP)/src/mem3.c \
267 $(TOP)/src/mem5.c \
268 $(TOP)/src/memdb.c \
269 $(TOP)/src/memjournal.c \
270 $(TOP)/src/msvc.h \
271 $(TOP)/src/mutex.c \
272 $(TOP)/src/mutex.h \
273 $(TOP)/src/mutex_noop.c \
274 $(TOP)/src/mutex_unix.c \
275 $(TOP)/src/mutex_w32.c \
276 $(TOP)/src/notify.c \
277 $(TOP)/src/os.c \
278 $(TOP)/src/os.h \
279 $(TOP)/src/os_common.h \
280 $(TOP)/src/os_setup.h \
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/fts1/fts1.c \
340 $(TOP)/ext/fts1/fts1.h \
341 $(TOP)/ext/fts1/fts1_hash.c \
342 $(TOP)/ext/fts1/fts1_hash.h \
343 $(TOP)/ext/fts1/fts1_porter.c \
344 $(TOP)/ext/fts1/fts1_tokenizer.h \
345 $(TOP)/ext/fts1/fts1_tokenizer1.c
346 SRC += \
347 $(TOP)/ext/fts2/fts2.c \
348 $(TOP)/ext/fts2/fts2.h \
349 $(TOP)/ext/fts2/fts2_hash.c \
350 $(TOP)/ext/fts2/fts2_hash.h \
351 $(TOP)/ext/fts2/fts2_icu.c \
352 $(TOP)/ext/fts2/fts2_porter.c \
353 $(TOP)/ext/fts2/fts2_tokenizer.h \
354 $(TOP)/ext/fts2/fts2_tokenizer.c \
355 $(TOP)/ext/fts2/fts2_tokenizer1.c
356 SRC += \
357 $(TOP)/ext/fts3/fts3.c \
358 $(TOP)/ext/fts3/fts3.h \
359 $(TOP)/ext/fts3/fts3Int.h \
360 $(TOP)/ext/fts3/fts3_aux.c \
361 $(TOP)/ext/fts3/fts3_expr.c \
362 $(TOP)/ext/fts3/fts3_hash.c \
363 $(TOP)/ext/fts3/fts3_hash.h \
364 $(TOP)/ext/fts3/fts3_icu.c \
365 $(TOP)/ext/fts3/fts3_porter.c \
366 $(TOP)/ext/fts3/fts3_snippet.c \
367 $(TOP)/ext/fts3/fts3_tokenizer.h \
368 $(TOP)/ext/fts3/fts3_tokenizer.c \
369 $(TOP)/ext/fts3/fts3_tokenizer1.c \
370 $(TOP)/ext/fts3/fts3_tokenize_vtab.c \
371 $(TOP)/ext/fts3/fts3_unicode.c \
372 $(TOP)/ext/fts3/fts3_unicode2.c \
373 $(TOP)/ext/fts3/fts3_write.c
374 SRC += \
375 $(TOP)/ext/icu/sqliteicu.h \
376 $(TOP)/ext/icu/icu.c
377 SRC += \
378 $(TOP)/ext/rtree/rtree.h \
379 $(TOP)/ext/rtree/rtree.c \
380 $(TOP)/ext/rtree/geopoly.c
381 SRC += \
382 $(TOP)/ext/session/sqlite3session.c \
383 $(TOP)/ext/session/sqlite3session.h
384 SRC += \
385 $(TOP)/ext/userauth/userauth.c \
386 $(TOP)/ext/userauth/sqlite3userauth.h
387 SRC += \
388 $(TOP)/ext/rbu/sqlite3rbu.h \
389 $(TOP)/ext/rbu/sqlite3rbu.c
390 SRC += \
391 $(TOP)/ext/misc/json1.c \
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/regexp.c \
486 $(TOP)/ext/misc/remember.c \
487 $(TOP)/ext/misc/series.c \
488 $(TOP)/ext/misc/spellfix.c \
489 $(TOP)/ext/misc/totype.c \
490 $(TOP)/ext/misc/unionvtab.c \
491 $(TOP)/ext/misc/wholenumber.c \
492 $(TOP)/ext/misc/zipfile.c \
493 $(TOP)/ext/userauth/userauth.c \
494 $(TOP)/ext/rtree/test_rtreedoc.c
496 # Source code to the library files needed by the test fixture
498 TESTSRC2 = \
499 $(TOP)/src/attach.c \
500 $(TOP)/src/backup.c \
501 $(TOP)/src/bitvec.c \
502 $(TOP)/src/btree.c \
503 $(TOP)/src/build.c \
504 $(TOP)/src/ctime.c \
505 $(TOP)/src/date.c \
506 $(TOP)/src/dbpage.c \
507 $(TOP)/src/dbstat.c \
508 $(TOP)/src/expr.c \
509 $(TOP)/src/func.c \
510 $(TOP)/src/global.c \
511 $(TOP)/src/insert.c \
512 $(TOP)/src/wal.c \
513 $(TOP)/src/main.c \
514 $(TOP)/src/mem5.c \
515 $(TOP)/src/os.c \
516 $(TOP)/src/os_unix.c \
517 $(TOP)/src/os_win.c \
518 $(TOP)/src/pager.c \
519 $(TOP)/src/pragma.c \
520 $(TOP)/src/prepare.c \
521 $(TOP)/src/printf.c \
522 $(TOP)/src/random.c \
523 $(TOP)/src/pcache.c \
524 $(TOP)/src/pcache1.c \
525 $(TOP)/src/select.c \
526 $(TOP)/src/tokenize.c \
527 $(TOP)/src/utf.c \
528 $(TOP)/src/util.c \
529 $(TOP)/src/vdbeapi.c \
530 $(TOP)/src/vdbeaux.c \
531 $(TOP)/src/vdbe.c \
532 $(TOP)/src/vdbemem.c \
533 $(TOP)/src/vdbetrace.c \
534 $(TOP)/src/vdbevtab.c \
535 $(TOP)/src/where.c \
536 $(TOP)/src/wherecode.c \
537 $(TOP)/src/whereexpr.c \
538 $(TOP)/src/window.c \
539 parse.c \
540 $(TOP)/ext/fts3/fts3.c \
541 $(TOP)/ext/fts3/fts3_aux.c \
542 $(TOP)/ext/fts3/fts3_expr.c \
543 $(TOP)/ext/fts3/fts3_term.c \
544 $(TOP)/ext/fts3/fts3_tokenizer.c \
545 $(TOP)/ext/fts3/fts3_write.c \
546 $(TOP)/ext/async/sqlite3async.c \
547 $(TOP)/ext/session/sqlite3session.c \
548 $(TOP)/ext/misc/stmt.c \
549 fts5.c
551 # Header files used by all library source files.
553 HDR = \
554 $(TOP)/src/btree.h \
555 $(TOP)/src/btreeInt.h \
556 $(TOP)/src/hash.h \
557 $(TOP)/src/hwtime.h \
558 keywordhash.h \
559 $(TOP)/src/msvc.h \
560 $(TOP)/src/mutex.h \
561 opcodes.h \
562 $(TOP)/src/os.h \
563 $(TOP)/src/os_common.h \
564 $(TOP)/src/os_setup.h \
565 $(TOP)/src/os_win.h \
566 $(TOP)/src/pager.h \
567 $(TOP)/src/pcache.h \
568 parse.h \
569 $(TOP)/src/pragma.h \
570 sqlite3.h \
571 $(TOP)/src/sqlite3ext.h \
572 $(TOP)/src/sqliteInt.h \
573 $(TOP)/src/sqliteLimit.h \
574 $(TOP)/src/vdbe.h \
575 $(TOP)/src/vdbeInt.h \
576 $(TOP)/src/vxworks.h \
577 $(TOP)/src/whereInt.h \
578 config.h
580 # Header files used by extensions
582 EXTHDR += \
583 $(TOP)/ext/fts1/fts1.h \
584 $(TOP)/ext/fts1/fts1_hash.h \
585 $(TOP)/ext/fts1/fts1_tokenizer.h
586 EXTHDR += \
587 $(TOP)/ext/fts2/fts2.h \
588 $(TOP)/ext/fts2/fts2_hash.h \
589 $(TOP)/ext/fts2/fts2_tokenizer.h
590 EXTHDR += \
591 $(TOP)/ext/fts3/fts3.h \
592 $(TOP)/ext/fts3/fts3Int.h \
593 $(TOP)/ext/fts3/fts3_hash.h \
594 $(TOP)/ext/fts3/fts3_tokenizer.h
595 EXTHDR += \
596 $(TOP)/ext/rtree/rtree.h \
597 $(TOP)/ext/rtree/geopoly.c
598 EXTHDR += \
599 $(TOP)/ext/icu/sqliteicu.h
600 EXTHDR += \
601 $(TOP)/ext/rtree/sqlite3rtree.h
602 EXTHDR += \
603 $(TOP)/ext/userauth/sqlite3userauth.h
605 # executables needed for testing
607 TESTPROGS = \
608 testfixture$(TEXE) \
609 sqlite3$(TEXE) \
610 sqlite3_analyzer$(TEXE) \
611 sqldiff$(TEXE) \
612 dbhash$(TEXE) \
613 sqltclsh$(TEXE)
615 # Databases containing fuzzer test cases
617 FUZZDATA = \
618 $(TOP)/test/fuzzdata1.db \
619 $(TOP)/test/fuzzdata2.db \
620 $(TOP)/test/fuzzdata3.db \
621 $(TOP)/test/fuzzdata4.db \
622 $(TOP)/test/fuzzdata5.db \
623 $(TOP)/test/fuzzdata6.db \
624 $(TOP)/test/fuzzdata7.db \
625 $(TOP)/test/fuzzdata8.db
627 # Standard options to testfixture
629 TESTOPTS = --verbose=file --output=test-out.txt
631 # Extra compiler options for various shell tools
633 SHELL_OPT = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS4
634 #SHELL_OPT += -DSQLITE_ENABLE_FTS5
635 SHELL_OPT += -DSQLITE_ENABLE_RTREE
636 SHELL_OPT += -DSQLITE_ENABLE_EXPLAIN_COMMENTS
637 SHELL_OPT += -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
638 SHELL_OPT += -DSQLITE_ENABLE_STMTVTAB
639 SHELL_OPT += -DSQLITE_ENABLE_DBPAGE_VTAB
640 SHELL_OPT += -DSQLITE_ENABLE_DBSTAT_VTAB
641 SHELL_OPT += -DSQLITE_ENABLE_BYTECODE_VTAB
642 SHELL_OPT += -DSQLITE_ENABLE_OFFSET_SQL_FUNC
643 FUZZERSHELL_OPT = -DSQLITE_ENABLE_JSON1
644 FUZZCHECK_OPT = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMSYS5 -DSQLITE_OSS_FUZZ
645 FUZZCHECK_OPT += -DSQLITE_MAX_MEMORY=50000000
646 FUZZCHECK_OPT += -DSQLITE_PRINTF_PRECISION_LIMIT=1000
647 FUZZCHECK_OPT += -DSQLITE_ENABLE_FTS4
648 FUZZCHECK_OPT += -DSQLITE_ENABLE_FTS3_PARENTHESIS
649 FUZZCHECK_OPT += -DSQLITE_ENABLE_FTS5
650 FUZZCHECK_OPT += -DSQLITE_ENABLE_RTREE
651 FUZZCHECK_OPT += -DSQLITE_ENABLE_GEOPOLY
652 FUZZCHECK_OPT += -DSQLITE_ENABLE_DBSTAT_VTAB
653 FUZZCHECK_OPT += -DSQLITE_ENABLE_BYTECODE_VTAB
654 FUZZCHECK_SRC = $(TOP)/test/fuzzcheck.c $(TOP)/test/ossfuzz.c
655 DBFUZZ_OPT =
657 # This is the default Makefile target. The objects listed here
658 # are what get build when you type just "make" with no arguments.
660 all: sqlite3.h libsqlcipher.la sqlcipher$(TEXE) $(HAVE_TCL:1=libtclsqlite3.la)
662 Makefile: $(TOP)/Makefile.in
663 ./config.status
665 sqlcipher.pc: $(TOP)/sqlcipher.pc.in
666 ./config.status
668 libsqlcipher.la: $(LIBOBJ)
669 $(LTLINK) -no-undefined -o $@ $(LIBOBJ) $(TLIBS) \
670 ${ALLOWRELEASE} -rpath "$(libdir)" -version-info "8:6:8"
672 libtclsqlite3.la: tclsqlite.lo libsqlcipher.la
673 $(LTLINK) -no-undefined -o $@ tclsqlite.lo \
674 libsqlcipher.la @TCL_STUB_LIB_SPEC@ $(TLIBS) \
675 -rpath "$(TCLLIBDIR)" \
676 -version-info "8:6:8" \
677 -avoid-version
679 sqlcipher$(TEXE): shell.c sqlite3.c
680 $(LTLINK) $(READLINE_FLAGS) $(SHELL_OPT) -o $@ \
681 shell.c sqlite3.c \
682 $(LIBREADLINE) $(TLIBS) -rpath "$(libdir)"
684 sqldiff$(TEXE): $(TOP)/tool/sqldiff.c sqlite3.lo sqlite3.h
685 $(LTLINK) -o $@ $(TOP)/tool/sqldiff.c sqlite3.lo $(TLIBS)
687 dbhash$(TEXE): $(TOP)/tool/dbhash.c sqlite3.lo sqlite3.h
688 $(LTLINK) -o $@ $(TOP)/tool/dbhash.c sqlite3.lo $(TLIBS)
690 scrub$(TEXE): $(TOP)/ext/misc/scrub.c sqlite3.lo
691 $(LTLINK) -o $@ -I. -DSCRUB_STANDALONE \
692 $(TOP)/ext/misc/scrub.c sqlite3.lo $(TLIBS)
694 srcck1$(BEXE): $(TOP)/tool/srcck1.c
695 $(BCC) -o srcck1$(BEXE) $(TOP)/tool/srcck1.c
697 sourcetest: srcck1$(BEXE) sqlite3.c
698 ./srcck1 sqlite3.c
700 fuzzershell$(TEXE): $(TOP)/tool/fuzzershell.c sqlite3.c sqlite3.h
701 $(LTLINK) -o $@ $(FUZZERSHELL_OPT) \
702 $(TOP)/tool/fuzzershell.c sqlite3.c $(TLIBS)
704 fuzzcheck$(TEXE): $(FUZZCHECK_SRC) sqlite3.c sqlite3.h
705 $(LTLINK) -o $@ $(FUZZCHECK_OPT) $(FUZZCHECK_SRC) sqlite3.c $(TLIBS)
707 ossshell$(TEXE): $(TOP)/test/ossfuzz.c $(TOP)/test/ossshell.c sqlite3.c sqlite3.h
708 $(LTLINK) -o $@ $(FUZZCHECK_OPT) $(TOP)/test/ossshell.c \
709 $(TOP)/test/ossfuzz.c sqlite3.c $(TLIBS)
711 sessionfuzz$(TEXE): $(TOP)/test/sessionfuzz.c sqlite3.c sqlite3.h
712 $(LTLINK) -o $@ $(TOP)/test/sessionfuzz.c $(TLIBS)
714 dbfuzz$(TEXE): $(TOP)/test/dbfuzz.c sqlite3.c sqlite3.h
715 $(LTLINK) -o $@ $(DBFUZZ_OPT) $(TOP)/test/dbfuzz.c sqlite3.c $(TLIBS)
717 DBFUZZ2_OPTS = \
718 -DSQLITE_THREADSAFE=0 \
719 -DSQLITE_OMIT_LOAD_EXTENSION \
720 -DSQLITE_DEBUG \
721 -DSQLITE_ENABLE_DBSTAT_VTAB \
722 -DSQLITE_ENABLE_BYTECODE_VTAB \
723 -DSQLITE_ENABLE_RTREE \
724 -DSQLITE_ENABLE_FTS4 \
725 -DSQLITE_ENABLE_FTS5
727 dbfuzz2$(TEXE): $(TOP)/test/dbfuzz2.c sqlite3.c sqlite3.h
728 $(CC) $(OPT_FEATURE_FLAGS) $(OPTS) -I. -g -O0 \
729 -DSTANDALONE -o dbfuzz2 \
730 $(DBFUZZ2_OPTS) $(TOP)/test/dbfuzz2.c sqlite3.c $(TLIBS)
731 mkdir -p dbfuzz2-dir
732 cp $(TOP)/test/dbfuzz2-seed* dbfuzz2-dir
734 dbfuzz2-asan: $(TOP)/test/dbfuzz2.c sqlite3.c sqlite3.h
735 clang-6.0 $(OPT_FEATURE_FLAGS) $(OPTS) -I. -g -O0 \
736 -fsanitize=fuzzer,undefined,address -o dbfuzz2-asan \
737 $(DBFUZZ2_OPTS) $(TOP)/test/dbfuzz2.c sqlite3.c $(TLIBS)
738 mkdir -p dbfuzz2-dir
739 cp $(TOP)/test/dbfuzz2-seed* dbfuzz2-dir
741 dbfuzz2-msan: $(TOP)/test/dbfuzz2.c sqlite3.c sqlite3.h
742 clang-6.0 $(OPT_FEATURE_FLAGS) $(OPTS) -I. -g -O0 \
743 -fsanitize=fuzzer,undefined,memory -o dbfuzz2-msan \
744 $(DBFUZZ2_OPTS) $(TOP)/test/dbfuzz2.c sqlite3.c $(TLIBS)
745 mkdir -p dbfuzz2-dir
746 cp $(TOP)/test/dbfuzz2-seed* dbfuzz2-dir
748 mptester$(TEXE): sqlite3.lo $(TOP)/mptest/mptest.c
749 $(LTLINK) -o $@ -I. $(TOP)/mptest/mptest.c sqlite3.lo \
750 $(TLIBS) -rpath "$(libdir)"
752 MPTEST1=./mptester$(TEXE) mptest.db $(TOP)/mptest/crash01.test --repeat 20
753 MPTEST2=./mptester$(TEXE) mptest.db $(TOP)/mptest/multiwrite01.test --repeat 20
754 mptest: mptester$(TEXE)
755 rm -f mptest.db
756 $(MPTEST1) --journalmode DELETE
757 $(MPTEST2) --journalmode WAL
758 $(MPTEST1) --journalmode WAL
759 $(MPTEST2) --journalmode PERSIST
760 $(MPTEST1) --journalmode PERSIST
761 $(MPTEST2) --journalmode TRUNCATE
762 $(MPTEST1) --journalmode TRUNCATE
763 $(MPTEST2) --journalmode DELETE
766 # This target creates a directory named "tsrc" and fills it with
767 # copies of all of the C source code and header files needed to
768 # build on the target system. Some of the C source code and header
769 # files are automatically generated. This target takes care of
770 # all that automatic generation.
772 .target_source: $(SRC) $(TOP)/tool/vdbe-compress.tcl fts5.c
773 rm -rf tsrc
774 mkdir tsrc
775 cp -f $(SRC) tsrc
776 rm tsrc/sqlite.h.in tsrc/parse.y
777 $(TCLSH_CMD) $(TOP)/tool/vdbe-compress.tcl $(OPTS) <tsrc/vdbe.c >vdbe.new
778 mv vdbe.new tsrc/vdbe.c
779 cp fts5.c fts5.h tsrc
780 touch .target_source
782 sqlite3.c: .target_source $(TOP)/tool/mksqlite3c.tcl
783 $(TCLSH_CMD) $(TOP)/tool/mksqlite3c.tcl $(AMALGAMATION_LINE_MACROS)
784 cp tsrc/sqlite3ext.h .
785 cp $(TOP)/ext/session/sqlite3session.h .
787 sqlite3ext.h: .target_source
788 cp tsrc/sqlite3ext.h .
790 tclsqlite3.c: sqlite3.c
791 echo '#ifndef USE_SYSTEM_SQLITE' >tclsqlite3.c
792 cat sqlite3.c >>tclsqlite3.c
793 echo '#endif /* USE_SYSTEM_SQLITE */' >>tclsqlite3.c
794 cat $(TOP)/src/tclsqlite.c >>tclsqlite3.c
796 sqlite3-all.c: sqlite3.c $(TOP)/tool/split-sqlite3c.tcl
797 $(TCLSH_CMD) $(TOP)/tool/split-sqlite3c.tcl
799 # Rule to build the amalgamation
801 sqlite3.lo: sqlite3.c
802 $(LTCOMPILE) $(TEMP_STORE) -c sqlite3.c
804 # Rules to build the LEMON compiler generator
806 lemon$(BEXE): $(TOP)/tool/lemon.c $(TOP)/tool/lempar.c
807 $(BCC) -o $@ $(TOP)/tool/lemon.c
808 cp $(TOP)/tool/lempar.c .
810 # Rules to build the program that generates the source-id
812 mksourceid$(BEXE): $(TOP)/tool/mksourceid.c
813 $(BCC) -o $@ $(TOP)/tool/mksourceid.c
815 # Rules to build individual *.o files from generated *.c files. This
816 # applies to:
818 # parse.o
819 # opcodes.o
821 parse.lo: parse.c $(HDR)
822 $(LTCOMPILE) $(TEMP_STORE) -c parse.c
824 opcodes.lo: opcodes.c
825 $(LTCOMPILE) $(TEMP_STORE) -c opcodes.c
827 # BEGIN CRYPTO
828 crypto.lo: $(TOP)/src/crypto.c $(HDR)
829 $(LTCOMPILE) -c $(TOP)/src/crypto.c
830 crypto_impl.lo: $(TOP)/src/crypto_impl.c $(HDR)
831 $(LTCOMPILE) -c $(TOP)/src/crypto_impl.c
832 crypto_openssl.lo: $(TOP)/src/crypto_openssl.c $(HDR)
833 $(LTCOMPILE) -c $(TOP)/src/crypto_openssl.c
834 crypto_nss.lo: $(TOP)/src/crypto_nss.c $(HDR)
835 $(LTCOMPILE) -c $(TOP)/src/crypto_nss.c
836 crypto_libtomcrypt.lo: $(TOP)/src/crypto_libtomcrypt.c $(HDR)
837 $(LTCOMPILE) -c $(TOP)/src/crypto_libtomcrypt.c
838 crypto_cc.lo: $(TOP)/src/crypto_cc.c $(HDR)
839 $(LTCOMPILE) -c $(TOP)/src/crypto_cc.c
840 # END CRYPTO
842 # Rules to build individual *.o files from files in the src directory.
844 alter.lo: $(TOP)/src/alter.c $(HDR)
845 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/alter.c
847 analyze.lo: $(TOP)/src/analyze.c $(HDR)
848 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/analyze.c
850 attach.lo: $(TOP)/src/attach.c $(HDR)
851 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/attach.c
853 auth.lo: $(TOP)/src/auth.c $(HDR)
854 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/auth.c
856 backup.lo: $(TOP)/src/backup.c $(HDR)
857 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/backup.c
859 bitvec.lo: $(TOP)/src/bitvec.c $(HDR)
860 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/bitvec.c
862 btmutex.lo: $(TOP)/src/btmutex.c $(HDR)
863 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/btmutex.c
865 btree.lo: $(TOP)/src/btree.c $(HDR) $(TOP)/src/pager.h
866 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/btree.c
868 build.lo: $(TOP)/src/build.c $(HDR)
869 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/build.c
871 callback.lo: $(TOP)/src/callback.c $(HDR)
872 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/callback.c
874 complete.lo: $(TOP)/src/complete.c $(HDR)
875 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/complete.c
877 ctime.lo: $(TOP)/src/ctime.c $(HDR)
878 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/ctime.c
880 date.lo: $(TOP)/src/date.c $(HDR)
881 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/date.c
883 dbpage.lo: $(TOP)/src/dbpage.c $(HDR)
884 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/dbpage.c
886 dbstat.lo: $(TOP)/src/dbstat.c $(HDR)
887 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/dbstat.c
889 delete.lo: $(TOP)/src/delete.c $(HDR)
890 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/delete.c
892 expr.lo: $(TOP)/src/expr.c $(HDR)
893 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/expr.c
895 fault.lo: $(TOP)/src/fault.c $(HDR)
896 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/fault.c
898 fkey.lo: $(TOP)/src/fkey.c $(HDR)
899 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/fkey.c
901 func.lo: $(TOP)/src/func.c $(HDR)
902 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/func.c
904 global.lo: $(TOP)/src/global.c $(HDR)
905 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/global.c
907 hash.lo: $(TOP)/src/hash.c $(HDR)
908 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/hash.c
910 insert.lo: $(TOP)/src/insert.c $(HDR)
911 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/insert.c
913 legacy.lo: $(TOP)/src/legacy.c $(HDR)
914 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/legacy.c
916 loadext.lo: $(TOP)/src/loadext.c $(HDR)
917 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/loadext.c
919 main.lo: $(TOP)/src/main.c $(HDR)
920 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/main.c
922 malloc.lo: $(TOP)/src/malloc.c $(HDR)
923 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/malloc.c
925 mem0.lo: $(TOP)/src/mem0.c $(HDR)
926 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem0.c
928 mem1.lo: $(TOP)/src/mem1.c $(HDR)
929 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem1.c
931 mem2.lo: $(TOP)/src/mem2.c $(HDR)
932 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem2.c
934 mem3.lo: $(TOP)/src/mem3.c $(HDR)
935 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem3.c
937 mem5.lo: $(TOP)/src/mem5.c $(HDR)
938 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem5.c
940 memdb.lo: $(TOP)/src/memdb.c $(HDR)
941 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/memdb.c
943 memjournal.lo: $(TOP)/src/memjournal.c $(HDR)
944 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/memjournal.c
946 mutex.lo: $(TOP)/src/mutex.c $(HDR)
947 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex.c
949 mutex_noop.lo: $(TOP)/src/mutex_noop.c $(HDR)
950 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex_noop.c
952 mutex_unix.lo: $(TOP)/src/mutex_unix.c $(HDR)
953 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex_unix.c
955 mutex_w32.lo: $(TOP)/src/mutex_w32.c $(HDR)
956 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex_w32.c
958 notify.lo: $(TOP)/src/notify.c $(HDR)
959 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/notify.c
961 pager.lo: $(TOP)/src/pager.c $(HDR) $(TOP)/src/pager.h
962 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pager.c
964 pcache.lo: $(TOP)/src/pcache.c $(HDR) $(TOP)/src/pcache.h
965 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pcache.c
967 pcache1.lo: $(TOP)/src/pcache1.c $(HDR) $(TOP)/src/pcache.h
968 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pcache1.c
970 os.lo: $(TOP)/src/os.c $(HDR)
971 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os.c
973 os_unix.lo: $(TOP)/src/os_unix.c $(HDR)
974 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os_unix.c
976 os_win.lo: $(TOP)/src/os_win.c $(HDR)
977 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os_win.c
979 pragma.lo: $(TOP)/src/pragma.c $(HDR)
980 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pragma.c
982 prepare.lo: $(TOP)/src/prepare.c $(HDR)
983 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/prepare.c
985 printf.lo: $(TOP)/src/printf.c $(HDR)
986 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/printf.c
988 random.lo: $(TOP)/src/random.c $(HDR)
989 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/random.c
991 resolve.lo: $(TOP)/src/resolve.c $(HDR)
992 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/resolve.c
994 rowset.lo: $(TOP)/src/rowset.c $(HDR)
995 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/rowset.c
997 select.lo: $(TOP)/src/select.c $(HDR)
998 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/select.c
1000 status.lo: $(TOP)/src/status.c $(HDR)
1001 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/status.c
1003 table.lo: $(TOP)/src/table.c $(HDR)
1004 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/table.c
1006 threads.lo: $(TOP)/src/threads.c $(HDR)
1007 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/threads.c
1009 tokenize.lo: $(TOP)/src/tokenize.c keywordhash.h $(HDR)
1010 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/tokenize.c
1012 treeview.lo: $(TOP)/src/treeview.c $(HDR)
1013 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/treeview.c
1015 trigger.lo: $(TOP)/src/trigger.c $(HDR)
1016 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/trigger.c
1018 update.lo: $(TOP)/src/update.c $(HDR)
1019 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/update.c
1021 upsert.lo: $(TOP)/src/upsert.c $(HDR)
1022 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/upsert.c
1024 utf.lo: $(TOP)/src/utf.c $(HDR)
1025 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/utf.c
1027 util.lo: $(TOP)/src/util.c $(HDR)
1028 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/util.c
1030 vacuum.lo: $(TOP)/src/vacuum.c $(HDR)
1031 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vacuum.c
1033 vdbe.lo: $(TOP)/src/vdbe.c $(HDR)
1034 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbe.c
1036 vdbeapi.lo: $(TOP)/src/vdbeapi.c $(HDR)
1037 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbeapi.c
1039 vdbeaux.lo: $(TOP)/src/vdbeaux.c $(HDR)
1040 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbeaux.c
1042 vdbeblob.lo: $(TOP)/src/vdbeblob.c $(HDR)
1043 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbeblob.c
1045 vdbemem.lo: $(TOP)/src/vdbemem.c $(HDR)
1046 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbemem.c
1048 vdbesort.lo: $(TOP)/src/vdbesort.c $(HDR)
1049 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbesort.c
1051 vdbetrace.lo: $(TOP)/src/vdbetrace.c $(HDR)
1052 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbetrace.c
1054 vdbevtab.lo: $(TOP)/src/vdbevtab.c $(HDR)
1055 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbevtab.c
1057 vtab.lo: $(TOP)/src/vtab.c $(HDR)
1058 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vtab.c
1060 wal.lo: $(TOP)/src/wal.c $(HDR)
1061 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/wal.c
1063 walker.lo: $(TOP)/src/walker.c $(HDR)
1064 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/walker.c
1066 where.lo: $(TOP)/src/where.c $(HDR)
1067 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/where.c
1069 wherecode.lo: $(TOP)/src/wherecode.c $(HDR)
1070 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/wherecode.c
1072 whereexpr.lo: $(TOP)/src/whereexpr.c $(HDR)
1073 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/whereexpr.c
1075 window.lo: $(TOP)/src/window.c $(HDR)
1076 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/window.c
1078 tclsqlite.lo: $(TOP)/src/tclsqlite.c $(HDR)
1079 $(LTCOMPILE) -DUSE_TCL_STUBS=1 -c $(TOP)/src/tclsqlite.c
1081 tclsqlite-shell.lo: $(TOP)/src/tclsqlite.c $(HDR)
1082 $(LTCOMPILE) -DTCLSH -o $@ -c $(TOP)/src/tclsqlite.c
1084 tclsqlite-stubs.lo: $(TOP)/src/tclsqlite.c $(HDR)
1085 $(LTCOMPILE) -DUSE_TCL_STUBS=1 -o $@ -c $(TOP)/src/tclsqlite.c
1087 tclsqlcipher$(TEXE): tclsqlite-shell.lo libsqlcipher.la
1088 $(LTLINK) -o $@ tclsqlite-shell.lo \
1089 libsqlcipher.la $(LIBTCL)
1091 # Rules to build opcodes.c and opcodes.h
1093 opcodes.c: opcodes.h $(TOP)/tool/mkopcodec.tcl
1094 $(TCLSH_CMD) $(TOP)/tool/mkopcodec.tcl opcodes.h >opcodes.c
1096 opcodes.h: parse.h $(TOP)/src/vdbe.c $(TOP)/tool/mkopcodeh.tcl
1097 cat parse.h $(TOP)/src/vdbe.c | $(TCLSH_CMD) $(TOP)/tool/mkopcodeh.tcl >opcodes.h
1099 # Rules to build parse.c and parse.h - the outputs of lemon.
1101 parse.h: parse.c
1103 parse.c: $(TOP)/src/parse.y lemon$(BEXE)
1104 cp $(TOP)/src/parse.y .
1105 ./lemon$(BEXE) $(OPT_FEATURE_FLAGS) $(OPTS) -S parse.y
1107 sqlite3.h: $(TOP)/src/sqlite.h.in $(TOP)/manifest mksourceid$(BEXE) $(TOP)/VERSION
1108 $(TCLSH_CMD) $(TOP)/tool/mksqlite3h.tcl $(TOP) >sqlite3.h
1110 sqlite3rc.h: $(TOP)/src/sqlite3.rc $(TOP)/VERSION
1111 echo '#ifndef SQLITE_RESOURCE_VERSION' >$@
1112 echo -n '#define SQLITE_RESOURCE_VERSION ' >>$@
1113 cat $(TOP)/VERSION | $(TCLSH_CMD) $(TOP)/tool/replace.tcl exact . , >>$@
1114 echo '#endif' >>sqlite3rc.h
1116 keywordhash.h: $(TOP)/tool/mkkeywordhash.c
1117 $(BCC) -o mkkeywordhash$(BEXE) $(OPT_FEATURE_FLAGS) $(OPTS) $(TOP)/tool/mkkeywordhash.c
1118 ./mkkeywordhash$(BEXE) >keywordhash.h
1120 # Source files that go into making shell.c
1121 SHELL_SRC = \
1122 $(TOP)/src/shell.c.in \
1123 $(TOP)/ext/misc/appendvfs.c \
1124 $(TOP)/ext/misc/completion.c \
1125 $(TOP)/ext/misc/decimal.c \
1126 $(TOP)/ext/misc/fileio.c \
1127 $(TOP)/ext/misc/ieee754.c \
1128 $(TOP)/ext/misc/regexp.c \
1129 $(TOP)/ext/misc/series.c \
1130 $(TOP)/ext/misc/shathree.c \
1131 $(TOP)/ext/misc/sqlar.c \
1132 $(TOP)/ext/misc/uint.c \
1133 $(TOP)/ext/expert/sqlite3expert.c \
1134 $(TOP)/ext/expert/sqlite3expert.h \
1135 $(TOP)/ext/misc/zipfile.c \
1136 $(TOP)/ext/misc/memtrace.c \
1137 $(TOP)/src/test_windirent.c
1139 shell.c: $(SHELL_SRC) $(TOP)/tool/mkshellc.tcl
1140 $(TCLSH_CMD) $(TOP)/tool/mkshellc.tcl >shell.c
1145 # Rules to build the extension objects.
1147 icu.lo: $(TOP)/ext/icu/icu.c $(HDR) $(EXTHDR)
1148 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/icu/icu.c
1150 fts2.lo: $(TOP)/ext/fts2/fts2.c $(HDR) $(EXTHDR)
1151 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2.c
1153 fts2_hash.lo: $(TOP)/ext/fts2/fts2_hash.c $(HDR) $(EXTHDR)
1154 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_hash.c
1156 fts2_icu.lo: $(TOP)/ext/fts2/fts2_icu.c $(HDR) $(EXTHDR)
1157 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_icu.c
1159 fts2_porter.lo: $(TOP)/ext/fts2/fts2_porter.c $(HDR) $(EXTHDR)
1160 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_porter.c
1162 fts2_tokenizer.lo: $(TOP)/ext/fts2/fts2_tokenizer.c $(HDR) $(EXTHDR)
1163 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_tokenizer.c
1165 fts2_tokenizer1.lo: $(TOP)/ext/fts2/fts2_tokenizer1.c $(HDR) $(EXTHDR)
1166 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_tokenizer1.c
1168 fts3.lo: $(TOP)/ext/fts3/fts3.c $(HDR) $(EXTHDR)
1169 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3.c
1171 fts3_aux.lo: $(TOP)/ext/fts3/fts3_aux.c $(HDR) $(EXTHDR)
1172 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_aux.c
1174 fts3_expr.lo: $(TOP)/ext/fts3/fts3_expr.c $(HDR) $(EXTHDR)
1175 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_expr.c
1177 fts3_hash.lo: $(TOP)/ext/fts3/fts3_hash.c $(HDR) $(EXTHDR)
1178 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_hash.c
1180 fts3_icu.lo: $(TOP)/ext/fts3/fts3_icu.c $(HDR) $(EXTHDR)
1181 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_icu.c
1183 fts3_porter.lo: $(TOP)/ext/fts3/fts3_porter.c $(HDR) $(EXTHDR)
1184 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_porter.c
1186 fts3_snippet.lo: $(TOP)/ext/fts3/fts3_snippet.c $(HDR) $(EXTHDR)
1187 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_snippet.c
1189 fts3_tokenizer.lo: $(TOP)/ext/fts3/fts3_tokenizer.c $(HDR) $(EXTHDR)
1190 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer.c
1192 fts3_tokenizer1.lo: $(TOP)/ext/fts3/fts3_tokenizer1.c $(HDR) $(EXTHDR)
1193 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer1.c
1195 fts3_tokenize_vtab.lo: $(TOP)/ext/fts3/fts3_tokenize_vtab.c $(HDR) $(EXTHDR)
1196 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenize_vtab.c
1198 fts3_unicode.lo: $(TOP)/ext/fts3/fts3_unicode.c $(HDR) $(EXTHDR)
1199 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_unicode.c
1201 fts3_unicode2.lo: $(TOP)/ext/fts3/fts3_unicode2.c $(HDR) $(EXTHDR)
1202 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_unicode2.c
1204 fts3_write.lo: $(TOP)/ext/fts3/fts3_write.c $(HDR) $(EXTHDR)
1205 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_write.c
1207 rtree.lo: $(TOP)/ext/rtree/rtree.c $(HDR) $(EXTHDR)
1208 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/rtree/rtree.c
1210 userauth.lo: $(TOP)/ext/userauth/userauth.c $(HDR) $(EXTHDR)
1211 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/userauth/userauth.c
1213 sqlite3session.lo: $(TOP)/ext/session/sqlite3session.c $(HDR) $(EXTHDR)
1214 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/session/sqlite3session.c
1216 json1.lo: $(TOP)/ext/misc/json1.c
1217 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/misc/json1.c
1219 stmt.lo: $(TOP)/ext/misc/stmt.c
1220 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/misc/stmt.c
1222 # FTS5 things
1224 FTS5_SRC = \
1225 $(TOP)/ext/fts5/fts5.h \
1226 $(TOP)/ext/fts5/fts5Int.h \
1227 $(TOP)/ext/fts5/fts5_aux.c \
1228 $(TOP)/ext/fts5/fts5_buffer.c \
1229 $(TOP)/ext/fts5/fts5_main.c \
1230 $(TOP)/ext/fts5/fts5_config.c \
1231 $(TOP)/ext/fts5/fts5_expr.c \
1232 $(TOP)/ext/fts5/fts5_hash.c \
1233 $(TOP)/ext/fts5/fts5_index.c \
1234 fts5parse.c fts5parse.h \
1235 $(TOP)/ext/fts5/fts5_storage.c \
1236 $(TOP)/ext/fts5/fts5_tokenize.c \
1237 $(TOP)/ext/fts5/fts5_unicode2.c \
1238 $(TOP)/ext/fts5/fts5_varint.c \
1239 $(TOP)/ext/fts5/fts5_vocab.c \
1241 fts5parse.c: $(TOP)/ext/fts5/fts5parse.y lemon$(BEXE)
1242 cp $(TOP)/ext/fts5/fts5parse.y .
1243 rm -f fts5parse.h
1244 ./lemon$(BEXE) $(OPTS) -S fts5parse.y
1246 fts5parse.h: fts5parse.c
1248 fts5.c: $(FTS5_SRC)
1249 $(TCLSH_CMD) $(TOP)/ext/fts5/tool/mkfts5c.tcl
1250 cp $(TOP)/ext/fts5/fts5.h .
1252 fts5.lo: fts5.c $(HDR) $(EXTHDR)
1253 $(LTCOMPILE) -DSQLITE_CORE -c fts5.c
1255 sqlite3rbu.lo: $(TOP)/ext/rbu/sqlite3rbu.c $(HDR) $(EXTHDR)
1256 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/rbu/sqlite3rbu.c
1259 # Rules to build the 'testfixture' application.
1261 # If using the amalgamation, use sqlite3.c directly to build the test
1262 # fixture. Otherwise link against libsqlcipher.la. (This distinction is
1263 # necessary because the test fixture requires non-API symbols which are
1264 # hidden when the library is built via the amalgamation).
1266 TESTFIXTURE_FLAGS = -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
1267 TESTFIXTURE_FLAGS += -DTCLSH_INIT_PROC=sqlite3TestInit
1268 TESTFIXTURE_FLAGS += -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE
1269 TESTFIXTURE_FLAGS += -DBUILD_sqlite
1270 TESTFIXTURE_FLAGS += -DSQLITE_SERIES_CONSTRAINT_VERIFY=1
1271 TESTFIXTURE_FLAGS += -DSQLITE_DEFAULT_PAGE_SIZE=1024
1272 TESTFIXTURE_FLAGS += -DSQLITE_ENABLE_STMTVTAB
1273 TESTFIXTURE_FLAGS += -DSQLITE_ENABLE_DBPAGE_VTAB
1274 TESTFIXTURE_FLAGS += -DSQLITE_ENABLE_BYTECODE_VTAB
1275 TESTFIXTURE_FLAGS += -DSQLITE_CKSUMVFS_STATIC
1277 TESTFIXTURE_SRC0 = $(TESTSRC2) libsqlcipher.la
1278 TESTFIXTURE_SRC1 = sqlite3.c
1279 TESTFIXTURE_SRC = $(TESTSRC) $(TOP)/src/tclsqlite.c
1280 TESTFIXTURE_SRC += $(TESTFIXTURE_SRC$(USE_AMALGAMATION))
1282 testfixture$(TEXE): $(TESTFIXTURE_SRC)
1283 $(LTLINK) -DSQLITE_NO_SYNC=1 $(TEMP_STORE) $(TESTFIXTURE_FLAGS) \
1284 -o $@ $(TESTFIXTURE_SRC) $(LIBTCL) $(TLIBS)
1286 coretestprogs: $(TESTPROGS)
1288 testprogs: coretestprogs srcck1$(BEXE) fuzzcheck$(TEXE) sessionfuzz$(TEXE)
1290 # A very detailed test running most or all test cases
1291 fulltest: alltest fuzztest
1293 # Run most or all tcl test cases
1294 alltest: $(TESTPROGS)
1295 ./testfixture$(TEXE) $(TOP)/test/all.test $(TESTOPTS)
1297 # Really really long testing
1298 soaktest: $(TESTPROGS)
1299 ./testfixture$(TEXE) $(TOP)/test/all.test -soak=1 $(TESTOPTS)
1301 # Do extra testing but not everything.
1302 fulltestonly: $(TESTPROGS) fuzztest
1303 ./testfixture$(TEXE) $(TOP)/test/full.test
1305 # Fuzz testing
1306 fuzztest: fuzzcheck$(TEXE) $(FUZZDATA) sessionfuzz$(TEXE) $(TOP)/test/sessionfuzz-data1.db
1307 ./fuzzcheck$(TEXE) $(FUZZDATA)
1308 ./sessionfuzz$(TEXE) run $(TOP)/test/sessionfuzz-data1.db
1310 valgrindfuzz: fuzzcheck$(TEXT) $(FUZZDATA) sessionfuzz$(TEXE) $(TOP)/test/sessionfuzz-data1.db
1311 valgrind ./fuzzcheck$(TEXE) --cell-size-check --limit-mem 10M $(FUZZDATA)
1312 valgrind ./sessionfuzz$(TEXE) run $(TOP)/test/sessionfuzz-data1.db
1314 # The veryquick.test TCL tests.
1316 tcltest: ./testfixture$(TEXE)
1317 ./testfixture$(TEXE) $(TOP)/test/veryquick.test $(TESTOPTS)
1319 # Minimal testing that runs in less than 3 minutes
1321 quicktest: ./testfixture$(TEXE)
1322 ./testfixture$(TEXE) $(TOP)/test/extraquick.test $(TESTOPTS)
1324 # This is the common case. Run many tests that do not take too long,
1325 # including fuzzcheck, sqlite3_analyzer, and sqldiff tests.
1327 test: fuzztest sourcetest $(TESTPROGS) tcltest
1329 # Run a test using valgrind. This can take a really long time
1330 # because valgrind is so much slower than a native machine.
1332 valgrindtest: $(TESTPROGS) valgrindfuzz
1333 OMIT_MISUSE=1 valgrind -v ./testfixture$(TEXE) $(TOP)/test/permutations.test valgrind $(TESTOPTS)
1335 # A very fast test that checks basic sanity. The name comes from
1336 # the 60s-era electronics testing: "Turn it on and see if smoke
1337 # comes out."
1339 smoketest: $(TESTPROGS) fuzzcheck$(TEXE)
1340 ./testfixture$(TEXE) $(TOP)/test/main.test $(TESTOPTS)
1342 shelltest: $(TESTPROGS)
1343 ./testfixture$(TEXT) $(TOP)/test/permutations.test shell
1345 sqlite3_analyzer.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqlite3_analyzer.c.in
1346 $(TCLSH_CMD) $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqlite3_analyzer.c.in >sqlite3_analyzer.c
1348 sqlite3_analyzer$(TEXE): sqlite3_analyzer.c
1349 $(LTLINK) sqlite3_analyzer.c -o $@ $(LIBTCL) $(TLIBS)
1351 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
1352 $(TCLSH_CMD) $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqltclsh.c.in >sqltclsh.c
1354 sqltclsh$(TEXE): sqltclsh.c
1355 $(LTLINK) sqltclsh.c -o $@ $(LIBTCL) $(TLIBS)
1357 sqlite3_expert$(TEXE): $(TOP)/ext/expert/sqlite3expert.h $(TOP)/ext/expert/sqlite3expert.c $(TOP)/ext/expert/expert.c sqlite3.c
1358 $(LTLINK) $(TOP)/ext/expert/sqlite3expert.h $(TOP)/ext/expert/sqlite3expert.c $(TOP)/ext/expert/expert.c sqlite3.c -o sqlite3_expert $(TLIBS)
1360 CHECKER_DEPS =\
1361 $(TOP)/tool/mkccode.tcl \
1362 sqlite3.c \
1363 $(TOP)/src/tclsqlite.c \
1364 $(TOP)/ext/repair/sqlite3_checker.tcl \
1365 $(TOP)/ext/repair/checkindex.c \
1366 $(TOP)/ext/repair/checkfreelist.c \
1367 $(TOP)/ext/misc/btreeinfo.c \
1368 $(TOP)/ext/repair/sqlite3_checker.c.in
1370 sqlite3_checker.c: $(CHECKER_DEPS)
1371 $(TCLSH_CMD) $(TOP)/tool/mkccode.tcl $(TOP)/ext/repair/sqlite3_checker.c.in >$@
1373 sqlite3_checker$(TEXE): sqlite3_checker.c
1374 $(LTLINK) sqlite3_checker.c -o $@ $(LIBTCL) $(TLIBS)
1376 dbdump$(TEXE): $(TOP)/ext/misc/dbdump.c sqlite3.lo
1377 $(LTLINK) -DDBDUMP_STANDALONE -o $@ \
1378 $(TOP)/ext/misc/dbdump.c sqlite3.lo $(TLIBS)
1380 dbtotxt$(TEXE): $(TOP)/tool/dbtotxt.c
1381 $(LTLINK)-o $@ $(TOP)/tool/dbtotxt.c
1383 showdb$(TEXE): $(TOP)/tool/showdb.c sqlite3.lo
1384 $(LTLINK) -o $@ $(TOP)/tool/showdb.c sqlite3.lo $(TLIBS)
1386 showstat4$(TEXE): $(TOP)/tool/showstat4.c sqlite3.lo
1387 $(LTLINK) -o $@ $(TOP)/tool/showstat4.c sqlite3.lo $(TLIBS)
1389 showjournal$(TEXE): $(TOP)/tool/showjournal.c sqlite3.lo
1390 $(LTLINK) -o $@ $(TOP)/tool/showjournal.c sqlite3.lo $(TLIBS)
1392 showwal$(TEXE): $(TOP)/tool/showwal.c sqlite3.lo
1393 $(LTLINK) -o $@ $(TOP)/tool/showwal.c sqlite3.lo $(TLIBS)
1395 showshm$(TEXE): $(TOP)/tool/showshm.c
1396 $(LTLINK) -o $@ $(TOP)/tool/showshm.c
1398 index_usage$(TEXE): $(TOP)/tool/index_usage.c sqlite3.lo
1399 $(LTLINK) $(SHELL_OPT) -o $@ $(TOP)/tool/index_usage.c sqlite3.lo $(TLIBS)
1401 changeset$(TEXE): $(TOP)/ext/session/changeset.c sqlite3.lo
1402 $(LTLINK) -o $@ $(TOP)/ext/session/changeset.c sqlite3.lo $(TLIBS)
1404 changesetfuzz$(TEXE): $(TOP)/ext/session/changesetfuzz.c sqlite3.lo
1405 $(LTLINK) -o $@ $(TOP)/ext/session/changesetfuzz.c sqlite3.lo $(TLIBS)
1407 rollback-test$(TEXE): $(TOP)/tool/rollback-test.c sqlite3.lo
1408 $(LTLINK) -o $@ $(TOP)/tool/rollback-test.c sqlite3.lo $(TLIBS)
1410 atrc$(TEXX): $(TOP)/test/atrc.c sqlite3.lo
1411 $(LTLINK) -o $@ $(TOP)/test/atrc.c sqlite3.lo $(TLIBS)
1413 LogEst$(TEXE): $(TOP)/tool/logest.c sqlite3.h
1414 $(LTLINK) -I. -o $@ $(TOP)/tool/logest.c
1416 wordcount$(TEXE): $(TOP)/test/wordcount.c sqlite3.lo
1417 $(LTLINK) -o $@ $(TOP)/test/wordcount.c sqlite3.lo $(TLIBS)
1419 speedtest1$(TEXE): $(TOP)/test/speedtest1.c sqlite3.c
1420 $(LTLINK) $(ST_OPT) -o $@ $(TOP)/test/speedtest1.c sqlite3.c $(TLIBS)
1422 startup$(TEXE): $(TOP)/test/startup.c sqlite3.c
1423 $(CC) -Os -g -DSQLITE_THREADSAFE=0 -o $@ $(TOP)/test/startup.c sqlite3.c $(TLIBS)
1425 KV_OPT += -DSQLITE_DIRECT_OVERFLOW_READ
1427 kvtest$(TEXE): $(TOP)/test/kvtest.c sqlite3.c
1428 $(LTLINK) $(KV_OPT) -o $@ $(TOP)/test/kvtest.c sqlite3.c $(TLIBS)
1430 rbu$(EXE): $(TOP)/ext/rbu/rbu.c $(TOP)/ext/rbu/sqlite3rbu.c sqlite3.lo
1431 $(LTLINK) -I. -o $@ $(TOP)/ext/rbu/rbu.c sqlite3.lo $(TLIBS)
1433 loadfts$(EXE): $(TOP)/tool/loadfts.c libsqlite3.la
1434 $(LTLINK) $(TOP)/tool/loadfts.c libsqlite3.la -o $@ $(TLIBS)
1436 # This target will fail if the SQLite amalgamation contains any exported
1437 # symbols that do not begin with "sqlite3_". It is run as part of the
1438 # releasetest.tcl script.
1440 VALIDIDS=' sqlite3(changeset|changegroup|session)?_'
1441 checksymbols: sqlite3.o
1442 nm -g --defined-only sqlite3.o
1443 nm -g --defined-only sqlite3.o | egrep -v $(VALIDIDS); test $$? -ne 0
1444 echo '0 errors out of 1 tests'
1446 # Build the amalgamation-autoconf package. The amalamgation-tarball target builds
1447 # a tarball named for the version number. Ex: sqlite-autoconf-3110000.tar.gz.
1448 # The snapshot-tarball target builds a tarball named by the SHA1 hash
1450 amalgamation-tarball: sqlite3.c sqlite3rc.h
1451 TOP=$(TOP) sh $(TOP)/tool/mkautoconfamal.sh --normal
1453 snapshot-tarball: sqlite3.c sqlite3rc.h
1454 TOP=$(TOP) sh $(TOP)/tool/mkautoconfamal.sh --snapshot
1456 # The next two rules are used to support the "threadtest" target. Building
1457 # threadtest runs a few thread-safety tests that are implemented in C. This
1458 # target is invoked by the releasetest.tcl script.
1460 THREADTEST3_SRC = $(TOP)/test/threadtest3.c \
1461 $(TOP)/test/tt3_checkpoint.c \
1462 $(TOP)/test/tt3_index.c \
1463 $(TOP)/test/tt3_vacuum.c \
1464 $(TOP)/test/tt3_stress.c \
1465 $(TOP)/test/tt3_lookaside1.c
1467 threadtest3$(TEXE): sqlite3.lo $(THREADTEST3_SRC)
1468 $(LTLINK) $(TOP)/test/threadtest3.c $(TOP)/src/test_multiplex.c sqlite3.lo -o $@ $(TLIBS)
1470 threadtest: threadtest3$(TEXE)
1471 ./threadtest3$(TEXE)
1473 threadtest5: sqlite3.c $(TOP)/test/threadtest5.c
1474 $(LTLINK) $(TOP)/test/threadtest5.c sqlite3.c -o $@ $(TLIBS)
1476 releasetest:
1477 $(TCLSH_CMD) $(TOP)/test/releasetest.tcl
1479 # Standard install and cleanup targets
1481 lib_install: libsqlcipher.la
1482 $(INSTALL) -d $(DESTDIR)$(libdir)
1483 $(LTINSTALL) libsqlcipher.la $(DESTDIR)$(libdir)
1485 install: sqlcipher$(TEXE) lib_install sqlite3.h sqlcipher.pc ${HAVE_TCL:1=tcl_install}
1486 $(INSTALL) -d $(DESTDIR)$(bindir)
1487 $(LTINSTALL) sqlcipher$(TEXE) $(DESTDIR)$(bindir)
1488 $(INSTALL) -d $(DESTDIR)$(includedir)
1489 $(INSTALL) -m 0644 sqlite3.h $(DESTDIR)$(includedir)
1490 $(INSTALL) -m 0644 $(TOP)/src/sqlite3ext.h $(DESTDIR)$(includedir)
1491 $(INSTALL) -d $(DESTDIR)$(pkgconfigdir)
1492 $(INSTALL) -m 0644 sqlcipher.pc $(DESTDIR)$(pkgconfigdir)
1494 pkgIndex.tcl:
1495 echo 'package ifneeded sqlite3 $(RELEASE) [list load [file join $$dir libtclsqlite3[info sharedlibextension]] sqlite3]' > $@
1496 tcl_install: lib_install libtclsqlite3.la pkgIndex.tcl
1497 $(INSTALL) -d $(DESTDIR)$(TCLLIBDIR)
1498 $(LTINSTALL) libtclsqlite3.la $(DESTDIR)$(TCLLIBDIR)
1499 rm -f $(DESTDIR)$(TCLLIBDIR)/libtclsqlite3.la $(DESTDIR)$(TCLLIBDIR)/libtclsqlite3.a
1500 $(INSTALL) -m 0644 pkgIndex.tcl $(DESTDIR)$(TCLLIBDIR)
1502 clean:
1503 rm -f *.lo *.la *.o sqlcipher$(TEXE) libsqlcipher.la
1504 rm -f sqlite3.h opcodes.*
1505 rm -rf .libs .deps
1506 rm -f lemon$(BEXE) lempar.c parse.* sqlite*.tar.gz
1507 rm -f mkkeywordhash$(BEXE) keywordhash.h
1508 rm -f *.da *.bb *.bbg gmon.out
1509 rm -rf tsrc .target_source
1510 rm -f tclsqlcipher$(TEXE)
1511 rm -f testfixture$(TEXE) test.db
1512 rm -f LogEst$(TEXE) fts3view$(TEXE) rollback-test$(TEXE) showdb$(TEXE)
1513 rm -f showjournal$(TEXE) showstat4$(TEXE) showwal$(TEXE) speedtest1$(TEXE)
1514 rm -f wordcount$(TEXE) changeset$(TEXE)
1515 rm -f sqlite3.dll sqlite3.lib sqlite3.exp sqlite3.def
1516 rm -f sqlite3.c
1517 rm -f sqlite3rc.h
1518 rm -f shell.c sqlite3ext.h
1519 rm -f sqlite3_analyzer$(TEXE) sqlite3_analyzer.c
1520 rm -f sqlite-*-output.vsix
1521 rm -f mptester mptester.exe
1522 rm -f rbu rbu.exe
1523 rm -f srcck1 srcck1.exe
1524 rm -f fuzzershell fuzzershell.exe
1525 rm -f fuzzcheck fuzzcheck.exe
1526 rm -f sqldiff sqldiff.exe
1527 rm -f dbhash dbhash.exe
1528 rm -f fts5.* fts5parse.*
1529 rm -f threadtest5
1531 distclean: clean
1532 rm -f config.h config.log config.status libtool Makefile sqlcipher.pc
1535 # Windows section
1537 dll: sqlite3.dll
1539 REAL_LIBOBJ = $(LIBOBJ:%.lo=.libs/%.o)
1541 $(REAL_LIBOBJ): $(LIBOBJ)
1543 sqlite3.def: $(REAL_LIBOBJ)
1544 echo 'EXPORTS' >sqlite3.def
1545 nm $(REAL_LIBOBJ) | grep ' T ' | grep ' _sqlite3_' \
1546 | sed 's/^.* _//' >>sqlite3.def
1548 sqlite3.dll: $(REAL_LIBOBJ) sqlite3.def
1549 $(TCC) -shared -o $@ sqlite3.def \
1550 -Wl,"--strip-all" $(REAL_LIBOBJ)