Snapshot of upstream SQLite 3.45.3
[sqlcipher.git] / main.mk
blob081e0cd3b5b4e83d37a8aab0ec6bd3f318223dab
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/fts3/fts3.c \
197 $(TOP)/ext/fts3/fts3.h \
198 $(TOP)/ext/fts3/fts3Int.h \
199 $(TOP)/ext/fts3/fts3_aux.c \
200 $(TOP)/ext/fts3/fts3_expr.c \
201 $(TOP)/ext/fts3/fts3_hash.c \
202 $(TOP)/ext/fts3/fts3_hash.h \
203 $(TOP)/ext/fts3/fts3_icu.c \
204 $(TOP)/ext/fts3/fts3_porter.c \
205 $(TOP)/ext/fts3/fts3_snippet.c \
206 $(TOP)/ext/fts3/fts3_tokenizer.h \
207 $(TOP)/ext/fts3/fts3_tokenizer.c \
208 $(TOP)/ext/fts3/fts3_tokenizer1.c \
209 $(TOP)/ext/fts3/fts3_tokenize_vtab.c \
210 $(TOP)/ext/fts3/fts3_unicode.c \
211 $(TOP)/ext/fts3/fts3_unicode2.c \
212 $(TOP)/ext/fts3/fts3_write.c
213 SRC += \
214 $(TOP)/ext/icu/sqliteicu.h \
215 $(TOP)/ext/icu/icu.c
216 SRC += \
217 $(TOP)/ext/rtree/sqlite3rtree.h \
218 $(TOP)/ext/rtree/rtree.h \
219 $(TOP)/ext/rtree/rtree.c \
220 $(TOP)/ext/rtree/geopoly.c
221 SRC += \
222 $(TOP)/ext/session/sqlite3session.c \
223 $(TOP)/ext/session/sqlite3session.h
224 SRC += \
225 $(TOP)/ext/userauth/userauth.c \
226 $(TOP)/ext/userauth/sqlite3userauth.h
227 SRC += \
228 $(TOP)/ext/rbu/sqlite3rbu.c \
229 $(TOP)/ext/rbu/sqlite3rbu.h
230 SRC += \
231 $(TOP)/ext/misc/stmt.c
234 # FTS5 things
236 FTS5_HDR = \
237 $(TOP)/ext/fts5/fts5.h \
238 $(TOP)/ext/fts5/fts5Int.h \
239 fts5parse.h
241 FTS5_SRC = \
242 $(TOP)/ext/fts5/fts5_aux.c \
243 $(TOP)/ext/fts5/fts5_buffer.c \
244 $(TOP)/ext/fts5/fts5_main.c \
245 $(TOP)/ext/fts5/fts5_config.c \
246 $(TOP)/ext/fts5/fts5_expr.c \
247 $(TOP)/ext/fts5/fts5_hash.c \
248 $(TOP)/ext/fts5/fts5_index.c \
249 fts5parse.c \
250 $(TOP)/ext/fts5/fts5_storage.c \
251 $(TOP)/ext/fts5/fts5_tokenize.c \
252 $(TOP)/ext/fts5/fts5_unicode2.c \
253 $(TOP)/ext/fts5/fts5_varint.c \
254 $(TOP)/ext/fts5/fts5_vocab.c \
256 LSM1_SRC = \
257 $(TOP)/ext/lsm1/lsm.h \
258 $(TOP)/ext/lsm1/lsmInt.h \
259 $(TOP)/ext/lsm1/lsm_ckpt.c \
260 $(TOP)/ext/lsm1/lsm_file.c \
261 $(TOP)/ext/lsm1/lsm_log.c \
262 $(TOP)/ext/lsm1/lsm_main.c \
263 $(TOP)/ext/lsm1/lsm_mem.c \
264 $(TOP)/ext/lsm1/lsm_mutex.c \
265 $(TOP)/ext/lsm1/lsm_shared.c \
266 $(TOP)/ext/lsm1/lsm_sorted.c \
267 $(TOP)/ext/lsm1/lsm_str.c \
268 $(TOP)/ext/lsm1/lsm_tree.c \
269 $(TOP)/ext/lsm1/lsm_unix.c \
270 $(TOP)/ext/lsm1/lsm_varint.c \
271 $(TOP)/ext/lsm1/lsm_vtab.c \
272 $(TOP)/ext/lsm1/lsm_win32.c
275 # Generated source code files
277 SRC += \
278 keywordhash.h \
279 opcodes.c \
280 opcodes.h \
281 parse.c \
282 parse.h \
283 shell.c \
284 sqlite3.h
287 # Source code to the test files.
289 TESTSRC = \
290 $(TOP)/ext/expert/sqlite3expert.c \
291 $(TOP)/ext/expert/test_expert.c \
292 $(TOP)/ext/fts3/fts3_term.c \
293 $(TOP)/ext/fts3/fts3_test.c \
294 $(TOP)/ext/rbu/test_rbu.c \
295 $(TOP)/src/test1.c \
296 $(TOP)/src/test2.c \
297 $(TOP)/src/test3.c \
298 $(TOP)/src/test4.c \
299 $(TOP)/src/test5.c \
300 $(TOP)/src/test6.c \
301 $(TOP)/src/test8.c \
302 $(TOP)/src/test9.c \
303 $(TOP)/src/test_autoext.c \
304 $(TOP)/src/test_async.c \
305 $(TOP)/src/test_backup.c \
306 $(TOP)/src/test_bestindex.c \
307 $(TOP)/src/test_blob.c \
308 $(TOP)/src/test_btree.c \
309 $(TOP)/src/test_config.c \
310 $(TOP)/src/test_delete.c \
311 $(TOP)/src/test_demovfs.c \
312 $(TOP)/src/test_devsym.c \
313 $(TOP)/src/test_fs.c \
314 $(TOP)/src/test_func.c \
315 $(TOP)/src/test_hexio.c \
316 $(TOP)/src/test_init.c \
317 $(TOP)/src/test_intarray.c \
318 $(TOP)/src/test_journal.c \
319 $(TOP)/src/test_malloc.c \
320 $(TOP)/src/test_md5.c \
321 $(TOP)/src/test_multiplex.c \
322 $(TOP)/src/test_mutex.c \
323 $(TOP)/src/test_onefile.c \
324 $(TOP)/src/test_osinst.c \
325 $(TOP)/src/test_pcache.c \
326 $(TOP)/src/test_quota.c \
327 $(TOP)/src/test_rtree.c \
328 $(TOP)/src/test_schema.c \
329 $(TOP)/src/test_sqllog.c \
330 $(TOP)/src/test_superlock.c \
331 $(TOP)/src/test_syscall.c \
332 $(TOP)/src/test_tclsh.c \
333 $(TOP)/src/test_tclvar.c \
334 $(TOP)/src/test_thread.c \
335 $(TOP)/src/test_vdbecov.c \
336 $(TOP)/src/test_vfs.c \
337 $(TOP)/src/test_windirent.c \
338 $(TOP)/src/test_window.c \
339 $(TOP)/src/test_wsd.c
341 # Extensions to be statically loaded.
343 TESTSRC += \
344 $(TOP)/ext/misc/amatch.c \
345 $(TOP)/ext/misc/appendvfs.c \
346 $(TOP)/ext/misc/basexx.c \
347 $(TOP)/ext/misc/carray.c \
348 $(TOP)/ext/misc/cksumvfs.c \
349 $(TOP)/ext/misc/closure.c \
350 $(TOP)/ext/misc/csv.c \
351 $(TOP)/ext/misc/decimal.c \
352 $(TOP)/ext/misc/eval.c \
353 $(TOP)/ext/misc/explain.c \
354 $(TOP)/ext/misc/fileio.c \
355 $(TOP)/ext/misc/fuzzer.c \
356 $(TOP)/ext/misc/ieee754.c \
357 $(TOP)/ext/misc/mmapwarm.c \
358 $(TOP)/ext/misc/nextchar.c \
359 $(TOP)/ext/misc/normalize.c \
360 $(TOP)/ext/misc/percentile.c \
361 $(TOP)/ext/misc/prefixes.c \
362 $(TOP)/ext/misc/qpvtab.c \
363 $(TOP)/ext/misc/randomjson.c \
364 $(TOP)/ext/misc/regexp.c \
365 $(TOP)/ext/misc/remember.c \
366 $(TOP)/ext/misc/series.c \
367 $(TOP)/ext/misc/spellfix.c \
368 $(TOP)/ext/misc/totype.c \
369 $(TOP)/ext/misc/unionvtab.c \
370 $(TOP)/ext/misc/wholenumber.c \
371 $(TOP)/ext/misc/zipfile.c \
372 $(TOP)/ext/fts5/fts5_tcl.c \
373 $(TOP)/ext/fts5/fts5_test_mi.c \
374 $(TOP)/ext/fts5/fts5_test_tok.c \
375 $(TOP)/ext/rtree/test_rtreedoc.c \
376 $(TOP)/ext/recover/sqlite3recover.c \
377 $(TOP)/ext/recover/dbdata.c \
378 $(TOP)/ext/recover/test_recover.c
381 #TESTSRC += $(TOP)/ext/fts3/fts3_tokenizer.c
383 TESTSRC2 = \
384 $(TOP)/src/attach.c \
385 $(TOP)/src/backup.c \
386 $(TOP)/src/btree.c \
387 $(TOP)/src/build.c \
388 $(TOP)/src/date.c \
389 $(TOP)/src/dbpage.c \
390 $(TOP)/src/dbstat.c \
391 $(TOP)/src/expr.c \
392 $(TOP)/src/func.c \
393 $(TOP)/src/global.c \
394 $(TOP)/src/insert.c \
395 $(TOP)/src/wal.c \
396 $(TOP)/src/main.c \
397 $(TOP)/src/mem5.c \
398 $(TOP)/src/os.c \
399 $(TOP)/src/os_kv.c \
400 $(TOP)/src/os_unix.c \
401 $(TOP)/src/os_win.c \
402 $(TOP)/src/pager.c \
403 $(TOP)/src/pragma.c \
404 $(TOP)/src/prepare.c \
405 $(TOP)/src/printf.c \
406 $(TOP)/src/random.c \
407 $(TOP)/src/pcache.c \
408 $(TOP)/src/pcache1.c \
409 $(TOP)/src/select.c \
410 $(TOP)/src/threads.c \
411 $(TOP)/src/tokenize.c \
412 $(TOP)/src/treeview.c \
413 $(TOP)/src/utf.c \
414 $(TOP)/src/util.c \
415 $(TOP)/src/vdbeapi.c \
416 $(TOP)/src/vdbeaux.c \
417 $(TOP)/src/vdbe.c \
418 $(TOP)/src/vdbemem.c \
419 $(TOP)/src/vdbevtab.c \
420 $(TOP)/src/where.c \
421 $(TOP)/src/wherecode.c \
422 $(TOP)/src/whereexpr.c \
423 parse.c \
424 $(TOP)/ext/fts3/fts3.c \
425 $(TOP)/ext/fts3/fts3_aux.c \
426 $(TOP)/ext/fts3/fts3_expr.c \
427 $(TOP)/ext/fts3/fts3_tokenizer.c \
428 $(TOP)/ext/fts3/fts3_write.c \
429 $(TOP)/ext/async/sqlite3async.c \
430 $(TOP)/ext/misc/stmt.c \
431 $(TOP)/ext/session/sqlite3session.c \
432 $(TOP)/ext/session/test_session.c \
433 fts5.c
435 # Header files used by all library source files.
437 HDR = \
438 $(TOP)/src/btree.h \
439 $(TOP)/src/btreeInt.h \
440 $(TOP)/src/hash.h \
441 $(TOP)/src/hwtime.h \
442 keywordhash.h \
443 $(TOP)/src/msvc.h \
444 $(TOP)/src/mutex.h \
445 opcodes.h \
446 $(TOP)/src/os.h \
447 $(TOP)/src/os_common.h \
448 $(TOP)/src/os_setup.h \
449 $(TOP)/src/os_win.h \
450 $(TOP)/src/pager.h \
451 $(TOP)/src/pcache.h \
452 parse.h \
453 $(TOP)/src/pragma.h \
454 sqlite3.h \
455 $(TOP)/src/sqlite3ext.h \
456 $(TOP)/src/sqliteInt.h \
457 $(TOP)/src/sqliteLimit.h \
458 $(TOP)/src/vdbe.h \
459 $(TOP)/src/vdbeInt.h \
460 $(TOP)/src/vxworks.h \
461 $(TOP)/src/whereInt.h
463 # Header files used by extensions
465 EXTHDR += \
466 $(TOP)/ext/fts3/fts3.h \
467 $(TOP)/ext/fts3/fts3Int.h \
468 $(TOP)/ext/fts3/fts3_hash.h \
469 $(TOP)/ext/fts3/fts3_tokenizer.h
470 EXTHDR += \
471 $(TOP)/ext/rtree/rtree.h \
472 $(TOP)/ext/rtree/geopoly.c
473 EXTHDR += \
474 $(TOP)/ext/icu/sqliteicu.h
475 EXTHDR += \
476 $(TOP)/ext/fts5/fts5Int.h \
477 fts5parse.h \
478 $(TOP)/ext/fts5/fts5.h
479 EXTHDR += \
480 $(TOP)/ext/userauth/sqlite3userauth.h
482 # executables needed for testing
484 TESTPROGS = \
485 testfixture$(EXE) \
486 sqlite3$(EXE) \
487 sqlite3_analyzer$(EXE) \
488 sqlite3_checker$(EXE) \
489 sqldiff$(EXE) \
490 dbhash$(EXE) \
491 sqltclsh$(EXE)
493 # Databases containing fuzzer test cases
495 FUZZDATA = \
496 $(TOP)/test/fuzzdata1.db \
497 $(TOP)/test/fuzzdata2.db \
498 $(TOP)/test/fuzzdata3.db \
499 $(TOP)/test/fuzzdata4.db \
500 $(TOP)/test/fuzzdata5.db \
501 $(TOP)/test/fuzzdata6.db \
502 $(TOP)/test/fuzzdata7.db \
503 $(TOP)/test/fuzzdata8.db
505 # Standard options to testfixture
507 TESTOPTS = --verbose=file --output=test-out.txt
509 # Extra compiler options for various shell tools
511 SHELL_OPT += -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5
512 SHELL_OPT += -DSQLITE_ENABLE_RTREE
513 SHELL_OPT += -DSQLITE_ENABLE_EXPLAIN_COMMENTS
514 SHELL_OPT += -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
515 SHELL_OPT += -DSQLITE_ENABLE_STMTVTAB
516 SHELL_OPT += -DSQLITE_ENABLE_DBPAGE_VTAB
517 SHELL_OPT += -DSQLITE_ENABLE_DBSTAT_VTAB
518 SHELL_OPT += -DSQLITE_ENABLE_BYTECODE_VTAB
519 SHELL_OPT += -DSQLITE_ENABLE_OFFSET_SQL_FUNC
520 FUZZCHECK_OPT += -I$(TOP)/test
521 FUZZCHECK_OPT += -I$(TOP)/ext/recover
522 FUZZCHECK_OPT += -DSQLITE_ENABLE_MEMSYS5
523 FUZZCHECK_OPT += -DSQLITE_MAX_MEMORY=50000000
524 FUZZCHECK_OPT += -DSQLITE_PRINTF_PRECISION_LIMIT=1000
525 FUZZCHECK_OPT += -DSQLITE_ENABLE_FTS4
526 FUZZCHECK_OPT += -DSQLITE_ENABLE_RTREE
527 FUZZCHECK_OPT += -DSQLITE_ENABLE_GEOPOLY
528 FUZZCHECK_OPT += -DSQLITE_ENABLE_DBSTAT_VTAB
529 FUZZCHECK_OPT += -DSQLITE_ENABLE_BYTECODE_VTAB
530 FUZZCHECK_OPT += -DSQLITE_STRICT_SUBTYPE=1
531 FUZZCHECK_OPT += -DSQLITE_STATIC_RANDOMJSON
532 FUZZSRC += $(TOP)/test/fuzzcheck.c
533 FUZZSRC += $(TOP)/test/ossfuzz.c
534 FUZZSRC += $(TOP)/test/vt02.c
535 FUZZSRC += $(TOP)/test/fuzzinvariants.c
536 FUZZSRC += $(TOP)/ext/recover/dbdata.c
537 FUZZSRC += $(TOP)/ext/recover/sqlite3recover.c
538 FUZZSRC += $(TOP)/ext/misc/randomjson.c
539 DBFUZZ_OPT =
540 KV_OPT = -DSQLITE_THREADSAFE=0 -DSQLITE_DIRECT_OVERFLOW_READ
541 ST_OPT = -DSQLITE_THREADSAFE=0
543 # This is the default Makefile target. The objects listed here
544 # are what get build when you type just "make" with no arguments.
546 all: sqlite3.h sqlite3ext.h libsqlite3.a sqlite3$(EXE)
548 libsqlite3.a: sqlite3.h $(LIBOBJ)
549 $(AR) libsqlite3.a $(LIBOBJ)
550 $(RANLIB) libsqlite3.a
552 sqlite3$(EXE): sqlite3.h libsqlite3.a shell.c
553 $(TCCX) $(READLINE_FLAGS) -o sqlite3$(EXE) $(SHELL_OPT) \
554 shell.c libsqlite3.a $(LIBREADLINE) $(TLIBS) $(THREADLIB)
556 sqldiff$(EXE): $(TOP)/tool/sqldiff.c sqlite3.c sqlite3.h
557 $(TCCX) -o sqldiff$(EXE) -DSQLITE_THREADSAFE=0 \
558 $(TOP)/tool/sqldiff.c sqlite3.c $(TLIBS) $(THREADLIB)
560 dbhash$(EXE): $(TOP)/tool/dbhash.c sqlite3.c sqlite3.h
561 $(TCCX) -o dbhash$(EXE) -DSQLITE_THREADSAFE=0 \
562 $(TOP)/tool/dbhash.c sqlite3.c $(TLIBS) $(THREADLIB)
564 scrub$(EXE): $(TOP)/ext/misc/scrub.c sqlite3.o
565 $(TCC) -I. -DSCRUB_STANDALONE -o scrub$(EXE) $(TOP)/ext/misc/scrub.c sqlite3.o $(THREADLIB)
567 srcck1$(EXE): $(TOP)/tool/srcck1.c
568 $(BCC) -o srcck1$(EXE) $(TOP)/tool/srcck1.c
570 sourcetest: srcck1$(EXE) sqlite3.c
571 ./srcck1 sqlite3.c
573 src-verify: $(TOP)/tool/src-verify.c
574 $(BCC) -o src-verify$(EXE) $(TOP)/tool/src-verify.c
576 verify-source: ./src-verify
577 ./src-verify $(TOP)
579 fuzzershell$(EXE): $(TOP)/tool/fuzzershell.c sqlite3.c sqlite3.h
580 $(TCCX) -o fuzzershell$(EXE) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
581 $(FUZZERSHELL_OPT) $(TOP)/tool/fuzzershell.c sqlite3.c \
582 $(TLIBS) $(THREADLIB)
584 dbfuzz$(EXE): $(TOP)/test/dbfuzz.c sqlite3.c sqlite3.h
585 $(TCCX) -o dbfuzz$(EXE) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
586 $(DBFUZZ_OPT) $(TOP)/test/dbfuzz.c sqlite3.c \
587 $(TLIBS) $(THREADLIB)
589 DBFUZZ2_OPTS = \
590 -DSQLITE_THREADSAFE=0 \
591 -DSQLITE_OMIT_LOAD_EXTENSION \
592 -DSQLITE_DEBUG \
593 -DSQLITE_ENABLE_DBSTAT_VTAB \
594 -DSQLITE_ENABLE_BYTECODE_VTAB \
595 -DSQLITE_ENABLE_RTREE \
596 -DSQLITE_ENABLE_FTS4 \
597 -DSQLITE_ENABLE_FTS5
599 dbfuzz2$(EXE): $(TOP)/test/dbfuzz2.c sqlite3.c sqlite3.h
600 $(TCCX) -I. -g -O0 -DSTANDALONE -o dbfuzz2$(EXE) \
601 $(DBFUZZ2_OPTS) $(TOP)/test/dbfuzz2.c sqlite3.c $(TLIBS) $(THREADLIB)
603 fuzzcheck$(EXE): $(FUZZSRC) sqlite3.c sqlite3.h $(FUZZDEP)
604 $(TCCX) -o $@ -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
605 -DSQLITE_ENABLE_MEMSYS5 $(FUZZCHECK_OPT) -DSQLITE_OSS_FUZZ \
606 $(FUZZSRC) sqlite3.c $(TLIBS) $(THREADLIB)
608 fuzzcheck-asan$(EXE): $(FUZZSRC) sqlite3.c sqlite3.h $(FUZZDEP)
609 $(TCCX) -fsanitize=address -o $W -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
610 -DSQLITE_ENABLE_MEMSYS5 $(FUZZCHECK_OPT) -DSQLITE_OSS_FUZZ \
611 $(FUZZSRC) sqlite3.c $(TLIBS) $(THREADLIB)
613 fuzzcheck-ubsan$(EXE): $(FUZZSRC) sqlite3.c sqlite3.h $(FUZZDEP)
614 $(TCCX) -fsanitize=undefined -o $@ -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
615 -DSQLITE_ENABLE_MEMSYS5 $(FUZZCHECK_OPT) -DSQLITE_OSS_FUZZ \
616 $(FUZZSRC) sqlite3.c $(TLIBS) $(THREADLIB)
618 ossshell$(EXE): $(TOP)/test/ossfuzz.c $(TOP)/test/ossshell.c sqlite3.c sqlite3.h
619 $(TCCX) -o ossshell$(EXE) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
620 -DSQLITE_ENABLE_MEMSYS5 $(FUZZCHECK_OPT) \
621 $(TOP)/test/ossfuzz.c $(TOP)/test/ossshell.c sqlite3.c $(TLIBS) $(THREADLIB)
623 sessionfuzz$(EXE): $(TOP)/test/sessionfuzz.c sqlite3.c sqlite3.h
624 $(TCC) -o sessionfuzz$(EXE) $(TOP)/test/sessionfuzz.c -lz $(TLIBS) $(THREADLIB)
626 mptester$(EXE): sqlite3.c $(TOP)/mptest/mptest.c
627 $(TCCX) -o $@ -I. $(TOP)/mptest/mptest.c sqlite3.c \
628 $(TLIBS) $(THREADLIB)
630 MPTEST1=./mptester$(EXE) mptest1.db $(TOP)/mptest/crash01.test --repeat 20
631 MPTEST2=./mptester$(EXE) mptest2.db $(TOP)/mptest/multiwrite01.test --repeat 20
632 mptest: mptester$(EXE)
633 $(MPTEST1) --journalmode DELETE
634 $(MPTEST2) --journalmode WAL
635 $(MPTEST1) --journalmode WAL
636 $(MPTEST2) --journalmode PERSIST
637 $(MPTEST1) --journalmode PERSIST
638 $(MPTEST2) --journalmode TRUNCATE
639 $(MPTEST1) --journalmode TRUNCATE
640 $(MPTEST2) --journalmode DELETE
642 sqlite3.o: sqlite3.c
643 $(TCCX) -I. -c sqlite3.c
645 # This target creates a directory named "tsrc" and fills it with
646 # copies of all of the C source code and header files needed to
647 # build on the target system. Some of the C source code and header
648 # files are automatically generated. This target takes care of
649 # all that automatic generation.
651 target_source: $(SRC) $(TOP)/tool/vdbe-compress.tcl fts5.c
652 rm -rf tsrc
653 mkdir tsrc
654 cp -f $(SRC) tsrc
655 rm tsrc/sqlite.h.in tsrc/parse.y
656 tclsh $(TOP)/tool/vdbe-compress.tcl $(OPTS) <tsrc/vdbe.c >vdbe.new
657 mv vdbe.new tsrc/vdbe.c
658 cp fts5.c fts5.h tsrc
659 touch target_source
661 sqlite3.c: target_source $(TOP)/tool/mksqlite3c.tcl src-verify
662 tclsh $(TOP)/tool/mksqlite3c.tcl
663 cp tsrc/sqlite3ext.h .
664 cp $(TOP)/ext/session/sqlite3session.h .
665 echo '#ifndef USE_SYSTEM_SQLITE' >tclsqlite3.c
666 cat sqlite3.c >>tclsqlite3.c
667 echo '#endif /* USE_SYSTEM_SQLITE */' >>tclsqlite3.c
668 cat $(TOP)/src/tclsqlite.c >>tclsqlite3.c
670 sqlite3ext.h: target_source
671 cp tsrc/sqlite3ext.h .
673 sqlite3.c-debug: target_source $(TOP)/tool/mksqlite3c.tcl src-verify
674 tclsh $(TOP)/tool/mksqlite3c.tcl --linemacros=1
675 echo '#ifndef USE_SYSTEM_SQLITE' >tclsqlite3.c
676 cat sqlite3.c >>tclsqlite3.c
677 echo '#endif /* USE_SYSTEM_SQLITE */' >>tclsqlite3.c
678 echo '#line 1 "tclsqlite.c"' >>tclsqlite3.c
679 cat $(TOP)/src/tclsqlite.c >>tclsqlite3.c
681 sqlite3-all.c: sqlite3.c $(TOP)/tool/split-sqlite3c.tcl
682 tclsh $(TOP)/tool/split-sqlite3c.tcl
684 # Rules to build the LEMON compiler generator
686 lemon: $(TOP)/tool/lemon.c $(TOP)/tool/lempar.c
687 $(BCC) -o lemon $(TOP)/tool/lemon.c
688 cp $(TOP)/tool/lempar.c .
690 # A tool to generate the source-id
692 mksourceid: $(TOP)/tool/mksourceid.c
693 $(BCC) -o mksourceid $(TOP)/tool/mksourceid.c
695 # Rules to build individual *.o files from generated *.c files. This
696 # applies to:
698 # parse.o
699 # opcodes.o
701 %.o: %.c $(HDR)
702 $(TCCX) -c $<
704 # Rules to build individual *.o files from files in the src directory.
706 %.o: $(TOP)/src/%.c $(HDR)
707 $(TCCX) -c $<
709 tclsqlite.o: $(TOP)/src/tclsqlite.c $(HDR)
710 $(TCCX) $(TCL_FLAGS) -c $(TOP)/src/tclsqlite.c
714 # Rules to build opcodes.c and opcodes.h
716 opcodes.c: opcodes.h $(TOP)/tool/mkopcodec.tcl
717 tclsh $(TOP)/tool/mkopcodec.tcl opcodes.h >opcodes.c
719 opcodes.h: parse.h $(TOP)/src/vdbe.c $(TOP)/tool/mkopcodeh.tcl
720 cat parse.h $(TOP)/src/vdbe.c | \
721 tclsh $(TOP)/tool/mkopcodeh.tcl >opcodes.h
723 # Rules to build parse.c and parse.h - the outputs of lemon.
725 parse.h: parse.c
727 parse.c: $(TOP)/src/parse.y lemon
728 cp $(TOP)/src/parse.y .
729 ./lemon -s $(OPTS) parse.y
731 sqlite3.h: $(TOP)/src/sqlite.h.in $(TOP)/manifest mksourceid $(TOP)/VERSION $(TOP)/ext/rtree/sqlite3rtree.h
732 tclsh $(TOP)/tool/mksqlite3h.tcl $(TOP) >sqlite3.h
734 sqlite3rc.h: $(TOP)/src/sqlite3.rc $(TOP)/VERSION
735 echo '#ifndef SQLITE_RESOURCE_VERSION' >$@
736 echo -n '#define SQLITE_RESOURCE_VERSION ' >>$@
737 cat $(TOP)/VERSION | tclsh $(TOP)/tool/replace.tcl exact . , >>$@
738 echo '#endif' >>sqlite3rc.h
740 keywordhash.h: $(TOP)/tool/mkkeywordhash.c
741 $(BCC) -o mkkeywordhash $(OPTS) $(TOP)/tool/mkkeywordhash.c
742 ./mkkeywordhash >keywordhash.h
744 # Source files that go into making shell.c
745 SHELL_SRC = \
746 $(TOP)/src/shell.c.in \
747 $(TOP)/ext/misc/appendvfs.c \
748 $(TOP)/ext/misc/completion.c \
749 $(TOP)/ext/misc/base64.c \
750 $(TOP)/ext/misc/base85.c \
751 $(TOP)/ext/misc/decimal.c \
752 $(TOP)/ext/misc/fileio.c \
753 $(TOP)/ext/misc/ieee754.c \
754 $(TOP)/ext/misc/regexp.c \
755 $(TOP)/ext/misc/series.c \
756 $(TOP)/ext/misc/shathree.c \
757 $(TOP)/ext/misc/sqlar.c \
758 $(TOP)/ext/misc/uint.c \
759 $(TOP)/ext/expert/sqlite3expert.c \
760 $(TOP)/ext/expert/sqlite3expert.h \
761 $(TOP)/ext/misc/zipfile.c \
762 $(TOP)/ext/misc/memtrace.c \
763 $(TOP)/ext/misc/pcachetrace.c \
764 $(TOP)/ext/recover/dbdata.c \
765 $(TOP)/ext/recover/sqlite3recover.c \
766 $(TOP)/ext/recover/sqlite3recover.h \
767 $(TOP)/src/test_windirent.c
769 shell.c: $(SHELL_SRC) $(TOP)/tool/mkshellc.tcl
770 tclsh $(TOP)/tool/mkshellc.tcl >shell.c
774 # Rules to build the extension objects.
776 icu.o: $(TOP)/ext/icu/icu.c $(HDR) $(EXTHDR)
777 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/icu/icu.c
779 fts3.o: $(TOP)/ext/fts3/fts3.c $(HDR) $(EXTHDR)
780 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3.c
782 fts3_aux.o: $(TOP)/ext/fts3/fts3_aux.c $(HDR) $(EXTHDR)
783 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_aux.c
785 fts3_expr.o: $(TOP)/ext/fts3/fts3_expr.c $(HDR) $(EXTHDR)
786 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_expr.c
788 fts3_hash.o: $(TOP)/ext/fts3/fts3_hash.c $(HDR) $(EXTHDR)
789 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_hash.c
791 fts3_icu.o: $(TOP)/ext/fts3/fts3_icu.c $(HDR) $(EXTHDR)
792 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_icu.c
794 fts3_snippet.o: $(TOP)/ext/fts3/fts3_snippet.c $(HDR) $(EXTHDR)
795 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_snippet.c
797 fts3_porter.o: $(TOP)/ext/fts3/fts3_porter.c $(HDR) $(EXTHDR)
798 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_porter.c
800 fts3_tokenizer.o: $(TOP)/ext/fts3/fts3_tokenizer.c $(HDR) $(EXTHDR)
801 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer.c
803 fts3_tokenizer1.o: $(TOP)/ext/fts3/fts3_tokenizer1.c $(HDR) $(EXTHDR)
804 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer1.c
806 fts3_tokenize_vtab.o: $(TOP)/ext/fts3/fts3_tokenize_vtab.c $(HDR) $(EXTHDR)
807 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenize_vtab.c
809 fts3_unicode.o: $(TOP)/ext/fts3/fts3_unicode.c $(HDR) $(EXTHDR)
810 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_unicode.c
812 fts3_unicode2.o: $(TOP)/ext/fts3/fts3_unicode2.c $(HDR) $(EXTHDR)
813 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_unicode2.c
815 fts3_write.o: $(TOP)/ext/fts3/fts3_write.c $(HDR) $(EXTHDR)
816 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_write.c
818 fts5.o: fts5.c sqlite3ext.h sqlite3.h
819 $(TCCX) -DSQLITE_CORE -c fts5.c
821 stmt.o: $(TOP)/ext/misc/stmt.c sqlite3ext.h sqlite3.h
822 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/misc/stmt.c
824 rtree.o: $(TOP)/ext/rtree/rtree.c $(HDR) $(EXTHDR)
825 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/rtree/rtree.c
829 fts5parse.c: $(TOP)/ext/fts5/fts5parse.y lemon
830 cp $(TOP)/ext/fts5/fts5parse.y .
831 rm -f fts5parse.h
832 ./lemon $(OPTS) fts5parse.y
834 fts5parse.h: fts5parse.c
836 fts5.c: $(FTS5_SRC) $(FTS5_HDR)
837 tclsh $(TOP)/ext/fts5/tool/mkfts5c.tcl
838 cp $(TOP)/ext/fts5/fts5.h .
840 lsm1.c: $(LSM1_SRC)
841 tclsh $(TOP)/ext/lsm1/tool/mklsm1c.tcl
842 cp $(TOP)/ext/lsm1/lsm.h .
844 userauth.o: $(TOP)/ext/userauth/userauth.c $(HDR) $(EXTHDR)
845 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/userauth/userauth.c
847 sqlite3session.o: $(TOP)/ext/session/sqlite3session.c $(HDR) $(EXTHDR)
848 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/session/sqlite3session.c
850 sqlite3rbu.o: $(TOP)/ext/rbu/sqlite3rbu.c $(HDR) $(EXTHDR)
851 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/rbu/sqlite3rbu.c
853 # Rules for building test programs and for running tests
855 tclsqlite3: $(TOP)/src/tclsqlite.c libsqlite3.a
856 $(TCCX) $(TCL_FLAGS) -DTCLSH -o tclsqlite3 \
857 $(TOP)/src/tclsqlite.c libsqlite3.a $(LIBTCL) $(THREADLIB)
859 sqlite3_analyzer.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl $(TOP)/tool/sqlite3_analyzer.c.in $(TOP)/tool/mkccode.tcl
860 tclsh $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqlite3_analyzer.c.in >sqlite3_analyzer.c
862 sqlite3_analyzer$(EXE): sqlite3_analyzer.c
863 $(TCCX) $(TCL_FLAGS) sqlite3_analyzer.c -o $@ $(LIBTCL) $(THREADLIB)
865 sqltclsh.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/sqltclsh.tcl $(TOP)/ext/misc/appendvfs.c $(TOP)/tool/mkccode.tcl
866 tclsh $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqltclsh.c.in >sqltclsh.c
868 sqltclsh$(EXE): sqltclsh.c
869 $(TCCX) $(TCL_FLAGS) sqltclsh.c -o $@ $(LIBTCL) $(THREADLIB)
871 sqlite3_expert$(EXE): $(TOP)/ext/expert/sqlite3expert.h $(TOP)/ext/expert/sqlite3expert.c $(TOP)/ext/expert/expert.c sqlite3.c
872 $(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)
874 CHECKER_DEPS =\
875 $(TOP)/tool/mkccode.tcl \
876 sqlite3.c \
877 $(TOP)/src/tclsqlite.c \
878 $(TOP)/ext/repair/sqlite3_checker.tcl \
879 $(TOP)/ext/repair/checkindex.c \
880 $(TOP)/ext/repair/checkfreelist.c \
881 $(TOP)/ext/misc/btreeinfo.c \
882 $(TOP)/ext/repair/sqlite3_checker.c.in
884 sqlite3_checker.c: $(CHECKER_DEPS)
885 tclsh $(TOP)/tool/mkccode.tcl $(TOP)/ext/repair/sqlite3_checker.c.in >$@
887 sqlite3_checker$(TEXE): sqlite3_checker.c
888 $(TCCX) $(TCL_FLAGS) sqlite3_checker.c -o $@ $(LIBTCL) $(THREADLIB)
890 dbdump$(EXE): $(TOP)/ext/misc/dbdump.c sqlite3.o
891 $(TCCX) -DDBDUMP_STANDALONE -o dbdump$(EXE) \
892 $(TOP)/ext/misc/dbdump.c sqlite3.o $(THREADLIB)
894 # Rules to build the 'testfixture' application.
896 TESTFIXTURE_FLAGS = -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
897 TESTFIXTURE_FLAGS += -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE
898 TESTFIXTURE_FLAGS += -DSQLITE_SERIES_CONSTRAINT_VERIFY=1
899 TESTFIXTURE_FLAGS += -DSQLITE_DEFAULT_PAGE_SIZE=1024
900 TESTFIXTURE_FLAGS += -DSQLITE_ENABLE_STMTVTAB
901 TESTFIXTURE_FLAGS += -DSQLITE_ENABLE_DBPAGE_VTAB
902 TESTFIXTURE_FLAGS += -DSQLITE_ENABLE_BYTECODE_VTAB
903 TESTFIXTURE_FLAGS += -DTCLSH_INIT_PROC=sqlite3TestInit
904 TESTFIXTURE_FLAGS += -DSQLITE_CKSUMVFS_STATIC
905 TESTFIXTURE_FLAGS += -DSQLITE_STATIC_RANDOMJSON
906 TESTFIXTURE_FLAGS += -DSQLITE_STRICT_SUBTYPE=1
908 testfixture$(EXE): $(TESTSRC2) libsqlite3.a $(TESTSRC) $(TOP)/src/tclsqlite.c
909 $(TCCX) $(TCL_FLAGS) $(TESTFIXTURE_FLAGS) \
910 $(TESTSRC) $(TESTSRC2) $(TOP)/src/tclsqlite.c \
911 -o testfixture$(EXE) $(LIBTCL) libsqlite3.a $(THREADLIB)
913 amalgamation-testfixture$(EXE): sqlite3.c $(TESTSRC) $(TOP)/src/tclsqlite.c \
914 $(TOP)/ext/session/test_session.c
915 $(TCCX) $(TCL_FLAGS) $(TESTFIXTURE_FLAGS) \
916 $(TESTSRC) $(TOP)/src/tclsqlite.c sqlite3.c \
917 $(TOP)/ext/session/test_session.c \
918 -o testfixture$(EXE) $(LIBTCL) $(THREADLIB)
920 coretestprogs: $(TESTPROGS)
922 testprogs: coretestprogs srcck1$(EXE) fuzzcheck$(EXE) sessionfuzz$(EXE)
924 fulltest: $(TESTPROGS) fuzztest
925 ./testfixture$(EXE) $(TOP)/test/all.test $(TESTOPTS)
927 soaktest: $(TESTPROGS)
928 ./testfixture$(EXE) $(TOP)/test/all.test -soak=1 $(TESTOPTS)
930 fulltestonly: $(TESTPROGS) fuzztest
931 ./testfixture$(EXE) $(TOP)/test/full.test $(TESTOPTS)
933 queryplantest: testfixture$(EXE) sqlite3$(EXE)
934 ./testfixture$(EXE) $(TOP)/test/permutations.test queryplanner $(TESTOPTS)
936 fuzztest: fuzzcheck$(EXE) $(FUZZDATA) sessionfuzz$(EXE)
937 ./fuzzcheck$(EXE) $(FUZZDATA)
938 ./sessionfuzz run $(TOP)/test/sessionfuzz-data1.db
940 valgrindfuzz: fuzzcheck$(EXE) $(FUZZDATA) sessionfuzz$(EXE)
941 valgrind ./fuzzcheck$(EXE) --cell-size-check --limit-mem 10M $(FUZZDATA)
942 valgrind ./sessionfuzz run $(TOP)/test/sessionfuzz-data1.db
944 # The veryquick.test TCL tests.
946 tcltest: ./testfixture$(EXE)
947 ./testfixture$(EXE) $(TOP)/test/veryquick.test $(TESTOPTS)
949 # Runs all the same tests cases as the "tcltest" target but uses
950 # the testrunner.tcl script to run them in multiple cores
951 # concurrently.
952 testrunner: testfixture$(EXE)
953 ./testfixture$(EXE) $(TOP)/test/testrunner.tcl
955 # Runs both fuzztest and testrunner, consecutively.
957 devtest: testfixture$(EXE) fuzztest testrunner
959 mdevtest:
960 tclsh $(TOP)/test/testrunner.tcl mdevtest
962 # A very quick test using only testfixture and omitting all the slower
963 # tests. Designed to run in under 3 minutes on a workstation.
965 quicktest: ./testfixture$(EXE)
966 ./testfixture$(EXE) $(TOP)/test/extraquick.test $(TESTOPTS)
968 # The default test case. Runs most of the faster standard TCL tests,
969 # and fuzz tests, and sqlite3_analyzer and sqldiff tests.
970 test: fuzztest sourcetest $(TESTPROGS) tcltest
973 # Run a test using valgrind. This can take a really long time
974 # because valgrind is so much slower than a native machine.
976 valgrindtest: $(TESTPROGS) valgrindfuzz
977 OMIT_MISUSE=1 valgrind -v \
978 ./testfixture$(EXE) $(TOP)/test/permutations.test valgrind $(TESTOPTS)
980 # A very fast test that checks basic sanity. The name comes from
981 # the 60s-era electronics testing: "Turn it on and see if smoke
982 # comes out."
984 smoketest: $(TESTPROGS) fuzzcheck$(EXE)
985 ./testfixture$(EXE) $(TOP)/test/main.test $(TESTOPTS)
987 shelltest: $(TESTPROGS)
988 ./testfixture$(EXT) $(TOP)/test/permutations.test shell
990 # The next two rules are used to support the "threadtest" target. Building
991 # threadtest runs a few thread-safety tests that are implemented in C. This
992 # target is invoked by the releasetest.tcl script.
994 THREADTEST3_SRC = $(TOP)/test/threadtest3.c \
995 $(TOP)/test/tt3_checkpoint.c \
996 $(TOP)/test/tt3_index.c \
997 $(TOP)/test/tt3_vacuum.c \
998 $(TOP)/test/tt3_stress.c \
999 $(TOP)/test/tt3_lookaside1.c
1001 threadtest3$(EXE): sqlite3.o $(THREADTEST3_SRC) $(TOP)/src/test_multiplex.c
1002 $(TCCX) $(TOP)/test/threadtest3.c $(TOP)/src/test_multiplex.c sqlite3.o -o $@ $(THREADLIB)
1004 threadtest: threadtest3$(EXE)
1005 ./threadtest3$(EXE)
1007 TEST_EXTENSION = $(SHPREFIX)testloadext.$(SO)
1008 $(TEST_EXTENSION): $(TOP)/src/test_loadext.c
1009 $(MKSHLIB) $(TOP)/src/test_loadext.c -o $(TEST_EXTENSION)
1011 extensiontest: testfixture$(EXE) $(TEST_EXTENSION)
1012 ./testfixture$(EXE) $(TOP)/test/loadext.test
1014 dbtotxt$(EXE): $(TOP)/tool/dbtotxt.c
1015 $(TCC) -o dbtotxt$(EXE) $(TOP)/tool/dbtotxt.c
1017 showdb$(EXE): $(TOP)/tool/showdb.c sqlite3.o
1018 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o showdb$(EXE) \
1019 $(TOP)/tool/showdb.c sqlite3.o $(THREADLIB)
1021 showstat4$(EXE): $(TOP)/tool/showstat4.c sqlite3.o
1022 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o showstat4$(EXE) \
1023 $(TOP)/tool/showstat4.c sqlite3.o $(THREADLIB)
1025 showjournal$(EXE): $(TOP)/tool/showjournal.c sqlite3.o
1026 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o showjournal$(EXE) \
1027 $(TOP)/tool/showjournal.c sqlite3.o $(THREADLIB)
1029 showwal$(EXE): $(TOP)/tool/showwal.c sqlite3.o
1030 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o showwal$(EXE) \
1031 $(TOP)/tool/showwal.c sqlite3.o $(THREADLIB)
1033 showshm$(EXE): $(TOP)/tool/showshm.c
1034 $(TCC) -o showshm$(EXE) $(TOP)/tool/showshm.c
1036 index_usage$(EXE): $(TOP)/tool/index_usage.c sqlite3.o
1037 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_DEPRECATED $(SHELL_OPTS) -o index_usage$(EXE) \
1038 $(TOP)/tool/index_usage.c sqlite3.o $(THREADLIB)
1040 changeset$(EXE): $(TOP)/ext/session/changeset.c sqlite3.o
1041 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o changeset$(EXE) \
1042 $(TOP)/ext/session/changeset.c sqlite3.o $(THREADLIB)
1044 changesetfuzz$(EXE): $(TOP)/ext/session/changesetfuzz.c sqlite3.o
1045 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o changesetfuzz$(EXE) \
1046 $(TOP)/ext/session/changesetfuzz.c sqlite3.o $(THREADLIB)
1048 fts3view$(EXE): $(TOP)/ext/fts3/tool/fts3view.c sqlite3.o
1049 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o fts3view$(EXE) \
1050 $(TOP)/ext/fts3/tool/fts3view.c sqlite3.o $(THREADLIB)
1052 rollback-test$(EXE): $(TOP)/tool/rollback-test.c sqlite3.o
1053 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o rollback-test$(EXE) \
1054 $(TOP)/tool/rollback-test.c sqlite3.o $(THREADLIB)
1056 atrc$(EXE): $(TOP)/test/atrc.c sqlite3.o
1057 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o atrc$(EXE) \
1058 $(TOP)/test/atrc.c sqlite3.o $(THREADLIB)
1060 LogEst$(EXE): $(TOP)/tool/logest.c sqlite3.h
1061 $(TCC) -o LogEst$(EXE) $(TOP)/tool/logest.c
1063 wordcount$(EXE): $(TOP)/test/wordcount.c sqlite3.c
1064 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o wordcount$(EXE) \
1065 $(TOP)/test/wordcount.c sqlite3.c
1067 speedtest1$(EXE): $(TOP)/test/speedtest1.c sqlite3.c
1068 $(TCCX) -I. $(ST_OPT) -o speedtest1$(EXE) $(TOP)/test/speedtest1.c sqlite3.c $(THREADLIB)
1070 kvtest$(EXE): $(TOP)/test/kvtest.c sqlite3.c
1071 $(TCCX) -I. $(KV_OPT) -o kvtest$(EXE) $(TOP)/test/kvtest.c sqlite3.c $(THREADLIB)
1073 rbu$(EXE): $(TOP)/ext/rbu/rbu.c $(TOP)/ext/rbu/sqlite3rbu.c sqlite3.o
1074 $(TCC) -I. -o rbu$(EXE) $(TOP)/ext/rbu/rbu.c sqlite3.o \
1075 $(THREADLIB)
1077 loadfts: $(TOP)/tool/loadfts.c libsqlite3.a
1078 $(TCC) $(TOP)/tool/loadfts.c libsqlite3.a -o loadfts $(THREADLIB)
1080 threadtest5: $(TOP)/test/threadtest5.c libsqlite3.a
1081 $(TCC) $(TOP)/test/threadtest5.c libsqlite3.a -o threadtest5 $(THREADLIB)
1083 # This target will fail if the SQLite amalgamation contains any exported
1084 # symbols that do not begin with "sqlite3_". It is run as part of the
1085 # releasetest.tcl script.
1087 checksymbols: sqlite3.o
1088 nm -g --defined-only sqlite3.o | grep -v " sqlite3_" ; test $$? -ne 0
1090 # Build the amalgamation-autoconf package. The amalamgation-tarball target builds
1091 # a tarball named for the version number. Ex: sqlite-autoconf-3110000.tar.gz.
1092 # The snapshot-tarball target builds a tarball named by the SHA1 hash
1094 amalgamation-tarball: sqlite3.c sqlite3rc.h
1095 TOP=$(TOP) sh $(TOP)/tool/mkautoconfamal.sh --normal
1097 snapshot-tarball: sqlite3.c sqlite3rc.h
1098 TOP=$(TOP) sh $(TOP)/tool/mkautoconfamal.sh --snapshot
1101 # Standard install and cleanup targets
1103 install: sqlite3 libsqlite3.a sqlite3.h
1104 mv sqlite3 /usr/bin
1105 mv libsqlite3.a /usr/lib
1106 mv sqlite3.h /usr/include
1108 clean:
1109 rm -f *.o sqlite3 sqlite3.exe libsqlite3.a sqlite3.h opcodes.*
1110 rm -f lemon lemon.exe lempar.c parse.* sqlite*.tar.gz
1111 rm -f mkkeywordhash mkkeywordhash.exe keywordhash.h
1112 rm -f $(PUBLISH)
1113 rm -f *.da *.bb *.bbg gmon.out
1114 rm -rf tsrc target_source
1115 rm -f testloadext.dll libtestloadext.so
1116 rm -f amalgamation-testfixture amalgamation-testfixture.exe
1117 rm -f fts3-testfixture fts3-testfixture.exe
1118 rm -f testfixture testfixture.exe
1119 rm -f threadtest3 threadtest3.exe
1120 rm -f LogEst LogEst.exe
1121 rm -f fts3view fts3view.exe
1122 rm -f rollback-test rollback-test.exe
1123 rm -f showdb showdb.exe
1124 rm -f showjournal showjournal.exe
1125 rm -f showstat4 showstat4.exe
1126 rm -f showwal showwal.exe
1127 rm -f changeset changeset.exe
1128 rm -f speedtest1 speedtest1.exe
1129 rm -f wordcount wordcount.exe
1130 rm -f rbu rbu.exe
1131 rm -f srcck1 srcck1.exe
1132 rm -f sqlite3.c sqlite3-*.c fts?amal.c tclsqlite3.c
1133 rm -f sqlite3rc.h
1134 rm -f shell.c sqlite3ext.h
1135 rm -f sqlite3_analyzer sqlite3_analyzer.exe sqlite3_analyzer.c
1136 rm -f sqlite3_expert sqlite3_expert.exe
1137 rm -f sqlite-*-output.vsix
1138 rm -f mptester mptester.exe
1139 rm -f fuzzershell fuzzershell.exe
1140 rm -f fuzzcheck fuzzcheck.exe
1141 rm -f sessionfuzz
1142 rm -f sqldiff sqldiff.exe
1143 rm -f fts5.* fts5parse.*
1144 rm -f lsm.h lsm1.c
1145 rm -f threadtest5
1146 rm -f src-verify