changelog update
[sqlcipher.git] / main.mk
blob35e42d6ca2a14525306aa1eea81cedacbcd4102a
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_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_unix.c \
138 $(TOP)/src/os_win.c \
139 $(TOP)/src/os_win.h \
140 $(TOP)/src/pager.c \
141 $(TOP)/src/pager.h \
142 $(TOP)/src/parse.y \
143 $(TOP)/src/pcache.c \
144 $(TOP)/src/pcache.h \
145 $(TOP)/src/pcache1.c \
146 $(TOP)/src/pragma.c \
147 $(TOP)/src/pragma.h \
148 $(TOP)/src/prepare.c \
149 $(TOP)/src/printf.c \
150 $(TOP)/src/random.c \
151 $(TOP)/src/resolve.c \
152 $(TOP)/src/rowset.c \
153 $(TOP)/src/select.c \
154 $(TOP)/src/status.c \
155 $(TOP)/src/shell.c.in \
156 $(TOP)/src/sqlite.h.in \
157 $(TOP)/src/sqlite3ext.h \
158 $(TOP)/src/sqliteInt.h \
159 $(TOP)/src/sqliteLimit.h \
160 $(TOP)/src/table.c \
161 $(TOP)/src/tclsqlite.c \
162 $(TOP)/src/threads.c \
163 $(TOP)/src/tokenize.c \
164 $(TOP)/src/treeview.c \
165 $(TOP)/src/trigger.c \
166 $(TOP)/src/utf.c \
167 $(TOP)/src/update.c \
168 $(TOP)/src/upsert.c \
169 $(TOP)/src/util.c \
170 $(TOP)/src/vacuum.c \
171 $(TOP)/src/vdbe.c \
172 $(TOP)/src/vdbe.h \
173 $(TOP)/src/vdbeapi.c \
174 $(TOP)/src/vdbeaux.c \
175 $(TOP)/src/vdbeblob.c \
176 $(TOP)/src/vdbemem.c \
177 $(TOP)/src/vdbesort.c \
178 $(TOP)/src/vdbetrace.c \
179 $(TOP)/src/vdbevtab.c \
180 $(TOP)/src/vdbeInt.h \
181 $(TOP)/src/vtab.c \
182 $(TOP)/src/vxworks.h \
183 $(TOP)/src/wal.c \
184 $(TOP)/src/wal.h \
185 $(TOP)/src/walker.c \
186 $(TOP)/src/where.c \
187 $(TOP)/src/wherecode.c \
188 $(TOP)/src/whereexpr.c \
189 $(TOP)/src/whereInt.h \
190 $(TOP)/src/window.c
192 # Source code for extensions
194 SRC += \
195 $(TOP)/ext/fts1/fts1.c \
196 $(TOP)/ext/fts1/fts1.h \
197 $(TOP)/ext/fts1/fts1_hash.c \
198 $(TOP)/ext/fts1/fts1_hash.h \
199 $(TOP)/ext/fts1/fts1_porter.c \
200 $(TOP)/ext/fts1/fts1_tokenizer.h \
201 $(TOP)/ext/fts1/fts1_tokenizer1.c
202 SRC += \
203 $(TOP)/ext/fts2/fts2.c \
204 $(TOP)/ext/fts2/fts2.h \
205 $(TOP)/ext/fts2/fts2_hash.c \
206 $(TOP)/ext/fts2/fts2_hash.h \
207 $(TOP)/ext/fts2/fts2_icu.c \
208 $(TOP)/ext/fts2/fts2_porter.c \
209 $(TOP)/ext/fts2/fts2_tokenizer.h \
210 $(TOP)/ext/fts2/fts2_tokenizer.c \
211 $(TOP)/ext/fts2/fts2_tokenizer1.c
212 SRC += \
213 $(TOP)/ext/fts3/fts3.c \
214 $(TOP)/ext/fts3/fts3.h \
215 $(TOP)/ext/fts3/fts3Int.h \
216 $(TOP)/ext/fts3/fts3_aux.c \
217 $(TOP)/ext/fts3/fts3_expr.c \
218 $(TOP)/ext/fts3/fts3_hash.c \
219 $(TOP)/ext/fts3/fts3_hash.h \
220 $(TOP)/ext/fts3/fts3_icu.c \
221 $(TOP)/ext/fts3/fts3_porter.c \
222 $(TOP)/ext/fts3/fts3_snippet.c \
223 $(TOP)/ext/fts3/fts3_tokenizer.h \
224 $(TOP)/ext/fts3/fts3_tokenizer.c \
225 $(TOP)/ext/fts3/fts3_tokenizer1.c \
226 $(TOP)/ext/fts3/fts3_tokenize_vtab.c \
227 $(TOP)/ext/fts3/fts3_unicode.c \
228 $(TOP)/ext/fts3/fts3_unicode2.c \
229 $(TOP)/ext/fts3/fts3_write.c
230 SRC += \
231 $(TOP)/ext/icu/sqliteicu.h \
232 $(TOP)/ext/icu/icu.c
233 SRC += \
234 $(TOP)/ext/rtree/sqlite3rtree.h \
235 $(TOP)/ext/rtree/rtree.h \
236 $(TOP)/ext/rtree/rtree.c \
237 $(TOP)/ext/rtree/geopoly.c
238 SRC += \
239 $(TOP)/ext/session/sqlite3session.c \
240 $(TOP)/ext/session/sqlite3session.h
241 SRC += \
242 $(TOP)/ext/userauth/userauth.c \
243 $(TOP)/ext/userauth/sqlite3userauth.h
244 SRC += \
245 $(TOP)/ext/rbu/sqlite3rbu.c \
246 $(TOP)/ext/rbu/sqlite3rbu.h
247 SRC += \
248 $(TOP)/ext/misc/stmt.c
251 # FTS5 things
253 FTS5_HDR = \
254 $(TOP)/ext/fts5/fts5.h \
255 $(TOP)/ext/fts5/fts5Int.h \
256 fts5parse.h
258 FTS5_SRC = \
259 $(TOP)/ext/fts5/fts5_aux.c \
260 $(TOP)/ext/fts5/fts5_buffer.c \
261 $(TOP)/ext/fts5/fts5_main.c \
262 $(TOP)/ext/fts5/fts5_config.c \
263 $(TOP)/ext/fts5/fts5_expr.c \
264 $(TOP)/ext/fts5/fts5_hash.c \
265 $(TOP)/ext/fts5/fts5_index.c \
266 fts5parse.c \
267 $(TOP)/ext/fts5/fts5_storage.c \
268 $(TOP)/ext/fts5/fts5_tokenize.c \
269 $(TOP)/ext/fts5/fts5_unicode2.c \
270 $(TOP)/ext/fts5/fts5_varint.c \
271 $(TOP)/ext/fts5/fts5_vocab.c \
273 LSM1_SRC = \
274 $(TOP)/ext/lsm1/lsm.h \
275 $(TOP)/ext/lsm1/lsmInt.h \
276 $(TOP)/ext/lsm1/lsm_ckpt.c \
277 $(TOP)/ext/lsm1/lsm_file.c \
278 $(TOP)/ext/lsm1/lsm_log.c \
279 $(TOP)/ext/lsm1/lsm_main.c \
280 $(TOP)/ext/lsm1/lsm_mem.c \
281 $(TOP)/ext/lsm1/lsm_mutex.c \
282 $(TOP)/ext/lsm1/lsm_shared.c \
283 $(TOP)/ext/lsm1/lsm_sorted.c \
284 $(TOP)/ext/lsm1/lsm_str.c \
285 $(TOP)/ext/lsm1/lsm_tree.c \
286 $(TOP)/ext/lsm1/lsm_unix.c \
287 $(TOP)/ext/lsm1/lsm_varint.c \
288 $(TOP)/ext/lsm1/lsm_vtab.c \
289 $(TOP)/ext/lsm1/lsm_win32.c
292 # Generated source code files
294 SRC += \
295 keywordhash.h \
296 opcodes.c \
297 opcodes.h \
298 parse.c \
299 parse.h \
300 shell.c \
301 sqlite3.h
304 # Source code to the test files.
306 TESTSRC = \
307 $(TOP)/ext/expert/sqlite3expert.c \
308 $(TOP)/ext/expert/test_expert.c \
309 $(TOP)/ext/fts3/fts3_term.c \
310 $(TOP)/ext/fts3/fts3_test.c \
311 $(TOP)/ext/rbu/test_rbu.c \
312 $(TOP)/src/test1.c \
313 $(TOP)/src/test2.c \
314 $(TOP)/src/test3.c \
315 $(TOP)/src/test4.c \
316 $(TOP)/src/test5.c \
317 $(TOP)/src/test6.c \
318 $(TOP)/src/test7.c \
319 $(TOP)/src/test8.c \
320 $(TOP)/src/test9.c \
321 $(TOP)/src/test_autoext.c \
322 $(TOP)/src/test_async.c \
323 $(TOP)/src/test_backup.c \
324 $(TOP)/src/test_bestindex.c \
325 $(TOP)/src/test_blob.c \
326 $(TOP)/src/test_btree.c \
327 $(TOP)/src/test_config.c \
328 $(TOP)/src/test_delete.c \
329 $(TOP)/src/test_demovfs.c \
330 $(TOP)/src/test_devsym.c \
331 $(TOP)/src/test_fs.c \
332 $(TOP)/src/test_func.c \
333 $(TOP)/src/test_hexio.c \
334 $(TOP)/src/test_init.c \
335 $(TOP)/src/test_intarray.c \
336 $(TOP)/src/test_journal.c \
337 $(TOP)/src/test_malloc.c \
338 $(TOP)/src/test_md5.c \
339 $(TOP)/src/test_multiplex.c \
340 $(TOP)/src/test_mutex.c \
341 $(TOP)/src/test_onefile.c \
342 $(TOP)/src/test_osinst.c \
343 $(TOP)/src/test_pcache.c \
344 $(TOP)/src/test_quota.c \
345 $(TOP)/src/test_rtree.c \
346 $(TOP)/src/test_schema.c \
347 $(TOP)/src/test_server.c \
348 $(TOP)/src/test_sqllog.c \
349 $(TOP)/src/test_superlock.c \
350 $(TOP)/src/test_syscall.c \
351 $(TOP)/src/test_tclsh.c \
352 $(TOP)/src/test_tclvar.c \
353 $(TOP)/src/test_thread.c \
354 $(TOP)/src/test_vdbecov.c \
355 $(TOP)/src/test_vfs.c \
356 $(TOP)/src/test_windirent.c \
357 $(TOP)/src/test_window.c \
358 $(TOP)/src/test_wsd.c
360 # Extensions to be statically loaded.
362 TESTSRC += \
363 $(TOP)/ext/misc/amatch.c \
364 $(TOP)/ext/misc/appendvfs.c \
365 $(TOP)/ext/misc/carray.c \
366 $(TOP)/ext/misc/cksumvfs.c \
367 $(TOP)/ext/misc/closure.c \
368 $(TOP)/ext/misc/csv.c \
369 $(TOP)/ext/misc/decimal.c \
370 $(TOP)/ext/misc/eval.c \
371 $(TOP)/ext/misc/explain.c \
372 $(TOP)/ext/misc/fileio.c \
373 $(TOP)/ext/misc/fuzzer.c \
374 $(TOP)/ext/misc/ieee754.c \
375 $(TOP)/ext/misc/mmapwarm.c \
376 $(TOP)/ext/misc/nextchar.c \
377 $(TOP)/ext/misc/normalize.c \
378 $(TOP)/ext/misc/percentile.c \
379 $(TOP)/ext/misc/prefixes.c \
380 $(TOP)/ext/misc/qpvtab.c \
381 $(TOP)/ext/misc/regexp.c \
382 $(TOP)/ext/misc/remember.c \
383 $(TOP)/ext/misc/series.c \
384 $(TOP)/ext/misc/spellfix.c \
385 $(TOP)/ext/misc/totype.c \
386 $(TOP)/ext/misc/unionvtab.c \
387 $(TOP)/ext/misc/wholenumber.c \
388 $(TOP)/ext/misc/zipfile.c \
389 $(TOP)/ext/fts5/fts5_tcl.c \
390 $(TOP)/ext/fts5/fts5_test_mi.c \
391 $(TOP)/ext/fts5/fts5_test_tok.c \
392 $(TOP)/ext/rtree/test_rtreedoc.c
395 #TESTSRC += $(TOP)/ext/fts2/fts2_tokenizer.c
396 #TESTSRC += $(TOP)/ext/fts3/fts3_tokenizer.c
398 TESTSRC2 = \
399 $(TOP)/src/attach.c \
400 $(TOP)/src/backup.c \
401 $(TOP)/src/btree.c \
402 $(TOP)/src/build.c \
403 $(TOP)/src/date.c \
404 $(TOP)/src/dbpage.c \
405 $(TOP)/src/dbstat.c \
406 $(TOP)/src/expr.c \
407 $(TOP)/src/func.c \
408 $(TOP)/src/global.c \
409 $(TOP)/src/insert.c \
410 $(TOP)/src/wal.c \
411 $(TOP)/src/main.c \
412 $(TOP)/src/mem5.c \
413 $(TOP)/src/os.c \
414 $(TOP)/src/os_unix.c \
415 $(TOP)/src/os_win.c \
416 $(TOP)/src/pager.c \
417 $(TOP)/src/pragma.c \
418 $(TOP)/src/prepare.c \
419 $(TOP)/src/printf.c \
420 $(TOP)/src/random.c \
421 $(TOP)/src/pcache.c \
422 $(TOP)/src/pcache1.c \
423 $(TOP)/src/select.c \
424 $(TOP)/src/threads.c \
425 $(TOP)/src/tokenize.c \
426 $(TOP)/src/treeview.c \
427 $(TOP)/src/utf.c \
428 $(TOP)/src/util.c \
429 $(TOP)/src/vdbeapi.c \
430 $(TOP)/src/vdbeaux.c \
431 $(TOP)/src/vdbe.c \
432 $(TOP)/src/vdbemem.c \
433 $(TOP)/src/vdbevtab.c \
434 $(TOP)/src/where.c \
435 $(TOP)/src/wherecode.c \
436 $(TOP)/src/whereexpr.c \
437 parse.c \
438 $(TOP)/ext/fts3/fts3.c \
439 $(TOP)/ext/fts3/fts3_aux.c \
440 $(TOP)/ext/fts3/fts3_expr.c \
441 $(TOP)/ext/fts3/fts3_tokenizer.c \
442 $(TOP)/ext/fts3/fts3_write.c \
443 $(TOP)/ext/async/sqlite3async.c \
444 $(TOP)/ext/misc/stmt.c \
445 $(TOP)/ext/session/sqlite3session.c \
446 $(TOP)/ext/session/test_session.c \
447 fts5.c
449 # Header files used by all library source files.
451 HDR = \
452 $(TOP)/src/btree.h \
453 $(TOP)/src/btreeInt.h \
454 $(TOP)/src/hash.h \
455 $(TOP)/src/hwtime.h \
456 keywordhash.h \
457 $(TOP)/src/msvc.h \
458 $(TOP)/src/mutex.h \
459 opcodes.h \
460 $(TOP)/src/os.h \
461 $(TOP)/src/os_common.h \
462 $(TOP)/src/os_setup.h \
463 $(TOP)/src/os_win.h \
464 $(TOP)/src/pager.h \
465 $(TOP)/src/pcache.h \
466 parse.h \
467 $(TOP)/src/pragma.h \
468 sqlite3.h \
469 $(TOP)/src/sqlite3ext.h \
470 $(TOP)/src/sqliteInt.h \
471 $(TOP)/src/sqliteLimit.h \
472 $(TOP)/src/vdbe.h \
473 $(TOP)/src/vdbeInt.h \
474 $(TOP)/src/vxworks.h \
475 $(TOP)/src/whereInt.h
477 # Header files used by extensions
479 EXTHDR += \
480 $(TOP)/ext/fts1/fts1.h \
481 $(TOP)/ext/fts1/fts1_hash.h \
482 $(TOP)/ext/fts1/fts1_tokenizer.h
483 EXTHDR += \
484 $(TOP)/ext/fts2/fts2.h \
485 $(TOP)/ext/fts2/fts2_hash.h \
486 $(TOP)/ext/fts2/fts2_tokenizer.h
487 EXTHDR += \
488 $(TOP)/ext/fts3/fts3.h \
489 $(TOP)/ext/fts3/fts3Int.h \
490 $(TOP)/ext/fts3/fts3_hash.h \
491 $(TOP)/ext/fts3/fts3_tokenizer.h
492 EXTHDR += \
493 $(TOP)/ext/rtree/rtree.h \
494 $(TOP)/ext/rtree/geopoly.c
495 EXTHDR += \
496 $(TOP)/ext/icu/sqliteicu.h
497 EXTHDR += \
498 $(TOP)/ext/fts5/fts5Int.h \
499 fts5parse.h \
500 $(TOP)/ext/fts5/fts5.h
501 EXTHDR += \
502 $(TOP)/ext/userauth/sqlite3userauth.h
504 # executables needed for testing
506 TESTPROGS = \
507 testfixture$(EXE) \
508 sqlite3$(EXE) \
509 sqlite3_analyzer$(EXE) \
510 sqlite3_checker$(EXE) \
511 sqldiff$(EXE) \
512 dbhash$(EXE) \
513 sqltclsh$(EXE)
515 # Databases containing fuzzer test cases
517 FUZZDATA = \
518 $(TOP)/test/fuzzdata1.db \
519 $(TOP)/test/fuzzdata2.db \
520 $(TOP)/test/fuzzdata3.db \
521 $(TOP)/test/fuzzdata4.db \
522 $(TOP)/test/fuzzdata5.db \
523 $(TOP)/test/fuzzdata6.db \
524 $(TOP)/test/fuzzdata7.db \
525 $(TOP)/test/fuzzdata8.db
527 # Standard options to testfixture
529 TESTOPTS = --verbose=file --output=test-out.txt
531 # Extra compiler options for various shell tools
533 SHELL_OPT += -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5
534 SHELL_OPT += -DSQLITE_ENABLE_RTREE
535 SHELL_OPT += -DSQLITE_ENABLE_EXPLAIN_COMMENTS
536 SHELL_OPT += -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
537 SHELL_OPT += -DSQLITE_ENABLE_STMTVTAB
538 SHELL_OPT += -DSQLITE_ENABLE_DBPAGE_VTAB
539 SHELL_OPT += -DSQLITE_ENABLE_DBSTAT_VTAB
540 SHELL_OPT += -DSQLITE_ENABLE_BYTECODE_VTAB
541 SHELL_OPT += -DSQLITE_ENABLE_OFFSET_SQL_FUNC
542 FUZZCHECK_OPT = -DSQLITE_ENABLE_MEMSYS5
543 FUZZCHECK_OPT += -DSQLITE_MAX_MEMORY=50000000
544 FUZZCHECK_OPT += -DSQLITE_PRINTF_PRECISION_LIMIT=1000
545 FUZZCHECK_OPT += -DSQLITE_ENABLE_FTS4
546 FUZZCHECK_OPT += -DSQLITE_ENABLE_RTREE
547 FUZZCHECK_OPT += -DSQLITE_ENABLE_GEOPOLY
548 FUZZCHECK_OPT += -DSQLITE_ENABLE_DBSTAT_VTAB
549 FUZZCHECK_OPT += -DSQLITE_ENABLE_BYTECODE_VTAB
550 FUZZSRC += $(TOP)/test/fuzzcheck.c
551 FUZZSRC += $(TOP)/test/ossfuzz.c
552 FUZZSRC += $(TOP)/test/fuzzinvariants.c
553 DBFUZZ_OPT =
554 KV_OPT = -DSQLITE_THREADSAFE=0 -DSQLITE_DIRECT_OVERFLOW_READ
555 ST_OPT = -DSQLITE_THREADSAFE=0
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 sqlite3ext.h libsqlite3.a sqlite3$(EXE)
562 libsqlite3.a: sqlite3.h $(LIBOBJ)
563 $(AR) libsqlite3.a $(LIBOBJ)
564 $(RANLIB) libsqlite3.a
566 sqlite3$(EXE): sqlite3.h libsqlite3.a shell.c
567 $(TCCX) $(READLINE_FLAGS) -o sqlite3$(EXE) $(SHELL_OPT) \
568 shell.c libsqlite3.a $(LIBREADLINE) $(TLIBS) $(THREADLIB)
570 sqldiff$(EXE): $(TOP)/tool/sqldiff.c sqlite3.c sqlite3.h
571 $(TCCX) -o sqldiff$(EXE) -DSQLITE_THREADSAFE=0 \
572 $(TOP)/tool/sqldiff.c sqlite3.c $(TLIBS) $(THREADLIB)
574 dbhash$(EXE): $(TOP)/tool/dbhash.c sqlite3.c sqlite3.h
575 $(TCCX) -o dbhash$(EXE) -DSQLITE_THREADSAFE=0 \
576 $(TOP)/tool/dbhash.c sqlite3.c $(TLIBS) $(THREADLIB)
578 scrub$(EXE): $(TOP)/ext/misc/scrub.c sqlite3.o
579 $(TCC) -I. -DSCRUB_STANDALONE -o scrub$(EXE) $(TOP)/ext/misc/scrub.c sqlite3.o $(THREADLIB)
581 srcck1$(EXE): $(TOP)/tool/srcck1.c
582 $(BCC) -o srcck1$(EXE) $(TOP)/tool/srcck1.c
584 sourcetest: srcck1$(EXE) sqlite3.c
585 ./srcck1 sqlite3.c
587 fuzzershell$(EXE): $(TOP)/tool/fuzzershell.c sqlite3.c sqlite3.h
588 $(TCCX) -o fuzzershell$(EXE) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
589 $(FUZZERSHELL_OPT) $(TOP)/tool/fuzzershell.c sqlite3.c \
590 $(TLIBS) $(THREADLIB)
592 dbfuzz$(EXE): $(TOP)/test/dbfuzz.c sqlite3.c sqlite3.h
593 $(TCCX) -o dbfuzz$(EXE) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
594 $(DBFUZZ_OPT) $(TOP)/test/dbfuzz.c sqlite3.c \
595 $(TLIBS) $(THREADLIB)
597 DBFUZZ2_OPTS = \
598 -DSQLITE_THREADSAFE=0 \
599 -DSQLITE_OMIT_LOAD_EXTENSION \
600 -DSQLITE_DEBUG \
601 -DSQLITE_ENABLE_DBSTAT_VTAB \
602 -DSQLITE_ENABLE_BYTECODE_VTAB \
603 -DSQLITE_ENABLE_RTREE \
604 -DSQLITE_ENABLE_FTS4 \
605 -DSQLITE_ENABLE_FTS5
607 dbfuzz2$(EXE): $(TOP)/test/dbfuzz2.c sqlite3.c sqlite3.h
608 $(TCCX) -I. -g -O0 -DSTANDALONE -o dbfuzz2$(EXE) \
609 $(DBFUZZ2_OPTS) $(TOP)/test/dbfuzz2.c sqlite3.c $(TLIBS) $(THREADLIB)
611 fuzzcheck$(EXE): $(FUZZSRC) sqlite3.c sqlite3.h
612 $(TCCX) -o fuzzcheck$(EXE) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
613 -DSQLITE_ENABLE_MEMSYS5 $(FUZZCHECK_OPT) -DSQLITE_OSS_FUZZ \
614 $(FUZZSRC) sqlite3.c $(TLIBS) $(THREADLIB)
616 ossshell$(EXE): $(TOP)/test/ossfuzz.c $(TOP)/test/ossshell.c sqlite3.c sqlite3.h
617 $(TCCX) -o ossshell$(EXE) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
618 -DSQLITE_ENABLE_MEMSYS5 $(FUZZCHECK_OPT) \
619 $(TOP)/test/ossfuzz.c $(TOP)/test/ossshell.c sqlite3.c $(TLIBS) $(THREADLIB)
621 sessionfuzz$(EXE): $(TOP)/test/sessionfuzz.c sqlite3.c sqlite3.h
622 $(TCC) -o sessionfuzz$(EXE) $(TOP)/test/sessionfuzz.c -lz $(TLIBS) $(THREADLIB)
624 mptester$(EXE): sqlite3.c $(TOP)/mptest/mptest.c
625 $(TCCX) -o $@ -I. $(TOP)/mptest/mptest.c sqlite3.c \
626 $(TLIBS) $(THREADLIB)
628 MPTEST1=./mptester$(EXE) mptest1.db $(TOP)/mptest/crash01.test --repeat 20
629 MPTEST2=./mptester$(EXE) mptest2.db $(TOP)/mptest/multiwrite01.test --repeat 20
630 mptest: mptester$(EXE)
631 $(MPTEST1) --journalmode DELETE
632 $(MPTEST2) --journalmode WAL
633 $(MPTEST1) --journalmode WAL
634 $(MPTEST2) --journalmode PERSIST
635 $(MPTEST1) --journalmode PERSIST
636 $(MPTEST2) --journalmode TRUNCATE
637 $(MPTEST1) --journalmode TRUNCATE
638 $(MPTEST2) --journalmode DELETE
640 sqlite3.o: sqlite3.c
641 $(TCCX) -I. -c sqlite3.c
643 # This target creates a directory named "tsrc" and fills it with
644 # copies of all of the C source code and header files needed to
645 # build on the target system. Some of the C source code and header
646 # files are automatically generated. This target takes care of
647 # all that automatic generation.
649 target_source: $(SRC) $(TOP)/tool/vdbe-compress.tcl fts5.c
650 rm -rf tsrc
651 mkdir tsrc
652 cp -f $(SRC) tsrc
653 rm tsrc/sqlite.h.in tsrc/parse.y
654 tclsh $(TOP)/tool/vdbe-compress.tcl $(OPTS) <tsrc/vdbe.c >vdbe.new
655 mv vdbe.new tsrc/vdbe.c
656 cp fts5.c fts5.h tsrc
657 touch target_source
659 sqlite3.c: target_source $(TOP)/tool/mksqlite3c.tcl
660 tclsh $(TOP)/tool/mksqlite3c.tcl
661 cp tsrc/sqlite3ext.h .
662 cp $(TOP)/ext/session/sqlite3session.h .
663 echo '#ifndef USE_SYSTEM_SQLITE' >tclsqlite3.c
664 cat sqlite3.c >>tclsqlite3.c
665 echo '#endif /* USE_SYSTEM_SQLITE */' >>tclsqlite3.c
666 cat $(TOP)/src/tclsqlite.c >>tclsqlite3.c
668 sqlite3ext.h: target_source
669 cp tsrc/sqlite3ext.h .
671 sqlite3.c-debug: target_source $(TOP)/tool/mksqlite3c.tcl
672 tclsh $(TOP)/tool/mksqlite3c.tcl --linemacros=1
673 echo '#ifndef USE_SYSTEM_SQLITE' >tclsqlite3.c
674 cat sqlite3.c >>tclsqlite3.c
675 echo '#endif /* USE_SYSTEM_SQLITE */' >>tclsqlite3.c
676 echo '#line 1 "tclsqlite.c"' >>tclsqlite3.c
677 cat $(TOP)/src/tclsqlite.c >>tclsqlite3.c
679 sqlite3-all.c: sqlite3.c $(TOP)/tool/split-sqlite3c.tcl
680 tclsh $(TOP)/tool/split-sqlite3c.tcl
682 fts2amal.c: target_source $(TOP)/ext/fts2/mkfts2amal.tcl
683 tclsh $(TOP)/ext/fts2/mkfts2amal.tcl
685 # Rules to build the LEMON compiler generator
687 lemon: $(TOP)/tool/lemon.c $(TOP)/tool/lempar.c
688 $(BCC) -o lemon $(TOP)/tool/lemon.c
689 cp $(TOP)/tool/lempar.c .
691 # A tool to generate the source-id
693 mksourceid: $(TOP)/tool/mksourceid.c
694 $(BCC) -o mksourceid $(TOP)/tool/mksourceid.c
696 # Rules to build individual *.o files from generated *.c files. This
697 # applies to:
699 # parse.o
700 # opcodes.o
702 %.o: %.c $(HDR)
703 $(TCCX) -c $<
705 # Rules to build individual *.o files from files in the src directory.
707 %.o: $(TOP)/src/%.c $(HDR)
708 $(TCCX) -c $<
710 tclsqlite.o: $(TOP)/src/tclsqlite.c $(HDR)
711 $(TCCX) $(TCL_FLAGS) -c $(TOP)/src/tclsqlite.c
715 # Rules to build opcodes.c and opcodes.h
717 opcodes.c: opcodes.h $(TOP)/tool/mkopcodec.tcl
718 tclsh $(TOP)/tool/mkopcodec.tcl opcodes.h >opcodes.c
720 opcodes.h: parse.h $(TOP)/src/vdbe.c $(TOP)/tool/mkopcodeh.tcl
721 cat parse.h $(TOP)/src/vdbe.c | \
722 tclsh $(TOP)/tool/mkopcodeh.tcl >opcodes.h
724 # Rules to build parse.c and parse.h - the outputs of lemon.
726 parse.h: parse.c
728 parse.c: $(TOP)/src/parse.y lemon
729 cp $(TOP)/src/parse.y .
730 ./lemon -s $(OPTS) parse.y
732 sqlite3.h: $(TOP)/src/sqlite.h.in $(TOP)/manifest mksourceid $(TOP)/VERSION $(TOP)/ext/rtree/sqlite3rtree.h
733 tclsh $(TOP)/tool/mksqlite3h.tcl $(TOP) >sqlite3.h
735 sqlite3rc.h: $(TOP)/src/sqlite3.rc $(TOP)/VERSION
736 echo '#ifndef SQLITE_RESOURCE_VERSION' >$@
737 echo -n '#define SQLITE_RESOURCE_VERSION ' >>$@
738 cat $(TOP)/VERSION | tclsh $(TOP)/tool/replace.tcl exact . , >>$@
739 echo '#endif' >>sqlite3rc.h
741 keywordhash.h: $(TOP)/tool/mkkeywordhash.c
742 $(BCC) -o mkkeywordhash $(OPTS) $(TOP)/tool/mkkeywordhash.c
743 ./mkkeywordhash >keywordhash.h
745 # Source files that go into making shell.c
746 SHELL_SRC = \
747 $(TOP)/src/shell.c.in \
748 $(TOP)/ext/misc/appendvfs.c \
749 $(TOP)/ext/misc/completion.c \
750 $(TOP)/ext/misc/decimal.c \
751 $(TOP)/ext/misc/fileio.c \
752 $(TOP)/ext/misc/ieee754.c \
753 $(TOP)/ext/misc/regexp.c \
754 $(TOP)/ext/misc/series.c \
755 $(TOP)/ext/misc/shathree.c \
756 $(TOP)/ext/misc/sqlar.c \
757 $(TOP)/ext/misc/uint.c \
758 $(TOP)/ext/expert/sqlite3expert.c \
759 $(TOP)/ext/expert/sqlite3expert.h \
760 $(TOP)/ext/misc/zipfile.c \
761 $(TOP)/ext/misc/memtrace.c \
762 $(TOP)/ext/misc/dbdata.c \
763 $(TOP)/src/test_windirent.c
765 shell.c: $(SHELL_SRC) $(TOP)/tool/mkshellc.tcl
766 tclsh $(TOP)/tool/mkshellc.tcl >shell.c
770 # Rules to build the extension objects.
772 icu.o: $(TOP)/ext/icu/icu.c $(HDR) $(EXTHDR)
773 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/icu/icu.c
775 fts2.o: $(TOP)/ext/fts2/fts2.c $(HDR) $(EXTHDR)
776 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2.c
778 fts2_hash.o: $(TOP)/ext/fts2/fts2_hash.c $(HDR) $(EXTHDR)
779 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_hash.c
781 fts2_icu.o: $(TOP)/ext/fts2/fts2_icu.c $(HDR) $(EXTHDR)
782 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_icu.c
784 fts2_porter.o: $(TOP)/ext/fts2/fts2_porter.c $(HDR) $(EXTHDR)
785 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_porter.c
787 fts2_tokenizer.o: $(TOP)/ext/fts2/fts2_tokenizer.c $(HDR) $(EXTHDR)
788 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_tokenizer.c
790 fts2_tokenizer1.o: $(TOP)/ext/fts2/fts2_tokenizer1.c $(HDR) $(EXTHDR)
791 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_tokenizer1.c
793 fts3.o: $(TOP)/ext/fts3/fts3.c $(HDR) $(EXTHDR)
794 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3.c
796 fts3_aux.o: $(TOP)/ext/fts3/fts3_aux.c $(HDR) $(EXTHDR)
797 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_aux.c
799 fts3_expr.o: $(TOP)/ext/fts3/fts3_expr.c $(HDR) $(EXTHDR)
800 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_expr.c
802 fts3_hash.o: $(TOP)/ext/fts3/fts3_hash.c $(HDR) $(EXTHDR)
803 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_hash.c
805 fts3_icu.o: $(TOP)/ext/fts3/fts3_icu.c $(HDR) $(EXTHDR)
806 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_icu.c
808 fts3_snippet.o: $(TOP)/ext/fts3/fts3_snippet.c $(HDR) $(EXTHDR)
809 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_snippet.c
811 fts3_porter.o: $(TOP)/ext/fts3/fts3_porter.c $(HDR) $(EXTHDR)
812 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_porter.c
814 fts3_tokenizer.o: $(TOP)/ext/fts3/fts3_tokenizer.c $(HDR) $(EXTHDR)
815 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer.c
817 fts3_tokenizer1.o: $(TOP)/ext/fts3/fts3_tokenizer1.c $(HDR) $(EXTHDR)
818 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer1.c
820 fts3_tokenize_vtab.o: $(TOP)/ext/fts3/fts3_tokenize_vtab.c $(HDR) $(EXTHDR)
821 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenize_vtab.c
823 fts3_unicode.o: $(TOP)/ext/fts3/fts3_unicode.c $(HDR) $(EXTHDR)
824 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_unicode.c
826 fts3_unicode2.o: $(TOP)/ext/fts3/fts3_unicode2.c $(HDR) $(EXTHDR)
827 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_unicode2.c
829 fts3_write.o: $(TOP)/ext/fts3/fts3_write.c $(HDR) $(EXTHDR)
830 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_write.c
832 fts5.o: fts5.c sqlite3ext.h sqlite3.h
833 $(TCCX) -DSQLITE_CORE -c fts5.c
835 stmt.o: $(TOP)/ext/misc/stmt.c sqlite3ext.h sqlite3.h
836 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/misc/stmt.c
838 rtree.o: $(TOP)/ext/rtree/rtree.c $(HDR) $(EXTHDR)
839 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/rtree/rtree.c
843 fts5parse.c: $(TOP)/ext/fts5/fts5parse.y lemon
844 cp $(TOP)/ext/fts5/fts5parse.y .
845 rm -f fts5parse.h
846 ./lemon $(OPTS) fts5parse.y
848 fts5parse.h: fts5parse.c
850 fts5.c: $(FTS5_SRC) $(FTS5_HDR)
851 tclsh $(TOP)/ext/fts5/tool/mkfts5c.tcl
852 cp $(TOP)/ext/fts5/fts5.h .
854 lsm1.c: $(LSM1_SRC)
855 tclsh $(TOP)/ext/lsm1/tool/mklsm1c.tcl
856 cp $(TOP)/ext/lsm1/lsm.h .
858 userauth.o: $(TOP)/ext/userauth/userauth.c $(HDR) $(EXTHDR)
859 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/userauth/userauth.c
861 sqlite3session.o: $(TOP)/ext/session/sqlite3session.c $(HDR) $(EXTHDR)
862 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/session/sqlite3session.c
864 sqlite3rbu.o: $(TOP)/ext/rbu/sqlite3rbu.c $(HDR) $(EXTHDR)
865 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/rbu/sqlite3rbu.c
867 # Rules for building test programs and for running tests
869 tclsqlite3: $(TOP)/src/tclsqlite.c libsqlite3.a
870 $(TCCX) $(TCL_FLAGS) -DTCLSH -o tclsqlite3 \
871 $(TOP)/src/tclsqlite.c libsqlite3.a $(LIBTCL) $(THREADLIB)
873 sqlite3_analyzer.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl $(TOP)/tool/sqlite3_analyzer.c.in $(TOP)/tool/mkccode.tcl
874 tclsh $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqlite3_analyzer.c.in >sqlite3_analyzer.c
876 sqlite3_analyzer$(EXE): sqlite3_analyzer.c
877 $(TCCX) $(TCL_FLAGS) sqlite3_analyzer.c -o $@ $(LIBTCL) $(THREADLIB)
879 sqltclsh.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/sqltclsh.tcl $(TOP)/ext/misc/appendvfs.c $(TOP)/tool/mkccode.tcl
880 tclsh $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqltclsh.c.in >sqltclsh.c
882 sqltclsh$(EXE): sqltclsh.c
883 $(TCCX) $(TCL_FLAGS) sqltclsh.c -o $@ $(LIBTCL) $(THREADLIB)
885 sqlite3_expert$(EXE): $(TOP)/ext/expert/sqlite3expert.h $(TOP)/ext/expert/sqlite3expert.c $(TOP)/ext/expert/expert.c sqlite3.c
886 $(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)
888 CHECKER_DEPS =\
889 $(TOP)/tool/mkccode.tcl \
890 sqlite3.c \
891 $(TOP)/src/tclsqlite.c \
892 $(TOP)/ext/repair/sqlite3_checker.tcl \
893 $(TOP)/ext/repair/checkindex.c \
894 $(TOP)/ext/repair/checkfreelist.c \
895 $(TOP)/ext/misc/btreeinfo.c \
896 $(TOP)/ext/repair/sqlite3_checker.c.in
898 sqlite3_checker.c: $(CHECKER_DEPS)
899 tclsh $(TOP)/tool/mkccode.tcl $(TOP)/ext/repair/sqlite3_checker.c.in >$@
901 sqlite3_checker$(TEXE): sqlite3_checker.c
902 $(TCCX) $(TCL_FLAGS) sqlite3_checker.c -o $@ $(LIBTCL) $(THREADLIB)
904 dbdump$(EXE): $(TOP)/ext/misc/dbdump.c sqlite3.o
905 $(TCCX) -DDBDUMP_STANDALONE -o dbdump$(EXE) \
906 $(TOP)/ext/misc/dbdump.c sqlite3.o $(THREADLIB)
908 # Rules to build the 'testfixture' application.
910 TESTFIXTURE_FLAGS = -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
911 TESTFIXTURE_FLAGS += -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE
912 TESTFIXTURE_FLAGS += -DSQLITE_SERIES_CONSTRAINT_VERIFY=1
913 TESTFIXTURE_FLAGS += -DSQLITE_DEFAULT_PAGE_SIZE=1024
914 TESTFIXTURE_FLAGS += -DSQLITE_ENABLE_STMTVTAB
915 TESTFIXTURE_FLAGS += -DSQLITE_ENABLE_DBPAGE_VTAB
916 TESTFIXTURE_FLAGS += -DSQLITE_ENABLE_BYTECODE_VTAB
917 TESTFIXTURE_FLAGS += -DTCLSH_INIT_PROC=sqlite3TestInit
918 TESTFIXTURE_FLAGS += -DSQLITE_CKSUMVFS_STATIC
920 testfixture$(EXE): $(TESTSRC2) libsqlite3.a $(TESTSRC) $(TOP)/src/tclsqlite.c
921 $(TCCX) $(TCL_FLAGS) $(TESTFIXTURE_FLAGS) \
922 $(TESTSRC) $(TESTSRC2) $(TOP)/src/tclsqlite.c \
923 -o testfixture$(EXE) $(LIBTCL) libsqlite3.a $(THREADLIB)
925 amalgamation-testfixture$(EXE): sqlite3.c $(TESTSRC) $(TOP)/src/tclsqlite.c \
926 $(TOP)/ext/session/test_session.c
927 $(TCCX) $(TCL_FLAGS) $(TESTFIXTURE_FLAGS) \
928 $(TESTSRC) $(TOP)/src/tclsqlite.c sqlite3.c \
929 $(TOP)/ext/session/test_session.c \
930 -o testfixture$(EXE) $(LIBTCL) $(THREADLIB)
932 coretestprogs: $(TESTPROGS)
934 testprogs: coretestprogs srcck1$(EXE) fuzzcheck$(EXE) sessionfuzz$(EXE)
936 fulltest: $(TESTPROGS) fuzztest
937 ./testfixture$(EXE) $(TOP)/test/all.test $(TESTOPTS)
939 soaktest: $(TESTPROGS)
940 ./testfixture$(EXE) $(TOP)/test/all.test -soak=1 $(TESTOPTS)
942 fulltestonly: $(TESTPROGS) fuzztest
943 ./testfixture$(EXE) $(TOP)/test/full.test $(TESTOPTS)
945 queryplantest: testfixture$(EXE) sqlite3$(EXE)
946 ./testfixture$(EXE) $(TOP)/test/permutations.test queryplanner $(TESTOPTS)
948 fuzztest: fuzzcheck$(EXE) $(FUZZDATA) sessionfuzz$(EXE) $(TOP)/test/sessionfuzz-data1.db
949 ./fuzzcheck$(EXE) $(FUZZDATA)
950 ./sessionfuzz run $(TOP)/test/sessionfuzz-data1.db
952 valgrindfuzz: fuzzcheck$(EXE) $(FUZZDATA) sessionfuzz$(EXE) $(TOP)/test/sessionfuzz-data1.db
953 valgrind ./fuzzcheck$(EXE) --cell-size-check --limit-mem 10M $(FUZZDATA)
954 valgrind ./sessionfuzz run $(TOP)/test/sessionfuzz-data1.db
956 # The veryquick.test TCL tests.
958 tcltest: ./testfixture$(EXE)
959 ./testfixture$(EXE) $(TOP)/test/veryquick.test $(TESTOPTS)
961 # A very quick test using only testfixture and omitting all the slower
962 # tests. Designed to run in under 3 minutes on a workstation.
964 quicktest: ./testfixture$(EXE)
965 ./testfixture$(EXE) $(TOP)/test/extraquick.test $(TESTOPTS)
967 # The default test case. Runs most of the faster standard TCL tests,
968 # and fuzz tests, and sqlite3_analyzer and sqldiff tests.
969 test: fuzztest sourcetest $(TESTPROGS) tcltest
971 # Run a test using valgrind. This can take a really long time
972 # because valgrind is so much slower than a native machine.
974 valgrindtest: $(TESTPROGS) valgrindfuzz
975 OMIT_MISUSE=1 valgrind -v \
976 ./testfixture$(EXE) $(TOP)/test/permutations.test valgrind $(TESTOPTS)
978 # A very fast test that checks basic sanity. The name comes from
979 # the 60s-era electronics testing: "Turn it on and see if smoke
980 # comes out."
982 smoketest: $(TESTPROGS) fuzzcheck$(EXE)
983 ./testfixture$(EXE) $(TOP)/test/main.test $(TESTOPTS)
985 shelltest: $(TESTPROGS)
986 ./testfixture$(EXT) $(TOP)/test/permutations.test shell
988 # The next two rules are used to support the "threadtest" target. Building
989 # threadtest runs a few thread-safety tests that are implemented in C. This
990 # target is invoked by the releasetest.tcl script.
992 THREADTEST3_SRC = $(TOP)/test/threadtest3.c \
993 $(TOP)/test/tt3_checkpoint.c \
994 $(TOP)/test/tt3_index.c \
995 $(TOP)/test/tt3_vacuum.c \
996 $(TOP)/test/tt3_stress.c \
997 $(TOP)/test/tt3_lookaside1.c
999 threadtest3$(EXE): sqlite3.o $(THREADTEST3_SRC) $(TOP)/src/test_multiplex.c
1000 $(TCCX) $(TOP)/test/threadtest3.c $(TOP)/src/test_multiplex.c sqlite3.o -o $@ $(THREADLIB)
1002 threadtest: threadtest3$(EXE)
1003 ./threadtest3$(EXE)
1005 TEST_EXTENSION = $(SHPREFIX)testloadext.$(SO)
1006 $(TEST_EXTENSION): $(TOP)/src/test_loadext.c
1007 $(MKSHLIB) $(TOP)/src/test_loadext.c -o $(TEST_EXTENSION)
1009 extensiontest: testfixture$(EXE) $(TEST_EXTENSION)
1010 ./testfixture$(EXE) $(TOP)/test/loadext.test
1012 dbtotxt$(EXE): $(TOP)/tool/dbtotxt.c
1013 $(TCC) -o dbtotxt$(EXE) $(TOP)/tool/dbtotxt.c
1015 showdb$(EXE): $(TOP)/tool/showdb.c sqlite3.o
1016 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o showdb$(EXE) \
1017 $(TOP)/tool/showdb.c sqlite3.o $(THREADLIB)
1019 showstat4$(EXE): $(TOP)/tool/showstat4.c sqlite3.o
1020 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o showstat4$(EXE) \
1021 $(TOP)/tool/showstat4.c sqlite3.o $(THREADLIB)
1023 showjournal$(EXE): $(TOP)/tool/showjournal.c sqlite3.o
1024 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o showjournal$(EXE) \
1025 $(TOP)/tool/showjournal.c sqlite3.o $(THREADLIB)
1027 showwal$(EXE): $(TOP)/tool/showwal.c sqlite3.o
1028 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o showwal$(EXE) \
1029 $(TOP)/tool/showwal.c sqlite3.o $(THREADLIB)
1031 showshm$(EXE): $(TOP)/tool/showshm.c
1032 $(TCC) -o showshm$(EXE) $(TOP)/tool/showshm.c
1034 index_usage$(EXE): $(TOP)/tool/index_usage.c sqlite3.o
1035 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_DEPRECATED $(SHELL_OPTS) -o index_usage$(EXE) \
1036 $(TOP)/tool/index_usage.c sqlite3.o $(THREADLIB)
1038 changeset$(EXE): $(TOP)/ext/session/changeset.c sqlite3.o
1039 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o changeset$(EXE) \
1040 $(TOP)/ext/session/changeset.c sqlite3.o $(THREADLIB)
1042 changesetfuzz$(EXE): $(TOP)/ext/session/changesetfuzz.c sqlite3.o
1043 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o changesetfuzz$(EXE) \
1044 $(TOP)/ext/session/changesetfuzz.c sqlite3.o $(THREADLIB)
1046 fts3view$(EXE): $(TOP)/ext/fts3/tool/fts3view.c sqlite3.o
1047 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o fts3view$(EXE) \
1048 $(TOP)/ext/fts3/tool/fts3view.c sqlite3.o $(THREADLIB)
1050 rollback-test$(EXE): $(TOP)/tool/rollback-test.c sqlite3.o
1051 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o rollback-test$(EXE) \
1052 $(TOP)/tool/rollback-test.c sqlite3.o $(THREADLIB)
1054 atrc$(EXE): $(TOP)/test/atrc.c sqlite3.o
1055 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o atrc$(EXE) \
1056 $(TOP)/test/atrc.c sqlite3.o $(THREADLIB)
1058 LogEst$(EXE): $(TOP)/tool/logest.c sqlite3.h
1059 $(TCC) -o LogEst$(EXE) $(TOP)/tool/logest.c
1061 wordcount$(EXE): $(TOP)/test/wordcount.c sqlite3.c
1062 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o wordcount$(EXE) \
1063 $(TOP)/test/wordcount.c sqlite3.c
1065 speedtest1$(EXE): $(TOP)/test/speedtest1.c sqlite3.c
1066 $(TCCX) -I. $(ST_OPT) -o speedtest1$(EXE) $(TOP)/test/speedtest1.c sqlite3.c $(THREADLIB)
1068 kvtest$(EXE): $(TOP)/test/kvtest.c sqlite3.c
1069 $(TCCX) -I. $(KV_OPT) -o kvtest$(EXE) $(TOP)/test/kvtest.c sqlite3.c $(THREADLIB)
1071 rbu$(EXE): $(TOP)/ext/rbu/rbu.c $(TOP)/ext/rbu/sqlite3rbu.c sqlite3.o
1072 $(TCC) -I. -o rbu$(EXE) $(TOP)/ext/rbu/rbu.c sqlite3.o \
1073 $(THREADLIB)
1075 loadfts: $(TOP)/tool/loadfts.c libsqlite3.a
1076 $(TCC) $(TOP)/tool/loadfts.c libsqlite3.a -o loadfts $(THREADLIB)
1078 threadtest5: $(TOP)/test/threadtest5.c libsqlite3.a
1079 $(TCC) $(TOP)/test/threadtest5.c libsqlite3.a -o threadtest5 $(THREADLIB)
1081 # This target will fail if the SQLite amalgamation contains any exported
1082 # symbols that do not begin with "sqlite3_". It is run as part of the
1083 # releasetest.tcl script.
1085 checksymbols: sqlite3.o
1086 nm -g --defined-only sqlite3.o | grep -v " sqlite3_" ; test $$? -ne 0
1088 # Build the amalgamation-autoconf package. The amalamgation-tarball target builds
1089 # a tarball named for the version number. Ex: sqlite-autoconf-3110000.tar.gz.
1090 # The snapshot-tarball target builds a tarball named by the SHA1 hash
1092 amalgamation-tarball: sqlite3.c sqlite3rc.h
1093 TOP=$(TOP) sh $(TOP)/tool/mkautoconfamal.sh --normal
1095 snapshot-tarball: sqlite3.c sqlite3rc.h
1096 TOP=$(TOP) sh $(TOP)/tool/mkautoconfamal.sh --snapshot
1099 # Standard install and cleanup targets
1101 install: sqlite3 libsqlite3.a sqlite3.h
1102 mv sqlite3 /usr/bin
1103 mv libsqlite3.a /usr/lib
1104 mv sqlite3.h /usr/include
1106 clean:
1107 rm -f *.o sqlite3 sqlite3.exe libsqlite3.a sqlite3.h opcodes.*
1108 rm -f lemon lemon.exe lempar.c parse.* sqlite*.tar.gz
1109 rm -f mkkeywordhash mkkeywordhash.exe keywordhash.h
1110 rm -f $(PUBLISH)
1111 rm -f *.da *.bb *.bbg gmon.out
1112 rm -rf tsrc target_source
1113 rm -f testloadext.dll libtestloadext.so
1114 rm -f amalgamation-testfixture amalgamation-testfixture.exe
1115 rm -f fts3-testfixture fts3-testfixture.exe
1116 rm -f testfixture testfixture.exe
1117 rm -f threadtest3 threadtest3.exe
1118 rm -f LogEst LogEst.exe
1119 rm -f fts3view fts3view.exe
1120 rm -f rollback-test rollback-test.exe
1121 rm -f showdb showdb.exe
1122 rm -f showjournal showjournal.exe
1123 rm -f showstat4 showstat4.exe
1124 rm -f showwal showwal.exe
1125 rm -f changeset changeset.exe
1126 rm -f speedtest1 speedtest1.exe
1127 rm -f wordcount wordcount.exe
1128 rm -f rbu rbu.exe
1129 rm -f srcck1 srcck1.exe
1130 rm -f sqlite3.c sqlite3-*.c fts?amal.c tclsqlite3.c
1131 rm -f sqlite3rc.h
1132 rm -f shell.c sqlite3ext.h
1133 rm -f sqlite3_analyzer sqlite3_analyzer.exe sqlite3_analyzer.c
1134 rm -f sqlite3_expert sqlite3_expert.exe
1135 rm -f sqlite-*-output.vsix
1136 rm -f mptester mptester.exe
1137 rm -f fuzzershell fuzzershell.exe
1138 rm -f fuzzcheck fuzzcheck.exe
1139 rm -f sessionfuzz
1140 rm -f sqldiff sqldiff.exe
1141 rm -f fts5.* fts5parse.*
1142 rm -f lsm.h lsm1.c
1143 rm -f threadtest5