standardize flag handling
[sqlcipher.git] / main.mk
blob628f3d1621025846952623075a3781edcd11043f
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/regexp.c \
364 $(TOP)/ext/misc/remember.c \
365 $(TOP)/ext/misc/series.c \
366 $(TOP)/ext/misc/spellfix.c \
367 $(TOP)/ext/misc/totype.c \
368 $(TOP)/ext/misc/unionvtab.c \
369 $(TOP)/ext/misc/wholenumber.c \
370 $(TOP)/ext/misc/zipfile.c \
371 $(TOP)/ext/fts5/fts5_tcl.c \
372 $(TOP)/ext/fts5/fts5_test_mi.c \
373 $(TOP)/ext/fts5/fts5_test_tok.c \
374 $(TOP)/ext/rtree/test_rtreedoc.c \
375 $(TOP)/ext/recover/sqlite3recover.c \
376 $(TOP)/ext/recover/dbdata.c \
377 $(TOP)/ext/recover/test_recover.c
380 #TESTSRC += $(TOP)/ext/fts3/fts3_tokenizer.c
382 TESTSRC2 = \
383 $(TOP)/src/attach.c \
384 $(TOP)/src/backup.c \
385 $(TOP)/src/btree.c \
386 $(TOP)/src/build.c \
387 $(TOP)/src/date.c \
388 $(TOP)/src/dbpage.c \
389 $(TOP)/src/dbstat.c \
390 $(TOP)/src/expr.c \
391 $(TOP)/src/func.c \
392 $(TOP)/src/global.c \
393 $(TOP)/src/insert.c \
394 $(TOP)/src/wal.c \
395 $(TOP)/src/main.c \
396 $(TOP)/src/mem5.c \
397 $(TOP)/src/os.c \
398 $(TOP)/src/os_kv.c \
399 $(TOP)/src/os_unix.c \
400 $(TOP)/src/os_win.c \
401 $(TOP)/src/pager.c \
402 $(TOP)/src/pragma.c \
403 $(TOP)/src/prepare.c \
404 $(TOP)/src/printf.c \
405 $(TOP)/src/random.c \
406 $(TOP)/src/pcache.c \
407 $(TOP)/src/pcache1.c \
408 $(TOP)/src/select.c \
409 $(TOP)/src/threads.c \
410 $(TOP)/src/tokenize.c \
411 $(TOP)/src/treeview.c \
412 $(TOP)/src/utf.c \
413 $(TOP)/src/util.c \
414 $(TOP)/src/vdbeapi.c \
415 $(TOP)/src/vdbeaux.c \
416 $(TOP)/src/vdbe.c \
417 $(TOP)/src/vdbemem.c \
418 $(TOP)/src/vdbevtab.c \
419 $(TOP)/src/where.c \
420 $(TOP)/src/wherecode.c \
421 $(TOP)/src/whereexpr.c \
422 parse.c \
423 $(TOP)/ext/fts3/fts3.c \
424 $(TOP)/ext/fts3/fts3_aux.c \
425 $(TOP)/ext/fts3/fts3_expr.c \
426 $(TOP)/ext/fts3/fts3_tokenizer.c \
427 $(TOP)/ext/fts3/fts3_write.c \
428 $(TOP)/ext/async/sqlite3async.c \
429 $(TOP)/ext/misc/stmt.c \
430 $(TOP)/ext/session/sqlite3session.c \
431 $(TOP)/ext/session/test_session.c \
432 fts5.c
434 # Header files used by all library source files.
436 HDR = \
437 $(TOP)/src/btree.h \
438 $(TOP)/src/btreeInt.h \
439 $(TOP)/src/hash.h \
440 $(TOP)/src/hwtime.h \
441 keywordhash.h \
442 $(TOP)/src/msvc.h \
443 $(TOP)/src/mutex.h \
444 opcodes.h \
445 $(TOP)/src/os.h \
446 $(TOP)/src/os_common.h \
447 $(TOP)/src/os_setup.h \
448 $(TOP)/src/os_win.h \
449 $(TOP)/src/pager.h \
450 $(TOP)/src/pcache.h \
451 parse.h \
452 $(TOP)/src/pragma.h \
453 sqlite3.h \
454 $(TOP)/src/sqlite3ext.h \
455 $(TOP)/src/sqliteInt.h \
456 $(TOP)/src/sqliteLimit.h \
457 $(TOP)/src/vdbe.h \
458 $(TOP)/src/vdbeInt.h \
459 $(TOP)/src/vxworks.h \
460 $(TOP)/src/whereInt.h
462 # Header files used by extensions
464 EXTHDR += \
465 $(TOP)/ext/fts3/fts3.h \
466 $(TOP)/ext/fts3/fts3Int.h \
467 $(TOP)/ext/fts3/fts3_hash.h \
468 $(TOP)/ext/fts3/fts3_tokenizer.h
469 EXTHDR += \
470 $(TOP)/ext/rtree/rtree.h \
471 $(TOP)/ext/rtree/geopoly.c
472 EXTHDR += \
473 $(TOP)/ext/icu/sqliteicu.h
474 EXTHDR += \
475 $(TOP)/ext/fts5/fts5Int.h \
476 fts5parse.h \
477 $(TOP)/ext/fts5/fts5.h
478 EXTHDR += \
479 $(TOP)/ext/userauth/sqlite3userauth.h
481 # executables needed for testing
483 TESTPROGS = \
484 testfixture$(EXE) \
485 sqlite3$(EXE) \
486 sqlite3_analyzer$(EXE) \
487 sqlite3_checker$(EXE) \
488 sqldiff$(EXE) \
489 dbhash$(EXE) \
490 sqltclsh$(EXE)
492 # Databases containing fuzzer test cases
494 FUZZDATA = \
495 $(TOP)/test/fuzzdata1.db \
496 $(TOP)/test/fuzzdata2.db \
497 $(TOP)/test/fuzzdata3.db \
498 $(TOP)/test/fuzzdata4.db \
499 $(TOP)/test/fuzzdata5.db \
500 $(TOP)/test/fuzzdata6.db \
501 $(TOP)/test/fuzzdata7.db \
502 $(TOP)/test/fuzzdata8.db
504 # Standard options to testfixture
506 TESTOPTS = --verbose=file --output=test-out.txt
508 # Extra compiler options for various shell tools
510 SHELL_OPT += -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5
511 SHELL_OPT += -DSQLITE_ENABLE_RTREE
512 SHELL_OPT += -DSQLITE_ENABLE_EXPLAIN_COMMENTS
513 SHELL_OPT += -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
514 SHELL_OPT += -DSQLITE_ENABLE_STMTVTAB
515 SHELL_OPT += -DSQLITE_ENABLE_DBPAGE_VTAB
516 SHELL_OPT += -DSQLITE_ENABLE_DBSTAT_VTAB
517 SHELL_OPT += -DSQLITE_ENABLE_BYTECODE_VTAB
518 SHELL_OPT += -DSQLITE_ENABLE_OFFSET_SQL_FUNC
519 FUZZCHECK_OPT += -I$(TOP)/test
520 FUZZCHECK_OPT += -I$(TOP)/ext/recover
521 FUZZCHECK_OPT += -DSQLITE_ENABLE_MEMSYS5
522 FUZZCHECK_OPT += -DSQLITE_MAX_MEMORY=50000000
523 FUZZCHECK_OPT += -DSQLITE_PRINTF_PRECISION_LIMIT=1000
524 FUZZCHECK_OPT += -DSQLITE_ENABLE_FTS4
525 FUZZCHECK_OPT += -DSQLITE_ENABLE_RTREE
526 FUZZCHECK_OPT += -DSQLITE_ENABLE_GEOPOLY
527 FUZZCHECK_OPT += -DSQLITE_ENABLE_DBSTAT_VTAB
528 FUZZCHECK_OPT += -DSQLITE_ENABLE_BYTECODE_VTAB
529 FUZZSRC += $(TOP)/test/fuzzcheck.c
530 FUZZSRC += $(TOP)/test/ossfuzz.c
531 FUZZSRC += $(TOP)/test/vt02.c
532 FUZZSRC += $(TOP)/test/fuzzinvariants.c
533 FUZZSRC += $(TOP)/ext/recover/dbdata.c
534 FUZZSRC += $(TOP)/ext/recover/sqlite3recover.c
535 DBFUZZ_OPT =
536 KV_OPT = -DSQLITE_THREADSAFE=0 -DSQLITE_DIRECT_OVERFLOW_READ
537 ST_OPT = -DSQLITE_THREADSAFE=0
539 # This is the default Makefile target. The objects listed here
540 # are what get build when you type just "make" with no arguments.
542 all: sqlite3.h sqlite3ext.h libsqlite3.a sqlite3$(EXE)
544 libsqlite3.a: sqlite3.h $(LIBOBJ)
545 $(AR) libsqlite3.a $(LIBOBJ)
546 $(RANLIB) libsqlite3.a
548 sqlite3$(EXE): sqlite3.h libsqlite3.a shell.c
549 $(TCCX) $(READLINE_FLAGS) -o sqlite3$(EXE) $(SHELL_OPT) \
550 shell.c libsqlite3.a $(LIBREADLINE) $(TLIBS) $(THREADLIB)
552 sqldiff$(EXE): $(TOP)/tool/sqldiff.c sqlite3.c sqlite3.h
553 $(TCCX) -o sqldiff$(EXE) -DSQLITE_THREADSAFE=0 \
554 $(TOP)/tool/sqldiff.c sqlite3.c $(TLIBS) $(THREADLIB)
556 dbhash$(EXE): $(TOP)/tool/dbhash.c sqlite3.c sqlite3.h
557 $(TCCX) -o dbhash$(EXE) -DSQLITE_THREADSAFE=0 \
558 $(TOP)/tool/dbhash.c sqlite3.c $(TLIBS) $(THREADLIB)
560 scrub$(EXE): $(TOP)/ext/misc/scrub.c sqlite3.o
561 $(TCC) -I. -DSCRUB_STANDALONE -o scrub$(EXE) $(TOP)/ext/misc/scrub.c sqlite3.o $(THREADLIB)
563 srcck1$(EXE): $(TOP)/tool/srcck1.c
564 $(BCC) -o srcck1$(EXE) $(TOP)/tool/srcck1.c
566 sourcetest: srcck1$(EXE) sqlite3.c
567 ./srcck1 sqlite3.c
569 fuzzershell$(EXE): $(TOP)/tool/fuzzershell.c sqlite3.c sqlite3.h
570 $(TCCX) -o fuzzershell$(EXE) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
571 $(FUZZERSHELL_OPT) $(TOP)/tool/fuzzershell.c sqlite3.c \
572 $(TLIBS) $(THREADLIB)
574 dbfuzz$(EXE): $(TOP)/test/dbfuzz.c sqlite3.c sqlite3.h
575 $(TCCX) -o dbfuzz$(EXE) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
576 $(DBFUZZ_OPT) $(TOP)/test/dbfuzz.c sqlite3.c \
577 $(TLIBS) $(THREADLIB)
579 DBFUZZ2_OPTS = \
580 -DSQLITE_THREADSAFE=0 \
581 -DSQLITE_OMIT_LOAD_EXTENSION \
582 -DSQLITE_DEBUG \
583 -DSQLITE_ENABLE_DBSTAT_VTAB \
584 -DSQLITE_ENABLE_BYTECODE_VTAB \
585 -DSQLITE_ENABLE_RTREE \
586 -DSQLITE_ENABLE_FTS4 \
587 -DSQLITE_ENABLE_FTS5
589 dbfuzz2$(EXE): $(TOP)/test/dbfuzz2.c sqlite3.c sqlite3.h
590 $(TCCX) -I. -g -O0 -DSTANDALONE -o dbfuzz2$(EXE) \
591 $(DBFUZZ2_OPTS) $(TOP)/test/dbfuzz2.c sqlite3.c $(TLIBS) $(THREADLIB)
593 fuzzcheck$(EXE): $(FUZZSRC) sqlite3.c sqlite3.h $(FUZZDEP)
594 $(TCCX) -o fuzzcheck$(EXE) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
595 -DSQLITE_ENABLE_MEMSYS5 $(FUZZCHECK_OPT) -DSQLITE_OSS_FUZZ \
596 $(FUZZSRC) sqlite3.c $(TLIBS) $(THREADLIB)
598 ossshell$(EXE): $(TOP)/test/ossfuzz.c $(TOP)/test/ossshell.c sqlite3.c sqlite3.h
599 $(TCCX) -o ossshell$(EXE) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
600 -DSQLITE_ENABLE_MEMSYS5 $(FUZZCHECK_OPT) \
601 $(TOP)/test/ossfuzz.c $(TOP)/test/ossshell.c sqlite3.c $(TLIBS) $(THREADLIB)
603 sessionfuzz$(EXE): $(TOP)/test/sessionfuzz.c sqlite3.c sqlite3.h
604 $(TCC) -o sessionfuzz$(EXE) $(TOP)/test/sessionfuzz.c -lz $(TLIBS) $(THREADLIB)
606 mptester$(EXE): sqlite3.c $(TOP)/mptest/mptest.c
607 $(TCCX) -o $@ -I. $(TOP)/mptest/mptest.c sqlite3.c \
608 $(TLIBS) $(THREADLIB)
610 MPTEST1=./mptester$(EXE) mptest1.db $(TOP)/mptest/crash01.test --repeat 20
611 MPTEST2=./mptester$(EXE) mptest2.db $(TOP)/mptest/multiwrite01.test --repeat 20
612 mptest: mptester$(EXE)
613 $(MPTEST1) --journalmode DELETE
614 $(MPTEST2) --journalmode WAL
615 $(MPTEST1) --journalmode WAL
616 $(MPTEST2) --journalmode PERSIST
617 $(MPTEST1) --journalmode PERSIST
618 $(MPTEST2) --journalmode TRUNCATE
619 $(MPTEST1) --journalmode TRUNCATE
620 $(MPTEST2) --journalmode DELETE
622 sqlite3.o: sqlite3.c
623 $(TCCX) -I. -c sqlite3.c
625 # This target creates a directory named "tsrc" and fills it with
626 # copies of all of the C source code and header files needed to
627 # build on the target system. Some of the C source code and header
628 # files are automatically generated. This target takes care of
629 # all that automatic generation.
631 target_source: $(SRC) $(TOP)/tool/vdbe-compress.tcl fts5.c
632 rm -rf tsrc
633 mkdir tsrc
634 cp -f $(SRC) tsrc
635 rm tsrc/sqlite.h.in tsrc/parse.y
636 tclsh $(TOP)/tool/vdbe-compress.tcl $(OPTS) <tsrc/vdbe.c >vdbe.new
637 mv vdbe.new tsrc/vdbe.c
638 cp fts5.c fts5.h tsrc
639 touch target_source
641 sqlite3.c: target_source $(TOP)/tool/mksqlite3c.tcl
642 tclsh $(TOP)/tool/mksqlite3c.tcl
643 cp tsrc/sqlite3ext.h .
644 cp $(TOP)/ext/session/sqlite3session.h .
645 echo '#ifndef USE_SYSTEM_SQLITE' >tclsqlite3.c
646 cat sqlite3.c >>tclsqlite3.c
647 echo '#endif /* USE_SYSTEM_SQLITE */' >>tclsqlite3.c
648 cat $(TOP)/src/tclsqlite.c >>tclsqlite3.c
650 sqlite3ext.h: target_source
651 cp tsrc/sqlite3ext.h .
653 sqlite3.c-debug: target_source $(TOP)/tool/mksqlite3c.tcl
654 tclsh $(TOP)/tool/mksqlite3c.tcl --linemacros=1
655 echo '#ifndef USE_SYSTEM_SQLITE' >tclsqlite3.c
656 cat sqlite3.c >>tclsqlite3.c
657 echo '#endif /* USE_SYSTEM_SQLITE */' >>tclsqlite3.c
658 echo '#line 1 "tclsqlite.c"' >>tclsqlite3.c
659 cat $(TOP)/src/tclsqlite.c >>tclsqlite3.c
661 sqlite3-all.c: sqlite3.c $(TOP)/tool/split-sqlite3c.tcl
662 tclsh $(TOP)/tool/split-sqlite3c.tcl
664 # Rules to build the LEMON compiler generator
666 lemon: $(TOP)/tool/lemon.c $(TOP)/tool/lempar.c
667 $(BCC) -o lemon $(TOP)/tool/lemon.c
668 cp $(TOP)/tool/lempar.c .
670 # A tool to generate the source-id
672 mksourceid: $(TOP)/tool/mksourceid.c
673 $(BCC) -o mksourceid $(TOP)/tool/mksourceid.c
675 # Rules to build individual *.o files from generated *.c files. This
676 # applies to:
678 # parse.o
679 # opcodes.o
681 %.o: %.c $(HDR)
682 $(TCCX) -c $<
684 # Rules to build individual *.o files from files in the src directory.
686 %.o: $(TOP)/src/%.c $(HDR)
687 $(TCCX) -c $<
689 tclsqlite.o: $(TOP)/src/tclsqlite.c $(HDR)
690 $(TCCX) $(TCL_FLAGS) -c $(TOP)/src/tclsqlite.c
694 # Rules to build opcodes.c and opcodes.h
696 opcodes.c: opcodes.h $(TOP)/tool/mkopcodec.tcl
697 tclsh $(TOP)/tool/mkopcodec.tcl opcodes.h >opcodes.c
699 opcodes.h: parse.h $(TOP)/src/vdbe.c $(TOP)/tool/mkopcodeh.tcl
700 cat parse.h $(TOP)/src/vdbe.c | \
701 tclsh $(TOP)/tool/mkopcodeh.tcl >opcodes.h
703 # Rules to build parse.c and parse.h - the outputs of lemon.
705 parse.h: parse.c
707 parse.c: $(TOP)/src/parse.y lemon
708 cp $(TOP)/src/parse.y .
709 ./lemon -s $(OPTS) parse.y
711 sqlite3.h: $(TOP)/src/sqlite.h.in $(TOP)/manifest mksourceid $(TOP)/VERSION $(TOP)/ext/rtree/sqlite3rtree.h
712 tclsh $(TOP)/tool/mksqlite3h.tcl $(TOP) >sqlite3.h
714 sqlite3rc.h: $(TOP)/src/sqlite3.rc $(TOP)/VERSION
715 echo '#ifndef SQLITE_RESOURCE_VERSION' >$@
716 echo -n '#define SQLITE_RESOURCE_VERSION ' >>$@
717 cat $(TOP)/VERSION | tclsh $(TOP)/tool/replace.tcl exact . , >>$@
718 echo '#endif' >>sqlite3rc.h
720 keywordhash.h: $(TOP)/tool/mkkeywordhash.c
721 $(BCC) -o mkkeywordhash $(OPTS) $(TOP)/tool/mkkeywordhash.c
722 ./mkkeywordhash >keywordhash.h
724 # Source files that go into making shell.c
725 SHELL_SRC = \
726 $(TOP)/src/shell.c.in \
727 $(TOP)/ext/misc/appendvfs.c \
728 $(TOP)/ext/misc/completion.c \
729 $(TOP)/ext/misc/base64.c \
730 $(TOP)/ext/misc/base85.c \
731 $(TOP)/ext/misc/decimal.c \
732 $(TOP)/ext/misc/fileio.c \
733 $(TOP)/ext/misc/ieee754.c \
734 $(TOP)/ext/misc/regexp.c \
735 $(TOP)/ext/misc/series.c \
736 $(TOP)/ext/misc/shathree.c \
737 $(TOP)/ext/misc/sqlar.c \
738 $(TOP)/ext/misc/uint.c \
739 $(TOP)/ext/expert/sqlite3expert.c \
740 $(TOP)/ext/expert/sqlite3expert.h \
741 $(TOP)/ext/misc/zipfile.c \
742 $(TOP)/ext/misc/memtrace.c \
743 $(TOP)/ext/recover/dbdata.c \
744 $(TOP)/ext/recover/sqlite3recover.c \
745 $(TOP)/ext/recover/sqlite3recover.h \
746 $(TOP)/src/test_windirent.c
748 shell.c: $(SHELL_SRC) $(TOP)/tool/mkshellc.tcl
749 tclsh $(TOP)/tool/mkshellc.tcl >shell.c
753 # Rules to build the extension objects.
755 icu.o: $(TOP)/ext/icu/icu.c $(HDR) $(EXTHDR)
756 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/icu/icu.c
758 fts3.o: $(TOP)/ext/fts3/fts3.c $(HDR) $(EXTHDR)
759 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3.c
761 fts3_aux.o: $(TOP)/ext/fts3/fts3_aux.c $(HDR) $(EXTHDR)
762 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_aux.c
764 fts3_expr.o: $(TOP)/ext/fts3/fts3_expr.c $(HDR) $(EXTHDR)
765 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_expr.c
767 fts3_hash.o: $(TOP)/ext/fts3/fts3_hash.c $(HDR) $(EXTHDR)
768 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_hash.c
770 fts3_icu.o: $(TOP)/ext/fts3/fts3_icu.c $(HDR) $(EXTHDR)
771 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_icu.c
773 fts3_snippet.o: $(TOP)/ext/fts3/fts3_snippet.c $(HDR) $(EXTHDR)
774 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_snippet.c
776 fts3_porter.o: $(TOP)/ext/fts3/fts3_porter.c $(HDR) $(EXTHDR)
777 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_porter.c
779 fts3_tokenizer.o: $(TOP)/ext/fts3/fts3_tokenizer.c $(HDR) $(EXTHDR)
780 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer.c
782 fts3_tokenizer1.o: $(TOP)/ext/fts3/fts3_tokenizer1.c $(HDR) $(EXTHDR)
783 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer1.c
785 fts3_tokenize_vtab.o: $(TOP)/ext/fts3/fts3_tokenize_vtab.c $(HDR) $(EXTHDR)
786 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenize_vtab.c
788 fts3_unicode.o: $(TOP)/ext/fts3/fts3_unicode.c $(HDR) $(EXTHDR)
789 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_unicode.c
791 fts3_unicode2.o: $(TOP)/ext/fts3/fts3_unicode2.c $(HDR) $(EXTHDR)
792 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_unicode2.c
794 fts3_write.o: $(TOP)/ext/fts3/fts3_write.c $(HDR) $(EXTHDR)
795 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_write.c
797 fts5.o: fts5.c sqlite3ext.h sqlite3.h
798 $(TCCX) -DSQLITE_CORE -c fts5.c
800 stmt.o: $(TOP)/ext/misc/stmt.c sqlite3ext.h sqlite3.h
801 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/misc/stmt.c
803 rtree.o: $(TOP)/ext/rtree/rtree.c $(HDR) $(EXTHDR)
804 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/rtree/rtree.c
808 fts5parse.c: $(TOP)/ext/fts5/fts5parse.y lemon
809 cp $(TOP)/ext/fts5/fts5parse.y .
810 rm -f fts5parse.h
811 ./lemon $(OPTS) fts5parse.y
813 fts5parse.h: fts5parse.c
815 fts5.c: $(FTS5_SRC) $(FTS5_HDR)
816 tclsh $(TOP)/ext/fts5/tool/mkfts5c.tcl
817 cp $(TOP)/ext/fts5/fts5.h .
819 lsm1.c: $(LSM1_SRC)
820 tclsh $(TOP)/ext/lsm1/tool/mklsm1c.tcl
821 cp $(TOP)/ext/lsm1/lsm.h .
823 userauth.o: $(TOP)/ext/userauth/userauth.c $(HDR) $(EXTHDR)
824 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/userauth/userauth.c
826 sqlite3session.o: $(TOP)/ext/session/sqlite3session.c $(HDR) $(EXTHDR)
827 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/session/sqlite3session.c
829 sqlite3rbu.o: $(TOP)/ext/rbu/sqlite3rbu.c $(HDR) $(EXTHDR)
830 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/rbu/sqlite3rbu.c
832 # Rules for building test programs and for running tests
834 tclsqlite3: $(TOP)/src/tclsqlite.c libsqlite3.a
835 $(TCCX) $(TCL_FLAGS) -DTCLSH -o tclsqlite3 \
836 $(TOP)/src/tclsqlite.c libsqlite3.a $(LIBTCL) $(THREADLIB)
838 sqlite3_analyzer.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl $(TOP)/tool/sqlite3_analyzer.c.in $(TOP)/tool/mkccode.tcl
839 tclsh $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqlite3_analyzer.c.in >sqlite3_analyzer.c
841 sqlite3_analyzer$(EXE): sqlite3_analyzer.c
842 $(TCCX) $(TCL_FLAGS) sqlite3_analyzer.c -o $@ $(LIBTCL) $(THREADLIB)
844 sqltclsh.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/sqltclsh.tcl $(TOP)/ext/misc/appendvfs.c $(TOP)/tool/mkccode.tcl
845 tclsh $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqltclsh.c.in >sqltclsh.c
847 sqltclsh$(EXE): sqltclsh.c
848 $(TCCX) $(TCL_FLAGS) sqltclsh.c -o $@ $(LIBTCL) $(THREADLIB)
850 sqlite3_expert$(EXE): $(TOP)/ext/expert/sqlite3expert.h $(TOP)/ext/expert/sqlite3expert.c $(TOP)/ext/expert/expert.c sqlite3.c
851 $(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)
853 CHECKER_DEPS =\
854 $(TOP)/tool/mkccode.tcl \
855 sqlite3.c \
856 $(TOP)/src/tclsqlite.c \
857 $(TOP)/ext/repair/sqlite3_checker.tcl \
858 $(TOP)/ext/repair/checkindex.c \
859 $(TOP)/ext/repair/checkfreelist.c \
860 $(TOP)/ext/misc/btreeinfo.c \
861 $(TOP)/ext/repair/sqlite3_checker.c.in
863 sqlite3_checker.c: $(CHECKER_DEPS)
864 tclsh $(TOP)/tool/mkccode.tcl $(TOP)/ext/repair/sqlite3_checker.c.in >$@
866 sqlite3_checker$(TEXE): sqlite3_checker.c
867 $(TCCX) $(TCL_FLAGS) sqlite3_checker.c -o $@ $(LIBTCL) $(THREADLIB)
869 dbdump$(EXE): $(TOP)/ext/misc/dbdump.c sqlite3.o
870 $(TCCX) -DDBDUMP_STANDALONE -o dbdump$(EXE) \
871 $(TOP)/ext/misc/dbdump.c sqlite3.o $(THREADLIB)
873 # Rules to build the 'testfixture' application.
875 TESTFIXTURE_FLAGS = -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
876 TESTFIXTURE_FLAGS += -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE
877 TESTFIXTURE_FLAGS += -DSQLITE_SERIES_CONSTRAINT_VERIFY=1
878 TESTFIXTURE_FLAGS += -DSQLITE_DEFAULT_PAGE_SIZE=1024
879 TESTFIXTURE_FLAGS += -DSQLITE_ENABLE_STMTVTAB
880 TESTFIXTURE_FLAGS += -DSQLITE_ENABLE_DBPAGE_VTAB
881 TESTFIXTURE_FLAGS += -DSQLITE_ENABLE_BYTECODE_VTAB
882 TESTFIXTURE_FLAGS += -DTCLSH_INIT_PROC=sqlite3TestInit
883 TESTFIXTURE_FLAGS += -DSQLITE_CKSUMVFS_STATIC
885 testfixture$(EXE): $(TESTSRC2) libsqlite3.a $(TESTSRC) $(TOP)/src/tclsqlite.c
886 $(TCCX) $(TCL_FLAGS) $(TESTFIXTURE_FLAGS) \
887 $(TESTSRC) $(TESTSRC2) $(TOP)/src/tclsqlite.c \
888 -o testfixture$(EXE) $(LIBTCL) libsqlite3.a $(THREADLIB)
890 amalgamation-testfixture$(EXE): sqlite3.c $(TESTSRC) $(TOP)/src/tclsqlite.c \
891 $(TOP)/ext/session/test_session.c
892 $(TCCX) $(TCL_FLAGS) $(TESTFIXTURE_FLAGS) \
893 $(TESTSRC) $(TOP)/src/tclsqlite.c sqlite3.c \
894 $(TOP)/ext/session/test_session.c \
895 -o testfixture$(EXE) $(LIBTCL) $(THREADLIB)
897 coretestprogs: $(TESTPROGS)
899 testprogs: coretestprogs srcck1$(EXE) fuzzcheck$(EXE) sessionfuzz$(EXE)
901 fulltest: $(TESTPROGS) fuzztest
902 ./testfixture$(EXE) $(TOP)/test/all.test $(TESTOPTS)
904 soaktest: $(TESTPROGS)
905 ./testfixture$(EXE) $(TOP)/test/all.test -soak=1 $(TESTOPTS)
907 fulltestonly: $(TESTPROGS) fuzztest
908 ./testfixture$(EXE) $(TOP)/test/full.test $(TESTOPTS)
910 queryplantest: testfixture$(EXE) sqlite3$(EXE)
911 ./testfixture$(EXE) $(TOP)/test/permutations.test queryplanner $(TESTOPTS)
913 fuzztest: fuzzcheck$(EXE) $(FUZZDATA) sessionfuzz$(EXE) $(TOP)/test/sessionfuzz-data1.db
914 ./fuzzcheck$(EXE) $(FUZZDATA)
915 ./sessionfuzz run $(TOP)/test/sessionfuzz-data1.db
917 valgrindfuzz: fuzzcheck$(EXE) $(FUZZDATA) sessionfuzz$(EXE) $(TOP)/test/sessionfuzz-data1.db
918 valgrind ./fuzzcheck$(EXE) --cell-size-check --limit-mem 10M $(FUZZDATA)
919 valgrind ./sessionfuzz run $(TOP)/test/sessionfuzz-data1.db
921 # The veryquick.test TCL tests.
923 tcltest: ./testfixture$(EXE)
924 ./testfixture$(EXE) $(TOP)/test/veryquick.test $(TESTOPTS)
926 # Runs all the same tests cases as the "tcltest" target but uses
927 # the testrunner.tcl script to run them in multiple cores
928 # concurrently.
929 testrunner: testfixture$(EXE)
930 ./testfixture$(EXE) $(TOP)/test/testrunner.tcl
932 # Runs both fuzztest and testrunner, consecutively.
934 devtest: testfixture$(EXE) fuzztest testrunner
936 # A very quick test using only testfixture and omitting all the slower
937 # tests. Designed to run in under 3 minutes on a workstation.
939 quicktest: ./testfixture$(EXE)
940 ./testfixture$(EXE) $(TOP)/test/extraquick.test $(TESTOPTS)
942 # The default test case. Runs most of the faster standard TCL tests,
943 # and fuzz tests, and sqlite3_analyzer and sqldiff tests.
944 test: fuzztest sourcetest $(TESTPROGS) tcltest
947 # Run a test using valgrind. This can take a really long time
948 # because valgrind is so much slower than a native machine.
950 valgrindtest: $(TESTPROGS) valgrindfuzz
951 OMIT_MISUSE=1 valgrind -v \
952 ./testfixture$(EXE) $(TOP)/test/permutations.test valgrind $(TESTOPTS)
954 # A very fast test that checks basic sanity. The name comes from
955 # the 60s-era electronics testing: "Turn it on and see if smoke
956 # comes out."
958 smoketest: $(TESTPROGS) fuzzcheck$(EXE)
959 ./testfixture$(EXE) $(TOP)/test/main.test $(TESTOPTS)
961 shelltest: $(TESTPROGS)
962 ./testfixture$(EXT) $(TOP)/test/permutations.test shell
964 # The next two rules are used to support the "threadtest" target. Building
965 # threadtest runs a few thread-safety tests that are implemented in C. This
966 # target is invoked by the releasetest.tcl script.
968 THREADTEST3_SRC = $(TOP)/test/threadtest3.c \
969 $(TOP)/test/tt3_checkpoint.c \
970 $(TOP)/test/tt3_index.c \
971 $(TOP)/test/tt3_vacuum.c \
972 $(TOP)/test/tt3_stress.c \
973 $(TOP)/test/tt3_lookaside1.c
975 threadtest3$(EXE): sqlite3.o $(THREADTEST3_SRC) $(TOP)/src/test_multiplex.c
976 $(TCCX) $(TOP)/test/threadtest3.c $(TOP)/src/test_multiplex.c sqlite3.o -o $@ $(THREADLIB)
978 threadtest: threadtest3$(EXE)
979 ./threadtest3$(EXE)
981 TEST_EXTENSION = $(SHPREFIX)testloadext.$(SO)
982 $(TEST_EXTENSION): $(TOP)/src/test_loadext.c
983 $(MKSHLIB) $(TOP)/src/test_loadext.c -o $(TEST_EXTENSION)
985 extensiontest: testfixture$(EXE) $(TEST_EXTENSION)
986 ./testfixture$(EXE) $(TOP)/test/loadext.test
988 dbtotxt$(EXE): $(TOP)/tool/dbtotxt.c
989 $(TCC) -o dbtotxt$(EXE) $(TOP)/tool/dbtotxt.c
991 showdb$(EXE): $(TOP)/tool/showdb.c sqlite3.o
992 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o showdb$(EXE) \
993 $(TOP)/tool/showdb.c sqlite3.o $(THREADLIB)
995 showstat4$(EXE): $(TOP)/tool/showstat4.c sqlite3.o
996 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o showstat4$(EXE) \
997 $(TOP)/tool/showstat4.c sqlite3.o $(THREADLIB)
999 showjournal$(EXE): $(TOP)/tool/showjournal.c sqlite3.o
1000 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o showjournal$(EXE) \
1001 $(TOP)/tool/showjournal.c sqlite3.o $(THREADLIB)
1003 showwal$(EXE): $(TOP)/tool/showwal.c sqlite3.o
1004 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o showwal$(EXE) \
1005 $(TOP)/tool/showwal.c sqlite3.o $(THREADLIB)
1007 showshm$(EXE): $(TOP)/tool/showshm.c
1008 $(TCC) -o showshm$(EXE) $(TOP)/tool/showshm.c
1010 index_usage$(EXE): $(TOP)/tool/index_usage.c sqlite3.o
1011 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_DEPRECATED $(SHELL_OPTS) -o index_usage$(EXE) \
1012 $(TOP)/tool/index_usage.c sqlite3.o $(THREADLIB)
1014 changeset$(EXE): $(TOP)/ext/session/changeset.c sqlite3.o
1015 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o changeset$(EXE) \
1016 $(TOP)/ext/session/changeset.c sqlite3.o $(THREADLIB)
1018 changesetfuzz$(EXE): $(TOP)/ext/session/changesetfuzz.c sqlite3.o
1019 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o changesetfuzz$(EXE) \
1020 $(TOP)/ext/session/changesetfuzz.c sqlite3.o $(THREADLIB)
1022 fts3view$(EXE): $(TOP)/ext/fts3/tool/fts3view.c sqlite3.o
1023 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o fts3view$(EXE) \
1024 $(TOP)/ext/fts3/tool/fts3view.c sqlite3.o $(THREADLIB)
1026 rollback-test$(EXE): $(TOP)/tool/rollback-test.c sqlite3.o
1027 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o rollback-test$(EXE) \
1028 $(TOP)/tool/rollback-test.c sqlite3.o $(THREADLIB)
1030 atrc$(EXE): $(TOP)/test/atrc.c sqlite3.o
1031 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o atrc$(EXE) \
1032 $(TOP)/test/atrc.c sqlite3.o $(THREADLIB)
1034 LogEst$(EXE): $(TOP)/tool/logest.c sqlite3.h
1035 $(TCC) -o LogEst$(EXE) $(TOP)/tool/logest.c
1037 wordcount$(EXE): $(TOP)/test/wordcount.c sqlite3.c
1038 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o wordcount$(EXE) \
1039 $(TOP)/test/wordcount.c sqlite3.c
1041 speedtest1$(EXE): $(TOP)/test/speedtest1.c sqlite3.c
1042 $(TCCX) -I. $(ST_OPT) -o speedtest1$(EXE) $(TOP)/test/speedtest1.c sqlite3.c $(THREADLIB)
1044 kvtest$(EXE): $(TOP)/test/kvtest.c sqlite3.c
1045 $(TCCX) -I. $(KV_OPT) -o kvtest$(EXE) $(TOP)/test/kvtest.c sqlite3.c $(THREADLIB)
1047 rbu$(EXE): $(TOP)/ext/rbu/rbu.c $(TOP)/ext/rbu/sqlite3rbu.c sqlite3.o
1048 $(TCC) -I. -o rbu$(EXE) $(TOP)/ext/rbu/rbu.c sqlite3.o \
1049 $(THREADLIB)
1051 loadfts: $(TOP)/tool/loadfts.c libsqlite3.a
1052 $(TCC) $(TOP)/tool/loadfts.c libsqlite3.a -o loadfts $(THREADLIB)
1054 threadtest5: $(TOP)/test/threadtest5.c libsqlite3.a
1055 $(TCC) $(TOP)/test/threadtest5.c libsqlite3.a -o threadtest5 $(THREADLIB)
1057 # This target will fail if the SQLite amalgamation contains any exported
1058 # symbols that do not begin with "sqlite3_". It is run as part of the
1059 # releasetest.tcl script.
1061 checksymbols: sqlite3.o
1062 nm -g --defined-only sqlite3.o | grep -v " sqlite3_" ; test $$? -ne 0
1064 # Build the amalgamation-autoconf package. The amalamgation-tarball target builds
1065 # a tarball named for the version number. Ex: sqlite-autoconf-3110000.tar.gz.
1066 # The snapshot-tarball target builds a tarball named by the SHA1 hash
1068 amalgamation-tarball: sqlite3.c sqlite3rc.h
1069 TOP=$(TOP) sh $(TOP)/tool/mkautoconfamal.sh --normal
1071 snapshot-tarball: sqlite3.c sqlite3rc.h
1072 TOP=$(TOP) sh $(TOP)/tool/mkautoconfamal.sh --snapshot
1075 # Standard install and cleanup targets
1077 install: sqlite3 libsqlite3.a sqlite3.h
1078 mv sqlite3 /usr/bin
1079 mv libsqlite3.a /usr/lib
1080 mv sqlite3.h /usr/include
1082 clean:
1083 rm -f *.o sqlite3 sqlite3.exe libsqlite3.a sqlite3.h opcodes.*
1084 rm -f lemon lemon.exe lempar.c parse.* sqlite*.tar.gz
1085 rm -f mkkeywordhash mkkeywordhash.exe keywordhash.h
1086 rm -f $(PUBLISH)
1087 rm -f *.da *.bb *.bbg gmon.out
1088 rm -rf tsrc target_source
1089 rm -f testloadext.dll libtestloadext.so
1090 rm -f amalgamation-testfixture amalgamation-testfixture.exe
1091 rm -f fts3-testfixture fts3-testfixture.exe
1092 rm -f testfixture testfixture.exe
1093 rm -f threadtest3 threadtest3.exe
1094 rm -f LogEst LogEst.exe
1095 rm -f fts3view fts3view.exe
1096 rm -f rollback-test rollback-test.exe
1097 rm -f showdb showdb.exe
1098 rm -f showjournal showjournal.exe
1099 rm -f showstat4 showstat4.exe
1100 rm -f showwal showwal.exe
1101 rm -f changeset changeset.exe
1102 rm -f speedtest1 speedtest1.exe
1103 rm -f wordcount wordcount.exe
1104 rm -f rbu rbu.exe
1105 rm -f srcck1 srcck1.exe
1106 rm -f sqlite3.c sqlite3-*.c fts?amal.c tclsqlite3.c
1107 rm -f sqlite3rc.h
1108 rm -f shell.c sqlite3ext.h
1109 rm -f sqlite3_analyzer sqlite3_analyzer.exe sqlite3_analyzer.c
1110 rm -f sqlite3_expert sqlite3_expert.exe
1111 rm -f sqlite-*-output.vsix
1112 rm -f mptester mptester.exe
1113 rm -f fuzzershell fuzzershell.exe
1114 rm -f fuzzcheck fuzzcheck.exe
1115 rm -f sessionfuzz
1116 rm -f sqldiff sqldiff.exe
1117 rm -f fts5.* fts5parse.*
1118 rm -f lsm.h lsm1.c
1119 rm -f threadtest5