xref: /sqlite-3.40.0/Makefile.msc (revision cc285c5a)
1#
2# nmake Makefile for SQLite
3#
4###############################################################################
5############################## START OF OPTIONS ###############################
6###############################################################################
7
8# The toplevel directory of the source tree.  This is the directory
9# that contains this "Makefile.msc".
10#
11TOP = .
12
13# Set this non-0 to create and use the SQLite amalgamation file.
14#
15!IFNDEF USE_AMALGAMATION
16USE_AMALGAMATION = 1
17!ENDIF
18
19# Set this non-0 to enable full warnings (-W4, etc) when compiling.
20#
21!IFNDEF USE_FULLWARN
22USE_FULLWARN = 0
23!ENDIF
24
25# If necessary, create a list of harmless compiler warnings to disable when
26# compiling the build tools.  For the SQLite source code itself, warnings,
27# if any, will be disabled from within it.
28#
29!IFNDEF NO_WARN
30!IF $(USE_FULLWARN)!=0
31NO_WARN = -wd4054 -wd4055 -wd4100 -wd4127 -wd4152 -wd4189 -wd4206 -wd4210
32NO_WARN = $(NO_WARN) -wd4232 -wd4244 -wd4305 -wd4306 -wd4702 -wd4706
33!ENDIF
34!ENDIF
35
36# Set this non-0 to use the library paths and other options necessary for
37# Windows Phone 8.1.
38#
39!IFNDEF USE_WP81_OPTS
40USE_WP81_OPTS = 0
41!ENDIF
42
43# Set this non-0 to split the SQLite amalgamation file into chunks to
44# be used for debugging with Visual Studio.
45#
46!IFNDEF SPLIT_AMALGAMATION
47SPLIT_AMALGAMATION = 0
48!ENDIF
49
50# Set this non-0 to use the International Components for Unicode (ICU).
51#
52!IFNDEF USE_ICU
53USE_ICU = 0
54!ENDIF
55
56# Set this non-0 to dynamically link to the MSVC runtime library.
57#
58!IFNDEF USE_CRT_DLL
59USE_CRT_DLL = 0
60!ENDIF
61
62# Set this non-0 to link to the RPCRT4 library.
63#
64!IFNDEF USE_RPCRT4_LIB
65USE_RPCRT4_LIB = 0
66!ENDIF
67
68# Set this non-0 to generate assembly code listings for the source code
69# files.
70#
71!IFNDEF USE_LISTINGS
72USE_LISTINGS = 0
73!ENDIF
74
75# Set this non-0 to attempt setting the native compiler automatically
76# for cross-compiling the command line tools needed during the compilation
77# process.
78#
79!IFNDEF XCOMPILE
80XCOMPILE = 0
81!ENDIF
82
83# Set this non-0 to use the native libraries paths for cross-compiling
84# the command line tools needed during the compilation process.
85#
86!IFNDEF USE_NATIVE_LIBPATHS
87USE_NATIVE_LIBPATHS = 0
88!ENDIF
89
90# Set this 0 to skip the compiling and embedding of version resources.
91#
92!IFNDEF USE_RC
93USE_RC = 1
94!ENDIF
95
96# Set this non-0 to compile binaries suitable for the WinRT environment.
97# This setting does not apply to any binaries that require Tcl to operate
98# properly (i.e. the text fixture, etc).
99#
100!IFNDEF FOR_WINRT
101FOR_WINRT = 0
102!ENDIF
103
104# Set this non-0 to skip attempting to look for and/or link with the Tcl
105# runtime library.
106#
107!IFNDEF NO_TCL
108NO_TCL = 0
109!ENDIF
110
111# Set this to non-0 to create and use PDBs.
112#
113!IFNDEF SYMBOLS
114SYMBOLS = 1
115!ENDIF
116
117# Set this to non-0 to use the SQLite debugging heap subsystem.
118#
119!IFNDEF MEMDEBUG
120MEMDEBUG = 0
121!ENDIF
122
123# Set this to non-0 to use the Win32 native heap subsystem.
124#
125!IFNDEF WIN32HEAP
126WIN32HEAP = 0
127!ENDIF
128
129# Set this to one of the following values to enable various debugging
130# features.  Each level includes the debugging options from the previous
131# levels.  Currently, the recognized values for DEBUG are:
132#
133# 0 == NDEBUG: Disables assert() and other runtime diagnostics.
134# 1 == SQLITE_ENABLE_API_ARMOR: extra attempts to detect misuse of the API.
135# 2 == Disables NDEBUG and all optimizations and then enables PDBs.
136# 3 == SQLITE_DEBUG: Enables various diagnostics messages and code.
137# 4 == SQLITE_WIN32_MALLOC_VALIDATE: Validate the Win32 native heap per call.
138# 5 == SQLITE_DEBUG_OS_TRACE: Enables output from the OSTRACE() macros.
139# 6 == SQLITE_ENABLE_IOTRACE: Enables output from the IOTRACE() macros.
140#
141!IFNDEF DEBUG
142DEBUG = 0
143!ENDIF
144
145# Enable use of available compiler optimizations?  Normally, this should be
146# non-zero.  Setting this to zero, thus disabling all compiler optimizations,
147# can be useful for testing.
148#
149!IFNDEF OPTIMIZATIONS
150OPTIMIZATIONS = 2
151!ENDIF
152
153# These are the "standard" SQLite compilation options used when compiling for
154# the Windows platform.
155#
156!IFNDEF OPT_FEATURE_FLAGS
157OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS3=1
158OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RTREE=1
159OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_COLUMN_METADATA=1
160!ENDIF
161
162###############################################################################
163############################### END OF OPTIONS ################################
164###############################################################################
165
166# This assumes that MSVC is always installed in 32-bit Program Files directory
167# and sets the variable for use in locating other 32-bit installs accordingly.
168#
169PROGRAMFILES_X86 = $(VCINSTALLDIR)\..\..
170PROGRAMFILES_X86 = $(PROGRAMFILES_X86:\\=\)
171
172# Check for the predefined command macro CC.  This should point to the compiler
173# binary for the target platform.  If it is not defined, simply define it to
174# the legacy default value 'cl.exe'.
175#
176!IFNDEF CC
177CC = cl.exe
178!ENDIF
179
180# Check for the command macro LD.  This should point to the linker binary for
181# the target platform.  If it is not defined, simply define it to the legacy
182# default value 'link.exe'.
183#
184!IFNDEF LD
185LD = link.exe
186!ENDIF
187
188# Check for the predefined command macro RC.  This should point to the resource
189# compiler binary for the target platform.  If it is not defined, simply define
190# it to the legacy default value 'rc.exe'.
191#
192!IFNDEF RC
193RC = rc.exe
194!ENDIF
195
196# Check for the MSVC runtime library path macro.  Othertise, this value will
197# default to the 'lib' directory underneath the MSVC installation directory.
198#
199!IFNDEF CRTLIBPATH
200CRTLIBPATH = $(VCINSTALLDIR)\lib
201!ENDIF
202
203CRTLIBPATH = $(CRTLIBPATH:\\=\)
204
205# Check for the command macro NCC.  This should point to the compiler binary
206# for the platform the compilation process is taking place on.  If it is not
207# defined, simply define it to have the same value as the CC macro.  When
208# cross-compiling, it is suggested that this macro be modified via the command
209# line (since nmake itself does not provide a built-in method to guess it).
210# For example, to use the x86 compiler when cross-compiling for x64, a command
211# line similar to the following could be used (all on one line):
212#
213#     nmake /f Makefile.msc sqlite3.dll
214#           XCOMPILE=1 USE_NATIVE_LIBPATHS=1
215#
216# Alternatively, the full path and file name to the compiler binary for the
217# platform the compilation process is taking place may be specified (all on
218# one line):
219#
220#     nmake /f Makefile.msc sqlite3.dll
221#           "NCC=""%VCINSTALLDIR%\bin\cl.exe"""
222#           USE_NATIVE_LIBPATHS=1
223#
224!IFDEF NCC
225NCC = $(NCC:\\=\)
226!ELSEIF $(XCOMPILE)!=0
227NCC = "$(VCINSTALLDIR)\bin\$(CC)"
228NCC = $(NCC:\\=\)
229!ELSE
230NCC = $(CC)
231!ENDIF
232
233# Check for the MSVC native runtime library path macro.  Othertise,
234# this value will default to the 'lib' directory underneath the MSVC
235# installation directory.
236#
237!IFNDEF NCRTLIBPATH
238NCRTLIBPATH = $(VCINSTALLDIR)\lib
239!ENDIF
240
241NCRTLIBPATH = $(NCRTLIBPATH:\\=\)
242
243# Check for the Platform SDK library path macro.  Othertise, this
244# value will default to the 'lib' directory underneath the Windows
245# SDK installation directory (the environment variable used appears
246# to be available when using Visual C++ 2008 or later via the
247# command line).
248#
249!IFNDEF NSDKLIBPATH
250NSDKLIBPATH = $(WINDOWSSDKDIR)\lib
251!ENDIF
252
253NSDKLIBPATH = $(NSDKLIBPATH:\\=\)
254
255# C compiler and options for use in building executables that
256# will run on the platform that is doing the build.
257#
258!IF $(USE_FULLWARN)!=0
259BCC = $(NCC) -W4
260!ELSE
261BCC = $(NCC) -W3
262!ENDIF
263
264# Check if assembly code listings should be generated for the source
265# code files to be compiled.
266#
267!IF $(USE_LISTINGS)!=0
268BCC = $(BCC) -FAcs
269!ENDIF
270
271# Check if the native library paths should be used when compiling
272# the command line tools used during the compilation process.  If
273# so, set the necessary macro now.
274#
275!IF $(USE_NATIVE_LIBPATHS)!=0
276NLTLIBPATHS = "/LIBPATH:$(NCRTLIBPATH)" "/LIBPATH:$(NSDKLIBPATH)"
277!ENDIF
278
279# C compiler and options for use in building executables that
280# will run on the target platform.  (BCC and TCC are usually the
281# same unless your are cross-compiling.)
282#
283!IF $(USE_FULLWARN)!=0
284TCC = $(CC) -W4 -DINCLUDE_MSVC_H=1
285!ELSE
286TCC = $(CC) -W3
287!ENDIF
288
289TCC = $(TCC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) -I$(TOP)\src -fp:precise
290RCC = $(RC) -DSQLITE_OS_WIN=1 -I$(TOP) -I$(TOP)\src
291
292# Check if assembly code listings should be generated for the source
293# code files to be compiled.
294#
295!IF $(USE_LISTINGS)!=0
296TCC = $(TCC) -FAcs
297!ENDIF
298
299# When compiling the library for use in the WinRT environment,
300# the following compile-time options must be used as well to
301# disable use of Win32 APIs that are not available and to enable
302# use of Win32 APIs that are specific to Windows 8 and/or WinRT.
303#
304!IF $(FOR_WINRT)!=0
305TCC = $(TCC) -DSQLITE_OS_WINRT=1
306RCC = $(RCC) -DSQLITE_OS_WINRT=1
307TCC = $(TCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
308RCC = $(RCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
309!ENDIF
310
311# Also, we need to dynamically link to the correct MSVC runtime
312# when compiling for WinRT (e.g. debug or release) OR if the
313# USE_CRT_DLL option is set to force dynamically linking to the
314# MSVC runtime library.
315#
316!IF $(FOR_WINRT)!=0 || $(USE_CRT_DLL)!=0
317!IF $(DEBUG)>1
318TCC = $(TCC) -MDd
319BCC = $(BCC) -MDd
320!ELSE
321TCC = $(TCC) -MD
322BCC = $(BCC) -MD
323!ENDIF
324!ELSE
325!IF $(DEBUG)>1
326TCC = $(TCC) -MTd
327BCC = $(BCC) -MTd
328!ELSE
329TCC = $(TCC) -MT
330BCC = $(BCC) -MT
331!ENDIF
332!ENDIF
333
334# The mksqlite3c.tcl and mksqlite3h.tcl scripts will pull in
335# any extension header files by default.  For non-amalgamation
336# builds, we need to make sure the compiler can find these.
337#
338!IF $(USE_AMALGAMATION)==0
339TCC = $(TCC) -I$(TOP)\ext\fts3
340RCC = $(RCC) -I$(TOP)\ext\fts3
341TCC = $(TCC) -I$(TOP)\ext\rtree
342RCC = $(RCC) -I$(TOP)\ext\rtree
343!ENDIF
344
345# The mksqlite3c.tcl script accepts some options on the command
346# line.  When compiling with debugging enabled, some of these
347# options are necessary in order to allow debugging symbols to
348# work correctly with Visual Studio when using the amalgamation.
349#
350!IF $(DEBUG)>1
351MKSQLITE3C_ARGS = --linemacros
352!ELSE
353MKSQLITE3C_ARGS =
354!ENDIF
355
356# Define -DNDEBUG to compile without debugging (i.e., for production usage)
357# Omitting the define will cause extra debugging code to be inserted and
358# includes extra comments when "EXPLAIN stmt" is used.
359#
360!IF $(DEBUG)==0
361TCC = $(TCC) -DNDEBUG
362BCC = $(BCC) -DNDEBUG
363RCC = $(RCC) -DNDEBUG
364!ENDIF
365
366!IF $(DEBUG)>0
367TCC = $(TCC) -DSQLITE_ENABLE_API_ARMOR
368RCC = $(RCC) -DSQLITE_ENABLE_API_ARMOR
369!ENDIF
370
371!IF $(DEBUG)>2
372TCC = $(TCC) -DSQLITE_DEBUG
373RCC = $(RCC) -DSQLITE_DEBUG
374!ENDIF
375
376!IF $(DEBUG)>4
377TCC = $(TCC) -DSQLITE_DEBUG_OS_TRACE=1
378RCC = $(RCC) -DSQLITE_DEBUG_OS_TRACE=1
379!ENDIF
380
381!IF $(DEBUG)>5
382TCC = $(TCC) -DSQLITE_ENABLE_IOTRACE
383RCC = $(RCC) -DSQLITE_ENABLE_IOTRACE
384!ENDIF
385
386# Prevent warnings about "insecure" MSVC runtime library functions
387# being used.
388#
389TCC = $(TCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
390BCC = $(BCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
391RCC = $(RCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
392
393# Prevent warnings about "deprecated" POSIX functions being used.
394#
395TCC = $(TCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
396BCC = $(BCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
397RCC = $(RCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
398
399# Use the SQLite debugging heap subsystem?
400#
401!IF $(MEMDEBUG)!=0
402TCC = $(TCC) -DSQLITE_MEMDEBUG=1
403RCC = $(RCC) -DSQLITE_MEMDEBUG=1
404
405# Use native Win32 heap subsystem instead of malloc/free?
406#
407!ELSEIF $(WIN32HEAP)!=0
408TCC = $(TCC) -DSQLITE_WIN32_MALLOC=1
409RCC = $(RCC) -DSQLITE_WIN32_MALLOC=1
410
411# Validate the heap on every call into the native Win32 heap subsystem?
412#
413!IF $(DEBUG)>3
414TCC = $(TCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1
415RCC = $(RCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1
416!ENDIF
417!ENDIF
418
419# The locations of the Tcl header and library files.  Also, the library that
420# non-stubs enabled programs using Tcl must link against.  These variables
421# (TCLINCDIR, TCLLIBDIR, and LIBTCL) may be overridden via the environment
422# prior to running nmake in order to match the actual installed location and
423# version on this machine.
424#
425!IFNDEF TCLINCDIR
426TCLINCDIR = c:\tcl\include
427!ENDIF
428
429!IFNDEF TCLLIBDIR
430TCLLIBDIR = c:\tcl\lib
431!ENDIF
432
433!IFNDEF LIBTCL
434LIBTCL = tcl85.lib
435!ENDIF
436
437# The locations of the ICU header and library files.  These variables
438# (ICUINCDIR, ICULIBDIR, and LIBICU) may be overridden via the environment
439# prior to running nmake in order to match the actual installed location on
440# this machine.
441#
442!IFNDEF ICUINCDIR
443ICUINCDIR = c:\icu\include
444!ENDIF
445
446!IFNDEF ICULIBDIR
447ICULIBDIR = c:\icu\lib
448!ENDIF
449
450!IFNDEF LIBICU
451LIBICU = icuuc.lib icuin.lib
452!ENDIF
453
454# This is the command to use for tclsh - normally just "tclsh", but we may
455# know the specific version we want to use.  This variable (TCLSH_CMD) may be
456# overridden via the environment prior to running nmake in order to select a
457# specific Tcl shell to use.
458#
459!IFNDEF TCLSH_CMD
460TCLSH_CMD = tclsh85
461!ENDIF
462
463# Compiler options needed for programs that use the readline() library.
464#
465!IFNDEF READLINE_FLAGS
466READLINE_FLAGS = -DHAVE_READLINE=0
467!ENDIF
468
469# The library that programs using readline() must link against.
470#
471!IFNDEF LIBREADLINE
472LIBREADLINE =
473!ENDIF
474
475# Should the database engine be compiled threadsafe
476#
477TCC = $(TCC) -DSQLITE_THREADSAFE=1
478RCC = $(RCC) -DSQLITE_THREADSAFE=1
479
480# Do threads override each others locks by default (1), or do we test (-1)
481#
482TCC = $(TCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1
483RCC = $(RCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1
484
485# Any target libraries which libsqlite must be linked against
486#
487!IFNDEF TLIBS
488TLIBS =
489!ENDIF
490
491# Flags controlling use of the in memory btree implementation
492#
493# SQLITE_TEMP_STORE is 0 to force temporary tables to be in a file, 1 to
494# default to file, 2 to default to memory, and 3 to force temporary
495# tables to always be in memory.
496#
497TCC = $(TCC) -DSQLITE_TEMP_STORE=1
498RCC = $(RCC) -DSQLITE_TEMP_STORE=1
499
500# Enable/disable loadable extensions, and other optional features
501# based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*).
502# The same set of OMIT and ENABLE flags should be passed to the
503# LEMON parser generator and the mkkeywordhash tool as well.
504
505# These are the required SQLite compilation options used when compiling for
506# the Windows platform.
507#
508REQ_FEATURE_FLAGS = $(REQ_FEATURE_FLAGS) -DSQLITE_MAX_TRIGGER_DEPTH=100
509
510# If we are linking to the RPCRT4 library, enable features that need it.
511#
512!IF $(USE_RPCRT4_LIB)!=0
513REQ_FEATURE_FLAGS = $(REQ_FEATURE_FLAGS) -DSQLITE_WIN32_USE_UUID=1
514!ENDIF
515
516# Add the required and optional SQLite compilation options into the command
517# lines used to invoke the MSVC code and resource compilers.
518#
519TCC = $(TCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS)
520RCC = $(RCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS)
521
522# Add in any optional parameters specified on the commane line, e.g.
523# nmake /f Makefile.msc all "OPTS=-DSQLITE_ENABLE_FOO=1 -DSQLITE_OMIT_FOO=1"
524#
525TCC = $(TCC) $(OPTS)
526RCC = $(RCC) $(OPTS)
527
528# If compiling for debugging, add some defines.
529#
530!IF $(DEBUG)>1
531TCC = $(TCC) -D_DEBUG
532BCC = $(BCC) -D_DEBUG
533RCC = $(RCC) -D_DEBUG
534!ENDIF
535
536# If optimizations are enabled or disabled (either implicitly or
537# explicitly), add the necessary flags.
538#
539!IF $(DEBUG)>1 || $(OPTIMIZATIONS)==0
540TCC = $(TCC) -Od
541BCC = $(BCC) -Od
542!ELSEIF $(OPTIMIZATIONS)>=3
543TCC = $(TCC) -Ox
544BCC = $(BCC) -Ox
545!ELSEIF $(OPTIMIZATIONS)==2
546TCC = $(TCC) -O2
547BCC = $(BCC) -O2
548!ELSEIF $(OPTIMIZATIONS)==1
549TCC = $(TCC) -O1
550BCC = $(BCC) -O1
551!ENDIF
552
553# If symbols are enabled (or compiling for debugging), enable PDBs.
554#
555!IF $(DEBUG)>1 || $(SYMBOLS)!=0
556TCC = $(TCC) -Zi
557BCC = $(BCC) -Zi
558!ENDIF
559
560# If ICU support is enabled, add the compiler options for it.
561#
562!IF $(USE_ICU)!=0
563TCC = $(TCC) -DSQLITE_ENABLE_ICU=1
564RCC = $(RCC) -DSQLITE_ENABLE_ICU=1
565TCC = $(TCC) -I$(TOP)\ext\icu
566RCC = $(RCC) -I$(TOP)\ext\icu
567TCC = $(TCC) -I$(ICUINCDIR)
568RCC = $(RCC) -I$(ICUINCDIR)
569!ENDIF
570
571# Command line prefixes for compiling code, compiling resources,
572# linking, etc.
573#
574LTCOMPILE = $(TCC) -Fo$@
575LTRCOMPILE = $(RCC) -r
576LTLIB = lib.exe
577LTLINK = $(TCC) -Fe$@
578
579# If requested, link to the RPCRT4 library.
580#
581!IF $(USE_RPCRT4_LIB)!=0
582LTLINK = $(LTLINK) rpcrt4.lib
583!ENDIF
584
585# If a platform was set, force the linker to target that.
586# Note that the vcvars*.bat family of batch files typically
587# set this for you.  Otherwise, the linker will attempt
588# to deduce the binary type based on the object files.
589!IFDEF PLATFORM
590LTLINKOPTS = /MACHINE:$(PLATFORM)
591LTLIBOPTS = /MACHINE:$(PLATFORM)
592!ENDIF
593
594# When compiling for use in the WinRT environment, the following
595# linker option must be used to mark the executable as runnable
596# only in the context of an application container.
597#
598!IF $(FOR_WINRT)!=0
599LTLINKOPTS = $(LTLINKOPTS) /APPCONTAINER
600!IF "$(VISUALSTUDIOVERSION)"=="12.0"
601!IFNDEF STORELIBPATH
602!IF "$(PLATFORM)"=="x86"
603STORELIBPATH = $(CRTLIBPATH)\store
604!ELSEIF "$(PLATFORM)"=="x64"
605STORELIBPATH = $(CRTLIBPATH)\store\amd64
606!ELSEIF "$(PLATFORM)"=="ARM"
607STORELIBPATH = $(CRTLIBPATH)\store\arm
608!ELSE
609STORELIBPATH = $(CRTLIBPATH)\store
610!ENDIF
611!ENDIF
612STORELIBPATH = $(STORELIBPATH:\\=\)
613LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(STORELIBPATH)"
614!ENDIF
615!ENDIF
616
617# When compiling for Windows Phone 8.1, an extra library path is
618# required.
619#
620!IF $(USE_WP81_OPTS)!=0
621!IFNDEF WP81LIBPATH
622!IF "$(PLATFORM)"=="x86"
623WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86
624!ELSEIF "$(PLATFORM)"=="ARM"
625WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\ARM
626!ELSE
627WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86
628!ENDIF
629!ENDIF
630!ENDIF
631
632# When compiling for Windows Phone 8.1, some extra linker options
633# are also required.
634#
635!IF $(USE_WP81_OPTS)!=0
636!IFDEF WP81LIBPATH
637LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(WP81LIBPATH)"
638!ENDIF
639LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE
640LTLINKOPTS = $(LTLINKOPTS) WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelHost.lib
641LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:kernel32.lib /NODEFAULTLIB:ole32.lib
642!ENDIF
643
644# If either debugging or symbols are enabled, enable PDBs.
645#
646!IF $(DEBUG)>1 || $(SYMBOLS)!=0
647LDFLAGS = /DEBUG
648!ENDIF
649
650# Start with the Tcl related linker options.
651#
652!IF $(NO_TCL)==0
653LTLIBPATHS = /LIBPATH:$(TCLLIBDIR)
654LTLIBS = $(LIBTCL)
655!ENDIF
656
657# If ICU support is enabled, add the linker options for it.
658#
659!IF $(USE_ICU)!=0
660LTLIBPATHS = $(LTLIBPATHS) /LIBPATH:$(ICULIBDIR)
661LTLIBS = $(LTLIBS) $(LIBICU)
662!ENDIF
663
664# nawk compatible awk.
665#
666!IFNDEF NAWK
667NAWK = gawk.exe
668!ENDIF
669
670# You should not have to change anything below this line
671###############################################################################
672
673# Object files for the SQLite library (non-amalgamation).
674#
675LIBOBJS0 = vdbe.lo parse.lo alter.lo analyze.lo attach.lo auth.lo \
676         backup.lo bitvec.lo btmutex.lo btree.lo build.lo \
677         callback.lo complete.lo ctime.lo date.lo delete.lo \
678         expr.lo fault.lo fkey.lo \
679         fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo \
680         fts3_porter.lo fts3_snippet.lo fts3_tokenizer.lo fts3_tokenizer1.lo \
681         fts3_tokenize_vtab.lo fts3_unicode.lo fts3_unicode2.lo fts3_write.lo \
682         func.lo global.lo hash.lo \
683         icu.lo insert.lo journal.lo legacy.lo loadext.lo \
684         main.lo malloc.lo mem0.lo mem1.lo mem2.lo mem3.lo mem5.lo \
685         memjournal.lo \
686         mutex.lo mutex_noop.lo mutex_unix.lo mutex_w32.lo \
687         notify.lo opcodes.lo os.lo os_unix.lo os_win.lo \
688         pager.lo pcache.lo pcache1.lo pragma.lo prepare.lo printf.lo \
689         random.lo resolve.lo rowset.lo rtree.lo select.lo status.lo \
690         table.lo threads.lo tokenize.lo trigger.lo \
691         update.lo util.lo vacuum.lo \
692         vdbeapi.lo vdbeaux.lo vdbeblob.lo vdbemem.lo vdbesort.lo \
693         vdbetrace.lo wal.lo walker.lo where.lo utf.lo vtab.lo
694
695# Object files for the amalgamation.
696#
697LIBOBJS1 = sqlite3.lo
698
699# Determine the real value of LIBOBJ based on the 'configure' script
700#
701!IF $(USE_AMALGAMATION)==0
702LIBOBJ = $(LIBOBJS0)
703!ELSE
704LIBOBJ = $(LIBOBJS1)
705!ENDIF
706
707# Determine if embedded resource compilation and usage are enabled.
708#
709!IF $(USE_RC)!=0
710LIBRESOBJS = sqlite3res.lo
711!ELSE
712LIBRESOBJS =
713!ENDIF
714
715# All of the source code files.
716#
717SRC1 = \
718  $(TOP)\src\alter.c \
719  $(TOP)\src\analyze.c \
720  $(TOP)\src\attach.c \
721  $(TOP)\src\auth.c \
722  $(TOP)\src\backup.c \
723  $(TOP)\src\bitvec.c \
724  $(TOP)\src\btmutex.c \
725  $(TOP)\src\btree.c \
726  $(TOP)\src\btree.h \
727  $(TOP)\src\btreeInt.h \
728  $(TOP)\src\build.c \
729  $(TOP)\src\callback.c \
730  $(TOP)\src\complete.c \
731  $(TOP)\src\ctime.c \
732  $(TOP)\src\date.c \
733  $(TOP)\src\delete.c \
734  $(TOP)\src\expr.c \
735  $(TOP)\src\fault.c \
736  $(TOP)\src\fkey.c \
737  $(TOP)\src\func.c \
738  $(TOP)\src\global.c \
739  $(TOP)\src\hash.c \
740  $(TOP)\src\hash.h \
741  $(TOP)\src\hwtime.h \
742  $(TOP)\src\insert.c \
743  $(TOP)\src\journal.c \
744  $(TOP)\src\legacy.c \
745  $(TOP)\src\loadext.c \
746  $(TOP)\src\main.c \
747  $(TOP)\src\malloc.c \
748  $(TOP)\src\mem0.c \
749  $(TOP)\src\mem1.c \
750  $(TOP)\src\mem2.c \
751  $(TOP)\src\mem3.c \
752  $(TOP)\src\mem5.c \
753  $(TOP)\src\memjournal.c \
754  $(TOP)\src\msvc.h \
755  $(TOP)\src\mutex.c \
756  $(TOP)\src\mutex.h \
757  $(TOP)\src\mutex_noop.c \
758  $(TOP)\src\mutex_unix.c \
759  $(TOP)\src\mutex_w32.c \
760  $(TOP)\src\notify.c \
761  $(TOP)\src\os.c \
762  $(TOP)\src\os.h \
763  $(TOP)\src\os_common.h \
764  $(TOP)\src\os_setup.h \
765  $(TOP)\src\os_unix.c \
766  $(TOP)\src\os_win.c \
767  $(TOP)\src\os_win.h
768SRC2 = \
769  $(TOP)\src\pager.c \
770  $(TOP)\src\pager.h \
771  $(TOP)\src\parse.y \
772  $(TOP)\src\pcache.c \
773  $(TOP)\src\pcache.h \
774  $(TOP)\src\pcache1.c \
775  $(TOP)\src\pragma.c \
776  $(TOP)\src\pragma.h \
777  $(TOP)\src\prepare.c \
778  $(TOP)\src\printf.c \
779  $(TOP)\src\random.c \
780  $(TOP)\src\resolve.c \
781  $(TOP)\src\rowset.c \
782  $(TOP)\src\select.c \
783  $(TOP)\src\status.c \
784  $(TOP)\src\shell.c \
785  $(TOP)\src\sqlite.h.in \
786  $(TOP)\src\sqlite3ext.h \
787  $(TOP)\src\sqliteInt.h \
788  $(TOP)\src\sqliteLimit.h \
789  $(TOP)\src\table.c \
790  $(TOP)\src\threads.c \
791  $(TOP)\src\tclsqlite.c \
792  $(TOP)\src\tokenize.c \
793  $(TOP)\src\trigger.c \
794  $(TOP)\src\utf.c \
795  $(TOP)\src\update.c \
796  $(TOP)\src\util.c \
797  $(TOP)\src\vacuum.c \
798  $(TOP)\src\vdbe.c \
799  $(TOP)\src\vdbe.h \
800  $(TOP)\src\vdbeapi.c \
801  $(TOP)\src\vdbeaux.c \
802  $(TOP)\src\vdbeblob.c \
803  $(TOP)\src\vdbemem.c \
804  $(TOP)\src\vdbesort.c \
805  $(TOP)\src\vdbetrace.c \
806  $(TOP)\src\vdbeInt.h \
807  $(TOP)\src\vtab.c \
808  $(TOP)\src\vxworks.h \
809  $(TOP)\src\wal.c \
810  $(TOP)\src\wal.h \
811  $(TOP)\src\walker.c \
812  $(TOP)\src\where.c \
813  $(TOP)\src\whereInt.h
814
815# Source code for extensions
816#
817SRC3 = \
818  $(TOP)\ext\fts1\fts1.c \
819  $(TOP)\ext\fts1\fts1.h \
820  $(TOP)\ext\fts1\fts1_hash.c \
821  $(TOP)\ext\fts1\fts1_hash.h \
822  $(TOP)\ext\fts1\fts1_porter.c \
823  $(TOP)\ext\fts1\fts1_tokenizer.h \
824  $(TOP)\ext\fts1\fts1_tokenizer1.c \
825  $(TOP)\ext\fts2\fts2.c \
826  $(TOP)\ext\fts2\fts2.h \
827  $(TOP)\ext\fts2\fts2_hash.c \
828  $(TOP)\ext\fts2\fts2_hash.h \
829  $(TOP)\ext\fts2\fts2_icu.c \
830  $(TOP)\ext\fts2\fts2_porter.c \
831  $(TOP)\ext\fts2\fts2_tokenizer.h \
832  $(TOP)\ext\fts2\fts2_tokenizer.c \
833  $(TOP)\ext\fts2\fts2_tokenizer1.c
834SRC4 = \
835  $(TOP)\ext\fts3\fts3.c \
836  $(TOP)\ext\fts3\fts3.h \
837  $(TOP)\ext\fts3\fts3Int.h \
838  $(TOP)\ext\fts3\fts3_aux.c \
839  $(TOP)\ext\fts3\fts3_expr.c \
840  $(TOP)\ext\fts3\fts3_hash.c \
841  $(TOP)\ext\fts3\fts3_hash.h \
842  $(TOP)\ext\fts3\fts3_icu.c \
843  $(TOP)\ext\fts3\fts3_porter.c \
844  $(TOP)\ext\fts3\fts3_snippet.c \
845  $(TOP)\ext\fts3\fts3_tokenizer.h \
846  $(TOP)\ext\fts3\fts3_tokenizer.c \
847  $(TOP)\ext\fts3\fts3_tokenizer1.c \
848  $(TOP)\ext\fts3\fts3_tokenize_vtab.c \
849  $(TOP)\ext\fts3\fts3_unicode.c \
850  $(TOP)\ext\fts3\fts3_unicode2.c \
851  $(TOP)\ext\fts3\fts3_write.c \
852  $(TOP)\ext\icu\sqliteicu.h \
853  $(TOP)\ext\icu\icu.c \
854  $(TOP)\ext\rtree\rtree.h \
855  $(TOP)\ext\rtree\rtree.c
856
857
858# Generated source code files
859#
860SRC5 = \
861  keywordhash.h \
862  opcodes.c \
863  opcodes.h \
864  parse.c \
865  parse.h \
866  sqlite3.h
867
868# All source code files.
869#
870SRC = $(SRC1) $(SRC2) $(SRC3) $(SRC4) $(SRC5)
871
872# Source code to the test files.
873#
874TESTSRC = \
875  $(TOP)\src\test1.c \
876  $(TOP)\src\test2.c \
877  $(TOP)\src\test3.c \
878  $(TOP)\src\test4.c \
879  $(TOP)\src\test5.c \
880  $(TOP)\src\test6.c \
881  $(TOP)\src\test7.c \
882  $(TOP)\src\test8.c \
883  $(TOP)\src\test9.c \
884  $(TOP)\src\test_autoext.c \
885  $(TOP)\src\test_async.c \
886  $(TOP)\src\test_backup.c \
887  $(TOP)\src\test_blob.c \
888  $(TOP)\src\test_btree.c \
889  $(TOP)\src\test_config.c \
890  $(TOP)\src\test_demovfs.c \
891  $(TOP)\src\test_devsym.c \
892  $(TOP)\src\test_fs.c \
893  $(TOP)\src\test_func.c \
894  $(TOP)\src\test_hexio.c \
895  $(TOP)\src\test_init.c \
896  $(TOP)\src\test_intarray.c \
897  $(TOP)\src\test_journal.c \
898  $(TOP)\src\test_malloc.c \
899  $(TOP)\src\test_multiplex.c \
900  $(TOP)\src\test_mutex.c \
901  $(TOP)\src\test_onefile.c \
902  $(TOP)\src\test_osinst.c \
903  $(TOP)\src\test_pcache.c \
904  $(TOP)\src\test_quota.c \
905  $(TOP)\src\test_rtree.c \
906  $(TOP)\src\test_schema.c \
907  $(TOP)\src\test_server.c \
908  $(TOP)\src\test_superlock.c \
909  $(TOP)\src\test_syscall.c \
910  $(TOP)\src\test_stat.c \
911  $(TOP)\src\test_tclvar.c \
912  $(TOP)\src\test_thread.c \
913  $(TOP)\src\test_vfs.c \
914  $(TOP)\src\test_wsd.c \
915  $(TOP)\ext\fts3\fts3_term.c \
916  $(TOP)\ext\fts3\fts3_test.c
917
918# Statically linked extensions
919#
920TESTEXT = \
921  $(TOP)\ext\misc\amatch.c \
922  $(TOP)\ext\misc\closure.c \
923  $(TOP)\ext\misc\eval.c \
924  $(TOP)\ext\misc\fileio.c \
925  $(TOP)\ext\misc\fuzzer.c \
926  $(TOP)\ext\misc\ieee754.c \
927  $(TOP)\ext\misc\nextchar.c \
928  $(TOP)\ext\misc\percentile.c \
929  $(TOP)\ext\misc\regexp.c \
930  $(TOP)\ext\misc\spellfix.c \
931  $(TOP)\ext\misc\totype.c \
932  $(TOP)\ext\misc\wholenumber.c
933
934
935# Source code to the library files needed by the test fixture
936#
937TESTSRC2 = \
938  $(TOP)\src\attach.c \
939  $(TOP)\src\backup.c \
940  $(TOP)\src\bitvec.c \
941  $(TOP)\src\btree.c \
942  $(TOP)\src\build.c \
943  $(TOP)\src\ctime.c \
944  $(TOP)\src\date.c \
945  $(TOP)\src\expr.c \
946  $(TOP)\src\func.c \
947  $(TOP)\src\insert.c \
948  $(TOP)\src\wal.c \
949  $(TOP)\src\main.c \
950  $(TOP)\src\mem5.c \
951  $(TOP)\src\os.c \
952  $(TOP)\src\os_unix.c \
953  $(TOP)\src\os_win.c \
954  $(TOP)\src\pager.c \
955  $(TOP)\src\pragma.c \
956  $(TOP)\src\prepare.c \
957  $(TOP)\src\printf.c \
958  $(TOP)\src\random.c \
959  $(TOP)\src\pcache.c \
960  $(TOP)\src\pcache1.c \
961  $(TOP)\src\select.c \
962  $(TOP)\src\tokenize.c \
963  $(TOP)\src\utf.c \
964  $(TOP)\src\util.c \
965  $(TOP)\src\vdbeapi.c \
966  $(TOP)\src\vdbeaux.c \
967  $(TOP)\src\vdbe.c \
968  $(TOP)\src\vdbemem.c \
969  $(TOP)\src\vdbesort.c \
970  $(TOP)\src\vdbetrace.c \
971  $(TOP)\src\where.c \
972  parse.c \
973  $(TOP)\ext\fts3\fts3.c \
974  $(TOP)\ext\fts3\fts3_aux.c \
975  $(TOP)\ext\fts3\fts3_expr.c \
976  $(TOP)\ext\fts3\fts3_tokenizer.c \
977  $(TOP)\ext\fts3\fts3_tokenize_vtab.c \
978  $(TOP)\ext\fts3\fts3_unicode.c \
979  $(TOP)\ext\fts3\fts3_unicode2.c \
980  $(TOP)\ext\fts3\fts3_write.c \
981  $(TOP)\ext\async\sqlite3async.c
982
983# Header files used by all library source files.
984#
985HDR = \
986   $(TOP)\src\btree.h \
987   $(TOP)\src\btreeInt.h \
988   $(TOP)\src\hash.h \
989   $(TOP)\src\hwtime.h \
990   keywordhash.h \
991   $(TOP)\src\msvc.h \
992   $(TOP)\src\mutex.h \
993   opcodes.h \
994   $(TOP)\src\os.h \
995   $(TOP)\src\os_common.h \
996   $(TOP)\src\os_setup.h \
997   $(TOP)\src\os_win.h \
998   $(TOP)\src\pager.h \
999   $(TOP)\src\pcache.h \
1000   parse.h \
1001   $(TOP)\src\pragma.h \
1002   sqlite3.h \
1003   $(TOP)\src\sqlite3ext.h \
1004   $(TOP)\src\sqliteInt.h \
1005   $(TOP)\src\sqliteLimit.h \
1006   $(TOP)\src\vdbe.h \
1007   $(TOP)\src\vdbeInt.h \
1008   $(TOP)\src\vxworks.h \
1009   $(TOP)\src\whereInt.h
1010
1011# Header files used by extensions
1012#
1013EXTHDR = $(EXTHDR) \
1014  $(TOP)\ext\fts1\fts1.h \
1015  $(TOP)\ext\fts1\fts1_hash.h \
1016  $(TOP)\ext\fts1\fts1_tokenizer.h
1017EXTHDR = $(EXTHDR) \
1018  $(TOP)\ext\fts2\fts2.h \
1019  $(TOP)\ext\fts2\fts2_hash.h \
1020  $(TOP)\ext\fts2\fts2_tokenizer.h
1021EXTHDR = $(EXTHDR) \
1022  $(TOP)\ext\fts3\fts3.h \
1023  $(TOP)\ext\fts3\fts3Int.h \
1024  $(TOP)\ext\fts3\fts3_hash.h \
1025  $(TOP)\ext\fts3\fts3_tokenizer.h
1026EXTHDR = $(EXTHDR) \
1027  $(TOP)\ext\rtree\rtree.h
1028EXTHDR = $(EXTHDR) \
1029  $(TOP)\ext\icu\sqliteicu.h
1030EXTHDR = $(EXTHDR) \
1031  $(TOP)\ext\rtree\sqlite3rtree.h
1032
1033# This is the default Makefile target.  The objects listed here
1034# are what get build when you type just "make" with no arguments.
1035#
1036all:	dll libsqlite3.lib sqlite3.exe libtclsqlite3.lib
1037
1038libsqlite3.lib:	$(LIBOBJ)
1039	$(LTLIB) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS)
1040
1041libtclsqlite3.lib:	tclsqlite.lo libsqlite3.lib
1042	$(LTLIB) $(LTLIBOPTS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCL:tcl=tclstub) $(TLIBS)
1043
1044sqlite3.exe:	$(TOP)\src\shell.c libsqlite3.lib $(LIBRESOBJS) sqlite3.h
1045	$(LTLINK) $(READLINE_FLAGS) $(TOP)\src\shell.c \
1046		/link $(LTLINKOPTS) $(LTLIBPATHS) libsqlite3.lib $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS)
1047
1048mptester.exe:	$(TOP)\mptest\mptest.c libsqlite3.lib $(LIBRESOBJS) sqlite3.h
1049	$(LTLINK) $(TOP)\mptest\mptest.c \
1050		/link $(LTLINKOPTS) $(LTLIBPATHS) libsqlite3.lib $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS)
1051
1052# This target creates a directory named "tsrc" and fills it with
1053# copies of all of the C source code and header files needed to
1054# build on the target system.  Some of the C source code and header
1055# files are automatically generated.  This target takes care of
1056# all that automatic generation.
1057#
1058.target_source:	$(SRC) $(TOP)\tool\vdbe-compress.tcl
1059	-rmdir /S/Q tsrc
1060	-mkdir tsrc
1061	for %i in ($(SRC1)) do copy /Y %i tsrc
1062	for %i in ($(SRC2)) do copy /Y %i tsrc
1063	for %i in ($(SRC3)) do copy /Y %i tsrc
1064	for %i in ($(SRC4)) do copy /Y %i tsrc
1065	for %i in ($(SRC5)) do copy /Y %i tsrc
1066	del /Q tsrc\sqlite.h.in tsrc\parse.y
1067	$(TCLSH_CMD) $(TOP)\tool\vdbe-compress.tcl $(OPTS) < tsrc\vdbe.c > vdbe.new
1068	move vdbe.new tsrc\vdbe.c
1069	echo > .target_source
1070
1071sqlite3.c:	.target_source $(TOP)\tool\mksqlite3c.tcl
1072	$(TCLSH_CMD) $(TOP)\tool\mksqlite3c.tcl $(MKSQLITE3C_ARGS)
1073	copy tsrc\shell.c .
1074	copy tsrc\sqlite3ext.h .
1075
1076sqlite3-all.c:	sqlite3.c $(TOP)\tool\split-sqlite3c.tcl
1077	$(TCLSH_CMD) $(TOP)\tool\split-sqlite3c.tcl
1078
1079# Set the source code file to be used by executables and libraries when
1080# they need the amalgamation.
1081#
1082!IF $(SPLIT_AMALGAMATION)!=0
1083SQLITE3C = sqlite3-all.c
1084!ELSE
1085SQLITE3C = sqlite3.c
1086!ENDIF
1087
1088# Rule to build the amalgamation
1089#
1090sqlite3.lo:	$(SQLITE3C)
1091	$(LTCOMPILE) -c $(SQLITE3C)
1092
1093# Rules to build the LEMON compiler generator
1094#
1095lempar.c:	$(TOP)\src\lempar.c
1096	copy $(TOP)\src\lempar.c .
1097
1098lemon.exe:	$(TOP)\tool\lemon.c lempar.c
1099	$(BCC) $(NO_WARN) -Daccess=_access \
1100		-Fe$@ $(TOP)\tool\lemon.c /link $(NLTLINKOPTS) $(NLTLIBPATHS)
1101
1102# Rules to build individual *.lo files from generated *.c files. This
1103# applies to:
1104#
1105#     parse.lo
1106#     opcodes.lo
1107#
1108parse.lo:	parse.c $(HDR)
1109	$(LTCOMPILE) -c parse.c
1110
1111opcodes.lo:	opcodes.c
1112	$(LTCOMPILE) -c opcodes.c
1113
1114# Rule to build the Win32 resources object file.
1115#
1116!IF $(USE_RC)!=0
1117$(LIBRESOBJS):	$(TOP)\src\sqlite3.rc $(HDR)
1118	echo #ifndef SQLITE_RESOURCE_VERSION > sqlite3rc.h
1119	for /F %%V in ('type "$(TOP)\VERSION"') do ( \
1120		echo #define SQLITE_RESOURCE_VERSION %%V \
1121			| $(NAWK) "/.*/ { gsub(/[.]/,\",\");print }" >> sqlite3rc.h \
1122	)
1123	echo #endif >> sqlite3rc.h
1124	$(LTRCOMPILE) -fo $(LIBRESOBJS) $(TOP)\src\sqlite3.rc
1125!ENDIF
1126
1127# Rules to build individual *.lo files from files in the src directory.
1128#
1129alter.lo:	$(TOP)\src\alter.c $(HDR)
1130	$(LTCOMPILE) -c $(TOP)\src\alter.c
1131
1132analyze.lo:	$(TOP)\src\analyze.c $(HDR)
1133	$(LTCOMPILE) -c $(TOP)\src\analyze.c
1134
1135attach.lo:	$(TOP)\src\attach.c $(HDR)
1136	$(LTCOMPILE) -c $(TOP)\src\attach.c
1137
1138auth.lo:	$(TOP)\src\auth.c $(HDR)
1139	$(LTCOMPILE) -c $(TOP)\src\auth.c
1140
1141backup.lo:	$(TOP)\src\backup.c $(HDR)
1142	$(LTCOMPILE) -c $(TOP)\src\backup.c
1143
1144bitvec.lo:	$(TOP)\src\bitvec.c $(HDR)
1145	$(LTCOMPILE) -c $(TOP)\src\bitvec.c
1146
1147btmutex.lo:	$(TOP)\src\btmutex.c $(HDR)
1148	$(LTCOMPILE) -c $(TOP)\src\btmutex.c
1149
1150btree.lo:	$(TOP)\src\btree.c $(HDR) $(TOP)\src\pager.h
1151	$(LTCOMPILE) -c $(TOP)\src\btree.c
1152
1153build.lo:	$(TOP)\src\build.c $(HDR)
1154	$(LTCOMPILE) -c $(TOP)\src\build.c
1155
1156callback.lo:	$(TOP)\src\callback.c $(HDR)
1157	$(LTCOMPILE) -c $(TOP)\src\callback.c
1158
1159complete.lo:	$(TOP)\src\complete.c $(HDR)
1160	$(LTCOMPILE) -c $(TOP)\src\complete.c
1161
1162ctime.lo:	$(TOP)\src\ctime.c $(HDR)
1163	$(LTCOMPILE) -c $(TOP)\src\ctime.c
1164
1165date.lo:	$(TOP)\src\date.c $(HDR)
1166	$(LTCOMPILE) -c $(TOP)\src\date.c
1167
1168delete.lo:	$(TOP)\src\delete.c $(HDR)
1169	$(LTCOMPILE) -c $(TOP)\src\delete.c
1170
1171expr.lo:	$(TOP)\src\expr.c $(HDR)
1172	$(LTCOMPILE) -c $(TOP)\src\expr.c
1173
1174fault.lo:	$(TOP)\src\fault.c $(HDR)
1175	$(LTCOMPILE) -c $(TOP)\src\fault.c
1176
1177fkey.lo:	$(TOP)\src\fkey.c $(HDR)
1178	$(LTCOMPILE) -c $(TOP)\src\fkey.c
1179
1180func.lo:	$(TOP)\src\func.c $(HDR)
1181	$(LTCOMPILE) -c $(TOP)\src\func.c
1182
1183global.lo:	$(TOP)\src\global.c $(HDR)
1184	$(LTCOMPILE) -c $(TOP)\src\global.c
1185
1186hash.lo:	$(TOP)\src\hash.c $(HDR)
1187	$(LTCOMPILE) -c $(TOP)\src\hash.c
1188
1189insert.lo:	$(TOP)\src\insert.c $(HDR)
1190	$(LTCOMPILE) -c $(TOP)\src\insert.c
1191
1192journal.lo:	$(TOP)\src\journal.c $(HDR)
1193	$(LTCOMPILE) -c $(TOP)\src\journal.c
1194
1195legacy.lo:	$(TOP)\src\legacy.c $(HDR)
1196	$(LTCOMPILE) -c $(TOP)\src\legacy.c
1197
1198loadext.lo:	$(TOP)\src\loadext.c $(HDR)
1199	$(LTCOMPILE) -c $(TOP)\src\loadext.c
1200
1201main.lo:	$(TOP)\src\main.c $(HDR)
1202	$(LTCOMPILE) -c $(TOP)\src\main.c
1203
1204malloc.lo:	$(TOP)\src\malloc.c $(HDR)
1205	$(LTCOMPILE) -c $(TOP)\src\malloc.c
1206
1207mem0.lo:	$(TOP)\src\mem0.c $(HDR)
1208	$(LTCOMPILE) -c $(TOP)\src\mem0.c
1209
1210mem1.lo:	$(TOP)\src\mem1.c $(HDR)
1211	$(LTCOMPILE) -c $(TOP)\src\mem1.c
1212
1213mem2.lo:	$(TOP)\src\mem2.c $(HDR)
1214	$(LTCOMPILE) -c $(TOP)\src\mem2.c
1215
1216mem3.lo:	$(TOP)\src\mem3.c $(HDR)
1217	$(LTCOMPILE) -c $(TOP)\src\mem3.c
1218
1219mem5.lo:	$(TOP)\src\mem5.c $(HDR)
1220	$(LTCOMPILE) -c $(TOP)\src\mem5.c
1221
1222memjournal.lo:	$(TOP)\src\memjournal.c $(HDR)
1223	$(LTCOMPILE) -c $(TOP)\src\memjournal.c
1224
1225mutex.lo:	$(TOP)\src\mutex.c $(HDR)
1226	$(LTCOMPILE) -c $(TOP)\src\mutex.c
1227
1228mutex_noop.lo:	$(TOP)\src\mutex_noop.c $(HDR)
1229	$(LTCOMPILE) -c $(TOP)\src\mutex_noop.c
1230
1231mutex_unix.lo:	$(TOP)\src\mutex_unix.c $(HDR)
1232	$(LTCOMPILE) -c $(TOP)\src\mutex_unix.c
1233
1234mutex_w32.lo:	$(TOP)\src\mutex_w32.c $(HDR)
1235	$(LTCOMPILE) -c $(TOP)\src\mutex_w32.c
1236
1237notify.lo:	$(TOP)\src\notify.c $(HDR)
1238	$(LTCOMPILE) -c $(TOP)\src\notify.c
1239
1240pager.lo:	$(TOP)\src\pager.c $(HDR) $(TOP)\src\pager.h
1241	$(LTCOMPILE) -c $(TOP)\src\pager.c
1242
1243pcache.lo:	$(TOP)\src\pcache.c $(HDR) $(TOP)\src\pcache.h
1244	$(LTCOMPILE) -c $(TOP)\src\pcache.c
1245
1246pcache1.lo:	$(TOP)\src\pcache1.c $(HDR) $(TOP)\src\pcache.h
1247	$(LTCOMPILE) -c $(TOP)\src\pcache1.c
1248
1249os.lo:	$(TOP)\src\os.c $(HDR)
1250	$(LTCOMPILE) -c $(TOP)\src\os.c
1251
1252os_unix.lo:	$(TOP)\src\os_unix.c $(HDR)
1253	$(LTCOMPILE) -c $(TOP)\src\os_unix.c
1254
1255os_win.lo:	$(TOP)\src\os_win.c $(HDR)
1256	$(LTCOMPILE) -c $(TOP)\src\os_win.c
1257
1258pragma.lo:	$(TOP)\src\pragma.c $(HDR)
1259	$(LTCOMPILE) -c $(TOP)\src\pragma.c
1260
1261prepare.lo:	$(TOP)\src\prepare.c $(HDR)
1262	$(LTCOMPILE) -c $(TOP)\src\prepare.c
1263
1264printf.lo:	$(TOP)\src\printf.c $(HDR)
1265	$(LTCOMPILE) -c $(TOP)\src\printf.c
1266
1267random.lo:	$(TOP)\src\random.c $(HDR)
1268	$(LTCOMPILE) -c $(TOP)\src\random.c
1269
1270resolve.lo:	$(TOP)\src\resolve.c $(HDR)
1271	$(LTCOMPILE) -c $(TOP)\src\resolve.c
1272
1273rowset.lo:	$(TOP)\src\rowset.c $(HDR)
1274	$(LTCOMPILE) -c $(TOP)\src\rowset.c
1275
1276select.lo:	$(TOP)\src\select.c $(HDR)
1277	$(LTCOMPILE) -c $(TOP)\src\select.c
1278
1279status.lo:	$(TOP)\src\status.c $(HDR)
1280	$(LTCOMPILE) -c $(TOP)\src\status.c
1281
1282table.lo:	$(TOP)\src\table.c $(HDR)
1283	$(LTCOMPILE) -c $(TOP)\src\table.c
1284
1285threads.lo:	$(TOP)\src\threads.c $(HDR)
1286	$(LTCOMPILE) -c $(TOP)\src\threads.c
1287
1288tokenize.lo:	$(TOP)\src\tokenize.c keywordhash.h $(HDR)
1289	$(LTCOMPILE) -c $(TOP)\src\tokenize.c
1290
1291trigger.lo:	$(TOP)\src\trigger.c $(HDR)
1292	$(LTCOMPILE) -c $(TOP)\src\trigger.c
1293
1294update.lo:	$(TOP)\src\update.c $(HDR)
1295	$(LTCOMPILE) -c $(TOP)\src\update.c
1296
1297utf.lo:	$(TOP)\src\utf.c $(HDR)
1298	$(LTCOMPILE) -c $(TOP)\src\utf.c
1299
1300util.lo:	$(TOP)\src\util.c $(HDR)
1301	$(LTCOMPILE) -c $(TOP)\src\util.c
1302
1303vacuum.lo:	$(TOP)\src\vacuum.c $(HDR)
1304	$(LTCOMPILE) -c $(TOP)\src\vacuum.c
1305
1306vdbe.lo:	$(TOP)\src\vdbe.c $(HDR)
1307	$(LTCOMPILE) -c $(TOP)\src\vdbe.c
1308
1309vdbeapi.lo:	$(TOP)\src\vdbeapi.c $(HDR)
1310	$(LTCOMPILE) -c $(TOP)\src\vdbeapi.c
1311
1312vdbeaux.lo:	$(TOP)\src\vdbeaux.c $(HDR)
1313	$(LTCOMPILE) -c $(TOP)\src\vdbeaux.c
1314
1315vdbeblob.lo:	$(TOP)\src\vdbeblob.c $(HDR)
1316	$(LTCOMPILE) -c $(TOP)\src\vdbeblob.c
1317
1318vdbemem.lo:	$(TOP)\src\vdbemem.c $(HDR)
1319	$(LTCOMPILE) -c $(TOP)\src\vdbemem.c
1320
1321vdbesort.lo:	$(TOP)\src\vdbesort.c $(HDR)
1322	$(LTCOMPILE) -c $(TOP)\src\vdbesort.c
1323
1324vdbetrace.lo:	$(TOP)\src\vdbetrace.c $(HDR)
1325	$(LTCOMPILE) -c $(TOP)\src\vdbetrace.c
1326
1327vtab.lo:	$(TOP)\src\vtab.c $(HDR)
1328	$(LTCOMPILE) -c $(TOP)\src\vtab.c
1329
1330wal.lo:	$(TOP)\src\wal.c $(HDR)
1331	$(LTCOMPILE) -c $(TOP)\src\wal.c
1332
1333walker.lo:	$(TOP)\src\walker.c $(HDR)
1334	$(LTCOMPILE) -c $(TOP)\src\walker.c
1335
1336where.lo:	$(TOP)\src\where.c $(HDR)
1337	$(LTCOMPILE) -c $(TOP)\src\where.c
1338
1339tclsqlite.lo:	$(TOP)\src\tclsqlite.c $(HDR)
1340	$(LTCOMPILE) -DUSE_TCL_STUBS=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c
1341
1342tclsqlite-shell.lo:	$(TOP)\src\tclsqlite.c $(HDR)
1343	$(LTCOMPILE) -DTCLSH=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c
1344
1345tclsqlite3.exe:	tclsqlite-shell.lo libsqlite3.lib $(LIBRESOBJS)
1346	$(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /OUT:$@ libsqlite3.lib tclsqlite-shell.lo $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
1347
1348# Rules to build opcodes.c and opcodes.h
1349#
1350opcodes.c:	opcodes.h $(TOP)\mkopcodec.awk
1351	$(NAWK) -f $(TOP)\mkopcodec.awk opcodes.h > opcodes.c
1352
1353opcodes.h:	parse.h $(TOP)\src\vdbe.c $(TOP)\mkopcodeh.awk
1354	type parse.h $(TOP)\src\vdbe.c | $(NAWK) -f $(TOP)\mkopcodeh.awk > opcodes.h
1355
1356# Rules to build parse.c and parse.h - the outputs of lemon.
1357#
1358parse.h:	parse.c
1359
1360parse.c:	$(TOP)\src\parse.y lemon.exe $(TOP)\addopcodes.awk
1361	del /Q parse.y parse.h parse.h.temp
1362	copy $(TOP)\src\parse.y .
1363	.\lemon.exe $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(OPTS) parse.y
1364	move parse.h parse.h.temp
1365	$(NAWK) -f $(TOP)\addopcodes.awk parse.h.temp > parse.h
1366
1367sqlite3.h:	$(TOP)\src\sqlite.h.in $(TOP)\manifest.uuid $(TOP)\VERSION
1368	$(TCLSH_CMD) $(TOP)\tool\mksqlite3h.tcl $(TOP:\=/) > sqlite3.h
1369
1370mkkeywordhash.exe:	$(TOP)\tool\mkkeywordhash.c
1371	$(BCC) $(NO_WARN) -Fe$@ $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(OPTS) \
1372		$(TOP)\tool\mkkeywordhash.c /link $(NLTLINKOPTS) $(NLTLIBPATHS)
1373
1374keywordhash.h:	$(TOP)\tool\mkkeywordhash.c mkkeywordhash.exe
1375	.\mkkeywordhash.exe > keywordhash.h
1376
1377
1378
1379# Rules to build the extension objects.
1380#
1381icu.lo:	$(TOP)\ext\icu\icu.c $(HDR) $(EXTHDR)
1382	$(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\icu\icu.c
1383
1384fts2.lo:	$(TOP)\ext\fts2\fts2.c $(HDR) $(EXTHDR)
1385	$(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2.c
1386
1387fts2_hash.lo:	$(TOP)\ext\fts2\fts2_hash.c $(HDR) $(EXTHDR)
1388	$(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_hash.c
1389
1390fts2_icu.lo:	$(TOP)\ext\fts2\fts2_icu.c $(HDR) $(EXTHDR)
1391	$(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_icu.c
1392
1393fts2_porter.lo:	$(TOP)\ext\fts2\fts2_porter.c $(HDR) $(EXTHDR)
1394	$(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_porter.c
1395
1396fts2_tokenizer.lo:	$(TOP)\ext\fts2\fts2_tokenizer.c $(HDR) $(EXTHDR)
1397	$(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_tokenizer.c
1398
1399fts2_tokenizer1.lo:	$(TOP)\ext\fts2\fts2_tokenizer1.c $(HDR) $(EXTHDR)
1400	$(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_tokenizer1.c
1401
1402fts3.lo:	$(TOP)\ext\fts3\fts3.c $(HDR) $(EXTHDR)
1403	$(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3.c
1404
1405fts3_aux.lo:	$(TOP)\ext\fts3\fts3_aux.c $(HDR) $(EXTHDR)
1406	$(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_aux.c
1407
1408fts3_expr.lo:	$(TOP)\ext\fts3\fts3_expr.c $(HDR) $(EXTHDR)
1409	$(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_expr.c
1410
1411fts3_hash.lo:	$(TOP)\ext\fts3\fts3_hash.c $(HDR) $(EXTHDR)
1412	$(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_hash.c
1413
1414fts3_icu.lo:	$(TOP)\ext\fts3\fts3_icu.c $(HDR) $(EXTHDR)
1415	$(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_icu.c
1416
1417fts3_snippet.lo:	$(TOP)\ext\fts3\fts3_snippet.c $(HDR) $(EXTHDR)
1418	$(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_snippet.c
1419
1420fts3_porter.lo:	$(TOP)\ext\fts3\fts3_porter.c $(HDR) $(EXTHDR)
1421	$(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_porter.c
1422
1423fts3_tokenizer.lo:	$(TOP)\ext\fts3\fts3_tokenizer.c $(HDR) $(EXTHDR)
1424	$(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenizer.c
1425
1426fts3_tokenizer1.lo:	$(TOP)\ext\fts3\fts3_tokenizer1.c $(HDR) $(EXTHDR)
1427	$(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenizer1.c
1428
1429fts3_tokenize_vtab.lo:	$(TOP)\ext\fts3\fts3_tokenize_vtab.c $(HDR) $(EXTHDR)
1430	$(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenize_vtab.c
1431
1432fts3_unicode.lo:	$(TOP)\ext\fts3\fts3_unicode.c $(HDR) $(EXTHDR)
1433	$(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_unicode.c
1434
1435fts3_unicode2.lo:	$(TOP)\ext\fts3\fts3_unicode2.c $(HDR) $(EXTHDR)
1436	$(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_unicode2.c
1437
1438fts3_write.lo:	$(TOP)\ext\fts3\fts3_write.c $(HDR) $(EXTHDR)
1439	$(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_write.c
1440
1441rtree.lo:	$(TOP)\ext\rtree\rtree.c $(HDR) $(EXTHDR)
1442	$(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\rtree\rtree.c
1443
1444
1445# Rules to build the 'testfixture' application.
1446#
1447# If using the amalgamation, use sqlite3.c directly to build the test
1448# fixture.  Otherwise link against libsqlite3.lib.  (This distinction is
1449# necessary because the test fixture requires non-API symbols which are
1450# hidden when the library is built via the amalgamation).
1451#
1452TESTFIXTURE_FLAGS = -DTCLSH=1 -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
1453TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_SERVER=1 -DSQLITE_PRIVATE=""
1454TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_CORE $(NO_WARN)
1455
1456TESTFIXTURE_SRC0 = $(TESTEXT) $(TESTSRC2) libsqlite3.lib
1457TESTFIXTURE_SRC1 = $(TESTEXT) $(SQLITE3C)
1458!IF $(USE_AMALGAMATION)==0
1459TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC0)
1460!ELSE
1461TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC1)
1462!ENDIF
1463
1464testfixture.exe:	$(TESTFIXTURE_SRC) $(LIBRESOBJS) $(HDR)
1465	$(LTLINK) -DSQLITE_NO_SYNC=1 $(TESTFIXTURE_FLAGS) \
1466		-DBUILD_sqlite -I$(TCLINCDIR) \
1467		$(TESTFIXTURE_SRC) \
1468		/link $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
1469
1470extensiontest: testfixture.exe testloadext.dll
1471	.\testfixture.exe $(TOP)\test\loadext.test
1472
1473fulltest:	testfixture.exe sqlite3.exe
1474	.\testfixture.exe $(TOP)\test\all.test
1475
1476soaktest:	testfixture.exe sqlite3.exe
1477	.\testfixture.exe $(TOP)\test\all.test -soak=1
1478
1479fulltestonly:	testfixture.exe sqlite3.exe
1480	.\testfixture.exe $(TOP)\test\full.test
1481
1482queryplantest:	testfixture.exe sqlite3.exe
1483	.\testfixture.exe $(TOP)\test\permutations.test queryplanner
1484
1485test:	testfixture.exe sqlite3.exe
1486	.\testfixture.exe $(TOP)\test\veryquick.test
1487
1488sqlite3_analyzer.c: $(SQLITE3C) $(TOP)\src\test_stat.c $(TOP)\src\tclsqlite.c $(TOP)\tool\spaceanal.tcl
1489	copy $(SQLITE3C) + $(TOP)\src\test_stat.c + $(TOP)\src\tclsqlite.c $@
1490	echo static const char *tclsh_main_loop(void){ >> $@
1491	echo static const char *zMainloop = >> $@
1492	$(NAWK) -f $(TOP)\tool\tostr.awk $(TOP)\tool\spaceanal.tcl >> $@
1493	echo ; return zMainloop; } >> $@
1494
1495sqlite3_analyzer.exe:	sqlite3_analyzer.c $(LIBRESOBJS)
1496	$(LTLINK) -DBUILD_sqlite -DTCLSH=2 -I$(TCLINCDIR) sqlite3_analyzer.c \
1497		/link $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
1498
1499testloadext.lo:	$(TOP)\src\test_loadext.c
1500	$(LTCOMPILE) -c $(TOP)\src\test_loadext.c
1501
1502testloadext.dll: testloadext.lo
1503	$(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /OUT:$@ testloadext.lo
1504
1505showdb.exe:	$(TOP)\tool\showdb.c $(SQLITE3C)
1506	$(LTLINK) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
1507		$(TOP)\tool\showdb.c $(SQLITE3C)
1508
1509showstat4.exe:	$(TOP)\tool\showstat4.c $(SQLITE3C)
1510	$(LTLINK) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
1511		$(TOP)\tool\showstat4.c $(SQLITE3C)
1512
1513showjournal.exe:	$(TOP)\tool\showjournal.c $(SQLITE3C)
1514	$(LTLINK) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
1515		$(TOP)\tool\showjournal.c $(SQLITE3C)
1516
1517showwal.exe:	$(TOP)\tool\showwal.c $(SQLITE3C)
1518	$(LTLINK) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
1519		$(TOP)\tool\showwal.c $(SQLITE3C)
1520
1521fts3view.exe:	$(TOP)\ext\fts3\tool\fts3view.c $(SQLITE3C)
1522	$(LTLINK) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
1523		$(TOP)\ext\fts3\tool\fts3view.c $(SQLITE3C)
1524
1525rollback-test.exe:	$(TOP)\tool\rollback-test.c $(SQLITE3C)
1526	$(LTLINK) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
1527		$(TOP)\tool\rollback-test.c $(SQLITE3C)
1528
1529LogEst.exe:	$(TOP)\tool\logest.c sqlite3.h
1530	$(LTLINK) -Fe$@ $(TOP)\tool\LogEst.c
1531
1532wordcount.exe:	$(TOP)\test\wordcount.c $(SQLITE3C)
1533	$(LTLINK) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
1534		$(TOP)\test\wordcount.c $(SQLITE3C)
1535
1536speedtest1.exe:	$(TOP)\test\speedtest1.c $(SQLITE3C)
1537	$(LTLINK) -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
1538		$(TOP)\test\speedtest1.c $(SQLITE3C)
1539
1540clean:
1541	del /Q *.lo *.ilk *.lib *.obj *.pdb sqlite3.exe libsqlite3.lib 2>NUL
1542	del /Q *.cod *.da *.bb *.bbg gmon.out 2>NUL
1543	del /Q sqlite3.h opcodes.c opcodes.h 2>NUL
1544	del /Q lemon.* lempar.c parse.* 2>NUL
1545	del /Q mkkeywordhash.* keywordhash.h 2>NUL
1546	del /Q notasharedlib.* 2>NUL
1547	-rmdir /Q/S .deps 2>NUL
1548	-rmdir /Q/S .libs 2>NUL
1549	-rmdir /Q/S quota2a 2>NUL
1550	-rmdir /Q/S quota2b 2>NUL
1551	-rmdir /Q/S quota2c 2>NUL
1552	-rmdir /Q/S tsrc 2>NUL
1553	del /Q .target_source 2>NUL
1554	del /Q tclsqlite3.exe tclsqlite3.exp 2>NUL
1555	del /Q testloadext.dll testloadext.exp 2>NUL
1556	del /Q testfixture.exe testfixture.exp test.db 2>NUL
1557	del /Q LogEst.exe fts3view.exe rollback-test.exe showdb.exe 2>NUL
1558	del /Q showjournal.exe showstat4.exe showwal.exe speedtest1.exe 2>NUL
1559	del /Q wordcount.exe 2>NUL
1560	del /Q sqlite3.dll sqlite3.lib sqlite3.exp sqlite3.def 2>NUL
1561	del /Q sqlite3.c sqlite3-*.c 2>NUL
1562	del /Q sqlite3rc.h 2>NUL
1563	del /Q shell.c sqlite3ext.h 2>NUL
1564	del /Q sqlite3_analyzer.exe sqlite3_analyzer.exp sqlite3_analyzer.c 2>NUL
1565	del /Q sqlite-*-output.vsix 2>NUL
1566	del /Q mptester.exe 2>NUL
1567
1568# Dynamic link library section.
1569#
1570dll: sqlite3.dll
1571
1572sqlite3.def: libsqlite3.lib
1573	echo EXPORTS > sqlite3.def
1574	dumpbin /all libsqlite3.lib \
1575		| $(NAWK) "/ 1 _?sqlite3_/ { sub(/^.* _?/,\"\");print }" \
1576		| sort >> sqlite3.def
1577
1578sqlite3.dll: $(LIBOBJ) $(LIBRESOBJS) sqlite3.def
1579	$(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /DEF:sqlite3.def /OUT:$@ $(LIBOBJ) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
1580