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