blob: ea7efa75806ddc2a6c8dc78f68aab1eb140867d3 [file] [log] [blame]
shanehb2f20bf2011-06-17 07:07:24 +00001#
shaneh603e4262011-06-17 18:52:07 +00002# nmake Makefile for SQLite
shanehb2f20bf2011-06-17 07:07:24 +00003#
4
5# The toplevel directory of the source tree. This is the directory
6# that contains this "Makefile.msc".
7#
8TOP = .
9
shaneh6e7850c2011-06-17 15:57:07 +000010# Set this non-0 to create and use the SQLite amalgamation file.
11#
12USE_AMALGAMATION = 1
13
mistachkinc756ded2011-10-02 05:23:16 +000014# Set this non-0 to use the International Components for Unicode (ICU).
15#
16USE_ICU = 0
17
mistachkin4d60be52011-08-26 05:40:31 +000018# Set this to non-0 to create and use PDBs.
19#
20SYMBOLS = 1
21
mistachkinf2d25f22011-08-25 04:09:12 +000022# 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:
25#
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.
32#
33DEBUG = 0
shanehb2f20bf2011-06-17 07:07:24 +000034
shaneh603e4262011-06-17 18:52:07 +000035# Version numbers and release number for the SQLite being compiled.
36#
37VERSION = 3.7
mistachkinc756ded2011-10-02 05:23:16 +000038VERSION_NUMBER = 3007009
39RELEASE = 3.7.9
shaneh603e4262011-06-17 18:52:07 +000040
shanehb2f20bf2011-06-17 07:07:24 +000041# C Compiler and options for use in building executables that
42# will run on the platform that is doing the build.
43#
mistachkin4d60be52011-08-26 05:40:31 +000044BCC = cl.exe
shanehb2f20bf2011-06-17 07:07:24 +000045
shaneh6e7850c2011-06-17 15:57:07 +000046# C Compile and options for use in building executables that
shanehb2f20bf2011-06-17 07:07:24 +000047# will run on the target platform. (BCC and TCC are usually the
48# same unless your are cross-compiling.)
49#
mistachkin4d60be52011-08-26 05:40:31 +000050TCC = cl.exe -W3 -DSQLITE_OS_WIN=1 -I. -I$(TOP)\src -fp:precise
shaneh6e7850c2011-06-17 15:57:07 +000051
mistachkin32121192011-11-09 17:01:40 +000052# We always have the _msize function available when using MSVC.
53TCC = $(TCC) -DHAVE_MALLOC_USABLE_SIZE -Dmalloc_usable_size=_msize
54
shaneh6e7850c2011-06-17 15:57:07 +000055# The mksqlite3c.tcl and mksqlite3h.tcl scripts will pull in
56# any extension header files by default. For non-amalgamation
57# builds, we need to make sure the compiler can find these.
58#
59!IF $(USE_AMALGAMATION)==0
60TCC = $(TCC) -I$(TOP)\ext\fts3
61TCC = $(TCC) -I$(TOP)\ext\rtree
62!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +000063
64# Define -DNDEBUG to compile without debugging (i.e., for production usage)
65# Omitting the define will cause extra debugging code to be inserted and
66# includes extra comments when "EXPLAIN stmt" is used.
67#
mistachkin753c5442011-08-25 02:02:25 +000068!IF $(DEBUG)==0
shanehb2f20bf2011-06-17 07:07:24 +000069TCC = $(TCC) -DNDEBUG
mistachkin753c5442011-08-25 02:02:25 +000070!ENDIF
71
72!IF $(DEBUG)>1
73TCC = $(TCC) -DSQLITE_DEBUG
74!ENDIF
75
76!IF $(DEBUG)>3
77TCC = $(TCC) -DSQLITE_DEBUG_OS_TRACE=1
78!ENDIF
79
80!IF $(DEBUG)>4
81TCC = $(TCC) -DSQLITE_ENABLE_IOTRACE
82!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +000083
mistachkin176f1b42011-08-02 23:34:00 +000084#
85# Prevent warnings about "insecure" runtime library functions being used.
86#
87TCC = $(TCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
88
mistachkin1b186a92011-08-24 16:13:57 +000089#
mistachkin753c5442011-08-25 02:02:25 +000090# Use native Win32 heap instead of malloc/free?
mistachkin1b186a92011-08-24 16:13:57 +000091#
mistachkind2f496a2011-08-26 11:18:44 +000092# TCC = $(TCC) -DSQLITE_WIN32_MALLOC=1
mistachkin753c5442011-08-25 02:02:25 +000093
94#
95# Validate the heap on every call into the native Win32 heap subsystem?
96#
97!IF $(DEBUG)>2
98TCC = $(TCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1
99!ENDIF
mistachkin1b186a92011-08-24 16:13:57 +0000100
mistachkin5b0b6fd2011-06-25 01:14:36 +0000101# The locations of the Tcl header and library files. Also, the library that
102# non-stubs enabled programs using Tcl must link against. These variables
103# (TCLINCDIR, TCLLIBDIR, and LIBTCL) may be overridden via the environment
104# prior to running nmake in order to match the actual installed location and
105# version on this machine.
shanehb2f20bf2011-06-17 07:07:24 +0000106#
mistachkin5b0b6fd2011-06-25 01:14:36 +0000107!if "$(TCLINCDIR)" == ""
shanehb2f20bf2011-06-17 07:07:24 +0000108TCLINCDIR = c:\tcl\include
mistachkin5b0b6fd2011-06-25 01:14:36 +0000109!endif
110
111!if "$(TCLLIBDIR)" == ""
shanehb2f20bf2011-06-17 07:07:24 +0000112TCLLIBDIR = c:\tcl\lib
mistachkin5b0b6fd2011-06-25 01:14:36 +0000113!endif
114
115!if "$(LIBTCL)" == ""
116LIBTCL = tcl85.lib
117!endif
shanehb2f20bf2011-06-17 07:07:24 +0000118
mistachkinc756ded2011-10-02 05:23:16 +0000119# The locations of the ICU header and library files. These variables
120# (ICUINCDIR, ICULIBDIR, and LIBICU) may be overridden via the environment
121# prior to running nmake in order to match the actual installed location on
122# this machine.
123#
124!if "$(ICUINCDIR)" == ""
125ICUINCDIR = c:\icu\include
126!endif
127
128!if "$(ICULIBDIR)" == ""
129ICULIBDIR = c:\icu\lib
130!endif
131
132!if "$(LIBICU)" == ""
133LIBICU = icuuc.lib icuin.lib
134!endif
135
shanehb2f20bf2011-06-17 07:07:24 +0000136# This is the command to use for tclsh - normally just "tclsh", but we may
mistachkin5b0b6fd2011-06-25 01:14:36 +0000137# know the specific version we want to use. This variable (TCLSH_CMD) may be
138# overridden via the environment prior to running nmake in order to select a
139# specific Tcl shell to use.
shanehb2f20bf2011-06-17 07:07:24 +0000140#
mistachkin5b0b6fd2011-06-25 01:14:36 +0000141!if "$(TCLSH_CMD)" == ""
shanehb2f20bf2011-06-17 07:07:24 +0000142TCLSH_CMD = tclsh85
mistachkin5b0b6fd2011-06-25 01:14:36 +0000143!endif
shanehb2f20bf2011-06-17 07:07:24 +0000144
145# Compiler options needed for programs that use the readline() library.
146#
shaneh6e7850c2011-06-17 15:57:07 +0000147READLINE_FLAGS = -DHAVE_READLINE=0
shanehb2f20bf2011-06-17 07:07:24 +0000148
149# The library that programs using readline() must link against.
150#
shaneh6e7850c2011-06-17 15:57:07 +0000151LIBREADLINE =
shanehb2f20bf2011-06-17 07:07:24 +0000152
153# Should the database engine be compiled threadsafe
154#
155TCC = $(TCC) -DSQLITE_THREADSAFE=1
156
157# Do threads override each others locks by default (1), or do we test (-1)
158#
159TCC = $(TCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1
160
161# Any target libraries which libsqlite must be linked against
shaneh6e7850c2011-06-17 15:57:07 +0000162#
mistachkinc756ded2011-10-02 05:23:16 +0000163!if "$(TLIBS)" == ""
shaneh6e7850c2011-06-17 15:57:07 +0000164TLIBS =
mistachkinc756ded2011-10-02 05:23:16 +0000165!endif
shanehb2f20bf2011-06-17 07:07:24 +0000166
167# Flags controlling use of the in memory btree implementation
168#
169# SQLITE_TEMP_STORE is 0 to force temporary tables to be in a file, 1 to
170# default to file, 2 to default to memory, and 3 to force temporary
171# tables to always be in memory.
172#
shaneh6e7850c2011-06-17 15:57:07 +0000173TCC = $(TCC) -DSQLITE_TEMP_STORE=1
shanehb2f20bf2011-06-17 07:07:24 +0000174
175# Enable/disable loadable extensions, and other optional features
shaneh6e7850c2011-06-17 15:57:07 +0000176# based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*).
177# The same set of OMIT and ENABLE flags should be passed to the
shanehb2f20bf2011-06-17 07:07:24 +0000178# LEMON parser generator and the mkkeywordhash tool as well.
179
180# BEGIN standard options
181OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS3=1
182OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RTREE=1
183OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_COLUMN_METADATA=1
184# END standard options
185
186# BEGIN required Windows option
187OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_MAX_TRIGGER_DEPTH=100
188# END required Windows option
189
190TCC = $(TCC) $(OPT_FEATURE_FLAGS)
191
192# Add in any optional parameters specified on the make commane line
193# ie. make "OPTS=-DSQLITE_ENABLE_FOO=1 -DSQLITE_OMIT_FOO=1".
194TCC = $(TCC) $(OPTS)
195
mistachkin4d60be52011-08-26 05:40:31 +0000196# If symbols are enabled, enable PDBs.
mistachkinf2d25f22011-08-25 04:09:12 +0000197# If debugging is enabled, disable all optimizations and enable PDBs.
198!IF $(DEBUG)>0
mistachkin4d60be52011-08-26 05:40:31 +0000199TCC = $(TCC) -Od -D_DEBUG
200!ELSE
201TCC = $(TCC) -O2
202!ENDIF
203
204!IF $(DEBUG)>0 || $(SYMBOLS)!=0
205TCC = $(TCC) -Zi
mistachkin753c5442011-08-25 02:02:25 +0000206!ENDIF
207
mistachkinc756ded2011-10-02 05:23:16 +0000208# If ICU support is enabled, add the compiler options for it.
209!IF $(USE_ICU)!=0
210TCC = $(TCC) -DSQLITE_ENABLE_ICU=1
211TCC = $(TCC) -I$(TOP)\ext\icu
212TCC = $(TCC) -I$(ICUINCDIR)
213!ENDIF
214
shanehb2f20bf2011-06-17 07:07:24 +0000215# libtool compile/link
216LTCOMPILE = $(TCC) -Fo$@
shanehb2f20bf2011-06-17 07:07:24 +0000217LTLIB = lib.exe
shaneh2a0b9ef2011-06-20 20:52:32 +0000218LTLINK = $(TCC) -Fe$@
219
220# If a platform was set, force the linker to target that.
221# Note that the vcvars*.bat family of batch files typically
222# set this for you. Otherwise, the linker will attempt
223# to deduce the binary type based on the object files.
224!IF "$(PLATFORM)"!=""
225LTLINKOPTS = /MACHINE:$(PLATFORM)
shaneh29ebea82011-06-21 18:12:07 +0000226LTLIBOPTS = /MACHINE:$(PLATFORM)
shaneh2a0b9ef2011-06-20 20:52:32 +0000227!ENDIF
shanehb2f20bf2011-06-17 07:07:24 +0000228
mistachkinf2d25f22011-08-25 04:09:12 +0000229# If debugging is enabled, enable PDBs.
mistachkin4d60be52011-08-26 05:40:31 +0000230!IF $(DEBUG)>0 || $(SYMBOLS)!=0
mistachkin753c5442011-08-25 02:02:25 +0000231LTLINKOPTS = $(LTLINKOPTS) /DEBUG
232!ENDIF
233
mistachkinc756ded2011-10-02 05:23:16 +0000234# Start with the Tcl related linker options.
235LTLIBPATHS = /LIBPATH:$(TCLLIBDIR)
236LTLIBS = $(LIBTCL)
237
238# If ICU support is enabled, add the linker options for it.
239!IF $(USE_ICU)!=0
240LTLIBPATHS = $(LTLIBPATHS) /LIBPATH:$(ICULIBDIR)
241LTLIBS = $(LTLIBS) $(LIBICU)
242!ENDIF
243
shanehb2f20bf2011-06-17 07:07:24 +0000244# nawk compatible awk.
mistachkin5b0b6fd2011-06-25 01:14:36 +0000245NAWK = gawk.exe
shanehb2f20bf2011-06-17 07:07:24 +0000246
247# You should not have to change anything below this line
248###############################################################################
249
shanehb2f20bf2011-06-17 07:07:24 +0000250# Object files for the SQLite library (non-amalgamation).
251#
252LIBOBJS0 = alter.lo analyze.lo attach.lo auth.lo \
253 backup.lo bitvec.lo btmutex.lo btree.lo build.lo \
254 callback.lo complete.lo ctime.lo date.lo delete.lo \
255 expr.lo fault.lo fkey.lo \
256 fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo fts3_porter.lo \
257 fts3_snippet.lo fts3_tokenizer.lo fts3_tokenizer1.lo fts3_write.lo \
258 func.lo global.lo hash.lo \
259 icu.lo insert.lo journal.lo legacy.lo loadext.lo \
260 main.lo malloc.lo mem0.lo mem1.lo mem2.lo mem3.lo mem5.lo \
261 memjournal.lo \
262 mutex.lo mutex_noop.lo mutex_os2.lo mutex_unix.lo mutex_w32.lo \
263 notify.lo opcodes.lo os.lo os_os2.lo os_unix.lo os_win.lo \
264 pager.lo parse.lo pcache.lo pcache1.lo pragma.lo prepare.lo printf.lo \
265 random.lo resolve.lo rowset.lo rtree.lo select.lo status.lo \
266 table.lo tokenize.lo trigger.lo \
267 update.lo util.lo vacuum.lo \
mistachkin81c428a2011-08-17 02:19:54 +0000268 vdbe.lo vdbeapi.lo vdbeaux.lo vdbeblob.lo vdbemem.lo vdbesort.lo \
269 vdbetrace.lo wal.lo walker.lo where.lo utf.lo vtab.lo
shanehb2f20bf2011-06-17 07:07:24 +0000270
271# Object files for the amalgamation.
272#
273LIBOBJS1 = sqlite3.lo
274
275# Determine the real value of LIBOBJ based on the 'configure' script
276#
277!IF $(USE_AMALGAMATION)==0
278LIBOBJ = $(LIBOBJS0)
279!ELSE
280LIBOBJ = $(LIBOBJS1)
281!ENDIF
282
283# All of the source code files.
284#
285SRC = \
286 $(TOP)\src\alter.c \
287 $(TOP)\src\analyze.c \
288 $(TOP)\src\attach.c \
289 $(TOP)\src\auth.c \
290 $(TOP)\src\backup.c \
291 $(TOP)\src\bitvec.c \
292 $(TOP)\src\btmutex.c \
293 $(TOP)\src\btree.c \
294 $(TOP)\src\btree.h \
295 $(TOP)\src\btreeInt.h \
296 $(TOP)\src\build.c \
297 $(TOP)\src\callback.c \
298 $(TOP)\src\complete.c \
299 $(TOP)\src\ctime.c \
300 $(TOP)\src\date.c \
301 $(TOP)\src\delete.c \
302 $(TOP)\src\expr.c \
303 $(TOP)\src\fault.c \
304 $(TOP)\src\fkey.c \
305 $(TOP)\src\func.c \
306 $(TOP)\src\global.c \
307 $(TOP)\src\hash.c \
308 $(TOP)\src\hash.h \
309 $(TOP)\src\hwtime.h \
310 $(TOP)\src\insert.c \
311 $(TOP)\src\journal.c \
312 $(TOP)\src\legacy.c \
313 $(TOP)\src\loadext.c \
314 $(TOP)\src\main.c \
315 $(TOP)\src\malloc.c \
316 $(TOP)\src\mem0.c \
317 $(TOP)\src\mem1.c \
318 $(TOP)\src\mem2.c \
319 $(TOP)\src\mem3.c \
320 $(TOP)\src\mem5.c \
321 $(TOP)\src\memjournal.c \
322 $(TOP)\src\mutex.c \
323 $(TOP)\src\mutex.h \
324 $(TOP)\src\mutex_noop.c \
325 $(TOP)\src\mutex_os2.c \
326 $(TOP)\src\mutex_unix.c \
327 $(TOP)\src\mutex_w32.c \
328 $(TOP)\src\notify.c \
329 $(TOP)\src\os.c \
330 $(TOP)\src\os.h \
331 $(TOP)\src\os_common.h \
332 $(TOP)\src\os_os2.c \
333 $(TOP)\src\os_unix.c \
334 $(TOP)\src\os_win.c \
335 $(TOP)\src\pager.c \
336 $(TOP)\src\pager.h \
337 $(TOP)\src\parse.y \
338 $(TOP)\src\pcache.c \
339 $(TOP)\src\pcache.h \
340 $(TOP)\src\pcache1.c \
341 $(TOP)\src\pragma.c \
342 $(TOP)\src\prepare.c \
343 $(TOP)\src\printf.c \
344 $(TOP)\src\random.c \
345 $(TOP)\src\resolve.c \
346 $(TOP)\src\rowset.c \
347 $(TOP)\src\select.c \
348 $(TOP)\src\status.c \
349 $(TOP)\src\shell.c \
350 $(TOP)\src\sqlite.h.in \
351 $(TOP)\src\sqlite3ext.h \
352 $(TOP)\src\sqliteInt.h \
353 $(TOP)\src\sqliteLimit.h \
354 $(TOP)\src\table.c \
355 $(TOP)\src\tclsqlite.c \
356 $(TOP)\src\tokenize.c \
357 $(TOP)\src\trigger.c \
358 $(TOP)\src\utf.c \
359 $(TOP)\src\update.c \
360 $(TOP)\src\util.c \
361 $(TOP)\src\vacuum.c \
362 $(TOP)\src\vdbe.c \
363 $(TOP)\src\vdbe.h \
364 $(TOP)\src\vdbeapi.c \
365 $(TOP)\src\vdbeaux.c \
366 $(TOP)\src\vdbeblob.c \
367 $(TOP)\src\vdbemem.c \
mistachkin81c428a2011-08-17 02:19:54 +0000368 $(TOP)\src\vdbesort.c \
shanehb2f20bf2011-06-17 07:07:24 +0000369 $(TOP)\src\vdbetrace.c \
370 $(TOP)\src\vdbeInt.h \
371 $(TOP)\src\vtab.c \
372 $(TOP)\src\wal.c \
373 $(TOP)\src\wal.h \
374 $(TOP)\src\walker.c \
375 $(TOP)\src\where.c
376
377# Source code for extensions
378#
379SRC = $(SRC) \
380 $(TOP)\ext\fts1\fts1.c \
381 $(TOP)\ext\fts1\fts1.h \
382 $(TOP)\ext\fts1\fts1_hash.c \
383 $(TOP)\ext\fts1\fts1_hash.h \
384 $(TOP)\ext\fts1\fts1_porter.c \
385 $(TOP)\ext\fts1\fts1_tokenizer.h \
386 $(TOP)\ext\fts1\fts1_tokenizer1.c
387SRC = $(SRC) \
388 $(TOP)\ext\fts2\fts2.c \
389 $(TOP)\ext\fts2\fts2.h \
390 $(TOP)\ext\fts2\fts2_hash.c \
391 $(TOP)\ext\fts2\fts2_hash.h \
392 $(TOP)\ext\fts2\fts2_icu.c \
393 $(TOP)\ext\fts2\fts2_porter.c \
394 $(TOP)\ext\fts2\fts2_tokenizer.h \
395 $(TOP)\ext\fts2\fts2_tokenizer.c \
396 $(TOP)\ext\fts2\fts2_tokenizer1.c
397SRC = $(SRC) \
398 $(TOP)\ext\fts3\fts3.c \
399 $(TOP)\ext\fts3\fts3.h \
400 $(TOP)\ext\fts3\fts3Int.h \
401 $(TOP)\ext\fts3\fts3_aux.c \
402 $(TOP)\ext\fts3\fts3_expr.c \
403 $(TOP)\ext\fts3\fts3_hash.c \
404 $(TOP)\ext\fts3\fts3_hash.h \
405 $(TOP)\ext\fts3\fts3_icu.c \
406 $(TOP)\ext\fts3\fts3_porter.c \
407 $(TOP)\ext\fts3\fts3_snippet.c \
408 $(TOP)\ext\fts3\fts3_tokenizer.h \
409 $(TOP)\ext\fts3\fts3_tokenizer.c \
410 $(TOP)\ext\fts3\fts3_tokenizer1.c \
411 $(TOP)\ext\fts3\fts3_write.c
412SRC = $(SRC) \
413 $(TOP)\ext\icu\sqliteicu.h \
414 $(TOP)\ext\icu\icu.c
415SRC = $(SRC) \
416 $(TOP)\ext\rtree\rtree.h \
417 $(TOP)\ext\rtree\rtree.c
418
419
420# Generated source code files
421#
422SRC = $(SRC) \
423 keywordhash.h \
424 opcodes.c \
425 opcodes.h \
426 parse.c \
427 parse.h \
428 sqlite3.h
429
430# Source code to the test files.
431#
432TESTSRC = \
433 $(TOP)\src\test1.c \
434 $(TOP)\src\test2.c \
435 $(TOP)\src\test3.c \
436 $(TOP)\src\test4.c \
437 $(TOP)\src\test5.c \
438 $(TOP)\src\test6.c \
439 $(TOP)\src\test7.c \
440 $(TOP)\src\test8.c \
441 $(TOP)\src\test9.c \
442 $(TOP)\src\test_autoext.c \
443 $(TOP)\src\test_async.c \
444 $(TOP)\src\test_backup.c \
445 $(TOP)\src\test_btree.c \
446 $(TOP)\src\test_config.c \
447 $(TOP)\src\test_demovfs.c \
448 $(TOP)\src\test_devsym.c \
449 $(TOP)\src\test_func.c \
450 $(TOP)\src\test_fuzzer.c \
451 $(TOP)\src\test_hexio.c \
452 $(TOP)\src\test_init.c \
453 $(TOP)\src\test_intarray.c \
454 $(TOP)\src\test_journal.c \
455 $(TOP)\src\test_malloc.c \
456 $(TOP)\src\test_multiplex.c \
457 $(TOP)\src\test_mutex.c \
458 $(TOP)\src\test_onefile.c \
459 $(TOP)\src\test_osinst.c \
460 $(TOP)\src\test_pcache.c \
461 $(TOP)\src\test_quota.c \
462 $(TOP)\src\test_rtree.c \
463 $(TOP)\src\test_schema.c \
464 $(TOP)\src\test_server.c \
465 $(TOP)\src\test_superlock.c \
466 $(TOP)\src\test_syscall.c \
467 $(TOP)\src\test_stat.c \
468 $(TOP)\src\test_tclvar.c \
469 $(TOP)\src\test_thread.c \
470 $(TOP)\src\test_vfs.c \
471 $(TOP)\src\test_wholenumber.c \
472 $(TOP)\src\test_wsd.c \
473 $(TOP)\ext\fts3\fts3_term.c \
shaneh6e7850c2011-06-17 15:57:07 +0000474 $(TOP)\ext\fts3\fts3_test.c
shanehb2f20bf2011-06-17 07:07:24 +0000475
476# Source code to the library files needed by the test fixture
477#
478TESTSRC2 = \
479 $(TOP)\src\attach.c \
480 $(TOP)\src\backup.c \
481 $(TOP)\src\bitvec.c \
482 $(TOP)\src\btree.c \
483 $(TOP)\src\build.c \
484 $(TOP)\src\ctime.c \
485 $(TOP)\src\date.c \
486 $(TOP)\src\expr.c \
487 $(TOP)\src\func.c \
488 $(TOP)\src\insert.c \
489 $(TOP)\src\wal.c \
490 $(TOP)\src\mem5.c \
491 $(TOP)\src\os.c \
492 $(TOP)\src\os_os2.c \
493 $(TOP)\src\os_unix.c \
494 $(TOP)\src\os_win.c \
495 $(TOP)\src\pager.c \
496 $(TOP)\src\pragma.c \
497 $(TOP)\src\prepare.c \
498 $(TOP)\src\printf.c \
499 $(TOP)\src\random.c \
500 $(TOP)\src\pcache.c \
501 $(TOP)\src\pcache1.c \
502 $(TOP)\src\select.c \
503 $(TOP)\src\tokenize.c \
504 $(TOP)\src\utf.c \
505 $(TOP)\src\util.c \
506 $(TOP)\src\vdbeapi.c \
507 $(TOP)\src\vdbeaux.c \
508 $(TOP)\src\vdbe.c \
509 $(TOP)\src\vdbemem.c \
mistachkin81c428a2011-08-17 02:19:54 +0000510 $(TOP)\src\vdbesort.c \
shanehb2f20bf2011-06-17 07:07:24 +0000511 $(TOP)\src\vdbetrace.c \
512 $(TOP)\src\where.c \
513 parse.c \
514 $(TOP)\ext\fts3\fts3.c \
515 $(TOP)\ext\fts3\fts3_aux.c \
516 $(TOP)\ext\fts3\fts3_expr.c \
shanehb2f20bf2011-06-17 07:07:24 +0000517 $(TOP)\ext\fts3\fts3_tokenizer.c \
518 $(TOP)\ext\fts3\fts3_write.c \
519 $(TOP)\ext\async\sqlite3async.c
520
521# Header files used by all library source files.
522#
523HDR = \
524 $(TOP)\src\btree.h \
525 $(TOP)\src\btreeInt.h \
526 $(TOP)\src\hash.h \
527 $(TOP)\src\hwtime.h \
528 keywordhash.h \
529 $(TOP)\src\mutex.h \
530 opcodes.h \
531 $(TOP)\src\os.h \
532 $(TOP)\src\os_common.h \
533 $(TOP)\src\pager.h \
534 $(TOP)\src\pcache.h \
shaneh6e7850c2011-06-17 15:57:07 +0000535 parse.h \
536 sqlite3.h \
shanehb2f20bf2011-06-17 07:07:24 +0000537 $(TOP)\src\sqlite3ext.h \
shaneh6e7850c2011-06-17 15:57:07 +0000538 $(TOP)\src\sqliteInt.h \
shanehb2f20bf2011-06-17 07:07:24 +0000539 $(TOP)\src\sqliteLimit.h \
540 $(TOP)\src\vdbe.h \
541 $(TOP)\src\vdbeInt.h
542
543# Header files used by extensions
544#
545EXTHDR = $(EXTHDR) \
546 $(TOP)\ext\fts1\fts1.h \
547 $(TOP)\ext\fts1\fts1_hash.h \
548 $(TOP)\ext\fts1\fts1_tokenizer.h
549EXTHDR = $(EXTHDR) \
550 $(TOP)\ext\fts2\fts2.h \
551 $(TOP)\ext\fts2\fts2_hash.h \
552 $(TOP)\ext\fts2\fts2_tokenizer.h
553EXTHDR = $(EXTHDR) \
554 $(TOP)\ext\fts3\fts3.h \
555 $(TOP)\ext\fts3\fts3Int.h \
556 $(TOP)\ext\fts3\fts3_hash.h \
557 $(TOP)\ext\fts3\fts3_tokenizer.h
558EXTHDR = $(EXTHDR) \
559 $(TOP)\ext\rtree\rtree.h
560EXTHDR = $(EXTHDR) \
561 $(TOP)\ext\icu\sqliteicu.h
562EXTHDR = $(EXTHDR) \
563 $(TOP)\ext\rtree\sqlite3rtree.h
564
565# This is the default Makefile target. The objects listed here
566# are what get build when you type just "make" with no arguments.
567#
mistachkin5b0b6fd2011-06-25 01:14:36 +0000568all: dll libsqlite3.lib sqlite3.exe libtclsqlite3.lib
shanehb2f20bf2011-06-17 07:07:24 +0000569
shanehb2f20bf2011-06-17 07:07:24 +0000570libsqlite3.lib: $(LIBOBJ)
shaneh29ebea82011-06-21 18:12:07 +0000571 $(LTLIB) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +0000572
573libtclsqlite3.lib: tclsqlite.lo libsqlite3.lib
mistachkinc756ded2011-10-02 05:23:16 +0000574 $(LTLIB) $(LTLIBOPTS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCL:tcl=tclstub) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +0000575
576sqlite3.exe: $(TOP)\src\shell.c libsqlite3.lib sqlite3.h
577 $(LTLINK) $(READLINE_FLAGS) \
shaneh2a0b9ef2011-06-20 20:52:32 +0000578 $(TOP)\src\shell.c \
mistachkinc756ded2011-10-02 05:23:16 +0000579 /link $(LTLINKOPTS) $(LTLIBPATHS) libsqlite3.lib $(LIBREADLINE) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +0000580
581# This target creates a directory named "tsrc" and fills it with
582# copies of all of the C source code and header files needed to
583# build on the target system. Some of the C source code and header
584# files are automatically generated. This target takes care of
585# all that automatic generation.
586#
587.target_source: $(SRC) $(TOP)\tool\vdbe-compress.tcl
588 -rmdir /S/Q tsrc
589 -mkdir tsrc
590 for %i in ($(SRC)) do copy /Y %i tsrc
591 del /Q tsrc\sqlite.h.in tsrc\parse.y
mistachkin5b0b6fd2011-06-25 01:14:36 +0000592 $(TCLSH_CMD) $(TOP)\tool\vdbe-compress.tcl < tsrc\vdbe.c > vdbe.new
shanehb2f20bf2011-06-17 07:07:24 +0000593 move vdbe.new tsrc\vdbe.c
594 echo > .target_source
595
596sqlite3.c: .target_source $(TOP)\tool\mksqlite3c.tcl
597 $(TCLSH_CMD) $(TOP)\tool\mksqlite3c.tcl
598
drh75e7bc12011-07-22 11:23:49 +0000599sqlite3-all.c: sqlite3.c $(TOP)/tool/split-sqlite3c.tcl
600 $(TCLSH_CMD) $(TOP)/tool/split-sqlite3c.tcl
601
shanehb2f20bf2011-06-17 07:07:24 +0000602# Rule to build the amalgamation
603#
604sqlite3.lo: sqlite3.c
shaneh6e7850c2011-06-17 15:57:07 +0000605 $(LTCOMPILE) -c sqlite3.c
shanehb2f20bf2011-06-17 07:07:24 +0000606
607# Rules to build the LEMON compiler generator
608#
609lempar.c: $(TOP)\src\lempar.c
610 copy $(TOP)\src\lempar.c .
611
612lemon.exe: $(TOP)\tool\lemon.c lempar.c
613 $(BCC) -Fe$@ $(TOP)\tool\lemon.c
614
615# Rules to build individual *.lo files from generated *.c files. This
616# applies to:
617#
618# parse.lo
619# opcodes.lo
620#
621parse.lo: parse.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000622 $(LTCOMPILE) -c parse.c
shanehb2f20bf2011-06-17 07:07:24 +0000623
624opcodes.lo: opcodes.c
shaneh6e7850c2011-06-17 15:57:07 +0000625 $(LTCOMPILE) -c opcodes.c
shanehb2f20bf2011-06-17 07:07:24 +0000626
627# Rules to build individual *.lo files from files in the src directory.
628#
629alter.lo: $(TOP)\src\alter.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000630 $(LTCOMPILE) -c $(TOP)\src\alter.c
shanehb2f20bf2011-06-17 07:07:24 +0000631
632analyze.lo: $(TOP)\src\analyze.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000633 $(LTCOMPILE) -c $(TOP)\src\analyze.c
shanehb2f20bf2011-06-17 07:07:24 +0000634
635attach.lo: $(TOP)\src\attach.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000636 $(LTCOMPILE) -c $(TOP)\src\attach.c
shanehb2f20bf2011-06-17 07:07:24 +0000637
638auth.lo: $(TOP)\src\auth.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000639 $(LTCOMPILE) -c $(TOP)\src\auth.c
shanehb2f20bf2011-06-17 07:07:24 +0000640
641backup.lo: $(TOP)\src\backup.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000642 $(LTCOMPILE) -c $(TOP)\src\backup.c
shanehb2f20bf2011-06-17 07:07:24 +0000643
644bitvec.lo: $(TOP)\src\bitvec.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000645 $(LTCOMPILE) -c $(TOP)\src\bitvec.c
shanehb2f20bf2011-06-17 07:07:24 +0000646
647btmutex.lo: $(TOP)\src\btmutex.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000648 $(LTCOMPILE) -c $(TOP)\src\btmutex.c
shanehb2f20bf2011-06-17 07:07:24 +0000649
650btree.lo: $(TOP)\src\btree.c $(HDR) $(TOP)\src\pager.h
shaneh6e7850c2011-06-17 15:57:07 +0000651 $(LTCOMPILE) -c $(TOP)\src\btree.c
shanehb2f20bf2011-06-17 07:07:24 +0000652
653build.lo: $(TOP)\src\build.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000654 $(LTCOMPILE) -c $(TOP)\src\build.c
shanehb2f20bf2011-06-17 07:07:24 +0000655
656callback.lo: $(TOP)\src\callback.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000657 $(LTCOMPILE) -c $(TOP)\src\callback.c
shanehb2f20bf2011-06-17 07:07:24 +0000658
659complete.lo: $(TOP)\src\complete.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000660 $(LTCOMPILE) -c $(TOP)\src\complete.c
shanehb2f20bf2011-06-17 07:07:24 +0000661
662ctime.lo: $(TOP)\src\ctime.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000663 $(LTCOMPILE) -c $(TOP)\src\ctime.c
shanehb2f20bf2011-06-17 07:07:24 +0000664
665date.lo: $(TOP)\src\date.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000666 $(LTCOMPILE) -c $(TOP)\src\date.c
shanehb2f20bf2011-06-17 07:07:24 +0000667
668delete.lo: $(TOP)\src\delete.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000669 $(LTCOMPILE) -c $(TOP)\src\delete.c
shanehb2f20bf2011-06-17 07:07:24 +0000670
671expr.lo: $(TOP)\src\expr.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000672 $(LTCOMPILE) -c $(TOP)\src\expr.c
shanehb2f20bf2011-06-17 07:07:24 +0000673
674fault.lo: $(TOP)\src\fault.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000675 $(LTCOMPILE) -c $(TOP)\src\fault.c
shanehb2f20bf2011-06-17 07:07:24 +0000676
677fkey.lo: $(TOP)\src\fkey.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000678 $(LTCOMPILE) -c $(TOP)\src\fkey.c
shanehb2f20bf2011-06-17 07:07:24 +0000679
680func.lo: $(TOP)\src\func.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000681 $(LTCOMPILE) -c $(TOP)\src\func.c
shanehb2f20bf2011-06-17 07:07:24 +0000682
683global.lo: $(TOP)\src\global.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000684 $(LTCOMPILE) -c $(TOP)\src\global.c
shanehb2f20bf2011-06-17 07:07:24 +0000685
686hash.lo: $(TOP)\src\hash.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000687 $(LTCOMPILE) -c $(TOP)\src\hash.c
shanehb2f20bf2011-06-17 07:07:24 +0000688
689insert.lo: $(TOP)\src\insert.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000690 $(LTCOMPILE) -c $(TOP)\src\insert.c
shanehb2f20bf2011-06-17 07:07:24 +0000691
692journal.lo: $(TOP)\src\journal.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000693 $(LTCOMPILE) -c $(TOP)\src\journal.c
shanehb2f20bf2011-06-17 07:07:24 +0000694
695legacy.lo: $(TOP)\src\legacy.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000696 $(LTCOMPILE) -c $(TOP)\src\legacy.c
shanehb2f20bf2011-06-17 07:07:24 +0000697
698loadext.lo: $(TOP)\src\loadext.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000699 $(LTCOMPILE) -c $(TOP)\src\loadext.c
shanehb2f20bf2011-06-17 07:07:24 +0000700
701main.lo: $(TOP)\src\main.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000702 $(LTCOMPILE) -c $(TOP)\src\main.c
shanehb2f20bf2011-06-17 07:07:24 +0000703
704malloc.lo: $(TOP)\src\malloc.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000705 $(LTCOMPILE) -c $(TOP)\src\malloc.c
shanehb2f20bf2011-06-17 07:07:24 +0000706
707mem0.lo: $(TOP)\src\mem0.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000708 $(LTCOMPILE) -c $(TOP)\src\mem0.c
shanehb2f20bf2011-06-17 07:07:24 +0000709
710mem1.lo: $(TOP)\src\mem1.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000711 $(LTCOMPILE) -c $(TOP)\src\mem1.c
shanehb2f20bf2011-06-17 07:07:24 +0000712
713mem2.lo: $(TOP)\src\mem2.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000714 $(LTCOMPILE) -c $(TOP)\src\mem2.c
shanehb2f20bf2011-06-17 07:07:24 +0000715
716mem3.lo: $(TOP)\src\mem3.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000717 $(LTCOMPILE) -c $(TOP)\src\mem3.c
shanehb2f20bf2011-06-17 07:07:24 +0000718
719mem5.lo: $(TOP)\src\mem5.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000720 $(LTCOMPILE) -c $(TOP)\src\mem5.c
shanehb2f20bf2011-06-17 07:07:24 +0000721
722memjournal.lo: $(TOP)\src\memjournal.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000723 $(LTCOMPILE) -c $(TOP)\src\memjournal.c
shanehb2f20bf2011-06-17 07:07:24 +0000724
725mutex.lo: $(TOP)\src\mutex.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000726 $(LTCOMPILE) -c $(TOP)\src\mutex.c
shanehb2f20bf2011-06-17 07:07:24 +0000727
728mutex_noop.lo: $(TOP)\src\mutex_noop.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000729 $(LTCOMPILE) -c $(TOP)\src\mutex_noop.c
shanehb2f20bf2011-06-17 07:07:24 +0000730
731mutex_os2.lo: $(TOP)\src\mutex_os2.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000732 $(LTCOMPILE) -c $(TOP)\src\mutex_os2.c
shanehb2f20bf2011-06-17 07:07:24 +0000733
734mutex_unix.lo: $(TOP)\src\mutex_unix.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000735 $(LTCOMPILE) -c $(TOP)\src\mutex_unix.c
shanehb2f20bf2011-06-17 07:07:24 +0000736
737mutex_w32.lo: $(TOP)\src\mutex_w32.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000738 $(LTCOMPILE) -c $(TOP)\src\mutex_w32.c
shanehb2f20bf2011-06-17 07:07:24 +0000739
740notify.lo: $(TOP)\src\notify.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000741 $(LTCOMPILE) -c $(TOP)\src\notify.c
shanehb2f20bf2011-06-17 07:07:24 +0000742
743pager.lo: $(TOP)\src\pager.c $(HDR) $(TOP)\src\pager.h
shaneh6e7850c2011-06-17 15:57:07 +0000744 $(LTCOMPILE) -c $(TOP)\src\pager.c
shanehb2f20bf2011-06-17 07:07:24 +0000745
746pcache.lo: $(TOP)\src\pcache.c $(HDR) $(TOP)\src\pcache.h
shaneh6e7850c2011-06-17 15:57:07 +0000747 $(LTCOMPILE) -c $(TOP)\src\pcache.c
shanehb2f20bf2011-06-17 07:07:24 +0000748
749pcache1.lo: $(TOP)\src\pcache1.c $(HDR) $(TOP)\src\pcache.h
shaneh6e7850c2011-06-17 15:57:07 +0000750 $(LTCOMPILE) -c $(TOP)\src\pcache1.c
shanehb2f20bf2011-06-17 07:07:24 +0000751
752os.lo: $(TOP)\src\os.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000753 $(LTCOMPILE) -c $(TOP)\src\os.c
shanehb2f20bf2011-06-17 07:07:24 +0000754
755os_unix.lo: $(TOP)\src\os_unix.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000756 $(LTCOMPILE) -c $(TOP)\src\os_unix.c
shanehb2f20bf2011-06-17 07:07:24 +0000757
758os_win.lo: $(TOP)\src\os_win.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000759 $(LTCOMPILE) -c $(TOP)\src\os_win.c
shanehb2f20bf2011-06-17 07:07:24 +0000760
761os_os2.lo: $(TOP)\src\os_os2.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000762 $(LTCOMPILE) -c $(TOP)\src\os_os2.c
shanehb2f20bf2011-06-17 07:07:24 +0000763
764pragma.lo: $(TOP)\src\pragma.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000765 $(LTCOMPILE) -c $(TOP)\src\pragma.c
shanehb2f20bf2011-06-17 07:07:24 +0000766
767prepare.lo: $(TOP)\src\prepare.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000768 $(LTCOMPILE) -c $(TOP)\src\prepare.c
shanehb2f20bf2011-06-17 07:07:24 +0000769
770printf.lo: $(TOP)\src\printf.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000771 $(LTCOMPILE) -c $(TOP)\src\printf.c
shanehb2f20bf2011-06-17 07:07:24 +0000772
773random.lo: $(TOP)\src\random.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000774 $(LTCOMPILE) -c $(TOP)\src\random.c
shanehb2f20bf2011-06-17 07:07:24 +0000775
776resolve.lo: $(TOP)\src\resolve.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000777 $(LTCOMPILE) -c $(TOP)\src\resolve.c
shanehb2f20bf2011-06-17 07:07:24 +0000778
779rowset.lo: $(TOP)\src\rowset.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000780 $(LTCOMPILE) -c $(TOP)\src\rowset.c
shanehb2f20bf2011-06-17 07:07:24 +0000781
782select.lo: $(TOP)\src\select.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000783 $(LTCOMPILE) -c $(TOP)\src\select.c
shanehb2f20bf2011-06-17 07:07:24 +0000784
785status.lo: $(TOP)\src\status.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000786 $(LTCOMPILE) -c $(TOP)\src\status.c
shanehb2f20bf2011-06-17 07:07:24 +0000787
788table.lo: $(TOP)\src\table.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000789 $(LTCOMPILE) -c $(TOP)\src\table.c
shanehb2f20bf2011-06-17 07:07:24 +0000790
791tokenize.lo: $(TOP)\src\tokenize.c keywordhash.h $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000792 $(LTCOMPILE) -c $(TOP)\src\tokenize.c
shanehb2f20bf2011-06-17 07:07:24 +0000793
794trigger.lo: $(TOP)\src\trigger.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000795 $(LTCOMPILE) -c $(TOP)\src\trigger.c
shanehb2f20bf2011-06-17 07:07:24 +0000796
797update.lo: $(TOP)\src\update.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000798 $(LTCOMPILE) -c $(TOP)\src\update.c
shanehb2f20bf2011-06-17 07:07:24 +0000799
800utf.lo: $(TOP)\src\utf.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000801 $(LTCOMPILE) -c $(TOP)\src\utf.c
shanehb2f20bf2011-06-17 07:07:24 +0000802
803util.lo: $(TOP)\src\util.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000804 $(LTCOMPILE) -c $(TOP)\src\util.c
shanehb2f20bf2011-06-17 07:07:24 +0000805
806vacuum.lo: $(TOP)\src\vacuum.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000807 $(LTCOMPILE) -c $(TOP)\src\vacuum.c
shanehb2f20bf2011-06-17 07:07:24 +0000808
809vdbe.lo: $(TOP)\src\vdbe.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000810 $(LTCOMPILE) -c $(TOP)\src\vdbe.c
shanehb2f20bf2011-06-17 07:07:24 +0000811
812vdbeapi.lo: $(TOP)\src\vdbeapi.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000813 $(LTCOMPILE) -c $(TOP)\src\vdbeapi.c
shanehb2f20bf2011-06-17 07:07:24 +0000814
815vdbeaux.lo: $(TOP)\src\vdbeaux.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000816 $(LTCOMPILE) -c $(TOP)\src\vdbeaux.c
shanehb2f20bf2011-06-17 07:07:24 +0000817
818vdbeblob.lo: $(TOP)\src\vdbeblob.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000819 $(LTCOMPILE) -c $(TOP)\src\vdbeblob.c
shanehb2f20bf2011-06-17 07:07:24 +0000820
821vdbemem.lo: $(TOP)\src\vdbemem.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000822 $(LTCOMPILE) -c $(TOP)\src\vdbemem.c
shanehb2f20bf2011-06-17 07:07:24 +0000823
mistachkin81c428a2011-08-17 02:19:54 +0000824vdbesort.lo: $(TOP)\src\vdbesort.c $(HDR)
825 $(LTCOMPILE) -c $(TOP)\src\vdbesort.c
826
shanehb2f20bf2011-06-17 07:07:24 +0000827vdbetrace.lo: $(TOP)\src\vdbetrace.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000828 $(LTCOMPILE) -c $(TOP)\src\vdbetrace.c
shanehb2f20bf2011-06-17 07:07:24 +0000829
830vtab.lo: $(TOP)\src\vtab.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000831 $(LTCOMPILE) -c $(TOP)\src\vtab.c
shanehb2f20bf2011-06-17 07:07:24 +0000832
833wal.lo: $(TOP)\src\wal.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000834 $(LTCOMPILE) -c $(TOP)\src\wal.c
shanehb2f20bf2011-06-17 07:07:24 +0000835
836walker.lo: $(TOP)\src\walker.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000837 $(LTCOMPILE) -c $(TOP)\src\walker.c
shanehb2f20bf2011-06-17 07:07:24 +0000838
839where.lo: $(TOP)\src\where.c $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000840 $(LTCOMPILE) -c $(TOP)\src\where.c
shanehb2f20bf2011-06-17 07:07:24 +0000841
842tclsqlite.lo: $(TOP)\src\tclsqlite.c $(HDR)
843 $(LTCOMPILE) -DUSE_TCL_STUBS=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c
844
845tclsqlite-shell.lo: $(TOP)\src\tclsqlite.c $(HDR)
846 $(LTCOMPILE) -DTCLSH=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c
847
shanehb2f20bf2011-06-17 07:07:24 +0000848tclsqlite3.exe: tclsqlite-shell.lo libsqlite3.lib
849 $(LTLINK) tclsqlite-shell.lo \
mistachkinc756ded2011-10-02 05:23:16 +0000850 /link $(LTLINKOPTS) $(LTLIBPATHS) libsqlite3.lib $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +0000851
852# Rules to build opcodes.c and opcodes.h
853#
854opcodes.c: opcodes.h $(TOP)\mkopcodec.awk
drh307ff302011-08-30 01:29:04 +0000855 $(NAWK) -f $(TOP)\mkopcodec.awk opcodes.h > opcodes.c
shanehb2f20bf2011-06-17 07:07:24 +0000856
857opcodes.h: parse.h $(TOP)\src\vdbe.c $(TOP)\mkopcodeh.awk
mistachkin5b0b6fd2011-06-25 01:14:36 +0000858 type parse.h $(TOP)\src\vdbe.c | $(NAWK) -f $(TOP)\mkopcodeh.awk > opcodes.h
shanehb2f20bf2011-06-17 07:07:24 +0000859
860# Rules to build parse.c and parse.h - the outputs of lemon.
861#
862parse.h: parse.c
863
864parse.c: $(TOP)\src\parse.y lemon.exe $(TOP)\addopcodes.awk
shaneh6e7850c2011-06-17 15:57:07 +0000865 del /Q parse.y parse.h parse.h.temp
shanehb2f20bf2011-06-17 07:07:24 +0000866 copy $(TOP)\src\parse.y .
shanehb2f20bf2011-06-17 07:07:24 +0000867 .\lemon.exe $(OPT_FEATURE_FLAGS) $(OPTS) parse.y
868 move parse.h parse.h.temp
mistachkin5b0b6fd2011-06-25 01:14:36 +0000869 $(NAWK) -f $(TOP)\addopcodes.awk parse.h.temp > parse.h
shanehb2f20bf2011-06-17 07:07:24 +0000870
871sqlite3.h: $(TOP)\src\sqlite.h.in $(TOP)\manifest.uuid $(TOP)\VERSION
mistachkin5b0b6fd2011-06-25 01:14:36 +0000872 $(TCLSH_CMD) $(TOP)\tool\mksqlite3h.tcl $(TOP) > sqlite3.h
shanehb2f20bf2011-06-17 07:07:24 +0000873
874mkkeywordhash.exe: $(TOP)\tool\mkkeywordhash.c
875 $(BCC) -Femkkeywordhash.exe $(OPT_FEATURE_FLAGS) $(OPTS) $(TOP)\tool\mkkeywordhash.c
876
877keywordhash.h: $(TOP)\tool\mkkeywordhash.c mkkeywordhash.exe
mistachkin5b0b6fd2011-06-25 01:14:36 +0000878 .\mkkeywordhash.exe > keywordhash.h
shanehb2f20bf2011-06-17 07:07:24 +0000879
880
881
882# Rules to build the extension objects.
883#
884icu.lo: $(TOP)\ext\icu\icu.c $(HDR) $(EXTHDR)
885 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\icu\icu.c
886
887fts2.lo: $(TOP)\ext\fts2\fts2.c $(HDR) $(EXTHDR)
888 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2.c
889
890fts2_hash.lo: $(TOP)\ext\fts2\fts2_hash.c $(HDR) $(EXTHDR)
891 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_hash.c
892
893fts2_icu.lo: $(TOP)\ext\fts2\fts2_icu.c $(HDR) $(EXTHDR)
894 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_icu.c
895
896fts2_porter.lo: $(TOP)\ext\fts2\fts2_porter.c $(HDR) $(EXTHDR)
897 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_porter.c
898
899fts2_tokenizer.lo: $(TOP)\ext\fts2\fts2_tokenizer.c $(HDR) $(EXTHDR)
900 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_tokenizer.c
901
902fts2_tokenizer1.lo: $(TOP)\ext\fts2\fts2_tokenizer1.c $(HDR) $(EXTHDR)
903 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts2\fts2_tokenizer1.c
904
905fts3.lo: $(TOP)\ext\fts3\fts3.c $(HDR) $(EXTHDR)
906 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3.c
907
908fts3_aux.lo: $(TOP)\ext\fts3\fts3_aux.c $(HDR) $(EXTHDR)
909 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_aux.c
910
911fts3_expr.lo: $(TOP)\ext\fts3\fts3_expr.c $(HDR) $(EXTHDR)
912 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_expr.c
913
914fts3_hash.lo: $(TOP)\ext\fts3\fts3_hash.c $(HDR) $(EXTHDR)
915 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_hash.c
916
917fts3_icu.lo: $(TOP)\ext\fts3\fts3_icu.c $(HDR) $(EXTHDR)
918 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_icu.c
919
920fts3_snippet.lo: $(TOP)\ext\fts3\fts3_snippet.c $(HDR) $(EXTHDR)
921 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_snippet.c
922
923fts3_porter.lo: $(TOP)\ext\fts3\fts3_porter.c $(HDR) $(EXTHDR)
924 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_porter.c
925
926fts3_tokenizer.lo: $(TOP)\ext\fts3\fts3_tokenizer.c $(HDR) $(EXTHDR)
927 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenizer.c
928
929fts3_tokenizer1.lo: $(TOP)\ext\fts3\fts3_tokenizer1.c $(HDR) $(EXTHDR)
930 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenizer1.c
931
932fts3_write.lo: $(TOP)\ext\fts3\fts3_write.c $(HDR) $(EXTHDR)
933 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_write.c
934
935rtree.lo: $(TOP)\ext\rtree\rtree.c $(HDR) $(EXTHDR)
936 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\rtree\rtree.c
937
938
939# Rules to build the 'testfixture' application.
940#
941# If using the amalgamation, use sqlite3.c directly to build the test
942# fixture. Otherwise link against libsqlite3.lib. (This distinction is
943# necessary because the test fixture requires non-API symbols which are
944# hidden when the library is built via the amalgamation).
945#
946TESTFIXTURE_FLAGS = -DTCLSH=1 -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
shaneh6e7850c2011-06-17 15:57:07 +0000947TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE
shanehb2f20bf2011-06-17 07:07:24 +0000948
949TESTFIXTURE_SRC0 = $(TESTSRC2) libsqlite3.lib
950TESTFIXTURE_SRC1 = sqlite3.c
951!IF $(USE_AMALGAMATION)==0
952TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC0)
953!ELSE
954TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC1)
955!ENDIF
956
shaneh603e4262011-06-17 18:52:07 +0000957testfixture.exe: $(TESTFIXTURE_SRC) $(HDR)
shaneh6e7850c2011-06-17 15:57:07 +0000958 $(LTLINK) -DSQLITE_NO_SYNC=1 $(TESTFIXTURE_FLAGS) \
shanehb2f20bf2011-06-17 07:07:24 +0000959 -DBUILD_sqlite -I$(TCLINCDIR) \
shaneh2a0b9ef2011-06-20 20:52:32 +0000960 $(TESTFIXTURE_SRC) \
mistachkinc756ded2011-10-02 05:23:16 +0000961 /link $(LTLINKOPTS) $(LTLIBPATHS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +0000962
963fulltest: testfixture.exe sqlite3.exe
964 .\testfixture.exe $(TOP)\test\all.test
965
966soaktest: testfixture.exe sqlite3.exe
967 .\testfixture.exe $(TOP)\test\all.test -soak=1
968
969test: testfixture.exe sqlite3.exe
970 .\testfixture.exe $(TOP)\test\veryquick.test
971
mistachkin9a55e312011-09-22 00:06:44 +0000972sqlite3_analyzer.c: sqlite3.c $(TOP)\src\test_stat.c $(TOP)\src\tclsqlite.c $(TOP)\tool\spaceanal.tcl
973 copy sqlite3.c + $(TOP)\src\test_stat.c + $(TOP)\src\tclsqlite.c $@
974 echo static const char *tclsh_main_loop(void){ >> $@
975 echo static const char *zMainloop = >> $@
976 $(NAWK) -f $(TOP)\tool\tostr.awk $(TOP)\tool\spaceanal.tcl >> $@
977 echo ; return zMainloop; } >> $@
shanehb2f20bf2011-06-17 07:07:24 +0000978
mistachkin9a55e312011-09-22 00:06:44 +0000979sqlite3_analyzer.exe: sqlite3_analyzer.c
980 $(LTLINK) -DBUILD_sqlite -DTCLSH=2 -I$(TCLINCDIR) sqlite3_analyzer.c \
mistachkinc756ded2011-10-02 05:23:16 +0000981 /link $(LTLINKOPTS) $(LTLIBPATHS) $(LTLIBS) $(TLIBS)
shanehb2f20bf2011-06-17 07:07:24 +0000982
shaneh6e7850c2011-06-17 15:57:07 +0000983clean:
mistachkin649591a2011-09-11 10:14:37 +0000984 del /Q *.lo *.ilk *.lib *.obj *.pdb sqlite3.exe libsqlite3.lib
shanehb2f20bf2011-06-17 07:07:24 +0000985 del /Q sqlite3.h opcodes.c opcodes.h
986 del /Q lemon.exe lempar.c parse.*
987 del /Q mkkeywordhash.exe keywordhash.h
988 -rmdir /Q/S tsrc
989 del /Q .target_source
mistachkin9a55e312011-09-22 00:06:44 +0000990 del /Q tclsqlite3.exe
shaneh603e4262011-06-17 18:52:07 +0000991 del /Q testfixture.exe testfixture.exp test.db
shaneh6e7850c2011-06-17 15:57:07 +0000992 del /Q sqlite3.dll sqlite3.lib sqlite3.exp sqlite3.def
shanehb2f20bf2011-06-17 07:07:24 +0000993 del /Q sqlite3.c
mistachkin9a55e312011-09-22 00:06:44 +0000994 del /Q sqlite3_analyzer.exe sqlite3_analyzer.exp sqlite3_analyzer.c
shanehb2f20bf2011-06-17 07:07:24 +0000995
996#
997# Windows section
998#
999dll: sqlite3.dll
1000
shaneh6e7850c2011-06-17 15:57:07 +00001001sqlite3.def: libsqlite3.lib
mistachkin5b0b6fd2011-06-25 01:14:36 +00001002 echo EXPORTS > sqlite3.def
shaneh6e7850c2011-06-17 15:57:07 +00001003 dumpbin /all libsqlite3.lib \
mistachkin6a3eb4a2011-08-17 07:46:48 +00001004 | $(NAWK) "/ 1 _?sqlite3_/ { sub(/^.* _?/,\"\");print }" \
mistachkin5b0b6fd2011-06-25 01:14:36 +00001005 | sort >> sqlite3.def
shanehb2f20bf2011-06-17 07:07:24 +00001006
1007sqlite3.dll: $(LIBOBJ) sqlite3.def
mistachkinc756ded2011-10-02 05:23:16 +00001008 link $(LTLINKOPTS) $(LTLIBPATHS) /DLL /DEF:sqlite3.def /OUT:$@ $(LIBOBJ) $(LTLIBS) $(TLIBS)