15
15
# The toplevel directory of the source tree. This is the directory
16
16
# that contains this "Makefile.in" and the "configure.in" script.
17
17
#
18
- TOP = @srcdir @
18
+ TOP = @abs_srcdir @
19
19
20
20
# C Compiler and options for use in building executables that
21
21
# will run on the platform that is doing the build.
22
22
#
23
23
BCC = @BUILD_CC@ @BUILD_CFLAGS@
24
24
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
26
26
# 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"
28
30
#
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
30
34
31
35
# Define this for the autoconf-based build, so that the code knows it can
32
36
# include the generated config.h
@@ -37,7 +41,7 @@ TCC += -D_HAVE_SQLITE_CONFIG_H -DBUILD_sqlite
37
41
# Omitting the define will cause extra debugging code to be inserted and
38
42
# includes extra comments when "EXPLAIN stmt" is used.
39
43
#
40
- TCC += @TARGET_DEBUG@ @XTHREADCONNECT@
44
+ TCC += @TARGET_DEBUG@
41
45
42
46
# Compiler options needed for programs that use the TCL library.
43
47
#
@@ -177,7 +181,7 @@ LIBOBJS0 = alter.lo analyze.lo attach.lo auth.lo \
177
181
notify.lo opcodes.lo os.lo os_unix.lo os_win.lo \
178
182
pager.lo parse.lo pcache.lo pcache1.lo pragma.lo prepare.lo printf.lo \
179
183
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 \
181
185
update.lo util.lo vacuum.lo \
182
186
vdbe.lo vdbeapi.lo vdbeaux.lo vdbeblob.lo vdbemem.lo vdbesort.lo \
183
187
vdbetrace.lo wal.lo walker.lo where.lo utf.lo vtab.lo
@@ -230,6 +234,7 @@ SRC = \
230
234
$(TOP ) /src/mem3.c \
231
235
$(TOP ) /src/mem5.c \
232
236
$(TOP ) /src/memjournal.c \
237
+ $(TOP ) /src/msvc.h \
233
238
$(TOP ) /src/mutex.c \
234
239
$(TOP ) /src/mutex.h \
235
240
$(TOP ) /src/mutex_noop.c \
@@ -263,6 +268,7 @@ SRC = \
263
268
$(TOP ) /src/sqliteInt.h \
264
269
$(TOP ) /src/sqliteLimit.h \
265
270
$(TOP ) /src/table.c \
271
+ $(TOP ) /src/threads.c \
266
272
$(TOP ) /src/tclsqlite.c \
267
273
$(TOP ) /src/tokenize.c \
268
274
$(TOP ) /src/trigger.c \
@@ -358,6 +364,7 @@ TESTSRC = \
358
364
$(TOP ) /src/test_autoext.c \
359
365
$(TOP ) /src/test_async.c \
360
366
$(TOP ) /src/test_backup.c \
367
+ $(TOP ) /src/test_blob.c \
361
368
$(TOP ) /src/test_btree.c \
362
369
$(TOP ) /src/test_config.c \
363
370
$(TOP ) /src/test_demovfs.c \
@@ -393,6 +400,7 @@ TESTSRC = \
393
400
TESTSRC += \
394
401
$(TOP ) /ext/misc/amatch.c \
395
402
$(TOP ) /ext/misc/closure.c \
403
+ $(TOP ) /ext/misc/eval.c \
396
404
$(TOP ) /ext/misc/fileio.c \
397
405
$(TOP ) /ext/misc/fuzzer.c \
398
406
$(TOP ) /ext/misc/ieee754.c \
@@ -456,6 +464,7 @@ HDR = \
456
464
$(TOP ) /src/hash.h \
457
465
$(TOP ) /src/hwtime.h \
458
466
keywordhash.h \
467
+ $(TOP ) /src/msvc.h \
459
468
$(TOP ) /src/mutex.h \
460
469
opcodes.h \
461
470
$(TOP ) /src/os.h \
@@ -527,6 +536,11 @@ mptester$(EXE): sqlite3.c $(TOP)/mptest/mptest.c
527
536
$(LTLINK ) -o $@ -I. $(TOP ) /mptest/mptest.c sqlite3.c \
528
537
$(TLIBS ) -rpath " $( libdir) "
529
538
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
530
544
531
545
# This target creates a directory named "tsrc" and fills it with
532
546
# copies of all of the C source code and header files needed to
@@ -737,6 +751,9 @@ status.lo: $(TOP)/src/status.c $(HDR)
737
751
table.lo : $(TOP ) /src/table.c $(HDR )
738
752
$(LTCOMPILE ) $(TEMP_STORE ) -c $(TOP ) /src/table.c
739
753
754
+ threads.lo : $(TOP ) /src/threads.c $(HDR )
755
+ $(LTCOMPILE ) $(TEMP_STORE ) -c $(TOP ) /src/threads.c
756
+
740
757
tokenize.lo : $(TOP ) /src/tokenize.c keywordhash.h $(HDR )
741
758
$(LTCOMPILE ) $(TEMP_STORE ) -c $(TOP ) /src/tokenize.c
742
759
@@ -915,19 +932,37 @@ testfixture$(TEXE): $(TESTFIXTURE_SRC)
915
932
$(LTLINK ) -DSQLITE_NO_SYNC=1 $(TEMP_STORE ) $(TESTFIXTURE_FLAGS ) \
916
933
-o $@ $(TESTFIXTURE_SRC ) $(LIBTCL ) $(TLIBS )
917
934
918
-
935
+ # A very detailed test running most or all test cases
919
936
fulltest : testfixture$(TEXE ) sqlite3$(TEXE )
920
937
./testfixture$(TEXE ) $(TOP ) /test/all.test
921
938
939
+ # Really really long testing
922
940
soaktest : testfixture$(TEXE ) sqlite3$(TEXE )
923
941
./testfixture$(TEXE ) $(TOP ) /test/all.test -soak=1
924
942
943
+ # Do extra testing but not aeverything.
925
944
fulltestonly : testfixture$(TEXE ) sqlite3$(TEXE )
926
945
./testfixture$(TEXE ) $(TOP ) /test/full.test
927
946
947
+ # This is the common case. Run many tests but not those that take
948
+ # a really long time.
949
+ #
928
950
test : testfixture$(TEXE ) sqlite3$(TEXE )
929
951
./testfixture$(TEXE ) $(TOP ) /test/veryquick.test
930
952
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
+
931
966
sqlite3_analyzer.c : sqlite3.c $(TOP ) /src/test_stat.c $(TOP ) /src/tclsqlite.c $(TOP ) /tool/spaceanal.tcl
932
967
echo " #define TCLSH 2" > $@
933
968
cat sqlite3.c $(TOP ) /src/test_stat.c $(TOP ) /src/tclsqlite.c >> $@
@@ -963,6 +998,39 @@ wordcount$(TEXE): $(TOP)/test/wordcount.c sqlite3.c
963
998
speedtest1$(TEXE ) : $(TOP ) /test/wordcount.c sqlite3.lo
964
999
$(LTLINK ) -o $@ $(TOP ) /test/speedtest1.c sqlite3.lo $(TLIBS )
965
1000
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
+
966
1034
# Standard install and cleanup targets
967
1035
#
968
1036
lib_install : libsqlite3.la
0 commit comments