2 # nmake Makefile for SQLite
5 # The toplevel directory of the source tree. This is the directory
6 # that contains this "Makefile.msc".
10 # Set this non-0 to create and use the SQLite amalgamation file.
14 # Set this non-0 to use the International Components for Unicode (ICU).
18 # Set this to non-0 to create and use PDBs.
22 # Set this to one of the following values to enable various debugging
23 # features. Each level includes the debugging options from the previous
24 # levels. Currently, the recognized values for DEBUG are:
26 # 0 == NDEBUG: Disables assert() and other runtime diagnostics.
27 # 1 == Disables NDEBUG and all optimizations and then enables PDBs.
28 # 2 == SQLITE_DEBUG: Enables various diagnostics messages and code.
29 # 3 == SQLITE_WIN32_MALLOC_VALIDATE: Validate the Win32 native heap per call.
30 # 4 == SQLITE_DEBUG_OS_TRACE: Enables output from the OSTRACE() macros.
31 # 5 == SQLITE_ENABLE_IOTRACE: Enables output from the IOTRACE() macros.
35 # Version numbers and release number for the SQLite being compiled.
38 VERSION_NUMBER = 3007009
41 # C Compiler and options for use in building executables that
42 # will run on the platform that is doing the build.
46 # C Compile and options for use in building executables that
47 # will run on the target platform. (BCC and TCC are usually the
48 # same unless your are cross-compiling.)
50 TCC = cl.exe -W3 -DSQLITE_OS_WIN=1 -I. -I$(TOP)\src -fp:precise
52 # The mksqlite3c.tcl and mksqlite3h.tcl scripts will pull in
53 # any extension header files by default. For non-amalgamation
54 # builds, we need to make sure the compiler can find these.
56 !IF $(USE_AMALGAMATION)==0
57 TCC = $(TCC) -I$(TOP)\ext\fts3
58 TCC = $(TCC) -I$(TOP)\ext\rtree
61 # Define -DNDEBUG to compile without debugging (i.e., for production usage)
62 # Omitting the define will cause extra debugging code to be inserted and
63 # includes extra comments when "EXPLAIN stmt" is used.
70 TCC = $(TCC) -DSQLITE_DEBUG
74 TCC = $(TCC) -DSQLITE_DEBUG_OS_TRACE=1
78 TCC = $(TCC) -DSQLITE_ENABLE_IOTRACE
82 # Prevent warnings about "insecure" runtime library functions being used.
84 TCC = $(TCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
87 # Use native Win32 heap instead of malloc/free?
89 # TCC = $(TCC) -DSQLITE_WIN32_MALLOC=1
92 # Validate the heap on every call into the native Win32 heap subsystem?
95 TCC = $(TCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1
98 # The locations of the Tcl header and library files. Also, the library that
99 # non-stubs enabled programs using Tcl must link against. These variables
100 # (TCLINCDIR, TCLLIBDIR, and LIBTCL) may be overridden via the environment
101 # prior to running nmake in order to match the actual installed location and
102 # version on this machine.
104 !if "$(TCLINCDIR)" == ""
105 TCLINCDIR = c:\tcl\include
108 !if "$(TCLLIBDIR)" == ""
109 TCLLIBDIR = c:\tcl\lib
112 !if "$(LIBTCL)" == ""
116 # The locations of the ICU header and library files. These variables
117 # (ICUINCDIR, ICULIBDIR, and LIBICU) may be overridden via the environment
118 # prior to running nmake in order to match the actual installed location on
121 !if "$(ICUINCDIR)" == ""
122 ICUINCDIR = c:\icu\include
125 !if "$(ICULIBDIR)" == ""
126 ICULIBDIR = c:\icu\lib
129 !if "$(LIBICU)" == ""
130 LIBICU = icuuc.lib icuin.lib
133 # This is the command to use for tclsh - normally just "tclsh", but we may
134 # know the specific version we want to use. This variable (TCLSH_CMD) may be
135 # overridden via the environment prior to running nmake in order to select a
136 # specific Tcl shell to use.
138 !if "$(TCLSH_CMD)" == ""
142 # Compiler options needed for programs that use the readline() library.
144 READLINE_FLAGS = -DHAVE_READLINE=0
146 # The library that programs using readline() must link against.
150 # Should the database engine be compiled threadsafe
152 TCC = $(TCC) -DSQLITE_THREADSAFE=1
154 # Do threads override each others locks by default (1), or do we test (-1)
156 TCC = $(TCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1
158 # Any target libraries which libsqlite must be linked against
164 # Flags controlling use of the in memory btree implementation
166 # SQLITE_TEMP_STORE is 0 to force temporary tables to be in a file, 1 to
167 # default to file, 2 to default to memory, and 3 to force temporary
168 # tables to always be in memory.
170 TCC = $(TCC) -DSQLITE_TEMP_STORE=1
172 # Enable/disable loadable extensions, and other optional features
173 # based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*).
174 # The same set of OMIT and ENABLE flags should be passed to the
175 # LEMON parser generator and the mkkeywordhash tool as well.
177 # BEGIN standard options
178 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS3=1
179 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RTREE=1
180 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_COLUMN_METADATA=1
181 # END standard options
183 # BEGIN required Windows option
184 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_MAX_TRIGGER_DEPTH=100
185 # END required Windows option
187 TCC = $(TCC) $(OPT_FEATURE_FLAGS)
189 # Add in any optional parameters specified on the make commane line
190 # ie. make "OPTS=-DSQLITE_ENABLE_FOO=1 -DSQLITE_OMIT_FOO=1".
193 # If symbols are enabled, enable PDBs.
194 # If debugging is enabled, disable all optimizations and enable PDBs.
196 TCC = $(TCC) -Od -D_DEBUG
201 !IF $(DEBUG)>0 || $(SYMBOLS)!=0
205 # If ICU support is enabled, add the compiler options for it.
207 TCC = $(TCC) -DSQLITE_ENABLE_ICU=1
208 TCC = $(TCC) -I$(TOP)\ext\icu
209 TCC = $(TCC) -I$(ICUINCDIR)
212 # libtool compile/link
213 LTCOMPILE = $(TCC) -Fo$@
215 LTLINK = $(TCC) -Fe$@
217 # If a platform was set, force the linker to target that.
218 # Note that the vcvars*.bat family of batch files typically
219 # set this for you. Otherwise, the linker will attempt
220 # to deduce the binary type based on the object files.
221 !IF "$(PLATFORM)"!=""
222 LTLINKOPTS = /MACHINE:$(PLATFORM)
223 LTLIBOPTS = /MACHINE:$(PLATFORM)
226 # If debugging is enabled, enable PDBs.
227 !IF $(DEBUG)>0 || $(SYMBOLS)!=0
228 LTLINKOPTS = $(LTLINKOPTS) /DEBUG
231 # Start with the Tcl related linker options.
232 LTLIBPATHS = /LIBPATH:$(TCLLIBDIR)
235 # If ICU support is enabled, add the linker options for it.
237 LTLIBPATHS = $(LTLIBPATHS) /LIBPATH:$(ICULIBDIR)
238 LTLIBS = $(LTLIBS) $(LIBICU)
241 # nawk compatible awk.
244 # You should not have to change anything below this line
245 ###############################################################################
247 # Object files for the SQLite library (non-amalgamation).
249 LIBOBJS0 = alter.lo analyze.lo attach.lo auth.lo \
250 backup.lo bitvec.lo btmutex.lo btree.lo build.lo \
251 callback.lo complete.lo ctime.lo date.lo delete.lo \
252 expr.lo fault.lo fkey.lo \
253 fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo fts3_porter.lo \
254 fts3_snippet.lo fts3_tokenizer.lo fts3_tokenizer1.lo fts3_write.lo \
255 func.lo global.lo hash.lo \
256 icu.lo insert.lo journal.lo legacy.lo loadext.lo \
257 main.lo malloc.lo mem0.lo mem1.lo mem2.lo mem3.lo mem5.lo \
259 mutex.lo mutex_noop.lo mutex_os2.lo mutex_unix.lo mutex_w32.lo \
260 notify.lo opcodes.lo os.lo os_os2.lo os_unix.lo os_win.lo \
261 pager.lo parse.lo pcache.lo pcache1.lo pragma.lo prepare.lo printf.lo \
262 random.lo resolve.lo rowset.lo rtree.lo select.lo status.lo \
263 table.lo tokenize.lo trigger.lo \
264 update.lo util.lo vacuum.lo \
265 vdbe.lo vdbeapi.lo vdbeaux.lo vdbeblob.lo vdbemem.lo vdbesort.lo \
266 vdbetrace.lo wal.lo walker.lo where.lo utf.lo vtab.lo
268 # Object files for the amalgamation.
270 LIBOBJS1 = sqlite3.lo
272 # Determine the real value of LIBOBJ based on the 'configure' script
274 !IF $(USE_AMALGAMATION)==0
280 # All of the source code files.
284 $(TOP)\src\analyze.c \
285 $(TOP)\src\attach.c \
287 $(TOP)\src\backup.c \
288 $(TOP)\src\bitvec.c \
289 $(TOP)\src\btmutex.c \
292 $(TOP)\src\btreeInt.h \
294 $(TOP)\src\callback.c \
295 $(TOP)\src\complete.c \
298 $(TOP)\src\delete.c \
303 $(TOP)\src\global.c \
306 $(TOP)\src\hwtime.h \
307 $(TOP)\src\insert.c \
308 $(TOP)\src\journal.c \
309 $(TOP)\src\legacy.c \
310 $(TOP)\src\loadext.c \
312 $(TOP)\src\malloc.c \
318 $(TOP)\src\memjournal.c \
321 $(TOP)\src\mutex_noop.c \
322 $(TOP)\src\mutex_os2.c \
323 $(TOP)\src\mutex_unix.c \
324 $(TOP)\src\mutex_w32.c \
325 $(TOP)\src\notify.c \
328 $(TOP)\src\os_common.h \
329 $(TOP)\src\os_os2.c \
330 $(TOP)\src\os_unix.c \
331 $(TOP)\src\os_win.c \
335 $(TOP)\src\pcache.c \
336 $(TOP)\src\pcache.h \
337 $(TOP)\src\pcache1.c \
338 $(TOP)\src\pragma.c \
339 $(TOP)\src\prepare.c \
340 $(TOP)\src\printf.c \
341 $(TOP)\src\random.c \
342 $(TOP)\src\resolve.c \
343 $(TOP)\src\rowset.c \
344 $(TOP)\src\select.c \
345 $(TOP)\src\status.c \
347 $(TOP)\src\sqlite.h.in \
348 $(TOP)\src\sqlite3ext.h \
349 $(TOP)\src\sqliteInt.h \
350 $(TOP)\src\sqliteLimit.h \
352 $(TOP)\src\tclsqlite.c \
353 $(TOP)\src\tokenize.c \
354 $(TOP)\src\trigger.c \
356 $(TOP)\src\update.c \
358 $(TOP)\src\vacuum.c \
361 $(TOP)\src\vdbeapi.c \
362 $(TOP)\src\vdbeaux.c \
363 $(TOP)\src\vdbeblob.c \
364 $(TOP)\src\vdbemem.c \
365 $(TOP)\src\vdbesort.c \
366 $(TOP)\src\vdbetrace.c \
367 $(TOP)\src\vdbeInt.h \
371 $(TOP)\src\walker.c \
374 # Source code for extensions
377 $(TOP)\ext\fts1\fts1.c \
378 $(TOP)\ext\fts1\fts1.h \
379 $(TOP)\ext\fts1\fts1_hash.c \
380 $(TOP)\ext\fts1\fts1_hash.h \
381 $(TOP)\ext\fts1\fts1_porter.c \
382 $(TOP)\ext\fts1\fts1_tokenizer.h \
383 $(TOP)\ext\fts1\fts1_tokenizer1.c
385 $(TOP)\ext\fts2\fts2.c \
386 $(TOP)\ext\fts2\fts2.h \
387 $(TOP)\ext\fts2\fts2_hash.c \
388 $(TOP)\ext\fts2\fts2_hash.h \
389 $(TOP)\ext\fts2\fts2_icu.c \
390 $(TOP)\ext\fts2\fts2_porter.c \
391 $(TOP)\ext\fts2\fts2_tokenizer.h \
392 $(TOP)\ext\fts2\fts2_tokenizer.c \
393 $(TOP)\ext\fts2\fts2_tokenizer1.c
395 $(TOP)\ext\fts3\fts3.c \
396 $(TOP)\ext\fts3\fts3.h \
397 $(TOP)\ext\fts3\fts3Int.h \
398 $(TOP)\ext\fts3\fts3_aux.c \
399 $(TOP)\ext\fts3\fts3_expr.c \
400 $(TOP)\ext\fts3\fts3_hash.c \
401 $(TOP)\ext\fts3\fts3_hash.h \
402 $(TOP)\ext\fts3\fts3_icu.c \
403 $(TOP)\ext\fts3\fts3_porter.c \
404 $(TOP)\ext\fts3\fts3_snippet.c \
405 $(TOP)\ext\fts3\fts3_tokenizer.h \
406 $(TOP)\ext\fts3\fts3_tokenizer.c \
407 $(TOP)\ext\fts3\fts3_tokenizer1.c \
408 $(TOP)\ext\fts3\fts3_write.c
410 $(TOP)\ext\icu\sqliteicu.h \
413 $(TOP)\ext\rtree\rtree.h \
414 $(TOP)\ext\rtree\rtree.c
417 # Generated source code files
427 # Source code to the test files.
439 $(TOP)\src\test_autoext.c \
440 $(TOP)\src\test_async.c \
441 $(TOP)\src\test_backup.c \
442 $(TOP)\src\test_btree.c \
443 $(TOP)\src\test_config.c \
444 $(TOP)\src\test_demovfs.c \
445 $(TOP)\src\test_devsym.c \
446 $(TOP)\src\test_func.c \
447 $(TOP)\src\test_fuzzer.c \
448 $(TOP)\src\test_hexio.c \
449 $(TOP)\src\test_init.c \
450 $(TOP)\src\test_intarray.c \
451 $(TOP)\src\test_journal.c \
452 $(TOP)\src\test_malloc.c \
453 $(TOP)\src\test_multiplex.c \
454 $(TOP)\src\test_mutex.c \
455 $(TOP)\src\test_onefile.c \
456 $(TOP)\src\test_osinst.c \
457 $(TOP)\src\test_pcache.c \
458 $(TOP)\src\test_quota.c \
459 $(TOP)\src\test_rtree.c \
460 $(TOP)\src\test_schema.c \
461 $(TOP)\src\test_server.c \
462 $(TOP)\src\test_superlock.c \
463 $(TOP)\src\test_syscall.c \
464 $(TOP)\src\test_stat.c \
465 $(TOP)\src\test_tclvar.c \
466 $(TOP)\src\test_thread.c \
467 $(TOP)\src\test_vfs.c \
468 $(TOP)\src\test_wholenumber.c \
469 $(TOP)\src\test_wsd.c \
470 $(TOP)\ext\fts3\fts3_term.c \
471 $(TOP)\ext\fts3\fts3_test.c
473 # Source code to the library files needed by the test fixture
476 $(TOP)\src\attach.c \
477 $(TOP)\src\backup.c \
478 $(TOP)\src\bitvec.c \
485 $(TOP)\src\insert.c \
489 $(TOP)\src\os_os2.c \
490 $(TOP)\src\os_unix.c \
491 $(TOP)\src\os_win.c \
493 $(TOP)\src\pragma.c \
494 $(TOP)\src\prepare.c \
495 $(TOP)\src\printf.c \
496 $(TOP)\src\random.c \
497 $(TOP)\src\pcache.c \
498 $(TOP)\src\pcache1.c \
499 $(TOP)\src\select.c \
500 $(TOP)\src\tokenize.c \
503 $(TOP)\src\vdbeapi.c \
504 $(TOP)\src\vdbeaux.c \
506 $(TOP)\src\vdbemem.c \
507 $(TOP)\src\vdbesort.c \
508 $(TOP)\src\vdbetrace.c \
511 $(TOP)\ext\fts3\fts3.c \
512 $(TOP)\ext\fts3\fts3_aux.c \
513 $(TOP)\ext\fts3\fts3_expr.c \
514 $(TOP)\ext\fts3\fts3_tokenizer.c \
515 $(TOP)\ext\fts3\fts3_write.c \
516 $(TOP)\ext\async\sqlite3async.c
518 # Header files used by all library source files.
522 $(TOP)\src\btreeInt.h \
524 $(TOP)\src\hwtime.h \
529 $(TOP)\src\os_common.h \
531 $(TOP)\src\pcache.h \
534 $(TOP)\src\sqlite3ext.h \
535 $(TOP)\src\sqliteInt.h \
536 $(TOP)\src\sqliteLimit.h \
540 # Header files used by extensions
543 $(TOP)\ext\fts1\fts1.h \
544 $(TOP)\ext\fts1\fts1_hash.h \
545 $(TOP)\ext\fts1\fts1_tokenizer.h
547 $(TOP)\ext\fts2\fts2.h \
548 $(TOP)\ext\fts2\fts2_hash.h \
549 $(TOP)\ext\fts2\fts2_tokenizer.h
551 $(TOP)\ext\fts3\fts3.h \
552 $(TOP)\ext\fts3\fts3Int.h \
553 $(TOP)\ext\fts3\fts3_hash.h \
554 $(TOP)\ext\fts3\fts3_tokenizer.h
556 $(TOP)\ext\rtree\rtree.h
558 $(TOP)\ext\icu\sqliteicu.h
560 $(TOP)\ext\rtree\sqlite3rtree.h
562 # This is the default Makefile target. The objects listed here
563 # are what get build when you type just "make" with no arguments.
565 all: dll libsqlite3.lib sqlite3.exe libtclsqlite3.lib
567 libsqlite3.lib: $(LIBOBJ)
568 $(LTLIB) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS)
570 libtclsqlite3.lib: tclsqlite.lo libsqlite3.lib
571 $(LTLIB) $(LTLIBOPTS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCL:tcl=tclstub) $(TLIBS)
573 sqlite3.exe: $(TOP)\src\shell.c libsqlite3.lib sqlite3.h
574 $(LTLINK) $(READLINE_FLAGS) \
576 /link $(LTLINKOPTS) $(LTLIBPATHS) libsqlite3.lib $(LIBREADLINE) $(LTLIBS) $(TLIBS)
578 # This target creates a directory named "tsrc" and fills it with
579 # copies of all of the C source code and header files needed to
580 # build on the target system. Some of the C source code and header
581 # files are automatically generated. This target takes care of
582 # all that automatic generation.
584 .target_source: $(SRC) $(TOP)\tool\vdbe-compress.tcl
587 for %i in ($(SRC)) do copy /Y %i tsrc
588 del /Q tsrc\sqlite.h.in tsrc\parse.y
589 $(TCLSH_CMD) $(TOP)\tool\vdbe-compress.tcl < tsrc\vdbe.c > vdbe.new
590 move vdbe.new tsrc\vdbe.c
591 echo > .target_source
593 sqlite3.c: .target_source $(TOP)\tool\mksqlite3c.tcl
594 $(TCLSH_CMD) $(TOP)\tool\mksqlite3c.tcl
596 sqlite3-all.c: sqlite3.c $(TOP)/tool/split-sqlite3c.tcl
597 $(TCLSH_CMD) $(TOP)/tool/split-sqlite3c.tcl
599 # Rule to build the amalgamation
601 sqlite3.lo: sqlite3.c
602 $(LTCOMPILE) -c sqlite3.c
604 # Rules to build the LEMON compiler generator
606 lempar.c: $(TOP)\src\lempar.c
607 copy $(TOP)\src\lempar.c .
609 lemon.exe: $(TOP)\tool\lemon.c lempar.c
610 $(BCC) -Fe$@ $(TOP)\tool\lemon.c
612 # Rules to build individual *.lo files from generated *.c files. This
618 parse.lo: parse.c $(HDR)
619 $(LTCOMPILE) -c parse.c
621 opcodes.lo: opcodes.c
622 $(LTCOMPILE) -c opcodes.c
624 # Rules to build individual *.lo files from files in the src directory.
626 alter.lo: $(TOP)\src\alter.c $(HDR)
627 $(LTCOMPILE) -c $(TOP)\src\alter.c
629 analyze.lo: $(TOP)\src\analyze.c $(HDR)
630 $(LTCOMPILE) -c $(TOP)\src\analyze.c
632 attach.lo: $(TOP)\src\attach.c $(HDR)
633 $(LTCOMPILE) -c $(TOP)\src\attach.c
635 auth.lo: $(TOP)\src\auth.c $(HDR)
636 $(LTCOMPILE) -c $(TOP)\src\auth.c
638 backup.lo: $(TOP)\src\backup.c $(HDR)
639 $(LTCOMPILE) -c $(TOP)\src\backup.c
641 bitvec.lo: $(TOP)\src\bitvec.c $(HDR)
642 $(LTCOMPILE) -c $(TOP)\src\bitvec.c
644 btmutex.lo: $(TOP)\src\btmutex.c $(HDR)
645 $(LTCOMPILE) -c $(TOP)\src\btmutex.c
647 btree.lo: $(TOP)\src\btree.c $(HDR) $(TOP)\src\pager.h
648 $(LTCOMPILE) -c $(TOP)\src\btree.c
650 build.lo: $(TOP)\src\build.c $(HDR)
651 $(LTCOMPILE) -c $(TOP)\src\build.c
653 callback.lo: $(TOP)\src\callback.c $(HDR)
654 $(LTCOMPILE) -c $(TOP)\src\callback.c
656 complete.lo: $(TOP)\src\complete.c $(HDR)
657 $(LTCOMPILE) -c $(TOP)\src\complete.c
659 ctime.lo: $(TOP)\src\ctime.c $(HDR)
660 $(LTCOMPILE) -c $(TOP)\src\ctime.c
662 date.lo: $(TOP)\src\date.c $(HDR)
663 $(LTCOMPILE) -c $(TOP)\src\date.c
665 delete.lo: $(TOP)\src\delete.c $(HDR)
666 $(LTCOMPILE) -c $(TOP)\src\delete.c
668 expr.lo: $(TOP)\src\expr.c $(HDR)
669 $(LTCOMPILE) -c $(TOP)\src\expr.c
671 fault.lo: $(TOP)\src\fault.c $(HDR)
672 $(LTCOMPILE) -c $(TOP)\src\fault.c
674 fkey.lo: $(TOP)\src\fkey.c $(HDR)
675 $(LTCOMPILE) -c $(TOP)\src\fkey.c
677 func.lo: $(TOP)\src\func.c $(HDR)
678 $(LTCOMPILE) -c $(TOP)\src\func.c
680 global.lo: $(TOP)\src\global.c $(HDR)
681 $(LTCOMPILE) -c $(TOP)\src\global.c
683 hash.lo: $(TOP)\src\hash.c $(HDR)
684 $(LTCOMPILE) -c $(TOP)\src\hash.c
686 insert.lo: $(TOP)\src\insert.c $(HDR)
687 $(LTCOMPILE) -c $(TOP)\src\insert.c
689 journal.lo: $(TOP)\src\journal.c $(HDR)
690 $(LTCOMPILE) -c $(TOP)\src\journal.c
692 legacy.lo: $(TOP)\src\legacy.c $(HDR)
693 $(LTCOMPILE) -c $(TOP)\src\legacy.c
695 loadext.lo: $(TOP)\src\loadext.c $(HDR)
696 $(LTCOMPILE) -c $(TOP)\src\loadext.c
698 main.lo: $(TOP)\src\main.c $(HDR)
699 $(LTCOMPILE) -c $(TOP)\src\main.c
701 malloc.lo: $(TOP)\src\malloc.c $(HDR)
702 $(LTCOMPILE) -c $(TOP)\src\malloc.c
704 mem0.lo: $(TOP)\src\mem0.c $(HDR)
705 $(LTCOMPILE) -c $(TOP)\src\mem0.c
707 mem1.lo: $(TOP)\src\mem1.c $(HDR)
708 $(LTCOMPILE) -c $(TOP)\src\mem1.c
710 mem2.lo: $(TOP)\src\mem2.c $(HDR)
711 $(LTCOMPILE) -c $(TOP)\src\mem2.c
713 mem3.lo: $(TOP)\src\mem3.c $(HDR)
714 $(LTCOMPILE) -c $(TOP)\src\mem3.c
716 mem5.lo: $(TOP)\src\mem5.c $(HDR)
717 $(LTCOMPILE) -c $(TOP)\src\mem5.c
719 memjournal.lo: $(TOP)\src\memjournal.c $(HDR)
720 $(LTCOMPILE) -c $(TOP)\src\memjournal.c
722 mutex.lo: $(TOP)\src\mutex.c $(HDR)
723 $(LTCOMPILE) -c $(TOP)\src\mutex.c
725 mutex_noop.lo: $(TOP)\src\mutex_noop.c $(HDR)
726 $(LTCOMPILE) -c $(TOP)\src\mutex_noop.c
728 mutex_os2.lo: $(TOP)\src\mutex_os2.c $(HDR)
729 $(LTCOMPILE) -c $(TOP)\src\mutex_os2.c
731 mutex_unix.lo: $(TOP)\src\mutex_unix.c $(HDR)
732 $(LTCOMPILE) -c $(TOP)\src\mutex_unix.c
734 mutex_w32.lo: $(TOP)\src\mutex_w32.c $(HDR)
735 $(LTCOMPILE) -c $(TOP)\src\mutex_w32.c
737 notify.lo: $(TOP)\src\notify.c $(HDR)
738 $(LTCOMPILE) -c $(TOP)\src\notify.c
740 pager.lo: $(TOP)\src\pager.c $(HDR) $(TOP)\src\pager.h
741 $(LTCOMPILE) -c $(TOP)\src\pager.c
743 pcache.lo: $(TOP)\src\pcache.c $(HDR) $(TOP)\src\pcache.h
744 $(LTCOMPILE) -c $(TOP)\src\pcache.c
746 pcache1.lo: $(TOP)\src\pcache1.c $(HDR) $(TOP)\src\pcache.h
747 $(LTCOMPILE) -c $(TOP)\src\pcache1.c
749 os.lo: $(TOP)\src\os.c $(HDR)
750 $(LTCOMPILE) -c $(TOP)\src\os.c
752 os_unix.lo: $(TOP)\src\os_unix.c $(HDR)
753 $(LTCOMPILE) -c $(TOP)\src\os_unix.c
755 os_win.lo: $(TOP)\src\os_win.c $(HDR)
756 $(LTCOMPILE) -c $(TOP)\src\os_win.c
758 os_os2.lo: $(TOP)\src\os_os2.c $(HDR)
759 $(LTCOMPILE) -c $(TOP)\src\os_os2.c
761 pragma.lo: $(TOP)\src\pragma.c $(HDR)
762 $(LTCOMPILE) -c $(TOP)\src\pragma.c
764 prepare.lo: $(TOP)\src\prepare.c $(HDR)
765 $(LTCOMPILE) -c $(TOP)\src\prepare.c
767 printf.lo: $(TOP)\src\printf.c $(HDR)
768 $(LTCOMPILE) -c $(TOP)\src\printf.c
770 random.lo: $(TOP)\src\random.c $(HDR)
771 $(LTCOMPILE) -c $(TOP)\src\random.c
773 resolve.lo: $(TOP)\src\resolve.c $(HDR)
774 $(LTCOMPILE) -c $(TOP)\src\resolve.c
776 rowset.lo: $(TOP)\src\rowset.c $(HDR)
777 $(LTCOMPILE) -c $(TOP)\src\rowset.c
779 select.lo: $(TOP)\src\select.c $(HDR)
780 $(LTCOMPILE) -c $(TOP)\src\select.c
782 status.lo: $(TOP)\src\status.c $(HDR)
783 $(LTCOMPILE) -c $(TOP)\src\status.c
785 table.lo: $(TOP)\src\table.c $(HDR)
786 $(LTCOMPILE) -c $(TOP)\src\table.c
788 tokenize.lo: $(TOP)\src\tokenize.c keywordhash.h $(HDR)
789 $(LTCOMPILE) -c $(TOP)\src\tokenize.c
791 trigger.lo: $(TOP)\src\trigger.c $(HDR)
792 $(LTCOMPILE) -c $(TOP)\src\trigger.c
794 update.lo: $(TOP)\src\update.c $(HDR)
795 $(LTCOMPILE) -c $(TOP)\src\update.c
797 utf.lo: $(TOP)\src\utf.c $(HDR)
798 $(LTCOMPILE) -c $(TOP)\src\utf.c
800 util.lo: $(TOP)\src\util.c $(HDR)
801 $(LTCOMPILE) -c $(TOP)\src\util.c
803 vacuum.lo: $(TOP)\src\vacuum.c $(HDR)
804 $(LTCOMPILE) -c $(TOP)\src\vacuum.c
806 vdbe.lo: $(TOP)\src\vdbe.c $(HDR)
807 $(LTCOMPILE) -c $(TOP)\src\vdbe.c
809 vdbeapi.lo: $(TOP)\src\vdbeapi.c $(HDR)
810 $(LTCOMPILE) -c $(TOP)\src\vdbeapi.c
812 vdbeaux.lo: $(TOP)\src\vdbeaux.c $(HDR)
813 $(LTCOMPILE) -c $(TOP)\src\vdbeaux.c
815 vdbeblob.lo: $(TOP)\src\vdbeblob.c $(HDR)
816 $(LTCOMPILE) -c $(TOP)\src\vdbeblob.c
818 vdbemem.lo: $(TOP)\src\vdbemem.c $(HDR)
819 $(LTCOMPILE) -c $(TOP)\src\vdbemem.c
821 vdbesort.lo: $(TOP)\src\vdbesort.c $(HDR)
822 $(LTCOMPILE) -c $(TOP)\src\vdbesort.c
824 vdbetrace.lo: $(TOP)\src\vdbetrace.c $(HDR)
825 $(LTCOMPILE) -c $(TOP)\src\vdbetrace.c
827 vtab.lo: $(TOP)\src\vtab.c $(HDR)
828 $(LTCOMPILE) -c $(TOP)\src\vtab.c
830 wal.lo: $(TOP)\src\wal.c $(HDR)
831 $(LTCOMPILE) -c $(TOP)\src\wal.c
833 walker.lo: $(TOP)\src\walker.c $(HDR)
834 $(LTCOMPILE) -c $(TOP)\src\walker.c
836 where.lo: $(TOP)\src\where.c $(HDR)
837 $(LTCOMPILE) -c $(TOP)\src\where.c
839 tclsqlite.lo: $(TOP)\src\tclsqlite.c $(HDR)
840 $(LTCOMPILE) -DUSE_TCL_STUBS=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c
842 tclsqlite-shell.lo: $(TOP)\src\tclsqlite.c $(HDR)
843 $(LTCOMPILE) -DTCLSH=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c
845 tclsqlite3.exe: tclsqlite-shell.lo libsqlite3.lib
846 $(LTLINK) tclsqlite-shell.lo \
847 /link $(LTLINKOPTS) $(LTLIBPATHS) libsqlite3.lib $(LTLIBS) $(TLIBS)
849 # Rules to build opcodes.c and opcodes.h
851 opcodes.c: opcodes.h $(TOP)\mkopcodec.awk
852 $(NAWK) -f $(TOP)\mkopcodec.awk opcodes.h > opcodes.c
854 opcodes.h: parse.h $(TOP)\src\vdbe.c $(TOP)\mkopcodeh.awk
855 type parse.h $(TOP)\src\vdbe.c | $(NAWK) -f $(TOP)\mkopcodeh.awk > opcodes.h
857 # Rules to build parse.c and parse.h - the outputs of lemon.
861 parse.c: $(TOP)\src\parse.y lemon.exe $(TOP)\addopcodes.awk
862 del /Q parse.y parse.h parse.h.temp
863 copy $(TOP)\src\parse.y .
864 .\lemon.exe $(OPT_FEATURE_FLAGS) $(OPTS) parse.y
865 move parse.h parse.h.temp
866 $(NAWK) -f $(TOP)\addopcodes.awk parse.h.temp > parse.h
868 sqlite3.h: $(TOP)\src\sqlite.h.in $(TOP)\manifest.uuid $(TOP)\VERSION
869 $(TCLSH_CMD) $(TOP)\tool\mksqlite3h.tcl $(TOP) > sqlite3.h
871 mkkeywordhash.exe: $(TOP)\tool\mkkeywordhash.c
872 $(BCC) -Femkkeywordhash.exe $(OPT_FEATURE_FLAGS) $(OPTS) $(TOP)\tool\mkkeywordhash.c
874 keywordhash.h: $(TOP)\tool\mkkeywordhash.c mkkeywordhash.exe
875 .\mkkeywordhash.exe > keywordhash.h
879 # Rules to build the extension objects.
881 icu.lo: $(TOP)\ext\icu\icu.c $(HDR) $(EXTHDR)
882 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\icu\icu.c
884 fts2.lo: $(TOP)\ext\fts2\fts2.c $(HDR) $(EXTHDR)
885 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2.c
887 fts2_hash.lo: $(TOP)\ext\fts2\fts2_hash.c $(HDR) $(EXTHDR)
888 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_hash.c
890 fts2_icu.lo: $(TOP)\ext\fts2\fts2_icu.c $(HDR) $(EXTHDR)
891 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_icu.c
893 fts2_porter.lo: $(TOP)\ext\fts2\fts2_porter.c $(HDR) $(EXTHDR)
894 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_porter.c
896 fts2_tokenizer.lo: $(TOP)\ext\fts2\fts2_tokenizer.c $(HDR) $(EXTHDR)
897 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_tokenizer.c
899 fts2_tokenizer1.lo: $(TOP)\ext\fts2\fts2_tokenizer1.c $(HDR) $(EXTHDR)
900 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_tokenizer1.c
902 fts3.lo: $(TOP)\ext\fts3\fts3.c $(HDR) $(EXTHDR)
903 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3.c
905 fts3_aux.lo: $(TOP)\ext\fts3\fts3_aux.c $(HDR) $(EXTHDR)
906 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_aux.c
908 fts3_expr.lo: $(TOP)\ext\fts3\fts3_expr.c $(HDR) $(EXTHDR)
909 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_expr.c
911 fts3_hash.lo: $(TOP)\ext\fts3\fts3_hash.c $(HDR) $(EXTHDR)
912 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_hash.c
914 fts3_icu.lo: $(TOP)\ext\fts3\fts3_icu.c $(HDR) $(EXTHDR)
915 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_icu.c
917 fts3_snippet.lo: $(TOP)\ext\fts3\fts3_snippet.c $(HDR) $(EXTHDR)
918 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_snippet.c
920 fts3_porter.lo: $(TOP)\ext\fts3\fts3_porter.c $(HDR) $(EXTHDR)
921 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_porter.c
923 fts3_tokenizer.lo: $(TOP)\ext\fts3\fts3_tokenizer.c $(HDR) $(EXTHDR)
924 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenizer.c
926 fts3_tokenizer1.lo: $(TOP)\ext\fts3\fts3_tokenizer1.c $(HDR) $(EXTHDR)
927 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenizer1.c
929 fts3_write.lo: $(TOP)\ext\fts3\fts3_write.c $(HDR) $(EXTHDR)
930 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_write.c
932 rtree.lo: $(TOP)\ext\rtree\rtree.c $(HDR) $(EXTHDR)
933 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\rtree\rtree.c
936 # Rules to build the 'testfixture' application.
938 # If using the amalgamation, use sqlite3.c directly to build the test
939 # fixture. Otherwise link against libsqlite3.lib. (This distinction is
940 # necessary because the test fixture requires non-API symbols which are
941 # hidden when the library is built via the amalgamation).
943 TESTFIXTURE_FLAGS = -DTCLSH=1 -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
944 TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE
946 TESTFIXTURE_SRC0 = $(TESTSRC2) libsqlite3.lib
947 TESTFIXTURE_SRC1 = sqlite3.c
948 !IF $(USE_AMALGAMATION)==0
949 TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC0)
951 TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC1)
954 testfixture.exe: $(TESTFIXTURE_SRC) $(HDR)
955 $(LTLINK) -DSQLITE_NO_SYNC=1 $(TESTFIXTURE_FLAGS) \
956 -DBUILD_sqlite -I$(TCLINCDIR) \
958 /link $(LTLINKOPTS) $(LTLIBPATHS) $(LTLIBS) $(TLIBS)
960 fulltest: testfixture.exe sqlite3.exe
961 .\testfixture.exe $(TOP)\test\all.test
963 soaktest: testfixture.exe sqlite3.exe
964 .\testfixture.exe $(TOP)\test\all.test -soak=1
966 test: testfixture.exe sqlite3.exe
967 .\testfixture.exe $(TOP)\test\veryquick.test
969 sqlite3_analyzer.c: sqlite3.c $(TOP)\src\test_stat.c $(TOP)\src\tclsqlite.c $(TOP)\tool\spaceanal.tcl
970 copy sqlite3.c + $(TOP)\src\test_stat.c + $(TOP)\src\tclsqlite.c $@
971 echo static const char *tclsh_main_loop(void){ >> $@
972 echo static const char *zMainloop = >> $@
973 $(NAWK) -f $(TOP)\tool\tostr.awk $(TOP)\tool\spaceanal.tcl >> $@
974 echo ; return zMainloop; } >> $@
976 sqlite3_analyzer.exe: sqlite3_analyzer.c
977 $(LTLINK) -DBUILD_sqlite -DTCLSH=2 -I$(TCLINCDIR) sqlite3_analyzer.c \
978 /link $(LTLINKOPTS) $(LTLIBPATHS) $(LTLIBS) $(TLIBS)
981 del /Q *.lo *.ilk *.lib *.obj *.pdb sqlite3.exe libsqlite3.lib
982 del /Q *.da *.bb *.bbg gmon.out
983 del /Q sqlite3.h opcodes.c opcodes.h
984 del /Q lemon.exe lempar.c parse.*
985 del /Q mkkeywordhash.exe keywordhash.h
992 del /Q .target_source
993 del /Q tclsqlite3.exe
994 del /Q testfixture.exe testfixture.exp test.db
995 del /Q sqlite3.dll sqlite3.lib sqlite3.exp sqlite3.def
997 del /Q sqlite3_analyzer.exe sqlite3_analyzer.exp sqlite3_analyzer.c
1004 sqlite3.def: libsqlite3.lib
1005 echo EXPORTS > sqlite3.def
1006 dumpbin /all libsqlite3.lib \
1007 | $(NAWK) "/ 1 _?sqlite3_/ { sub(/^.* _?/,\"\");print }" \
1008 | sort >> sqlite3.def
1010 sqlite3.dll: $(LIBOBJ) sqlite3.def
1011 link $(LTLINKOPTS) $(LTLIBPATHS) /DLL /DEF:sqlite3.def /OUT:$@ $(LIBOBJ) $(LTLIBS) $(TLIBS)