@@ -9,49 +9,75 @@ TOP = .
99
1010# Set this non-0 to create and use the SQLite amalgamation file.
1111#
12+ !IFNDEF USE_AMALGAMATION
1213USE_AMALGAMATION = 1
14+ !ENDIF
1315
1416# Set this non-0 to use the International Components for Unicode (ICU).
1517#
18+ !IFNDEF USE_ICU
1619USE_ICU = 0
20+ !ENDIF
1721
1822# Set this non-0 to dynamically link to the MSVC runtime library.
1923#
24+ !IFNDEF USE_CRT_DLL
2025USE_CRT_DLL = 0
26+ !ENDIF
2127
2228# Set this non-0 to attempt setting the native compiler automatically
2329# for cross-compiling the command line tools needed during the compilation
2430# process.
2531#
32+ !IFNDEF XCOMPILE
2633XCOMPILE = 0
34+ !ENDIF
2735
2836# Set this non-0 to use the native libraries paths for cross-compiling
2937# the command line tools needed during the compilation process.
3038#
39+ !IFNDEF USE_NATIVE_LIBPATHS
3140USE_NATIVE_LIBPATHS = 0
41+ !ENDIF
42+
43+ # Set this 0 to skip the compiling and embedding of version resources.
44+ #
45+ !IFNDEF USE_RC
46+ USE_RC = 1
47+ !ENDIF
3248
3349# Set this non-0 to compile binaries suitable for the WinRT environment.
3450# This setting does not apply to any binaries that require Tcl to operate
3551# properly (i.e. the text fixture, etc).
3652#
53+ !IFNDEF FOR_WINRT
3754FOR_WINRT = 0
55+ !ENDIF
3856
3957# Set this non-0 to skip attempting to look for and/or link with the Tcl
4058# runtime library.
4159#
60+ !IFNDEF NO_TCL
4261NO_TCL = 0
62+ !ENDIF
4363
4464# Set this to non-0 to create and use PDBs.
4565#
66+ !IFNDEF SYMBOLS
4667SYMBOLS = 1
68+ !ENDIF
4769
4870# Set this to non-0 to use the SQLite debugging heap subsystem.
4971#
72+ !IFNDEF MEMDEBUG
5073MEMDEBUG = 0
74+ !ENDIF
5175
5276# Set this to non-0 to use the Win32 native heap subsystem.
5377#
78+ !IFNDEF WIN32HEAP
5479WIN32HEAP = 0
80+ !ENDIF
5581
5682# Set this to one of the following values to enable various debugging
5783# features. Each level includes the debugging options from the previous
@@ -64,7 +90,9 @@ WIN32HEAP = 0
6490# 4 == SQLITE_DEBUG_OS_TRACE: Enables output from the OSTRACE() macros.
6591# 5 == SQLITE_ENABLE_IOTRACE: Enables output from the IOTRACE() macros.
6692#
93+ !IFNDEF DEBUG
6794DEBUG = 0
95+ !ENDIF
6896
6997# Check for the predefined command macro CC. This should point to the compiler
7098# binary for the target platform. If it is not defined, simply define it to
@@ -157,8 +185,8 @@ NLTLIBPATHS = "/LIBPATH:$(NCRTLIBPATH)" "/LIBPATH:$(NSDKLIBPATH)"
157185# will run on the target platform. (BCC and TCC are usually the
158186# same unless your are cross-compiling.)
159187#
160- TCC = $(CC) -W3 -DSQLITE_OS_WIN=1 -I. -I$(TOP)\src -fp:precise
161- RCC = $(RC) -DSQLITE_OS_WIN=1 -I. -I$(TOP)\src
188+ TCC = $(CC) -W3 -DSQLITE_OS_WIN=1 -I$(TOP) -I$(TOP)\src -fp:precise
189+ RCC = $(RC) -DSQLITE_OS_WIN=1 -I$(TOP) -I$(TOP)\src
162190
163191# When compiling the library for use in the WinRT environment,
164192# the following compile-time options must be used as well to
@@ -168,8 +196,8 @@ RCC = $(RC) -DSQLITE_OS_WIN=1 -I. -I$(TOP)\src
168196!IF $(FOR_WINRT)!=0
169197TCC = $(TCC) -DSQLITE_OS_WINRT=1
170198RCC = $(RCC) -DSQLITE_OS_WINRT=1
171- TCC = $(TCC) -DWINAPI_FAMILY=WINAPI_PARTITION_APP
172- RCC = $(RCC) -DWINAPI_FAMILY=WINAPI_PARTITION_APP
199+ TCC = $(TCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
200+ RCC = $(RCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
173201!ENDIF
174202
175203# Also, we need to dynamically link to the correct MSVC runtime
@@ -180,14 +208,18 @@ RCC = $(RCC) -DWINAPI_FAMILY=WINAPI_PARTITION_APP
180208!IF $(FOR_WINRT)!=0 || $(USE_CRT_DLL)!=0
181209!IF $(DEBUG)>0
182210TCC = $(TCC) -MDd
211+ BCC = $(BCC) -MDd
183212!ELSE
184213TCC = $(TCC) -MD
214+ BCC = $(BCC) -MD
185215!ENDIF
186216!ELSE
187217!IF $(DEBUG)>0
188218TCC = $(TCC) -MTd
219+ BCC = $(BCC) -MTd
189220!ELSE
190221TCC = $(TCC) -MT
222+ BCC = $(BCC) -MT
191223!ENDIF
192224!ENDIF
193225
@@ -472,6 +504,14 @@ LIBOBJ = $(LIBOBJS0)
472504LIBOBJ = $(LIBOBJS1)
473505!ENDIF
474506
507+ # Determine if embedded resource compilation and usage are enabled.
508+ #
509+ !IF $(USE_RC)!=0
510+ LIBRESOBJS = sqlite3res.lo
511+ !ELSE
512+ LIBRESOBJS =
513+ !ENDIF
514+
475515# All of the source code files.
476516#
477517SRC = \
@@ -766,10 +806,10 @@ libsqlite3.lib: $(LIBOBJ)
766806libtclsqlite3.lib: tclsqlite.lo libsqlite3.lib
767807 $(LTLIB) $(LTLIBOPTS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCL:tcl=tclstub) $(TLIBS)
768808
769- sqlite3.exe: $(TOP)\src\shell.c libsqlite3.lib sqlite3res.lo sqlite3.h
809+ sqlite3.exe: $(TOP)\src\shell.c libsqlite3.lib $(LIBRESOBJS) sqlite3.h
770810 $(LTLINK) $(READLINE_FLAGS) \
771811 $(TOP)\src\shell.c \
772- /link $(LTLINKOPTS) $(LTLIBPATHS) libsqlite3.lib sqlite3res.lo $(LIBREADLINE) $(LTLIBS) $(TLIBS)
812+ /link $(LTLINKOPTS) $(LTLIBPATHS) libsqlite3.lib $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS)
773813
774814# This target creates a directory named "tsrc" and fills it with
775815# copies of all of the C source code and header files needed to
@@ -789,8 +829,8 @@ sqlite3.exe: $(TOP)\src\shell.c libsqlite3.lib sqlite3res.lo sqlite3.h
789829sqlite3.c: .target_source $(TOP)\tool\mksqlite3c.tcl
790830 $(TCLSH_CMD) $(TOP)\tool\mksqlite3c.tcl
791831
792- sqlite3-all.c: sqlite3.c $(TOP)/ tool/ split-sqlite3c.tcl
793- $(TCLSH_CMD) $(TOP)/ tool/ split-sqlite3c.tcl
832+ sqlite3-all.c: sqlite3.c $(TOP)\ tool\ split-sqlite3c.tcl
833+ $(TCLSH_CMD) $(TOP)\ tool\ split-sqlite3c.tcl
794834
795835# Rule to build the amalgamation
796836#
@@ -819,14 +859,16 @@ opcodes.lo: opcodes.c
819859
820860# Rule to build the Win32 resources object file.
821861#
822- sqlite3res.lo: $(TOP)\src\sqlite3.rc $(HDR)
862+ !IF $(USE_RC)!=0
863+ $(LIBRESOBJS): $(TOP)\src\sqlite3.rc $(HDR)
823864 echo #ifndef SQLITE_RESOURCE_VERSION > sqlite3rc.h
824- for /F %%V in ('type VERSION') do ( \
865+ for /F %%V in ('type "$(TOP)\ VERSION" ') do ( \
825866 echo #define SQLITE_RESOURCE_VERSION %%V \
826867 | $(NAWK) "/.*/ { gsub(/[.]/,\",\");print }" >> sqlite3rc.h \
827868 )
828869 echo #endif >> sqlite3rc.h
829- $(LTRCOMPILE) -fo sqlite3res.lo $(TOP)\src\sqlite3.rc
870+ $(LTRCOMPILE) -fo $(LIBRESOBJS) $(TOP)\src\sqlite3.rc
871+ !ENDIF
830872
831873# Rules to build individual *.lo files from files in the src directory.
832874#
@@ -1043,8 +1085,8 @@ tclsqlite.lo: $(TOP)\src\tclsqlite.c $(HDR)
10431085tclsqlite-shell.lo: $(TOP)\src\tclsqlite.c $(HDR)
10441086 $(LTCOMPILE) -DTCLSH=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c
10451087
1046- tclsqlite3.exe: tclsqlite-shell.lo libsqlite3.lib sqlite3res.lo
1047- $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /OUT:$@ libsqlite3.lib tclsqlite-shell.lo sqlite3res.lo $(LTLIBS) $(TLIBS)
1088+ tclsqlite3.exe: tclsqlite-shell.lo libsqlite3.lib $(LIBRESOBJS)
1089+ $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /OUT:$@ libsqlite3.lib tclsqlite-shell.lo $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
10481090
10491091# Rules to build opcodes.c and opcodes.h
10501092#
@@ -1157,18 +1199,21 @@ TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC0)
11571199TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC1)
11581200!ENDIF
11591201
1160- testfixture.exe: $(TESTFIXTURE_SRC) sqlite3res.lo $(HDR)
1202+ testfixture.exe: $(TESTFIXTURE_SRC) $(LIBRESOBJS) $(HDR)
11611203 $(LTLINK) -DSQLITE_NO_SYNC=1 $(TESTFIXTURE_FLAGS) \
11621204 -DBUILD_sqlite -I$(TCLINCDIR) \
11631205 $(TESTFIXTURE_SRC) \
1164- /link $(LTLINKOPTS) $(LTLIBPATHS) sqlite3res.lo $(LTLIBS) $(TLIBS)
1206+ /link $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
11651207
11661208fulltest: testfixture.exe sqlite3.exe
11671209 .\testfixture.exe $(TOP)\test\all.test
11681210
11691211soaktest: testfixture.exe sqlite3.exe
11701212 .\testfixture.exe $(TOP)\test\all.test -soak=1
11711213
1214+ fulltestonly: testfixture.exe sqlite3.exe
1215+ .\testfixture.exe $(TOP)\test\full.test
1216+
11721217test: testfixture.exe sqlite3.exe
11731218 .\testfixture.exe $(TOP)\test\veryquick.test
11741219
@@ -1179,9 +1224,9 @@ sqlite3_analyzer.c: sqlite3.c $(TOP)\src\test_stat.c $(TOP)\src\tclsqlite.c $(TO
11791224 $(NAWK) -f $(TOP)\tool\tostr.awk $(TOP)\tool\spaceanal.tcl >> $@
11801225 echo ; return zMainloop; } >> $@
11811226
1182- sqlite3_analyzer.exe: sqlite3_analyzer.c sqlite3res.lo
1227+ sqlite3_analyzer.exe: sqlite3_analyzer.c $(LIBRESOBJS)
11831228 $(LTLINK) -DBUILD_sqlite -DTCLSH=2 -I$(TCLINCDIR) sqlite3_analyzer.c \
1184- /link $(LTLINKOPTS) $(LTLIBPATHS) sqlite3res.lo $(LTLIBS) $(TLIBS)
1229+ /link $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
11851230
11861231clean:
11871232 del /Q *.lo *.ilk *.lib *.obj *.pdb sqlite3.exe libsqlite3.lib
@@ -1202,7 +1247,7 @@ clean:
12021247 del /Q sqlite3.c
12031248 del /Q sqlite3rc.h
12041249 del /Q sqlite3_analyzer.exe sqlite3_analyzer.exp sqlite3_analyzer.c
1205- del /Q sqlite-output.vsix
1250+ del /Q sqlite-*- output.vsix
12061251
12071252# Dynamic link library section.
12081253#
@@ -1214,5 +1259,5 @@ sqlite3.def: libsqlite3.lib
12141259 | $(NAWK) "/ 1 _?sqlite3_/ { sub(/^.* _?/,\"\");print }" \
12151260 | sort >> sqlite3.def
12161261
1217- sqlite3.dll: $(LIBOBJ) sqlite3res.lo sqlite3.def
1218- $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /DEF:sqlite3.def /OUT:$@ $(LIBOBJ) sqlite3res.lo $(LTLIBS) $(TLIBS)
1262+ sqlite3.dll: $(LIBOBJ) $(LIBRESOBJS) sqlite3.def
1263+ $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /DEF:sqlite3.def /OUT:$@ $(LIBOBJ) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
0 commit comments