sqlcipher/main.mk

1089 lines
34 KiB
Makefile
Raw Normal View History

2008-07-30 13:15:43 +00:00
###############################################################################
# The following macros should be defined before this script is
# invoked:
#
# TOP The toplevel directory of the source tree. This is the
# directory that contains this "Makefile.in" and the
# "configure.in" script.
#
# BCC C Compiler and options for use in building executables that
# will run on the platform that is doing the build.
#
# THREADLIB Specify any extra linker options needed to make the library
# thread safe
#
2016-02-23 15:07:39 +00:00
# LIBS Extra libraries options
#
2008-07-30 13:15:43 +00:00
# OPTS Extra compiler command-line options.
#
# EXE The suffix to add to executable files. ".exe" for windows
# and "" for Unix.
#
# TCC C Compiler and options for use in building executables that
# will run on the target platform. This is usually the same
# as BCC, unless you are cross-compiling.
#
# AR Tools used to build a static library.
# RANLIB
#
# TCL_FLAGS Extra compiler options needed for programs that use the
# TCL library.
#
# LIBTCL Linker options needed to link against the TCL library.
#
# READLINE_FLAGS Compiler options needed for programs that use the
# readline() library.
#
# LIBREADLINE Linker options needed by programs using readline() must
# link against.
#
# Once the macros above are defined, the rest of this make script will
# build the SQLite library and testing tools.
################################################################################
# This is how we compile
#
2009-02-20 20:33:35 +00:00
TCCX = $(TCC) $(OPTS) -I. -I$(TOP)/src -I$(TOP)
TCCX += -I$(TOP)/ext/rtree -I$(TOP)/ext/icu -I$(TOP)/ext/fts3
2015-03-20 14:04:26 +00:00
TCCX += -I$(TOP)/ext/async -I$(TOP)/ext/userauth
2016-12-05 20:29:15 +00:00
TCCX += -I$(TOP)/ext/session
2016-02-23 15:07:39 +00:00
TCCX += -I$(TOP)/ext/fts5
THREADLIB += $(LIBS)
2008-07-30 13:15:43 +00:00
# Object files for the SQLite library.
#
2013-08-29 13:11:18 +00:00
LIBOBJ+= vdbe.o parse.o \
alter.o analyze.o attach.o auth.o \
2009-02-20 20:33:35 +00:00
backup.o bitvec.o btmutex.o btree.o build.o \
2018-09-18 16:31:37 +00:00
callback.o complete.o ctime.o \
date.o dbpage.o dbstat.o delete.o expr.o \
2016-02-23 15:07:39 +00:00
fault.o fkey.o \
2011-05-06 02:37:34 +00:00
fts3.o fts3_aux.o fts3_expr.o fts3_hash.o fts3_icu.o fts3_porter.o \
2011-08-17 17:17:32 +00:00
fts3_snippet.o fts3_tokenizer.o fts3_tokenizer1.o \
2013-05-21 20:38:11 +00:00
fts3_tokenize_vtab.o \
2012-07-18 18:42:52 +00:00
fts3_unicode.o fts3_unicode2.o \
2016-02-23 15:07:39 +00:00
fts3_write.o fts5.o func.o global.o hash.o \
2016-12-05 20:29:15 +00:00
icu.o insert.o json1.o legacy.o loadext.o \
2009-02-20 20:33:35 +00:00
main.o malloc.o mem0.o mem1.o mem2.o mem3.o mem5.o \
2018-09-18 16:31:37 +00:00
memdb.o memjournal.o \
2012-11-15 23:45:58 +00:00
mutex.o mutex_noop.o mutex_unix.o mutex_w32.o \
notify.o opcodes.o os.o os_unix.o os_win.o \
2013-08-29 13:11:18 +00:00
pager.o pcache.o pcache1.o pragma.o prepare.o printf.o \
2017-09-27 21:07:03 +00:00
random.o resolve.o rowset.o rtree.o \
select.o sqlite3rbu.o status.o stmt.o \
2016-02-23 15:07:39 +00:00
table.o threads.o tokenize.o treeview.o trigger.o \
2018-09-18 16:31:37 +00:00
update.o upsert.o userauth.o util.o vacuum.o \
2013-08-29 13:11:18 +00:00
vdbeapi.o vdbeaux.o vdbeblob.o vdbemem.o vdbesort.o \
2016-02-23 15:07:39 +00:00
vdbetrace.o wal.o walker.o where.o wherecode.o whereexpr.o \
2018-09-18 16:31:37 +00:00
utf.o vtab.o window.o
2009-02-20 20:33:35 +00:00
2016-12-05 20:29:15 +00:00
LIBOBJ += sqlite3session.o
2008-07-30 13:15:43 +00:00
# All of the source code files.
#
SRC = \
$(TOP)/src/alter.c \
$(TOP)/src/analyze.c \
$(TOP)/src/attach.c \
$(TOP)/src/auth.c \
2009-02-20 20:33:35 +00:00
$(TOP)/src/backup.c \
2008-07-30 13:15:43 +00:00
$(TOP)/src/bitvec.c \
$(TOP)/src/btmutex.c \
$(TOP)/src/btree.c \
$(TOP)/src/btree.h \
$(TOP)/src/btreeInt.h \
$(TOP)/src/build.c \
$(TOP)/src/callback.c \
$(TOP)/src/complete.c \
2010-05-18 16:22:17 +00:00
$(TOP)/src/ctime.c \
2008-07-30 13:15:43 +00:00
$(TOP)/src/date.c \
2018-09-18 16:31:37 +00:00
$(TOP)/src/dbpage.c \
2015-07-10 19:14:29 +00:00
$(TOP)/src/dbstat.c \
2008-07-30 13:15:43 +00:00
$(TOP)/src/delete.c \
$(TOP)/src/expr.c \
$(TOP)/src/fault.c \
2009-12-03 21:24:07 +00:00
$(TOP)/src/fkey.c \
2008-07-30 13:15:43 +00:00
$(TOP)/src/func.c \
$(TOP)/src/global.c \
$(TOP)/src/hash.c \
$(TOP)/src/hash.h \
$(TOP)/src/hwtime.h \
$(TOP)/src/insert.c \
$(TOP)/src/legacy.c \
$(TOP)/src/loadext.c \
$(TOP)/src/main.c \
$(TOP)/src/malloc.c \
2009-02-20 20:33:35 +00:00
$(TOP)/src/mem0.c \
2008-07-30 13:15:43 +00:00
$(TOP)/src/mem1.c \
$(TOP)/src/mem2.c \
$(TOP)/src/mem3.c \
$(TOP)/src/mem5.c \
2018-09-18 16:31:37 +00:00
$(TOP)/src/memdb.c \
2009-02-20 20:33:35 +00:00
$(TOP)/src/memjournal.c \
2015-03-20 14:04:26 +00:00
$(TOP)/src/msvc.h \
2008-07-30 13:15:43 +00:00
$(TOP)/src/mutex.c \
$(TOP)/src/mutex.h \
2009-02-20 20:33:35 +00:00
$(TOP)/src/mutex_noop.c \
2008-07-30 13:15:43 +00:00
$(TOP)/src/mutex_unix.c \
$(TOP)/src/mutex_w32.c \
2009-04-21 14:39:00 +00:00
$(TOP)/src/notify.c \
2008-07-30 13:15:43 +00:00
$(TOP)/src/os.c \
$(TOP)/src/os.h \
$(TOP)/src/os_common.h \
2014-09-30 13:40:45 +00:00
$(TOP)/src/os_setup.h \
2008-07-30 13:15:43 +00:00
$(TOP)/src/os_unix.c \
$(TOP)/src/os_win.c \
2014-09-30 13:40:45 +00:00
$(TOP)/src/os_win.h \
2008-07-30 13:15:43 +00:00
$(TOP)/src/pager.c \
$(TOP)/src/pager.h \
$(TOP)/src/parse.y \
2009-02-20 20:33:35 +00:00
$(TOP)/src/pcache.c \
$(TOP)/src/pcache.h \
$(TOP)/src/pcache1.c \
2008-07-30 13:15:43 +00:00
$(TOP)/src/pragma.c \
2015-07-10 19:14:29 +00:00
$(TOP)/src/pragma.h \
2008-07-30 13:15:43 +00:00
$(TOP)/src/prepare.c \
$(TOP)/src/printf.c \
$(TOP)/src/random.c \
2009-02-20 20:33:35 +00:00
$(TOP)/src/resolve.c \
$(TOP)/src/rowset.c \
2008-07-30 13:15:43 +00:00
$(TOP)/src/select.c \
$(TOP)/src/status.c \
2018-09-18 16:31:37 +00:00
$(TOP)/src/shell.c.in \
2008-07-30 13:15:43 +00:00
$(TOP)/src/sqlite.h.in \
$(TOP)/src/sqlite3ext.h \
$(TOP)/src/sqliteInt.h \
$(TOP)/src/sqliteLimit.h \
$(TOP)/src/table.c \
$(TOP)/src/tclsqlite.c \
2015-03-20 14:04:26 +00:00
$(TOP)/src/threads.c \
2008-07-30 13:15:43 +00:00
$(TOP)/src/tokenize.c \
2016-02-23 15:07:39 +00:00
$(TOP)/src/treeview.c \
2008-07-30 13:15:43 +00:00
$(TOP)/src/trigger.c \
$(TOP)/src/utf.c \
$(TOP)/src/update.c \
2018-09-18 16:31:37 +00:00
$(TOP)/src/upsert.c \
2008-07-30 13:15:43 +00:00
$(TOP)/src/util.c \
$(TOP)/src/vacuum.c \
$(TOP)/src/vdbe.c \
$(TOP)/src/vdbe.h \
$(TOP)/src/vdbeapi.c \
$(TOP)/src/vdbeaux.c \
$(TOP)/src/vdbeblob.c \
$(TOP)/src/vdbemem.c \
2011-12-26 19:52:17 +00:00
$(TOP)/src/vdbesort.c \
2009-12-19 20:56:40 +00:00
$(TOP)/src/vdbetrace.c \
2008-07-30 13:15:43 +00:00
$(TOP)/src/vdbeInt.h \
$(TOP)/src/vtab.c \
2015-07-10 19:14:29 +00:00
$(TOP)/src/vxworks.h \
2010-07-22 13:16:22 +00:00
$(TOP)/src/wal.c \
$(TOP)/src/wal.h \
2009-02-20 20:33:35 +00:00
$(TOP)/src/walker.c \
2014-04-04 15:16:20 +00:00
$(TOP)/src/where.c \
2016-02-23 15:07:39 +00:00
$(TOP)/src/wherecode.c \
$(TOP)/src/whereexpr.c \
2018-09-18 16:31:37 +00:00
$(TOP)/src/whereInt.h \
$(TOP)/src/window.c
2008-07-30 13:15:43 +00:00
# Source code for extensions
#
SRC += \
$(TOP)/ext/fts1/fts1.c \
$(TOP)/ext/fts1/fts1.h \
$(TOP)/ext/fts1/fts1_hash.c \
$(TOP)/ext/fts1/fts1_hash.h \
$(TOP)/ext/fts1/fts1_porter.c \
$(TOP)/ext/fts1/fts1_tokenizer.h \
$(TOP)/ext/fts1/fts1_tokenizer1.c
SRC += \
$(TOP)/ext/fts2/fts2.c \
$(TOP)/ext/fts2/fts2.h \
$(TOP)/ext/fts2/fts2_hash.c \
$(TOP)/ext/fts2/fts2_hash.h \
$(TOP)/ext/fts2/fts2_icu.c \
$(TOP)/ext/fts2/fts2_porter.c \
$(TOP)/ext/fts2/fts2_tokenizer.h \
$(TOP)/ext/fts2/fts2_tokenizer.c \
$(TOP)/ext/fts2/fts2_tokenizer1.c
SRC += \
$(TOP)/ext/fts3/fts3.c \
$(TOP)/ext/fts3/fts3.h \
2009-12-19 20:56:40 +00:00
$(TOP)/ext/fts3/fts3Int.h \
2011-05-06 02:37:34 +00:00
$(TOP)/ext/fts3/fts3_aux.c \
2009-02-20 20:33:35 +00:00
$(TOP)/ext/fts3/fts3_expr.c \
2008-07-30 13:15:43 +00:00
$(TOP)/ext/fts3/fts3_hash.c \
$(TOP)/ext/fts3/fts3_hash.h \
$(TOP)/ext/fts3/fts3_icu.c \
$(TOP)/ext/fts3/fts3_porter.c \
2009-12-19 20:56:40 +00:00
$(TOP)/ext/fts3/fts3_snippet.c \
2008-07-30 13:15:43 +00:00
$(TOP)/ext/fts3/fts3_tokenizer.h \
$(TOP)/ext/fts3/fts3_tokenizer.c \
2009-12-19 20:56:40 +00:00
$(TOP)/ext/fts3/fts3_tokenizer1.c \
2013-05-21 20:38:11 +00:00
$(TOP)/ext/fts3/fts3_tokenize_vtab.c \
2012-07-18 18:42:52 +00:00
$(TOP)/ext/fts3/fts3_unicode.c \
$(TOP)/ext/fts3/fts3_unicode2.c \
2009-12-19 20:56:40 +00:00
$(TOP)/ext/fts3/fts3_write.c
2008-07-30 13:15:43 +00:00
SRC += \
2009-02-20 20:33:35 +00:00
$(TOP)/ext/icu/sqliteicu.h \
2009-12-03 21:24:07 +00:00
$(TOP)/ext/icu/icu.c
2008-07-30 13:15:43 +00:00
SRC += \
2014-09-30 13:40:45 +00:00
$(TOP)/ext/rtree/sqlite3rtree.h \
2008-07-30 13:15:43 +00:00
$(TOP)/ext/rtree/rtree.h \
2018-09-18 16:31:37 +00:00
$(TOP)/ext/rtree/rtree.c \
$(TOP)/ext/rtree/geopoly.c
2016-12-05 20:29:15 +00:00
SRC += \
$(TOP)/ext/session/sqlite3session.c \
$(TOP)/ext/session/sqlite3session.h
2015-03-20 14:04:26 +00:00
SRC += \
$(TOP)/ext/userauth/userauth.c \
2016-02-23 15:07:39 +00:00
$(TOP)/ext/userauth/sqlite3userauth.h
SRC += \
$(TOP)/ext/rbu/sqlite3rbu.c \
$(TOP)/ext/rbu/sqlite3rbu.h
SRC += \
2017-09-27 21:07:03 +00:00
$(TOP)/ext/misc/json1.c \
$(TOP)/ext/misc/stmt.c
2016-02-23 15:07:39 +00:00
# FTS5 things
#
FTS5_HDR = \
$(TOP)/ext/fts5/fts5.h \
$(TOP)/ext/fts5/fts5Int.h \
fts5parse.h
FTS5_SRC = \
$(TOP)/ext/fts5/fts5_aux.c \
$(TOP)/ext/fts5/fts5_buffer.c \
$(TOP)/ext/fts5/fts5_main.c \
$(TOP)/ext/fts5/fts5_config.c \
$(TOP)/ext/fts5/fts5_expr.c \
$(TOP)/ext/fts5/fts5_hash.c \
$(TOP)/ext/fts5/fts5_index.c \
fts5parse.c \
$(TOP)/ext/fts5/fts5_storage.c \
$(TOP)/ext/fts5/fts5_tokenize.c \
$(TOP)/ext/fts5/fts5_unicode2.c \
$(TOP)/ext/fts5/fts5_varint.c \
$(TOP)/ext/fts5/fts5_vocab.c \
2018-09-18 16:31:37 +00:00
LSM1_SRC = \
$(TOP)/ext/lsm1/lsm.h \
$(TOP)/ext/lsm1/lsmInt.h \
$(TOP)/ext/lsm1/lsm_ckpt.c \
$(TOP)/ext/lsm1/lsm_file.c \
$(TOP)/ext/lsm1/lsm_log.c \
$(TOP)/ext/lsm1/lsm_main.c \
$(TOP)/ext/lsm1/lsm_mem.c \
$(TOP)/ext/lsm1/lsm_mutex.c \
$(TOP)/ext/lsm1/lsm_shared.c \
$(TOP)/ext/lsm1/lsm_sorted.c \
$(TOP)/ext/lsm1/lsm_str.c \
$(TOP)/ext/lsm1/lsm_tree.c \
$(TOP)/ext/lsm1/lsm_unix.c \
$(TOP)/ext/lsm1/lsm_varint.c \
$(TOP)/ext/lsm1/lsm_vtab.c \
$(TOP)/ext/lsm1/lsm_win32.c
2008-07-30 13:15:43 +00:00
# Generated source code files
#
SRC += \
keywordhash.h \
opcodes.c \
opcodes.h \
parse.c \
parse.h \
2018-09-18 16:31:37 +00:00
shell.c \
2008-07-30 13:15:43 +00:00
sqlite3.h
# Source code to the test files.
#
TESTSRC = \
2018-09-18 16:31:37 +00:00
$(TOP)/ext/expert/sqlite3expert.c \
$(TOP)/ext/expert/test_expert.c \
2011-08-17 17:17:32 +00:00
$(TOP)/ext/fts3/fts3_term.c \
$(TOP)/ext/fts3/fts3_test.c \
2016-02-23 15:07:39 +00:00
$(TOP)/ext/rbu/test_rbu.c \
2008-07-30 13:15:43 +00:00
$(TOP)/src/test1.c \
$(TOP)/src/test2.c \
$(TOP)/src/test3.c \
$(TOP)/src/test4.c \
$(TOP)/src/test5.c \
$(TOP)/src/test6.c \
$(TOP)/src/test7.c \
$(TOP)/src/test8.c \
$(TOP)/src/test9.c \
$(TOP)/src/test_autoext.c \
$(TOP)/src/test_async.c \
2009-02-20 20:33:35 +00:00
$(TOP)/src/test_backup.c \
2016-12-05 20:29:15 +00:00
$(TOP)/src/test_bestindex.c \
2015-03-20 14:04:26 +00:00
$(TOP)/src/test_blob.c \
2008-07-30 13:15:43 +00:00
$(TOP)/src/test_btree.c \
$(TOP)/src/test_config.c \
2016-12-05 20:29:15 +00:00
$(TOP)/src/test_delete.c \
2010-07-22 13:16:22 +00:00
$(TOP)/src/test_demovfs.c \
2008-07-30 13:15:43 +00:00
$(TOP)/src/test_devsym.c \
2013-05-21 20:38:11 +00:00
$(TOP)/src/test_fs.c \
2008-07-30 13:15:43 +00:00
$(TOP)/src/test_func.c \
$(TOP)/src/test_hexio.c \
2009-12-03 21:24:07 +00:00
$(TOP)/src/test_init.c \
2009-12-19 20:56:40 +00:00
$(TOP)/src/test_intarray.c \
2009-02-20 20:33:35 +00:00
$(TOP)/src/test_journal.c \
2008-07-30 13:15:43 +00:00
$(TOP)/src/test_malloc.c \
2018-09-18 16:31:37 +00:00
$(TOP)/src/test_md5.c \
2011-02-16 21:14:46 +00:00
$(TOP)/src/test_multiplex.c \
2008-07-30 13:15:43 +00:00
$(TOP)/src/test_mutex.c \
$(TOP)/src/test_onefile.c \
$(TOP)/src/test_osinst.c \
2009-02-20 20:33:35 +00:00
$(TOP)/src/test_pcache.c \
2011-02-16 21:14:46 +00:00
$(TOP)/src/test_quota.c \
$(TOP)/src/test_rtree.c \
2008-07-30 13:15:43 +00:00
$(TOP)/src/test_schema.c \
$(TOP)/src/test_server.c \
2013-01-15 22:38:05 +00:00
$(TOP)/src/test_sqllog.c \
2011-02-16 21:14:46 +00:00
$(TOP)/src/test_superlock.c \
2011-05-06 02:37:34 +00:00
$(TOP)/src/test_syscall.c \
2018-09-18 16:31:37 +00:00
$(TOP)/src/test_tclsh.c \
2008-07-30 13:15:43 +00:00
$(TOP)/src/test_tclvar.c \
$(TOP)/src/test_thread.c \
2010-07-22 13:16:22 +00:00
$(TOP)/src/test_vfs.c \
2016-02-23 15:07:39 +00:00
$(TOP)/src/test_windirent.c \
2018-09-18 16:31:37 +00:00
$(TOP)/src/test_window.c \
2009-12-03 21:24:07 +00:00
$(TOP)/src/test_wsd.c
2008-07-30 13:15:43 +00:00
2013-05-21 20:38:11 +00:00
# Extensions to be statically loaded.
#
TESTSRC += \
$(TOP)/ext/misc/amatch.c \
2016-12-05 20:29:15 +00:00
$(TOP)/ext/misc/carray.c \
2013-05-21 20:38:11 +00:00
$(TOP)/ext/misc/closure.c \
2016-12-05 20:29:15 +00:00
$(TOP)/ext/misc/csv.c \
2015-03-20 14:04:26 +00:00
$(TOP)/ext/misc/eval.c \
2014-09-30 13:40:45 +00:00
$(TOP)/ext/misc/fileio.c \
2013-05-21 20:38:11 +00:00
$(TOP)/ext/misc/fuzzer.c \
$(TOP)/ext/misc/ieee754.c \
2018-09-18 16:31:37 +00:00
$(TOP)/ext/misc/mmapwarm.c \
2013-05-21 20:38:11 +00:00
$(TOP)/ext/misc/nextchar.c \
2018-09-18 16:31:37 +00:00
$(TOP)/ext/misc/normalize.c \
2013-08-29 13:11:18 +00:00
$(TOP)/ext/misc/percentile.c \
2013-05-21 20:38:11 +00:00
$(TOP)/ext/misc/regexp.c \
2017-09-27 21:07:03 +00:00
$(TOP)/ext/misc/remember.c \
2016-02-23 15:07:39 +00:00
$(TOP)/ext/misc/series.c \
2013-05-21 20:38:11 +00:00
$(TOP)/ext/misc/spellfix.c \
2014-04-04 15:16:20 +00:00
$(TOP)/ext/misc/totype.c \
2017-09-27 21:07:03 +00:00
$(TOP)/ext/misc/unionvtab.c \
2014-04-04 15:16:20 +00:00
$(TOP)/ext/misc/wholenumber.c \
2016-02-23 15:07:39 +00:00
$(TOP)/ext/misc/vfslog.c \
2018-09-18 16:31:37 +00:00
$(TOP)/ext/misc/zipfile.c \
2016-02-23 15:07:39 +00:00
$(TOP)/ext/fts5/fts5_tcl.c \
$(TOP)/ext/fts5/fts5_test_mi.c \
2018-09-18 16:31:37 +00:00
$(TOP)/ext/fts5/fts5_test_tok.c
2013-05-21 20:38:11 +00:00
2008-07-30 13:15:43 +00:00
#TESTSRC += $(TOP)/ext/fts2/fts2_tokenizer.c
#TESTSRC += $(TOP)/ext/fts3/fts3_tokenizer.c
TESTSRC2 = \
2010-07-22 13:16:22 +00:00
$(TOP)/src/attach.c \
$(TOP)/src/backup.c \
$(TOP)/src/btree.c \
$(TOP)/src/build.c \
$(TOP)/src/date.c \
2018-09-18 16:31:37 +00:00
$(TOP)/src/dbpage.c \
2015-07-10 19:14:29 +00:00
$(TOP)/src/dbstat.c \
2010-07-22 13:16:22 +00:00
$(TOP)/src/expr.c \
$(TOP)/src/func.c \
$(TOP)/src/insert.c \
$(TOP)/src/wal.c \
2013-05-21 20:38:11 +00:00
$(TOP)/src/main.c \
2010-07-22 13:16:22 +00:00
$(TOP)/src/mem5.c \
$(TOP)/src/os.c \
$(TOP)/src/os_unix.c \
$(TOP)/src/os_win.c \
$(TOP)/src/pager.c \
$(TOP)/src/pragma.c \
$(TOP)/src/prepare.c \
$(TOP)/src/printf.c \
$(TOP)/src/random.c \
$(TOP)/src/pcache.c \
$(TOP)/src/pcache1.c \
$(TOP)/src/select.c \
2015-03-20 14:04:26 +00:00
$(TOP)/src/threads.c \
2010-07-22 13:16:22 +00:00
$(TOP)/src/tokenize.c \
$(TOP)/src/utf.c \
$(TOP)/src/util.c \
$(TOP)/src/vdbeapi.c \
$(TOP)/src/vdbeaux.c \
$(TOP)/src/vdbe.c \
$(TOP)/src/vdbemem.c \
$(TOP)/src/where.c \
2016-02-23 15:07:39 +00:00
$(TOP)/src/wherecode.c \
$(TOP)/src/whereexpr.c \
2010-07-22 13:16:22 +00:00
parse.c \
$(TOP)/ext/fts3/fts3.c \
2011-05-06 02:37:34 +00:00
$(TOP)/ext/fts3/fts3_aux.c \
2010-07-22 13:16:22 +00:00
$(TOP)/ext/fts3/fts3_expr.c \
$(TOP)/ext/fts3/fts3_tokenizer.c \
$(TOP)/ext/fts3/fts3_write.c \
2016-12-05 20:29:15 +00:00
$(TOP)/ext/async/sqlite3async.c \
2018-09-18 16:31:37 +00:00
$(TOP)/ext/misc/stmt.c \
2016-12-05 20:29:15 +00:00
$(TOP)/ext/session/sqlite3session.c \
$(TOP)/ext/session/test_session.c
2008-07-30 13:15:43 +00:00
# Header files used by all library source files.
#
HDR = \
$(TOP)/src/btree.h \
$(TOP)/src/btreeInt.h \
$(TOP)/src/hash.h \
$(TOP)/src/hwtime.h \
keywordhash.h \
2015-03-20 14:04:26 +00:00
$(TOP)/src/msvc.h \
2008-07-30 13:15:43 +00:00
$(TOP)/src/mutex.h \
opcodes.h \
$(TOP)/src/os.h \
$(TOP)/src/os_common.h \
2014-09-30 13:40:45 +00:00
$(TOP)/src/os_setup.h \
$(TOP)/src/os_win.h \
2008-07-30 13:15:43 +00:00
$(TOP)/src/pager.h \
2009-02-20 20:33:35 +00:00
$(TOP)/src/pcache.h \
2008-07-30 13:15:43 +00:00
parse.h \
2015-07-10 19:14:29 +00:00
$(TOP)/src/pragma.h \
2008-07-30 13:15:43 +00:00
sqlite3.h \
$(TOP)/src/sqlite3ext.h \
$(TOP)/src/sqliteInt.h \
$(TOP)/src/sqliteLimit.h \
$(TOP)/src/vdbe.h \
2014-04-04 15:16:20 +00:00
$(TOP)/src/vdbeInt.h \
2015-07-10 19:14:29 +00:00
$(TOP)/src/vxworks.h \
2014-04-04 15:16:20 +00:00
$(TOP)/src/whereInt.h
2008-07-30 13:15:43 +00:00
# Header files used by extensions
#
EXTHDR += \
$(TOP)/ext/fts1/fts1.h \
$(TOP)/ext/fts1/fts1_hash.h \
$(TOP)/ext/fts1/fts1_tokenizer.h
EXTHDR += \
$(TOP)/ext/fts2/fts2.h \
$(TOP)/ext/fts2/fts2_hash.h \
$(TOP)/ext/fts2/fts2_tokenizer.h
EXTHDR += \
$(TOP)/ext/fts3/fts3.h \
2009-12-19 20:56:40 +00:00
$(TOP)/ext/fts3/fts3Int.h \
2008-07-30 13:15:43 +00:00
$(TOP)/ext/fts3/fts3_hash.h \
$(TOP)/ext/fts3/fts3_tokenizer.h
EXTHDR += \
2018-09-18 16:31:37 +00:00
$(TOP)/ext/rtree/rtree.h \
$(TOP)/ext/rtree/geopoly.c
2009-02-20 20:33:35 +00:00
EXTHDR += \
$(TOP)/ext/icu/sqliteicu.h
2016-02-23 15:07:39 +00:00
EXTHDR += \
$(TOP)/ext/fts5/fts5Int.h \
fts5parse.h \
$(TOP)/ext/fts5/fts5.h
2015-03-20 14:04:26 +00:00
EXTHDR += \
$(TOP)/ext/userauth/sqlite3userauth.h
2008-07-30 13:15:43 +00:00
2016-02-23 15:07:39 +00:00
# executables needed for testing
#
TESTPROGS = \
testfixture$(EXE) \
sqlite3$(EXE) \
sqlite3_analyzer$(EXE) \
2018-09-18 16:31:37 +00:00
sqlite3_checker$(EXE) \
2016-12-05 20:29:15 +00:00
sqldiff$(EXE) \
2018-09-18 16:31:37 +00:00
dbhash$(EXE) \
sqltclsh$(EXE)
2016-02-23 15:07:39 +00:00
# Databases containing fuzzer test cases
#
FUZZDATA = \
$(TOP)/test/fuzzdata1.db \
$(TOP)/test/fuzzdata2.db \
$(TOP)/test/fuzzdata3.db \
2017-09-27 21:07:03 +00:00
$(TOP)/test/fuzzdata4.db \
2018-09-18 16:31:37 +00:00
$(TOP)/test/fuzzdata5.db \
$(TOP)/test/fuzzdata6.db
2016-02-23 15:07:39 +00:00
# Standard options to testfixture
#
TESTOPTS = --verbose=file --output=test-out.txt
# Extra compiler options for various shell tools
#
2017-09-27 21:07:03 +00:00
SHELL_OPT += -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5
2018-09-18 16:31:37 +00:00
SHELL_OPT += -DSQLITE_ENABLE_RTREE
2016-12-05 20:29:15 +00:00
SHELL_OPT += -DSQLITE_ENABLE_EXPLAIN_COMMENTS
SHELL_OPT += -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
2017-09-27 21:07:03 +00:00
SHELL_OPT += -DSQLITE_ENABLE_STMTVTAB
2018-09-18 16:31:37 +00:00
SHELL_OPT += -DSQLITE_ENABLE_DBPAGE_VTAB
SHELL_OPT += -DSQLITE_ENABLE_DBSTAT_VTAB
SHELL_OPT += -DSQLITE_ENABLE_OFFSET_SQL_FUNC
SHELL_OPT += -DSQLITE_INTROSPECTION_PRAGMAS
2016-02-23 15:07:39 +00:00
FUZZERSHELL_OPT = -DSQLITE_ENABLE_JSON1
FUZZCHECK_OPT = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMSYS5
2017-09-27 21:07:03 +00:00
FUZZCHECK_OPT += -DSQLITE_MAX_MEMORY=50000000
2018-09-18 16:31:37 +00:00
FUZZCHECK_OPT += -DSQLITE_PRINTF_PRECISION_LIMIT=1000
2017-09-27 21:07:03 +00:00
DBFUZZ_OPT =
KV_OPT = -DSQLITE_THREADSAFE=0 -DSQLITE_DIRECT_OVERFLOW_READ
ST_OPT = -DSQLITE_THREADSAFE=0
2016-02-23 15:07:39 +00:00
2008-07-30 13:15:43 +00:00
# This is the default Makefile target. The objects listed here
# are what get build when you type just "make" with no arguments.
#
all: sqlite3.h libsqlite3.a sqlite3$(EXE)
libsqlite3.a: $(LIBOBJ)
$(AR) libsqlite3.a $(LIBOBJ)
$(RANLIB) libsqlite3.a
2018-09-18 16:31:37 +00:00
sqlite3$(EXE): shell.c libsqlite3.a sqlite3.h
2016-02-23 15:07:39 +00:00
$(TCCX) $(READLINE_FLAGS) -o sqlite3$(EXE) $(SHELL_OPT) \
2018-09-18 16:31:37 +00:00
shell.c libsqlite3.a $(LIBREADLINE) $(TLIBS) $(THREADLIB)
2008-07-30 13:15:43 +00:00
2015-07-10 19:14:29 +00:00
sqldiff$(EXE): $(TOP)/tool/sqldiff.c sqlite3.c sqlite3.h
$(TCCX) -o sqldiff$(EXE) -DSQLITE_THREADSAFE=0 \
2016-02-23 15:07:39 +00:00
$(TOP)/tool/sqldiff.c sqlite3.c $(TLIBS) $(THREADLIB)
2016-12-05 20:29:15 +00:00
dbhash$(EXE): $(TOP)/tool/dbhash.c sqlite3.c sqlite3.h
$(TCCX) -o dbhash$(EXE) -DSQLITE_THREADSAFE=0 \
$(TOP)/tool/dbhash.c sqlite3.c $(TLIBS) $(THREADLIB)
scrub$(EXE): $(TOP)/ext/misc/scrub.c sqlite3.o
$(TCC) -I. -DSCRUB_STANDALONE -o scrub$(EXE) $(TOP)/ext/misc/scrub.c sqlite3.o $(THREADLIB)
2016-02-23 15:07:39 +00:00
srcck1$(EXE): $(TOP)/tool/srcck1.c
$(BCC) -o srcck1$(EXE) $(TOP)/tool/srcck1.c
sourcetest: srcck1$(EXE) sqlite3.c
./srcck1 sqlite3.c
2015-07-10 19:14:29 +00:00
fuzzershell$(EXE): $(TOP)/tool/fuzzershell.c sqlite3.c sqlite3.h
2016-02-23 15:07:39 +00:00
$(TCCX) -o fuzzershell$(EXE) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
$(FUZZERSHELL_OPT) $(TOP)/tool/fuzzershell.c sqlite3.c \
$(TLIBS) $(THREADLIB)
2017-09-27 21:07:03 +00:00
dbfuzz$(EXE): $(TOP)/test/dbfuzz.c sqlite3.c sqlite3.h
$(TCCX) -o dbfuzz$(EXE) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
$(DBFUZZ_OPT) $(TOP)/test/dbfuzz.c sqlite3.c \
$(TLIBS) $(THREADLIB)
fuzzcheck$(EXE): $(TOP)/test/fuzzcheck.c sqlite3.c sqlite3.h $(TOP)/test/ossfuzz.c
2016-02-23 15:07:39 +00:00
$(TCCX) -o fuzzcheck$(EXE) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
2017-09-27 21:07:03 +00:00
-DSQLITE_ENABLE_MEMSYS5 $(FUZZCHECK_OPT) -DSQLITE_OSS_FUZZ \
$(TOP)/test/fuzzcheck.c $(TOP)/test/ossfuzz.c sqlite3.c $(TLIBS) $(THREADLIB)
ossshell$(EXE): $(TOP)/test/ossfuzz.c $(TOP)/test/ossshell.c sqlite3.c sqlite3.h
$(TCCX) -o ossshell$(EXE) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
2016-02-23 15:07:39 +00:00
-DSQLITE_ENABLE_MEMSYS5 $(FUZZCHECK_OPT) \
2017-09-27 21:07:03 +00:00
$(TOP)/test/ossfuzz.c $(TOP)/test/ossshell.c sqlite3.c $(TLIBS) $(THREADLIB)
2015-07-10 19:14:29 +00:00
2018-09-18 16:31:37 +00:00
sessionfuzz$(EXE): $(TOP)/test/sessionfuzz.c sqlite3.c sqlite3.h
$(TCC) -o sessionfuzz$(EXE) $(TOP)/test/sessionfuzz.c -lz $(TLIBS) $(THREADLIB)
2013-05-21 20:38:11 +00:00
mptester$(EXE): sqlite3.c $(TOP)/mptest/mptest.c
$(TCCX) -o $@ -I. $(TOP)/mptest/mptest.c sqlite3.c \
$(TLIBS) $(THREADLIB)
2016-02-23 15:07:39 +00:00
MPTEST1=./mptester$(EXE) mptest1.db $(TOP)/mptest/crash01.test --repeat 20
MPTEST2=./mptester$(EXE) mptest2.db $(TOP)/mptest/multiwrite01.test --repeat 20
2015-07-10 19:14:29 +00:00
mptest: mptester$(EXE)
$(MPTEST1) --journalmode DELETE
$(MPTEST2) --journalmode WAL
$(MPTEST1) --journalmode WAL
$(MPTEST2) --journalmode PERSIST
$(MPTEST1) --journalmode PERSIST
$(MPTEST2) --journalmode TRUNCATE
$(MPTEST1) --journalmode TRUNCATE
$(MPTEST2) --journalmode DELETE
2011-12-26 19:52:17 +00:00
sqlite3.o: sqlite3.c
2014-04-04 15:16:20 +00:00
$(TCCX) -I. -c sqlite3.c
2011-12-26 19:52:17 +00:00
2008-07-30 13:15:43 +00:00
# This target creates a directory named "tsrc" and fills it with
# copies of all of the C source code and header files needed to
# build on the target system. Some of the C source code and header
# files are automatically generated. This target takes care of
# all that automatic generation.
#
2016-02-23 15:07:39 +00:00
target_source: $(SRC) $(TOP)/tool/vdbe-compress.tcl fts5.c
2008-07-30 13:15:43 +00:00
rm -rf tsrc
mkdir tsrc
cp -f $(SRC) tsrc
rm tsrc/sqlite.h.in tsrc/parse.y
2014-04-04 15:16:20 +00:00
tclsh $(TOP)/tool/vdbe-compress.tcl $(OPTS) <tsrc/vdbe.c >vdbe.new
2009-08-11 20:01:51 +00:00
mv vdbe.new tsrc/vdbe.c
2016-02-23 15:07:39 +00:00
cp fts5.c fts5.h tsrc
2008-07-30 13:15:43 +00:00
touch target_source
sqlite3.c: target_source $(TOP)/tool/mksqlite3c.tcl
tclsh $(TOP)/tool/mksqlite3c.tcl
2018-09-18 16:31:37 +00:00
cp tsrc/sqlite3ext.h .
2016-12-05 20:29:15 +00:00
cp $(TOP)/ext/session/sqlite3session.h .
2011-02-16 21:14:46 +00:00
echo '#ifndef USE_SYSTEM_SQLITE' >tclsqlite3.c
cat sqlite3.c >>tclsqlite3.c
echo '#endif /* USE_SYSTEM_SQLITE */' >>tclsqlite3.c
2008-07-30 13:15:43 +00:00
cat $(TOP)/src/tclsqlite.c >>tclsqlite3.c
2016-02-23 15:07:39 +00:00
sqlite3ext.h: target_source
cp tsrc/sqlite3ext.h .
2011-12-26 19:52:17 +00:00
sqlite3.c-debug: target_source $(TOP)/tool/mksqlite3c.tcl
tclsh $(TOP)/tool/mksqlite3c.tcl --linemacros
echo '#ifndef USE_SYSTEM_SQLITE' >tclsqlite3.c
cat sqlite3.c >>tclsqlite3.c
echo '#endif /* USE_SYSTEM_SQLITE */' >>tclsqlite3.c
echo '#line 1 "tclsqlite.c"' >>tclsqlite3.c
cat $(TOP)/src/tclsqlite.c >>tclsqlite3.c
sqlite3-all.c: sqlite3.c $(TOP)/tool/split-sqlite3c.tcl
tclsh $(TOP)/tool/split-sqlite3c.tcl
2008-07-30 13:15:43 +00:00
fts2amal.c: target_source $(TOP)/ext/fts2/mkfts2amal.tcl
tclsh $(TOP)/ext/fts2/mkfts2amal.tcl
fts3amal.c: target_source $(TOP)/ext/fts3/mkfts3amal.tcl
tclsh $(TOP)/ext/fts3/mkfts3amal.tcl
# Rules to build the LEMON compiler generator
#
2016-02-23 15:07:39 +00:00
lemon: $(TOP)/tool/lemon.c $(TOP)/tool/lempar.c
2008-07-30 13:15:43 +00:00
$(BCC) -o lemon $(TOP)/tool/lemon.c
2016-02-23 15:07:39 +00:00
cp $(TOP)/tool/lempar.c .
2008-07-30 13:15:43 +00:00
2018-09-18 16:31:37 +00:00
# A tool to generate the source-id
#
mksourceid: $(TOP)/tool/mksourceid.c
$(BCC) -o mksourceid $(TOP)/tool/mksourceid.c
2008-07-30 13:15:43 +00:00
# Rules to build individual *.o files from generated *.c files. This
# applies to:
#
# parse.o
# opcodes.o
#
%.o: %.c $(HDR)
$(TCCX) -c $<
# Rules to build individual *.o files from files in the src directory.
#
%.o: $(TOP)/src/%.c $(HDR)
$(TCCX) -c $<
tclsqlite.o: $(TOP)/src/tclsqlite.c $(HDR)
$(TCCX) $(TCL_FLAGS) -c $(TOP)/src/tclsqlite.c
# Rules to build opcodes.c and opcodes.h
#
2016-02-23 15:07:39 +00:00
opcodes.c: opcodes.h $(TOP)/tool/mkopcodec.tcl
tclsh $(TOP)/tool/mkopcodec.tcl opcodes.h >opcodes.c
2008-07-30 13:15:43 +00:00
2016-02-23 15:07:39 +00:00
opcodes.h: parse.h $(TOP)/src/vdbe.c $(TOP)/tool/mkopcodeh.tcl
2009-02-20 20:33:35 +00:00
cat parse.h $(TOP)/src/vdbe.c | \
2016-02-23 15:07:39 +00:00
tclsh $(TOP)/tool/mkopcodeh.tcl >opcodes.h
2008-07-30 13:15:43 +00:00
# Rules to build parse.c and parse.h - the outputs of lemon.
#
parse.h: parse.c
2016-02-23 15:07:39 +00:00
parse.c: $(TOP)/src/parse.y lemon $(TOP)/tool/addopcodes.tcl
2008-07-30 13:15:43 +00:00
cp $(TOP)/src/parse.y .
rm -f parse.h
2016-02-23 15:07:39 +00:00
./lemon -s $(OPTS) parse.y
2008-07-30 13:15:43 +00:00
mv parse.h parse.h.temp
2016-02-23 15:07:39 +00:00
tclsh $(TOP)/tool/addopcodes.tcl parse.h.temp >parse.h
2008-07-30 13:15:43 +00:00
2018-09-18 16:31:37 +00:00
sqlite3.h: $(TOP)/src/sqlite.h.in $(TOP)/manifest mksourceid $(TOP)/VERSION $(TOP)/ext/rtree/sqlite3rtree.h
2009-12-03 21:24:07 +00:00
tclsh $(TOP)/tool/mksqlite3h.tcl $(TOP) >sqlite3.h
2008-07-30 13:15:43 +00:00
keywordhash.h: $(TOP)/tool/mkkeywordhash.c
$(BCC) -o mkkeywordhash $(OPTS) $(TOP)/tool/mkkeywordhash.c
./mkkeywordhash >keywordhash.h
2018-09-18 16:31:37 +00:00
# Source files that go into making shell.c
SHELL_SRC = \
$(TOP)/src/shell.c.in \
$(TOP)/ext/misc/appendvfs.c \
$(TOP)/ext/misc/shathree.c \
$(TOP)/ext/misc/fileio.c \
$(TOP)/ext/misc/completion.c \
$(TOP)/ext/misc/sqlar.c \
$(TOP)/ext/expert/sqlite3expert.c \
$(TOP)/ext/expert/sqlite3expert.h \
$(TOP)/ext/misc/zipfile.c \
$(TOP)/src/test_windirent.c
shell.c: $(SHELL_SRC) $(TOP)/tool/mkshellc.tcl
tclsh $(TOP)/tool/mkshellc.tcl >shell.c
2008-07-30 13:15:43 +00:00
# Rules to build the extension objects.
#
icu.o: $(TOP)/ext/icu/icu.c $(HDR) $(EXTHDR)
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/icu/icu.c
fts2.o: $(TOP)/ext/fts2/fts2.c $(HDR) $(EXTHDR)
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2.c
fts2_hash.o: $(TOP)/ext/fts2/fts2_hash.c $(HDR) $(EXTHDR)
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_hash.c
fts2_icu.o: $(TOP)/ext/fts2/fts2_icu.c $(HDR) $(EXTHDR)
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_icu.c
fts2_porter.o: $(TOP)/ext/fts2/fts2_porter.c $(HDR) $(EXTHDR)
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_porter.c
fts2_tokenizer.o: $(TOP)/ext/fts2/fts2_tokenizer.c $(HDR) $(EXTHDR)
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_tokenizer.c
fts2_tokenizer1.o: $(TOP)/ext/fts2/fts2_tokenizer1.c $(HDR) $(EXTHDR)
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_tokenizer1.c
fts3.o: $(TOP)/ext/fts3/fts3.c $(HDR) $(EXTHDR)
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3.c
2011-05-06 02:37:34 +00:00
fts3_aux.o: $(TOP)/ext/fts3/fts3_aux.c $(HDR) $(EXTHDR)
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_aux.c
2009-02-20 20:33:35 +00:00
fts3_expr.o: $(TOP)/ext/fts3/fts3_expr.c $(HDR) $(EXTHDR)
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_expr.c
2008-07-30 13:15:43 +00:00
fts3_hash.o: $(TOP)/ext/fts3/fts3_hash.c $(HDR) $(EXTHDR)
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_hash.c
fts3_icu.o: $(TOP)/ext/fts3/fts3_icu.c $(HDR) $(EXTHDR)
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_icu.c
2009-12-19 20:56:40 +00:00
fts3_snippet.o: $(TOP)/ext/fts3/fts3_snippet.c $(HDR) $(EXTHDR)
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_snippet.c
2008-07-30 13:15:43 +00:00
fts3_porter.o: $(TOP)/ext/fts3/fts3_porter.c $(HDR) $(EXTHDR)
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_porter.c
fts3_tokenizer.o: $(TOP)/ext/fts3/fts3_tokenizer.c $(HDR) $(EXTHDR)
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer.c
fts3_tokenizer1.o: $(TOP)/ext/fts3/fts3_tokenizer1.c $(HDR) $(EXTHDR)
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer1.c
2013-05-21 20:38:11 +00:00
fts3_tokenize_vtab.o: $(TOP)/ext/fts3/fts3_tokenize_vtab.c $(HDR) $(EXTHDR)
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenize_vtab.c
2012-07-18 18:42:52 +00:00
fts3_unicode.o: $(TOP)/ext/fts3/fts3_unicode.c $(HDR) $(EXTHDR)
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_unicode.c
fts3_unicode2.o: $(TOP)/ext/fts3/fts3_unicode2.c $(HDR) $(EXTHDR)
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_unicode2.c
2009-12-19 20:56:40 +00:00
fts3_write.o: $(TOP)/ext/fts3/fts3_write.c $(HDR) $(EXTHDR)
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_write.c
2016-02-23 15:07:39 +00:00
fts5.o: fts5.c
$(TCCX) -DSQLITE_CORE -c fts5.c
json1.o: $(TOP)/ext/misc/json1.c
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/misc/json1.c
2017-09-27 21:07:03 +00:00
stmt.o: $(TOP)/ext/misc/stmt.c
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/misc/stmt.c
2008-07-30 13:15:43 +00:00
rtree.o: $(TOP)/ext/rtree/rtree.c $(HDR) $(EXTHDR)
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/rtree/rtree.c
2016-02-23 15:07:39 +00:00
fts5parse.c: $(TOP)/ext/fts5/fts5parse.y lemon
cp $(TOP)/ext/fts5/fts5parse.y .
rm -f fts5parse.h
./lemon $(OPTS) fts5parse.y
fts5parse.h: fts5parse.c
fts5.c: $(FTS5_SRC) $(FTS5_HDR)
tclsh $(TOP)/ext/fts5/tool/mkfts5c.tcl
cp $(TOP)/ext/fts5/fts5.h .
2018-09-18 16:31:37 +00:00
lsm1.c: $(LSM1_SRC)
tclsh $(TOP)/ext/lsm1/tool/mklsm1c.tcl
cp $(TOP)/ext/lsm1/lsm.h .
2015-03-20 14:04:26 +00:00
userauth.o: $(TOP)/ext/userauth/userauth.c $(HDR) $(EXTHDR)
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/userauth/userauth.c
2016-12-05 20:29:15 +00:00
sqlite3session.o: $(TOP)/ext/session/sqlite3session.c $(HDR) $(EXTHDR)
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/session/sqlite3session.c
2016-02-23 15:07:39 +00:00
sqlite3rbu.o: $(TOP)/ext/rbu/sqlite3rbu.c $(HDR) $(EXTHDR)
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/rbu/sqlite3rbu.c
2008-07-30 13:15:43 +00:00
# Rules for building test programs and for running tests
#
tclsqlite3: $(TOP)/src/tclsqlite.c libsqlite3.a
2018-09-18 16:31:37 +00:00
$(TCCX) $(TCL_FLAGS) -DTCLSH -o tclsqlite3 \
2008-07-30 13:15:43 +00:00
$(TOP)/src/tclsqlite.c libsqlite3.a $(LIBTCL) $(THREADLIB)
2018-09-18 16:31:37 +00:00
sqlite3_analyzer.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl $(TOP)/tool/sqlite3_analyzer.c.in $(TOP)/tool/mkccode.tcl
tclsh $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqlite3_analyzer.c.in >sqlite3_analyzer.c
2011-12-26 19:52:17 +00:00
sqlite3_analyzer$(EXE): sqlite3_analyzer.c
$(TCCX) $(TCL_FLAGS) sqlite3_analyzer.c -o $@ $(LIBTCL) $(THREADLIB)
2008-07-30 13:15:43 +00:00
2018-09-18 16:31:37 +00:00
sqltclsh.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/sqltclsh.tcl $(TOP)/ext/misc/appendvfs.c $(TOP)/tool/mkccode.tcl
tclsh $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqltclsh.c.in >sqltclsh.c
sqltclsh$(EXE): sqltclsh.c
$(TCCX) $(TCL_FLAGS) sqltclsh.c -o $@ $(LIBTCL) $(THREADLIB)
sqlite3_expert$(EXE): $(TOP)/ext/expert/sqlite3expert.h $(TOP)/ext/expert/sqlite3expert.c $(TOP)/ext/expert/expert.c sqlite3.c
$(TCCX) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION $(TOP)/ext/expert/sqlite3expert.c $(TOP)/ext/expert/expert.c sqlite3.c -o sqlite3_expert$(EXE) $(THREADLIB)
CHECKER_DEPS =\
$(TOP)/tool/mkccode.tcl \
sqlite3.c \
$(TOP)/src/tclsqlite.c \
$(TOP)/ext/repair/sqlite3_checker.tcl \
$(TOP)/ext/repair/checkindex.c \
$(TOP)/ext/repair/checkfreelist.c \
$(TOP)/ext/misc/btreeinfo.c \
$(TOP)/ext/repair/sqlite3_checker.c.in
sqlite3_checker.c: $(CHECKER_DEPS)
tclsh $(TOP)/tool/mkccode.tcl $(TOP)/ext/repair/sqlite3_checker.c.in >$@
sqlite3_checker$(TEXE): sqlite3_checker.c
$(TCCX) $(TCL_FLAGS) sqlite3_checker.c -o $@ $(LIBTCL) $(THREADLIB)
2017-09-27 21:07:03 +00:00
dbdump$(EXE): $(TOP)/ext/misc/dbdump.c sqlite3.o
$(TCCX) -DDBDUMP_STANDALONE -o dbdump$(EXE) \
$(TOP)/ext/misc/dbdump.c sqlite3.o $(THREADLIB)
2008-07-30 13:15:43 +00:00
# Rules to build the 'testfixture' application.
#
2010-07-22 13:16:22 +00:00
TESTFIXTURE_FLAGS = -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
2016-12-05 20:29:15 +00:00
TESTFIXTURE_FLAGS += -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE
TESTFIXTURE_FLAGS += -DSQLITE_SERIES_CONSTRAINT_VERIFY=1
TESTFIXTURE_FLAGS += -DSQLITE_DEFAULT_PAGE_SIZE=1024
2017-09-27 21:07:03 +00:00
TESTFIXTURE_FLAGS += -DSQLITE_ENABLE_STMTVTAB
2018-09-18 16:31:37 +00:00
TESTFIXTURE_FLAGS += -DSQLITE_ENABLE_DBPAGE_VTAB
TESTFIXTURE_FLAGS += -DTCLSH_INIT_PROC=sqlite3TestInit
2008-07-30 13:15:43 +00:00
testfixture$(EXE): $(TESTSRC2) libsqlite3.a $(TESTSRC) $(TOP)/src/tclsqlite.c
2018-09-18 16:31:37 +00:00
$(TCCX) $(TCL_FLAGS) $(TESTFIXTURE_FLAGS) \
2008-07-30 13:15:43 +00:00
$(TESTSRC) $(TESTSRC2) $(TOP)/src/tclsqlite.c \
2013-01-15 22:38:05 +00:00
-o testfixture$(EXE) $(LIBTCL) libsqlite3.a $(THREADLIB)
2008-07-30 13:15:43 +00:00
2016-12-05 20:29:15 +00:00
amalgamation-testfixture$(EXE): sqlite3.c $(TESTSRC) $(TOP)/src/tclsqlite.c \
$(TOP)/ext/session/test_session.c
2018-09-18 16:31:37 +00:00
$(TCCX) $(TCL_FLAGS) $(TESTFIXTURE_FLAGS) \
2008-07-30 13:15:43 +00:00
$(TESTSRC) $(TOP)/src/tclsqlite.c sqlite3.c \
2016-12-05 20:29:15 +00:00
$(TOP)/ext/session/test_session.c \
2008-07-30 13:15:43 +00:00
-o testfixture$(EXE) $(LIBTCL) $(THREADLIB)
fts3-testfixture$(EXE): sqlite3.c fts3amal.c $(TESTSRC) $(TOP)/src/tclsqlite.c
2018-09-18 16:31:37 +00:00
$(TCCX) $(TCL_FLAGS) $(TESTFIXTURE_FLAGS) \
2008-07-30 13:15:43 +00:00
-DSQLITE_ENABLE_FTS3=1 \
$(TESTSRC) $(TOP)/src/tclsqlite.c sqlite3.c fts3amal.c \
-o testfixture$(EXE) $(LIBTCL) $(THREADLIB)
2016-02-23 15:07:39 +00:00
fulltest: $(TESTPROGS) fuzztest
./testfixture$(EXE) $(TOP)/test/all.test $(TESTOPTS)
2008-07-30 13:15:43 +00:00
2016-02-23 15:07:39 +00:00
soaktest: $(TESTPROGS)
./testfixture$(EXE) $(TOP)/test/all.test -soak=1 $(TESTOPTS)
2008-07-30 13:15:43 +00:00
2016-02-23 15:07:39 +00:00
fulltestonly: $(TESTPROGS) fuzztest
./testfixture$(EXE) $(TOP)/test/full.test $(TESTOPTS)
2013-01-15 22:38:05 +00:00
2013-08-29 13:11:18 +00:00
queryplantest: testfixture$(EXE) sqlite3$(EXE)
2016-02-23 15:07:39 +00:00
./testfixture$(EXE) $(TOP)/test/permutations.test queryplanner $(TESTOPTS)
2013-08-29 13:11:18 +00:00
2018-09-18 16:31:37 +00:00
fuzztest: fuzzcheck$(EXE) $(FUZZDATA) sessionfuzz$(EXE) $(TOP)/test/sessionfuzz-data1.db
2016-02-23 15:07:39 +00:00
./fuzzcheck$(EXE) $(FUZZDATA)
2018-09-18 16:31:37 +00:00
./sessionfuzz run $(TOP)/test/sessionfuzz-data1.db
2015-07-10 19:14:29 +00:00
2018-09-18 16:31:37 +00:00
fastfuzztest: fuzzcheck$(EXE) $(FUZZDATA) sessionfuzz$(EXE) $(TOP)/test/sessionfuzz-data1.db
2016-02-23 15:07:39 +00:00
./fuzzcheck$(EXE) --limit-mem 100M $(FUZZDATA)
2018-09-18 16:31:37 +00:00
./sessionfuzz run $(TOP)/test/sessionfuzz-data1.db
2015-07-10 19:14:29 +00:00
2018-09-18 16:31:37 +00:00
valgrindfuzz: fuzzcheck$(EXE) $(FUZZDATA) sessionfuzz$(EXE) $(TOP)/test/sessionfuzz-data1.db
2016-02-23 15:07:39 +00:00
valgrind ./fuzzcheck$(EXE) --cell-size-check --limit-mem 10M --timeout 600 $(FUZZDATA)
2018-09-18 16:31:37 +00:00
valgrind ./sessionfuzz run $(TOP)/test/sessionfuzz-data1.db
2016-02-23 15:07:39 +00:00
2017-09-27 21:07:03 +00:00
# The veryquick.test TCL tests.
#
tcltest: ./testfixture$(EXE)
./testfixture$(EXE) $(TOP)/test/veryquick.test $(TESTOPTS)
2016-02-23 15:07:39 +00:00
# A very quick test using only testfixture and omitting all the slower
# tests. Designed to run in under 3 minutes on a workstation.
#
quicktest: ./testfixture$(EXE)
./testfixture$(EXE) $(TOP)/test/extraquick.test $(TESTOPTS)
# The default test case. Runs most of the faster standard TCL tests,
# and fuzz tests, and sqlite3_analyzer and sqldiff tests.
2017-09-27 21:07:03 +00:00
test: fastfuzztest sourcetest $(TESTPROGS) tcltest
2008-07-30 13:15:43 +00:00
2015-07-10 19:14:29 +00:00
# Run a test using valgrind. This can take a really long time
# because valgrind is so much slower than a native machine.
#
2016-02-23 15:07:39 +00:00
valgrindtest: $(TESTPROGS) valgrindfuzz
OMIT_MISUSE=1 valgrind -v \
./testfixture$(EXE) $(TOP)/test/permutations.test valgrind $(TESTOPTS)
# A very fast test that checks basic sanity. The name comes from
# the 60s-era electronics testing: "Turn it on and see if smoke
# comes out."
#
smoketest: $(TESTPROGS) fuzzcheck$(EXE)
./testfixture$(EXE) $(TOP)/test/main.test $(TESTOPTS)
2015-07-10 19:14:29 +00:00
2011-02-16 21:14:46 +00:00
# The next two rules are used to support the "threadtest" target. Building
# threadtest runs a few thread-safety tests that are implemented in C. This
# target is invoked by the releasetest.tcl script.
#
2015-03-20 14:04:26 +00:00
THREADTEST3_SRC = $(TOP)/test/threadtest3.c \
$(TOP)/test/tt3_checkpoint.c \
$(TOP)/test/tt3_index.c \
$(TOP)/test/tt3_vacuum.c \
$(TOP)/test/tt3_stress.c \
$(TOP)/test/tt3_lookaside1.c
2016-02-23 15:07:39 +00:00
threadtest3$(EXE): sqlite3.o $(THREADTEST3_SRC) $(TOP)/src/test_multiplex.c
$(TCCX) $(TOP)/test/threadtest3.c $(TOP)/src/test_multiplex.c sqlite3.o -o $@ $(THREADLIB)
2011-02-16 21:14:46 +00:00
threadtest: threadtest3$(EXE)
./threadtest3$(EXE)
2008-07-30 13:15:43 +00:00
TEST_EXTENSION = $(SHPREFIX)testloadext.$(SO)
$(TEST_EXTENSION): $(TOP)/src/test_loadext.c
$(MKSHLIB) $(TOP)/src/test_loadext.c -o $(TEST_EXTENSION)
extensiontest: testfixture$(EXE) $(TEST_EXTENSION)
./testfixture$(EXE) $(TOP)/test/loadext.test
2014-09-30 13:40:45 +00:00
showdb$(EXE): $(TOP)/tool/showdb.c sqlite3.o
2014-04-04 15:16:20 +00:00
$(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o showdb$(EXE) \
2014-09-30 13:40:45 +00:00
$(TOP)/tool/showdb.c sqlite3.o $(THREADLIB)
showstat4$(EXE): $(TOP)/tool/showstat4.c sqlite3.o
$(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o showstat4$(EXE) \
$(TOP)/tool/showstat4.c sqlite3.o $(THREADLIB)
showjournal$(EXE): $(TOP)/tool/showjournal.c sqlite3.o
$(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o showjournal$(EXE) \
$(TOP)/tool/showjournal.c sqlite3.o $(THREADLIB)
showwal$(EXE): $(TOP)/tool/showwal.c sqlite3.o
$(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o showwal$(EXE) \
$(TOP)/tool/showwal.c sqlite3.o $(THREADLIB)
2018-09-18 16:31:37 +00:00
showshm$(EXE): $(TOP)/tool/showshm.c
$(TCC) -o showshm$(EXE) $(TOP)/tool/showshm.c
2016-12-05 20:29:15 +00:00
changeset$(EXE): $(TOP)/ext/session/changeset.c sqlite3.o
$(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o changeset$(EXE) \
$(TOP)/ext/session/changeset.c sqlite3.o $(THREADLIB)
2014-09-30 13:40:45 +00:00
fts3view$(EXE): $(TOP)/ext/fts3/tool/fts3view.c sqlite3.o
$(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o fts3view$(EXE) \
$(TOP)/ext/fts3/tool/fts3view.c sqlite3.o $(THREADLIB)
rollback-test$(EXE): $(TOP)/tool/rollback-test.c sqlite3.o
$(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o rollback-test$(EXE) \
$(TOP)/tool/rollback-test.c sqlite3.o $(THREADLIB)
2018-09-18 16:31:37 +00:00
atrc$(EXE): $(TOP)/test/atrc.c sqlite3.o
$(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o atrc$(EXE) \
$(TOP)/test/atrc.c sqlite3.o $(THREADLIB)
2014-09-30 13:40:45 +00:00
LogEst$(EXE): $(TOP)/tool/logest.c sqlite3.h
$(TCC) -o LogEst$(EXE) $(TOP)/tool/logest.c
2014-04-04 15:16:20 +00:00
wordcount$(EXE): $(TOP)/test/wordcount.c sqlite3.c
$(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o wordcount$(EXE) \
$(TOP)/test/wordcount.c sqlite3.c
2017-09-27 21:07:03 +00:00
speedtest1$(EXE): $(TOP)/test/speedtest1.c sqlite3.c
$(TCCX) -I. $(ST_OPT) -o speedtest1$(EXE) $(TOP)/test/speedtest1.c sqlite3.c $(THREADLIB)
kvtest$(EXE): $(TOP)/test/kvtest.c sqlite3.c
$(TCCX) -I. $(KV_OPT) -o kvtest$(EXE) $(TOP)/test/kvtest.c sqlite3.c $(THREADLIB)
2016-02-23 15:07:39 +00:00
rbu$(EXE): $(TOP)/ext/rbu/rbu.c $(TOP)/ext/rbu/sqlite3rbu.c sqlite3.o
$(TCC) -I. -o rbu$(EXE) $(TOP)/ext/rbu/rbu.c sqlite3.o \
$(THREADLIB)
loadfts: $(TOP)/tool/loadfts.c libsqlite3.a
$(TCC) $(TOP)/tool/loadfts.c libsqlite3.a -o loadfts $(THREADLIB)
2014-04-04 15:16:20 +00:00
2011-12-26 19:52:17 +00:00
# This target will fail if the SQLite amalgamation contains any exported
# symbols that do not begin with "sqlite3_". It is run as part of the
# releasetest.tcl script.
#
checksymbols: sqlite3.o
nm -g --defined-only sqlite3.o | grep -v " sqlite3_" ; test $$? -ne 0
2016-02-23 15:07:39 +00:00
# Build the amalgamation-autoconf package. The amalamgation-tarball target builds
# a tarball named for the version number. Ex: sqlite-autoconf-3110000.tar.gz.
# The snapshot-tarball target builds a tarball named by the SHA1 hash
2013-08-29 13:11:18 +00:00
#
2015-03-20 14:04:26 +00:00
amalgamation-tarball: sqlite3.c
2016-02-23 15:07:39 +00:00
TOP=$(TOP) sh $(TOP)/tool/mkautoconfamal.sh --normal
snapshot-tarball: sqlite3.c
TOP=$(TOP) sh $(TOP)/tool/mkautoconfamal.sh --snapshot
2013-08-29 13:11:18 +00:00
2008-07-30 13:15:43 +00:00
# Standard install and cleanup targets
#
install: sqlite3 libsqlite3.a sqlite3.h
mv sqlite3 /usr/bin
mv libsqlite3.a /usr/lib
mv sqlite3.h /usr/include
clean:
2011-12-26 19:52:17 +00:00
rm -f *.o sqlite3 sqlite3.exe libsqlite3.a sqlite3.h opcodes.*
rm -f lemon lemon.exe lempar.c parse.* sqlite*.tar.gz
rm -f mkkeywordhash mkkeywordhash.exe keywordhash.h
2008-07-30 13:15:43 +00:00
rm -f $(PUBLISH)
rm -f *.da *.bb *.bbg gmon.out
rm -rf tsrc target_source
rm -f testloadext.dll libtestloadext.so
2011-12-26 19:52:17 +00:00
rm -f amalgamation-testfixture amalgamation-testfixture.exe
rm -f fts3-testfixture fts3-testfixture.exe
rm -f testfixture testfixture.exe
rm -f threadtest3 threadtest3.exe
2014-09-30 13:40:45 +00:00
rm -f LogEst LogEst.exe
rm -f fts3view fts3view.exe
rm -f rollback-test rollback-test.exe
rm -f showdb showdb.exe
rm -f showjournal showjournal.exe
rm -f showstat4 showstat4.exe
rm -f showwal showwal.exe
2016-12-05 20:29:15 +00:00
rm -f changeset changeset.exe
2014-09-30 13:40:45 +00:00
rm -f speedtest1 speedtest1.exe
rm -f wordcount wordcount.exe
2016-02-23 15:07:39 +00:00
rm -f rbu rbu.exe
rm -f srcck1 srcck1.exe
2014-04-04 15:16:20 +00:00
rm -f sqlite3.c sqlite3-*.c fts?amal.c tclsqlite3.c
2013-05-21 20:38:11 +00:00
rm -f sqlite3rc.h
rm -f shell.c sqlite3ext.h
2011-12-26 19:52:17 +00:00
rm -f sqlite3_analyzer sqlite3_analyzer.exe sqlite3_analyzer.c
2018-09-18 16:31:37 +00:00
rm -f sqlite3_expert sqlite3_expert.exe
2013-01-15 22:38:05 +00:00
rm -f sqlite-*-output.vsix
2013-05-21 20:38:11 +00:00
rm -f mptester mptester.exe
2016-02-23 15:07:39 +00:00
rm -f fuzzershell fuzzershell.exe
rm -f fuzzcheck fuzzcheck.exe
2018-09-18 16:31:37 +00:00
rm -f sessionfuzz
2016-02-23 15:07:39 +00:00
rm -f sqldiff sqldiff.exe
rm -f fts5.* fts5parse.*
2018-09-18 16:31:37 +00:00
rm -f lsm.h lsm1.c