sqlite/Makefile.in
stephan d0be4a781e Merge trunk into autosetup branch.
FossilOrigin-Name: 6cbb05fde1b74ced6d56d6ec7f815c989697381531175daccebc4311bfef61d9
2024-10-05 12:06:31 +00:00

1813 lines
58 KiB
Makefile

#!/usr/make
#
# Makefile for SQLITE
#
# This makefile is suppose to be configured automatically using the
# configure script. But if that does not work for you, you can configure
# the makefile manually. Just set the parameters below to values that
# work well for your system.
#
all:
#XX# Lines starting with #XX# are TODOs for the port to autosetup
# The toplevel directory of the source tree. This is the directory
# that contains this "Makefile.in" and the "configure" script.
#
TOP = @abs_top_srcdir@
# Just testing expansions...
# srcdir = @srcdir@
# top_srcdir = @top_srcdir@
# abs_top_srcdir = @abs_top_srcdir@
# abs_top_builddir = @abs_top_builddir@
LDFLAGS_ZLIB = @LDFLAGS_ZLIB@
LDFLAGS_MATH = @LDFLAGS_MATH@
LDFLAGS_RPATH = @LDFLAGS_RPATH@
LDFLAGS_READLINE = @LDFLAGS_READLINE@
LD = @LD@
AR = @AR@
# C Compiler and options for use in building executables that
# will run on the platform that is doing the build.
#
BCC = @BUILD_CC@ @BUILD_CFLAGS@
# TODO: @BUILD_CFLAGS@
#
#XX## TCC is the C Compile and options for use in building executables that
#XX## will run on the target platform. (BCC and TCC are usually the
#XX## same unless your are cross-compiling.) Separate CC and CFLAGS macros
#XX## are provide so that these aspects of the build process can be changed
#XX## on the "make" command-line. Ex: "make CC=clang CFLAGS=-fsanitize=undefined"
#XX##
CC = @CC@
CFLAGS ?= @CFLAGS@
CPPFLAGS ?= @CPPFLAGS@
@if SH_CFLAGS
CFLAGS += @SH_CFLAGS@
@endif
CFLAGS_stdio3 := -I${TOP}/ext/misc
# CFLAGS_stdio3 ==> for sqlite3_stdio.h
TCC = ${CC} ${CFLAGS}
TCC += -I. -I${TOP}/src -I${TOP}/ext/rtree -I${TOP}/ext/icu
TCC += -I${TOP}/ext/fts3 -I${TOP}/ext/async -I${TOP}/ext/session
TCC += -I${TOP}/ext/userauth
# Define this for the autoconf-based build, so that the code knows it can
# include the generated sqlite_cfg.h
#
TCC += -D_HAVE_SQLITE_CONFIG_H -DBUILD_sqlite
# Define -DNDEBUG to compile without debugging (i.e., for production usage)
# Omitting the define will cause extra debugging code to be inserted and
# includes extra comments when "EXPLAIN stmt" is used.
#
TCC += @TARGET_DEBUG@
#XX#
#XX## Compiler options needed for programs that use the TCL library.
#XX##
#XX#TCC += @TCL_INCLUDE_SPEC@
#XX#
#XX## The library that programs using TCL must link against.
#XX##
#XX#LIBTCL = @TCL_LIB_SPEC@
#XX#
# Compiler options needed for programs that use the readline() library.
#
READLINE_FLAGS = -DHAVE_READLINE=@HAVE_READLINE@ @CFLAGS_READLINE@
#XX#READLINE_FLAGS += -DHAVE_EDITLINE=@TARGET_HAVE_EDITLINE@
#XX#READLINE_FLAGS += -DHAVE_LINENOISE=@TARGET_HAVE_LINENOISE@
#XX#
#XX## The library that programs using readline() must link against.
#XX##
#XX#LIBREADLINE = @TARGET_READLINE_LIBS@
#XX#
#XX## Should the database engine be compiled threadsafe
#XX##
#XX#TCC += -DSQLITE_THREADSAFE=@SQLITE_THREADSAFE@
#XX#
# Any target libraries which libsqlite must be linked against
#
TLIBS = @LIBS@ $(LIBS)
#XX#
# Flags controlling use of the in memory btree implementation
#
# SQLITE_TEMP_STORE is 0 to force temporary tables to be in a file, 1 to
# default to file, 2 to default to memory, and 3 to force temporary
# tables to always be in memory.
#
TEMP_STORE = -DSQLITE_TEMP_STORE=@TEMP_STORE@
# Enable/disable loadable extensions, and other optional features
# based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*).
# The same set of OMIT and ENABLE flags should be passed to the
# LEMON parser generator and the mkkeywordhash tool as well.
#
# Add OPTIONS=... on the command line to append additional options
# to the OPT_FEATURE_FLAGS. Note that some flags only work if
# the build is specifically configured to account for them.
#
OPT_FEATURE_FLAGS = @OPT_FEATURE_FLAGS@ $(OPTIONS)
TCC += $(OPT_FEATURE_FLAGS)
# Add in any optional parameters specified on the make commane line
# ie. make "OPTS=-DSQLITE_ENABLE_FOO=1 -DSQLITE_OMIT_FOO=1".
TCC += $(OPTS)
# Add in compile-time options for some libraries used by extensions
TCC += @CFLAGS_ZLIB@
# Version numbers and release number for the SQLite being compiled.
#
VERSION = @VERSION@
RELEASE = @RELEASE@
# Filename extensions for binaries and shared libraries
#
BEXE = @BUILD_EXEEXT@
TEXE = @TARGET_EXEEXT@
BDLL = @BUILD_DLLEXT@
TDLL = @TARGET_DLLEXT@
BLIB = @BUILD_LIBEXT@
TLIB = @TARGET_LIBEXT@
# The following variable is "1" if the configure script was able to locate
# the tclConfig.sh file. It is an empty string otherwise. When this
# variable is "1", the TCL extension library (libtclsqlite3.so) is built
# and installed.
#
HAVE_TCL = @HAVE_TCL@
# This is the command to use for tclsh - normally just "tclsh", but we may
# know the specific version we want to use
#
TCLSH_CMD = @TCLSH_CMD@
# Additional options when running tests using testrunner.tcl
# This is usually either blank, or else --status
#
TSTRNNR_OPTS = @TSTRNNR_OPTS@
#XX## Where do we want to install the tcl plugin
#XX##
#XX#TCLLIBDIR = @TCLLIBDIR@
#
# If gcov support was enabled by the configure script, add the appropriate
# flags here. It's not always as easy as just having the user add the right
# CFLAGS / LDFLAGS, because libtool wants to use CFLAGS when linking, which
# causes build errors with -fprofile-arcs -ftest-coverage with some GCCs.
# Supposedly GCC does the right thing if you use --coverage, but in
# practice it still fails. See:
#
# http://www.mail-archive.com/debian-gcc@lists.debian.org/msg26197.html
#
# for more info.
#
GCOV_CFLAGS1 = -DSQLITE_COVERAGE_TEST=1 -fprofile-arcs -ftest-coverage
GCOV_LDFLAGS1 = -lgcov
USE_GCOV = @USE_GCOV@
TCOMPILE_EXTRAS += $(GCOV_CFLAGS$(USE_GCOV))
TLINK_EXTRAS += $(GCOV_LDFLAGS$(USE_GCOV))
# The directory into which to store package information for
# Some standard variables and programs
#
prefix = @prefix@
exec_prefix = @exec_prefix@
libdir = @libdir@
pkgconfigdir = $(libdir)/pkgconfig
bindir = @bindir@
includedir = @includedir@
INSTALL = @BIN_INSTALL@
#XX#LIBTOOL = ./libtool
#XX#ALLOWRELEASE = @ALLOWRELEASE@
#XX#
#XX## libtool compile/link/install
#XX#TCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(TCC) $(TCOMPILE_EXTRAS)
#XX#TLINK = $(LIBTOOL) --mode=link $(TCC) $(TCOMPILE_EXTRAS) @LDFLAGS@ $(TLINK_EXTRAS)
#XX#LTINSTALL = $(LIBTOOL) --mode=install $(INSTALL)
TCOMPILE = $(TCC) $(TCOMPILE_EXTRAS)
TLINK = $(TCC) $(TLINK_EXTRAS)
TINSTALL = $(INSTALL)
#
# You should not have to change anything below this line
################################################################################
#
# Vars with the AS_ prefix are specifically related to AutoSetup.
#
# AS_AUTO_DEF is the main configure script.
#
AS_AUTO_DEF = $(TOP)/auto.def
USE_AMALGAMATION = @USE_AMALGAMATION@
AMALGAMATION_LINE_MACROS = @AMALGAMATION_LINE_MACROS@
#
# Object files for the SQLite library (non-amalgamation).
#
LIBOBJS0 = alter.o analyze.o attach.o auth.o \
backup.o bitvec.o btmutex.o btree.o build.o \
callback.o complete.o ctime.o \
date.o dbpage.o dbstat.o delete.o \
expr.o fault.o fkey.o \
fts3.o fts3_aux.o fts3_expr.o fts3_hash.o fts3_icu.o \
fts3_porter.o fts3_snippet.o fts3_tokenizer.o fts3_tokenizer1.o \
fts3_tokenize_vtab.o \
fts3_unicode.o fts3_unicode2.o fts3_write.o \
fts5.o \
func.o global.o hash.o \
icu.o insert.o json.o legacy.o loadext.o \
main.o malloc.o mem0.o mem1.o mem2.o mem3.o mem5.o \
memdb.o memjournal.o \
mutex.o mutex_noop.o mutex_unix.o mutex_w32.o \
notify.o opcodes.o os.o os_kv.o os_unix.o os_win.o \
pager.o parse.o pcache.o pcache1.o pragma.o prepare.o printf.o \
random.o resolve.o rowset.o rtree.o \
sqlite3session.o select.o sqlite3rbu.o status.o stmt.o \
table.o threads.o tokenize.o treeview.o trigger.o \
update.o userauth.o upsert.o util.o vacuum.o \
vdbe.o vdbeapi.o vdbeaux.o vdbeblob.o vdbemem.o vdbesort.o \
vdbetrace.o vdbevtab.o \
wal.o walker.o where.o wherecode.o whereexpr.o \
window.o utf.o vtab.o
# Object files for the amalgamation.
#
LIBOBJS1 = sqlite3.o
# Determine the real value of LIBOBJ based on the 'configure' script
#
LIBOBJ = $(LIBOBJS$(USE_AMALGAMATION))
# All of the source code files.
#
SRC = \
$(TOP)/src/alter.c \
$(TOP)/src/analyze.c \
$(TOP)/src/attach.c \
$(TOP)/src/auth.c \
$(TOP)/src/backup.c \
$(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 \
$(TOP)/src/ctime.c \
$(TOP)/src/date.c \
$(TOP)/src/dbpage.c \
$(TOP)/src/dbstat.c \
$(TOP)/src/delete.c \
$(TOP)/src/expr.c \
$(TOP)/src/fault.c \
$(TOP)/src/fkey.c \
$(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/json.c \
$(TOP)/src/legacy.c \
$(TOP)/src/loadext.c \
$(TOP)/src/main.c \
$(TOP)/src/malloc.c \
$(TOP)/src/mem0.c \
$(TOP)/src/mem1.c \
$(TOP)/src/mem2.c \
$(TOP)/src/mem3.c \
$(TOP)/src/mem5.c \
$(TOP)/src/memdb.c \
$(TOP)/src/memjournal.c \
$(TOP)/src/msvc.h \
$(TOP)/src/mutex.c \
$(TOP)/src/mutex.h \
$(TOP)/src/mutex_noop.c \
$(TOP)/src/mutex_unix.c \
$(TOP)/src/mutex_w32.c \
$(TOP)/src/notify.c \
$(TOP)/src/os.c \
$(TOP)/src/os.h \
$(TOP)/src/os_common.h \
$(TOP)/src/os_setup.h \
$(TOP)/src/os_kv.c \
$(TOP)/src/os_unix.c \
$(TOP)/src/os_win.c \
$(TOP)/src/os_win.h \
$(TOP)/src/pager.c \
$(TOP)/src/pager.h \
$(TOP)/src/parse.y \
$(TOP)/src/pcache.c \
$(TOP)/src/pcache.h \
$(TOP)/src/pcache1.c \
$(TOP)/src/pragma.c \
$(TOP)/src/pragma.h \
$(TOP)/src/prepare.c \
$(TOP)/src/printf.c \
$(TOP)/src/random.c \
$(TOP)/src/resolve.c \
$(TOP)/src/rowset.c \
$(TOP)/src/select.c \
$(TOP)/src/status.c \
$(TOP)/src/shell.c.in \
$(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 \
$(TOP)/src/threads.c \
$(TOP)/src/tokenize.c \
$(TOP)/src/treeview.c \
$(TOP)/src/trigger.c \
$(TOP)/src/utf.c \
$(TOP)/src/update.c \
$(TOP)/src/upsert.c \
$(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 \
$(TOP)/src/vdbesort.c \
$(TOP)/src/vdbetrace.c \
$(TOP)/src/vdbevtab.c \
$(TOP)/src/vdbeInt.h \
$(TOP)/src/vtab.c \
$(TOP)/src/vxworks.h \
$(TOP)/src/wal.c \
$(TOP)/src/wal.h \
$(TOP)/src/walker.c \
$(TOP)/src/where.c \
$(TOP)/src/wherecode.c \
$(TOP)/src/whereexpr.c \
$(TOP)/src/whereInt.h \
$(TOP)/src/window.c
# Source code for extensions
#
SRC += \
$(TOP)/ext/fts3/fts3.c \
$(TOP)/ext/fts3/fts3.h \
$(TOP)/ext/fts3/fts3Int.h \
$(TOP)/ext/fts3/fts3_aux.c \
$(TOP)/ext/fts3/fts3_expr.c \
$(TOP)/ext/fts3/fts3_hash.c \
$(TOP)/ext/fts3/fts3_hash.h \
$(TOP)/ext/fts3/fts3_icu.c \
$(TOP)/ext/fts3/fts3_porter.c \
$(TOP)/ext/fts3/fts3_snippet.c \
$(TOP)/ext/fts3/fts3_tokenizer.h \
$(TOP)/ext/fts3/fts3_tokenizer.c \
$(TOP)/ext/fts3/fts3_tokenizer1.c \
$(TOP)/ext/fts3/fts3_tokenize_vtab.c \
$(TOP)/ext/fts3/fts3_unicode.c \
$(TOP)/ext/fts3/fts3_unicode2.c \
$(TOP)/ext/fts3/fts3_write.c
SRC += \
$(TOP)/ext/icu/sqliteicu.h \
$(TOP)/ext/icu/icu.c
SRC += \
$(TOP)/ext/rtree/rtree.h \
$(TOP)/ext/rtree/rtree.c \
$(TOP)/ext/rtree/geopoly.c
SRC += \
$(TOP)/ext/session/sqlite3session.c \
$(TOP)/ext/session/sqlite3session.h
SRC += \
$(TOP)/ext/userauth/userauth.c \
$(TOP)/ext/userauth/sqlite3userauth.h
SRC += \
$(TOP)/ext/rbu/sqlite3rbu.h \
$(TOP)/ext/rbu/sqlite3rbu.c
SRC += \
$(TOP)/ext/misc/stmt.c
# Generated source code files
#
SRC += \
keywordhash.h \
opcodes.c \
opcodes.h \
parse.c \
parse.h \
sqlite_cfg.h \
shell.c \
sqlite3.h
# Source code to the test files.
#
TESTSRC = \
$(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/test8.c \
$(TOP)/src/test9.c \
$(TOP)/src/test_autoext.c \
$(TOP)/src/test_async.c \
$(TOP)/src/test_backup.c \
$(TOP)/src/test_bestindex.c \
$(TOP)/src/test_blob.c \
$(TOP)/src/test_btree.c \
$(TOP)/src/test_config.c \
$(TOP)/src/test_delete.c \
$(TOP)/src/test_demovfs.c \
$(TOP)/src/test_devsym.c \
$(TOP)/src/test_fs.c \
$(TOP)/src/test_func.c \
$(TOP)/src/test_hexio.c \
$(TOP)/src/test_init.c \
$(TOP)/src/test_intarray.c \
$(TOP)/src/test_journal.c \
$(TOP)/src/test_malloc.c \
$(TOP)/src/test_md5.c \
$(TOP)/src/test_multiplex.c \
$(TOP)/src/test_mutex.c \
$(TOP)/src/test_onefile.c \
$(TOP)/src/test_osinst.c \
$(TOP)/src/test_pcache.c \
$(TOP)/src/test_quota.c \
$(TOP)/src/test_rtree.c \
$(TOP)/src/test_schema.c \
$(TOP)/src/test_superlock.c \
$(TOP)/src/test_syscall.c \
$(TOP)/src/test_tclsh.c \
$(TOP)/src/test_tclvar.c \
$(TOP)/src/test_thread.c \
$(TOP)/src/test_vdbecov.c \
$(TOP)/src/test_vfs.c \
$(TOP)/src/test_windirent.c \
$(TOP)/src/test_window.c \
$(TOP)/src/test_wsd.c \
$(TOP)/ext/fts3/fts3_term.c \
$(TOP)/ext/fts3/fts3_test.c \
$(TOP)/ext/session/test_session.c \
$(TOP)/ext/recover/sqlite3recover.c \
$(TOP)/ext/recover/dbdata.c \
$(TOP)/ext/recover/test_recover.c \
$(TOP)/ext/intck/test_intck.c \
$(TOP)/ext/intck/sqlite3intck.c \
$(TOP)/ext/rbu/test_rbu.c
# Statically linked extensions
#
TESTSRC += \
$(TOP)/ext/expert/sqlite3expert.c \
$(TOP)/ext/expert/test_expert.c \
$(TOP)/ext/misc/amatch.c \
$(TOP)/ext/misc/appendvfs.c \
$(TOP)/ext/misc/basexx.c \
$(TOP)/ext/misc/carray.c \
$(TOP)/ext/misc/cksumvfs.c \
$(TOP)/ext/misc/closure.c \
$(TOP)/ext/misc/csv.c \
$(TOP)/ext/misc/decimal.c \
$(TOP)/ext/misc/eval.c \
$(TOP)/ext/misc/explain.c \
$(TOP)/ext/misc/fileio.c \
$(TOP)/ext/misc/fuzzer.c \
$(TOP)/ext/fts5/fts5_tcl.c \
$(TOP)/ext/fts5/fts5_test_mi.c \
$(TOP)/ext/fts5/fts5_test_tok.c \
$(TOP)/ext/misc/ieee754.c \
$(TOP)/ext/misc/mmapwarm.c \
$(TOP)/ext/misc/nextchar.c \
$(TOP)/ext/misc/normalize.c \
$(TOP)/ext/misc/percentile.c \
$(TOP)/ext/misc/prefixes.c \
$(TOP)/ext/misc/qpvtab.c \
$(TOP)/ext/misc/randomjson.c \
$(TOP)/ext/misc/regexp.c \
$(TOP)/ext/misc/remember.c \
$(TOP)/ext/misc/series.c \
$(TOP)/ext/misc/spellfix.c \
$(TOP)/ext/misc/stmtrand.c \
$(TOP)/ext/misc/totype.c \
$(TOP)/ext/misc/unionvtab.c \
$(TOP)/ext/misc/wholenumber.c \
$(TOP)/ext/misc/zipfile.c \
$(TOP)/ext/userauth/userauth.c \
$(TOP)/ext/rtree/test_rtreedoc.c
# Source code to the library files needed by the test fixture
#
TESTSRC2 = \
$(TOP)/src/attach.c \
$(TOP)/src/backup.c \
$(TOP)/src/bitvec.c \
$(TOP)/src/btree.c \
$(TOP)/src/build.c \
$(TOP)/src/ctime.c \
$(TOP)/src/date.c \
$(TOP)/src/dbpage.c \
$(TOP)/src/dbstat.c \
$(TOP)/src/expr.c \
$(TOP)/src/func.c \
$(TOP)/src/global.c \
$(TOP)/src/insert.c \
$(TOP)/src/wal.c \
$(TOP)/src/main.c \
$(TOP)/src/mem5.c \
$(TOP)/src/os.c \
$(TOP)/src/os_kv.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 \
$(TOP)/src/tokenize.c \
$(TOP)/src/treeview.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/vdbetrace.c \
$(TOP)/src/vdbevtab.c \
$(TOP)/src/where.c \
$(TOP)/src/wherecode.c \
$(TOP)/src/whereexpr.c \
$(TOP)/src/window.c \
parse.c \
$(TOP)/ext/fts3/fts3.c \
$(TOP)/ext/fts3/fts3_aux.c \
$(TOP)/ext/fts3/fts3_expr.c \
$(TOP)/ext/fts3/fts3_term.c \
$(TOP)/ext/fts3/fts3_tokenizer.c \
$(TOP)/ext/fts3/fts3_write.c \
$(TOP)/ext/async/sqlite3async.c \
$(TOP)/ext/session/sqlite3session.c \
$(TOP)/ext/misc/stmt.c \
fts5.c
# 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 \
$(TOP)/src/msvc.h \
$(TOP)/src/mutex.h \
opcodes.h \
$(TOP)/src/os.h \
$(TOP)/src/os_common.h \
$(TOP)/src/os_setup.h \
$(TOP)/src/os_win.h \
$(TOP)/src/pager.h \
$(TOP)/src/pcache.h \
parse.h \
$(TOP)/src/pragma.h \
sqlite3.h \
$(TOP)/src/sqlite3ext.h \
$(TOP)/src/sqliteInt.h \
$(TOP)/src/sqliteLimit.h \
$(TOP)/src/vdbe.h \
$(TOP)/src/vdbeInt.h \
$(TOP)/src/vxworks.h \
$(TOP)/src/whereInt.h \
sqlite_cfg.h
# Header files used by extensions
#
EXTHDR += \
$(TOP)/ext/fts3/fts3.h \
$(TOP)/ext/fts3/fts3Int.h \
$(TOP)/ext/fts3/fts3_hash.h \
$(TOP)/ext/fts3/fts3_tokenizer.h
EXTHDR += \
$(TOP)/ext/rtree/rtree.h \
$(TOP)/ext/rtree/geopoly.c
EXTHDR += \
$(TOP)/ext/icu/sqliteicu.h
EXTHDR += \
$(TOP)/ext/rtree/sqlite3rtree.h
EXTHDR += \
$(TOP)/ext/userauth/sqlite3userauth.h
# executables needed for testing
#
TESTPROGS = \
testfixture$(TEXE) \
sqlite3$(TEXE) \
sqlite3_analyzer$(TEXE) \
sqldiff$(TEXE) \
dbhash$(TEXE) \
sqltclsh$(TEXE)
# Databases containing fuzzer test cases
#
FUZZDATA = \
$(TOP)/test/fuzzdata1.db \
$(TOP)/test/fuzzdata2.db \
$(TOP)/test/fuzzdata3.db \
$(TOP)/test/fuzzdata4.db \
$(TOP)/test/fuzzdata5.db \
$(TOP)/test/fuzzdata6.db \
$(TOP)/test/fuzzdata7.db \
$(TOP)/test/fuzzdata8.db
# Standard options to testfixture
#
TESTOPTS = --verbose=file --output=test-out.txt
# Extra compiler options for various shell tools
#
SHELL_OPT = @OPT_SHELL@
SHELL_OPT += -DSQLITE_DQS=0
SHELL_OPT += -DSQLITE_ENABLE_FTS4
#SHELL_OPT += -DSQLITE_ENABLE_FTS5
SHELL_OPT += -DSQLITE_ENABLE_RTREE
SHELL_OPT += -DSQLITE_ENABLE_EXPLAIN_COMMENTS
SHELL_OPT += -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
SHELL_OPT += -DSQLITE_ENABLE_STMTVTAB
SHELL_OPT += -DSQLITE_ENABLE_DBPAGE_VTAB
SHELL_OPT += -DSQLITE_ENABLE_DBSTAT_VTAB
SHELL_OPT += -DSQLITE_ENABLE_BYTECODE_VTAB
SHELL_OPT += -DSQLITE_ENABLE_OFFSET_SQL_FUNC
SHELL_OPT += -DSQLITE_STRICT_SUBTYPE=1
FUZZERSHELL_OPT =
FUZZCHECK_OPT += -I$(TOP)/test
FUZZCHECK_OPT += -I$(TOP)/ext/recover
FUZZCHECK_OPT += \
-DSQLITE_OSS_FUZZ \
-DSQLITE_ENABLE_BYTECODE_VTAB \
-DSQLITE_ENABLE_DBPAGE_VTAB \
-DSQLITE_ENABLE_DBSTAT_VTAB \
-DSQLITE_ENABLE_BYTECODE_VTAB \
-DSQLITE_ENABLE_DESERIALIZE \
-DSQLITE_ENABLE_EXPLAIN_COMMENTS \
-DSQLITE_ENABLE_FTS3_PARENTHESIS \
-DSQLITE_ENABLE_FTS4 \
-DSQLITE_ENABLE_FTS5 \
-DSQLITE_ENABLE_GEOPOLY \
-DSQLITE_ENABLE_MATH_FUNCTIONS \
-DSQLITE_ENABLE_MEMSYS5 \
-DSQLITE_ENABLE_NORMALIZE \
-DSQLITE_ENABLE_OFFSET_SQL_FUNC \
-DSQLITE_ENABLE_PREUPDATE_HOOK \
-DSQLITE_ENABLE_RTREE \
-DSQLITE_ENABLE_SESSION \
-DSQLITE_ENABLE_STMTVTAB \
-DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION \
-DSQLITE_ENABLE_STAT4 \
-DSQLITE_ENABLE_STMT_SCANSTATUS \
-DSQLITE_MAX_MEMORY=50000000 \
-DSQLITE_MAX_MMAP_SIZE=0 \
-DSQLITE_OMIT_LOAD_EXTENSION \
-DSQLITE_PRINTF_PRECISION_LIMIT=1000 \
-DSQLITE_PRIVATE="" \
-DSQLITE_STRICT_SUBTYPE=1 \
-DSQLITE_STATIC_RANDOMJSON
FUZZCHECK_SRC += $(TOP)/test/fuzzcheck.c
FUZZCHECK_SRC += $(TOP)/test/ossfuzz.c
FUZZCHECK_SRC += $(TOP)/test/fuzzinvariants.c
FUZZCHECK_SRC += $(TOP)/ext/recover/dbdata.c
FUZZCHECK_SRC += $(TOP)/ext/recover/sqlite3recover.c
FUZZCHECK_SRC += $(TOP)/test/vt02.c
FUZZCHECK_SRC += $(TOP)/ext/misc/percentile.c
FUZZCHECK_SRC += $(TOP)/ext/misc/randomjson.c
DBFUZZ_OPT =
ST_OPT = -DSQLITE_OS_KV_OPTIONAL
# In wasi-sdk builds, disable the CLI shell build.
@if HAVE_WASI_SDK
SQLITE3_SHELL_TARGET =
@else
SQLITE3_SHELL_TARGET = sqlite3$(TEXE)
@endif
#XXX#??? SQLITE3_O = $(TOP)/sqlite3.o
# Use $(libtclsqlite3.la_$(HAVE_TCL)) to resolve to either
# libtclsqlite3.la or an empty value.
libtclsqlite3.la_0 =
libtclsqlite3.la_1 = libtclsqlite3.la
#
# 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 sqlite3.c shell.c $(SQLITE3_SHELL_TARGET)
#all: libsqlite3.la \
#XX# $(libtclsqlite3.la_$(HAVE_TCL))
# Re-run $(TOP)/configure with the same args invoked to produce this
# makefile.
#
AUTOREMAKE = @SQLITE_AUTOREMAKE@
Makefile: $(TOP)/Makefile.in $(AS_AUTO_DEF)
$(AUTOREMAKE)
@touch $@
sqlite3.pc: $(TOP)/sqlite3.pc.in $(AS_AUTO_DEF)
$(AUTOREMAKE)
@touch $@
sqlite_cfg.h: $(TOP)/sqlite_cfg.h.in $(AS_AUTO_DEF)
$(AUTOREMAKE)
@touch $@
libsqlite3.DLL = libsqlite3$(TDLL)
libsqlite3.LIB = libsqlite3$(TLIB)
LDFLAGS_libsqlite = \
$(LDFLAGS_RPATH) $(TLIBS) $(LDFLAGS_MATH) $(LDFLAGS_ZLIB)
# LDFLAGS_libsqlite should be used with any target which
# either results in building libsqlite3.so, builds sqlite3.c
# directly, links in either of $(LIBOBJSO) or $(LIBOBJS1).
$(libsqlite3.DLL): $(LIBOBJ)
$(TLINK) -o $@ \
@SHOBJ_LDFLAGS@ $(LIBOBJ) $(TLIBS) \
$(LDFLAGS_libsqlite)
dll: $(libsqlite3.DLL)
all: dll
$(libsqlite3.LIB): $(LIBOBJ)
$(AR) crs $@ $(LIBOBJ)
lib: $(libsqlite3.LIB)
all: lib
#XX#libtclsqlite3.la: tclsqlite.lo libsqlite3.la
#XX# $(TLINK) -no-undefined -o $@ tclsqlite.lo \
#XX# libsqlite3.la @TCL_STUB_LIB_SPEC@ $(TLIBS) \
#XX# -rpath "$(TCLLIBDIR)" \
#XX# -version-info "8:6:8" \
#XX# -avoid-version
sqlite3$(TEXE): shell.c sqlite3.c
$(TCC) $(READLINE_FLAGS) $(SHELL_OPT) -o $@ \
shell.c sqlite3.c \
$(LDFLAGS_libsqlite) $(LDFLAGS_READLINE)
cli: sqlite3$(TEXE)
all: cli
sqldiff$(TEXE): $(TOP)/tool/sqldiff.c $(TOP)/ext/misc/sqlite3_stdio.h sqlite3.o sqlite3.h
$(TLINK) $(CFLAGS_stdio3) -o $@ $(TOP)/tool/sqldiff.c sqlite3.o $(LDFLAGS_libsqlite)
dbhash$(TEXE): $(TOP)/tool/dbhash.c sqlite3.o sqlite3.h
$(TLINK) -o $@ $(TOP)/tool/dbhash.c sqlite3.o $(LDFLAGS_libsqlite)
RSYNC_SRC = \
$(TOP)/tool/sqlite3-rsync.c \
sqlite3.c
RSYNC_OPT = \
-DSQLITE_ENABLE_DBPAGE_VTAB \
-USQLITE_THREADSAFE \
-DSQLITE_THREADSAFE=0 \
-DSQLITE_OMIT_LOAD_EXTENSION \
-DSQLITE_OMIT_DEPRECATED
sqlite3-rsync$(TEXE): $(RSYNC_SRC)
$(TCC) -o $@ $(RSYNC_OPT) $(RSYNC_SRC) $(LDFLAGS_libsqlite)
scrub$(TEXE): $(TOP)/ext/misc/scrub.c sqlite3.lo
$(TLINK) -o $@ -I. -DSCRUB_STANDALONE \
$(TOP)/ext/misc/scrub.c sqlite3.lo $(LDFLAGS_libsqlite)
srcck1$(BEXE): $(TOP)/tool/srcck1.c
$(BCC) -o srcck1$(BEXE) $(TOP)/tool/srcck1.c
sourcetest: srcck1$(BEXE) sqlite3.c
./srcck1 sqlite3.c
src-verify: $(TOP)/tool/src-verify.c
$(BCC) -o src-verify$(BEXE) $(TOP)/tool/src-verify.c
# JimTCL is part of the autosetup suite and is suitable for certain
# in-tree TCL jobs, but it requires that we build it with non-default
# flags. Note that the build tree will, if no system-level tclsh is
# found, also have a ./jimsh0. That one is a bare-bones build for the
# configure process, whereas we need to build it with another option
# enabled for use with the various code generators.
#
JIMSH = @srcdir@/jimsh
@if CFLAGS_JIMSH
$(JIMSH): $(TOP)/autosetup/jimsh0.c Makefile
$(BCC) -o $(JIMSH) @CFLAGS_JIMSH@ $<
@endif
# BTCL is the tclsh-compatible app used for running various code
# generators and other in-tree tools, as opposed to the TCL-based
# tests, which must be built and run using the canonical TCL
# distribution.
BTCL = @BTCL@
$(BTCL):
#XX#
#XX#verify-source: ./src-verify
#XX# ./src-verify $(TOP)
#XX#
#XX#fuzzershell$(TEXE): $(TOP)/tool/fuzzershell.c sqlite3.c sqlite3.h
#XX# $(TLINK) -o $@ $(FUZZERSHELL_OPT) \
#XX# $(TOP)/tool/fuzzershell.c sqlite3.c $(TLIBS)
#XX#
#XX#fuzzcheck$(TEXE): $(FUZZCHECK_SRC) sqlite3.c sqlite3.h $(FUZZCHECK_DEP)
#XX# $(TLINK) -o $@ $(FUZZCHECK_OPT) $(FUZZCHECK_SRC) sqlite3.c $(TLIBS)
#XX#
#XX#fuzzcheck-asan$(TEXE): $(FUZZCHECK_SRC) sqlite3.c sqlite3.h $(FUZZCHECK_DEP)
#XX# $(TLINK) -o $@ -fsanitize=address $(FUZZCHECK_OPT) $(FUZZCHECK_SRC) sqlite3.c $(TLIBS)
#XX#
#XX#fuzzcheck-ubsan$(TEXE): $(FUZZCHECK_SRC) sqlite3.c sqlite3.h $(FUZZCHECK_DEP)
#XX# $(TLINK) -o $@ -fsanitize=undefined $(FUZZCHECK_OPT) $(FUZZCHECK_SRC) sqlite3.c $(TLIBS)
#XX#
#XX## Usage: FUZZDB=filename make run-fuzzcheck
#XX##
#XX## Where filename is a fuzzcheck database, this target builds and runs
#XX## fuzzcheck, fuzzcheck-asan, and fuzzcheck-ubsan on that database.
#XX##
#XX## FUZZDB can be a glob pattern of two or more databases. Example:
#XX##
#XX## FUZZDB=test/fuzzdata*.db make run-fuzzcheck
#XX##
#XX#run-fuzzcheck: fuzzcheck$(TEXE) fuzzcheck-asan$(TEXE) fuzzcheck-ubsan$(TEXE)
#XX# @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi
#XX# ./fuzzcheck$(TEXE) --spinner $(FUZZDB)
#XX# ./fuzzcheck-asan$(TEXE) --spinner $(FUZZDB)
#XX# ./fuzzcheck-ubsan$(TEXE) --spinner $(FUZZDB)
#XX#
#XX#ossshell$(TEXE): $(TOP)/test/ossfuzz.c $(TOP)/test/ossshell.c sqlite3.c sqlite3.h
#XX# $(TLINK) -o $@ $(FUZZCHECK_OPT) $(TOP)/test/ossshell.c \
#XX# $(TOP)/test/ossfuzz.c sqlite3.c $(TLIBS)
#XX#
#XX#sessionfuzz$(TEXE): $(TOP)/test/sessionfuzz.c sqlite3.c sqlite3.h
#XX# $(TLINK) -o $@ $(TOP)/test/sessionfuzz.c $(TLIBS)
#XX#
#XX#dbfuzz$(TEXE): $(TOP)/test/dbfuzz.c sqlite3.c sqlite3.h
#XX# $(TLINK) -o $@ $(DBFUZZ_OPT) $(TOP)/test/dbfuzz.c sqlite3.c $(TLIBS)
#XX#
#XX#DBFUZZ2_OPTS = \
#XX# -DSQLITE_THREADSAFE=0 \
#XX# -DSQLITE_OMIT_LOAD_EXTENSION \
#XX# -DSQLITE_DEBUG \
#XX# -DSQLITE_ENABLE_DBSTAT_VTAB \
#XX# -DSQLITE_ENABLE_BYTECODE_VTAB \
#XX# -DSQLITE_ENABLE_RTREE \
#XX# -DSQLITE_ENABLE_FTS4 \
#XX# -DSQLITE_ENABLE_FTS5
#XX#
#XX#dbfuzz2$(TEXE): $(TOP)/test/dbfuzz2.c sqlite3.c sqlite3.h
#XX# $(CC) $(OPT_FEATURE_FLAGS) $(OPTS) -I. -g -O0 \
#XX# -DSTANDALONE -o dbfuzz2 \
#XX# $(DBFUZZ2_OPTS) $(TOP)/test/dbfuzz2.c sqlite3.c $(TLIBS)
#XX# mkdir -p dbfuzz2-dir
#XX# cp $(TOP)/test/dbfuzz2-seed* dbfuzz2-dir
#XX#
#XX#dbfuzz2-asan: $(TOP)/test/dbfuzz2.c sqlite3.c sqlite3.h
#XX# clang-6.0 $(OPT_FEATURE_FLAGS) $(OPTS) -I. -g -O0 \
#XX# -fsanitize=fuzzer,undefined,address -o dbfuzz2-asan \
#XX# $(DBFUZZ2_OPTS) $(TOP)/test/dbfuzz2.c sqlite3.c $(TLIBS)
#XX# mkdir -p dbfuzz2-dir
#XX# cp $(TOP)/test/dbfuzz2-seed* dbfuzz2-dir
#XX#
#XX#dbfuzz2-msan: $(TOP)/test/dbfuzz2.c sqlite3.c sqlite3.h
#XX# clang-6.0 $(OPT_FEATURE_FLAGS) $(OPTS) -I. -g -O0 \
#XX# -fsanitize=fuzzer,undefined,memory -o dbfuzz2-msan \
#XX# $(DBFUZZ2_OPTS) $(TOP)/test/dbfuzz2.c sqlite3.c $(TLIBS)
#XX# mkdir -p dbfuzz2-dir
#XX# cp $(TOP)/test/dbfuzz2-seed* dbfuzz2-dir
#XX#
#XX#mptester$(TEXE): sqlite3.lo $(TOP)/mptest/mptest.c
#XX# $(TLINK) -o $@ -I. $(TOP)/mptest/mptest.c sqlite3.lo \
#XX# $(TLIBS) -rpath "$(libdir)"
#XX#
#XX#MPTEST1=./mptester$(TEXE) mptest.db $(TOP)/mptest/crash01.test --repeat 20
#XX#MPTEST2=./mptester$(TEXE) mptest.db $(TOP)/mptest/multiwrite01.test --repeat 20
#XX#mptest: mptester$(TEXE)
#XX# rm -f mptest.db
#XX# $(MPTEST1) --journalmode DELETE
#XX# $(MPTEST2) --journalmode WAL
#XX# $(MPTEST1) --journalmode WAL
#XX# $(MPTEST2) --journalmode PERSIST
#XX# $(MPTEST1) --journalmode PERSIST
#XX# $(MPTEST2) --journalmode TRUNCATE
#XX# $(MPTEST1) --journalmode TRUNCATE
#XX# $(MPTEST2) --journalmode DELETE
#XX#
#XX#
has_tclsh84:
sh $(TOP)/tool/cktclsh.sh 8.4 $(TCLSH_CMD)
touch has_tclsh84
has_tclsh85:
sh $(TOP)/tool/cktclsh.sh 8.5 $(TCLSH_CMD)
touch has_tclsh85
#XX#has_tclconfig:
#XX# @ if test x"$(HAVE_TCL)" != "x1"; then echo 'ERROR: Requires access to "tclConfig.sh" which "configure" was not able to locate'; exit 1; fi
#XX# touch has_tclconfig
#XX#
#XX#
# 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.
#
.target_source: $(SRC) $(TOP)/tool/vdbe-compress.tcl fts5.c $(BTCL) # has_tclsh84
rm -rf tsrc
mkdir tsrc
cp -f $(SRC) tsrc
rm tsrc/sqlite.h.in tsrc/parse.y
$(BTCL) $(TOP)/tool/vdbe-compress.tcl $(OPTS) <tsrc/vdbe.c >vdbe.new
mv vdbe.new tsrc/vdbe.c
cp fts5.c fts5.h tsrc
touch .target_source
sqlite3.c: .target_source $(TOP)/tool/mksqlite3c.tcl src-verify \
$(BTCL) # has_tclsh84
$(BTCL) $(TOP)/tool/mksqlite3c.tcl $(AMALGAMATION_LINE_MACROS) $(EXTRA_SRC)
cp tsrc/sqlite3ext.h .
cp $(TOP)/ext/session/sqlite3session.h .
sqlite3r.h: sqlite3.h $(BTCL) # has_tclsh84
$(BTCL) $(TOP)/tool/mksqlite3h.tcl $(TOP) --enable-recover >sqlite3r.h
sqlite3r.c: sqlite3.c sqlite3r.h $(BTCL) # has_tclsh84
cp $(TOP)/ext/recover/sqlite3recover.c tsrc/
cp $(TOP)/ext/recover/sqlite3recover.h tsrc/
cp $(TOP)/ext/recover/dbdata.c tsrc/
$(BTCL) $(TOP)/tool/mksqlite3c.tcl --enable-recover $(AMALGAMATION_LINE_MACROS) $(EXTRA_SRC)
sqlite3ext.h: .target_source
cp tsrc/sqlite3ext.h .
#XX#tclsqlite3.c: sqlite3.c
#XX# echo '#ifndef USE_SYSTEM_SQLITE' >tclsqlite3.c
#XX# cat sqlite3.c >>tclsqlite3.c
#XX# echo '#endif /* USE_SYSTEM_SQLITE */' >>tclsqlite3.c
#XX# cat $(TOP)/src/tclsqlite.c >>tclsqlite3.c
#XX#
#XX#sqlite3-all.c: sqlite3.c $(TOP)/tool/split-sqlite3c.tcl has_tclsh84
#XX# $(TCLSH_CMD) $(TOP)/tool/split-sqlite3c.tcl
#XX#
#XX## Rule to build the amalgamation
#XX##
#XX#sqlite3.lo: sqlite3.c
#XX# $(TCOMPILE) $(TEMP_STORE) -c sqlite3.c
# Rules to build the LEMON compiler generator
#
lemon$(BEXE): $(TOP)/tool/lemon.c $(TOP)/tool/lempar.c
$(BCC) -o $@ $(TOP)/tool/lemon.c
cp $(TOP)/tool/lempar.c .
# Rules to build the program that generates the source-id
#
mksourceid$(BEXE): $(TOP)/tool/mksourceid.c
$(BCC) -o $@ $(TOP)/tool/mksourceid.c
# Rules to build individual *.o files from generated *.c files. This
# applies to:
#
# parse.o
# opcodes.o
#
parse.o: parse.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c parse.c
opcodes.o: opcodes.c
$(TCOMPILE) $(TEMP_STORE) -c opcodes.c
# Rules to build individual *.o files from files in the src directory.
#
alter.o: $(TOP)/src/alter.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/alter.c
analyze.o: $(TOP)/src/analyze.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/analyze.c
attach.o: $(TOP)/src/attach.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/attach.c
auth.o: $(TOP)/src/auth.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/auth.c
backup.o: $(TOP)/src/backup.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/backup.c
bitvec.o: $(TOP)/src/bitvec.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/bitvec.c
btmutex.o: $(TOP)/src/btmutex.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/btmutex.c
btree.o: $(TOP)/src/btree.c $(HDR) $(TOP)/src/pager.h
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/btree.c
build.o: $(TOP)/src/build.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/build.c
callback.o: $(TOP)/src/callback.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/callback.c
complete.o: $(TOP)/src/complete.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/complete.c
ctime.o: $(TOP)/src/ctime.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/ctime.c
date.o: $(TOP)/src/date.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/date.c
dbpage.o: $(TOP)/src/dbpage.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/dbpage.c
dbstat.o: $(TOP)/src/dbstat.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/dbstat.c
delete.o: $(TOP)/src/delete.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/delete.c
expr.o: $(TOP)/src/expr.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/expr.c
fault.o: $(TOP)/src/fault.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/fault.c
fkey.o: $(TOP)/src/fkey.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/fkey.c
func.o: $(TOP)/src/func.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/func.c
global.o: $(TOP)/src/global.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/global.c
hash.o: $(TOP)/src/hash.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/hash.c
insert.o: $(TOP)/src/insert.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/insert.c
json.o: $(TOP)/src/json.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/json.c
legacy.o: $(TOP)/src/legacy.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/legacy.c
loadext.o: $(TOP)/src/loadext.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/loadext.c
main.o: $(TOP)/src/main.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/main.c
malloc.o: $(TOP)/src/malloc.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/malloc.c
mem0.o: $(TOP)/src/mem0.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem0.c
mem1.o: $(TOP)/src/mem1.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem1.c
mem2.o: $(TOP)/src/mem2.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem2.c
mem3.o: $(TOP)/src/mem3.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem3.c
mem5.o: $(TOP)/src/mem5.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem5.c
memdb.o: $(TOP)/src/memdb.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/memdb.c
memjournal.o: $(TOP)/src/memjournal.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/memjournal.c
mutex.o: $(TOP)/src/mutex.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex.c
mutex_noop.o: $(TOP)/src/mutex_noop.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex_noop.c
mutex_unix.o: $(TOP)/src/mutex_unix.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex_unix.c
mutex_w32.o: $(TOP)/src/mutex_w32.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex_w32.c
notify.o: $(TOP)/src/notify.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/notify.c
pager.o: $(TOP)/src/pager.c $(HDR) $(TOP)/src/pager.h
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pager.c
pcache.o: $(TOP)/src/pcache.c $(HDR) $(TOP)/src/pcache.h
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pcache.c
pcache1.o: $(TOP)/src/pcache1.c $(HDR) $(TOP)/src/pcache.h
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pcache1.c
os.o: $(TOP)/src/os.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os.c
os_kv.o: $(TOP)/src/os_kv.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os_kv.c
os_unix.o: $(TOP)/src/os_unix.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os_unix.c
os_win.o: $(TOP)/src/os_win.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os_win.c
pragma.o: $(TOP)/src/pragma.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pragma.c
prepare.o: $(TOP)/src/prepare.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/prepare.c
printf.o: $(TOP)/src/printf.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/printf.c
random.o: $(TOP)/src/random.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/random.c
resolve.o: $(TOP)/src/resolve.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/resolve.c
rowset.o: $(TOP)/src/rowset.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/rowset.c
select.o: $(TOP)/src/select.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/select.c
status.o: $(TOP)/src/status.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/status.c
table.o: $(TOP)/src/table.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/table.c
threads.o: $(TOP)/src/threads.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/threads.c
tokenize.o: $(TOP)/src/tokenize.c keywordhash.h $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/tokenize.c
treeview.o: $(TOP)/src/treeview.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/treeview.c
trigger.o: $(TOP)/src/trigger.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/trigger.c
update.o: $(TOP)/src/update.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/update.c
upsert.o: $(TOP)/src/upsert.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/upsert.c
utf.o: $(TOP)/src/utf.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/utf.c
util.o: $(TOP)/src/util.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/util.c
vacuum.o: $(TOP)/src/vacuum.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vacuum.c
vdbe.o: $(TOP)/src/vdbe.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbe.c
vdbeapi.o: $(TOP)/src/vdbeapi.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbeapi.c
vdbeaux.o: $(TOP)/src/vdbeaux.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbeaux.c
vdbeblob.o: $(TOP)/src/vdbeblob.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbeblob.c
vdbemem.o: $(TOP)/src/vdbemem.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbemem.c
vdbesort.o: $(TOP)/src/vdbesort.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbesort.c
vdbetrace.o: $(TOP)/src/vdbetrace.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbetrace.c
vdbevtab.o: $(TOP)/src/vdbevtab.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbevtab.c
vtab.o: $(TOP)/src/vtab.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vtab.c
wal.o: $(TOP)/src/wal.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/wal.c
walker.o: $(TOP)/src/walker.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/walker.c
where.o: $(TOP)/src/where.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/where.c
wherecode.o: $(TOP)/src/wherecode.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/wherecode.c
whereexpr.o: $(TOP)/src/whereexpr.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/whereexpr.c
window.o: $(TOP)/src/window.c $(HDR)
$(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/window.c
#XX#tclsqlite.o: $(TOP)/src/tclsqlite.c $(HDR)
#XX# $(TCOMPILE) -DUSE_TCL_STUBS=1 -c $(TOP)/src/tclsqlite.c
#XX#
#XX#tclsqlite-shell.o: $(TOP)/src/tclsqlite.c $(HDR)
#XX# $(TCOMPILE) -DTCLSH -o $@ -c $(TOP)/src/tclsqlite.c
#XX#
#XX#tclsqlite-stubs.o: $(TOP)/src/tclsqlite.c $(HDR)
#XX# $(TCOMPILE) -DUSE_TCL_STUBS=1 -o $@ -c $(TOP)/src/tclsqlite.c
#XX#
#XX#tclsqlite3$(TEXE): has_tclconfig tclsqlite-shell.lo libsqlite3.la
#XX# $(TLINK) -o $@ tclsqlite-shell.lo \
#XX# libsqlite3.la $(LIBTCL)
# Rules to build opcodes.c and opcodes.h
#
opcodes.c: opcodes.h $(TOP)/tool/mkopcodec.tcl $(BTCL) # has_tclsh84
$(BTCL) $(TOP)/tool/mkopcodec.tcl opcodes.h >opcodes.c
opcodes.h: parse.h $(TOP)/src/vdbe.c \
$(TOP)/tool/mkopcodeh.tcl $(BTCL) # has_tclsh84
cat parse.h $(TOP)/src/vdbe.c | $(BTCL) $(TOP)/tool/mkopcodeh.tcl >opcodes.h
# Rules to build parse.c and parse.h - the outputs of lemon.
#
parse.h: parse.c
parse.c: $(TOP)/src/parse.y lemon$(BEXE)
cp $(TOP)/src/parse.y .
./lemon$(BEXE) $(OPT_FEATURE_FLAGS) $(OPTS) -S parse.y
sqlite3.h: $(TOP)/src/sqlite.h.in $(TOP)/manifest mksourceid$(BEXE) \
$(TOP)/VERSION $(BTCL) # has_tclsh84
$(BTCL) $(TOP)/tool/mksqlite3h.tcl $(TOP) >sqlite3.h
#XX#sqlite3rc.h: $(TOP)/src/sqlite3.rc $(TOP)/VERSION has_tclsh84
#XX# echo '#ifndef SQLITE_RESOURCE_VERSION' >$@
#XX# echo -n '#define SQLITE_RESOURCE_VERSION ' >>$@
#XX# cat $(TOP)/VERSION | $(TCLSH_CMD) $(TOP)/tool/replace.tcl exact . , >>$@
#XX# echo '#endif' >>sqlite3rc.h
keywordhash.h: $(TOP)/tool/mkkeywordhash.c
$(BCC) -o mkkeywordhash$(BEXE) $(OPT_FEATURE_FLAGS) $(OPTS) $(TOP)/tool/mkkeywordhash.c
./mkkeywordhash$(BEXE) >keywordhash.h
# Source and header files that shell.c depends on
SHELL_DEP = \
$(TOP)/src/shell.c.in \
$(TOP)/ext/consio/console_io.c \
$(TOP)/ext/consio/console_io.h \
$(TOP)/ext/expert/sqlite3expert.c \
$(TOP)/ext/expert/sqlite3expert.h \
$(TOP)/ext/intck/sqlite3intck.c \
$(TOP)/ext/intck/sqlite3intck.h \
$(TOP)/ext/misc/appendvfs.c \
$(TOP)/ext/misc/base64.c \
$(TOP)/ext/misc/base85.c \
$(TOP)/ext/misc/completion.c \
$(TOP)/ext/misc/decimal.c \
$(TOP)/ext/misc/fileio.c \
$(TOP)/ext/misc/ieee754.c \
$(TOP)/ext/misc/memtrace.c \
$(TOP)/ext/misc/pcachetrace.c \
$(TOP)/ext/misc/percentile.c \
$(TOP)/ext/misc/regexp.c \
$(TOP)/ext/misc/series.c \
$(TOP)/ext/misc/sha1.c \
$(TOP)/ext/misc/shathree.c \
$(TOP)/ext/misc/sqlar.c \
$(TOP)/ext/misc/uint.c \
$(TOP)/ext/misc/vfstrace.c \
$(TOP)/ext/misc/zipfile.c \
$(TOP)/ext/recover/dbdata.c \
$(TOP)/ext/recover/sqlite3recover.c \
$(TOP)/ext/recover/sqlite3recover.h \
$(TOP)/src/test_windirent.c \
$(TOP)/src/test_windirent.h
shell.c: $(SHELL_DEP) $(TOP)/tool/mkshellc.tcl $(BTCL) # has_tclsh84
$(BTCL) $(TOP)/tool/mkshellc.tcl >shell.c
# Rules to build the extension objects.
#
icu.o: $(TOP)/ext/icu/icu.c $(HDR) $(EXTHDR)
$(TCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/icu/icu.c
fts3.o: $(TOP)/ext/fts3/fts3.c $(HDR) $(EXTHDR)
$(TCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3.c
fts3_aux.o: $(TOP)/ext/fts3/fts3_aux.c $(HDR) $(EXTHDR)
$(TCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_aux.c
fts3_expr.o: $(TOP)/ext/fts3/fts3_expr.c $(HDR) $(EXTHDR)
$(TCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_expr.c
fts3_hash.o: $(TOP)/ext/fts3/fts3_hash.c $(HDR) $(EXTHDR)
$(TCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_hash.c
fts3_icu.o: $(TOP)/ext/fts3/fts3_icu.c $(HDR) $(EXTHDR)
$(TCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_icu.c
fts3_porter.o: $(TOP)/ext/fts3/fts3_porter.c $(HDR) $(EXTHDR)
$(TCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_porter.c
fts3_snippet.o: $(TOP)/ext/fts3/fts3_snippet.c $(HDR) $(EXTHDR)
$(TCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_snippet.c
fts3_tokenizer.o: $(TOP)/ext/fts3/fts3_tokenizer.c $(HDR) $(EXTHDR)
$(TCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer.c
fts3_tokenizer1.o: $(TOP)/ext/fts3/fts3_tokenizer1.c $(HDR) $(EXTHDR)
$(TCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer1.c
fts3_tokenize_vtab.o: $(TOP)/ext/fts3/fts3_tokenize_vtab.c $(HDR) $(EXTHDR)
$(TCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenize_vtab.c
fts3_unicode.o: $(TOP)/ext/fts3/fts3_unicode.c $(HDR) $(EXTHDR)
$(TCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_unicode.c
fts3_unicode2.o: $(TOP)/ext/fts3/fts3_unicode2.c $(HDR) $(EXTHDR)
$(TCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_unicode2.c
fts3_write.o: $(TOP)/ext/fts3/fts3_write.c $(HDR) $(EXTHDR)
$(TCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_write.c
rtree.o: $(TOP)/ext/rtree/rtree.c $(HDR) $(EXTHDR)
$(TCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/rtree/rtree.c
userauth.o: $(TOP)/ext/userauth/userauth.c $(HDR) $(EXTHDR)
$(TCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/userauth/userauth.c
sqlite3session.o: $(TOP)/ext/session/sqlite3session.c $(HDR) $(EXTHDR)
$(TCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/session/sqlite3session.c
stmt.o: $(TOP)/ext/misc/stmt.c
$(TCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/misc/stmt.c
# FTS5 things
#
FTS5_SRC = \
$(TOP)/ext/fts5/fts5.h \
$(TOP)/ext/fts5/fts5Int.h \
$(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 fts5parse.h \
$(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 \
fts5parse.c: $(TOP)/ext/fts5/fts5parse.y lemon$(BEXE)
cp $(TOP)/ext/fts5/fts5parse.y .
rm -f fts5parse.h
./lemon$(BEXE) $(OPTS) -S fts5parse.y
fts5parse.h: fts5parse.c
fts5.c: $(FTS5_SRC) $(BTCL) # has_tclsh84
$(BTCL) $(TOP)/ext/fts5/tool/mkfts5c.tcl
cp $(TOP)/ext/fts5/fts5.h .
fts5.o: fts5.c $(HDR) $(EXTHDR)
$(TCOMPILE) -DSQLITE_CORE -c fts5.c
sqlite3rbu.o: $(TOP)/ext/rbu/sqlite3rbu.c $(HDR) $(EXTHDR)
$(TCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/rbu/sqlite3rbu.c
#XX## Rules to build the 'testfixture' application.
#XX##
#XX## If using the amalgamation, use sqlite3.c directly to build the test
#XX## fixture. Otherwise link against libsqlite3.la. (This distinction is
#XX## necessary because the test fixture requires non-API symbols which are
#XX## hidden when the library is built via the amalgamation).
#XX##
#XX#TESTFIXTURE_FLAGS = -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
#XX#TESTFIXTURE_FLAGS += -DTCLSH_INIT_PROC=sqlite3TestInit
#XX#TESTFIXTURE_FLAGS += -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE
#XX#TESTFIXTURE_FLAGS += -DBUILD_sqlite
#XX#TESTFIXTURE_FLAGS += -DSQLITE_SERIES_CONSTRAINT_VERIFY=1
#XX#TESTFIXTURE_FLAGS += -DSQLITE_DEFAULT_PAGE_SIZE=1024
#XX#TESTFIXTURE_FLAGS += -DSQLITE_ENABLE_STMTVTAB
#XX#TESTFIXTURE_FLAGS += -DSQLITE_ENABLE_DBPAGE_VTAB
#XX#TESTFIXTURE_FLAGS += -DSQLITE_ENABLE_BYTECODE_VTAB
#XX#TESTFIXTURE_FLAGS += -DSQLITE_CKSUMVFS_STATIC
#XX#TESTFIXTURE_FLAGS += -DSQLITE_STATIC_RANDOMJSON
#XX#TESTFIXTURE_FLAGS += -DSQLITE_STRICT_SUBTYPE=1
#XX#
#XX#TESTFIXTURE_SRC0 = $(TESTSRC2) libsqlite3.la
#XX#TESTFIXTURE_SRC1 = sqlite3.c
#XX#TESTFIXTURE_SRC = $(TESTSRC) $(TOP)/src/tclsqlite.c
#XX#TESTFIXTURE_SRC += $(TESTFIXTURE_SRC$(USE_AMALGAMATION))
#XX#
#XX#testfixture$(TEXE): has_tclconfig has_tclsh85 $(TESTFIXTURE_SRC)
#XX# $(TLINK) -DSQLITE_NO_SYNC=1 $(TEMP_STORE) $(TESTFIXTURE_FLAGS) \
#XX# -o $@ $(TESTFIXTURE_SRC) $(LIBTCL) $(TLIBS)
#XX#
#XX#coretestprogs: testfixture$(BEXE) sqlite3$(BEXE)
#XX#
#XX#testprogs: $(TESTPROGS) srcck1$(BEXE) fuzzcheck$(TEXE) sessionfuzz$(TEXE)
#XX#
#XX## A very detailed test running most or all test cases
#XX#fulltest: alltest fuzztest
#XX#
#XX## Run most or all tcl test cases
#XX#alltest: $(TESTPROGS)
#XX# ./testfixture$(TEXE) $(TOP)/test/all.test $(TESTOPTS)
#XX#
#XX## Really really long testing
#XX#soaktest: $(TESTPROGS)
#XX# ./testfixture$(TEXE) $(TOP)/test/all.test -soak=1 $(TESTOPTS)
#XX#
#XX## Do extra testing but not everything.
#XX#fulltestonly: $(TESTPROGS) fuzztest
#XX# ./testfixture$(TEXE) $(TOP)/test/full.test
#XX#
#XX## Fuzz testing
#XX##
#XX## WARNING: When the "fuzztest" target is run by the testrunner.tcl script,
#XX## it does not actually run this code. Instead, it schedules equivalent
#XX## commands. Therefore, if this target is updated, then code in
#XX## testrunner_data.tcl (search for "trd_fuzztest_data") must also be updated.
#XX##
#XX#fuzztest: fuzzcheck$(TEXE) $(FUZZDATA) sessionfuzz$(TEXE)
#XX# ./fuzzcheck$(TEXE) $(FUZZDATA)
#XX# ./sessionfuzz$(TEXE) run $(TOP)/test/sessionfuzz-data1.db
#XX#
#XX#valgrindfuzz: fuzzcheck$(TEXT) $(FUZZDATA) sessionfuzz$(TEXE)
#XX# valgrind ./fuzzcheck$(TEXE) --cell-size-check --limit-mem 10M $(FUZZDATA)
#XX# valgrind ./sessionfuzz$(TEXE) run $(TOP)/test/sessionfuzz-data1.db
#XX#
#XX## The veryquick.test TCL tests.
#XX##
#XX#tcltest: ./testfixture$(TEXE)
#XX# ./testfixture$(TEXE) $(TOP)/test/veryquick.test $(TESTOPTS)
#XX#
#XX## Runs all the same tests cases as the "tcltest" target but uses
#XX## the testrunner.tcl script to run them in multiple cores
#XX## concurrently.
#XX#testrunner: testfixture$(TEXE)
#XX# ./testfixture$(TEXE) $(TOP)/test/testrunner.tcl
#XX#
#XX## This is the testing target preferred by the core SQLite developers.
#XX## It runs tests under a standard configuration, regardless of how
#XX## ./configure was run. The devs run "make devtest" prior to each
#XX## check-in, at a minimum. Probably other tests too, but at least this
#XX## one.
#XX##
#XX#devtest: srctree-check sourcetest
#XX# $(TCLSH_CMD) $(TOP)/test/testrunner.tcl mdevtest $(TSTRNNR_OPTS)
#XX#
#XX#mdevtest: srctree-check has_tclsh85
#XX# $(TCLSH_CMD) $(TOP)/test/testrunner.tcl mdevtest $(TSTRNNR_OPTS)
#XX#
#XX#sdevtest: has_tclsh85
#XX# $(TCLSH_CMD) $(TOP)/test/testrunner.tcl sdevtest $(TSTRNNR_OPTS)
#XX#
#XX## Validate that various generated files in the source tree
#XX## are up-to-date.
#XX##
#XX#srctree-check: $(TOP)/tool/srctree-check.tcl
#XX# $(TCLSH_CMD) $(TOP)/tool/srctree-check.tcl
#XX#
#XX## Testing for a release
#XX##
#XX#releasetest: srctree-check has_tclsh85 verify-source
#XX# $(TCLSH_CMD) $(TOP)/test/testrunner.tcl release $(TSTRNNR_OPTS)
#XX#
#XX## Minimal testing that runs in less than 3 minutes
#XX##
#XX#quicktest: ./testfixture$(TEXE)
#XX# ./testfixture$(TEXE) $(TOP)/test/extraquick.test $(TESTOPTS)
#XX#
#XX## Try to run tests on whatever options are specified by the
#XX## ./configure. The developers seldom use this target. Instead
#XX## they use "make devtest" which runs tests on a standard set of
#XX## options regardless of how SQLite is configured. This "test"
#XX## target is provided for legacy only.
#XX##
#XX#test: srctree-check fuzztest sourcetest $(TESTPROGS) tcltest
#XX#
#XX## Run a test using valgrind. This can take a really long time
#XX## because valgrind is so much slower than a native machine.
#XX##
#XX#valgrindtest: $(TESTPROGS) valgrindfuzz
#XX# OMIT_MISUSE=1 valgrind -v ./testfixture$(TEXE) $(TOP)/test/permutations.test valgrind $(TESTOPTS)
#XX#
#XX## A very fast test that checks basic sanity. The name comes from
#XX## the 60s-era electronics testing: "Turn it on and see if smoke
#XX## comes out."
#XX##
#XX#smoketest: $(TESTPROGS) fuzzcheck$(TEXE)
#XX# ./testfixture$(TEXE) $(TOP)/test/main.test $(TESTOPTS)
#XX#
#XX#shelltest:
#XX# $(TCLSH_CMD) $(TOP)/test/testrunner.tcl release shell
#XX#
#XX#sqlite3_analyzer.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqlite3_analyzer.c.in has_tclsh85
#XX# $(TCLSH_CMD) $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqlite3_analyzer.c.in >sqlite3_analyzer.c
#XX#
#XX#sqlite3_analyzer$(TEXE): has_tclconfig sqlite3_analyzer.c
#XX# $(TLINK) sqlite3_analyzer.c -o $@ $(LIBTCL) $(TLIBS)
#XX#
#XX#sqltclsh.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/sqltclsh.tcl $(TOP)/ext/misc/appendvfs.c $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqltclsh.c.in has_tclsh85
#XX# $(TCLSH_CMD) $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqltclsh.c.in >sqltclsh.c
#XX#
#XX#sqltclsh$(TEXE): has_tclconfig sqltclsh.c
#XX# $(TLINK) sqltclsh.c -o $@ $(LIBTCL) $(TLIBS)
#XX#
sqlite3_expert$(TEXE): $(TOP)/ext/expert/sqlite3expert.h $(TOP)/ext/expert/sqlite3expert.c $(TOP)/ext/expert/expert.c sqlite3.c
$(TLINK) $(TOP)/ext/expert/sqlite3expert.h $(TOP)/ext/expert/sqlite3expert.c $(TOP)/ext/expert/expert.c sqlite3.c -o sqlite3_expert $(LDFLAGS_libsqlite)
#XX#CHECKER_DEPS =\
#XX# $(TOP)/tool/mkccode.tcl \
#XX# sqlite3.c \
#XX# $(TOP)/src/tclsqlite.c \
#XX# $(TOP)/ext/repair/sqlite3_checker.tcl \
#XX# $(TOP)/ext/repair/checkindex.c \
#XX# $(TOP)/ext/repair/checkfreelist.c \
#XX# $(TOP)/ext/misc/btreeinfo.c \
#XX# $(TOP)/ext/repair/sqlite3_checker.c.in
#XX#
#XX#sqlite3_checker.c: $(CHECKER_DEPS) has_tclsh85
#XX# $(TCLSH_CMD) $(TOP)/tool/mkccode.tcl $(TOP)/ext/repair/sqlite3_checker.c.in >$@
#XX#
#XX#sqlite3_checker$(TEXE): has_tclconfig sqlite3_checker.c
#XX# $(TLINK) sqlite3_checker.c -o $@ $(LIBTCL) $(TLIBS)
#XX#
#XX#dbdump$(TEXE): $(TOP)/ext/misc/dbdump.c sqlite3.lo
#XX# $(TLINK) -DDBDUMP_STANDALONE -o $@ \
#XX# $(TOP)/ext/misc/dbdump.c sqlite3.lo $(TLIBS)
#XX#
#XX#dbtotxt$(TEXE): $(TOP)/tool/dbtotxt.c
#XX# $(TLINK)-o $@ $(TOP)/tool/dbtotxt.c
#XX#
#XX#showdb$(TEXE): $(TOP)/tool/showdb.c sqlite3.lo
#XX# $(TLINK) -o $@ $(TOP)/tool/showdb.c sqlite3.lo $(TLIBS)
#XX#
#XX#showstat4$(TEXE): $(TOP)/tool/showstat4.c sqlite3.lo
#XX# $(TLINK) -o $@ $(TOP)/tool/showstat4.c sqlite3.lo $(TLIBS)
#XX#
#XX#showjournal$(TEXE): $(TOP)/tool/showjournal.c sqlite3.lo
#XX# $(TLINK) -o $@ $(TOP)/tool/showjournal.c sqlite3.lo $(TLIBS)
#XX#
#XX#showwal$(TEXE): $(TOP)/tool/showwal.c sqlite3.lo
#XX# $(TLINK) -o $@ $(TOP)/tool/showwal.c sqlite3.lo $(TLIBS)
#XX#
#XX#showshm$(TEXE): $(TOP)/tool/showshm.c
#XX# $(TLINK) -o $@ $(TOP)/tool/showshm.c
#XX#
#XX#index_usage$(TEXE): $(TOP)/tool/index_usage.c sqlite3.lo
#XX# $(TLINK) $(SHELL_OPT) -o $@ $(TOP)/tool/index_usage.c sqlite3.lo $(TLIBS)
#XX#
#XX#changeset$(TEXE): $(TOP)/ext/session/changeset.c sqlite3.lo
#XX# $(TLINK) -o $@ $(TOP)/ext/session/changeset.c sqlite3.lo $(TLIBS)
#XX#
#XX#changesetfuzz$(TEXE): $(TOP)/ext/session/changesetfuzz.c sqlite3.lo
#XX# $(TLINK) -o $@ $(TOP)/ext/session/changesetfuzz.c sqlite3.lo $(TLIBS)
#XX#
#XX#rollback-test$(TEXE): $(TOP)/tool/rollback-test.c sqlite3.lo
#XX# $(TLINK) -o $@ $(TOP)/tool/rollback-test.c sqlite3.lo $(TLIBS)
#XX#
#XX#atrc$(TEXX): $(TOP)/test/atrc.c sqlite3.lo
#XX# $(TLINK) -o $@ $(TOP)/test/atrc.c sqlite3.lo $(TLIBS)
#XX#
#XX#LogEst$(TEXE): $(TOP)/tool/logest.c sqlite3.h
#XX# $(TLINK) -I. -o $@ $(TOP)/tool/logest.c
#XX#
#XX#wordcount$(TEXE): $(TOP)/test/wordcount.c sqlite3.lo
#XX# $(TLINK) -o $@ $(TOP)/test/wordcount.c sqlite3.lo $(TLIBS)
#XX#
#XX#speedtest1$(TEXE): $(TOP)/test/speedtest1.c sqlite3.c Makefile
#XX# $(TLINK) $(ST_OPT) -o $@ $(TOP)/test/speedtest1.c sqlite3.c $(TLIBS)
#XX#
#XX#startup$(TEXE): $(TOP)/test/startup.c sqlite3.c
#XX# $(CC) -Os -g -DSQLITE_THREADSAFE=0 -o $@ $(TOP)/test/startup.c sqlite3.c $(TLIBS)
#XX#
#XX#KV_OPT += -DSQLITE_DIRECT_OVERFLOW_READ
#XX#
#XX#kvtest$(TEXE): $(TOP)/test/kvtest.c sqlite3.c
#XX# $(TLINK) $(KV_OPT) -o $@ $(TOP)/test/kvtest.c sqlite3.c $(TLIBS)
#XX#
#XX#rbu$(EXE): $(TOP)/ext/rbu/rbu.c $(TOP)/ext/rbu/sqlite3rbu.c sqlite3.lo
#XX# $(TLINK) -I. -o $@ $(TOP)/ext/rbu/rbu.c sqlite3.lo $(TLIBS)
#XX#
#XX#loadfts$(EXE): $(TOP)/tool/loadfts.c libsqlite3.la
#XX# $(TLINK) $(TOP)/tool/loadfts.c libsqlite3.la -o $@ $(TLIBS)
#XX#
#XX## This target will fail if the SQLite amalgamation contains any exported
#XX## symbols that do not begin with "sqlite3_". It is run as part of the
#XX## releasetest.tcl script.
#XX##
#XX#VALIDIDS=' sqlite3(changeset|changegroup|session)?_'
#XX#checksymbols: sqlite3.o
#XX# nm -g --defined-only sqlite3.o
#XX# nm -g --defined-only sqlite3.o | egrep -v $(VALIDIDS); test $$? -ne 0
#XX# echo '0 errors out of 1 tests'
#XX#
#XX## Build the amalgamation-autoconf package. The amalamgation-tarball target builds
#XX## a tarball named for the version number. Ex: sqlite-autoconf-3110000.tar.gz.
#XX## The snapshot-tarball target builds a tarball named by the SHA1 hash
#XX##
#XX#amalgamation-tarball: sqlite3.c sqlite3rc.h
#XX# TOP=$(TOP) sh $(TOP)/tool/mkautoconfamal.sh --normal
#XX#
#XX#snapshot-tarball: sqlite3.c sqlite3rc.h
#XX# TOP=$(TOP) sh $(TOP)/tool/mkautoconfamal.sh --snapshot
#XX#
#XX## Build a ZIP archive containing various command-line tools.
#XX##
#XX#tool-zip: testfixture sqlite3 sqldiff sqlite3_analyzer $(TOP)/tool/mktoolzip.tcl
#XX# ./testfixture $(TOP)/tool/mktoolzip.tcl
#XX#
#XX## The next two rules are used to support the "threadtest" target. Building
#XX## threadtest runs a few thread-safety tests that are implemented in C. This
#XX## target is invoked by the releasetest.tcl script.
#XX##
#XX#THREADTEST3_SRC = $(TOP)/test/threadtest3.c \
#XX# $(TOP)/test/tt3_checkpoint.c \
#XX# $(TOP)/test/tt3_index.c \
#XX# $(TOP)/test/tt3_vacuum.c \
#XX# $(TOP)/test/tt3_stress.c \
#XX# $(TOP)/test/tt3_lookaside1.c
#XX#
#XX#threadtest3$(TEXE): sqlite3.lo $(THREADTEST3_SRC)
#XX# $(TLINK) $(TOP)/test/threadtest3.c $(TOP)/src/test_multiplex.c sqlite3.lo -o $@ $(TLIBS)
#XX#
#XX#threadtest: threadtest3$(TEXE)
#XX# ./threadtest3$(TEXE)
#XX#
#XX#threadtest5: sqlite3.c $(TOP)/test/threadtest5.c
#XX# $(TLINK) $(TOP)/test/threadtest5.c sqlite3.c -o $@ $(TLIBS)
#XX#
#XX## Standard install and cleanup targets
#XX##
#XX#lib_install: libsqlite3.la
#XX# $(INSTALL) -d $(DESTDIR)$(libdir)
#XX# $(LTINSTALL) libsqlite3.la $(DESTDIR)$(libdir)
#XX#
#XX## Use $(tcl_install_$(HAVE_TCL)) to resolve to either tcl_install or
#XX## an empty value.
#XX#tcl_install_0 =
#XX#tcl_install_1 = tcl_install
#XX#
#XX#install: sqlite3$(TEXE) lib_install sqlite3.h sqlite3.pc $(tcl_install_$(HAVE_TCL))
#XX# $(INSTALL) -d $(DESTDIR)$(bindir)
#XX# $(LTINSTALL) sqlite3$(TEXE) $(DESTDIR)$(bindir)
#XX# $(INSTALL) -d $(DESTDIR)$(includedir)
#XX# $(INSTALL) -m 0644 sqlite3.h $(DESTDIR)$(includedir)
#XX# $(INSTALL) -m 0644 $(TOP)/src/sqlite3ext.h $(DESTDIR)$(includedir)
#XX# $(INSTALL) -d $(DESTDIR)$(pkgconfigdir)
#XX# $(INSTALL) -m 0644 sqlite3.pc $(DESTDIR)$(pkgconfigdir)
#XX#
#XX#pkgIndex.tcl:
#XX# echo 'package ifneeded sqlite3 $(RELEASE) [list load [file join $$dir libtclsqlite3[info sharedlibextension]] sqlite3]' > $@
#XX#
#XX#tcl_install: lib_install libtclsqlite3.la pkgIndex.tcl
#XX# $(INSTALL) -d $(DESTDIR)$(TCLLIBDIR)
#XX# $(LTINSTALL) libtclsqlite3.la $(DESTDIR)$(TCLLIBDIR)
#XX# rm -f $(DESTDIR)$(TCLLIBDIR)/libtclsqlite3.la $(DESTDIR)$(TCLLIBDIR)/libtclsqlite3.a
#XX# $(INSTALL) -m 0644 pkgIndex.tcl $(DESTDIR)$(TCLLIBDIR)
#XX#
#XX## Build the SQLite TCL extension in a way that make it compatible
#XX## with whatever version of TCL is running as $TCLSH_CMD, possibly defined
#XX## by --with-tclsh=
#XX##
#XX#tclextension: tclsqlite3.c
#XX# $(TCLSH_CMD) $(TOP)/tool/buildtclext.tcl --build-only --cc $(CC) $(CFLAGS) $(OPT_FEATURE_FLAGS) $(OPTS)
#XX#
#XX## Install the SQLite TCL extension in a way that is appropriate for $TCLSH_CMD
#XX## to find it.
#XX##
#XX#tclextension-install: tclsqlite3.c
#XX# $(TCLSH_CMD) $(TOP)/tool/buildtclext.tcl --cc $(CC) $(CFLAGS) $(OPT_FEATURE_FLAGS) $(OPTS)
#XX#
#XX## Install the SQLite TCL extension that is used by $TCLSH_CMD
#XX##
#XX#tclextension-uninstall:
#XX# $(TCLSH_CMD) $(TOP)/tool/buildtclext.tcl --uninstall
#XX#
#XX## List all installed the SQLite TCL extension that is are accessible
#XX## by $TCLSH_CMD, included prior versions.
#XX##
#XX#tclextension-list:
#XX# $(TCLSH_CMD) $(TOP)/tool/buildtclext.tcl --info
# Remove build products sufficient so that subsequent makes will recompile
# everything from scratch. Do not remove:
#
# * test results and test logs
# * output from ./configure
#
tidy:
rm -f *.lo *.la *.o *.c *.da *.bb *.bbg gmon.* *.rws sqlite3$(TEXE)
rm -f fts5.h keywordhash.h opcodes.h sqlite3.h sqlite3ext.h sqlite3session.h
rm -rf .libs .deps tsrc .target_source
rm -f lemon$(BEXE) sqlite*.tar.gz
rm -f mkkeywordhash$(BEXE) mksourceid$(BEXE)
rm -f parse.* fts5parse.*
rm -f $(libsqlite3.DLL) $(libsqlite3.LIB)
rm -f tclsqlite3$(TEXE) $(TESTPROGS)
rm -f LogEst$(TEXE) fts3view$(TEXE) rollback-test$(TEXE) showdb$(TEXE)
rm -f showjournal$(TEXE) showstat4$(TEXE) showwal$(TEXE) speedtest1$(TEXE)
rm -f wordcount$(TEXE) changeset$(TEXE) version-info$(TEXE)
rm -f *.dll *.lib *.exp *.pc *.vsix *.so *.dylib pkgIndex.tcl
rm -f sqlite3_analyzer$(TEXE) sqlite3-rsync$(TEXE) sqlite3_expert$(TEXE)
rm -f mptester$(TEXE) rbu$(TEXE) srcck1$(TEXE)
rm -f fuzzershell$(TEXE) fuzzcheck$(TEXE) sqldiff$(TEXE) dbhash$(TEXE)
rm -f threadtest5$(TEXE)
rm -f src-verify has_tclsh*
# FIXME? (rm *.def) will remove auto.def (part of autosetup)
#
# Removes build products and test logs. Retains ./configure outputs.
#
clean: tidy
rm -rf omittest* testrunner* testdir*
-gmake -C ext/wasm distclean
# Clean up everything. No exceptions.
distclean: clean
rm -f sqlite_cfg.h config.log config.status $(JIMSH) Makefile
-gmake -C ext/wasm distclean
#XX##
#XX## Windows section
#XX##
#XX#dll: sqlite3.dll
#XX#
#XX#REAL_LIBOBJ = $(LIBOBJ:%.lo=.libs/%.o)
#XX#
#XX#$(REAL_LIBOBJ): $(LIBOBJ)
#XX#
#XX#sqlite3.def: $(REAL_LIBOBJ)
#XX# echo 'EXPORTS' >sqlite3.def
#XX# nm $(REAL_LIBOBJ) | grep ' T ' | grep ' _sqlite3_' \
#XX# | sed 's/^.* _//' >>sqlite3.def
#XX#
#XX#sqlite3.dll: $(REAL_LIBOBJ) sqlite3.def
#XX# $(TCC) -shared -o $@ sqlite3.def \
#XX# -Wl,"--strip-all" $(REAL_LIBOBJ)
#XX#
#XX##
#XX## Fiddle app
#XX##
#XX#fiddle: sqlite3.c shell.c
#XX# make -C ext/wasm fiddle emcc_opt=-Os
#XX#
#XX##
#XX## Spell-checking for source comments
#XX## The sources checked are either C sources or C source templates.
#XX## Their comments are extracted and processed through aspell using
#XX## a custom dictionary that contains scads of odd identifiers that
#XX## find their way into the comments.
#XX##
#XX## Currently, this target is setup to be "made" in-tree only.
#XX## The output is ephemeral. Redirect it to guide spelling fixups,
#XX## either to correct spelling or add words to tool/custom.txt.
#XX##
#XX#./custom.rws: ./tool/custom.txt
#XX# @echo 'Updating custom dictionary from tool/custom.txt'
#XX# aspell --lang=en create master ./custom.rws < $<
#XX#
#XX#misspell: ./custom.rws has_tclsh84
#XX# $(TCLSH_CMD) ./tool/spellsift.tcl ./src/*.c ./src/*.h ./src/*.in
#XX#
#
# tool/version-info: a utility for emitting sqlite3 version info
# in various forms.
#
version-info$(TEXE): $(TOP)/tool/version-info.c Makefile sqlite3.h
$(TLINK) $(ST_OPT) -o $@ $(TOP)/tool/version-info.c