Merge sqlite-release(3.40.1) into prerelease-integration
[sqlcipher.git] / main.mk
blob76c62fcecdb5812ffe83388e93a480956f257f53
2 ###############################################################################
3 # The following macros should be defined before this script is
4 # invoked:
6 # TOP The toplevel directory of the source tree. This is the
7 # directory that contains this "Makefile.in" and the
8 # "configure.in" script.
10 # BCC C Compiler and options for use in building executables that
11 # will run on the platform that is doing the build.
13 # THREADLIB Specify any extra linker options needed to make the library
14 # thread safe
16 # LIBS Extra libraries options
18 # OPTS Extra compiler command-line options.
20 # EXE The suffix to add to executable files. ".exe" for windows
21 # and "" for Unix.
23 # TCC C Compiler and options for use in building executables that
24 # will run on the target platform. This is usually the same
25 # as BCC, unless you are cross-compiling.
27 # AR Tools used to build a static library.
28 # RANLIB
30 # TCL_FLAGS Extra compiler options needed for programs that use the
31 # TCL library.
33 # LIBTCL Linker options needed to link against the TCL library.
35 # READLINE_FLAGS Compiler options needed for programs that use the
36 # readline() library.
38 # LIBREADLINE Linker options needed by programs using readline() must
39 # link against.
41 # Once the macros above are defined, the rest of this make script will
42 # build the SQLite library and testing tools.
43 ################################################################################
45 # This is how we compile
47 TCCX = $(TCC) $(OPTS) -I. -I$(TOP)/src -I$(TOP)
48 TCCX += -I$(TOP)/ext/rtree -I$(TOP)/ext/icu -I$(TOP)/ext/fts3
49 TCCX += -I$(TOP)/ext/async -I$(TOP)/ext/userauth
50 TCCX += -I$(TOP)/ext/session
51 TCCX += -I$(TOP)/ext/fts5
52 THREADLIB += $(LIBS)
54 # Object files for the SQLite library.
56 LIBOBJ+= vdbe.o parse.o \
57 alter.o analyze.o attach.o auth.o \
58 backup.o bitvec.o btmutex.o btree.o build.o \
59 callback.o complete.o ctime.o \
60 date.o dbpage.o dbstat.o delete.o expr.o \
61 fault.o fkey.o \
62 fts3.o fts3_aux.o fts3_expr.o fts3_hash.o fts3_icu.o fts3_porter.o \
63 fts3_snippet.o fts3_tokenizer.o fts3_tokenizer1.o \
64 fts3_tokenize_vtab.o \
65 fts3_unicode.o fts3_unicode2.o \
66 fts3_write.o fts5.o func.o global.o hash.o \
67 icu.o insert.o json.o legacy.o loadext.o \
68 main.o malloc.o mem0.o mem1.o mem2.o mem3.o mem5.o \
69 memdb.o memjournal.o \
70 mutex.o mutex_noop.o mutex_unix.o mutex_w32.o \
71 notify.o opcodes.o os.o os_kv.o os_unix.o os_win.o \
72 pager.o pcache.o pcache1.o pragma.o prepare.o printf.o \
73 random.o resolve.o rowset.o rtree.o \
74 select.o sqlite3rbu.o status.o stmt.o \
75 table.o threads.o tokenize.o treeview.o trigger.o \
76 update.o upsert.o userauth.o util.o vacuum.o \
77 vdbeapi.o vdbeaux.o vdbeblob.o vdbemem.o vdbesort.o \
78 vdbetrace.o vdbevtab.o \
79 wal.o walker.o where.o wherecode.o whereexpr.o \
80 utf.o vtab.o window.o
82 LIBOBJ += sqlite3session.o
84 # All of the source code files.
86 SRC = \
87 $(TOP)/src/alter.c \
88 $(TOP)/src/analyze.c \
89 $(TOP)/src/attach.c \
90 $(TOP)/src/auth.c \
91 $(TOP)/src/backup.c \
92 $(TOP)/src/bitvec.c \
93 $(TOP)/src/btmutex.c \
94 $(TOP)/src/btree.c \
95 $(TOP)/src/btree.h \
96 $(TOP)/src/btreeInt.h \
97 $(TOP)/src/build.c \
98 $(TOP)/src/callback.c \
99 $(TOP)/src/complete.c \
100 $(TOP)/src/ctime.c \
101 $(TOP)/src/date.c \
102 $(TOP)/src/dbpage.c \
103 $(TOP)/src/dbstat.c \
104 $(TOP)/src/delete.c \
105 $(TOP)/src/expr.c \
106 $(TOP)/src/fault.c \
107 $(TOP)/src/fkey.c \
108 $(TOP)/src/func.c \
109 $(TOP)/src/global.c \
110 $(TOP)/src/hash.c \
111 $(TOP)/src/hash.h \
112 $(TOP)/src/hwtime.h \
113 $(TOP)/src/insert.c \
114 $(TOP)/src/json.c \
115 $(TOP)/src/legacy.c \
116 $(TOP)/src/loadext.c \
117 $(TOP)/src/main.c \
118 $(TOP)/src/malloc.c \
119 $(TOP)/src/mem0.c \
120 $(TOP)/src/mem1.c \
121 $(TOP)/src/mem2.c \
122 $(TOP)/src/mem3.c \
123 $(TOP)/src/mem5.c \
124 $(TOP)/src/memdb.c \
125 $(TOP)/src/memjournal.c \
126 $(TOP)/src/msvc.h \
127 $(TOP)/src/mutex.c \
128 $(TOP)/src/mutex.h \
129 $(TOP)/src/mutex_noop.c \
130 $(TOP)/src/mutex_unix.c \
131 $(TOP)/src/mutex_w32.c \
132 $(TOP)/src/notify.c \
133 $(TOP)/src/os.c \
134 $(TOP)/src/os.h \
135 $(TOP)/src/os_common.h \
136 $(TOP)/src/os_setup.h \
137 $(TOP)/src/os_kv.c \
138 $(TOP)/src/os_unix.c \
139 $(TOP)/src/os_win.c \
140 $(TOP)/src/os_win.h \
141 $(TOP)/src/pager.c \
142 $(TOP)/src/pager.h \
143 $(TOP)/src/parse.y \
144 $(TOP)/src/pcache.c \
145 $(TOP)/src/pcache.h \
146 $(TOP)/src/pcache1.c \
147 $(TOP)/src/pragma.c \
148 $(TOP)/src/pragma.h \
149 $(TOP)/src/prepare.c \
150 $(TOP)/src/printf.c \
151 $(TOP)/src/random.c \
152 $(TOP)/src/resolve.c \
153 $(TOP)/src/rowset.c \
154 $(TOP)/src/select.c \
155 $(TOP)/src/status.c \
156 $(TOP)/src/shell.c.in \
157 $(TOP)/src/sqlite.h.in \
158 $(TOP)/src/sqlite3ext.h \
159 $(TOP)/src/sqliteInt.h \
160 $(TOP)/src/sqliteLimit.h \
161 $(TOP)/src/table.c \
162 $(TOP)/src/tclsqlite.c \
163 $(TOP)/src/threads.c \
164 $(TOP)/src/tokenize.c \
165 $(TOP)/src/treeview.c \
166 $(TOP)/src/trigger.c \
167 $(TOP)/src/utf.c \
168 $(TOP)/src/update.c \
169 $(TOP)/src/upsert.c \
170 $(TOP)/src/util.c \
171 $(TOP)/src/vacuum.c \
172 $(TOP)/src/vdbe.c \
173 $(TOP)/src/vdbe.h \
174 $(TOP)/src/vdbeapi.c \
175 $(TOP)/src/vdbeaux.c \
176 $(TOP)/src/vdbeblob.c \
177 $(TOP)/src/vdbemem.c \
178 $(TOP)/src/vdbesort.c \
179 $(TOP)/src/vdbetrace.c \
180 $(TOP)/src/vdbevtab.c \
181 $(TOP)/src/vdbeInt.h \
182 $(TOP)/src/vtab.c \
183 $(TOP)/src/vxworks.h \
184 $(TOP)/src/wal.c \
185 $(TOP)/src/wal.h \
186 $(TOP)/src/walker.c \
187 $(TOP)/src/where.c \
188 $(TOP)/src/wherecode.c \
189 $(TOP)/src/whereexpr.c \
190 $(TOP)/src/whereInt.h \
191 $(TOP)/src/window.c
193 # Source code for extensions
195 SRC += \
196 $(TOP)/ext/fts1/fts1.c \
197 $(TOP)/ext/fts1/fts1.h \
198 $(TOP)/ext/fts1/fts1_hash.c \
199 $(TOP)/ext/fts1/fts1_hash.h \
200 $(TOP)/ext/fts1/fts1_porter.c \
201 $(TOP)/ext/fts1/fts1_tokenizer.h \
202 $(TOP)/ext/fts1/fts1_tokenizer1.c
203 SRC += \
204 $(TOP)/ext/fts2/fts2.c \
205 $(TOP)/ext/fts2/fts2.h \
206 $(TOP)/ext/fts2/fts2_hash.c \
207 $(TOP)/ext/fts2/fts2_hash.h \
208 $(TOP)/ext/fts2/fts2_icu.c \
209 $(TOP)/ext/fts2/fts2_porter.c \
210 $(TOP)/ext/fts2/fts2_tokenizer.h \
211 $(TOP)/ext/fts2/fts2_tokenizer.c \
212 $(TOP)/ext/fts2/fts2_tokenizer1.c
213 SRC += \
214 $(TOP)/ext/fts3/fts3.c \
215 $(TOP)/ext/fts3/fts3.h \
216 $(TOP)/ext/fts3/fts3Int.h \
217 $(TOP)/ext/fts3/fts3_aux.c \
218 $(TOP)/ext/fts3/fts3_expr.c \
219 $(TOP)/ext/fts3/fts3_hash.c \
220 $(TOP)/ext/fts3/fts3_hash.h \
221 $(TOP)/ext/fts3/fts3_icu.c \
222 $(TOP)/ext/fts3/fts3_porter.c \
223 $(TOP)/ext/fts3/fts3_snippet.c \
224 $(TOP)/ext/fts3/fts3_tokenizer.h \
225 $(TOP)/ext/fts3/fts3_tokenizer.c \
226 $(TOP)/ext/fts3/fts3_tokenizer1.c \
227 $(TOP)/ext/fts3/fts3_tokenize_vtab.c \
228 $(TOP)/ext/fts3/fts3_unicode.c \
229 $(TOP)/ext/fts3/fts3_unicode2.c \
230 $(TOP)/ext/fts3/fts3_write.c
231 SRC += \
232 $(TOP)/ext/icu/sqliteicu.h \
233 $(TOP)/ext/icu/icu.c
234 SRC += \
235 $(TOP)/ext/rtree/sqlite3rtree.h \
236 $(TOP)/ext/rtree/rtree.h \
237 $(TOP)/ext/rtree/rtree.c \
238 $(TOP)/ext/rtree/geopoly.c
239 SRC += \
240 $(TOP)/ext/session/sqlite3session.c \
241 $(TOP)/ext/session/sqlite3session.h
242 SRC += \
243 $(TOP)/ext/userauth/userauth.c \
244 $(TOP)/ext/userauth/sqlite3userauth.h
245 SRC += \
246 $(TOP)/ext/rbu/sqlite3rbu.c \
247 $(TOP)/ext/rbu/sqlite3rbu.h
248 SRC += \
249 $(TOP)/ext/misc/stmt.c
252 # FTS5 things
254 FTS5_HDR = \
255 $(TOP)/ext/fts5/fts5.h \
256 $(TOP)/ext/fts5/fts5Int.h \
257 fts5parse.h
259 FTS5_SRC = \
260 $(TOP)/ext/fts5/fts5_aux.c \
261 $(TOP)/ext/fts5/fts5_buffer.c \
262 $(TOP)/ext/fts5/fts5_main.c \
263 $(TOP)/ext/fts5/fts5_config.c \
264 $(TOP)/ext/fts5/fts5_expr.c \
265 $(TOP)/ext/fts5/fts5_hash.c \
266 $(TOP)/ext/fts5/fts5_index.c \
267 fts5parse.c \
268 $(TOP)/ext/fts5/fts5_storage.c \
269 $(TOP)/ext/fts5/fts5_tokenize.c \
270 $(TOP)/ext/fts5/fts5_unicode2.c \
271 $(TOP)/ext/fts5/fts5_varint.c \
272 $(TOP)/ext/fts5/fts5_vocab.c \
274 LSM1_SRC = \
275 $(TOP)/ext/lsm1/lsm.h \
276 $(TOP)/ext/lsm1/lsmInt.h \
277 $(TOP)/ext/lsm1/lsm_ckpt.c \
278 $(TOP)/ext/lsm1/lsm_file.c \
279 $(TOP)/ext/lsm1/lsm_log.c \
280 $(TOP)/ext/lsm1/lsm_main.c \
281 $(TOP)/ext/lsm1/lsm_mem.c \
282 $(TOP)/ext/lsm1/lsm_mutex.c \
283 $(TOP)/ext/lsm1/lsm_shared.c \
284 $(TOP)/ext/lsm1/lsm_sorted.c \
285 $(TOP)/ext/lsm1/lsm_str.c \
286 $(TOP)/ext/lsm1/lsm_tree.c \
287 $(TOP)/ext/lsm1/lsm_unix.c \
288 $(TOP)/ext/lsm1/lsm_varint.c \
289 $(TOP)/ext/lsm1/lsm_vtab.c \
290 $(TOP)/ext/lsm1/lsm_win32.c
293 # Generated source code files
295 SRC += \
296 keywordhash.h \
297 opcodes.c \
298 opcodes.h \
299 parse.c \
300 parse.h \
301 shell.c \
302 sqlite3.h
305 # Source code to the test files.
307 TESTSRC = \
308 $(TOP)/ext/expert/sqlite3expert.c \
309 $(TOP)/ext/expert/test_expert.c \
310 $(TOP)/ext/fts3/fts3_term.c \
311 $(TOP)/ext/fts3/fts3_test.c \
312 $(TOP)/ext/rbu/test_rbu.c \
313 $(TOP)/src/test1.c \
314 $(TOP)/src/test2.c \
315 $(TOP)/src/test3.c \
316 $(TOP)/src/test4.c \
317 $(TOP)/src/test5.c \
318 $(TOP)/src/test6.c \
319 $(TOP)/src/test7.c \
320 $(TOP)/src/test8.c \
321 $(TOP)/src/test9.c \
322 $(TOP)/src/test_autoext.c \
323 $(TOP)/src/test_async.c \
324 $(TOP)/src/test_backup.c \
325 $(TOP)/src/test_bestindex.c \
326 $(TOP)/src/test_blob.c \
327 $(TOP)/src/test_btree.c \
328 $(TOP)/src/test_config.c \
329 $(TOP)/src/test_delete.c \
330 $(TOP)/src/test_demovfs.c \
331 $(TOP)/src/test_devsym.c \
332 $(TOP)/src/test_fs.c \
333 $(TOP)/src/test_func.c \
334 $(TOP)/src/test_hexio.c \
335 $(TOP)/src/test_init.c \
336 $(TOP)/src/test_intarray.c \
337 $(TOP)/src/test_journal.c \
338 $(TOP)/src/test_malloc.c \
339 $(TOP)/src/test_md5.c \
340 $(TOP)/src/test_multiplex.c \
341 $(TOP)/src/test_mutex.c \
342 $(TOP)/src/test_onefile.c \
343 $(TOP)/src/test_osinst.c \
344 $(TOP)/src/test_pcache.c \
345 $(TOP)/src/test_quota.c \
346 $(TOP)/src/test_rtree.c \
347 $(TOP)/src/test_schema.c \
348 $(TOP)/src/test_server.c \
349 $(TOP)/src/test_sqllog.c \
350 $(TOP)/src/test_superlock.c \
351 $(TOP)/src/test_syscall.c \
352 $(TOP)/src/test_tclsh.c \
353 $(TOP)/src/test_tclvar.c \
354 $(TOP)/src/test_thread.c \
355 $(TOP)/src/test_vdbecov.c \
356 $(TOP)/src/test_vfs.c \
357 $(TOP)/src/test_windirent.c \
358 $(TOP)/src/test_window.c \
359 $(TOP)/src/test_wsd.c
361 # Extensions to be statically loaded.
363 TESTSRC += \
364 $(TOP)/ext/misc/amatch.c \
365 $(TOP)/ext/misc/appendvfs.c \
366 $(TOP)/ext/misc/carray.c \
367 $(TOP)/ext/misc/cksumvfs.c \
368 $(TOP)/ext/misc/closure.c \
369 $(TOP)/ext/misc/csv.c \
370 $(TOP)/ext/misc/decimal.c \
371 $(TOP)/ext/misc/eval.c \
372 $(TOP)/ext/misc/explain.c \
373 $(TOP)/ext/misc/fileio.c \
374 $(TOP)/ext/misc/fuzzer.c \
375 $(TOP)/ext/misc/ieee754.c \
376 $(TOP)/ext/misc/mmapwarm.c \
377 $(TOP)/ext/misc/nextchar.c \
378 $(TOP)/ext/misc/normalize.c \
379 $(TOP)/ext/misc/percentile.c \
380 $(TOP)/ext/misc/prefixes.c \
381 $(TOP)/ext/misc/qpvtab.c \
382 $(TOP)/ext/misc/regexp.c \
383 $(TOP)/ext/misc/remember.c \
384 $(TOP)/ext/misc/series.c \
385 $(TOP)/ext/misc/spellfix.c \
386 $(TOP)/ext/misc/totype.c \
387 $(TOP)/ext/misc/unionvtab.c \
388 $(TOP)/ext/misc/wholenumber.c \
389 $(TOP)/ext/misc/zipfile.c \
390 $(TOP)/ext/fts5/fts5_tcl.c \
391 $(TOP)/ext/fts5/fts5_test_mi.c \
392 $(TOP)/ext/fts5/fts5_test_tok.c \
393 $(TOP)/ext/rtree/test_rtreedoc.c \
394 $(TOP)/ext/recover/sqlite3recover.c \
395 $(TOP)/ext/recover/dbdata.c \
396 $(TOP)/ext/recover/test_recover.c
399 #TESTSRC += $(TOP)/ext/fts2/fts2_tokenizer.c
400 #TESTSRC += $(TOP)/ext/fts3/fts3_tokenizer.c
402 TESTSRC2 = \
403 $(TOP)/src/attach.c \
404 $(TOP)/src/backup.c \
405 $(TOP)/src/btree.c \
406 $(TOP)/src/build.c \
407 $(TOP)/src/date.c \
408 $(TOP)/src/dbpage.c \
409 $(TOP)/src/dbstat.c \
410 $(TOP)/src/expr.c \
411 $(TOP)/src/func.c \
412 $(TOP)/src/global.c \
413 $(TOP)/src/insert.c \
414 $(TOP)/src/wal.c \
415 $(TOP)/src/main.c \
416 $(TOP)/src/mem5.c \
417 $(TOP)/src/os.c \
418 $(TOP)/src/os_kv.c \
419 $(TOP)/src/os_unix.c \
420 $(TOP)/src/os_win.c \
421 $(TOP)/src/pager.c \
422 $(TOP)/src/pragma.c \
423 $(TOP)/src/prepare.c \
424 $(TOP)/src/printf.c \
425 $(TOP)/src/random.c \
426 $(TOP)/src/pcache.c \
427 $(TOP)/src/pcache1.c \
428 $(TOP)/src/select.c \
429 $(TOP)/src/threads.c \
430 $(TOP)/src/tokenize.c \
431 $(TOP)/src/treeview.c \
432 $(TOP)/src/utf.c \
433 $(TOP)/src/util.c \
434 $(TOP)/src/vdbeapi.c \
435 $(TOP)/src/vdbeaux.c \
436 $(TOP)/src/vdbe.c \
437 $(TOP)/src/vdbemem.c \
438 $(TOP)/src/vdbevtab.c \
439 $(TOP)/src/where.c \
440 $(TOP)/src/wherecode.c \
441 $(TOP)/src/whereexpr.c \
442 parse.c \
443 $(TOP)/ext/fts3/fts3.c \
444 $(TOP)/ext/fts3/fts3_aux.c \
445 $(TOP)/ext/fts3/fts3_expr.c \
446 $(TOP)/ext/fts3/fts3_tokenizer.c \
447 $(TOP)/ext/fts3/fts3_write.c \
448 $(TOP)/ext/async/sqlite3async.c \
449 $(TOP)/ext/misc/stmt.c \
450 $(TOP)/ext/session/sqlite3session.c \
451 $(TOP)/ext/session/test_session.c \
452 fts5.c
454 # Header files used by all library source files.
456 HDR = \
457 $(TOP)/src/btree.h \
458 $(TOP)/src/btreeInt.h \
459 $(TOP)/src/hash.h \
460 $(TOP)/src/hwtime.h \
461 keywordhash.h \
462 $(TOP)/src/msvc.h \
463 $(TOP)/src/mutex.h \
464 opcodes.h \
465 $(TOP)/src/os.h \
466 $(TOP)/src/os_common.h \
467 $(TOP)/src/os_setup.h \
468 $(TOP)/src/os_win.h \
469 $(TOP)/src/pager.h \
470 $(TOP)/src/pcache.h \
471 parse.h \
472 $(TOP)/src/pragma.h \
473 sqlite3.h \
474 $(TOP)/src/sqlite3ext.h \
475 $(TOP)/src/sqliteInt.h \
476 $(TOP)/src/sqliteLimit.h \
477 $(TOP)/src/vdbe.h \
478 $(TOP)/src/vdbeInt.h \
479 $(TOP)/src/vxworks.h \
480 $(TOP)/src/whereInt.h
482 # Header files used by extensions
484 EXTHDR += \
485 $(TOP)/ext/fts1/fts1.h \
486 $(TOP)/ext/fts1/fts1_hash.h \
487 $(TOP)/ext/fts1/fts1_tokenizer.h
488 EXTHDR += \
489 $(TOP)/ext/fts2/fts2.h \
490 $(TOP)/ext/fts2/fts2_hash.h \
491 $(TOP)/ext/fts2/fts2_tokenizer.h
492 EXTHDR += \
493 $(TOP)/ext/fts3/fts3.h \
494 $(TOP)/ext/fts3/fts3Int.h \
495 $(TOP)/ext/fts3/fts3_hash.h \
496 $(TOP)/ext/fts3/fts3_tokenizer.h
497 EXTHDR += \
498 $(TOP)/ext/rtree/rtree.h \
499 $(TOP)/ext/rtree/geopoly.c
500 EXTHDR += \
501 $(TOP)/ext/icu/sqliteicu.h
502 EXTHDR += \
503 $(TOP)/ext/fts5/fts5Int.h \
504 fts5parse.h \
505 $(TOP)/ext/fts5/fts5.h
506 EXTHDR += \
507 $(TOP)/ext/userauth/sqlite3userauth.h
509 # executables needed for testing
511 TESTPROGS = \
512 testfixture$(EXE) \
513 sqlite3$(EXE) \
514 sqlite3_analyzer$(EXE) \
515 sqlite3_checker$(EXE) \
516 sqldiff$(EXE) \
517 dbhash$(EXE) \
518 sqltclsh$(EXE)
520 # Databases containing fuzzer test cases
522 FUZZDATA = \
523 $(TOP)/test/fuzzdata1.db \
524 $(TOP)/test/fuzzdata2.db \
525 $(TOP)/test/fuzzdata3.db \
526 $(TOP)/test/fuzzdata4.db \
527 $(TOP)/test/fuzzdata5.db \
528 $(TOP)/test/fuzzdata6.db \
529 $(TOP)/test/fuzzdata7.db \
530 $(TOP)/test/fuzzdata8.db
532 # Standard options to testfixture
534 TESTOPTS = --verbose=file --output=test-out.txt
536 # Extra compiler options for various shell tools
538 SHELL_OPT += -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5
539 SHELL_OPT += -DSQLITE_ENABLE_RTREE
540 SHELL_OPT += -DSQLITE_ENABLE_EXPLAIN_COMMENTS
541 SHELL_OPT += -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
542 SHELL_OPT += -DSQLITE_ENABLE_STMTVTAB
543 SHELL_OPT += -DSQLITE_ENABLE_DBPAGE_VTAB
544 SHELL_OPT += -DSQLITE_ENABLE_DBSTAT_VTAB
545 SHELL_OPT += -DSQLITE_ENABLE_BYTECODE_VTAB
546 SHELL_OPT += -DSQLITE_ENABLE_OFFSET_SQL_FUNC
547 FUZZCHECK_OPT += -I$(TOP)/test
548 FUZZCHECK_OPT += -I$(TOP)/ext/recover
549 FUZZCHECK_OPT += -DSQLITE_ENABLE_MEMSYS5
550 FUZZCHECK_OPT += -DSQLITE_MAX_MEMORY=50000000
551 FUZZCHECK_OPT += -DSQLITE_PRINTF_PRECISION_LIMIT=1000
552 FUZZCHECK_OPT += -DSQLITE_ENABLE_FTS4
553 FUZZCHECK_OPT += -DSQLITE_ENABLE_RTREE
554 FUZZCHECK_OPT += -DSQLITE_ENABLE_GEOPOLY
555 FUZZCHECK_OPT += -DSQLITE_ENABLE_DBSTAT_VTAB
556 FUZZCHECK_OPT += -DSQLITE_ENABLE_BYTECODE_VTAB
557 FUZZSRC += $(TOP)/test/fuzzcheck.c
558 FUZZSRC += $(TOP)/test/ossfuzz.c
559 FUZZSRC += $(TOP)/test/vt02.c
560 FUZZSRC += $(TOP)/test/fuzzinvariants.c
561 FUZZSRC += $(TOP)/ext/recover/dbdata.c
562 FUZZSRC += $(TOP)/ext/recover/sqlite3recover.c
563 DBFUZZ_OPT =
564 KV_OPT = -DSQLITE_THREADSAFE=0 -DSQLITE_DIRECT_OVERFLOW_READ
565 ST_OPT = -DSQLITE_THREADSAFE=0
567 # This is the default Makefile target. The objects listed here
568 # are what get build when you type just "make" with no arguments.
570 all: sqlite3.h sqlite3ext.h libsqlite3.a sqlite3$(EXE)
572 libsqlite3.a: sqlite3.h $(LIBOBJ)
573 $(AR) libsqlite3.a $(LIBOBJ)
574 $(RANLIB) libsqlite3.a
576 sqlite3$(EXE): sqlite3.h libsqlite3.a shell.c
577 $(TCCX) $(READLINE_FLAGS) -o sqlite3$(EXE) $(SHELL_OPT) \
578 shell.c libsqlite3.a $(LIBREADLINE) $(TLIBS) $(THREADLIB)
580 sqldiff$(EXE): $(TOP)/tool/sqldiff.c sqlite3.c sqlite3.h
581 $(TCCX) -o sqldiff$(EXE) -DSQLITE_THREADSAFE=0 \
582 $(TOP)/tool/sqldiff.c sqlite3.c $(TLIBS) $(THREADLIB)
584 dbhash$(EXE): $(TOP)/tool/dbhash.c sqlite3.c sqlite3.h
585 $(TCCX) -o dbhash$(EXE) -DSQLITE_THREADSAFE=0 \
586 $(TOP)/tool/dbhash.c sqlite3.c $(TLIBS) $(THREADLIB)
588 scrub$(EXE): $(TOP)/ext/misc/scrub.c sqlite3.o
589 $(TCC) -I. -DSCRUB_STANDALONE -o scrub$(EXE) $(TOP)/ext/misc/scrub.c sqlite3.o $(THREADLIB)
591 srcck1$(EXE): $(TOP)/tool/srcck1.c
592 $(BCC) -o srcck1$(EXE) $(TOP)/tool/srcck1.c
594 sourcetest: srcck1$(EXE) sqlite3.c
595 ./srcck1 sqlite3.c
597 fuzzershell$(EXE): $(TOP)/tool/fuzzershell.c sqlite3.c sqlite3.h
598 $(TCCX) -o fuzzershell$(EXE) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
599 $(FUZZERSHELL_OPT) $(TOP)/tool/fuzzershell.c sqlite3.c \
600 $(TLIBS) $(THREADLIB)
602 dbfuzz$(EXE): $(TOP)/test/dbfuzz.c sqlite3.c sqlite3.h
603 $(TCCX) -o dbfuzz$(EXE) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
604 $(DBFUZZ_OPT) $(TOP)/test/dbfuzz.c sqlite3.c \
605 $(TLIBS) $(THREADLIB)
607 DBFUZZ2_OPTS = \
608 -DSQLITE_THREADSAFE=0 \
609 -DSQLITE_OMIT_LOAD_EXTENSION \
610 -DSQLITE_DEBUG \
611 -DSQLITE_ENABLE_DBSTAT_VTAB \
612 -DSQLITE_ENABLE_BYTECODE_VTAB \
613 -DSQLITE_ENABLE_RTREE \
614 -DSQLITE_ENABLE_FTS4 \
615 -DSQLITE_ENABLE_FTS5
617 dbfuzz2$(EXE): $(TOP)/test/dbfuzz2.c sqlite3.c sqlite3.h
618 $(TCCX) -I. -g -O0 -DSTANDALONE -o dbfuzz2$(EXE) \
619 $(DBFUZZ2_OPTS) $(TOP)/test/dbfuzz2.c sqlite3.c $(TLIBS) $(THREADLIB)
621 fuzzcheck$(EXE): $(FUZZSRC) sqlite3.c sqlite3.h $(FUZZDEP)
622 $(TCCX) -o fuzzcheck$(EXE) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
623 -DSQLITE_ENABLE_MEMSYS5 $(FUZZCHECK_OPT) -DSQLITE_OSS_FUZZ \
624 $(FUZZSRC) sqlite3.c $(TLIBS) $(THREADLIB)
626 ossshell$(EXE): $(TOP)/test/ossfuzz.c $(TOP)/test/ossshell.c sqlite3.c sqlite3.h
627 $(TCCX) -o ossshell$(EXE) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
628 -DSQLITE_ENABLE_MEMSYS5 $(FUZZCHECK_OPT) \
629 $(TOP)/test/ossfuzz.c $(TOP)/test/ossshell.c sqlite3.c $(TLIBS) $(THREADLIB)
631 sessionfuzz$(EXE): $(TOP)/test/sessionfuzz.c sqlite3.c sqlite3.h
632 $(TCC) -o sessionfuzz$(EXE) $(TOP)/test/sessionfuzz.c -lz $(TLIBS) $(THREADLIB)
634 mptester$(EXE): sqlite3.c $(TOP)/mptest/mptest.c
635 $(TCCX) -o $@ -I. $(TOP)/mptest/mptest.c sqlite3.c \
636 $(TLIBS) $(THREADLIB)
638 MPTEST1=./mptester$(EXE) mptest1.db $(TOP)/mptest/crash01.test --repeat 20
639 MPTEST2=./mptester$(EXE) mptest2.db $(TOP)/mptest/multiwrite01.test --repeat 20
640 mptest: mptester$(EXE)
641 $(MPTEST1) --journalmode DELETE
642 $(MPTEST2) --journalmode WAL
643 $(MPTEST1) --journalmode WAL
644 $(MPTEST2) --journalmode PERSIST
645 $(MPTEST1) --journalmode PERSIST
646 $(MPTEST2) --journalmode TRUNCATE
647 $(MPTEST1) --journalmode TRUNCATE
648 $(MPTEST2) --journalmode DELETE
650 sqlite3.o: sqlite3.c
651 $(TCCX) -I. -c sqlite3.c
653 # This target creates a directory named "tsrc" and fills it with
654 # copies of all of the C source code and header files needed to
655 # build on the target system. Some of the C source code and header
656 # files are automatically generated. This target takes care of
657 # all that automatic generation.
659 target_source: $(SRC) $(TOP)/tool/vdbe-compress.tcl fts5.c
660 rm -rf tsrc
661 mkdir tsrc
662 cp -f $(SRC) tsrc
663 rm tsrc/sqlite.h.in tsrc/parse.y
664 tclsh $(TOP)/tool/vdbe-compress.tcl $(OPTS) <tsrc/vdbe.c >vdbe.new
665 mv vdbe.new tsrc/vdbe.c
666 cp fts5.c fts5.h tsrc
667 touch target_source
669 sqlite3.c: target_source $(TOP)/tool/mksqlite3c.tcl
670 tclsh $(TOP)/tool/mksqlite3c.tcl
671 cp tsrc/sqlite3ext.h .
672 cp $(TOP)/ext/session/sqlite3session.h .
673 echo '#ifndef USE_SYSTEM_SQLITE' >tclsqlite3.c
674 cat sqlite3.c >>tclsqlite3.c
675 echo '#endif /* USE_SYSTEM_SQLITE */' >>tclsqlite3.c
676 cat $(TOP)/src/tclsqlite.c >>tclsqlite3.c
678 sqlite3ext.h: target_source
679 cp tsrc/sqlite3ext.h .
681 sqlite3.c-debug: target_source $(TOP)/tool/mksqlite3c.tcl
682 tclsh $(TOP)/tool/mksqlite3c.tcl --linemacros=1
683 echo '#ifndef USE_SYSTEM_SQLITE' >tclsqlite3.c
684 cat sqlite3.c >>tclsqlite3.c
685 echo '#endif /* USE_SYSTEM_SQLITE */' >>tclsqlite3.c
686 echo '#line 1 "tclsqlite.c"' >>tclsqlite3.c
687 cat $(TOP)/src/tclsqlite.c >>tclsqlite3.c
689 sqlite3-all.c: sqlite3.c $(TOP)/tool/split-sqlite3c.tcl
690 tclsh $(TOP)/tool/split-sqlite3c.tcl
692 fts2amal.c: target_source $(TOP)/ext/fts2/mkfts2amal.tcl
693 tclsh $(TOP)/ext/fts2/mkfts2amal.tcl
695 # Rules to build the LEMON compiler generator
697 lemon: $(TOP)/tool/lemon.c $(TOP)/tool/lempar.c
698 $(BCC) -o lemon $(TOP)/tool/lemon.c
699 cp $(TOP)/tool/lempar.c .
701 # A tool to generate the source-id
703 mksourceid: $(TOP)/tool/mksourceid.c
704 $(BCC) -o mksourceid $(TOP)/tool/mksourceid.c
706 # Rules to build individual *.o files from generated *.c files. This
707 # applies to:
709 # parse.o
710 # opcodes.o
712 %.o: %.c $(HDR)
713 $(TCCX) -c $<
715 # Rules to build individual *.o files from files in the src directory.
717 %.o: $(TOP)/src/%.c $(HDR)
718 $(TCCX) -c $<
720 tclsqlite.o: $(TOP)/src/tclsqlite.c $(HDR)
721 $(TCCX) $(TCL_FLAGS) -c $(TOP)/src/tclsqlite.c
725 # Rules to build opcodes.c and opcodes.h
727 opcodes.c: opcodes.h $(TOP)/tool/mkopcodec.tcl
728 tclsh $(TOP)/tool/mkopcodec.tcl opcodes.h >opcodes.c
730 opcodes.h: parse.h $(TOP)/src/vdbe.c $(TOP)/tool/mkopcodeh.tcl
731 cat parse.h $(TOP)/src/vdbe.c | \
732 tclsh $(TOP)/tool/mkopcodeh.tcl >opcodes.h
734 # Rules to build parse.c and parse.h - the outputs of lemon.
736 parse.h: parse.c
738 parse.c: $(TOP)/src/parse.y lemon
739 cp $(TOP)/src/parse.y .
740 ./lemon -s $(OPTS) parse.y
742 sqlite3.h: $(TOP)/src/sqlite.h.in $(TOP)/manifest mksourceid $(TOP)/VERSION $(TOP)/ext/rtree/sqlite3rtree.h
743 tclsh $(TOP)/tool/mksqlite3h.tcl $(TOP) >sqlite3.h
745 sqlite3rc.h: $(TOP)/src/sqlite3.rc $(TOP)/VERSION
746 echo '#ifndef SQLITE_RESOURCE_VERSION' >$@
747 echo -n '#define SQLITE_RESOURCE_VERSION ' >>$@
748 cat $(TOP)/VERSION | tclsh $(TOP)/tool/replace.tcl exact . , >>$@
749 echo '#endif' >>sqlite3rc.h
751 keywordhash.h: $(TOP)/tool/mkkeywordhash.c
752 $(BCC) -o mkkeywordhash $(OPTS) $(TOP)/tool/mkkeywordhash.c
753 ./mkkeywordhash >keywordhash.h
755 # Source files that go into making shell.c
756 SHELL_SRC = \
757 $(TOP)/src/shell.c.in \
758 $(TOP)/ext/misc/appendvfs.c \
759 $(TOP)/ext/misc/completion.c \
760 $(TOP)/ext/misc/decimal.c \
761 $(TOP)/ext/misc/fileio.c \
762 $(TOP)/ext/misc/ieee754.c \
763 $(TOP)/ext/misc/regexp.c \
764 $(TOP)/ext/misc/series.c \
765 $(TOP)/ext/misc/shathree.c \
766 $(TOP)/ext/misc/sqlar.c \
767 $(TOP)/ext/misc/uint.c \
768 $(TOP)/ext/expert/sqlite3expert.c \
769 $(TOP)/ext/expert/sqlite3expert.h \
770 $(TOP)/ext/misc/zipfile.c \
771 $(TOP)/ext/misc/memtrace.c \
772 $(TOP)/ext/recover/dbdata.c \
773 $(TOP)/ext/recover/sqlite3recover.c \
774 $(TOP)/ext/recover/sqlite3recover.h \
775 $(TOP)/src/test_windirent.c
777 shell.c: $(SHELL_SRC) $(TOP)/tool/mkshellc.tcl
778 tclsh $(TOP)/tool/mkshellc.tcl >shell.c
782 # Rules to build the extension objects.
784 icu.o: $(TOP)/ext/icu/icu.c $(HDR) $(EXTHDR)
785 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/icu/icu.c
787 fts2.o: $(TOP)/ext/fts2/fts2.c $(HDR) $(EXTHDR)
788 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2.c
790 fts2_hash.o: $(TOP)/ext/fts2/fts2_hash.c $(HDR) $(EXTHDR)
791 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_hash.c
793 fts2_icu.o: $(TOP)/ext/fts2/fts2_icu.c $(HDR) $(EXTHDR)
794 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_icu.c
796 fts2_porter.o: $(TOP)/ext/fts2/fts2_porter.c $(HDR) $(EXTHDR)
797 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_porter.c
799 fts2_tokenizer.o: $(TOP)/ext/fts2/fts2_tokenizer.c $(HDR) $(EXTHDR)
800 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_tokenizer.c
802 fts2_tokenizer1.o: $(TOP)/ext/fts2/fts2_tokenizer1.c $(HDR) $(EXTHDR)
803 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_tokenizer1.c
805 fts3.o: $(TOP)/ext/fts3/fts3.c $(HDR) $(EXTHDR)
806 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3.c
808 fts3_aux.o: $(TOP)/ext/fts3/fts3_aux.c $(HDR) $(EXTHDR)
809 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_aux.c
811 fts3_expr.o: $(TOP)/ext/fts3/fts3_expr.c $(HDR) $(EXTHDR)
812 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_expr.c
814 fts3_hash.o: $(TOP)/ext/fts3/fts3_hash.c $(HDR) $(EXTHDR)
815 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_hash.c
817 fts3_icu.o: $(TOP)/ext/fts3/fts3_icu.c $(HDR) $(EXTHDR)
818 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_icu.c
820 fts3_snippet.o: $(TOP)/ext/fts3/fts3_snippet.c $(HDR) $(EXTHDR)
821 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_snippet.c
823 fts3_porter.o: $(TOP)/ext/fts3/fts3_porter.c $(HDR) $(EXTHDR)
824 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_porter.c
826 fts3_tokenizer.o: $(TOP)/ext/fts3/fts3_tokenizer.c $(HDR) $(EXTHDR)
827 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer.c
829 fts3_tokenizer1.o: $(TOP)/ext/fts3/fts3_tokenizer1.c $(HDR) $(EXTHDR)
830 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer1.c
832 fts3_tokenize_vtab.o: $(TOP)/ext/fts3/fts3_tokenize_vtab.c $(HDR) $(EXTHDR)
833 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenize_vtab.c
835 fts3_unicode.o: $(TOP)/ext/fts3/fts3_unicode.c $(HDR) $(EXTHDR)
836 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_unicode.c
838 fts3_unicode2.o: $(TOP)/ext/fts3/fts3_unicode2.c $(HDR) $(EXTHDR)
839 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_unicode2.c
841 fts3_write.o: $(TOP)/ext/fts3/fts3_write.c $(HDR) $(EXTHDR)
842 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_write.c
844 fts5.o: fts5.c sqlite3ext.h sqlite3.h
845 $(TCCX) -DSQLITE_CORE -c fts5.c
847 stmt.o: $(TOP)/ext/misc/stmt.c sqlite3ext.h sqlite3.h
848 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/misc/stmt.c
850 rtree.o: $(TOP)/ext/rtree/rtree.c $(HDR) $(EXTHDR)
851 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/rtree/rtree.c
855 fts5parse.c: $(TOP)/ext/fts5/fts5parse.y lemon
856 cp $(TOP)/ext/fts5/fts5parse.y .
857 rm -f fts5parse.h
858 ./lemon $(OPTS) fts5parse.y
860 fts5parse.h: fts5parse.c
862 fts5.c: $(FTS5_SRC) $(FTS5_HDR)
863 tclsh $(TOP)/ext/fts5/tool/mkfts5c.tcl
864 cp $(TOP)/ext/fts5/fts5.h .
866 lsm1.c: $(LSM1_SRC)
867 tclsh $(TOP)/ext/lsm1/tool/mklsm1c.tcl
868 cp $(TOP)/ext/lsm1/lsm.h .
870 userauth.o: $(TOP)/ext/userauth/userauth.c $(HDR) $(EXTHDR)
871 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/userauth/userauth.c
873 sqlite3session.o: $(TOP)/ext/session/sqlite3session.c $(HDR) $(EXTHDR)
874 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/session/sqlite3session.c
876 sqlite3rbu.o: $(TOP)/ext/rbu/sqlite3rbu.c $(HDR) $(EXTHDR)
877 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/rbu/sqlite3rbu.c
879 # Rules for building test programs and for running tests
881 tclsqlite3: $(TOP)/src/tclsqlite.c libsqlite3.a
882 $(TCCX) $(TCL_FLAGS) -DTCLSH -o tclsqlite3 \
883 $(TOP)/src/tclsqlite.c libsqlite3.a $(LIBTCL) $(THREADLIB)
885 sqlite3_analyzer.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl $(TOP)/tool/sqlite3_analyzer.c.in $(TOP)/tool/mkccode.tcl
886 tclsh $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqlite3_analyzer.c.in >sqlite3_analyzer.c
888 sqlite3_analyzer$(EXE): sqlite3_analyzer.c
889 $(TCCX) $(TCL_FLAGS) sqlite3_analyzer.c -o $@ $(LIBTCL) $(THREADLIB)
891 sqltclsh.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/sqltclsh.tcl $(TOP)/ext/misc/appendvfs.c $(TOP)/tool/mkccode.tcl
892 tclsh $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqltclsh.c.in >sqltclsh.c
894 sqltclsh$(EXE): sqltclsh.c
895 $(TCCX) $(TCL_FLAGS) sqltclsh.c -o $@ $(LIBTCL) $(THREADLIB)
897 sqlite3_expert$(EXE): $(TOP)/ext/expert/sqlite3expert.h $(TOP)/ext/expert/sqlite3expert.c $(TOP)/ext/expert/expert.c sqlite3.c
898 $(TCCX) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION $(TOP)/ext/expert/sqlite3expert.c $(TOP)/ext/expert/expert.c sqlite3.c -o sqlite3_expert$(EXE) $(THREADLIB)
900 CHECKER_DEPS =\
901 $(TOP)/tool/mkccode.tcl \
902 sqlite3.c \
903 $(TOP)/src/tclsqlite.c \
904 $(TOP)/ext/repair/sqlite3_checker.tcl \
905 $(TOP)/ext/repair/checkindex.c \
906 $(TOP)/ext/repair/checkfreelist.c \
907 $(TOP)/ext/misc/btreeinfo.c \
908 $(TOP)/ext/repair/sqlite3_checker.c.in
910 sqlite3_checker.c: $(CHECKER_DEPS)
911 tclsh $(TOP)/tool/mkccode.tcl $(TOP)/ext/repair/sqlite3_checker.c.in >$@
913 sqlite3_checker$(TEXE): sqlite3_checker.c
914 $(TCCX) $(TCL_FLAGS) sqlite3_checker.c -o $@ $(LIBTCL) $(THREADLIB)
916 dbdump$(EXE): $(TOP)/ext/misc/dbdump.c sqlite3.o
917 $(TCCX) -DDBDUMP_STANDALONE -o dbdump$(EXE) \
918 $(TOP)/ext/misc/dbdump.c sqlite3.o $(THREADLIB)
920 # Rules to build the 'testfixture' application.
922 TESTFIXTURE_FLAGS = -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
923 TESTFIXTURE_FLAGS += -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE
924 TESTFIXTURE_FLAGS += -DSQLITE_SERIES_CONSTRAINT_VERIFY=1
925 TESTFIXTURE_FLAGS += -DSQLITE_DEFAULT_PAGE_SIZE=1024
926 TESTFIXTURE_FLAGS += -DSQLITE_ENABLE_STMTVTAB
927 TESTFIXTURE_FLAGS += -DSQLITE_ENABLE_DBPAGE_VTAB
928 TESTFIXTURE_FLAGS += -DSQLITE_ENABLE_BYTECODE_VTAB
929 TESTFIXTURE_FLAGS += -DTCLSH_INIT_PROC=sqlite3TestInit
930 TESTFIXTURE_FLAGS += -DSQLITE_CKSUMVFS_STATIC
932 testfixture$(EXE): $(TESTSRC2) libsqlite3.a $(TESTSRC) $(TOP)/src/tclsqlite.c
933 $(TCCX) $(TCL_FLAGS) $(TESTFIXTURE_FLAGS) \
934 $(TESTSRC) $(TESTSRC2) $(TOP)/src/tclsqlite.c \
935 -o testfixture$(EXE) $(LIBTCL) libsqlite3.a $(THREADLIB)
937 amalgamation-testfixture$(EXE): sqlite3.c $(TESTSRC) $(TOP)/src/tclsqlite.c \
938 $(TOP)/ext/session/test_session.c
939 $(TCCX) $(TCL_FLAGS) $(TESTFIXTURE_FLAGS) \
940 $(TESTSRC) $(TOP)/src/tclsqlite.c sqlite3.c \
941 $(TOP)/ext/session/test_session.c \
942 -o testfixture$(EXE) $(LIBTCL) $(THREADLIB)
944 coretestprogs: $(TESTPROGS)
946 testprogs: coretestprogs srcck1$(EXE) fuzzcheck$(EXE) sessionfuzz$(EXE)
948 fulltest: $(TESTPROGS) fuzztest
949 ./testfixture$(EXE) $(TOP)/test/all.test $(TESTOPTS)
951 soaktest: $(TESTPROGS)
952 ./testfixture$(EXE) $(TOP)/test/all.test -soak=1 $(TESTOPTS)
954 fulltestonly: $(TESTPROGS) fuzztest
955 ./testfixture$(EXE) $(TOP)/test/full.test $(TESTOPTS)
957 queryplantest: testfixture$(EXE) sqlite3$(EXE)
958 ./testfixture$(EXE) $(TOP)/test/permutations.test queryplanner $(TESTOPTS)
960 fuzztest: fuzzcheck$(EXE) $(FUZZDATA) sessionfuzz$(EXE) $(TOP)/test/sessionfuzz-data1.db
961 ./fuzzcheck$(EXE) $(FUZZDATA)
962 ./sessionfuzz run $(TOP)/test/sessionfuzz-data1.db
964 valgrindfuzz: fuzzcheck$(EXE) $(FUZZDATA) sessionfuzz$(EXE) $(TOP)/test/sessionfuzz-data1.db
965 valgrind ./fuzzcheck$(EXE) --cell-size-check --limit-mem 10M $(FUZZDATA)
966 valgrind ./sessionfuzz run $(TOP)/test/sessionfuzz-data1.db
968 # The veryquick.test TCL tests.
970 tcltest: ./testfixture$(EXE)
971 ./testfixture$(EXE) $(TOP)/test/veryquick.test $(TESTOPTS)
973 # Runs all the same tests cases as the "tcltest" target but uses
974 # the testrunner.tcl script to run them in multiple cores
975 # concurrently.
976 testrunner: testfixture$(EXE)
977 ./testfixture$(EXE) $(TOP)/test/testrunner.tcl
979 # A very quick test using only testfixture and omitting all the slower
980 # tests. Designed to run in under 3 minutes on a workstation.
982 quicktest: ./testfixture$(EXE)
983 ./testfixture$(EXE) $(TOP)/test/extraquick.test $(TESTOPTS)
985 # The default test case. Runs most of the faster standard TCL tests,
986 # and fuzz tests, and sqlite3_analyzer and sqldiff tests.
987 test: fuzztest sourcetest $(TESTPROGS) tcltest
990 # Run a test using valgrind. This can take a really long time
991 # because valgrind is so much slower than a native machine.
993 valgrindtest: $(TESTPROGS) valgrindfuzz
994 OMIT_MISUSE=1 valgrind -v \
995 ./testfixture$(EXE) $(TOP)/test/permutations.test valgrind $(TESTOPTS)
997 # A very fast test that checks basic sanity. The name comes from
998 # the 60s-era electronics testing: "Turn it on and see if smoke
999 # comes out."
1001 smoketest: $(TESTPROGS) fuzzcheck$(EXE)
1002 ./testfixture$(EXE) $(TOP)/test/main.test $(TESTOPTS)
1004 shelltest: $(TESTPROGS)
1005 ./testfixture$(EXT) $(TOP)/test/permutations.test shell
1007 # The next two rules are used to support the "threadtest" target. Building
1008 # threadtest runs a few thread-safety tests that are implemented in C. This
1009 # target is invoked by the releasetest.tcl script.
1011 THREADTEST3_SRC = $(TOP)/test/threadtest3.c \
1012 $(TOP)/test/tt3_checkpoint.c \
1013 $(TOP)/test/tt3_index.c \
1014 $(TOP)/test/tt3_vacuum.c \
1015 $(TOP)/test/tt3_stress.c \
1016 $(TOP)/test/tt3_lookaside1.c
1018 threadtest3$(EXE): sqlite3.o $(THREADTEST3_SRC) $(TOP)/src/test_multiplex.c
1019 $(TCCX) $(TOP)/test/threadtest3.c $(TOP)/src/test_multiplex.c sqlite3.o -o $@ $(THREADLIB)
1021 threadtest: threadtest3$(EXE)
1022 ./threadtest3$(EXE)
1024 TEST_EXTENSION = $(SHPREFIX)testloadext.$(SO)
1025 $(TEST_EXTENSION): $(TOP)/src/test_loadext.c
1026 $(MKSHLIB) $(TOP)/src/test_loadext.c -o $(TEST_EXTENSION)
1028 extensiontest: testfixture$(EXE) $(TEST_EXTENSION)
1029 ./testfixture$(EXE) $(TOP)/test/loadext.test
1031 dbtotxt$(EXE): $(TOP)/tool/dbtotxt.c
1032 $(TCC) -o dbtotxt$(EXE) $(TOP)/tool/dbtotxt.c
1034 showdb$(EXE): $(TOP)/tool/showdb.c sqlite3.o
1035 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o showdb$(EXE) \
1036 $(TOP)/tool/showdb.c sqlite3.o $(THREADLIB)
1038 showstat4$(EXE): $(TOP)/tool/showstat4.c sqlite3.o
1039 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o showstat4$(EXE) \
1040 $(TOP)/tool/showstat4.c sqlite3.o $(THREADLIB)
1042 showjournal$(EXE): $(TOP)/tool/showjournal.c sqlite3.o
1043 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o showjournal$(EXE) \
1044 $(TOP)/tool/showjournal.c sqlite3.o $(THREADLIB)
1046 showwal$(EXE): $(TOP)/tool/showwal.c sqlite3.o
1047 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o showwal$(EXE) \
1048 $(TOP)/tool/showwal.c sqlite3.o $(THREADLIB)
1050 showshm$(EXE): $(TOP)/tool/showshm.c
1051 $(TCC) -o showshm$(EXE) $(TOP)/tool/showshm.c
1053 index_usage$(EXE): $(TOP)/tool/index_usage.c sqlite3.o
1054 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_DEPRECATED $(SHELL_OPTS) -o index_usage$(EXE) \
1055 $(TOP)/tool/index_usage.c sqlite3.o $(THREADLIB)
1057 changeset$(EXE): $(TOP)/ext/session/changeset.c sqlite3.o
1058 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o changeset$(EXE) \
1059 $(TOP)/ext/session/changeset.c sqlite3.o $(THREADLIB)
1061 changesetfuzz$(EXE): $(TOP)/ext/session/changesetfuzz.c sqlite3.o
1062 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o changesetfuzz$(EXE) \
1063 $(TOP)/ext/session/changesetfuzz.c sqlite3.o $(THREADLIB)
1065 fts3view$(EXE): $(TOP)/ext/fts3/tool/fts3view.c sqlite3.o
1066 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o fts3view$(EXE) \
1067 $(TOP)/ext/fts3/tool/fts3view.c sqlite3.o $(THREADLIB)
1069 rollback-test$(EXE): $(TOP)/tool/rollback-test.c sqlite3.o
1070 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o rollback-test$(EXE) \
1071 $(TOP)/tool/rollback-test.c sqlite3.o $(THREADLIB)
1073 atrc$(EXE): $(TOP)/test/atrc.c sqlite3.o
1074 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o atrc$(EXE) \
1075 $(TOP)/test/atrc.c sqlite3.o $(THREADLIB)
1077 LogEst$(EXE): $(TOP)/tool/logest.c sqlite3.h
1078 $(TCC) -o LogEst$(EXE) $(TOP)/tool/logest.c
1080 wordcount$(EXE): $(TOP)/test/wordcount.c sqlite3.c
1081 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o wordcount$(EXE) \
1082 $(TOP)/test/wordcount.c sqlite3.c
1084 speedtest1$(EXE): $(TOP)/test/speedtest1.c sqlite3.c
1085 $(TCCX) -I. $(ST_OPT) -o speedtest1$(EXE) $(TOP)/test/speedtest1.c sqlite3.c $(THREADLIB)
1087 kvtest$(EXE): $(TOP)/test/kvtest.c sqlite3.c
1088 $(TCCX) -I. $(KV_OPT) -o kvtest$(EXE) $(TOP)/test/kvtest.c sqlite3.c $(THREADLIB)
1090 rbu$(EXE): $(TOP)/ext/rbu/rbu.c $(TOP)/ext/rbu/sqlite3rbu.c sqlite3.o
1091 $(TCC) -I. -o rbu$(EXE) $(TOP)/ext/rbu/rbu.c sqlite3.o \
1092 $(THREADLIB)
1094 loadfts: $(TOP)/tool/loadfts.c libsqlite3.a
1095 $(TCC) $(TOP)/tool/loadfts.c libsqlite3.a -o loadfts $(THREADLIB)
1097 threadtest5: $(TOP)/test/threadtest5.c libsqlite3.a
1098 $(TCC) $(TOP)/test/threadtest5.c libsqlite3.a -o threadtest5 $(THREADLIB)
1100 # This target will fail if the SQLite amalgamation contains any exported
1101 # symbols that do not begin with "sqlite3_". It is run as part of the
1102 # releasetest.tcl script.
1104 checksymbols: sqlite3.o
1105 nm -g --defined-only sqlite3.o | grep -v " sqlite3_" ; test $$? -ne 0
1107 # Build the amalgamation-autoconf package. The amalamgation-tarball target builds
1108 # a tarball named for the version number. Ex: sqlite-autoconf-3110000.tar.gz.
1109 # The snapshot-tarball target builds a tarball named by the SHA1 hash
1111 amalgamation-tarball: sqlite3.c sqlite3rc.h
1112 TOP=$(TOP) sh $(TOP)/tool/mkautoconfamal.sh --normal
1114 snapshot-tarball: sqlite3.c sqlite3rc.h
1115 TOP=$(TOP) sh $(TOP)/tool/mkautoconfamal.sh --snapshot
1118 # Standard install and cleanup targets
1120 install: sqlite3 libsqlite3.a sqlite3.h
1121 mv sqlite3 /usr/bin
1122 mv libsqlite3.a /usr/lib
1123 mv sqlite3.h /usr/include
1125 clean:
1126 rm -f *.o sqlite3 sqlite3.exe libsqlite3.a sqlite3.h opcodes.*
1127 rm -f lemon lemon.exe lempar.c parse.* sqlite*.tar.gz
1128 rm -f mkkeywordhash mkkeywordhash.exe keywordhash.h
1129 rm -f $(PUBLISH)
1130 rm -f *.da *.bb *.bbg gmon.out
1131 rm -rf tsrc target_source
1132 rm -f testloadext.dll libtestloadext.so
1133 rm -f amalgamation-testfixture amalgamation-testfixture.exe
1134 rm -f fts3-testfixture fts3-testfixture.exe
1135 rm -f testfixture testfixture.exe
1136 rm -f threadtest3 threadtest3.exe
1137 rm -f LogEst LogEst.exe
1138 rm -f fts3view fts3view.exe
1139 rm -f rollback-test rollback-test.exe
1140 rm -f showdb showdb.exe
1141 rm -f showjournal showjournal.exe
1142 rm -f showstat4 showstat4.exe
1143 rm -f showwal showwal.exe
1144 rm -f changeset changeset.exe
1145 rm -f speedtest1 speedtest1.exe
1146 rm -f wordcount wordcount.exe
1147 rm -f rbu rbu.exe
1148 rm -f srcck1 srcck1.exe
1149 rm -f sqlite3.c sqlite3-*.c fts?amal.c tclsqlite3.c
1150 rm -f sqlite3rc.h
1151 rm -f shell.c sqlite3ext.h
1152 rm -f sqlite3_analyzer sqlite3_analyzer.exe sqlite3_analyzer.c
1153 rm -f sqlite3_expert sqlite3_expert.exe
1154 rm -f sqlite-*-output.vsix
1155 rm -f mptester mptester.exe
1156 rm -f fuzzershell fuzzershell.exe
1157 rm -f fuzzcheck fuzzcheck.exe
1158 rm -f sessionfuzz
1159 rm -f sqldiff sqldiff.exe
1160 rm -f fts5.* fts5parse.*
1161 rm -f lsm.h lsm1.c
1162 rm -f threadtest5