add pragma cipher_default_use_hmac to toggle global HMAC setting
[sqlcipher.git] / main.mk
blob4360d8626d363b1f2a3aca58ca549889c1983f7f
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 # OPTS Extra compiler command-line options.
17 # EXE The suffix to add to executable files. ".exe" for windows
18 # and "" for Unix.
20 # TCC C Compiler and options for use in building executables that
21 # will run on the target platform. This is usually the same
22 # as BCC, unless you are cross-compiling.
24 # AR Tools used to build a static library.
25 # RANLIB
27 # TCL_FLAGS Extra compiler options needed for programs that use the
28 # TCL library.
30 # LIBTCL Linker options needed to link against the TCL library.
32 # READLINE_FLAGS Compiler options needed for programs that use the
33 # readline() library.
35 # LIBREADLINE Linker options needed by programs using readline() must
36 # link against.
38 # NAWK Nawk compatible awk program. Older (obsolete?) solaris
39 # systems need this to avoid using the original AT&T AWK.
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
51 # Object files for the SQLite library.
53 LIBOBJ+= alter.o analyze.o attach.o auth.o \
54 backup.o bitvec.o btmutex.o btree.o build.o \
55 callback.o complete.o ctime.o date.o delete.o expr.o fault.o fkey.o \
56 fts3.o fts3_aux.o fts3_expr.o fts3_hash.o fts3_icu.o fts3_porter.o \
57 fts3_snippet.o fts3_tokenizer.o fts3_tokenizer1.o \
58 fts3_write.o func.o global.o hash.o \
59 icu.o insert.o journal.o legacy.o loadext.o \
60 main.o malloc.o mem0.o mem1.o mem2.o mem3.o mem5.o \
61 memjournal.o \
62 mutex.o mutex_noop.o mutex_os2.o mutex_unix.o mutex_w32.o \
63 notify.o opcodes.o os.o os_os2.o os_unix.o os_win.o \
64 pager.o parse.o pcache.o pcache1.o pragma.o prepare.o printf.o \
65 random.o resolve.o rowset.o rtree.o select.o status.o \
66 table.o tokenize.o trigger.o \
67 update.o util.o vacuum.o \
68 vdbe.o vdbeapi.o vdbeaux.o vdbeblob.o vdbemem.o vdbesort.o \
69 vdbetrace.o wal.o walker.o where.o utf.o vtab.o
73 # All of the source code files.
75 SRC = \
76 $(TOP)/src/alter.c \
77 $(TOP)/src/analyze.c \
78 $(TOP)/src/attach.c \
79 $(TOP)/src/auth.c \
80 $(TOP)/src/backup.c \
81 $(TOP)/src/bitvec.c \
82 $(TOP)/src/btmutex.c \
83 $(TOP)/src/btree.c \
84 $(TOP)/src/btree.h \
85 $(TOP)/src/btreeInt.h \
86 $(TOP)/src/build.c \
87 $(TOP)/src/callback.c \
88 $(TOP)/src/complete.c \
89 $(TOP)/src/ctime.c \
90 $(TOP)/src/date.c \
91 $(TOP)/src/delete.c \
92 $(TOP)/src/expr.c \
93 $(TOP)/src/fault.c \
94 $(TOP)/src/fkey.c \
95 $(TOP)/src/func.c \
96 $(TOP)/src/global.c \
97 $(TOP)/src/hash.c \
98 $(TOP)/src/hash.h \
99 $(TOP)/src/hwtime.h \
100 $(TOP)/src/insert.c \
101 $(TOP)/src/journal.c \
102 $(TOP)/src/legacy.c \
103 $(TOP)/src/loadext.c \
104 $(TOP)/src/main.c \
105 $(TOP)/src/malloc.c \
106 $(TOP)/src/mem0.c \
107 $(TOP)/src/mem1.c \
108 $(TOP)/src/mem2.c \
109 $(TOP)/src/mem3.c \
110 $(TOP)/src/mem5.c \
111 $(TOP)/src/memjournal.c \
112 $(TOP)/src/mutex.c \
113 $(TOP)/src/mutex.h \
114 $(TOP)/src/mutex_noop.c \
115 $(TOP)/src/mutex_os2.c \
116 $(TOP)/src/mutex_unix.c \
117 $(TOP)/src/mutex_w32.c \
118 $(TOP)/src/notify.c \
119 $(TOP)/src/os.c \
120 $(TOP)/src/os.h \
121 $(TOP)/src/os_common.h \
122 $(TOP)/src/os_os2.c \
123 $(TOP)/src/os_unix.c \
124 $(TOP)/src/os_win.c \
125 $(TOP)/src/pager.c \
126 $(TOP)/src/pager.h \
127 $(TOP)/src/parse.y \
128 $(TOP)/src/pcache.c \
129 $(TOP)/src/pcache.h \
130 $(TOP)/src/pcache1.c \
131 $(TOP)/src/pragma.c \
132 $(TOP)/src/prepare.c \
133 $(TOP)/src/printf.c \
134 $(TOP)/src/random.c \
135 $(TOP)/src/resolve.c \
136 $(TOP)/src/rowset.c \
137 $(TOP)/src/select.c \
138 $(TOP)/src/status.c \
139 $(TOP)/src/shell.c \
140 $(TOP)/src/sqlite.h.in \
141 $(TOP)/src/sqlite3ext.h \
142 $(TOP)/src/sqliteInt.h \
143 $(TOP)/src/sqliteLimit.h \
144 $(TOP)/src/table.c \
145 $(TOP)/src/tclsqlite.c \
146 $(TOP)/src/tokenize.c \
147 $(TOP)/src/trigger.c \
148 $(TOP)/src/utf.c \
149 $(TOP)/src/update.c \
150 $(TOP)/src/util.c \
151 $(TOP)/src/vacuum.c \
152 $(TOP)/src/vdbe.c \
153 $(TOP)/src/vdbe.h \
154 $(TOP)/src/vdbeapi.c \
155 $(TOP)/src/vdbeaux.c \
156 $(TOP)/src/vdbeblob.c \
157 $(TOP)/src/vdbemem.c \
158 $(TOP)/src/vdbesort.c \
159 $(TOP)/src/vdbetrace.c \
160 $(TOP)/src/vdbeInt.h \
161 $(TOP)/src/vtab.c \
162 $(TOP)/src/wal.c \
163 $(TOP)/src/wal.h \
164 $(TOP)/src/walker.c \
165 $(TOP)/src/where.c
167 # Source code for extensions
169 SRC += \
170 $(TOP)/ext/fts1/fts1.c \
171 $(TOP)/ext/fts1/fts1.h \
172 $(TOP)/ext/fts1/fts1_hash.c \
173 $(TOP)/ext/fts1/fts1_hash.h \
174 $(TOP)/ext/fts1/fts1_porter.c \
175 $(TOP)/ext/fts1/fts1_tokenizer.h \
176 $(TOP)/ext/fts1/fts1_tokenizer1.c
177 SRC += \
178 $(TOP)/ext/fts2/fts2.c \
179 $(TOP)/ext/fts2/fts2.h \
180 $(TOP)/ext/fts2/fts2_hash.c \
181 $(TOP)/ext/fts2/fts2_hash.h \
182 $(TOP)/ext/fts2/fts2_icu.c \
183 $(TOP)/ext/fts2/fts2_porter.c \
184 $(TOP)/ext/fts2/fts2_tokenizer.h \
185 $(TOP)/ext/fts2/fts2_tokenizer.c \
186 $(TOP)/ext/fts2/fts2_tokenizer1.c
187 SRC += \
188 $(TOP)/ext/fts3/fts3.c \
189 $(TOP)/ext/fts3/fts3.h \
190 $(TOP)/ext/fts3/fts3Int.h \
191 $(TOP)/ext/fts3/fts3_aux.c \
192 $(TOP)/ext/fts3/fts3_expr.c \
193 $(TOP)/ext/fts3/fts3_hash.c \
194 $(TOP)/ext/fts3/fts3_hash.h \
195 $(TOP)/ext/fts3/fts3_icu.c \
196 $(TOP)/ext/fts3/fts3_porter.c \
197 $(TOP)/ext/fts3/fts3_snippet.c \
198 $(TOP)/ext/fts3/fts3_tokenizer.h \
199 $(TOP)/ext/fts3/fts3_tokenizer.c \
200 $(TOP)/ext/fts3/fts3_tokenizer1.c \
201 $(TOP)/ext/fts3/fts3_write.c
202 SRC += \
203 $(TOP)/ext/icu/sqliteicu.h \
204 $(TOP)/ext/icu/icu.c
205 SRC += \
206 $(TOP)/ext/rtree/rtree.h \
207 $(TOP)/ext/rtree/rtree.c
210 # Generated source code files
212 SRC += \
213 keywordhash.h \
214 opcodes.c \
215 opcodes.h \
216 parse.c \
217 parse.h \
218 sqlite3.h
221 # Source code to the test files.
223 TESTSRC = \
224 $(TOP)/ext/fts3/fts3_term.c \
225 $(TOP)/ext/fts3/fts3_test.c \
226 $(TOP)/src/test1.c \
227 $(TOP)/src/test2.c \
228 $(TOP)/src/test3.c \
229 $(TOP)/src/test4.c \
230 $(TOP)/src/test5.c \
231 $(TOP)/src/test6.c \
232 $(TOP)/src/test7.c \
233 $(TOP)/src/test8.c \
234 $(TOP)/src/test9.c \
235 $(TOP)/src/test_autoext.c \
236 $(TOP)/src/test_async.c \
237 $(TOP)/src/test_backup.c \
238 $(TOP)/src/test_btree.c \
239 $(TOP)/src/test_config.c \
240 $(TOP)/src/test_demovfs.c \
241 $(TOP)/src/test_devsym.c \
242 $(TOP)/src/test_func.c \
243 $(TOP)/src/test_fuzzer.c \
244 $(TOP)/src/test_hexio.c \
245 $(TOP)/src/test_init.c \
246 $(TOP)/src/test_intarray.c \
247 $(TOP)/src/test_journal.c \
248 $(TOP)/src/test_malloc.c \
249 $(TOP)/src/test_multiplex.c \
250 $(TOP)/src/test_mutex.c \
251 $(TOP)/src/test_onefile.c \
252 $(TOP)/src/test_osinst.c \
253 $(TOP)/src/test_pcache.c \
254 $(TOP)/src/test_quota.c \
255 $(TOP)/src/test_rtree.c \
256 $(TOP)/src/test_schema.c \
257 $(TOP)/src/test_server.c \
258 $(TOP)/src/test_stat.c \
259 $(TOP)/src/test_superlock.c \
260 $(TOP)/src/test_syscall.c \
261 $(TOP)/src/test_tclvar.c \
262 $(TOP)/src/test_thread.c \
263 $(TOP)/src/test_vfs.c \
264 $(TOP)/src/test_wholenumber.c \
265 $(TOP)/src/test_wsd.c
267 #TESTSRC += $(TOP)/ext/fts2/fts2_tokenizer.c
268 #TESTSRC += $(TOP)/ext/fts3/fts3_tokenizer.c
270 TESTSRC2 = \
271 $(TOP)/src/attach.c \
272 $(TOP)/src/backup.c \
273 $(TOP)/src/btree.c \
274 $(TOP)/src/build.c \
275 $(TOP)/src/date.c \
276 $(TOP)/src/expr.c \
277 $(TOP)/src/func.c \
278 $(TOP)/src/insert.c \
279 $(TOP)/src/wal.c \
280 $(TOP)/src/mem5.c \
281 $(TOP)/src/os.c \
282 $(TOP)/src/os_os2.c \
283 $(TOP)/src/os_unix.c \
284 $(TOP)/src/os_win.c \
285 $(TOP)/src/pager.c \
286 $(TOP)/src/pragma.c \
287 $(TOP)/src/prepare.c \
288 $(TOP)/src/printf.c \
289 $(TOP)/src/random.c \
290 $(TOP)/src/pcache.c \
291 $(TOP)/src/pcache1.c \
292 $(TOP)/src/select.c \
293 $(TOP)/src/tokenize.c \
294 $(TOP)/src/utf.c \
295 $(TOP)/src/util.c \
296 $(TOP)/src/vdbeapi.c \
297 $(TOP)/src/vdbeaux.c \
298 $(TOP)/src/vdbe.c \
299 $(TOP)/src/vdbemem.c \
300 $(TOP)/src/where.c \
301 parse.c \
302 $(TOP)/ext/fts3/fts3.c \
303 $(TOP)/ext/fts3/fts3_aux.c \
304 $(TOP)/ext/fts3/fts3_expr.c \
305 $(TOP)/ext/fts3/fts3_tokenizer.c \
306 $(TOP)/ext/fts3/fts3_write.c \
307 $(TOP)/ext/async/sqlite3async.c
309 # Header files used by all library source files.
311 HDR = \
312 $(TOP)/src/btree.h \
313 $(TOP)/src/btreeInt.h \
314 $(TOP)/src/hash.h \
315 $(TOP)/src/hwtime.h \
316 keywordhash.h \
317 $(TOP)/src/mutex.h \
318 opcodes.h \
319 $(TOP)/src/os.h \
320 $(TOP)/src/os_common.h \
321 $(TOP)/src/pager.h \
322 $(TOP)/src/pcache.h \
323 parse.h \
324 sqlite3.h \
325 $(TOP)/src/sqlite3ext.h \
326 $(TOP)/src/sqliteInt.h \
327 $(TOP)/src/sqliteLimit.h \
328 $(TOP)/src/vdbe.h \
329 $(TOP)/src/vdbeInt.h
331 # Header files used by extensions
333 EXTHDR += \
334 $(TOP)/ext/fts1/fts1.h \
335 $(TOP)/ext/fts1/fts1_hash.h \
336 $(TOP)/ext/fts1/fts1_tokenizer.h
337 EXTHDR += \
338 $(TOP)/ext/fts2/fts2.h \
339 $(TOP)/ext/fts2/fts2_hash.h \
340 $(TOP)/ext/fts2/fts2_tokenizer.h
341 EXTHDR += \
342 $(TOP)/ext/fts3/fts3.h \
343 $(TOP)/ext/fts3/fts3Int.h \
344 $(TOP)/ext/fts3/fts3_hash.h \
345 $(TOP)/ext/fts3/fts3_tokenizer.h
346 EXTHDR += \
347 $(TOP)/ext/rtree/rtree.h
348 EXTHDR += \
349 $(TOP)/ext/icu/sqliteicu.h
351 # This is the default Makefile target. The objects listed here
352 # are what get build when you type just "make" with no arguments.
354 all: sqlite3.h libsqlite3.a sqlite3$(EXE)
356 libsqlite3.a: $(LIBOBJ)
357 $(AR) libsqlite3.a $(LIBOBJ)
358 $(RANLIB) libsqlite3.a
360 sqlite3$(EXE): $(TOP)/src/shell.c libsqlite3.a sqlite3.h
361 $(TCCX) $(READLINE_FLAGS) -o sqlite3$(EXE) \
362 $(TOP)/src/shell.c \
363 libsqlite3.a $(LIBREADLINE) $(TLIBS) $(THREADLIB)
365 sqlite3.o: sqlite3.c
366 $(TCCX) -c sqlite3.c
368 # This target creates a directory named "tsrc" and fills it with
369 # copies of all of the C source code and header files needed to
370 # build on the target system. Some of the C source code and header
371 # files are automatically generated. This target takes care of
372 # all that automatic generation.
374 target_source: $(SRC) $(TOP)/tool/vdbe-compress.tcl
375 rm -rf tsrc
376 mkdir tsrc
377 cp -f $(SRC) tsrc
378 rm tsrc/sqlite.h.in tsrc/parse.y
379 tclsh $(TOP)/tool/vdbe-compress.tcl <tsrc/vdbe.c >vdbe.new
380 mv vdbe.new tsrc/vdbe.c
381 touch target_source
383 sqlite3.c: target_source $(TOP)/tool/mksqlite3c.tcl
384 tclsh $(TOP)/tool/mksqlite3c.tcl
385 echo '#ifndef USE_SYSTEM_SQLITE' >tclsqlite3.c
386 cat sqlite3.c >>tclsqlite3.c
387 echo '#endif /* USE_SYSTEM_SQLITE */' >>tclsqlite3.c
388 cat $(TOP)/src/tclsqlite.c >>tclsqlite3.c
390 sqlite3.c-debug: target_source $(TOP)/tool/mksqlite3c.tcl
391 tclsh $(TOP)/tool/mksqlite3c.tcl --linemacros
392 echo '#ifndef USE_SYSTEM_SQLITE' >tclsqlite3.c
393 cat sqlite3.c >>tclsqlite3.c
394 echo '#endif /* USE_SYSTEM_SQLITE */' >>tclsqlite3.c
395 echo '#line 1 "tclsqlite.c"' >>tclsqlite3.c
396 cat $(TOP)/src/tclsqlite.c >>tclsqlite3.c
398 sqlite3-all.c: sqlite3.c $(TOP)/tool/split-sqlite3c.tcl
399 tclsh $(TOP)/tool/split-sqlite3c.tcl
401 fts2amal.c: target_source $(TOP)/ext/fts2/mkfts2amal.tcl
402 tclsh $(TOP)/ext/fts2/mkfts2amal.tcl
404 fts3amal.c: target_source $(TOP)/ext/fts3/mkfts3amal.tcl
405 tclsh $(TOP)/ext/fts3/mkfts3amal.tcl
407 # Rules to build the LEMON compiler generator
409 lemon: $(TOP)/tool/lemon.c $(TOP)/src/lempar.c
410 $(BCC) -o lemon $(TOP)/tool/lemon.c
411 cp $(TOP)/src/lempar.c .
413 # Rules to build individual *.o files from generated *.c files. This
414 # applies to:
416 # parse.o
417 # opcodes.o
419 %.o: %.c $(HDR)
420 $(TCCX) -c $<
422 # Rules to build individual *.o files from files in the src directory.
424 %.o: $(TOP)/src/%.c $(HDR)
425 $(TCCX) -c $<
427 tclsqlite.o: $(TOP)/src/tclsqlite.c $(HDR)
428 $(TCCX) $(TCL_FLAGS) -c $(TOP)/src/tclsqlite.c
432 # Rules to build opcodes.c and opcodes.h
434 opcodes.c: opcodes.h $(TOP)/mkopcodec.awk
435 $(NAWK) -f $(TOP)/mkopcodec.awk opcodes.h >opcodes.c
437 opcodes.h: parse.h $(TOP)/src/vdbe.c $(TOP)/mkopcodeh.awk
438 cat parse.h $(TOP)/src/vdbe.c | \
439 $(NAWK) -f $(TOP)/mkopcodeh.awk >opcodes.h
441 # Rules to build parse.c and parse.h - the outputs of lemon.
443 parse.h: parse.c
445 parse.c: $(TOP)/src/parse.y lemon $(TOP)/addopcodes.awk
446 cp $(TOP)/src/parse.y .
447 rm -f parse.h
448 ./lemon $(OPTS) parse.y
449 mv parse.h parse.h.temp
450 $(NAWK) -f $(TOP)/addopcodes.awk parse.h.temp >parse.h
452 sqlite3.h: $(TOP)/src/sqlite.h.in $(TOP)/manifest.uuid $(TOP)/VERSION
453 tclsh $(TOP)/tool/mksqlite3h.tcl $(TOP) >sqlite3.h
455 keywordhash.h: $(TOP)/tool/mkkeywordhash.c
456 $(BCC) -o mkkeywordhash $(OPTS) $(TOP)/tool/mkkeywordhash.c
457 ./mkkeywordhash >keywordhash.h
461 # Rules to build the extension objects.
463 icu.o: $(TOP)/ext/icu/icu.c $(HDR) $(EXTHDR)
464 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/icu/icu.c
466 fts2.o: $(TOP)/ext/fts2/fts2.c $(HDR) $(EXTHDR)
467 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2.c
469 fts2_hash.o: $(TOP)/ext/fts2/fts2_hash.c $(HDR) $(EXTHDR)
470 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_hash.c
472 fts2_icu.o: $(TOP)/ext/fts2/fts2_icu.c $(HDR) $(EXTHDR)
473 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_icu.c
475 fts2_porter.o: $(TOP)/ext/fts2/fts2_porter.c $(HDR) $(EXTHDR)
476 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_porter.c
478 fts2_tokenizer.o: $(TOP)/ext/fts2/fts2_tokenizer.c $(HDR) $(EXTHDR)
479 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_tokenizer.c
481 fts2_tokenizer1.o: $(TOP)/ext/fts2/fts2_tokenizer1.c $(HDR) $(EXTHDR)
482 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_tokenizer1.c
484 fts3.o: $(TOP)/ext/fts3/fts3.c $(HDR) $(EXTHDR)
485 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3.c
487 fts3_aux.o: $(TOP)/ext/fts3/fts3_aux.c $(HDR) $(EXTHDR)
488 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_aux.c
490 fts3_expr.o: $(TOP)/ext/fts3/fts3_expr.c $(HDR) $(EXTHDR)
491 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_expr.c
493 fts3_hash.o: $(TOP)/ext/fts3/fts3_hash.c $(HDR) $(EXTHDR)
494 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_hash.c
496 fts3_icu.o: $(TOP)/ext/fts3/fts3_icu.c $(HDR) $(EXTHDR)
497 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_icu.c
499 fts3_snippet.o: $(TOP)/ext/fts3/fts3_snippet.c $(HDR) $(EXTHDR)
500 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_snippet.c
502 fts3_porter.o: $(TOP)/ext/fts3/fts3_porter.c $(HDR) $(EXTHDR)
503 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_porter.c
505 fts3_tokenizer.o: $(TOP)/ext/fts3/fts3_tokenizer.c $(HDR) $(EXTHDR)
506 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer.c
508 fts3_tokenizer1.o: $(TOP)/ext/fts3/fts3_tokenizer1.c $(HDR) $(EXTHDR)
509 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer1.c
511 fts3_write.o: $(TOP)/ext/fts3/fts3_write.c $(HDR) $(EXTHDR)
512 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_write.c
514 rtree.o: $(TOP)/ext/rtree/rtree.c $(HDR) $(EXTHDR)
515 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/rtree/rtree.c
518 # Rules for building test programs and for running tests
520 tclsqlite3: $(TOP)/src/tclsqlite.c libsqlite3.a
521 $(TCCX) $(TCL_FLAGS) -DTCLSH=1 -o tclsqlite3 \
522 $(TOP)/src/tclsqlite.c libsqlite3.a $(LIBTCL) $(THREADLIB)
524 sqlite3_analyzer.c: sqlite3.c $(TOP)/src/test_stat.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl
525 echo "#define TCLSH 2" > $@
526 cat sqlite3.c $(TOP)/src/test_stat.c $(TOP)/src/tclsqlite.c >> $@
527 echo "static const char *tclsh_main_loop(void){" >> $@
528 echo "static const char *zMainloop = " >> $@
529 $(NAWK) -f $(TOP)/tool/tostr.awk $(TOP)/tool/spaceanal.tcl >> $@
530 echo "; return zMainloop; }" >> $@
532 sqlite3_analyzer$(EXE): sqlite3_analyzer.c
533 $(TCCX) $(TCL_FLAGS) sqlite3_analyzer.c -o $@ $(LIBTCL) $(THREADLIB)
535 # Rules to build the 'testfixture' application.
537 TESTFIXTURE_FLAGS = -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
538 TESTFIXTURE_FLAGS += -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE
540 testfixture$(EXE): $(TESTSRC2) libsqlite3.a $(TESTSRC) $(TOP)/src/tclsqlite.c
541 $(TCCX) $(TCL_FLAGS) -DTCLSH=1 $(TESTFIXTURE_FLAGS) \
542 $(TESTSRC) $(TESTSRC2) $(TOP)/src/tclsqlite.c \
543 -o testfixture$(EXE) $(LIBTCL) $(THREADLIB) libsqlite3.a
545 amalgamation-testfixture$(EXE): sqlite3.c $(TESTSRC) $(TOP)/src/tclsqlite.c
546 $(TCCX) $(TCL_FLAGS) -DTCLSH=1 $(TESTFIXTURE_FLAGS) \
547 $(TESTSRC) $(TOP)/src/tclsqlite.c sqlite3.c \
548 -o testfixture$(EXE) $(LIBTCL) $(THREADLIB)
550 fts3-testfixture$(EXE): sqlite3.c fts3amal.c $(TESTSRC) $(TOP)/src/tclsqlite.c
551 $(TCCX) $(TCL_FLAGS) -DTCLSH=1 $(TESTFIXTURE_FLAGS) \
552 -DSQLITE_ENABLE_FTS3=1 \
553 $(TESTSRC) $(TOP)/src/tclsqlite.c sqlite3.c fts3amal.c \
554 -o testfixture$(EXE) $(LIBTCL) $(THREADLIB)
556 fulltest: testfixture$(EXE) sqlite3$(EXE)
557 ./testfixture$(EXE) $(TOP)/test/all.test
559 soaktest: testfixture$(EXE) sqlite3$(EXE)
560 ./testfixture$(EXE) $(TOP)/test/all.test -soak=1
562 test: testfixture$(EXE) sqlite3$(EXE)
563 ./testfixture$(EXE) $(TOP)/test/veryquick.test
565 # The next two rules are used to support the "threadtest" target. Building
566 # threadtest runs a few thread-safety tests that are implemented in C. This
567 # target is invoked by the releasetest.tcl script.
569 threadtest3$(EXE): sqlite3.o $(TOP)/test/threadtest3.c $(TOP)/test/tt3_checkpoint.c
570 $(TCCX) -O2 sqlite3.o $(TOP)/test/threadtest3.c \
571 -o threadtest3$(EXE) $(THREADLIB)
573 threadtest: threadtest3$(EXE)
574 ./threadtest3$(EXE)
576 TEST_EXTENSION = $(SHPREFIX)testloadext.$(SO)
577 $(TEST_EXTENSION): $(TOP)/src/test_loadext.c
578 $(MKSHLIB) $(TOP)/src/test_loadext.c -o $(TEST_EXTENSION)
580 extensiontest: testfixture$(EXE) $(TEST_EXTENSION)
581 ./testfixture$(EXE) $(TOP)/test/loadext.test
583 # This target will fail if the SQLite amalgamation contains any exported
584 # symbols that do not begin with "sqlite3_". It is run as part of the
585 # releasetest.tcl script.
587 checksymbols: sqlite3.o
588 nm -g --defined-only sqlite3.o | grep -v " sqlite3_" ; test $$? -ne 0
591 # Standard install and cleanup targets
593 install: sqlite3 libsqlite3.a sqlite3.h
594 mv sqlite3 /usr/bin
595 mv libsqlite3.a /usr/lib
596 mv sqlite3.h /usr/include
598 clean:
599 rm -f *.o sqlite3 sqlite3.exe libsqlite3.a sqlite3.h opcodes.*
600 rm -f lemon lemon.exe lempar.c parse.* sqlite*.tar.gz
601 rm -f mkkeywordhash mkkeywordhash.exe keywordhash.h
602 rm -f $(PUBLISH)
603 rm -f *.da *.bb *.bbg gmon.out
604 rm -rf tsrc target_source
605 rm -f testloadext.dll libtestloadext.so
606 rm -f amalgamation-testfixture amalgamation-testfixture.exe
607 rm -f fts3-testfixture fts3-testfixture.exe
608 rm -f testfixture testfixture.exe
609 rm -f threadtest3 threadtest3.exe
610 rm -f sqlite3.c fts?amal.c tclsqlite3.c
611 rm -f sqlite3_analyzer sqlite3_analyzer.exe sqlite3_analyzer.c