Add missing VdbeCoverage() and VdbeCoverageNeverTaken() macros to window.c.
[sqlite.git] / main.mk
blobeb66473481955161e88e4643cd6b58d32424ec8b
1 ###############################################################################
2 # The following macros should be defined before this script is
3 # invoked:
5 # TOP The toplevel directory of the source tree. This is the
6 # directory that contains this "Makefile.in" and the
7 # "configure.in" script.
9 # BCC C Compiler and options for use in building executables that
10 # will run on the platform that is doing the build.
12 # THREADLIB Specify any extra linker options needed to make the library
13 # thread safe
15 # LIBS Extra libraries options
17 # OPTS Extra compiler command-line options.
19 # EXE The suffix to add to executable files. ".exe" for windows
20 # and "" for Unix.
22 # TCC C Compiler and options for use in building executables that
23 # will run on the target platform. This is usually the same
24 # as BCC, unless you are cross-compiling.
26 # AR Tools used to build a static library.
27 # RANLIB
29 # TCL_FLAGS Extra compiler options needed for programs that use the
30 # TCL library.
32 # LIBTCL Linker options needed to link against the TCL library.
34 # READLINE_FLAGS Compiler options needed for programs that use the
35 # readline() library.
37 # LIBREADLINE Linker options needed by programs using readline() must
38 # link against.
40 # Once the macros above are defined, the rest of this make script will
41 # build the SQLite library and testing tools.
42 ################################################################################
44 # This is how we compile
46 TCCX = $(TCC) $(OPTS) -I. -I$(TOP)/src -I$(TOP)
47 TCCX += -I$(TOP)/ext/rtree -I$(TOP)/ext/icu -I$(TOP)/ext/fts3
48 TCCX += -I$(TOP)/ext/async -I$(TOP)/ext/userauth
49 TCCX += -I$(TOP)/ext/session
50 TCCX += -I$(TOP)/ext/fts5
51 THREADLIB += $(LIBS)
53 # Object files for the SQLite library.
55 LIBOBJ+= vdbe.o parse.o \
56 alter.o analyze.o attach.o auth.o \
57 backup.o bitvec.o btmutex.o btree.o build.o \
58 callback.o complete.o ctime.o \
59 date.o dbpage.o dbstat.o delete.o expr.o \
60 fault.o fkey.o \
61 fts3.o fts3_aux.o fts3_expr.o fts3_hash.o fts3_icu.o fts3_porter.o \
62 fts3_snippet.o fts3_tokenizer.o fts3_tokenizer1.o \
63 fts3_tokenize_vtab.o \
64 fts3_unicode.o fts3_unicode2.o \
65 fts3_write.o fts5.o func.o global.o hash.o \
66 icu.o insert.o json1.o legacy.o loadext.o \
67 main.o malloc.o mem0.o mem1.o mem2.o mem3.o mem5.o \
68 memdb.o memjournal.o \
69 mutex.o mutex_noop.o mutex_unix.o mutex_w32.o \
70 notify.o opcodes.o os.o os_unix.o os_win.o \
71 pager.o pcache.o pcache1.o pragma.o prepare.o printf.o \
72 random.o resolve.o rowset.o rtree.o \
73 select.o sqlite3rbu.o status.o stmt.o \
74 table.o threads.o tokenize.o treeview.o trigger.o \
75 update.o upsert.o userauth.o util.o vacuum.o \
76 vdbeapi.o vdbeaux.o vdbeblob.o vdbemem.o vdbesort.o \
77 vdbetrace.o wal.o walker.o where.o wherecode.o whereexpr.o \
78 utf.o vtab.o window.o
80 LIBOBJ += sqlite3session.o
82 # All of the source code files.
84 SRC = \
85 $(TOP)/src/alter.c \
86 $(TOP)/src/analyze.c \
87 $(TOP)/src/attach.c \
88 $(TOP)/src/auth.c \
89 $(TOP)/src/backup.c \
90 $(TOP)/src/bitvec.c \
91 $(TOP)/src/btmutex.c \
92 $(TOP)/src/btree.c \
93 $(TOP)/src/btree.h \
94 $(TOP)/src/btreeInt.h \
95 $(TOP)/src/build.c \
96 $(TOP)/src/callback.c \
97 $(TOP)/src/complete.c \
98 $(TOP)/src/ctime.c \
99 $(TOP)/src/date.c \
100 $(TOP)/src/dbpage.c \
101 $(TOP)/src/dbstat.c \
102 $(TOP)/src/delete.c \
103 $(TOP)/src/expr.c \
104 $(TOP)/src/fault.c \
105 $(TOP)/src/fkey.c \
106 $(TOP)/src/func.c \
107 $(TOP)/src/global.c \
108 $(TOP)/src/hash.c \
109 $(TOP)/src/hash.h \
110 $(TOP)/src/hwtime.h \
111 $(TOP)/src/insert.c \
112 $(TOP)/src/legacy.c \
113 $(TOP)/src/loadext.c \
114 $(TOP)/src/main.c \
115 $(TOP)/src/malloc.c \
116 $(TOP)/src/mem0.c \
117 $(TOP)/src/mem1.c \
118 $(TOP)/src/mem2.c \
119 $(TOP)/src/mem3.c \
120 $(TOP)/src/mem5.c \
121 $(TOP)/src/memdb.c \
122 $(TOP)/src/memjournal.c \
123 $(TOP)/src/msvc.h \
124 $(TOP)/src/mutex.c \
125 $(TOP)/src/mutex.h \
126 $(TOP)/src/mutex_noop.c \
127 $(TOP)/src/mutex_unix.c \
128 $(TOP)/src/mutex_w32.c \
129 $(TOP)/src/notify.c \
130 $(TOP)/src/os.c \
131 $(TOP)/src/os.h \
132 $(TOP)/src/os_common.h \
133 $(TOP)/src/os_setup.h \
134 $(TOP)/src/os_unix.c \
135 $(TOP)/src/os_win.c \
136 $(TOP)/src/os_win.h \
137 $(TOP)/src/pager.c \
138 $(TOP)/src/pager.h \
139 $(TOP)/src/parse.y \
140 $(TOP)/src/pcache.c \
141 $(TOP)/src/pcache.h \
142 $(TOP)/src/pcache1.c \
143 $(TOP)/src/pragma.c \
144 $(TOP)/src/pragma.h \
145 $(TOP)/src/prepare.c \
146 $(TOP)/src/printf.c \
147 $(TOP)/src/random.c \
148 $(TOP)/src/resolve.c \
149 $(TOP)/src/rowset.c \
150 $(TOP)/src/select.c \
151 $(TOP)/src/status.c \
152 $(TOP)/src/shell.c.in \
153 $(TOP)/src/sqlite.h.in \
154 $(TOP)/src/sqlite3ext.h \
155 $(TOP)/src/sqliteInt.h \
156 $(TOP)/src/sqliteLimit.h \
157 $(TOP)/src/table.c \
158 $(TOP)/src/tclsqlite.c \
159 $(TOP)/src/threads.c \
160 $(TOP)/src/tokenize.c \
161 $(TOP)/src/treeview.c \
162 $(TOP)/src/trigger.c \
163 $(TOP)/src/utf.c \
164 $(TOP)/src/update.c \
165 $(TOP)/src/upsert.c \
166 $(TOP)/src/util.c \
167 $(TOP)/src/vacuum.c \
168 $(TOP)/src/vdbe.c \
169 $(TOP)/src/vdbe.h \
170 $(TOP)/src/vdbeapi.c \
171 $(TOP)/src/vdbeaux.c \
172 $(TOP)/src/vdbeblob.c \
173 $(TOP)/src/vdbemem.c \
174 $(TOP)/src/vdbesort.c \
175 $(TOP)/src/vdbetrace.c \
176 $(TOP)/src/vdbeInt.h \
177 $(TOP)/src/vtab.c \
178 $(TOP)/src/vxworks.h \
179 $(TOP)/src/wal.c \
180 $(TOP)/src/wal.h \
181 $(TOP)/src/walker.c \
182 $(TOP)/src/where.c \
183 $(TOP)/src/wherecode.c \
184 $(TOP)/src/whereexpr.c \
185 $(TOP)/src/whereInt.h \
186 $(TOP)/src/window.c
188 # Source code for extensions
190 SRC += \
191 $(TOP)/ext/fts1/fts1.c \
192 $(TOP)/ext/fts1/fts1.h \
193 $(TOP)/ext/fts1/fts1_hash.c \
194 $(TOP)/ext/fts1/fts1_hash.h \
195 $(TOP)/ext/fts1/fts1_porter.c \
196 $(TOP)/ext/fts1/fts1_tokenizer.h \
197 $(TOP)/ext/fts1/fts1_tokenizer1.c
198 SRC += \
199 $(TOP)/ext/fts2/fts2.c \
200 $(TOP)/ext/fts2/fts2.h \
201 $(TOP)/ext/fts2/fts2_hash.c \
202 $(TOP)/ext/fts2/fts2_hash.h \
203 $(TOP)/ext/fts2/fts2_icu.c \
204 $(TOP)/ext/fts2/fts2_porter.c \
205 $(TOP)/ext/fts2/fts2_tokenizer.h \
206 $(TOP)/ext/fts2/fts2_tokenizer.c \
207 $(TOP)/ext/fts2/fts2_tokenizer1.c
208 SRC += \
209 $(TOP)/ext/fts3/fts3.c \
210 $(TOP)/ext/fts3/fts3.h \
211 $(TOP)/ext/fts3/fts3Int.h \
212 $(TOP)/ext/fts3/fts3_aux.c \
213 $(TOP)/ext/fts3/fts3_expr.c \
214 $(TOP)/ext/fts3/fts3_hash.c \
215 $(TOP)/ext/fts3/fts3_hash.h \
216 $(TOP)/ext/fts3/fts3_icu.c \
217 $(TOP)/ext/fts3/fts3_porter.c \
218 $(TOP)/ext/fts3/fts3_snippet.c \
219 $(TOP)/ext/fts3/fts3_tokenizer.h \
220 $(TOP)/ext/fts3/fts3_tokenizer.c \
221 $(TOP)/ext/fts3/fts3_tokenizer1.c \
222 $(TOP)/ext/fts3/fts3_tokenize_vtab.c \
223 $(TOP)/ext/fts3/fts3_unicode.c \
224 $(TOP)/ext/fts3/fts3_unicode2.c \
225 $(TOP)/ext/fts3/fts3_write.c
226 SRC += \
227 $(TOP)/ext/icu/sqliteicu.h \
228 $(TOP)/ext/icu/icu.c
229 SRC += \
230 $(TOP)/ext/rtree/sqlite3rtree.h \
231 $(TOP)/ext/rtree/rtree.h \
232 $(TOP)/ext/rtree/rtree.c
233 SRC += \
234 $(TOP)/ext/session/sqlite3session.c \
235 $(TOP)/ext/session/sqlite3session.h
236 SRC += \
237 $(TOP)/ext/userauth/userauth.c \
238 $(TOP)/ext/userauth/sqlite3userauth.h
239 SRC += \
240 $(TOP)/ext/rbu/sqlite3rbu.c \
241 $(TOP)/ext/rbu/sqlite3rbu.h
242 SRC += \
243 $(TOP)/ext/misc/json1.c \
244 $(TOP)/ext/misc/stmt.c
247 # FTS5 things
249 FTS5_HDR = \
250 $(TOP)/ext/fts5/fts5.h \
251 $(TOP)/ext/fts5/fts5Int.h \
252 fts5parse.h
254 FTS5_SRC = \
255 $(TOP)/ext/fts5/fts5_aux.c \
256 $(TOP)/ext/fts5/fts5_buffer.c \
257 $(TOP)/ext/fts5/fts5_main.c \
258 $(TOP)/ext/fts5/fts5_config.c \
259 $(TOP)/ext/fts5/fts5_expr.c \
260 $(TOP)/ext/fts5/fts5_hash.c \
261 $(TOP)/ext/fts5/fts5_index.c \
262 fts5parse.c \
263 $(TOP)/ext/fts5/fts5_storage.c \
264 $(TOP)/ext/fts5/fts5_tokenize.c \
265 $(TOP)/ext/fts5/fts5_unicode2.c \
266 $(TOP)/ext/fts5/fts5_varint.c \
267 $(TOP)/ext/fts5/fts5_vocab.c \
269 LSM1_SRC = \
270 $(TOP)/ext/lsm1/lsm.h \
271 $(TOP)/ext/lsm1/lsmInt.h \
272 $(TOP)/ext/lsm1/lsm_ckpt.c \
273 $(TOP)/ext/lsm1/lsm_file.c \
274 $(TOP)/ext/lsm1/lsm_log.c \
275 $(TOP)/ext/lsm1/lsm_main.c \
276 $(TOP)/ext/lsm1/lsm_mem.c \
277 $(TOP)/ext/lsm1/lsm_mutex.c \
278 $(TOP)/ext/lsm1/lsm_shared.c \
279 $(TOP)/ext/lsm1/lsm_sorted.c \
280 $(TOP)/ext/lsm1/lsm_str.c \
281 $(TOP)/ext/lsm1/lsm_tree.c \
282 $(TOP)/ext/lsm1/lsm_unix.c \
283 $(TOP)/ext/lsm1/lsm_varint.c \
284 $(TOP)/ext/lsm1/lsm_vtab.c \
285 $(TOP)/ext/lsm1/lsm_win32.c
288 # Generated source code files
290 SRC += \
291 keywordhash.h \
292 opcodes.c \
293 opcodes.h \
294 parse.c \
295 parse.h \
296 shell.c \
297 sqlite3.h
300 # Source code to the test files.
302 TESTSRC = \
303 $(TOP)/ext/expert/sqlite3expert.c \
304 $(TOP)/ext/expert/test_expert.c \
305 $(TOP)/ext/fts3/fts3_term.c \
306 $(TOP)/ext/fts3/fts3_test.c \
307 $(TOP)/ext/rbu/test_rbu.c \
308 $(TOP)/src/test1.c \
309 $(TOP)/src/test2.c \
310 $(TOP)/src/test3.c \
311 $(TOP)/src/test4.c \
312 $(TOP)/src/test5.c \
313 $(TOP)/src/test6.c \
314 $(TOP)/src/test7.c \
315 $(TOP)/src/test8.c \
316 $(TOP)/src/test9.c \
317 $(TOP)/src/test_autoext.c \
318 $(TOP)/src/test_async.c \
319 $(TOP)/src/test_backup.c \
320 $(TOP)/src/test_bestindex.c \
321 $(TOP)/src/test_blob.c \
322 $(TOP)/src/test_btree.c \
323 $(TOP)/src/test_config.c \
324 $(TOP)/src/test_delete.c \
325 $(TOP)/src/test_demovfs.c \
326 $(TOP)/src/test_devsym.c \
327 $(TOP)/src/test_fs.c \
328 $(TOP)/src/test_func.c \
329 $(TOP)/src/test_hexio.c \
330 $(TOP)/src/test_init.c \
331 $(TOP)/src/test_intarray.c \
332 $(TOP)/src/test_journal.c \
333 $(TOP)/src/test_malloc.c \
334 $(TOP)/src/test_md5.c \
335 $(TOP)/src/test_multiplex.c \
336 $(TOP)/src/test_mutex.c \
337 $(TOP)/src/test_onefile.c \
338 $(TOP)/src/test_osinst.c \
339 $(TOP)/src/test_pcache.c \
340 $(TOP)/src/test_quota.c \
341 $(TOP)/src/test_rtree.c \
342 $(TOP)/src/test_schema.c \
343 $(TOP)/src/test_server.c \
344 $(TOP)/src/test_sqllog.c \
345 $(TOP)/src/test_superlock.c \
346 $(TOP)/src/test_syscall.c \
347 $(TOP)/src/test_tclsh.c \
348 $(TOP)/src/test_tclvar.c \
349 $(TOP)/src/test_thread.c \
350 $(TOP)/src/test_vfs.c \
351 $(TOP)/src/test_windirent.c \
352 $(TOP)/src/test_window.c \
353 $(TOP)/src/test_wsd.c
355 # Extensions to be statically loaded.
357 TESTSRC += \
358 $(TOP)/ext/misc/amatch.c \
359 $(TOP)/ext/misc/carray.c \
360 $(TOP)/ext/misc/closure.c \
361 $(TOP)/ext/misc/csv.c \
362 $(TOP)/ext/misc/eval.c \
363 $(TOP)/ext/misc/fileio.c \
364 $(TOP)/ext/misc/fuzzer.c \
365 $(TOP)/ext/misc/ieee754.c \
366 $(TOP)/ext/misc/mmapwarm.c \
367 $(TOP)/ext/misc/nextchar.c \
368 $(TOP)/ext/misc/normalize.c \
369 $(TOP)/ext/misc/percentile.c \
370 $(TOP)/ext/misc/regexp.c \
371 $(TOP)/ext/misc/remember.c \
372 $(TOP)/ext/misc/series.c \
373 $(TOP)/ext/misc/spellfix.c \
374 $(TOP)/ext/misc/totype.c \
375 $(TOP)/ext/misc/unionvtab.c \
376 $(TOP)/ext/misc/wholenumber.c \
377 $(TOP)/ext/misc/vfslog.c \
378 $(TOP)/ext/misc/zipfile.c \
379 $(TOP)/ext/fts5/fts5_tcl.c \
380 $(TOP)/ext/fts5/fts5_test_mi.c \
381 $(TOP)/ext/fts5/fts5_test_tok.c
384 #TESTSRC += $(TOP)/ext/fts2/fts2_tokenizer.c
385 #TESTSRC += $(TOP)/ext/fts3/fts3_tokenizer.c
387 TESTSRC2 = \
388 $(TOP)/src/attach.c \
389 $(TOP)/src/backup.c \
390 $(TOP)/src/btree.c \
391 $(TOP)/src/build.c \
392 $(TOP)/src/date.c \
393 $(TOP)/src/dbpage.c \
394 $(TOP)/src/dbstat.c \
395 $(TOP)/src/expr.c \
396 $(TOP)/src/func.c \
397 $(TOP)/src/insert.c \
398 $(TOP)/src/wal.c \
399 $(TOP)/src/main.c \
400 $(TOP)/src/mem5.c \
401 $(TOP)/src/os.c \
402 $(TOP)/src/os_unix.c \
403 $(TOP)/src/os_win.c \
404 $(TOP)/src/pager.c \
405 $(TOP)/src/pragma.c \
406 $(TOP)/src/prepare.c \
407 $(TOP)/src/printf.c \
408 $(TOP)/src/random.c \
409 $(TOP)/src/pcache.c \
410 $(TOP)/src/pcache1.c \
411 $(TOP)/src/select.c \
412 $(TOP)/src/threads.c \
413 $(TOP)/src/tokenize.c \
414 $(TOP)/src/utf.c \
415 $(TOP)/src/util.c \
416 $(TOP)/src/vdbeapi.c \
417 $(TOP)/src/vdbeaux.c \
418 $(TOP)/src/vdbe.c \
419 $(TOP)/src/vdbemem.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
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/fts1/fts1.h \
466 $(TOP)/ext/fts1/fts1_hash.h \
467 $(TOP)/ext/fts1/fts1_tokenizer.h
468 EXTHDR += \
469 $(TOP)/ext/fts2/fts2.h \
470 $(TOP)/ext/fts2/fts2_hash.h \
471 $(TOP)/ext/fts2/fts2_tokenizer.h
472 EXTHDR += \
473 $(TOP)/ext/fts3/fts3.h \
474 $(TOP)/ext/fts3/fts3Int.h \
475 $(TOP)/ext/fts3/fts3_hash.h \
476 $(TOP)/ext/fts3/fts3_tokenizer.h
477 EXTHDR += \
478 $(TOP)/ext/rtree/rtree.h
479 EXTHDR += \
480 $(TOP)/ext/icu/sqliteicu.h
481 EXTHDR += \
482 $(TOP)/ext/fts5/fts5Int.h \
483 fts5parse.h \
484 $(TOP)/ext/fts5/fts5.h
485 EXTHDR += \
486 $(TOP)/ext/userauth/sqlite3userauth.h
488 # executables needed for testing
490 TESTPROGS = \
491 testfixture$(EXE) \
492 sqlite3$(EXE) \
493 sqlite3_analyzer$(EXE) \
494 sqlite3_checker$(EXE) \
495 sqldiff$(EXE) \
496 dbhash$(EXE) \
497 sqltclsh$(EXE)
499 # Databases containing fuzzer test cases
501 FUZZDATA = \
502 $(TOP)/test/fuzzdata1.db \
503 $(TOP)/test/fuzzdata2.db \
504 $(TOP)/test/fuzzdata3.db \
505 $(TOP)/test/fuzzdata4.db \
506 $(TOP)/test/fuzzdata5.db \
507 $(TOP)/test/fuzzdata6.db
509 # Standard options to testfixture
511 TESTOPTS = --verbose=file --output=test-out.txt
513 # Extra compiler options for various shell tools
515 SHELL_OPT += -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5
516 SHELL_OPT += -DSQLITE_ENABLE_RTREE
517 SHELL_OPT += -DSQLITE_ENABLE_EXPLAIN_COMMENTS
518 SHELL_OPT += -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
519 SHELL_OPT += -DSQLITE_ENABLE_STMTVTAB
520 SHELL_OPT += -DSQLITE_ENABLE_DBPAGE_VTAB
521 SHELL_OPT += -DSQLITE_ENABLE_DBSTAT_VTAB
522 SHELL_OPT += -DSQLITE_ENABLE_OFFSET_SQL_FUNC
523 SHELL_OPT += -DSQLITE_INTROSPECTION_PRAGMAS
524 FUZZERSHELL_OPT = -DSQLITE_ENABLE_JSON1
525 FUZZCHECK_OPT = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMSYS5
526 FUZZCHECK_OPT += -DSQLITE_MAX_MEMORY=50000000
527 FUZZCHECK_OPT += -DSQLITE_PRINTF_PRECISION_LIMIT=1000
528 DBFUZZ_OPT =
529 KV_OPT = -DSQLITE_THREADSAFE=0 -DSQLITE_DIRECT_OVERFLOW_READ
530 ST_OPT = -DSQLITE_THREADSAFE=0
532 # This is the default Makefile target. The objects listed here
533 # are what get build when you type just "make" with no arguments.
535 all: sqlite3.h libsqlite3.a sqlite3$(EXE)
537 libsqlite3.a: $(LIBOBJ)
538 $(AR) libsqlite3.a $(LIBOBJ)
539 $(RANLIB) libsqlite3.a
541 sqlite3$(EXE): shell.c libsqlite3.a sqlite3.h
542 $(TCCX) $(READLINE_FLAGS) -o sqlite3$(EXE) $(SHELL_OPT) \
543 shell.c libsqlite3.a $(LIBREADLINE) $(TLIBS) $(THREADLIB)
545 sqldiff$(EXE): $(TOP)/tool/sqldiff.c sqlite3.c sqlite3.h
546 $(TCCX) -o sqldiff$(EXE) -DSQLITE_THREADSAFE=0 \
547 $(TOP)/tool/sqldiff.c sqlite3.c $(TLIBS) $(THREADLIB)
549 dbhash$(EXE): $(TOP)/tool/dbhash.c sqlite3.c sqlite3.h
550 $(TCCX) -o dbhash$(EXE) -DSQLITE_THREADSAFE=0 \
551 $(TOP)/tool/dbhash.c sqlite3.c $(TLIBS) $(THREADLIB)
553 scrub$(EXE): $(TOP)/ext/misc/scrub.c sqlite3.o
554 $(TCC) -I. -DSCRUB_STANDALONE -o scrub$(EXE) $(TOP)/ext/misc/scrub.c sqlite3.o $(THREADLIB)
556 srcck1$(EXE): $(TOP)/tool/srcck1.c
557 $(BCC) -o srcck1$(EXE) $(TOP)/tool/srcck1.c
559 sourcetest: srcck1$(EXE) sqlite3.c
560 ./srcck1 sqlite3.c
562 fuzzershell$(EXE): $(TOP)/tool/fuzzershell.c sqlite3.c sqlite3.h
563 $(TCCX) -o fuzzershell$(EXE) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
564 $(FUZZERSHELL_OPT) $(TOP)/tool/fuzzershell.c sqlite3.c \
565 $(TLIBS) $(THREADLIB)
567 dbfuzz$(EXE): $(TOP)/test/dbfuzz.c sqlite3.c sqlite3.h
568 $(TCCX) -o dbfuzz$(EXE) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
569 $(DBFUZZ_OPT) $(TOP)/test/dbfuzz.c sqlite3.c \
570 $(TLIBS) $(THREADLIB)
572 fuzzcheck$(EXE): $(TOP)/test/fuzzcheck.c sqlite3.c sqlite3.h $(TOP)/test/ossfuzz.c
573 $(TCCX) -o fuzzcheck$(EXE) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
574 -DSQLITE_ENABLE_MEMSYS5 $(FUZZCHECK_OPT) -DSQLITE_OSS_FUZZ \
575 $(TOP)/test/fuzzcheck.c $(TOP)/test/ossfuzz.c sqlite3.c $(TLIBS) $(THREADLIB)
577 ossshell$(EXE): $(TOP)/test/ossfuzz.c $(TOP)/test/ossshell.c sqlite3.c sqlite3.h
578 $(TCCX) -o ossshell$(EXE) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
579 -DSQLITE_ENABLE_MEMSYS5 $(FUZZCHECK_OPT) \
580 $(TOP)/test/ossfuzz.c $(TOP)/test/ossshell.c sqlite3.c $(TLIBS) $(THREADLIB)
582 sessionfuzz$(EXE): $(TOP)/test/sessionfuzz.c sqlite3.c sqlite3.h
583 $(TCC) -o sessionfuzz$(EXE) $(TOP)/test/sessionfuzz.c -lz $(TLIBS) $(THREADLIB)
585 mptester$(EXE): sqlite3.c $(TOP)/mptest/mptest.c
586 $(TCCX) -o $@ -I. $(TOP)/mptest/mptest.c sqlite3.c \
587 $(TLIBS) $(THREADLIB)
589 MPTEST1=./mptester$(EXE) mptest1.db $(TOP)/mptest/crash01.test --repeat 20
590 MPTEST2=./mptester$(EXE) mptest2.db $(TOP)/mptest/multiwrite01.test --repeat 20
591 mptest: mptester$(EXE)
592 $(MPTEST1) --journalmode DELETE
593 $(MPTEST2) --journalmode WAL
594 $(MPTEST1) --journalmode WAL
595 $(MPTEST2) --journalmode PERSIST
596 $(MPTEST1) --journalmode PERSIST
597 $(MPTEST2) --journalmode TRUNCATE
598 $(MPTEST1) --journalmode TRUNCATE
599 $(MPTEST2) --journalmode DELETE
601 sqlite3.o: sqlite3.c
602 $(TCCX) -I. -c sqlite3.c
604 # This target creates a directory named "tsrc" and fills it with
605 # copies of all of the C source code and header files needed to
606 # build on the target system. Some of the C source code and header
607 # files are automatically generated. This target takes care of
608 # all that automatic generation.
610 target_source: $(SRC) $(TOP)/tool/vdbe-compress.tcl fts5.c
611 rm -rf tsrc
612 mkdir tsrc
613 cp -f $(SRC) tsrc
614 rm tsrc/sqlite.h.in tsrc/parse.y
615 tclsh $(TOP)/tool/vdbe-compress.tcl $(OPTS) <tsrc/vdbe.c >vdbe.new
616 mv vdbe.new tsrc/vdbe.c
617 cp fts5.c fts5.h tsrc
618 touch target_source
620 sqlite3.c: target_source $(TOP)/tool/mksqlite3c.tcl
621 tclsh $(TOP)/tool/mksqlite3c.tcl
622 cp tsrc/sqlite3ext.h .
623 cp $(TOP)/ext/session/sqlite3session.h .
624 echo '#ifndef USE_SYSTEM_SQLITE' >tclsqlite3.c
625 cat sqlite3.c >>tclsqlite3.c
626 echo '#endif /* USE_SYSTEM_SQLITE */' >>tclsqlite3.c
627 cat $(TOP)/src/tclsqlite.c >>tclsqlite3.c
629 sqlite3ext.h: target_source
630 cp tsrc/sqlite3ext.h .
632 sqlite3.c-debug: target_source $(TOP)/tool/mksqlite3c.tcl
633 tclsh $(TOP)/tool/mksqlite3c.tcl --linemacros
634 echo '#ifndef USE_SYSTEM_SQLITE' >tclsqlite3.c
635 cat sqlite3.c >>tclsqlite3.c
636 echo '#endif /* USE_SYSTEM_SQLITE */' >>tclsqlite3.c
637 echo '#line 1 "tclsqlite.c"' >>tclsqlite3.c
638 cat $(TOP)/src/tclsqlite.c >>tclsqlite3.c
640 sqlite3-all.c: sqlite3.c $(TOP)/tool/split-sqlite3c.tcl
641 tclsh $(TOP)/tool/split-sqlite3c.tcl
643 fts2amal.c: target_source $(TOP)/ext/fts2/mkfts2amal.tcl
644 tclsh $(TOP)/ext/fts2/mkfts2amal.tcl
646 fts3amal.c: target_source $(TOP)/ext/fts3/mkfts3amal.tcl
647 tclsh $(TOP)/ext/fts3/mkfts3amal.tcl
649 # Rules to build the LEMON compiler generator
651 lemon: $(TOP)/tool/lemon.c $(TOP)/tool/lempar.c
652 $(BCC) -o lemon $(TOP)/tool/lemon.c
653 cp $(TOP)/tool/lempar.c .
655 # A tool to generate the source-id
657 mksourceid: $(TOP)/tool/mksourceid.c
658 $(BCC) -o mksourceid $(TOP)/tool/mksourceid.c
660 # Rules to build individual *.o files from generated *.c files. This
661 # applies to:
663 # parse.o
664 # opcodes.o
666 %.o: %.c $(HDR)
667 $(TCCX) -c $<
669 # Rules to build individual *.o files from files in the src directory.
671 %.o: $(TOP)/src/%.c $(HDR)
672 $(TCCX) -c $<
674 tclsqlite.o: $(TOP)/src/tclsqlite.c $(HDR)
675 $(TCCX) $(TCL_FLAGS) -c $(TOP)/src/tclsqlite.c
679 # Rules to build opcodes.c and opcodes.h
681 opcodes.c: opcodes.h $(TOP)/tool/mkopcodec.tcl
682 tclsh $(TOP)/tool/mkopcodec.tcl opcodes.h >opcodes.c
684 opcodes.h: parse.h $(TOP)/src/vdbe.c $(TOP)/tool/mkopcodeh.tcl
685 cat parse.h $(TOP)/src/vdbe.c | \
686 tclsh $(TOP)/tool/mkopcodeh.tcl >opcodes.h
688 # Rules to build parse.c and parse.h - the outputs of lemon.
690 parse.h: parse.c
692 parse.c: $(TOP)/src/parse.y lemon $(TOP)/tool/addopcodes.tcl
693 cp $(TOP)/src/parse.y .
694 rm -f parse.h
695 ./lemon -s $(OPTS) parse.y
696 mv parse.h parse.h.temp
697 tclsh $(TOP)/tool/addopcodes.tcl parse.h.temp >parse.h
699 sqlite3.h: $(TOP)/src/sqlite.h.in $(TOP)/manifest mksourceid $(TOP)/VERSION $(TOP)/ext/rtree/sqlite3rtree.h
700 tclsh $(TOP)/tool/mksqlite3h.tcl $(TOP) >sqlite3.h
702 keywordhash.h: $(TOP)/tool/mkkeywordhash.c
703 $(BCC) -o mkkeywordhash $(OPTS) $(TOP)/tool/mkkeywordhash.c
704 ./mkkeywordhash >keywordhash.h
706 # Source files that go into making shell.c
707 SHELL_SRC = \
708 $(TOP)/src/shell.c.in \
709 $(TOP)/ext/misc/appendvfs.c \
710 $(TOP)/ext/misc/shathree.c \
711 $(TOP)/ext/misc/fileio.c \
712 $(TOP)/ext/misc/completion.c \
713 $(TOP)/ext/misc/sqlar.c \
714 $(TOP)/ext/expert/sqlite3expert.c \
715 $(TOP)/ext/expert/sqlite3expert.h \
716 $(TOP)/ext/misc/zipfile.c \
717 $(TOP)/src/test_windirent.c
719 shell.c: $(SHELL_SRC) $(TOP)/tool/mkshellc.tcl
720 tclsh $(TOP)/tool/mkshellc.tcl >shell.c
724 # Rules to build the extension objects.
726 icu.o: $(TOP)/ext/icu/icu.c $(HDR) $(EXTHDR)
727 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/icu/icu.c
729 fts2.o: $(TOP)/ext/fts2/fts2.c $(HDR) $(EXTHDR)
730 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2.c
732 fts2_hash.o: $(TOP)/ext/fts2/fts2_hash.c $(HDR) $(EXTHDR)
733 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_hash.c
735 fts2_icu.o: $(TOP)/ext/fts2/fts2_icu.c $(HDR) $(EXTHDR)
736 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_icu.c
738 fts2_porter.o: $(TOP)/ext/fts2/fts2_porter.c $(HDR) $(EXTHDR)
739 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_porter.c
741 fts2_tokenizer.o: $(TOP)/ext/fts2/fts2_tokenizer.c $(HDR) $(EXTHDR)
742 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_tokenizer.c
744 fts2_tokenizer1.o: $(TOP)/ext/fts2/fts2_tokenizer1.c $(HDR) $(EXTHDR)
745 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_tokenizer1.c
747 fts3.o: $(TOP)/ext/fts3/fts3.c $(HDR) $(EXTHDR)
748 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3.c
750 fts3_aux.o: $(TOP)/ext/fts3/fts3_aux.c $(HDR) $(EXTHDR)
751 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_aux.c
753 fts3_expr.o: $(TOP)/ext/fts3/fts3_expr.c $(HDR) $(EXTHDR)
754 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_expr.c
756 fts3_hash.o: $(TOP)/ext/fts3/fts3_hash.c $(HDR) $(EXTHDR)
757 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_hash.c
759 fts3_icu.o: $(TOP)/ext/fts3/fts3_icu.c $(HDR) $(EXTHDR)
760 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_icu.c
762 fts3_snippet.o: $(TOP)/ext/fts3/fts3_snippet.c $(HDR) $(EXTHDR)
763 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_snippet.c
765 fts3_porter.o: $(TOP)/ext/fts3/fts3_porter.c $(HDR) $(EXTHDR)
766 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_porter.c
768 fts3_tokenizer.o: $(TOP)/ext/fts3/fts3_tokenizer.c $(HDR) $(EXTHDR)
769 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer.c
771 fts3_tokenizer1.o: $(TOP)/ext/fts3/fts3_tokenizer1.c $(HDR) $(EXTHDR)
772 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer1.c
774 fts3_tokenize_vtab.o: $(TOP)/ext/fts3/fts3_tokenize_vtab.c $(HDR) $(EXTHDR)
775 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenize_vtab.c
777 fts3_unicode.o: $(TOP)/ext/fts3/fts3_unicode.c $(HDR) $(EXTHDR)
778 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_unicode.c
780 fts3_unicode2.o: $(TOP)/ext/fts3/fts3_unicode2.c $(HDR) $(EXTHDR)
781 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_unicode2.c
783 fts3_write.o: $(TOP)/ext/fts3/fts3_write.c $(HDR) $(EXTHDR)
784 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_write.c
786 fts5.o: fts5.c
787 $(TCCX) -DSQLITE_CORE -c fts5.c
789 json1.o: $(TOP)/ext/misc/json1.c
790 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/misc/json1.c
792 stmt.o: $(TOP)/ext/misc/stmt.c
793 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/misc/stmt.c
795 rtree.o: $(TOP)/ext/rtree/rtree.c $(HDR) $(EXTHDR)
796 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/rtree/rtree.c
800 fts5parse.c: $(TOP)/ext/fts5/fts5parse.y lemon
801 cp $(TOP)/ext/fts5/fts5parse.y .
802 rm -f fts5parse.h
803 ./lemon $(OPTS) fts5parse.y
805 fts5parse.h: fts5parse.c
807 fts5.c: $(FTS5_SRC) $(FTS5_HDR)
808 tclsh $(TOP)/ext/fts5/tool/mkfts5c.tcl
809 cp $(TOP)/ext/fts5/fts5.h .
811 lsm1.c: $(LSM1_SRC)
812 tclsh $(TOP)/ext/lsm1/tool/mklsm1c.tcl
813 cp $(TOP)/ext/lsm1/lsm.h .
815 userauth.o: $(TOP)/ext/userauth/userauth.c $(HDR) $(EXTHDR)
816 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/userauth/userauth.c
818 sqlite3session.o: $(TOP)/ext/session/sqlite3session.c $(HDR) $(EXTHDR)
819 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/session/sqlite3session.c
821 sqlite3rbu.o: $(TOP)/ext/rbu/sqlite3rbu.c $(HDR) $(EXTHDR)
822 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/rbu/sqlite3rbu.c
824 # Rules for building test programs and for running tests
826 tclsqlite3: $(TOP)/src/tclsqlite.c libsqlite3.a
827 $(TCCX) $(TCL_FLAGS) -DTCLSH -o tclsqlite3 \
828 $(TOP)/src/tclsqlite.c libsqlite3.a $(LIBTCL) $(THREADLIB)
830 sqlite3_analyzer.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl $(TOP)/tool/sqlite3_analyzer.c.in $(TOP)/tool/mkccode.tcl
831 tclsh $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqlite3_analyzer.c.in >sqlite3_analyzer.c
833 sqlite3_analyzer$(EXE): sqlite3_analyzer.c
834 $(TCCX) $(TCL_FLAGS) sqlite3_analyzer.c -o $@ $(LIBTCL) $(THREADLIB)
836 sqltclsh.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/sqltclsh.tcl $(TOP)/ext/misc/appendvfs.c $(TOP)/tool/mkccode.tcl
837 tclsh $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqltclsh.c.in >sqltclsh.c
839 sqltclsh$(EXE): sqltclsh.c
840 $(TCCX) $(TCL_FLAGS) sqltclsh.c -o $@ $(LIBTCL) $(THREADLIB)
842 sqlite3_expert$(EXE): $(TOP)/ext/expert/sqlite3expert.h $(TOP)/ext/expert/sqlite3expert.c $(TOP)/ext/expert/expert.c sqlite3.c
843 $(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)
845 CHECKER_DEPS =\
846 $(TOP)/tool/mkccode.tcl \
847 sqlite3.c \
848 $(TOP)/src/tclsqlite.c \
849 $(TOP)/ext/repair/sqlite3_checker.tcl \
850 $(TOP)/ext/repair/checkindex.c \
851 $(TOP)/ext/repair/checkfreelist.c \
852 $(TOP)/ext/misc/btreeinfo.c \
853 $(TOP)/ext/repair/sqlite3_checker.c.in
855 sqlite3_checker.c: $(CHECKER_DEPS)
856 tclsh $(TOP)/tool/mkccode.tcl $(TOP)/ext/repair/sqlite3_checker.c.in >$@
858 sqlite3_checker$(TEXE): sqlite3_checker.c
859 $(TCCX) $(TCL_FLAGS) sqlite3_checker.c -o $@ $(LIBTCL) $(THREADLIB)
861 dbdump$(EXE): $(TOP)/ext/misc/dbdump.c sqlite3.o
862 $(TCCX) -DDBDUMP_STANDALONE -o dbdump$(EXE) \
863 $(TOP)/ext/misc/dbdump.c sqlite3.o $(THREADLIB)
865 # Rules to build the 'testfixture' application.
867 TESTFIXTURE_FLAGS = -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
868 TESTFIXTURE_FLAGS += -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE
869 TESTFIXTURE_FLAGS += -DSQLITE_SERIES_CONSTRAINT_VERIFY=1
870 TESTFIXTURE_FLAGS += -DSQLITE_DEFAULT_PAGE_SIZE=1024
871 TESTFIXTURE_FLAGS += -DSQLITE_ENABLE_STMTVTAB
872 TESTFIXTURE_FLAGS += -DSQLITE_ENABLE_DBPAGE_VTAB
873 TESTFIXTURE_FLAGS += -DTCLSH_INIT_PROC=sqlite3TestInit
875 testfixture$(EXE): $(TESTSRC2) libsqlite3.a $(TESTSRC) $(TOP)/src/tclsqlite.c
876 $(TCCX) $(TCL_FLAGS) $(TESTFIXTURE_FLAGS) \
877 $(TESTSRC) $(TESTSRC2) $(TOP)/src/tclsqlite.c \
878 -o testfixture$(EXE) $(LIBTCL) libsqlite3.a $(THREADLIB)
880 amalgamation-testfixture$(EXE): sqlite3.c $(TESTSRC) $(TOP)/src/tclsqlite.c \
881 $(TOP)/ext/session/test_session.c
882 $(TCCX) $(TCL_FLAGS) $(TESTFIXTURE_FLAGS) \
883 $(TESTSRC) $(TOP)/src/tclsqlite.c sqlite3.c \
884 $(TOP)/ext/session/test_session.c \
885 -o testfixture$(EXE) $(LIBTCL) $(THREADLIB)
887 fts3-testfixture$(EXE): sqlite3.c fts3amal.c $(TESTSRC) $(TOP)/src/tclsqlite.c
888 $(TCCX) $(TCL_FLAGS) $(TESTFIXTURE_FLAGS) \
889 -DSQLITE_ENABLE_FTS3=1 \
890 $(TESTSRC) $(TOP)/src/tclsqlite.c sqlite3.c fts3amal.c \
891 -o testfixture$(EXE) $(LIBTCL) $(THREADLIB)
893 fulltest: $(TESTPROGS) fuzztest
894 ./testfixture$(EXE) $(TOP)/test/all.test $(TESTOPTS)
896 soaktest: $(TESTPROGS)
897 ./testfixture$(EXE) $(TOP)/test/all.test -soak=1 $(TESTOPTS)
899 fulltestonly: $(TESTPROGS) fuzztest
900 ./testfixture$(EXE) $(TOP)/test/full.test $(TESTOPTS)
902 queryplantest: testfixture$(EXE) sqlite3$(EXE)
903 ./testfixture$(EXE) $(TOP)/test/permutations.test queryplanner $(TESTOPTS)
905 fuzztest: fuzzcheck$(EXE) $(FUZZDATA) sessionfuzz$(EXE) $(TOP)/test/sessionfuzz-data1.db
906 ./fuzzcheck$(EXE) $(FUZZDATA)
907 ./sessionfuzz run $(TOP)/test/sessionfuzz-data1.db
909 fastfuzztest: fuzzcheck$(EXE) $(FUZZDATA) sessionfuzz$(EXE) $(TOP)/test/sessionfuzz-data1.db
910 ./fuzzcheck$(EXE) --limit-mem 100M $(FUZZDATA)
911 ./sessionfuzz run $(TOP)/test/sessionfuzz-data1.db
913 valgrindfuzz: fuzzcheck$(EXE) $(FUZZDATA) sessionfuzz$(EXE) $(TOP)/test/sessionfuzz-data1.db
914 valgrind ./fuzzcheck$(EXE) --cell-size-check --limit-mem 10M --timeout 600 $(FUZZDATA)
915 valgrind ./sessionfuzz run $(TOP)/test/sessionfuzz-data1.db
917 # The veryquick.test TCL tests.
919 tcltest: ./testfixture$(EXE)
920 ./testfixture$(EXE) $(TOP)/test/veryquick.test $(TESTOPTS)
922 # A very quick test using only testfixture and omitting all the slower
923 # tests. Designed to run in under 3 minutes on a workstation.
925 quicktest: ./testfixture$(EXE)
926 ./testfixture$(EXE) $(TOP)/test/extraquick.test $(TESTOPTS)
928 # The default test case. Runs most of the faster standard TCL tests,
929 # and fuzz tests, and sqlite3_analyzer and sqldiff tests.
930 test: fastfuzztest sourcetest $(TESTPROGS) tcltest
932 # Run a test using valgrind. This can take a really long time
933 # because valgrind is so much slower than a native machine.
935 valgrindtest: $(TESTPROGS) valgrindfuzz
936 OMIT_MISUSE=1 valgrind -v \
937 ./testfixture$(EXE) $(TOP)/test/permutations.test valgrind $(TESTOPTS)
939 # A very fast test that checks basic sanity. The name comes from
940 # the 60s-era electronics testing: "Turn it on and see if smoke
941 # comes out."
943 smoketest: $(TESTPROGS) fuzzcheck$(EXE)
944 ./testfixture$(EXE) $(TOP)/test/main.test $(TESTOPTS)
946 # The next two rules are used to support the "threadtest" target. Building
947 # threadtest runs a few thread-safety tests that are implemented in C. This
948 # target is invoked by the releasetest.tcl script.
950 THREADTEST3_SRC = $(TOP)/test/threadtest3.c \
951 $(TOP)/test/tt3_checkpoint.c \
952 $(TOP)/test/tt3_index.c \
953 $(TOP)/test/tt3_vacuum.c \
954 $(TOP)/test/tt3_stress.c \
955 $(TOP)/test/tt3_lookaside1.c
957 threadtest3$(EXE): sqlite3.o $(THREADTEST3_SRC) $(TOP)/src/test_multiplex.c
958 $(TCCX) $(TOP)/test/threadtest3.c $(TOP)/src/test_multiplex.c sqlite3.o -o $@ $(THREADLIB)
960 threadtest: threadtest3$(EXE)
961 ./threadtest3$(EXE)
963 TEST_EXTENSION = $(SHPREFIX)testloadext.$(SO)
964 $(TEST_EXTENSION): $(TOP)/src/test_loadext.c
965 $(MKSHLIB) $(TOP)/src/test_loadext.c -o $(TEST_EXTENSION)
967 extensiontest: testfixture$(EXE) $(TEST_EXTENSION)
968 ./testfixture$(EXE) $(TOP)/test/loadext.test
970 showdb$(EXE): $(TOP)/tool/showdb.c sqlite3.o
971 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o showdb$(EXE) \
972 $(TOP)/tool/showdb.c sqlite3.o $(THREADLIB)
974 showstat4$(EXE): $(TOP)/tool/showstat4.c sqlite3.o
975 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o showstat4$(EXE) \
976 $(TOP)/tool/showstat4.c sqlite3.o $(THREADLIB)
978 showjournal$(EXE): $(TOP)/tool/showjournal.c sqlite3.o
979 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o showjournal$(EXE) \
980 $(TOP)/tool/showjournal.c sqlite3.o $(THREADLIB)
982 showwal$(EXE): $(TOP)/tool/showwal.c sqlite3.o
983 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o showwal$(EXE) \
984 $(TOP)/tool/showwal.c sqlite3.o $(THREADLIB)
986 showshm$(EXE): $(TOP)/tool/showshm.c
987 $(TCC) -o showshm$(EXE) $(TOP)/tool/showshm.c
989 changeset$(EXE): $(TOP)/ext/session/changeset.c sqlite3.o
990 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o changeset$(EXE) \
991 $(TOP)/ext/session/changeset.c sqlite3.o $(THREADLIB)
993 fts3view$(EXE): $(TOP)/ext/fts3/tool/fts3view.c sqlite3.o
994 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o fts3view$(EXE) \
995 $(TOP)/ext/fts3/tool/fts3view.c sqlite3.o $(THREADLIB)
997 rollback-test$(EXE): $(TOP)/tool/rollback-test.c sqlite3.o
998 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o rollback-test$(EXE) \
999 $(TOP)/tool/rollback-test.c sqlite3.o $(THREADLIB)
1001 LogEst$(EXE): $(TOP)/tool/logest.c sqlite3.h
1002 $(TCC) -o LogEst$(EXE) $(TOP)/tool/logest.c
1004 wordcount$(EXE): $(TOP)/test/wordcount.c sqlite3.c
1005 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o wordcount$(EXE) \
1006 $(TOP)/test/wordcount.c sqlite3.c
1008 speedtest1$(EXE): $(TOP)/test/speedtest1.c sqlite3.c
1009 $(TCCX) -I. $(ST_OPT) -o speedtest1$(EXE) $(TOP)/test/speedtest1.c sqlite3.c $(THREADLIB)
1011 kvtest$(EXE): $(TOP)/test/kvtest.c sqlite3.c
1012 $(TCCX) -I. $(KV_OPT) -o kvtest$(EXE) $(TOP)/test/kvtest.c sqlite3.c $(THREADLIB)
1014 rbu$(EXE): $(TOP)/ext/rbu/rbu.c $(TOP)/ext/rbu/sqlite3rbu.c sqlite3.o
1015 $(TCC) -I. -o rbu$(EXE) $(TOP)/ext/rbu/rbu.c sqlite3.o \
1016 $(THREADLIB)
1018 loadfts: $(TOP)/tool/loadfts.c libsqlite3.a
1019 $(TCC) $(TOP)/tool/loadfts.c libsqlite3.a -o loadfts $(THREADLIB)
1021 # This target will fail if the SQLite amalgamation contains any exported
1022 # symbols that do not begin with "sqlite3_". It is run as part of the
1023 # releasetest.tcl script.
1025 checksymbols: sqlite3.o
1026 nm -g --defined-only sqlite3.o | grep -v " sqlite3_" ; test $$? -ne 0
1028 # Build the amalgamation-autoconf package. The amalamgation-tarball target builds
1029 # a tarball named for the version number. Ex: sqlite-autoconf-3110000.tar.gz.
1030 # The snapshot-tarball target builds a tarball named by the SHA1 hash
1032 amalgamation-tarball: sqlite3.c
1033 TOP=$(TOP) sh $(TOP)/tool/mkautoconfamal.sh --normal
1035 snapshot-tarball: sqlite3.c
1036 TOP=$(TOP) sh $(TOP)/tool/mkautoconfamal.sh --snapshot
1039 # Standard install and cleanup targets
1041 install: sqlite3 libsqlite3.a sqlite3.h
1042 mv sqlite3 /usr/bin
1043 mv libsqlite3.a /usr/lib
1044 mv sqlite3.h /usr/include
1046 clean:
1047 rm -f *.o sqlite3 sqlite3.exe libsqlite3.a sqlite3.h opcodes.*
1048 rm -f lemon lemon.exe lempar.c parse.* sqlite*.tar.gz
1049 rm -f mkkeywordhash mkkeywordhash.exe keywordhash.h
1050 rm -f $(PUBLISH)
1051 rm -f *.da *.bb *.bbg gmon.out
1052 rm -rf tsrc target_source
1053 rm -f testloadext.dll libtestloadext.so
1054 rm -f amalgamation-testfixture amalgamation-testfixture.exe
1055 rm -f fts3-testfixture fts3-testfixture.exe
1056 rm -f testfixture testfixture.exe
1057 rm -f threadtest3 threadtest3.exe
1058 rm -f LogEst LogEst.exe
1059 rm -f fts3view fts3view.exe
1060 rm -f rollback-test rollback-test.exe
1061 rm -f showdb showdb.exe
1062 rm -f showjournal showjournal.exe
1063 rm -f showstat4 showstat4.exe
1064 rm -f showwal showwal.exe
1065 rm -f changeset changeset.exe
1066 rm -f speedtest1 speedtest1.exe
1067 rm -f wordcount wordcount.exe
1068 rm -f rbu rbu.exe
1069 rm -f srcck1 srcck1.exe
1070 rm -f sqlite3.c sqlite3-*.c fts?amal.c tclsqlite3.c
1071 rm -f sqlite3rc.h
1072 rm -f shell.c sqlite3ext.h
1073 rm -f sqlite3_analyzer sqlite3_analyzer.exe sqlite3_analyzer.c
1074 rm -f sqlite3_expert sqlite3_expert.exe
1075 rm -f sqlite-*-output.vsix
1076 rm -f mptester mptester.exe
1077 rm -f fuzzershell fuzzershell.exe
1078 rm -f fuzzcheck fuzzcheck.exe
1079 rm -f sessionfuzz
1080 rm -f sqldiff sqldiff.exe
1081 rm -f fts5.* fts5parse.*
1082 rm -f lsm.h lsm1.c