1515# The toplevel directory of the source tree. This is the directory
1616# that contains this "Makefile.in" and the "configure.in" script.
1717#
18- TOP = @srcdir @
18+ TOP = @abs_srcdir @
1919
2020# C Compiler and options for use in building executables that
2121# will run on the platform that is doing the build.
2222#
2323BCC = @BUILD_CC@ @BUILD_CFLAGS@
2424
25- # C Compile and options for use in building executables that
25+ # TCC is the C Compile and options for use in building executables that
2626# will run on the target platform. (BCC and TCC are usually the
27- # same unless your are cross-compiling.)
27+ # same unless your are cross-compiling.) Separate CC and CFLAGS macros
28+ # are provide so that these aspects of the build process can be changed
29+ # on the "make" command-line. Ex: "make CC=clang CFLAGS=-fsanitize=undefined"
2830#
29- TCC = @CC@ @CPPFLAGS@ @CFLAGS@ -I. -I${TOP}/src -I${TOP}/ext/rtree
31+ CC = @CC@
32+ CFLAGS = @CPPFLAGS@ @CFLAGS@
33+ TCC = $(CC ) $(CFLAGS ) -I. -I${TOP}/src -I${TOP}/ext/rtree -I${TOP}/ext/fts3
3034
3135# Define this for the autoconf-based build, so that the code knows it can
3236# include the generated config.h
@@ -37,7 +41,7 @@ TCC += -D_HAVE_SQLITE_CONFIG_H -DBUILD_sqlite
3741# Omitting the define will cause extra debugging code to be inserted and
3842# includes extra comments when "EXPLAIN stmt" is used.
3943#
40- TCC += @TARGET_DEBUG@ @XTHREADCONNECT@
44+ TCC += @TARGET_DEBUG@
4145
4246# Compiler options needed for programs that use the TCL library.
4347#
@@ -177,7 +181,7 @@ LIBOBJS0 = alter.lo analyze.lo attach.lo auth.lo \
177181 notify.lo opcodes.lo os.lo os_unix.lo os_win.lo \
178182 pager.lo parse.lo pcache.lo pcache1.lo pragma.lo prepare.lo printf.lo \
179183 random.lo resolve.lo rowset.lo rtree.lo select.lo status.lo \
180- table.lo tokenize.lo trigger.lo \
184+ table.lo threads.lo tokenize.lo trigger.lo \
181185 update.lo util.lo vacuum.lo \
182186 vdbe.lo vdbeapi.lo vdbeaux.lo vdbeblob.lo vdbemem.lo vdbesort.lo \
183187 vdbetrace.lo wal.lo walker.lo where.lo utf.lo vtab.lo
@@ -230,6 +234,7 @@ SRC = \
230234 $(TOP ) /src/mem3.c \
231235 $(TOP ) /src/mem5.c \
232236 $(TOP ) /src/memjournal.c \
237+ $(TOP ) /src/msvc.h \
233238 $(TOP ) /src/mutex.c \
234239 $(TOP ) /src/mutex.h \
235240 $(TOP ) /src/mutex_noop.c \
@@ -263,6 +268,7 @@ SRC = \
263268 $(TOP ) /src/sqliteInt.h \
264269 $(TOP ) /src/sqliteLimit.h \
265270 $(TOP ) /src/table.c \
271+ $(TOP ) /src/threads.c \
266272 $(TOP ) /src/tclsqlite.c \
267273 $(TOP ) /src/tokenize.c \
268274 $(TOP ) /src/trigger.c \
@@ -358,6 +364,7 @@ TESTSRC = \
358364 $(TOP ) /src/test_autoext.c \
359365 $(TOP ) /src/test_async.c \
360366 $(TOP ) /src/test_backup.c \
367+ $(TOP ) /src/test_blob.c \
361368 $(TOP ) /src/test_btree.c \
362369 $(TOP ) /src/test_config.c \
363370 $(TOP ) /src/test_demovfs.c \
@@ -393,6 +400,7 @@ TESTSRC = \
393400TESTSRC += \
394401 $(TOP ) /ext/misc/amatch.c \
395402 $(TOP ) /ext/misc/closure.c \
403+ $(TOP ) /ext/misc/eval.c \
396404 $(TOP ) /ext/misc/fileio.c \
397405 $(TOP ) /ext/misc/fuzzer.c \
398406 $(TOP ) /ext/misc/ieee754.c \
@@ -456,6 +464,7 @@ HDR = \
456464 $(TOP ) /src/hash.h \
457465 $(TOP ) /src/hwtime.h \
458466 keywordhash.h \
467+ $(TOP ) /src/msvc.h \
459468 $(TOP ) /src/mutex.h \
460469 opcodes.h \
461470 $(TOP ) /src/os.h \
@@ -527,6 +536,11 @@ mptester$(EXE): sqlite3.c $(TOP)/mptest/mptest.c
527536 $(LTLINK ) -o $@ -I. $(TOP ) /mptest/mptest.c sqlite3.c \
528537 $(TLIBS ) -rpath " $( libdir) "
529538
539+ mptest : mptester$(EXE )
540+ rm -f mptest1.db
541+ ./mptester$(EXE ) mptest1.db $(TOP ) /mptest/crash01.test
542+ rm -f mptest2.db
543+ ./mptester$(EXE ) mptest2.db $(TOP ) /mptest/multiwrite01.test
530544
531545# This target creates a directory named "tsrc" and fills it with
532546# copies of all of the C source code and header files needed to
@@ -737,6 +751,9 @@ status.lo: $(TOP)/src/status.c $(HDR)
737751table.lo : $(TOP ) /src/table.c $(HDR )
738752 $(LTCOMPILE ) $(TEMP_STORE ) -c $(TOP ) /src/table.c
739753
754+ threads.lo : $(TOP ) /src/threads.c $(HDR )
755+ $(LTCOMPILE ) $(TEMP_STORE ) -c $(TOP ) /src/threads.c
756+
740757tokenize.lo : $(TOP ) /src/tokenize.c keywordhash.h $(HDR )
741758 $(LTCOMPILE ) $(TEMP_STORE ) -c $(TOP ) /src/tokenize.c
742759
@@ -915,19 +932,37 @@ testfixture$(TEXE): $(TESTFIXTURE_SRC)
915932 $(LTLINK ) -DSQLITE_NO_SYNC=1 $(TEMP_STORE ) $(TESTFIXTURE_FLAGS ) \
916933 -o $@ $(TESTFIXTURE_SRC ) $(LIBTCL ) $(TLIBS )
917934
918-
935+ # A very detailed test running most or all test cases
919936fulltest : testfixture$(TEXE ) sqlite3$(TEXE )
920937 ./testfixture$(TEXE ) $(TOP ) /test/all.test
921938
939+ # Really really long testing
922940soaktest : testfixture$(TEXE ) sqlite3$(TEXE )
923941 ./testfixture$(TEXE ) $(TOP ) /test/all.test -soak=1
924942
943+ # Do extra testing but not aeverything.
925944fulltestonly : testfixture$(TEXE ) sqlite3$(TEXE )
926945 ./testfixture$(TEXE ) $(TOP ) /test/full.test
927946
947+ # This is the common case. Run many tests but not those that take
948+ # a really long time.
949+ #
928950test : testfixture$(TEXE ) sqlite3$(TEXE )
929951 ./testfixture$(TEXE ) $(TOP ) /test/veryquick.test
930952
953+ # Run a test using valgrind. This can take a really long time
954+ # because valgrind is so much slower than a native machine.
955+ #
956+ valgrindtest : testfixture$(TEXE ) sqlite3$(TEXE )
957+ OMIT_MISUSE=1 valgrind -v ./testfixture$(TEXE ) $(TOP ) /test/permutations.test valgrind
958+
959+ # A very fast test that checks basic sanity. The name comes from
960+ # the 60s-era electronics testing: "Turn it on and see if smoke
961+ # comes out."
962+ #
963+ smoketest : testfixture$(TEXE )
964+ ./testfixture$(TEXE ) $(TOP ) /test/main.test
965+
931966sqlite3_analyzer.c : sqlite3.c $(TOP ) /src/test_stat.c $(TOP ) /src/tclsqlite.c $(TOP ) /tool/spaceanal.tcl
932967 echo " #define TCLSH 2" > $@
933968 cat sqlite3.c $(TOP ) /src/test_stat.c $(TOP ) /src/tclsqlite.c >> $@
@@ -963,6 +998,39 @@ wordcount$(TEXE): $(TOP)/test/wordcount.c sqlite3.c
963998speedtest1$(TEXE ) : $(TOP ) /test/wordcount.c sqlite3.lo
964999 $(LTLINK ) -o $@ $(TOP ) /test/speedtest1.c sqlite3.lo $(TLIBS )
9651000
1001+ # This target will fail if the SQLite amalgamation contains any exported
1002+ # symbols that do not begin with "sqlite3_". It is run as part of the
1003+ # releasetest.tcl script.
1004+ #
1005+ checksymbols : sqlite3.lo
1006+ nm -g --defined-only sqlite3.o | grep -v " sqlite3_" ; test $$? -ne 0
1007+ echo ' 0 errors out of 1 tests'
1008+
1009+ # Build the amalgamation-autoconf package.
1010+ #
1011+ amalgamation-tarball : sqlite3.c
1012+ TOP=$(TOP ) sh $(TOP ) /tool/mkautoconfamal.sh
1013+
1014+ # The next two rules are used to support the "threadtest" target. Building
1015+ # threadtest runs a few thread-safety tests that are implemented in C. This
1016+ # target is invoked by the releasetest.tcl script.
1017+ #
1018+ THREADTEST3_SRC = $(TOP ) /test/threadtest3.c \
1019+ $(TOP ) /test/tt3_checkpoint.c \
1020+ $(TOP ) /test/tt3_index.c \
1021+ $(TOP ) /test/tt3_vacuum.c \
1022+ $(TOP ) /test/tt3_stress.c \
1023+ $(TOP ) /test/tt3_lookaside1.c
1024+
1025+ threadtest3$(TEXE ) : sqlite3.lo $(THREADTEST3_SRC )
1026+ $(LTLINK ) $(TOP ) /test/threadtest3.c sqlite3.lo -o $@ $(TLIBS )
1027+
1028+ threadtest : threadtest3$(TEXE )
1029+ ./threadtest3$(TEXE )
1030+
1031+ releasetest :
1032+ $(TCLSH_CMD ) $(TOP ) /test/releasetest.tcl
1033+
9661034# Standard install and cleanup targets
9671035#
9681036lib_install : libsqlite3.la
0 commit comments