Fix MSVC makefile options that enable control-flow guard.
[sqlite.git] / Makefile.in
blobe1293d69fa77f8c2f694cfa5f8374eee1895f076
1 #!/usr/make
3 # Makefile for SQLITE
5 # This makefile is suppose to be configured automatically using the
6 # autoconf. But if that does not work for you, you can configure
7 # the makefile manually. Just set the parameters below to values that
8 # work well for your system.
10 # If the configure script does not work out-of-the-box, you might
11 # be able to get it to work by giving it some hints. See the comment
12 # at the beginning of configure.in for additional information.
15 # The toplevel directory of the source tree. This is the directory
16 # that contains this "Makefile.in" and the "configure.in" script.
18 TOP = @abs_srcdir@
20 # C Compiler and options for use in building executables that
21 # will run on the platform that is doing the build.
23 BCC = @BUILD_CC@ @BUILD_CFLAGS@
25 # TCC is the C Compile and options for use in building executables that
26 # will run on the target platform. (BCC and TCC are usually the
27 # same unless your are cross-compiling.) Separate CC and CFLAGS macros
28 # are provide so that these aspects of the build process can be changed
29 # on the "make" command-line. Ex: "make CC=clang CFLAGS=-fsanitize=undefined"
31 CC = @CC@
32 CFLAGS = @CPPFLAGS@ @CFLAGS@
33 TCC = $(CC) $(CFLAGS) -I. -I${TOP}/src -I${TOP}/ext/rtree -I${TOP}/ext/fts3
35 # Define this for the autoconf-based build, so that the code knows it can
36 # include the generated config.h
38 TCC += -D_HAVE_SQLITE_CONFIG_H -DBUILD_sqlite
40 # Define -DNDEBUG to compile without debugging (i.e., for production usage)
41 # Omitting the define will cause extra debugging code to be inserted and
42 # includes extra comments when "EXPLAIN stmt" is used.
44 TCC += @TARGET_DEBUG@
46 # Compiler options needed for programs that use the TCL library.
48 TCC += @TCL_INCLUDE_SPEC@
50 # The library that programs using TCL must link against.
52 LIBTCL = @TCL_LIB_SPEC@
54 # Compiler options needed for programs that use the readline() library.
56 READLINE_FLAGS = -DHAVE_READLINE=@TARGET_HAVE_READLINE@ @TARGET_READLINE_INC@
57 READLINE_FLAGS += -DHAVE_EDITLINE=@TARGET_HAVE_EDITLINE@
59 # The library that programs using readline() must link against.
61 LIBREADLINE = @TARGET_READLINE_LIBS@
63 # Should the database engine be compiled threadsafe
65 TCC += -DSQLITE_THREADSAFE=@SQLITE_THREADSAFE@
67 # Any target libraries which libsqlite must be linked against
69 TLIBS = @LIBS@ $(LIBS)
71 # Flags controlling use of the in memory btree implementation
73 # SQLITE_TEMP_STORE is 0 to force temporary tables to be in a file, 1 to
74 # default to file, 2 to default to memory, and 3 to force temporary
75 # tables to always be in memory.
77 TEMP_STORE = -DSQLITE_TEMP_STORE=@TEMP_STORE@
79 # Enable/disable loadable extensions, and other optional features
80 # based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*).
81 # The same set of OMIT and ENABLE flags should be passed to the
82 # LEMON parser generator and the mkkeywordhash tool as well.
83 OPT_FEATURE_FLAGS = @OPT_FEATURE_FLAGS@
85 TCC += $(OPT_FEATURE_FLAGS)
87 # Add in any optional parameters specified on the make commane line
88 # ie. make "OPTS=-DSQLITE_ENABLE_FOO=1 -DSQLITE_OMIT_FOO=1".
89 TCC += $(OPTS)
91 # Version numbers and release number for the SQLite being compiled.
93 VERSION = @VERSION@
94 VERSION_NUMBER = @VERSION_NUMBER@
95 RELEASE = @RELEASE@
97 # Filename extensions
99 BEXE = @BUILD_EXEEXT@
100 TEXE = @TARGET_EXEEXT@
102 # The following variable is "1" if the configure script was able to locate
103 # the tclConfig.sh file. It is an empty string otherwise. When this
104 # variable is "1", the TCL extension library (libtclsqlite3.so) is built
105 # and installed.
107 HAVE_TCL = @HAVE_TCL@
109 # This is the command to use for tclsh - normally just "tclsh", but we may
110 # know the specific version we want to use
112 TCLSH_CMD = @TCLSH_CMD@
114 # Where do we want to install the tcl plugin
116 TCLLIBDIR = @TCLLIBDIR@
118 # The suffix used on shared libraries. Ex: ".dll", ".so", ".dylib"
120 SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@
122 # If gcov support was enabled by the configure script, add the appropriate
123 # flags here. It's not always as easy as just having the user add the right
124 # CFLAGS / LDFLAGS, because libtool wants to use CFLAGS when linking, which
125 # causes build errors with -fprofile-arcs -ftest-coverage with some GCCs.
126 # Supposedly GCC does the right thing if you use --coverage, but in
127 # practice it still fails. See:
129 # http://www.mail-archive.com/debian-gcc@lists.debian.org/msg26197.html
131 # for more info.
133 GCOV_CFLAGS1 = -DSQLITE_COVERAGE_TEST=1 -fprofile-arcs -ftest-coverage
134 GCOV_LDFLAGS1 = -lgcov
135 USE_GCOV = @USE_GCOV@
136 LTCOMPILE_EXTRAS += $(GCOV_CFLAGS$(USE_GCOV))
137 LTLINK_EXTRAS += $(GCOV_LDFLAGS$(USE_GCOV))
140 # The directory into which to store package information for
142 # Some standard variables and programs
144 prefix = @prefix@
145 exec_prefix = @exec_prefix@
146 libdir = @libdir@
147 pkgconfigdir = $(libdir)/pkgconfig
148 bindir = @bindir@
149 includedir = @includedir@
150 INSTALL = @INSTALL@
151 LIBTOOL = ./libtool
152 ALLOWRELEASE = @ALLOWRELEASE@
154 # libtool compile/link/install
155 LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(TCC) $(LTCOMPILE_EXTRAS)
156 LTLINK = $(LIBTOOL) --mode=link $(TCC) $(LTCOMPILE_EXTRAS) @LDFLAGS@ $(LTLINK_EXTRAS)
157 LTINSTALL = $(LIBTOOL) --mode=install $(INSTALL)
159 # You should not have to change anything below this line
160 ###############################################################################
162 USE_AMALGAMATION = @USE_AMALGAMATION@
164 # Object files for the SQLite library (non-amalgamation).
166 LIBOBJS0 = alter.lo analyze.lo attach.lo auth.lo \
167 backup.lo bitvec.lo btmutex.lo btree.lo build.lo \
168 callback.lo complete.lo ctime.lo date.lo dbstat.lo delete.lo \
169 expr.lo fault.lo fkey.lo \
170 fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo \
171 fts3_porter.lo fts3_snippet.lo fts3_tokenizer.lo fts3_tokenizer1.lo \
172 fts3_tokenize_vtab.lo \
173 fts3_unicode.lo fts3_unicode2.lo fts3_write.lo \
174 fts5.lo \
175 func.lo global.lo hash.lo \
176 icu.lo insert.lo journal.lo json1.lo legacy.lo loadext.lo \
177 main.lo malloc.lo mem0.lo mem1.lo mem2.lo mem3.lo mem5.lo \
178 memjournal.lo \
179 mutex.lo mutex_noop.lo mutex_unix.lo mutex_w32.lo \
180 notify.lo opcodes.lo os.lo os_unix.lo os_win.lo \
181 pager.lo parse.lo pcache.lo pcache1.lo pragma.lo prepare.lo printf.lo \
182 random.lo resolve.lo rowset.lo rtree.lo select.lo sqlite3rbu.lo status.lo \
183 table.lo threads.lo tokenize.lo treeview.lo trigger.lo \
184 update.lo util.lo vacuum.lo \
185 vdbe.lo vdbeapi.lo vdbeaux.lo vdbeblob.lo vdbemem.lo vdbesort.lo \
186 vdbetrace.lo wal.lo walker.lo where.lo wherecode.lo whereexpr.lo \
187 utf.lo vtab.lo
189 # Object files for the amalgamation.
191 LIBOBJS1 = sqlite3.lo
193 # Determine the real value of LIBOBJ based on the 'configure' script
195 LIBOBJ = $(LIBOBJS$(USE_AMALGAMATION))
198 # All of the source code files.
200 SRC = \
201 $(TOP)/src/alter.c \
202 $(TOP)/src/analyze.c \
203 $(TOP)/src/attach.c \
204 $(TOP)/src/auth.c \
205 $(TOP)/src/backup.c \
206 $(TOP)/src/bitvec.c \
207 $(TOP)/src/btmutex.c \
208 $(TOP)/src/btree.c \
209 $(TOP)/src/btree.h \
210 $(TOP)/src/btreeInt.h \
211 $(TOP)/src/build.c \
212 $(TOP)/src/callback.c \
213 $(TOP)/src/complete.c \
214 $(TOP)/src/ctime.c \
215 $(TOP)/src/date.c \
216 $(TOP)/src/dbstat.c \
217 $(TOP)/src/delete.c \
218 $(TOP)/src/expr.c \
219 $(TOP)/src/fault.c \
220 $(TOP)/src/fkey.c \
221 $(TOP)/src/func.c \
222 $(TOP)/src/global.c \
223 $(TOP)/src/hash.c \
224 $(TOP)/src/hash.h \
225 $(TOP)/src/hwtime.h \
226 $(TOP)/src/insert.c \
227 $(TOP)/src/journal.c \
228 $(TOP)/src/legacy.c \
229 $(TOP)/src/loadext.c \
230 $(TOP)/src/main.c \
231 $(TOP)/src/malloc.c \
232 $(TOP)/src/mem0.c \
233 $(TOP)/src/mem1.c \
234 $(TOP)/src/mem2.c \
235 $(TOP)/src/mem3.c \
236 $(TOP)/src/mem5.c \
237 $(TOP)/src/memjournal.c \
238 $(TOP)/src/msvc.h \
239 $(TOP)/src/mutex.c \
240 $(TOP)/src/mutex.h \
241 $(TOP)/src/mutex_noop.c \
242 $(TOP)/src/mutex_unix.c \
243 $(TOP)/src/mutex_w32.c \
244 $(TOP)/src/notify.c \
245 $(TOP)/src/os.c \
246 $(TOP)/src/os.h \
247 $(TOP)/src/os_common.h \
248 $(TOP)/src/os_setup.h \
249 $(TOP)/src/os_unix.c \
250 $(TOP)/src/os_win.c \
251 $(TOP)/src/os_win.h \
252 $(TOP)/src/pager.c \
253 $(TOP)/src/pager.h \
254 $(TOP)/src/parse.y \
255 $(TOP)/src/pcache.c \
256 $(TOP)/src/pcache.h \
257 $(TOP)/src/pcache1.c \
258 $(TOP)/src/pragma.c \
259 $(TOP)/src/pragma.h \
260 $(TOP)/src/prepare.c \
261 $(TOP)/src/printf.c \
262 $(TOP)/src/random.c \
263 $(TOP)/src/resolve.c \
264 $(TOP)/src/rowset.c \
265 $(TOP)/src/select.c \
266 $(TOP)/src/status.c \
267 $(TOP)/src/shell.c \
268 $(TOP)/src/sqlite.h.in \
269 $(TOP)/src/sqlite3ext.h \
270 $(TOP)/src/sqliteInt.h \
271 $(TOP)/src/sqliteLimit.h \
272 $(TOP)/src/table.c \
273 $(TOP)/src/tclsqlite.c \
274 $(TOP)/src/threads.c \
275 $(TOP)/src/tokenize.c \
276 $(TOP)/src/treeview.c \
277 $(TOP)/src/trigger.c \
278 $(TOP)/src/utf.c \
279 $(TOP)/src/update.c \
280 $(TOP)/src/util.c \
281 $(TOP)/src/vacuum.c \
282 $(TOP)/src/vdbe.c \
283 $(TOP)/src/vdbe.h \
284 $(TOP)/src/vdbeapi.c \
285 $(TOP)/src/vdbeaux.c \
286 $(TOP)/src/vdbeblob.c \
287 $(TOP)/src/vdbemem.c \
288 $(TOP)/src/vdbesort.c \
289 $(TOP)/src/vdbetrace.c \
290 $(TOP)/src/vdbeInt.h \
291 $(TOP)/src/vtab.c \
292 $(TOP)/src/vxworks.h \
293 $(TOP)/src/wal.c \
294 $(TOP)/src/wal.h \
295 $(TOP)/src/walker.c \
296 $(TOP)/src/where.c \
297 $(TOP)/src/wherecode.c \
298 $(TOP)/src/whereexpr.c \
299 $(TOP)/src/whereInt.h
301 # Source code for extensions
303 SRC += \
304 $(TOP)/ext/fts1/fts1.c \
305 $(TOP)/ext/fts1/fts1.h \
306 $(TOP)/ext/fts1/fts1_hash.c \
307 $(TOP)/ext/fts1/fts1_hash.h \
308 $(TOP)/ext/fts1/fts1_porter.c \
309 $(TOP)/ext/fts1/fts1_tokenizer.h \
310 $(TOP)/ext/fts1/fts1_tokenizer1.c
311 SRC += \
312 $(TOP)/ext/fts2/fts2.c \
313 $(TOP)/ext/fts2/fts2.h \
314 $(TOP)/ext/fts2/fts2_hash.c \
315 $(TOP)/ext/fts2/fts2_hash.h \
316 $(TOP)/ext/fts2/fts2_icu.c \
317 $(TOP)/ext/fts2/fts2_porter.c \
318 $(TOP)/ext/fts2/fts2_tokenizer.h \
319 $(TOP)/ext/fts2/fts2_tokenizer.c \
320 $(TOP)/ext/fts2/fts2_tokenizer1.c
321 SRC += \
322 $(TOP)/ext/fts3/fts3.c \
323 $(TOP)/ext/fts3/fts3.h \
324 $(TOP)/ext/fts3/fts3Int.h \
325 $(TOP)/ext/fts3/fts3_aux.c \
326 $(TOP)/ext/fts3/fts3_expr.c \
327 $(TOP)/ext/fts3/fts3_hash.c \
328 $(TOP)/ext/fts3/fts3_hash.h \
329 $(TOP)/ext/fts3/fts3_icu.c \
330 $(TOP)/ext/fts3/fts3_porter.c \
331 $(TOP)/ext/fts3/fts3_snippet.c \
332 $(TOP)/ext/fts3/fts3_tokenizer.h \
333 $(TOP)/ext/fts3/fts3_tokenizer.c \
334 $(TOP)/ext/fts3/fts3_tokenizer1.c \
335 $(TOP)/ext/fts3/fts3_tokenize_vtab.c \
336 $(TOP)/ext/fts3/fts3_unicode.c \
337 $(TOP)/ext/fts3/fts3_unicode2.c \
338 $(TOP)/ext/fts3/fts3_write.c
339 SRC += \
340 $(TOP)/ext/icu/sqliteicu.h \
341 $(TOP)/ext/icu/icu.c
342 SRC += \
343 $(TOP)/ext/rtree/rtree.h \
344 $(TOP)/ext/rtree/rtree.c
345 SRC += \
346 $(TOP)/ext/rbu/sqlite3rbu.h \
347 $(TOP)/ext/rbu/sqlite3rbu.c
348 SRC += \
349 $(TOP)/ext/misc/json1.c
353 # Generated source code files
355 SRC += \
356 keywordhash.h \
357 opcodes.c \
358 opcodes.h \
359 parse.c \
360 parse.h \
361 config.h \
362 sqlite3.h
364 # Source code to the test files.
366 TESTSRC = \
367 $(TOP)/src/test1.c \
368 $(TOP)/src/test2.c \
369 $(TOP)/src/test3.c \
370 $(TOP)/src/test4.c \
371 $(TOP)/src/test5.c \
372 $(TOP)/src/test6.c \
373 $(TOP)/src/test7.c \
374 $(TOP)/src/test8.c \
375 $(TOP)/src/test9.c \
376 $(TOP)/src/test_autoext.c \
377 $(TOP)/src/test_async.c \
378 $(TOP)/src/test_backup.c \
379 $(TOP)/src/test_blob.c \
380 $(TOP)/src/test_btree.c \
381 $(TOP)/src/test_config.c \
382 $(TOP)/src/test_demovfs.c \
383 $(TOP)/src/test_devsym.c \
384 $(TOP)/src/test_fs.c \
385 $(TOP)/src/test_func.c \
386 $(TOP)/src/test_hexio.c \
387 $(TOP)/src/test_init.c \
388 $(TOP)/src/test_intarray.c \
389 $(TOP)/src/test_journal.c \
390 $(TOP)/src/test_malloc.c \
391 $(TOP)/src/test_multiplex.c \
392 $(TOP)/src/test_mutex.c \
393 $(TOP)/src/test_onefile.c \
394 $(TOP)/src/test_osinst.c \
395 $(TOP)/src/test_pcache.c \
396 $(TOP)/src/test_quota.c \
397 $(TOP)/src/test_rtree.c \
398 $(TOP)/src/test_schema.c \
399 $(TOP)/src/test_server.c \
400 $(TOP)/src/test_superlock.c \
401 $(TOP)/src/test_syscall.c \
402 $(TOP)/src/test_tclvar.c \
403 $(TOP)/src/test_thread.c \
404 $(TOP)/src/test_vfs.c \
405 $(TOP)/src/test_windirent.c \
406 $(TOP)/src/test_wsd.c \
407 $(TOP)/ext/fts3/fts3_term.c \
408 $(TOP)/ext/fts3/fts3_test.c \
409 $(TOP)/ext/rbu/test_rbu.c
411 # Statically linked extensions
413 TESTSRC += \
414 $(TOP)/ext/misc/amatch.c \
415 $(TOP)/ext/misc/closure.c \
416 $(TOP)/ext/misc/eval.c \
417 $(TOP)/ext/misc/fileio.c \
418 $(TOP)/ext/misc/fuzzer.c \
419 $(TOP)/ext/fts5/fts5_tcl.c \
420 $(TOP)/ext/fts5/fts5_test_mi.c \
421 $(TOP)/ext/fts5/fts5_test_tok.c \
422 $(TOP)/ext/misc/ieee754.c \
423 $(TOP)/ext/misc/nextchar.c \
424 $(TOP)/ext/misc/percentile.c \
425 $(TOP)/ext/misc/regexp.c \
426 $(TOP)/ext/misc/series.c \
427 $(TOP)/ext/misc/spellfix.c \
428 $(TOP)/ext/misc/totype.c \
429 $(TOP)/ext/misc/wholenumber.c
431 # Source code to the library files needed by the test fixture
433 TESTSRC2 = \
434 $(TOP)/src/attach.c \
435 $(TOP)/src/backup.c \
436 $(TOP)/src/bitvec.c \
437 $(TOP)/src/btree.c \
438 $(TOP)/src/build.c \
439 $(TOP)/src/ctime.c \
440 $(TOP)/src/date.c \
441 $(TOP)/src/dbstat.c \
442 $(TOP)/src/expr.c \
443 $(TOP)/src/func.c \
444 $(TOP)/src/insert.c \
445 $(TOP)/src/wal.c \
446 $(TOP)/src/main.c \
447 $(TOP)/src/mem5.c \
448 $(TOP)/src/os.c \
449 $(TOP)/src/os_unix.c \
450 $(TOP)/src/os_win.c \
451 $(TOP)/src/pager.c \
452 $(TOP)/src/pragma.c \
453 $(TOP)/src/prepare.c \
454 $(TOP)/src/printf.c \
455 $(TOP)/src/random.c \
456 $(TOP)/src/pcache.c \
457 $(TOP)/src/pcache1.c \
458 $(TOP)/src/select.c \
459 $(TOP)/src/tokenize.c \
460 $(TOP)/src/utf.c \
461 $(TOP)/src/util.c \
462 $(TOP)/src/vdbeapi.c \
463 $(TOP)/src/vdbeaux.c \
464 $(TOP)/src/vdbe.c \
465 $(TOP)/src/vdbemem.c \
466 $(TOP)/src/vdbetrace.c \
467 $(TOP)/src/where.c \
468 $(TOP)/src/wherecode.c \
469 $(TOP)/src/whereexpr.c \
470 parse.c \
471 $(TOP)/ext/fts3/fts3.c \
472 $(TOP)/ext/fts3/fts3_aux.c \
473 $(TOP)/ext/fts3/fts3_expr.c \
474 $(TOP)/ext/fts3/fts3_term.c \
475 $(TOP)/ext/fts3/fts3_tokenizer.c \
476 $(TOP)/ext/fts3/fts3_write.c \
477 $(TOP)/ext/async/sqlite3async.c
479 # Header files used by all library source files.
481 HDR = \
482 $(TOP)/src/btree.h \
483 $(TOP)/src/btreeInt.h \
484 $(TOP)/src/hash.h \
485 $(TOP)/src/hwtime.h \
486 keywordhash.h \
487 $(TOP)/src/msvc.h \
488 $(TOP)/src/mutex.h \
489 opcodes.h \
490 $(TOP)/src/os.h \
491 $(TOP)/src/os_common.h \
492 $(TOP)/src/os_setup.h \
493 $(TOP)/src/os_win.h \
494 $(TOP)/src/pager.h \
495 $(TOP)/src/pcache.h \
496 parse.h \
497 $(TOP)/src/pragma.h \
498 sqlite3.h \
499 $(TOP)/src/sqlite3ext.h \
500 $(TOP)/src/sqliteInt.h \
501 $(TOP)/src/sqliteLimit.h \
502 $(TOP)/src/vdbe.h \
503 $(TOP)/src/vdbeInt.h \
504 $(TOP)/src/vxworks.h \
505 $(TOP)/src/whereInt.h \
506 config.h
508 # Header files used by extensions
510 EXTHDR += \
511 $(TOP)/ext/fts1/fts1.h \
512 $(TOP)/ext/fts1/fts1_hash.h \
513 $(TOP)/ext/fts1/fts1_tokenizer.h
514 EXTHDR += \
515 $(TOP)/ext/fts2/fts2.h \
516 $(TOP)/ext/fts2/fts2_hash.h \
517 $(TOP)/ext/fts2/fts2_tokenizer.h
518 EXTHDR += \
519 $(TOP)/ext/fts3/fts3.h \
520 $(TOP)/ext/fts3/fts3Int.h \
521 $(TOP)/ext/fts3/fts3_hash.h \
522 $(TOP)/ext/fts3/fts3_tokenizer.h
523 EXTHDR += \
524 $(TOP)/ext/rtree/rtree.h
525 EXTHDR += \
526 $(TOP)/ext/icu/sqliteicu.h
527 EXTHDR += \
528 $(TOP)/ext/rtree/sqlite3rtree.h
530 # executables needed for testing
532 TESTPROGS = \
533 testfixture$(TEXE) \
534 sqlite3$(TEXE) \
535 sqlite3_analyzer$(TEXE) \
536 sqldiff$(TEXE)
538 # Databases containing fuzzer test cases
540 FUZZDATA = \
541 $(TOP)/test/fuzzdata1.db \
542 $(TOP)/test/fuzzdata2.db \
543 $(TOP)/test/fuzzdata3.db \
544 $(TOP)/test/fuzzdata4.db
546 # Standard options to testfixture
548 TESTOPTS = --verbose=file --output=test-out.txt
550 # Extra compiler options for various shell tools
552 SHELL_OPT = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS4
553 SHELL_OPT += -DSQLITE_ENABLE_EXPLAIN_COMMENTS
554 FUZZERSHELL_OPT = -DSQLITE_ENABLE_JSON1
555 FUZZCHECK_OPT = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMSYS5
557 # This is the default Makefile target. The objects listed here
558 # are what get build when you type just "make" with no arguments.
560 all: sqlite3.h libsqlite3.la sqlite3$(TEXE) $(HAVE_TCL:1=libtclsqlite3.la)
562 Makefile: $(TOP)/Makefile.in
563 ./config.status
565 sqlite3.pc: $(TOP)/sqlite3.pc.in
566 ./config.status
568 libsqlite3.la: $(LIBOBJ)
569 $(LTLINK) -no-undefined -o $@ $(LIBOBJ) $(TLIBS) \
570 ${ALLOWRELEASE} -rpath "$(libdir)" -version-info "8:6:8"
572 libtclsqlite3.la: tclsqlite.lo libsqlite3.la
573 $(LTLINK) -no-undefined -o $@ tclsqlite.lo \
574 libsqlite3.la @TCL_STUB_LIB_SPEC@ $(TLIBS) \
575 -rpath "$(TCLLIBDIR)" \
576 -version-info "8:6:8" \
577 -avoid-version
579 sqlite3$(TEXE): $(TOP)/src/shell.c sqlite3.c
580 $(LTLINK) $(READLINE_FLAGS) $(SHELL_OPT) -o $@ \
581 $(TOP)/src/shell.c sqlite3.c \
582 $(LIBREADLINE) $(TLIBS) -rpath "$(libdir)"
584 sqldiff$(TEXE): $(TOP)/tool/sqldiff.c sqlite3.c sqlite3.h
585 $(LTLINK) -o $@ $(TOP)/tool/sqldiff.c sqlite3.c $(TLIBS)
587 srcck1$(BEXE): $(TOP)/tool/srcck1.c
588 $(BCC) -o srcck1$(BEXE) $(TOP)/tool/srcck1.c
590 sourcetest: srcck1$(BEXE) sqlite3.c
591 ./srcck1 sqlite3.c
593 fuzzershell$(TEXE): $(TOP)/tool/fuzzershell.c sqlite3.c sqlite3.h
594 $(LTLINK) -o $@ $(FUZZERSHELL_OPT) \
595 $(TOP)/tool/fuzzershell.c sqlite3.c $(TLIBS)
597 fuzzcheck$(TEXE): $(TOP)/test/fuzzcheck.c sqlite3.c sqlite3.h
598 $(LTLINK) -o $@ $(FUZZCHECK_OPT) $(TOP)/test/fuzzcheck.c sqlite3.c $(TLIBS)
600 mptester$(TEXE): sqlite3.c $(TOP)/mptest/mptest.c
601 $(LTLINK) -o $@ -I. $(TOP)/mptest/mptest.c sqlite3.c \
602 $(TLIBS) -rpath "$(libdir)"
604 MPTEST1=./mptester$(TEXE) mptest.db $(TOP)/mptest/crash01.test --repeat 20
605 MPTEST2=./mptester$(TEXE) mptest.db $(TOP)/mptest/multiwrite01.test --repeat 20
606 mptest: mptester$(TEXE)
607 rm -f mptest.db
608 $(MPTEST1) --journalmode DELETE
609 $(MPTEST2) --journalmode WAL
610 $(MPTEST1) --journalmode WAL
611 $(MPTEST2) --journalmode PERSIST
612 $(MPTEST1) --journalmode PERSIST
613 $(MPTEST2) --journalmode TRUNCATE
614 $(MPTEST1) --journalmode TRUNCATE
615 $(MPTEST2) --journalmode DELETE
618 # This target creates a directory named "tsrc" and fills it with
619 # copies of all of the C source code and header files needed to
620 # build on the target system. Some of the C source code and header
621 # files are automatically generated. This target takes care of
622 # all that automatic generation.
624 .target_source: $(SRC) $(TOP)/tool/vdbe-compress.tcl fts5.c
625 rm -rf tsrc
626 mkdir tsrc
627 cp -f $(SRC) tsrc
628 rm tsrc/sqlite.h.in tsrc/parse.y
629 $(TCLSH_CMD) $(TOP)/tool/vdbe-compress.tcl $(OPTS) <tsrc/vdbe.c >vdbe.new
630 mv vdbe.new tsrc/vdbe.c
631 cp fts5.c fts5.h tsrc
632 touch .target_source
634 sqlite3.c: .target_source $(TOP)/tool/mksqlite3c.tcl
635 $(TCLSH_CMD) $(TOP)/tool/mksqlite3c.tcl
636 cp tsrc/shell.c tsrc/sqlite3ext.h .
638 sqlite3ext.h: .target_source
639 cp tsrc/sqlite3ext.h .
641 tclsqlite3.c: sqlite3.c
642 echo '#ifndef USE_SYSTEM_SQLITE' >tclsqlite3.c
643 cat sqlite3.c >>tclsqlite3.c
644 echo '#endif /* USE_SYSTEM_SQLITE */' >>tclsqlite3.c
645 cat $(TOP)/src/tclsqlite.c >>tclsqlite3.c
647 sqlite3-all.c: sqlite3.c $(TOP)/tool/split-sqlite3c.tcl
648 $(TCLSH_CMD) $(TOP)/tool/split-sqlite3c.tcl
650 # Rule to build the amalgamation
652 sqlite3.lo: sqlite3.c
653 $(LTCOMPILE) $(TEMP_STORE) -c sqlite3.c
655 # Rules to build the LEMON compiler generator
657 lemon$(BEXE): $(TOP)/tool/lemon.c $(TOP)/tool/lempar.c
658 $(BCC) -o $@ $(TOP)/tool/lemon.c
659 cp $(TOP)/tool/lempar.c .
661 # Rules to build individual *.o files from generated *.c files. This
662 # applies to:
664 # parse.o
665 # opcodes.o
667 parse.lo: parse.c $(HDR)
668 $(LTCOMPILE) $(TEMP_STORE) -c parse.c
670 opcodes.lo: opcodes.c
671 $(LTCOMPILE) $(TEMP_STORE) -c opcodes.c
673 # Rules to build individual *.o files from files in the src directory.
675 alter.lo: $(TOP)/src/alter.c $(HDR)
676 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/alter.c
678 analyze.lo: $(TOP)/src/analyze.c $(HDR)
679 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/analyze.c
681 attach.lo: $(TOP)/src/attach.c $(HDR)
682 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/attach.c
684 auth.lo: $(TOP)/src/auth.c $(HDR)
685 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/auth.c
687 backup.lo: $(TOP)/src/backup.c $(HDR)
688 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/backup.c
690 bitvec.lo: $(TOP)/src/bitvec.c $(HDR)
691 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/bitvec.c
693 btmutex.lo: $(TOP)/src/btmutex.c $(HDR)
694 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/btmutex.c
696 btree.lo: $(TOP)/src/btree.c $(HDR) $(TOP)/src/pager.h
697 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/btree.c
699 build.lo: $(TOP)/src/build.c $(HDR)
700 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/build.c
702 callback.lo: $(TOP)/src/callback.c $(HDR)
703 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/callback.c
705 complete.lo: $(TOP)/src/complete.c $(HDR)
706 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/complete.c
708 ctime.lo: $(TOP)/src/ctime.c $(HDR)
709 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/ctime.c
711 date.lo: $(TOP)/src/date.c $(HDR)
712 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/date.c
714 dbstat.lo: $(TOP)/src/dbstat.c $(HDR)
715 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/dbstat.c
717 delete.lo: $(TOP)/src/delete.c $(HDR)
718 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/delete.c
720 expr.lo: $(TOP)/src/expr.c $(HDR)
721 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/expr.c
723 fault.lo: $(TOP)/src/fault.c $(HDR)
724 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/fault.c
726 fkey.lo: $(TOP)/src/fkey.c $(HDR)
727 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/fkey.c
729 func.lo: $(TOP)/src/func.c $(HDR)
730 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/func.c
732 global.lo: $(TOP)/src/global.c $(HDR)
733 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/global.c
735 hash.lo: $(TOP)/src/hash.c $(HDR)
736 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/hash.c
738 insert.lo: $(TOP)/src/insert.c $(HDR)
739 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/insert.c
741 journal.lo: $(TOP)/src/journal.c $(HDR)
742 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/journal.c
744 legacy.lo: $(TOP)/src/legacy.c $(HDR)
745 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/legacy.c
747 loadext.lo: $(TOP)/src/loadext.c $(HDR)
748 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/loadext.c
750 main.lo: $(TOP)/src/main.c $(HDR)
751 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/main.c
753 malloc.lo: $(TOP)/src/malloc.c $(HDR)
754 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/malloc.c
756 mem0.lo: $(TOP)/src/mem0.c $(HDR)
757 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem0.c
759 mem1.lo: $(TOP)/src/mem1.c $(HDR)
760 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem1.c
762 mem2.lo: $(TOP)/src/mem2.c $(HDR)
763 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem2.c
765 mem3.lo: $(TOP)/src/mem3.c $(HDR)
766 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem3.c
768 mem5.lo: $(TOP)/src/mem5.c $(HDR)
769 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem5.c
771 memjournal.lo: $(TOP)/src/memjournal.c $(HDR)
772 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/memjournal.c
774 mutex.lo: $(TOP)/src/mutex.c $(HDR)
775 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex.c
777 mutex_noop.lo: $(TOP)/src/mutex_noop.c $(HDR)
778 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex_noop.c
780 mutex_unix.lo: $(TOP)/src/mutex_unix.c $(HDR)
781 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex_unix.c
783 mutex_w32.lo: $(TOP)/src/mutex_w32.c $(HDR)
784 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex_w32.c
786 notify.lo: $(TOP)/src/notify.c $(HDR)
787 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/notify.c
789 pager.lo: $(TOP)/src/pager.c $(HDR) $(TOP)/src/pager.h
790 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pager.c
792 pcache.lo: $(TOP)/src/pcache.c $(HDR) $(TOP)/src/pcache.h
793 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pcache.c
795 pcache1.lo: $(TOP)/src/pcache1.c $(HDR) $(TOP)/src/pcache.h
796 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pcache1.c
798 os.lo: $(TOP)/src/os.c $(HDR)
799 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os.c
801 os_unix.lo: $(TOP)/src/os_unix.c $(HDR)
802 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os_unix.c
804 os_win.lo: $(TOP)/src/os_win.c $(HDR)
805 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os_win.c
807 pragma.lo: $(TOP)/src/pragma.c $(HDR)
808 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pragma.c
810 prepare.lo: $(TOP)/src/prepare.c $(HDR)
811 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/prepare.c
813 printf.lo: $(TOP)/src/printf.c $(HDR)
814 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/printf.c
816 random.lo: $(TOP)/src/random.c $(HDR)
817 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/random.c
819 resolve.lo: $(TOP)/src/resolve.c $(HDR)
820 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/resolve.c
822 rowset.lo: $(TOP)/src/rowset.c $(HDR)
823 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/rowset.c
825 select.lo: $(TOP)/src/select.c $(HDR)
826 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/select.c
828 status.lo: $(TOP)/src/status.c $(HDR)
829 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/status.c
831 table.lo: $(TOP)/src/table.c $(HDR)
832 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/table.c
834 threads.lo: $(TOP)/src/threads.c $(HDR)
835 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/threads.c
837 tokenize.lo: $(TOP)/src/tokenize.c keywordhash.h $(HDR)
838 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/tokenize.c
840 treeview.lo: $(TOP)/src/treeview.c $(HDR)
841 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/treeview.c
843 trigger.lo: $(TOP)/src/trigger.c $(HDR)
844 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/trigger.c
846 update.lo: $(TOP)/src/update.c $(HDR)
847 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/update.c
849 utf.lo: $(TOP)/src/utf.c $(HDR)
850 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/utf.c
852 util.lo: $(TOP)/src/util.c $(HDR)
853 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/util.c
855 vacuum.lo: $(TOP)/src/vacuum.c $(HDR)
856 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vacuum.c
858 vdbe.lo: $(TOP)/src/vdbe.c $(HDR)
859 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbe.c
861 vdbeapi.lo: $(TOP)/src/vdbeapi.c $(HDR)
862 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbeapi.c
864 vdbeaux.lo: $(TOP)/src/vdbeaux.c $(HDR)
865 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbeaux.c
867 vdbeblob.lo: $(TOP)/src/vdbeblob.c $(HDR)
868 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbeblob.c
870 vdbemem.lo: $(TOP)/src/vdbemem.c $(HDR)
871 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbemem.c
873 vdbesort.lo: $(TOP)/src/vdbesort.c $(HDR)
874 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbesort.c
876 vdbetrace.lo: $(TOP)/src/vdbetrace.c $(HDR)
877 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbetrace.c
879 vtab.lo: $(TOP)/src/vtab.c $(HDR)
880 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vtab.c
882 wal.lo: $(TOP)/src/wal.c $(HDR)
883 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/wal.c
885 walker.lo: $(TOP)/src/walker.c $(HDR)
886 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/walker.c
888 where.lo: $(TOP)/src/where.c $(HDR)
889 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/where.c
891 wherecode.lo: $(TOP)/src/wherecode.c $(HDR)
892 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/wherecode.c
894 whereexpr.lo: $(TOP)/src/whereexpr.c $(HDR)
895 $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/whereexpr.c
897 tclsqlite.lo: $(TOP)/src/tclsqlite.c $(HDR)
898 $(LTCOMPILE) -DUSE_TCL_STUBS=1 -c $(TOP)/src/tclsqlite.c
900 tclsqlite-shell.lo: $(TOP)/src/tclsqlite.c $(HDR)
901 $(LTCOMPILE) -DTCLSH=1 -o $@ -c $(TOP)/src/tclsqlite.c
903 tclsqlite-stubs.lo: $(TOP)/src/tclsqlite.c $(HDR)
904 $(LTCOMPILE) -DUSE_TCL_STUBS=1 -o $@ -c $(TOP)/src/tclsqlite.c
906 tclsqlite3$(TEXE): tclsqlite-shell.lo libsqlite3.la
907 $(LTLINK) -o $@ tclsqlite-shell.lo \
908 libsqlite3.la $(LIBTCL)
910 # Rules to build opcodes.c and opcodes.h
912 opcodes.c: opcodes.h $(TOP)/tool/mkopcodec.tcl
913 $(TCLSH_CMD) $(TOP)/tool/mkopcodec.tcl opcodes.h >opcodes.c
915 opcodes.h: parse.h $(TOP)/src/vdbe.c $(TOP)/tool/mkopcodeh.tcl
916 cat parse.h $(TOP)/src/vdbe.c | $(TCLSH_CMD) $(TOP)/tool/mkopcodeh.tcl >opcodes.h
918 # Rules to build parse.c and parse.h - the outputs of lemon.
920 parse.h: parse.c
922 parse.c: $(TOP)/src/parse.y lemon$(BEXE) $(TOP)/tool/addopcodes.tcl
923 cp $(TOP)/src/parse.y .
924 rm -f parse.h
925 ./lemon$(BEXE) $(OPT_FEATURE_FLAGS) $(OPTS) parse.y
926 mv parse.h parse.h.temp
927 $(TCLSH_CMD) $(TOP)/tool/addopcodes.tcl parse.h.temp >parse.h
929 sqlite3.h: $(TOP)/src/sqlite.h.in $(TOP)/manifest.uuid $(TOP)/VERSION
930 $(TCLSH_CMD) $(TOP)/tool/mksqlite3h.tcl $(TOP) >sqlite3.h
932 keywordhash.h: $(TOP)/tool/mkkeywordhash.c
933 $(BCC) -o mkkeywordhash$(BEXE) $(OPT_FEATURE_FLAGS) $(OPTS) $(TOP)/tool/mkkeywordhash.c
934 ./mkkeywordhash$(BEXE) >keywordhash.h
938 # Rules to build the extension objects.
940 icu.lo: $(TOP)/ext/icu/icu.c $(HDR) $(EXTHDR)
941 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/icu/icu.c
943 fts2.lo: $(TOP)/ext/fts2/fts2.c $(HDR) $(EXTHDR)
944 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2.c
946 fts2_hash.lo: $(TOP)/ext/fts2/fts2_hash.c $(HDR) $(EXTHDR)
947 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_hash.c
949 fts2_icu.lo: $(TOP)/ext/fts2/fts2_icu.c $(HDR) $(EXTHDR)
950 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_icu.c
952 fts2_porter.lo: $(TOP)/ext/fts2/fts2_porter.c $(HDR) $(EXTHDR)
953 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_porter.c
955 fts2_tokenizer.lo: $(TOP)/ext/fts2/fts2_tokenizer.c $(HDR) $(EXTHDR)
956 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_tokenizer.c
958 fts2_tokenizer1.lo: $(TOP)/ext/fts2/fts2_tokenizer1.c $(HDR) $(EXTHDR)
959 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_tokenizer1.c
961 fts3.lo: $(TOP)/ext/fts3/fts3.c $(HDR) $(EXTHDR)
962 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3.c
964 fts3_aux.lo: $(TOP)/ext/fts3/fts3_aux.c $(HDR) $(EXTHDR)
965 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_aux.c
967 fts3_expr.lo: $(TOP)/ext/fts3/fts3_expr.c $(HDR) $(EXTHDR)
968 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_expr.c
970 fts3_hash.lo: $(TOP)/ext/fts3/fts3_hash.c $(HDR) $(EXTHDR)
971 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_hash.c
973 fts3_icu.lo: $(TOP)/ext/fts3/fts3_icu.c $(HDR) $(EXTHDR)
974 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_icu.c
976 fts3_porter.lo: $(TOP)/ext/fts3/fts3_porter.c $(HDR) $(EXTHDR)
977 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_porter.c
979 fts3_snippet.lo: $(TOP)/ext/fts3/fts3_snippet.c $(HDR) $(EXTHDR)
980 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_snippet.c
982 fts3_tokenizer.lo: $(TOP)/ext/fts3/fts3_tokenizer.c $(HDR) $(EXTHDR)
983 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer.c
985 fts3_tokenizer1.lo: $(TOP)/ext/fts3/fts3_tokenizer1.c $(HDR) $(EXTHDR)
986 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer1.c
988 fts3_tokenize_vtab.lo: $(TOP)/ext/fts3/fts3_tokenize_vtab.c $(HDR) $(EXTHDR)
989 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenize_vtab.c
991 fts3_unicode.lo: $(TOP)/ext/fts3/fts3_unicode.c $(HDR) $(EXTHDR)
992 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_unicode.c
994 fts3_unicode2.lo: $(TOP)/ext/fts3/fts3_unicode2.c $(HDR) $(EXTHDR)
995 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_unicode2.c
997 fts3_write.lo: $(TOP)/ext/fts3/fts3_write.c $(HDR) $(EXTHDR)
998 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_write.c
1000 rtree.lo: $(TOP)/ext/rtree/rtree.c $(HDR) $(EXTHDR)
1001 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/rtree/rtree.c
1003 json1.lo: $(TOP)/ext/misc/json1.c
1004 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/misc/json1.c
1006 # FTS5 things
1008 FTS5_SRC = \
1009 $(TOP)/ext/fts5/fts5.h \
1010 $(TOP)/ext/fts5/fts5Int.h \
1011 $(TOP)/ext/fts5/fts5_aux.c \
1012 $(TOP)/ext/fts5/fts5_buffer.c \
1013 $(TOP)/ext/fts5/fts5_main.c \
1014 $(TOP)/ext/fts5/fts5_config.c \
1015 $(TOP)/ext/fts5/fts5_expr.c \
1016 $(TOP)/ext/fts5/fts5_hash.c \
1017 $(TOP)/ext/fts5/fts5_index.c \
1018 fts5parse.c fts5parse.h \
1019 $(TOP)/ext/fts5/fts5_storage.c \
1020 $(TOP)/ext/fts5/fts5_tokenize.c \
1021 $(TOP)/ext/fts5/fts5_unicode2.c \
1022 $(TOP)/ext/fts5/fts5_varint.c \
1023 $(TOP)/ext/fts5/fts5_vocab.c \
1025 fts5parse.c: $(TOP)/ext/fts5/fts5parse.y lemon
1026 cp $(TOP)/ext/fts5/fts5parse.y .
1027 rm -f fts5parse.h
1028 ./lemon $(OPTS) fts5parse.y
1030 fts5parse.h: fts5parse.c
1032 fts5.c: $(FTS5_SRC)
1033 $(TCLSH_CMD) $(TOP)/ext/fts5/tool/mkfts5c.tcl
1034 cp $(TOP)/ext/fts5/fts5.h .
1036 fts5.lo: fts5.c $(HDR) $(EXTHDR)
1037 $(LTCOMPILE) -DSQLITE_CORE -c fts5.c
1039 sqlite3rbu.lo: $(TOP)/ext/rbu/sqlite3rbu.c $(HDR) $(EXTHDR)
1040 $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/rbu/sqlite3rbu.c
1043 # Rules to build the 'testfixture' application.
1045 # If using the amalgamation, use sqlite3.c directly to build the test
1046 # fixture. Otherwise link against libsqlite3.la. (This distinction is
1047 # necessary because the test fixture requires non-API symbols which are
1048 # hidden when the library is built via the amalgamation).
1050 TESTFIXTURE_FLAGS = -DTCLSH=1 -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
1051 TESTFIXTURE_FLAGS += -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE
1052 TESTFIXTURE_FLAGS += -DBUILD_sqlite
1054 TESTFIXTURE_SRC0 = $(TESTSRC2) libsqlite3.la
1055 TESTFIXTURE_SRC1 = sqlite3.c
1056 TESTFIXTURE_SRC = $(TESTSRC) $(TOP)/src/tclsqlite.c
1057 TESTFIXTURE_SRC += $(TESTFIXTURE_SRC$(USE_AMALGAMATION))
1059 testfixture$(TEXE): $(TESTFIXTURE_SRC)
1060 $(LTLINK) -DSQLITE_NO_SYNC=1 $(TEMP_STORE) $(TESTFIXTURE_FLAGS) \
1061 -o $@ $(TESTFIXTURE_SRC) $(LIBTCL) $(TLIBS)
1063 # A very detailed test running most or all test cases
1064 fulltest: $(TESTPROGS) fuzztest
1065 ./testfixture$(TEXE) $(TOP)/test/all.test $(TESTOPTS)
1067 # Really really long testing
1068 soaktest: $(TESTPROGS)
1069 ./testfixture$(TEXE) $(TOP)/test/all.test -soak=1 $(TESTOPTS)
1071 # Do extra testing but not everything.
1072 fulltestonly: $(TESTPROGS) fuzztest
1073 ./testfixture$(TEXE) $(TOP)/test/full.test
1075 # Fuzz testing
1076 fuzztest: fuzzcheck$(TEXE) $(FUZZDATA)
1077 ./fuzzcheck$(TEXE) $(FUZZDATA)
1079 fastfuzztest: fuzzcheck$(TEXE) $(FUZZDATA)
1080 ./fuzzcheck$(TEXE) --limit-mem 100M $(FUZZDATA)
1082 valgrindfuzz: fuzzcheck$(TEXT) $(FUZZDATA)
1083 valgrind ./fuzzcheck$(TEXE) --cell-size-check --limit-mem 10M --timeout 600 $(FUZZDATA)
1085 # Minimal testing that runs in less than 3 minutes
1087 quicktest: ./testfixture$(TEXE)
1088 ./testfixture$(TEXE) $(TOP)/test/extraquick.test $(TESTOPTS)
1090 # This is the common case. Run many tests that do not take too long,
1091 # including fuzzcheck, sqlite3_analyzer, and sqldiff tests.
1093 test: $(TESTPROGS) sourcetest fastfuzztest
1094 ./testfixture$(TEXE) $(TOP)/test/veryquick.test $(TESTOPTS)
1096 # Run a test using valgrind. This can take a really long time
1097 # because valgrind is so much slower than a native machine.
1099 valgrindtest: $(TESTPROGS) valgrindfuzz
1100 OMIT_MISUSE=1 valgrind -v ./testfixture$(TEXE) $(TOP)/test/permutations.test valgrind $(TESTOPTS)
1102 # A very fast test that checks basic sanity. The name comes from
1103 # the 60s-era electronics testing: "Turn it on and see if smoke
1104 # comes out."
1106 smoketest: $(TESTPROGS) fuzzcheck$(TEXE)
1107 ./testfixture$(TEXE) $(TOP)/test/main.test $(TESTOPTS)
1109 sqlite3_analyzer.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl
1110 echo "#define TCLSH 2" > $@
1111 echo "#define SQLITE_ENABLE_DBSTAT_VTAB 1" >> $@
1112 cat sqlite3.c $(TOP)/src/tclsqlite.c >> $@
1113 echo "static const char *tclsh_main_loop(void){" >> $@
1114 echo "static const char *zMainloop = " >> $@
1115 $(TCLSH_CMD) $(TOP)/tool/tostr.tcl $(TOP)/tool/spaceanal.tcl >> $@
1116 echo "; return zMainloop; }" >> $@
1118 sqlite3_analyzer$(TEXE): sqlite3_analyzer.c
1119 $(LTLINK) sqlite3_analyzer.c -o $@ $(LIBTCL) $(TLIBS)
1121 showdb$(TEXE): $(TOP)/tool/showdb.c sqlite3.lo
1122 $(LTLINK) -o $@ $(TOP)/tool/showdb.c sqlite3.lo $(TLIBS)
1124 showstat4$(TEXE): $(TOP)/tool/showstat4.c sqlite3.lo
1125 $(LTLINK) -o $@ $(TOP)/tool/showstat4.c sqlite3.lo $(TLIBS)
1127 showjournal$(TEXE): $(TOP)/tool/showjournal.c sqlite3.lo
1128 $(LTLINK) -o $@ $(TOP)/tool/showjournal.c sqlite3.lo $(TLIBS)
1130 showwal$(TEXE): $(TOP)/tool/showwal.c sqlite3.lo
1131 $(LTLINK) -o $@ $(TOP)/tool/showwal.c sqlite3.lo $(TLIBS)
1133 rollback-test$(TEXE): $(TOP)/tool/rollback-test.c sqlite3.lo
1134 $(LTLINK) -o $@ $(TOP)/tool/rollback-test.c sqlite3.lo $(TLIBS)
1136 LogEst$(TEXE): $(TOP)/tool/logest.c sqlite3.h
1137 $(LTLINK) -I. -o $@ $(TOP)/tool/logest.c
1139 wordcount$(TEXE): $(TOP)/test/wordcount.c sqlite3.c
1140 $(LTLINK) -o $@ $(TOP)/test/wordcount.c sqlite3.c $(TLIBS)
1142 speedtest1$(TEXE): $(TOP)/test/speedtest1.c sqlite3.lo
1143 $(LTLINK) -o $@ $(TOP)/test/speedtest1.c sqlite3.lo $(TLIBS)
1145 rbu$(EXE): $(TOP)/ext/rbu/rbu.c $(TOP)/ext/rbu/sqlite3rbu.c sqlite3.lo
1146 $(LTLINK) -I. -o $@ $(TOP)/ext/rbu/rbu.c sqlite3.lo $(TLIBS)
1148 loadfts$(EXE): $(TOP)/tool/loadfts.c libsqlite3.la
1149 $(LTLINK) $(TOP)/tool/loadfts.c libsqlite3.la -o $@ $(TLIBS)
1151 # This target will fail if the SQLite amalgamation contains any exported
1152 # symbols that do not begin with "sqlite3_". It is run as part of the
1153 # releasetest.tcl script.
1155 checksymbols: sqlite3.lo
1156 nm -g --defined-only sqlite3.o | grep -v " sqlite3_" ; test $$? -ne 0
1157 echo '0 errors out of 1 tests'
1159 # Build the amalgamation-autoconf package.
1161 amalgamation-tarball: sqlite3.c
1162 TOP=$(TOP) sh $(TOP)/tool/mkautoconfamal.sh
1164 # The next two rules are used to support the "threadtest" target. Building
1165 # threadtest runs a few thread-safety tests that are implemented in C. This
1166 # target is invoked by the releasetest.tcl script.
1168 THREADTEST3_SRC = $(TOP)/test/threadtest3.c \
1169 $(TOP)/test/tt3_checkpoint.c \
1170 $(TOP)/test/tt3_index.c \
1171 $(TOP)/test/tt3_vacuum.c \
1172 $(TOP)/test/tt3_stress.c \
1173 $(TOP)/test/tt3_lookaside1.c
1175 threadtest3$(TEXE): sqlite3.lo $(THREADTEST3_SRC)
1176 $(LTLINK) $(TOP)/test/threadtest3.c $(TOP)/src/test_multiplex.c sqlite3.lo -o $@ $(TLIBS)
1178 threadtest: threadtest3$(TEXE)
1179 ./threadtest3$(TEXE)
1181 releasetest:
1182 $(TCLSH_CMD) $(TOP)/test/releasetest.tcl
1184 # Standard install and cleanup targets
1186 lib_install: libsqlite3.la
1187 $(INSTALL) -d $(DESTDIR)$(libdir)
1188 $(LTINSTALL) libsqlite3.la $(DESTDIR)$(libdir)
1190 install: sqlite3$(TEXE) lib_install sqlite3.h sqlite3.pc ${HAVE_TCL:1=tcl_install}
1191 $(INSTALL) -d $(DESTDIR)$(bindir)
1192 $(LTINSTALL) sqlite3$(TEXE) $(DESTDIR)$(bindir)
1193 $(INSTALL) -d $(DESTDIR)$(includedir)
1194 $(INSTALL) -m 0644 sqlite3.h $(DESTDIR)$(includedir)
1195 $(INSTALL) -m 0644 $(TOP)/src/sqlite3ext.h $(DESTDIR)$(includedir)
1196 $(INSTALL) -d $(DESTDIR)$(pkgconfigdir)
1197 $(INSTALL) -m 0644 sqlite3.pc $(DESTDIR)$(pkgconfigdir)
1199 pkgIndex.tcl:
1200 echo 'package ifneeded sqlite3 $(RELEASE) [list load $(TCLLIBDIR)/libtclsqlite3$(SHLIB_SUFFIX) sqlite3]' > $@
1201 tcl_install: lib_install libtclsqlite3.la pkgIndex.tcl
1202 $(INSTALL) -d $(DESTDIR)$(TCLLIBDIR)
1203 $(LTINSTALL) libtclsqlite3.la $(DESTDIR)$(TCLLIBDIR)
1204 rm -f $(DESTDIR)$(TCLLIBDIR)/libtclsqlite3.la $(DESTDIR)$(TCLLIBDIR)/libtclsqlite3.a
1205 $(INSTALL) -m 0644 pkgIndex.tcl $(DESTDIR)$(TCLLIBDIR)
1207 clean:
1208 rm -f *.lo *.la *.o sqlite3$(TEXE) libsqlite3.la
1209 rm -f sqlite3.h opcodes.*
1210 rm -rf .libs .deps
1211 rm -f lemon$(BEXE) lempar.c parse.* sqlite*.tar.gz
1212 rm -f mkkeywordhash$(BEXE) keywordhash.h
1213 rm -f *.da *.bb *.bbg gmon.out
1214 rm -rf quota2a quota2b quota2c
1215 rm -rf tsrc .target_source
1216 rm -f tclsqlite3$(TEXE)
1217 rm -f testfixture$(TEXE) test.db
1218 rm -f LogEst$(TEXE) fts3view$(TEXE) rollback-test$(TEXE) showdb$(TEXE)
1219 rm -f showjournal$(TEXE) showstat4$(TEXE) showwal$(TEXE) speedtest1$(TEXE)
1220 rm -f wordcount$(TEXE)
1221 rm -f sqlite3.dll sqlite3.lib sqlite3.exp sqlite3.def
1222 rm -f sqlite3.c
1223 rm -f sqlite3rc.h
1224 rm -f shell.c sqlite3ext.h
1225 rm -f sqlite3_analyzer$(TEXE) sqlite3_analyzer.c
1226 rm -f sqlite-*-output.vsix
1227 rm -f mptester mptester.exe
1228 rm -f rbu rbu.exe
1229 rm -f srcck1 srcck1.exe
1230 rm -f fuzzershell fuzzershell.exe
1231 rm -f fuzzcheck fuzzcheck.exe
1232 rm -f sqldiff sqldiff.exe
1233 rm -f fts5.* fts5parse.*
1235 distclean: clean
1236 rm -f config.h config.log config.status libtool Makefile sqlite3.pc
1239 # Windows section
1241 dll: sqlite3.dll
1243 REAL_LIBOBJ = $(LIBOBJ:%.lo=.libs/%.o)
1245 $(REAL_LIBOBJ): $(LIBOBJ)
1247 sqlite3.def: $(REAL_LIBOBJ)
1248 echo 'EXPORTS' >sqlite3.def
1249 nm $(REAL_LIBOBJ) | grep ' T ' | grep ' _sqlite3_' \
1250 | sed 's/^.* _//' >>sqlite3.def
1252 sqlite3.dll: $(REAL_LIBOBJ) sqlite3.def
1253 $(TCC) -shared -o $@ sqlite3.def \
1254 -Wl,"--strip-all" $(REAL_LIBOBJ)