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
21
21
# C Compiler and options for use in building executables that
22
22
# will run on the platform that is doing the build.
23
23
#
24
24
BCC = @BUILD_CC@ @BUILD_CFLAGS@
25
25
26
- # C Compile and options for use in building executables that
26
+ # TCC is the C Compile and options for use in building executables that
27
27
# will run on the target platform. (BCC and TCC are usually the
28
- # same unless your are cross-compiling.)
28
+ # same unless your are cross-compiling.) Separate CC and CFLAGS macros
29
+ # are provide so that these aspects of the build process can be changed
30
+ # on the "make" command-line. Ex: "make CC=clang CFLAGS=-fsanitize=undefined"
29
31
#
30
- TCC = @CC@ @CPPFLAGS@ @CFLAGS@ -I. -I${TOP}/src -I${TOP}/ext/rtree
32
+ CC = @CC@
33
+ CFLAGS = @CPPFLAGS@ @CFLAGS@
34
+ TCC = $(CC ) $(CFLAGS ) -I. -I${TOP}/src -I${TOP}/ext/rtree -I${TOP}/ext/fts3
31
35
32
36
# Define this for the autoconf-based build, so that the code knows it can
33
37
# include the generated config.h
@@ -38,7 +42,7 @@ TCC += -D_HAVE_SQLITE_CONFIG_H -DBUILD_sqlite
38
42
# Omitting the define will cause extra debugging code to be inserted and
39
43
# includes extra comments when "EXPLAIN stmt" is used.
40
44
#
41
- TCC += @TARGET_DEBUG@ @XTHREADCONNECT@
45
+ TCC += @TARGET_DEBUG@
42
46
43
47
# Compiler options needed for programs that use the TCL library.
44
48
#
@@ -196,7 +200,7 @@ LIBOBJS0 = alter.lo analyze.lo attach.lo auth.lo \
196
200
notify.lo opcodes.lo os.lo os_unix.lo os_win.lo \
197
201
pager.lo parse.lo pcache.lo pcache1.lo pragma.lo prepare.lo printf.lo \
198
202
random.lo resolve.lo rowset.lo rtree.lo select.lo status.lo \
199
- table.lo tokenize.lo trigger.lo \
203
+ table.lo threads.lo tokenize.lo trigger.lo \
200
204
update.lo util.lo vacuum.lo \
201
205
vdbe.lo vdbeapi.lo vdbeaux.lo vdbeblob.lo vdbemem.lo vdbesort.lo \
202
206
vdbetrace.lo wal.lo walker.lo where.lo utf.lo vtab.lo $(CRYPTOLIBOBJ )
@@ -250,6 +254,7 @@ SRC = \
250
254
$(TOP ) /src/mem3.c \
251
255
$(TOP ) /src/mem5.c \
252
256
$(TOP ) /src/memjournal.c \
257
+ $(TOP ) /src/msvc.h \
253
258
$(TOP ) /src/mutex.c \
254
259
$(TOP ) /src/mutex.h \
255
260
$(TOP ) /src/mutex_noop.c \
@@ -283,6 +288,7 @@ SRC = \
283
288
$(TOP ) /src/sqliteInt.h \
284
289
$(TOP ) /src/sqliteLimit.h \
285
290
$(TOP ) /src/table.c \
291
+ $(TOP ) /src/threads.c \
286
292
$(TOP ) /src/tclsqlite.c \
287
293
$(TOP ) /src/tokenize.c \
288
294
$(TOP ) /src/trigger.c \
@@ -378,6 +384,7 @@ TESTSRC = \
378
384
$(TOP ) /src/test_autoext.c \
379
385
$(TOP ) /src/test_async.c \
380
386
$(TOP ) /src/test_backup.c \
387
+ $(TOP ) /src/test_blob.c \
381
388
$(TOP ) /src/test_btree.c \
382
389
$(TOP ) /src/test_config.c \
383
390
$(TOP ) /src/test_demovfs.c \
@@ -413,6 +420,7 @@ TESTSRC = \
413
420
TESTSRC += \
414
421
$(TOP ) /ext/misc/amatch.c \
415
422
$(TOP ) /ext/misc/closure.c \
423
+ $(TOP ) /ext/misc/eval.c \
416
424
$(TOP ) /ext/misc/fileio.c \
417
425
$(TOP ) /ext/misc/fuzzer.c \
418
426
$(TOP ) /ext/misc/ieee754.c \
@@ -476,6 +484,7 @@ HDR = \
476
484
$(TOP ) /src/hash.h \
477
485
$(TOP ) /src/hwtime.h \
478
486
keywordhash.h \
487
+ $(TOP ) /src/msvc.h \
479
488
$(TOP ) /src/mutex.h \
480
489
opcodes.h \
481
490
$(TOP ) /src/os.h \
@@ -547,6 +556,11 @@ mptester$(EXE): sqlite3.c $(TOP)/mptest/mptest.c
547
556
$(LTLINK ) -o $@ -I. $(TOP ) /mptest/mptest.c sqlite3.c \
548
557
$(TLIBS ) -rpath " $( libdir) "
549
558
559
+ mptest : mptester$(EXE )
560
+ rm -f mptest1.db
561
+ ./mptester$(EXE ) mptest1.db $(TOP ) /mptest/crash01.test
562
+ rm -f mptest2.db
563
+ ./mptester$(EXE ) mptest2.db $(TOP ) /mptest/multiwrite01.test
550
564
551
565
# This target creates a directory named "tsrc" and fills it with
552
566
# copies of all of the C source code and header files needed to
@@ -770,6 +784,9 @@ status.lo: $(TOP)/src/status.c $(HDR)
770
784
table.lo : $(TOP ) /src/table.c $(HDR )
771
785
$(LTCOMPILE ) $(TEMP_STORE ) -c $(TOP ) /src/table.c
772
786
787
+ threads.lo : $(TOP ) /src/threads.c $(HDR )
788
+ $(LTCOMPILE ) $(TEMP_STORE ) -c $(TOP ) /src/threads.c
789
+
773
790
tokenize.lo : $(TOP ) /src/tokenize.c keywordhash.h $(HDR )
774
791
$(LTCOMPILE ) $(TEMP_STORE ) -c $(TOP ) /src/tokenize.c
775
792
@@ -948,19 +965,37 @@ testfixture$(TEXE): $(TESTFIXTURE_SRC)
948
965
$(LTLINK ) -DSQLITE_NO_SYNC=1 $(TEMP_STORE ) $(TESTFIXTURE_FLAGS ) \
949
966
-o $@ $(TESTFIXTURE_SRC ) $(LIBTCL ) $(TLIBS )
950
967
951
-
968
+ # A very detailed test running most or all test cases
952
969
fulltest : testfixture$(TEXE ) sqlcipher$(TEXE )
953
970
./testfixture$(TEXE ) $(TOP ) /test/all.test
954
971
972
+ # Really really long testing
955
973
soaktest : testfixture$(TEXE ) sqlcipher$(TEXE )
956
974
./testfixture$(TEXE ) $(TOP ) /test/all.test -soak=1
957
975
976
+ # Do extra testing but not aeverything.
958
977
fulltestonly : testfixture$(TEXE ) sqlcipher$(TEXE )
959
978
./testfixture$(TEXE ) $(TOP ) /test/full.test
960
979
980
+ # This is the common case. Run many tests but not those that take
981
+ # a really long time.
982
+ #
961
983
test : testfixture$(TEXE ) sqlcipher$(TEXE )
962
984
./testfixture$(TEXE ) $(TOP ) /test/veryquick.test
963
985
986
+ # Run a test using valgrind. This can take a really long time
987
+ # because valgrind is so much slower than a native machine.
988
+ #
989
+ valgrindtest : testfixture$(TEXE ) sqlite3$(TEXE )
990
+ OMIT_MISUSE=1 valgrind -v ./testfixture$(TEXE ) $(TOP ) /test/permutations.test valgrind
991
+
992
+ # A very fast test that checks basic sanity. The name comes from
993
+ # the 60s-era electronics testing: "Turn it on and see if smoke
994
+ # comes out."
995
+ #
996
+ smoketest : testfixture$(TEXE )
997
+ ./testfixture$(TEXE ) $(TOP ) /test/main.test
998
+
964
999
sqlite3_analyzer.c : sqlite3.c $(TOP ) /src/test_stat.c $(TOP ) /src/tclsqlite.c $(TOP ) /tool/spaceanal.tcl
965
1000
echo " #define TCLSH 2" > $@
966
1001
cat sqlite3.c $(TOP ) /src/test_stat.c $(TOP ) /src/tclsqlite.c >> $@
@@ -996,12 +1031,45 @@ wordcount$(TEXE): $(TOP)/test/wordcount.c sqlite3.c
996
1031
speedtest1$(TEXE ) : $(TOP ) /test/wordcount.c sqlite3.lo
997
1032
$(LTLINK ) -o $@ $(TOP ) /test/speedtest1.c sqlite3.lo $(TLIBS )
998
1033
1034
+ # This target will fail if the SQLite amalgamation contains any exported
1035
+ # symbols that do not begin with "sqlite3_". It is run as part of the
1036
+ # releasetest.tcl script.
1037
+ #
1038
+ checksymbols : sqlite3.lo
1039
+ nm -g --defined-only sqlite3.o | grep -v " sqlite3_" ; test $$? -ne 0
1040
+ echo ' 0 errors out of 1 tests'
1041
+
1042
+ # Build the amalgamation-autoconf package.
1043
+ #
1044
+ amalgamation-tarball : sqlite3.c
1045
+ TOP=$(TOP ) sh $(TOP ) /tool/mkautoconfamal.sh
1046
+
1047
+ # The next two rules are used to support the "threadtest" target. Building
1048
+ # threadtest runs a few thread-safety tests that are implemented in C. This
1049
+ # target is invoked by the releasetest.tcl script.
1050
+ #
1051
+ THREADTEST3_SRC = $(TOP ) /test/threadtest3.c \
1052
+ $(TOP )/test/tt3_checkpoint.c \
1053
+ $(TOP ) /test/tt3_index.c \
1054
+ $(TOP ) /test/tt3_vacuum.c \
1055
+ $(TOP ) /test/tt3_stress.c \
1056
+ $(TOP ) /test/tt3_lookaside1.c
1057
+
1058
+ threadtest3$(TEXE ) : sqlite3.lo $(THREADTEST3_SRC )
1059
+ $(LTLINK ) $(TOP ) /test/threadtest3.c sqlite3.lo -o $@ $(TLIBS )
1060
+
1061
+ threadtest : threadtest3$(TEXE )
1062
+ ./threadtest3$(TEXE )
1063
+
1064
+ releasetest :
1065
+ $(TCLSH_CMD ) $(TOP ) /test/releasetest.tcl
1066
+
999
1067
# Standard install and cleanup targets
1000
1068
#
1001
1069
lib_install : libsqlcipher.la
1002
1070
$(INSTALL ) -d $(DESTDIR )$(libdir )
1003
1071
$(LTINSTALL ) libsqlcipher.la $(DESTDIR )$(libdir )
1004
-
1072
+
1005
1073
install : sqlcipher$(BEXE ) lib_install sqlite3.h sqlcipher.pc ${HAVE_TCL:1=tcl_install}
1006
1074
$(INSTALL ) -d $(DESTDIR )$(bindir )
1007
1075
$(LTINSTALL ) sqlcipher$(BEXE ) $(DESTDIR )$(bindir )
0 commit comments