Remove a trailing tab from the Makefile for MSVC.
[sqlite.git] / main.mk
bloba16aad386093dfbde76c7f2f16cb32d49d086e03
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 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 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
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/memjournal.c \
122 $(TOP)/src/msvc.h \
123 $(TOP)/src/mutex.c \
124 $(TOP)/src/mutex.h \
125 $(TOP)/src/mutex_noop.c \
126 $(TOP)/src/mutex_unix.c \
127 $(TOP)/src/mutex_w32.c \
128 $(TOP)/src/notify.c \
129 $(TOP)/src/os.c \
130 $(TOP)/src/os.h \
131 $(TOP)/src/os_common.h \
132 $(TOP)/src/os_setup.h \
133 $(TOP)/src/os_unix.c \
134 $(TOP)/src/os_win.c \
135 $(TOP)/src/os_win.h \
136 $(TOP)/src/pager.c \
137 $(TOP)/src/pager.h \
138 $(TOP)/src/parse.y \
139 $(TOP)/src/pcache.c \
140 $(TOP)/src/pcache.h \
141 $(TOP)/src/pcache1.c \
142 $(TOP)/src/pragma.c \
143 $(TOP)/src/pragma.h \
144 $(TOP)/src/prepare.c \
145 $(TOP)/src/printf.c \
146 $(TOP)/src/random.c \
147 $(TOP)/src/resolve.c \
148 $(TOP)/src/rowset.c \
149 $(TOP)/src/select.c \
150 $(TOP)/src/status.c \
151 $(TOP)/src/shell.c.in \
152 $(TOP)/src/sqlite.h.in \
153 $(TOP)/src/sqlite3ext.h \
154 $(TOP)/src/sqliteInt.h \
155 $(TOP)/src/sqliteLimit.h \
156 $(TOP)/src/table.c \
157 $(TOP)/src/tclsqlite.c \
158 $(TOP)/src/threads.c \
159 $(TOP)/src/tokenize.c \
160 $(TOP)/src/treeview.c \
161 $(TOP)/src/trigger.c \
162 $(TOP)/src/utf.c \
163 $(TOP)/src/update.c \
164 $(TOP)/src/util.c \
165 $(TOP)/src/vacuum.c \
166 $(TOP)/src/vdbe.c \
167 $(TOP)/src/vdbe.h \
168 $(TOP)/src/vdbeapi.c \
169 $(TOP)/src/vdbeaux.c \
170 $(TOP)/src/vdbeblob.c \
171 $(TOP)/src/vdbemem.c \
172 $(TOP)/src/vdbesort.c \
173 $(TOP)/src/vdbetrace.c \
174 $(TOP)/src/vdbeInt.h \
175 $(TOP)/src/vtab.c \
176 $(TOP)/src/vxworks.h \
177 $(TOP)/src/wal.c \
178 $(TOP)/src/wal.h \
179 $(TOP)/src/walker.c \
180 $(TOP)/src/where.c \
181 $(TOP)/src/wherecode.c \
182 $(TOP)/src/whereexpr.c \
183 $(TOP)/src/whereInt.h
185 # Source code for extensions
187 SRC += \
188 $(TOP)/ext/fts1/fts1.c \
189 $(TOP)/ext/fts1/fts1.h \
190 $(TOP)/ext/fts1/fts1_hash.c \
191 $(TOP)/ext/fts1/fts1_hash.h \
192 $(TOP)/ext/fts1/fts1_porter.c \
193 $(TOP)/ext/fts1/fts1_tokenizer.h \
194 $(TOP)/ext/fts1/fts1_tokenizer1.c
195 SRC += \
196 $(TOP)/ext/fts2/fts2.c \
197 $(TOP)/ext/fts2/fts2.h \
198 $(TOP)/ext/fts2/fts2_hash.c \
199 $(TOP)/ext/fts2/fts2_hash.h \
200 $(TOP)/ext/fts2/fts2_icu.c \
201 $(TOP)/ext/fts2/fts2_porter.c \
202 $(TOP)/ext/fts2/fts2_tokenizer.h \
203 $(TOP)/ext/fts2/fts2_tokenizer.c \
204 $(TOP)/ext/fts2/fts2_tokenizer1.c
205 SRC += \
206 $(TOP)/ext/fts3/fts3.c \
207 $(TOP)/ext/fts3/fts3.h \
208 $(TOP)/ext/fts3/fts3Int.h \
209 $(TOP)/ext/fts3/fts3_aux.c \
210 $(TOP)/ext/fts3/fts3_expr.c \
211 $(TOP)/ext/fts3/fts3_hash.c \
212 $(TOP)/ext/fts3/fts3_hash.h \
213 $(TOP)/ext/fts3/fts3_icu.c \
214 $(TOP)/ext/fts3/fts3_porter.c \
215 $(TOP)/ext/fts3/fts3_snippet.c \
216 $(TOP)/ext/fts3/fts3_tokenizer.h \
217 $(TOP)/ext/fts3/fts3_tokenizer.c \
218 $(TOP)/ext/fts3/fts3_tokenizer1.c \
219 $(TOP)/ext/fts3/fts3_tokenize_vtab.c \
220 $(TOP)/ext/fts3/fts3_unicode.c \
221 $(TOP)/ext/fts3/fts3_unicode2.c \
222 $(TOP)/ext/fts3/fts3_write.c
223 SRC += \
224 $(TOP)/ext/icu/sqliteicu.h \
225 $(TOP)/ext/icu/icu.c
226 SRC += \
227 $(TOP)/ext/rtree/sqlite3rtree.h \
228 $(TOP)/ext/rtree/rtree.h \
229 $(TOP)/ext/rtree/rtree.c
230 SRC += \
231 $(TOP)/ext/session/sqlite3session.c \
232 $(TOP)/ext/session/sqlite3session.h
233 SRC += \
234 $(TOP)/ext/userauth/userauth.c \
235 $(TOP)/ext/userauth/sqlite3userauth.h
236 SRC += \
237 $(TOP)/ext/rbu/sqlite3rbu.c \
238 $(TOP)/ext/rbu/sqlite3rbu.h
239 SRC += \
240 $(TOP)/ext/misc/json1.c \
241 $(TOP)/ext/misc/stmt.c
244 # FTS5 things
246 FTS5_HDR = \
247 $(TOP)/ext/fts5/fts5.h \
248 $(TOP)/ext/fts5/fts5Int.h \
249 fts5parse.h
251 FTS5_SRC = \
252 $(TOP)/ext/fts5/fts5_aux.c \
253 $(TOP)/ext/fts5/fts5_buffer.c \
254 $(TOP)/ext/fts5/fts5_main.c \
255 $(TOP)/ext/fts5/fts5_config.c \
256 $(TOP)/ext/fts5/fts5_expr.c \
257 $(TOP)/ext/fts5/fts5_hash.c \
258 $(TOP)/ext/fts5/fts5_index.c \
259 fts5parse.c \
260 $(TOP)/ext/fts5/fts5_storage.c \
261 $(TOP)/ext/fts5/fts5_tokenize.c \
262 $(TOP)/ext/fts5/fts5_unicode2.c \
263 $(TOP)/ext/fts5/fts5_varint.c \
264 $(TOP)/ext/fts5/fts5_vocab.c \
266 LSM1_SRC = \
267 $(TOP)/ext/lsm1/lsm.h \
268 $(TOP)/ext/lsm1/lsmInt.h \
269 $(TOP)/ext/lsm1/lsm_ckpt.c \
270 $(TOP)/ext/lsm1/lsm_file.c \
271 $(TOP)/ext/lsm1/lsm_log.c \
272 $(TOP)/ext/lsm1/lsm_main.c \
273 $(TOP)/ext/lsm1/lsm_mem.c \
274 $(TOP)/ext/lsm1/lsm_mutex.c \
275 $(TOP)/ext/lsm1/lsm_shared.c \
276 $(TOP)/ext/lsm1/lsm_sorted.c \
277 $(TOP)/ext/lsm1/lsm_str.c \
278 $(TOP)/ext/lsm1/lsm_tree.c \
279 $(TOP)/ext/lsm1/lsm_unix.c \
280 $(TOP)/ext/lsm1/lsm_varint.c \
281 $(TOP)/ext/lsm1/lsm_vtab.c \
282 $(TOP)/ext/lsm1/lsm_win32.c
285 # Generated source code files
287 SRC += \
288 keywordhash.h \
289 opcodes.c \
290 opcodes.h \
291 parse.c \
292 parse.h \
293 shell.c \
294 sqlite3.h
297 # Source code to the test files.
299 TESTSRC = \
300 $(TOP)/ext/expert/sqlite3expert.c \
301 $(TOP)/ext/expert/test_expert.c \
302 $(TOP)/ext/fts3/fts3_term.c \
303 $(TOP)/ext/fts3/fts3_test.c \
304 $(TOP)/ext/rbu/test_rbu.c \
305 $(TOP)/src/test1.c \
306 $(TOP)/src/test2.c \
307 $(TOP)/src/test3.c \
308 $(TOP)/src/test4.c \
309 $(TOP)/src/test5.c \
310 $(TOP)/src/test6.c \
311 $(TOP)/src/test7.c \
312 $(TOP)/src/test8.c \
313 $(TOP)/src/test9.c \
314 $(TOP)/src/test_autoext.c \
315 $(TOP)/src/test_async.c \
316 $(TOP)/src/test_backup.c \
317 $(TOP)/src/test_bestindex.c \
318 $(TOP)/src/test_blob.c \
319 $(TOP)/src/test_btree.c \
320 $(TOP)/src/test_config.c \
321 $(TOP)/src/test_delete.c \
322 $(TOP)/src/test_demovfs.c \
323 $(TOP)/src/test_devsym.c \
324 $(TOP)/src/test_fs.c \
325 $(TOP)/src/test_func.c \
326 $(TOP)/src/test_hexio.c \
327 $(TOP)/src/test_init.c \
328 $(TOP)/src/test_intarray.c \
329 $(TOP)/src/test_journal.c \
330 $(TOP)/src/test_malloc.c \
331 $(TOP)/src/test_md5.c \
332 $(TOP)/src/test_multiplex.c \
333 $(TOP)/src/test_mutex.c \
334 $(TOP)/src/test_onefile.c \
335 $(TOP)/src/test_osinst.c \
336 $(TOP)/src/test_pcache.c \
337 $(TOP)/src/test_quota.c \
338 $(TOP)/src/test_rtree.c \
339 $(TOP)/src/test_schema.c \
340 $(TOP)/src/test_server.c \
341 $(TOP)/src/test_sqllog.c \
342 $(TOP)/src/test_superlock.c \
343 $(TOP)/src/test_syscall.c \
344 $(TOP)/src/test_tclsh.c \
345 $(TOP)/src/test_tclvar.c \
346 $(TOP)/src/test_thread.c \
347 $(TOP)/src/test_vfs.c \
348 $(TOP)/src/test_windirent.c \
349 $(TOP)/src/test_wsd.c
351 # Extensions to be statically loaded.
353 TESTSRC += \
354 $(TOP)/ext/misc/amatch.c \
355 $(TOP)/ext/misc/carray.c \
356 $(TOP)/ext/misc/closure.c \
357 $(TOP)/ext/misc/csv.c \
358 $(TOP)/ext/misc/eval.c \
359 $(TOP)/ext/misc/fileio.c \
360 $(TOP)/ext/misc/fuzzer.c \
361 $(TOP)/ext/misc/ieee754.c \
362 $(TOP)/ext/misc/mmapwarm.c \
363 $(TOP)/ext/misc/nextchar.c \
364 $(TOP)/ext/misc/percentile.c \
365 $(TOP)/ext/misc/regexp.c \
366 $(TOP)/ext/misc/remember.c \
367 $(TOP)/ext/misc/series.c \
368 $(TOP)/ext/misc/spellfix.c \
369 $(TOP)/ext/misc/totype.c \
370 $(TOP)/ext/misc/unionvtab.c \
371 $(TOP)/ext/misc/wholenumber.c \
372 $(TOP)/ext/misc/vfslog.c \
373 $(TOP)/ext/misc/zipfile.c \
374 $(TOP)/ext/fts5/fts5_tcl.c \
375 $(TOP)/ext/fts5/fts5_test_mi.c \
376 $(TOP)/ext/fts5/fts5_test_tok.c
379 #TESTSRC += $(TOP)/ext/fts2/fts2_tokenizer.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/insert.c \
393 $(TOP)/src/wal.c \
394 $(TOP)/src/main.c \
395 $(TOP)/src/mem5.c \
396 $(TOP)/src/os.c \
397 $(TOP)/src/os_unix.c \
398 $(TOP)/src/os_win.c \
399 $(TOP)/src/pager.c \
400 $(TOP)/src/pragma.c \
401 $(TOP)/src/prepare.c \
402 $(TOP)/src/printf.c \
403 $(TOP)/src/random.c \
404 $(TOP)/src/pcache.c \
405 $(TOP)/src/pcache1.c \
406 $(TOP)/src/select.c \
407 $(TOP)/src/threads.c \
408 $(TOP)/src/tokenize.c \
409 $(TOP)/src/utf.c \
410 $(TOP)/src/util.c \
411 $(TOP)/src/vdbeapi.c \
412 $(TOP)/src/vdbeaux.c \
413 $(TOP)/src/vdbe.c \
414 $(TOP)/src/vdbemem.c \
415 $(TOP)/src/where.c \
416 $(TOP)/src/wherecode.c \
417 $(TOP)/src/whereexpr.c \
418 parse.c \
419 $(TOP)/ext/fts3/fts3.c \
420 $(TOP)/ext/fts3/fts3_aux.c \
421 $(TOP)/ext/fts3/fts3_expr.c \
422 $(TOP)/ext/fts3/fts3_tokenizer.c \
423 $(TOP)/ext/fts3/fts3_write.c \
424 $(TOP)/ext/async/sqlite3async.c \
425 $(TOP)/ext/session/sqlite3session.c \
426 $(TOP)/ext/session/test_session.c
428 # Header files used by all library source files.
430 HDR = \
431 $(TOP)/src/btree.h \
432 $(TOP)/src/btreeInt.h \
433 $(TOP)/src/hash.h \
434 $(TOP)/src/hwtime.h \
435 keywordhash.h \
436 $(TOP)/src/msvc.h \
437 $(TOP)/src/mutex.h \
438 opcodes.h \
439 $(TOP)/src/os.h \
440 $(TOP)/src/os_common.h \
441 $(TOP)/src/os_setup.h \
442 $(TOP)/src/os_win.h \
443 $(TOP)/src/pager.h \
444 $(TOP)/src/pcache.h \
445 parse.h \
446 $(TOP)/src/pragma.h \
447 sqlite3.h \
448 $(TOP)/src/sqlite3ext.h \
449 $(TOP)/src/sqliteInt.h \
450 $(TOP)/src/sqliteLimit.h \
451 $(TOP)/src/vdbe.h \
452 $(TOP)/src/vdbeInt.h \
453 $(TOP)/src/vxworks.h \
454 $(TOP)/src/whereInt.h
456 # Header files used by extensions
458 EXTHDR += \
459 $(TOP)/ext/fts1/fts1.h \
460 $(TOP)/ext/fts1/fts1_hash.h \
461 $(TOP)/ext/fts1/fts1_tokenizer.h
462 EXTHDR += \
463 $(TOP)/ext/fts2/fts2.h \
464 $(TOP)/ext/fts2/fts2_hash.h \
465 $(TOP)/ext/fts2/fts2_tokenizer.h
466 EXTHDR += \
467 $(TOP)/ext/fts3/fts3.h \
468 $(TOP)/ext/fts3/fts3Int.h \
469 $(TOP)/ext/fts3/fts3_hash.h \
470 $(TOP)/ext/fts3/fts3_tokenizer.h
471 EXTHDR += \
472 $(TOP)/ext/rtree/rtree.h
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
502 # Standard options to testfixture
504 TESTOPTS = --verbose=file --output=test-out.txt
506 # Extra compiler options for various shell tools
508 SHELL_OPT += -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5
509 SHELL_OPT += -DSQLITE_ENABLE_EXPLAIN_COMMENTS
510 SHELL_OPT += -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
511 SHELL_OPT += -DSQLITE_ENABLE_STMTVTAB
512 SHELL_OPT += -DSQLITE_ENABLE_DBPAGE_VTAB
513 SHELL_OPT += -DSQLITE_ENABLE_DBSTAT_VTAB
514 SHELL_OPT += -DSQLITE_ENABLE_OFFSET_SQL_FUNC
515 SHELL_OPT += -DSQLITE_INTROSPECTION_PRAGMAS
516 FUZZERSHELL_OPT = -DSQLITE_ENABLE_JSON1
517 FUZZCHECK_OPT = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMSYS5
518 FUZZCHECK_OPT += -DSQLITE_MAX_MEMORY=50000000
519 DBFUZZ_OPT =
520 KV_OPT = -DSQLITE_THREADSAFE=0 -DSQLITE_DIRECT_OVERFLOW_READ
521 ST_OPT = -DSQLITE_THREADSAFE=0
523 # This is the default Makefile target. The objects listed here
524 # are what get build when you type just "make" with no arguments.
526 all: sqlite3.h libsqlite3.a sqlite3$(EXE)
528 libsqlite3.a: $(LIBOBJ)
529 $(AR) libsqlite3.a $(LIBOBJ)
530 $(RANLIB) libsqlite3.a
532 sqlite3$(EXE): shell.c libsqlite3.a sqlite3.h
533 $(TCCX) $(READLINE_FLAGS) -o sqlite3$(EXE) $(SHELL_OPT) \
534 shell.c libsqlite3.a $(LIBREADLINE) $(TLIBS) $(THREADLIB)
536 sqldiff$(EXE): $(TOP)/tool/sqldiff.c sqlite3.c sqlite3.h
537 $(TCCX) -o sqldiff$(EXE) -DSQLITE_THREADSAFE=0 \
538 $(TOP)/tool/sqldiff.c sqlite3.c $(TLIBS) $(THREADLIB)
540 dbhash$(EXE): $(TOP)/tool/dbhash.c sqlite3.c sqlite3.h
541 $(TCCX) -o dbhash$(EXE) -DSQLITE_THREADSAFE=0 \
542 $(TOP)/tool/dbhash.c sqlite3.c $(TLIBS) $(THREADLIB)
544 scrub$(EXE): $(TOP)/ext/misc/scrub.c sqlite3.o
545 $(TCC) -I. -DSCRUB_STANDALONE -o scrub$(EXE) $(TOP)/ext/misc/scrub.c sqlite3.o $(THREADLIB)
547 srcck1$(EXE): $(TOP)/tool/srcck1.c
548 $(BCC) -o srcck1$(EXE) $(TOP)/tool/srcck1.c
550 sourcetest: srcck1$(EXE) sqlite3.c
551 ./srcck1 sqlite3.c
553 fuzzershell$(EXE): $(TOP)/tool/fuzzershell.c sqlite3.c sqlite3.h
554 $(TCCX) -o fuzzershell$(EXE) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
555 $(FUZZERSHELL_OPT) $(TOP)/tool/fuzzershell.c sqlite3.c \
556 $(TLIBS) $(THREADLIB)
558 dbfuzz$(EXE): $(TOP)/test/dbfuzz.c sqlite3.c sqlite3.h
559 $(TCCX) -o dbfuzz$(EXE) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
560 $(DBFUZZ_OPT) $(TOP)/test/dbfuzz.c sqlite3.c \
561 $(TLIBS) $(THREADLIB)
563 fuzzcheck$(EXE): $(TOP)/test/fuzzcheck.c sqlite3.c sqlite3.h $(TOP)/test/ossfuzz.c
564 $(TCCX) -o fuzzcheck$(EXE) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
565 -DSQLITE_ENABLE_MEMSYS5 $(FUZZCHECK_OPT) -DSQLITE_OSS_FUZZ \
566 $(TOP)/test/fuzzcheck.c $(TOP)/test/ossfuzz.c sqlite3.c $(TLIBS) $(THREADLIB)
568 ossshell$(EXE): $(TOP)/test/ossfuzz.c $(TOP)/test/ossshell.c sqlite3.c sqlite3.h
569 $(TCCX) -o ossshell$(EXE) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
570 -DSQLITE_ENABLE_MEMSYS5 $(FUZZCHECK_OPT) \
571 $(TOP)/test/ossfuzz.c $(TOP)/test/ossshell.c sqlite3.c $(TLIBS) $(THREADLIB)
573 mptester$(EXE): sqlite3.c $(TOP)/mptest/mptest.c
574 $(TCCX) -o $@ -I. $(TOP)/mptest/mptest.c sqlite3.c \
575 $(TLIBS) $(THREADLIB)
577 MPTEST1=./mptester$(EXE) mptest1.db $(TOP)/mptest/crash01.test --repeat 20
578 MPTEST2=./mptester$(EXE) mptest2.db $(TOP)/mptest/multiwrite01.test --repeat 20
579 mptest: mptester$(EXE)
580 $(MPTEST1) --journalmode DELETE
581 $(MPTEST2) --journalmode WAL
582 $(MPTEST1) --journalmode WAL
583 $(MPTEST2) --journalmode PERSIST
584 $(MPTEST1) --journalmode PERSIST
585 $(MPTEST2) --journalmode TRUNCATE
586 $(MPTEST1) --journalmode TRUNCATE
587 $(MPTEST2) --journalmode DELETE
589 sqlite3.o: sqlite3.c
590 $(TCCX) -I. -c sqlite3.c
592 # This target creates a directory named "tsrc" and fills it with
593 # copies of all of the C source code and header files needed to
594 # build on the target system. Some of the C source code and header
595 # files are automatically generated. This target takes care of
596 # all that automatic generation.
598 target_source: $(SRC) $(TOP)/tool/vdbe-compress.tcl fts5.c
599 rm -rf tsrc
600 mkdir tsrc
601 cp -f $(SRC) tsrc
602 rm tsrc/sqlite.h.in tsrc/parse.y
603 tclsh $(TOP)/tool/vdbe-compress.tcl $(OPTS) <tsrc/vdbe.c >vdbe.new
604 mv vdbe.new tsrc/vdbe.c
605 cp fts5.c fts5.h tsrc
606 touch target_source
608 sqlite3.c: target_source $(TOP)/tool/mksqlite3c.tcl
609 tclsh $(TOP)/tool/mksqlite3c.tcl
610 cp tsrc/sqlite3ext.h .
611 cp $(TOP)/ext/session/sqlite3session.h .
612 echo '#ifndef USE_SYSTEM_SQLITE' >tclsqlite3.c
613 cat sqlite3.c >>tclsqlite3.c
614 echo '#endif /* USE_SYSTEM_SQLITE */' >>tclsqlite3.c
615 cat $(TOP)/src/tclsqlite.c >>tclsqlite3.c
617 sqlite3ext.h: target_source
618 cp tsrc/sqlite3ext.h .
620 sqlite3.c-debug: target_source $(TOP)/tool/mksqlite3c.tcl
621 tclsh $(TOP)/tool/mksqlite3c.tcl --linemacros
622 echo '#ifndef USE_SYSTEM_SQLITE' >tclsqlite3.c
623 cat sqlite3.c >>tclsqlite3.c
624 echo '#endif /* USE_SYSTEM_SQLITE */' >>tclsqlite3.c
625 echo '#line 1 "tclsqlite.c"' >>tclsqlite3.c
626 cat $(TOP)/src/tclsqlite.c >>tclsqlite3.c
628 sqlite3-all.c: sqlite3.c $(TOP)/tool/split-sqlite3c.tcl
629 tclsh $(TOP)/tool/split-sqlite3c.tcl
631 fts2amal.c: target_source $(TOP)/ext/fts2/mkfts2amal.tcl
632 tclsh $(TOP)/ext/fts2/mkfts2amal.tcl
634 fts3amal.c: target_source $(TOP)/ext/fts3/mkfts3amal.tcl
635 tclsh $(TOP)/ext/fts3/mkfts3amal.tcl
637 # Rules to build the LEMON compiler generator
639 lemon: $(TOP)/tool/lemon.c $(TOP)/tool/lempar.c
640 $(BCC) -o lemon $(TOP)/tool/lemon.c
641 cp $(TOP)/tool/lempar.c .
643 # A tool to generate the source-id
645 mksourceid: $(TOP)/tool/mksourceid.c
646 $(BCC) -o mksourceid $(TOP)/tool/mksourceid.c
648 # Rules to build individual *.o files from generated *.c files. This
649 # applies to:
651 # parse.o
652 # opcodes.o
654 %.o: %.c $(HDR)
655 $(TCCX) -c $<
657 # Rules to build individual *.o files from files in the src directory.
659 %.o: $(TOP)/src/%.c $(HDR)
660 $(TCCX) -c $<
662 tclsqlite.o: $(TOP)/src/tclsqlite.c $(HDR)
663 $(TCCX) $(TCL_FLAGS) -c $(TOP)/src/tclsqlite.c
667 # Rules to build opcodes.c and opcodes.h
669 opcodes.c: opcodes.h $(TOP)/tool/mkopcodec.tcl
670 tclsh $(TOP)/tool/mkopcodec.tcl opcodes.h >opcodes.c
672 opcodes.h: parse.h $(TOP)/src/vdbe.c $(TOP)/tool/mkopcodeh.tcl
673 cat parse.h $(TOP)/src/vdbe.c | \
674 tclsh $(TOP)/tool/mkopcodeh.tcl >opcodes.h
676 # Rules to build parse.c and parse.h - the outputs of lemon.
678 parse.h: parse.c
680 parse.c: $(TOP)/src/parse.y lemon $(TOP)/tool/addopcodes.tcl
681 cp $(TOP)/src/parse.y .
682 rm -f parse.h
683 ./lemon -s $(OPTS) parse.y
684 mv parse.h parse.h.temp
685 tclsh $(TOP)/tool/addopcodes.tcl parse.h.temp >parse.h
687 sqlite3.h: $(TOP)/src/sqlite.h.in $(TOP)/manifest mksourceid $(TOP)/VERSION $(TOP)/ext/rtree/sqlite3rtree.h
688 tclsh $(TOP)/tool/mksqlite3h.tcl $(TOP) >sqlite3.h
690 keywordhash.h: $(TOP)/tool/mkkeywordhash.c
691 $(BCC) -o mkkeywordhash $(OPTS) $(TOP)/tool/mkkeywordhash.c
692 ./mkkeywordhash >keywordhash.h
694 # Source files that go into making shell.c
695 SHELL_SRC = \
696 $(TOP)/src/shell.c.in \
697 $(TOP)/ext/misc/shathree.c \
698 $(TOP)/ext/misc/fileio.c \
699 $(TOP)/ext/misc/completion.c \
700 $(TOP)/ext/misc/sqlar.c \
701 $(TOP)/ext/expert/sqlite3expert.c \
702 $(TOP)/ext/expert/sqlite3expert.h \
703 $(TOP)/ext/misc/zipfile.c \
704 $(TOP)/src/test_windirent.c
706 shell.c: $(SHELL_SRC) $(TOP)/tool/mkshellc.tcl
707 tclsh $(TOP)/tool/mkshellc.tcl >shell.c
711 # Rules to build the extension objects.
713 icu.o: $(TOP)/ext/icu/icu.c $(HDR) $(EXTHDR)
714 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/icu/icu.c
716 fts2.o: $(TOP)/ext/fts2/fts2.c $(HDR) $(EXTHDR)
717 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2.c
719 fts2_hash.o: $(TOP)/ext/fts2/fts2_hash.c $(HDR) $(EXTHDR)
720 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_hash.c
722 fts2_icu.o: $(TOP)/ext/fts2/fts2_icu.c $(HDR) $(EXTHDR)
723 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_icu.c
725 fts2_porter.o: $(TOP)/ext/fts2/fts2_porter.c $(HDR) $(EXTHDR)
726 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_porter.c
728 fts2_tokenizer.o: $(TOP)/ext/fts2/fts2_tokenizer.c $(HDR) $(EXTHDR)
729 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_tokenizer.c
731 fts2_tokenizer1.o: $(TOP)/ext/fts2/fts2_tokenizer1.c $(HDR) $(EXTHDR)
732 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_tokenizer1.c
734 fts3.o: $(TOP)/ext/fts3/fts3.c $(HDR) $(EXTHDR)
735 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3.c
737 fts3_aux.o: $(TOP)/ext/fts3/fts3_aux.c $(HDR) $(EXTHDR)
738 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_aux.c
740 fts3_expr.o: $(TOP)/ext/fts3/fts3_expr.c $(HDR) $(EXTHDR)
741 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_expr.c
743 fts3_hash.o: $(TOP)/ext/fts3/fts3_hash.c $(HDR) $(EXTHDR)
744 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_hash.c
746 fts3_icu.o: $(TOP)/ext/fts3/fts3_icu.c $(HDR) $(EXTHDR)
747 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_icu.c
749 fts3_snippet.o: $(TOP)/ext/fts3/fts3_snippet.c $(HDR) $(EXTHDR)
750 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_snippet.c
752 fts3_porter.o: $(TOP)/ext/fts3/fts3_porter.c $(HDR) $(EXTHDR)
753 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_porter.c
755 fts3_tokenizer.o: $(TOP)/ext/fts3/fts3_tokenizer.c $(HDR) $(EXTHDR)
756 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer.c
758 fts3_tokenizer1.o: $(TOP)/ext/fts3/fts3_tokenizer1.c $(HDR) $(EXTHDR)
759 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer1.c
761 fts3_tokenize_vtab.o: $(TOP)/ext/fts3/fts3_tokenize_vtab.c $(HDR) $(EXTHDR)
762 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenize_vtab.c
764 fts3_unicode.o: $(TOP)/ext/fts3/fts3_unicode.c $(HDR) $(EXTHDR)
765 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_unicode.c
767 fts3_unicode2.o: $(TOP)/ext/fts3/fts3_unicode2.c $(HDR) $(EXTHDR)
768 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_unicode2.c
770 fts3_write.o: $(TOP)/ext/fts3/fts3_write.c $(HDR) $(EXTHDR)
771 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_write.c
773 fts5.o: fts5.c
774 $(TCCX) -DSQLITE_CORE -c fts5.c
776 json1.o: $(TOP)/ext/misc/json1.c
777 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/misc/json1.c
779 stmt.o: $(TOP)/ext/misc/stmt.c
780 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/misc/stmt.c
782 rtree.o: $(TOP)/ext/rtree/rtree.c $(HDR) $(EXTHDR)
783 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/rtree/rtree.c
787 fts5parse.c: $(TOP)/ext/fts5/fts5parse.y lemon
788 cp $(TOP)/ext/fts5/fts5parse.y .
789 rm -f fts5parse.h
790 ./lemon $(OPTS) fts5parse.y
792 fts5parse.h: fts5parse.c
794 fts5.c: $(FTS5_SRC) $(FTS5_HDR)
795 tclsh $(TOP)/ext/fts5/tool/mkfts5c.tcl
796 cp $(TOP)/ext/fts5/fts5.h .
798 lsm1.c: $(LSM1_SRC)
799 tclsh $(TOP)/ext/lsm1/tool/mklsm1c.tcl
800 cp $(TOP)/ext/lsm1/lsm.h .
802 userauth.o: $(TOP)/ext/userauth/userauth.c $(HDR) $(EXTHDR)
803 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/userauth/userauth.c
805 sqlite3session.o: $(TOP)/ext/session/sqlite3session.c $(HDR) $(EXTHDR)
806 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/session/sqlite3session.c
808 sqlite3rbu.o: $(TOP)/ext/rbu/sqlite3rbu.c $(HDR) $(EXTHDR)
809 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/rbu/sqlite3rbu.c
811 # Rules for building test programs and for running tests
813 tclsqlite3: $(TOP)/src/tclsqlite.c libsqlite3.a
814 $(TCCX) $(TCL_FLAGS) -DTCLSH -o tclsqlite3 \
815 $(TOP)/src/tclsqlite.c libsqlite3.a $(LIBTCL) $(THREADLIB)
817 sqlite3_analyzer.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl $(TOP)/tool/sqlite3_analyzer.c.in $(TOP)/tool/mkccode.tcl
818 tclsh $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqlite3_analyzer.c.in >sqlite3_analyzer.c
820 sqlite3_analyzer$(EXE): sqlite3_analyzer.c
821 $(TCCX) $(TCL_FLAGS) sqlite3_analyzer.c -o $@ $(LIBTCL) $(THREADLIB)
823 sqltclsh.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/sqltclsh.tcl $(TOP)/ext/misc/appendvfs.c $(TOP)/tool/mkccode.tcl
824 tclsh $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqltclsh.c.in >sqltclsh.c
826 sqltclsh$(EXE): sqltclsh.c
827 $(TCCX) $(TCL_FLAGS) sqltclsh.c -o $@ $(LIBTCL) $(THREADLIB)
829 sqlite3_expert$(EXE): $(TOP)/ext/expert/sqlite3expert.h $(TOP)/ext/expert/sqlite3expert.c $(TOP)/ext/expert/expert.c sqlite3.c
830 $(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)
832 CHECKER_DEPS =\
833 $(TOP)/tool/mkccode.tcl \
834 sqlite3.c \
835 $(TOP)/src/tclsqlite.c \
836 $(TOP)/ext/repair/sqlite3_checker.tcl \
837 $(TOP)/ext/repair/checkindex.c \
838 $(TOP)/ext/repair/checkfreelist.c \
839 $(TOP)/ext/misc/btreeinfo.c \
840 $(TOP)/ext/repair/sqlite3_checker.c.in
842 sqlite3_checker.c: $(CHECKER_DEPS)
843 tclsh $(TOP)/tool/mkccode.tcl $(TOP)/ext/repair/sqlite3_checker.c.in >$@
845 sqlite3_checker$(TEXE): sqlite3_checker.c
846 $(TCCX) $(TCL_FLAGS) sqlite3_checker.c -o $@ $(LIBTCL) $(THREADLIB)
848 dbdump$(EXE): $(TOP)/ext/misc/dbdump.c sqlite3.o
849 $(TCCX) -DDBDUMP_STANDALONE -o dbdump$(EXE) \
850 $(TOP)/ext/misc/dbdump.c sqlite3.o $(THREADLIB)
852 # Rules to build the 'testfixture' application.
854 TESTFIXTURE_FLAGS = -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
855 TESTFIXTURE_FLAGS += -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE
856 TESTFIXTURE_FLAGS += -DSQLITE_SERIES_CONSTRAINT_VERIFY=1
857 TESTFIXTURE_FLAGS += -DSQLITE_DEFAULT_PAGE_SIZE=1024
858 TESTFIXTURE_FLAGS += -DSQLITE_ENABLE_STMTVTAB
859 TESTFIXTURE_FLAGS += -DSQLITE_ENABLE_DBPAGE_VTAB
860 TESTFIXTURE_FLAGS += -DTCLSH_INIT_PROC=sqlite3TestInit
862 testfixture$(EXE): $(TESTSRC2) libsqlite3.a $(TESTSRC) $(TOP)/src/tclsqlite.c
863 $(TCCX) $(TCL_FLAGS) $(TESTFIXTURE_FLAGS) \
864 $(TESTSRC) $(TESTSRC2) $(TOP)/src/tclsqlite.c \
865 -o testfixture$(EXE) $(LIBTCL) libsqlite3.a $(THREADLIB)
867 amalgamation-testfixture$(EXE): sqlite3.c $(TESTSRC) $(TOP)/src/tclsqlite.c \
868 $(TOP)/ext/session/test_session.c
869 $(TCCX) $(TCL_FLAGS) $(TESTFIXTURE_FLAGS) \
870 $(TESTSRC) $(TOP)/src/tclsqlite.c sqlite3.c \
871 $(TOP)/ext/session/test_session.c \
872 -o testfixture$(EXE) $(LIBTCL) $(THREADLIB)
874 fts3-testfixture$(EXE): sqlite3.c fts3amal.c $(TESTSRC) $(TOP)/src/tclsqlite.c
875 $(TCCX) $(TCL_FLAGS) $(TESTFIXTURE_FLAGS) \
876 -DSQLITE_ENABLE_FTS3=1 \
877 $(TESTSRC) $(TOP)/src/tclsqlite.c sqlite3.c fts3amal.c \
878 -o testfixture$(EXE) $(LIBTCL) $(THREADLIB)
880 fulltest: $(TESTPROGS) fuzztest
881 ./testfixture$(EXE) $(TOP)/test/all.test $(TESTOPTS)
883 soaktest: $(TESTPROGS)
884 ./testfixture$(EXE) $(TOP)/test/all.test -soak=1 $(TESTOPTS)
886 fulltestonly: $(TESTPROGS) fuzztest
887 ./testfixture$(EXE) $(TOP)/test/full.test $(TESTOPTS)
889 queryplantest: testfixture$(EXE) sqlite3$(EXE)
890 ./testfixture$(EXE) $(TOP)/test/permutations.test queryplanner $(TESTOPTS)
892 fuzztest: fuzzcheck$(EXE) $(FUZZDATA)
893 ./fuzzcheck$(EXE) $(FUZZDATA)
895 fastfuzztest: fuzzcheck$(EXE) $(FUZZDATA)
896 ./fuzzcheck$(EXE) --limit-mem 100M $(FUZZDATA)
898 valgrindfuzz: fuzzcheck$(EXE) $(FUZZDATA)
899 valgrind ./fuzzcheck$(EXE) --cell-size-check --limit-mem 10M --timeout 600 $(FUZZDATA)
901 # The veryquick.test TCL tests.
903 tcltest: ./testfixture$(EXE)
904 ./testfixture$(EXE) $(TOP)/test/veryquick.test $(TESTOPTS)
906 # A very quick test using only testfixture and omitting all the slower
907 # tests. Designed to run in under 3 minutes on a workstation.
909 quicktest: ./testfixture$(EXE)
910 ./testfixture$(EXE) $(TOP)/test/extraquick.test $(TESTOPTS)
912 # The default test case. Runs most of the faster standard TCL tests,
913 # and fuzz tests, and sqlite3_analyzer and sqldiff tests.
914 test: fastfuzztest sourcetest $(TESTPROGS) tcltest
916 # Run a test using valgrind. This can take a really long time
917 # because valgrind is so much slower than a native machine.
919 valgrindtest: $(TESTPROGS) valgrindfuzz
920 OMIT_MISUSE=1 valgrind -v \
921 ./testfixture$(EXE) $(TOP)/test/permutations.test valgrind $(TESTOPTS)
923 # A very fast test that checks basic sanity. The name comes from
924 # the 60s-era electronics testing: "Turn it on and see if smoke
925 # comes out."
927 smoketest: $(TESTPROGS) fuzzcheck$(EXE)
928 ./testfixture$(EXE) $(TOP)/test/main.test $(TESTOPTS)
930 # The next two rules are used to support the "threadtest" target. Building
931 # threadtest runs a few thread-safety tests that are implemented in C. This
932 # target is invoked by the releasetest.tcl script.
934 THREADTEST3_SRC = $(TOP)/test/threadtest3.c \
935 $(TOP)/test/tt3_checkpoint.c \
936 $(TOP)/test/tt3_index.c \
937 $(TOP)/test/tt3_vacuum.c \
938 $(TOP)/test/tt3_stress.c \
939 $(TOP)/test/tt3_lookaside1.c
941 threadtest3$(EXE): sqlite3.o $(THREADTEST3_SRC) $(TOP)/src/test_multiplex.c
942 $(TCCX) $(TOP)/test/threadtest3.c $(TOP)/src/test_multiplex.c sqlite3.o -o $@ $(THREADLIB)
944 threadtest: threadtest3$(EXE)
945 ./threadtest3$(EXE)
947 TEST_EXTENSION = $(SHPREFIX)testloadext.$(SO)
948 $(TEST_EXTENSION): $(TOP)/src/test_loadext.c
949 $(MKSHLIB) $(TOP)/src/test_loadext.c -o $(TEST_EXTENSION)
951 extensiontest: testfixture$(EXE) $(TEST_EXTENSION)
952 ./testfixture$(EXE) $(TOP)/test/loadext.test
954 showdb$(EXE): $(TOP)/tool/showdb.c sqlite3.o
955 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o showdb$(EXE) \
956 $(TOP)/tool/showdb.c sqlite3.o $(THREADLIB)
958 showstat4$(EXE): $(TOP)/tool/showstat4.c sqlite3.o
959 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o showstat4$(EXE) \
960 $(TOP)/tool/showstat4.c sqlite3.o $(THREADLIB)
962 showjournal$(EXE): $(TOP)/tool/showjournal.c sqlite3.o
963 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o showjournal$(EXE) \
964 $(TOP)/tool/showjournal.c sqlite3.o $(THREADLIB)
966 showwal$(EXE): $(TOP)/tool/showwal.c sqlite3.o
967 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o showwal$(EXE) \
968 $(TOP)/tool/showwal.c sqlite3.o $(THREADLIB)
970 showshm$(EXE): $(TOP)/tool/showshm.c
971 $(TCC) -o showshm$(EXE) $(TOP)/tool/showshm.c
973 changeset$(EXE): $(TOP)/ext/session/changeset.c sqlite3.o
974 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o changeset$(EXE) \
975 $(TOP)/ext/session/changeset.c sqlite3.o $(THREADLIB)
977 fts3view$(EXE): $(TOP)/ext/fts3/tool/fts3view.c sqlite3.o
978 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o fts3view$(EXE) \
979 $(TOP)/ext/fts3/tool/fts3view.c sqlite3.o $(THREADLIB)
981 rollback-test$(EXE): $(TOP)/tool/rollback-test.c sqlite3.o
982 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o rollback-test$(EXE) \
983 $(TOP)/tool/rollback-test.c sqlite3.o $(THREADLIB)
985 LogEst$(EXE): $(TOP)/tool/logest.c sqlite3.h
986 $(TCC) -o LogEst$(EXE) $(TOP)/tool/logest.c
988 wordcount$(EXE): $(TOP)/test/wordcount.c sqlite3.c
989 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o wordcount$(EXE) \
990 $(TOP)/test/wordcount.c sqlite3.c
992 speedtest1$(EXE): $(TOP)/test/speedtest1.c sqlite3.c
993 $(TCCX) -I. $(ST_OPT) -o speedtest1$(EXE) $(TOP)/test/speedtest1.c sqlite3.c $(THREADLIB)
995 kvtest$(EXE): $(TOP)/test/kvtest.c sqlite3.c
996 $(TCCX) -I. $(KV_OPT) -o kvtest$(EXE) $(TOP)/test/kvtest.c sqlite3.c $(THREADLIB)
998 rbu$(EXE): $(TOP)/ext/rbu/rbu.c $(TOP)/ext/rbu/sqlite3rbu.c sqlite3.o
999 $(TCC) -I. -o rbu$(EXE) $(TOP)/ext/rbu/rbu.c sqlite3.o \
1000 $(THREADLIB)
1002 loadfts: $(TOP)/tool/loadfts.c libsqlite3.a
1003 $(TCC) $(TOP)/tool/loadfts.c libsqlite3.a -o loadfts $(THREADLIB)
1005 # This target will fail if the SQLite amalgamation contains any exported
1006 # symbols that do not begin with "sqlite3_". It is run as part of the
1007 # releasetest.tcl script.
1009 checksymbols: sqlite3.o
1010 nm -g --defined-only sqlite3.o | grep -v " sqlite3_" ; test $$? -ne 0
1012 # Build the amalgamation-autoconf package. The amalamgation-tarball target builds
1013 # a tarball named for the version number. Ex: sqlite-autoconf-3110000.tar.gz.
1014 # The snapshot-tarball target builds a tarball named by the SHA1 hash
1016 amalgamation-tarball: sqlite3.c
1017 TOP=$(TOP) sh $(TOP)/tool/mkautoconfamal.sh --normal
1019 snapshot-tarball: sqlite3.c
1020 TOP=$(TOP) sh $(TOP)/tool/mkautoconfamal.sh --snapshot
1023 # Standard install and cleanup targets
1025 install: sqlite3 libsqlite3.a sqlite3.h
1026 mv sqlite3 /usr/bin
1027 mv libsqlite3.a /usr/lib
1028 mv sqlite3.h /usr/include
1030 clean:
1031 rm -f *.o sqlite3 sqlite3.exe libsqlite3.a sqlite3.h opcodes.*
1032 rm -f lemon lemon.exe lempar.c parse.* sqlite*.tar.gz
1033 rm -f mkkeywordhash mkkeywordhash.exe keywordhash.h
1034 rm -f $(PUBLISH)
1035 rm -f *.da *.bb *.bbg gmon.out
1036 rm -rf tsrc target_source
1037 rm -f testloadext.dll libtestloadext.so
1038 rm -f amalgamation-testfixture amalgamation-testfixture.exe
1039 rm -f fts3-testfixture fts3-testfixture.exe
1040 rm -f testfixture testfixture.exe
1041 rm -f threadtest3 threadtest3.exe
1042 rm -f LogEst LogEst.exe
1043 rm -f fts3view fts3view.exe
1044 rm -f rollback-test rollback-test.exe
1045 rm -f showdb showdb.exe
1046 rm -f showjournal showjournal.exe
1047 rm -f showstat4 showstat4.exe
1048 rm -f showwal showwal.exe
1049 rm -f changeset changeset.exe
1050 rm -f speedtest1 speedtest1.exe
1051 rm -f wordcount wordcount.exe
1052 rm -f rbu rbu.exe
1053 rm -f srcck1 srcck1.exe
1054 rm -f sqlite3.c sqlite3-*.c fts?amal.c tclsqlite3.c
1055 rm -f sqlite3rc.h
1056 rm -f shell.c sqlite3ext.h
1057 rm -f sqlite3_analyzer sqlite3_analyzer.exe sqlite3_analyzer.c
1058 rm -f sqlite3_expert sqlite3_expert.exe
1059 rm -f sqlite-*-output.vsix
1060 rm -f mptester mptester.exe
1061 rm -f fuzzershell fuzzershell.exe
1062 rm -f fuzzcheck fuzzcheck.exe
1063 rm -f sqldiff sqldiff.exe
1064 rm -f fts5.* fts5parse.*
1065 rm -f lsm.h lsm1.c