Update mojo sdk to rev 1dc8a9a5db73d3718d99917fadf31f5fb2ebad4f
[chromium-blink-merge.git] / third_party / sqlite / src / main.mk
blob54b5b35bb2cdded7a82ba9f95fc882b99cb5e008
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 -I$(TOP)/ext/userauth
51 # Object files for the SQLite library.
53 LIBOBJ+= vdbe.o parse.o \
54 alter.o analyze.o attach.o auth.o \
55 backup.o bitvec.o btmutex.o btree.o build.o \
56 callback.o complete.o ctime.o date.o delete.o expr.o fault.o fkey.o \
57 fts3.o fts3_aux.o fts3_expr.o fts3_hash.o fts3_icu.o fts3_porter.o \
58 fts3_snippet.o fts3_tokenizer.o fts3_tokenizer1.o \
59 fts3_tokenize_vtab.o \
60 fts3_unicode.o fts3_unicode2.o \
61 fts3_write.o func.o global.o hash.o \
62 icu.o insert.o journal.o legacy.o loadext.o \
63 main.o malloc.o mem0.o mem1.o mem2.o mem3.o mem5.o \
64 memjournal.o \
65 mutex.o mutex_noop.o mutex_unix.o mutex_w32.o \
66 notify.o opcodes.o os.o os_unix.o os_win.o \
67 pager.o pcache.o pcache1.o pragma.o prepare.o printf.o \
68 random.o recover.o resolve.o rowset.o rtree.o select.o status.o \
69 table.o threads.o tokenize.o trigger.o \
70 update.o userauth.o util.o vacuum.o \
71 vdbeapi.o vdbeaux.o vdbeblob.o vdbemem.o vdbesort.o \
72 vdbetrace.o wal.o walker.o where.o utf.o vtab.o
76 # All of the source code files.
78 SRC = \
79 $(TOP)/src/alter.c \
80 $(TOP)/src/analyze.c \
81 $(TOP)/src/attach.c \
82 $(TOP)/src/auth.c \
83 $(TOP)/src/backup.c \
84 $(TOP)/src/bitvec.c \
85 $(TOP)/src/btmutex.c \
86 $(TOP)/src/btree.c \
87 $(TOP)/src/btree.h \
88 $(TOP)/src/btreeInt.h \
89 $(TOP)/src/build.c \
90 $(TOP)/src/callback.c \
91 $(TOP)/src/complete.c \
92 $(TOP)/src/ctime.c \
93 $(TOP)/src/date.c \
94 $(TOP)/src/delete.c \
95 $(TOP)/src/expr.c \
96 $(TOP)/src/fault.c \
97 $(TOP)/src/fkey.c \
98 $(TOP)/src/func.c \
99 $(TOP)/src/global.c \
100 $(TOP)/src/hash.c \
101 $(TOP)/src/hash.h \
102 $(TOP)/src/hwtime.h \
103 $(TOP)/src/insert.c \
104 $(TOP)/src/journal.c \
105 $(TOP)/src/legacy.c \
106 $(TOP)/src/loadext.c \
107 $(TOP)/src/main.c \
108 $(TOP)/src/malloc.c \
109 $(TOP)/src/mem0.c \
110 $(TOP)/src/mem1.c \
111 $(TOP)/src/mem2.c \
112 $(TOP)/src/mem3.c \
113 $(TOP)/src/mem5.c \
114 $(TOP)/src/memjournal.c \
115 $(TOP)/src/mutex.c \
116 $(TOP)/src/mutex.h \
117 $(TOP)/src/mutex_noop.c \
118 $(TOP)/src/mutex_unix.c \
119 $(TOP)/src/mutex_w32.c \
120 $(TOP)/src/notify.c \
121 $(TOP)/src/os.c \
122 $(TOP)/src/os.h \
123 $(TOP)/src/os_common.h \
124 $(TOP)/src/os_setup.h \
125 $(TOP)/src/os_unix.c \
126 $(TOP)/src/os_win.c \
127 $(TOP)/src/os_win.h \
128 $(TOP)/src/pager.c \
129 $(TOP)/src/pager.h \
130 $(TOP)/src/parse.y \
131 $(TOP)/src/pcache.c \
132 $(TOP)/src/pcache.h \
133 $(TOP)/src/pcache1.c \
134 $(TOP)/src/pragma.c \
135 $(TOP)/src/prepare.c \
136 $(TOP)/src/printf.c \
137 $(TOP)/src/random.c \
138 $(TOP)/src/recover.c \
139 $(TOP)/src/resolve.c \
140 $(TOP)/src/rowset.c \
141 $(TOP)/src/select.c \
142 $(TOP)/src/status.c \
143 $(TOP)/src/shell.c \
144 $(TOP)/src/sqlite.h.in \
145 $(TOP)/src/sqlite3ext.h \
146 $(TOP)/src/sqliteInt.h \
147 $(TOP)/src/sqliteLimit.h \
148 $(TOP)/src/table.c \
149 $(TOP)/src/tclsqlite.c \
150 $(TOP)/src/threads.c \
151 $(TOP)/src/tokenize.c \
152 $(TOP)/src/trigger.c \
153 $(TOP)/src/utf.c \
154 $(TOP)/src/update.c \
155 $(TOP)/src/util.c \
156 $(TOP)/src/vacuum.c \
157 $(TOP)/src/vdbe.c \
158 $(TOP)/src/vdbe.h \
159 $(TOP)/src/vdbeapi.c \
160 $(TOP)/src/vdbeaux.c \
161 $(TOP)/src/vdbeblob.c \
162 $(TOP)/src/vdbemem.c \
163 $(TOP)/src/vdbesort.c \
164 $(TOP)/src/vdbetrace.c \
165 $(TOP)/src/vdbeInt.h \
166 $(TOP)/src/vtab.c \
167 $(TOP)/src/wal.c \
168 $(TOP)/src/wal.h \
169 $(TOP)/src/walker.c \
170 $(TOP)/src/where.c \
171 $(TOP)/src/whereInt.h
173 # Source code for extensions
175 SRC += \
176 $(TOP)/ext/fts1/fts1.c \
177 $(TOP)/ext/fts1/fts1.h \
178 $(TOP)/ext/fts1/fts1_hash.c \
179 $(TOP)/ext/fts1/fts1_hash.h \
180 $(TOP)/ext/fts1/fts1_porter.c \
181 $(TOP)/ext/fts1/fts1_tokenizer.h \
182 $(TOP)/ext/fts1/fts1_tokenizer1.c
183 SRC += \
184 $(TOP)/ext/fts2/fts2.c \
185 $(TOP)/ext/fts2/fts2.h \
186 $(TOP)/ext/fts2/fts2_hash.c \
187 $(TOP)/ext/fts2/fts2_hash.h \
188 $(TOP)/ext/fts2/fts2_icu.c \
189 $(TOP)/ext/fts2/fts2_porter.c \
190 $(TOP)/ext/fts2/fts2_tokenizer.h \
191 $(TOP)/ext/fts2/fts2_tokenizer.c \
192 $(TOP)/ext/fts2/fts2_tokenizer1.c
193 SRC += \
194 $(TOP)/ext/fts3/fts3.c \
195 $(TOP)/ext/fts3/fts3.h \
196 $(TOP)/ext/fts3/fts3Int.h \
197 $(TOP)/ext/fts3/fts3_aux.c \
198 $(TOP)/ext/fts3/fts3_expr.c \
199 $(TOP)/ext/fts3/fts3_hash.c \
200 $(TOP)/ext/fts3/fts3_hash.h \
201 $(TOP)/ext/fts3/fts3_icu.c \
202 $(TOP)/ext/fts3/fts3_porter.c \
203 $(TOP)/ext/fts3/fts3_snippet.c \
204 $(TOP)/ext/fts3/fts3_tokenizer.h \
205 $(TOP)/ext/fts3/fts3_tokenizer.c \
206 $(TOP)/ext/fts3/fts3_tokenizer1.c \
207 $(TOP)/ext/fts3/fts3_tokenize_vtab.c \
208 $(TOP)/ext/fts3/fts3_unicode.c \
209 $(TOP)/ext/fts3/fts3_unicode2.c \
210 $(TOP)/ext/fts3/fts3_write.c
211 SRC += \
212 $(TOP)/ext/icu/sqliteicu.h \
213 $(TOP)/ext/icu/icu.c
214 SRC += \
215 $(TOP)/ext/rtree/sqlite3rtree.h \
216 $(TOP)/ext/rtree/rtree.h \
217 $(TOP)/ext/rtree/rtree.c
218 SRC += \
219 $(TOP)/ext/userauth/userauth.c \
220 $(TOP)/ext/userauth/sqlite3userauth.h
222 # Generated source code files
224 SRC += \
225 keywordhash.h \
226 opcodes.c \
227 opcodes.h \
228 parse.c \
229 parse.h \
230 sqlite3.h
233 # Source code to the test files.
235 TESTSRC = \
236 $(TOP)/ext/fts3/fts3_term.c \
237 $(TOP)/ext/fts3/fts3_test.c \
238 $(TOP)/src/test1.c \
239 $(TOP)/src/test2.c \
240 $(TOP)/src/test3.c \
241 $(TOP)/src/test4.c \
242 $(TOP)/src/test5.c \
243 $(TOP)/src/test6.c \
244 $(TOP)/src/test7.c \
245 $(TOP)/src/test8.c \
246 $(TOP)/src/test9.c \
247 $(TOP)/src/test_autoext.c \
248 $(TOP)/src/test_async.c \
249 $(TOP)/src/test_backup.c \
250 $(TOP)/src/test_btree.c \
251 $(TOP)/src/test_config.c \
252 $(TOP)/src/test_demovfs.c \
253 $(TOP)/src/test_devsym.c \
254 $(TOP)/src/test_fs.c \
255 $(TOP)/src/test_func.c \
256 $(TOP)/src/test_hexio.c \
257 $(TOP)/src/test_init.c \
258 $(TOP)/src/test_intarray.c \
259 $(TOP)/src/test_journal.c \
260 $(TOP)/src/test_malloc.c \
261 $(TOP)/src/test_multiplex.c \
262 $(TOP)/src/test_mutex.c \
263 $(TOP)/src/test_onefile.c \
264 $(TOP)/src/test_osinst.c \
265 $(TOP)/src/test_pcache.c \
266 $(TOP)/src/test_quota.c \
267 $(TOP)/src/test_rtree.c \
268 $(TOP)/src/test_schema.c \
269 $(TOP)/src/test_server.c \
270 $(TOP)/src/test_stat.c \
271 $(TOP)/src/test_sqllog.c \
272 $(TOP)/src/test_superlock.c \
273 $(TOP)/src/test_syscall.c \
274 $(TOP)/src/test_tclvar.c \
275 $(TOP)/src/test_thread.c \
276 $(TOP)/src/test_vfs.c \
277 $(TOP)/src/test_wsd.c
279 # Extensions to be statically loaded.
281 TESTSRC += \
282 $(TOP)/ext/misc/amatch.c \
283 $(TOP)/ext/misc/closure.c \
284 $(TOP)/ext/misc/fileio.c \
285 $(TOP)/ext/misc/fuzzer.c \
286 $(TOP)/ext/misc/ieee754.c \
287 $(TOP)/ext/misc/nextchar.c \
288 $(TOP)/ext/misc/percentile.c \
289 $(TOP)/ext/misc/regexp.c \
290 $(TOP)/ext/misc/spellfix.c \
291 $(TOP)/ext/misc/totype.c \
292 $(TOP)/ext/misc/wholenumber.c \
293 $(TOP)/ext/misc/vfslog.c
296 #TESTSRC += $(TOP)/ext/fts2/fts2_tokenizer.c
297 #TESTSRC += $(TOP)/ext/fts3/fts3_tokenizer.c
299 TESTSRC2 = \
300 $(TOP)/src/attach.c \
301 $(TOP)/src/backup.c \
302 $(TOP)/src/btree.c \
303 $(TOP)/src/build.c \
304 $(TOP)/src/date.c \
305 $(TOP)/src/expr.c \
306 $(TOP)/src/func.c \
307 $(TOP)/src/insert.c \
308 $(TOP)/src/wal.c \
309 $(TOP)/src/main.c \
310 $(TOP)/src/mem5.c \
311 $(TOP)/src/os.c \
312 $(TOP)/src/os_unix.c \
313 $(TOP)/src/os_win.c \
314 $(TOP)/src/pager.c \
315 $(TOP)/src/pragma.c \
316 $(TOP)/src/prepare.c \
317 $(TOP)/src/printf.c \
318 $(TOP)/src/random.c \
319 $(TOP)/src/recover.c \
320 $(TOP)/src/pcache.c \
321 $(TOP)/src/pcache1.c \
322 $(TOP)/src/select.c \
323 $(TOP)/src/threads.c \
324 $(TOP)/src/tokenize.c \
325 $(TOP)/src/utf.c \
326 $(TOP)/src/util.c \
327 $(TOP)/src/vdbeapi.c \
328 $(TOP)/src/vdbeaux.c \
329 $(TOP)/src/vdbe.c \
330 $(TOP)/src/vdbemem.c \
331 $(TOP)/src/where.c \
332 parse.c \
333 $(TOP)/ext/fts3/fts3.c \
334 $(TOP)/ext/fts3/fts3_aux.c \
335 $(TOP)/ext/fts3/fts3_expr.c \
336 $(TOP)/ext/fts3/fts3_tokenizer.c \
337 $(TOP)/ext/fts3/fts3_write.c \
338 $(TOP)/ext/async/sqlite3async.c
340 # Header files used by all library source files.
342 HDR = \
343 $(TOP)/src/btree.h \
344 $(TOP)/src/btreeInt.h \
345 $(TOP)/src/hash.h \
346 $(TOP)/src/hwtime.h \
347 keywordhash.h \
348 $(TOP)/src/mutex.h \
349 opcodes.h \
350 $(TOP)/src/os.h \
351 $(TOP)/src/os_common.h \
352 $(TOP)/src/os_setup.h \
353 $(TOP)/src/os_win.h \
354 $(TOP)/src/pager.h \
355 $(TOP)/src/pcache.h \
356 parse.h \
357 sqlite3.h \
358 $(TOP)/src/sqlite3ext.h \
359 $(TOP)/src/sqliteInt.h \
360 $(TOP)/src/sqliteLimit.h \
361 $(TOP)/src/vdbe.h \
362 $(TOP)/src/vdbeInt.h \
363 $(TOP)/src/whereInt.h
365 # Header files used by extensions
367 EXTHDR += \
368 $(TOP)/ext/fts1/fts1.h \
369 $(TOP)/ext/fts1/fts1_hash.h \
370 $(TOP)/ext/fts1/fts1_tokenizer.h
371 EXTHDR += \
372 $(TOP)/ext/fts2/fts2.h \
373 $(TOP)/ext/fts2/fts2_hash.h \
374 $(TOP)/ext/fts2/fts2_tokenizer.h
375 EXTHDR += \
376 $(TOP)/ext/fts3/fts3.h \
377 $(TOP)/ext/fts3/fts3Int.h \
378 $(TOP)/ext/fts3/fts3_hash.h \
379 $(TOP)/ext/fts3/fts3_tokenizer.h
380 EXTHDR += \
381 $(TOP)/ext/rtree/rtree.h
382 EXTHDR += \
383 $(TOP)/ext/icu/sqliteicu.h
384 EXTHDR += \
385 $(TOP)/ext/userauth/sqlite3userauth.h
387 # This is the default Makefile target. The objects listed here
388 # are what get build when you type just "make" with no arguments.
390 all: sqlite3.h libsqlite3.a sqlite3$(EXE)
392 libsqlite3.a: $(LIBOBJ)
393 $(AR) libsqlite3.a $(LIBOBJ)
394 $(RANLIB) libsqlite3.a
396 sqlite3$(EXE): $(TOP)/src/shell.c libsqlite3.a sqlite3.h
397 $(TCCX) $(READLINE_FLAGS) -o sqlite3$(EXE) \
398 $(TOP)/src/shell.c $(SHELL_ICU) \
399 libsqlite3.a $(LIBREADLINE) $(TLIBS) $(THREADLIB)
401 mptester$(EXE): sqlite3.c $(TOP)/mptest/mptest.c
402 $(TCCX) -o $@ -I. $(TOP)/mptest/mptest.c sqlite3.c \
403 $(TLIBS) $(THREADLIB)
405 sqlite3.o: sqlite3.c
406 $(TCCX) -I. -c sqlite3.c
408 # This target creates a directory named "tsrc" and fills it with
409 # copies of all of the C source code and header files needed to
410 # build on the target system. Some of the C source code and header
411 # files are automatically generated. This target takes care of
412 # all that automatic generation.
414 target_source: $(SRC) $(TOP)/tool/vdbe-compress.tcl
415 rm -rf tsrc
416 mkdir tsrc
417 cp -f $(SRC) tsrc
418 rm tsrc/sqlite.h.in tsrc/parse.y
419 tclsh $(TOP)/tool/vdbe-compress.tcl $(OPTS) <tsrc/vdbe.c >vdbe.new
420 mv vdbe.new tsrc/vdbe.c
421 touch target_source
423 sqlite3.c: target_source $(TOP)/tool/mksqlite3c.tcl
424 tclsh $(TOP)/tool/mksqlite3c.tcl
425 cp tsrc/shell.c tsrc/sqlite3ext.h .
426 echo '#ifndef USE_SYSTEM_SQLITE' >tclsqlite3.c
427 cat sqlite3.c >>tclsqlite3.c
428 echo '#endif /* USE_SYSTEM_SQLITE */' >>tclsqlite3.c
429 cat $(TOP)/src/tclsqlite.c >>tclsqlite3.c
431 sqlite3.c-debug: target_source $(TOP)/tool/mksqlite3c.tcl
432 tclsh $(TOP)/tool/mksqlite3c.tcl --linemacros
433 echo '#ifndef USE_SYSTEM_SQLITE' >tclsqlite3.c
434 cat sqlite3.c >>tclsqlite3.c
435 echo '#endif /* USE_SYSTEM_SQLITE */' >>tclsqlite3.c
436 echo '#line 1 "tclsqlite.c"' >>tclsqlite3.c
437 cat $(TOP)/src/tclsqlite.c >>tclsqlite3.c
439 sqlite3-all.c: sqlite3.c $(TOP)/tool/split-sqlite3c.tcl
440 tclsh $(TOP)/tool/split-sqlite3c.tcl
442 fts2amal.c: target_source $(TOP)/ext/fts2/mkfts2amal.tcl
443 tclsh $(TOP)/ext/fts2/mkfts2amal.tcl
445 fts3amal.c: target_source $(TOP)/ext/fts3/mkfts3amal.tcl
446 tclsh $(TOP)/ext/fts3/mkfts3amal.tcl
448 # Rules to build the LEMON compiler generator
450 lemon: $(TOP)/tool/lemon.c $(TOP)/src/lempar.c
451 $(BCC) -o lemon $(TOP)/tool/lemon.c
452 cp $(TOP)/src/lempar.c .
454 # Rules to build individual *.o files from generated *.c files. This
455 # applies to:
457 # parse.o
458 # opcodes.o
460 %.o: %.c $(HDR)
461 $(TCCX) -c $<
463 # Rules to build individual *.o files from files in the src directory.
465 %.o: $(TOP)/src/%.c $(HDR)
466 $(TCCX) -c $<
468 tclsqlite.o: $(TOP)/src/tclsqlite.c $(HDR)
469 $(TCCX) $(TCL_FLAGS) -c $(TOP)/src/tclsqlite.c
473 # Rules to build opcodes.c and opcodes.h
475 opcodes.c: opcodes.h $(TOP)/mkopcodec.awk
476 $(NAWK) -f $(TOP)/mkopcodec.awk opcodes.h >opcodes.c
478 opcodes.h: parse.h $(TOP)/src/vdbe.c $(TOP)/mkopcodeh.awk
479 cat parse.h $(TOP)/src/vdbe.c | \
480 $(NAWK) -f $(TOP)/mkopcodeh.awk >opcodes.h
482 # Rules to build parse.c and parse.h - the outputs of lemon.
484 parse.h: parse.c
486 parse.c: $(TOP)/src/parse.y lemon $(TOP)/addopcodes.awk
487 cp $(TOP)/src/parse.y .
488 rm -f parse.h
489 ./lemon $(OPTS) parse.y
490 mv parse.h parse.h.temp
491 $(NAWK) -f $(TOP)/addopcodes.awk parse.h.temp >parse.h
493 sqlite3.h: $(TOP)/src/sqlite.h.in $(TOP)/manifest.uuid $(TOP)/VERSION $(TOP)/ext/rtree/sqlite3rtree.h
494 tclsh $(TOP)/tool/mksqlite3h.tcl $(TOP) >sqlite3.h
496 keywordhash.h: $(TOP)/tool/mkkeywordhash.c
497 $(BCC) -o mkkeywordhash $(OPTS) $(TOP)/tool/mkkeywordhash.c
498 ./mkkeywordhash >keywordhash.h
502 # Rules to build the extension objects.
504 icu.o: $(TOP)/ext/icu/icu.c $(HDR) $(EXTHDR)
505 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/icu/icu.c
507 fts2.o: $(TOP)/ext/fts2/fts2.c $(HDR) $(EXTHDR)
508 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2.c
510 fts2_hash.o: $(TOP)/ext/fts2/fts2_hash.c $(HDR) $(EXTHDR)
511 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_hash.c
513 fts2_icu.o: $(TOP)/ext/fts2/fts2_icu.c $(HDR) $(EXTHDR)
514 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_icu.c
516 fts2_porter.o: $(TOP)/ext/fts2/fts2_porter.c $(HDR) $(EXTHDR)
517 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_porter.c
519 fts2_tokenizer.o: $(TOP)/ext/fts2/fts2_tokenizer.c $(HDR) $(EXTHDR)
520 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_tokenizer.c
522 fts2_tokenizer1.o: $(TOP)/ext/fts2/fts2_tokenizer1.c $(HDR) $(EXTHDR)
523 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_tokenizer1.c
525 fts3.o: $(TOP)/ext/fts3/fts3.c $(HDR) $(EXTHDR)
526 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3.c
528 fts3_aux.o: $(TOP)/ext/fts3/fts3_aux.c $(HDR) $(EXTHDR)
529 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_aux.c
531 fts3_expr.o: $(TOP)/ext/fts3/fts3_expr.c $(HDR) $(EXTHDR)
532 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_expr.c
534 fts3_hash.o: $(TOP)/ext/fts3/fts3_hash.c $(HDR) $(EXTHDR)
535 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_hash.c
537 fts3_icu.o: $(TOP)/ext/fts3/fts3_icu.c $(HDR) $(EXTHDR)
538 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_icu.c
540 fts3_snippet.o: $(TOP)/ext/fts3/fts3_snippet.c $(HDR) $(EXTHDR)
541 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_snippet.c
543 fts3_porter.o: $(TOP)/ext/fts3/fts3_porter.c $(HDR) $(EXTHDR)
544 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_porter.c
546 fts3_tokenizer.o: $(TOP)/ext/fts3/fts3_tokenizer.c $(HDR) $(EXTHDR)
547 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer.c
549 fts3_tokenizer1.o: $(TOP)/ext/fts3/fts3_tokenizer1.c $(HDR) $(EXTHDR)
550 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer1.c
552 fts3_tokenize_vtab.o: $(TOP)/ext/fts3/fts3_tokenize_vtab.c $(HDR) $(EXTHDR)
553 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenize_vtab.c
555 fts3_unicode.o: $(TOP)/ext/fts3/fts3_unicode.c $(HDR) $(EXTHDR)
556 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_unicode.c
558 fts3_unicode2.o: $(TOP)/ext/fts3/fts3_unicode2.c $(HDR) $(EXTHDR)
559 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_unicode2.c
561 fts3_write.o: $(TOP)/ext/fts3/fts3_write.c $(HDR) $(EXTHDR)
562 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_write.c
564 rtree.o: $(TOP)/ext/rtree/rtree.c $(HDR) $(EXTHDR)
565 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/rtree/rtree.c
567 userauth.o: $(TOP)/ext/userauth/userauth.c $(HDR) $(EXTHDR)
568 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/userauth/userauth.c
571 # Rules for building test programs and for running tests
573 tclsqlite3: $(TOP)/src/tclsqlite.c libsqlite3.a
574 $(TCCX) $(TCL_FLAGS) -DTCLSH=1 -o tclsqlite3 \
575 $(TOP)/src/tclsqlite.c libsqlite3.a $(LIBTCL) $(THREADLIB)
577 sqlite3_analyzer.c: sqlite3.c $(TOP)/src/test_stat.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl
578 echo "#define TCLSH 2" > $@
579 cat sqlite3.c $(TOP)/src/test_stat.c $(TOP)/src/tclsqlite.c >> $@
580 echo "static const char *tclsh_main_loop(void){" >> $@
581 echo "static const char *zMainloop = " >> $@
582 $(NAWK) -f $(TOP)/tool/tostr.awk $(TOP)/tool/spaceanal.tcl >> $@
583 echo "; return zMainloop; }" >> $@
585 sqlite3_analyzer$(EXE): sqlite3_analyzer.c
586 $(TCCX) $(TCL_FLAGS) sqlite3_analyzer.c -o $@ $(LIBTCL) $(THREADLIB)
588 # Rules to build the 'testfixture' application.
590 TESTFIXTURE_FLAGS = -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
591 TESTFIXTURE_FLAGS += -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE
593 testfixture$(EXE): $(TESTSRC2) libsqlite3.a $(TESTSRC) $(TOP)/src/tclsqlite.c
594 $(TCCX) $(TCL_FLAGS) -DTCLSH=1 $(TESTFIXTURE_FLAGS) \
595 $(TESTSRC) $(TESTSRC2) $(TOP)/src/tclsqlite.c \
596 -o testfixture$(EXE) $(LIBTCL) libsqlite3.a $(THREADLIB) $(TLIBS)
598 amalgamation-testfixture$(EXE): sqlite3.c $(TESTSRC) $(TOP)/src/tclsqlite.c
599 $(TCCX) $(TCL_FLAGS) -DTCLSH=1 $(TESTFIXTURE_FLAGS) \
600 $(TESTSRC) $(TOP)/src/tclsqlite.c sqlite3.c \
601 -o testfixture$(EXE) $(LIBTCL) $(THREADLIB)
603 fts3-testfixture$(EXE): sqlite3.c fts3amal.c $(TESTSRC) $(TOP)/src/tclsqlite.c
604 $(TCCX) $(TCL_FLAGS) -DTCLSH=1 $(TESTFIXTURE_FLAGS) \
605 -DSQLITE_ENABLE_FTS3=1 \
606 $(TESTSRC) $(TOP)/src/tclsqlite.c sqlite3.c fts3amal.c \
607 -o testfixture$(EXE) $(LIBTCL) $(THREADLIB)
609 fulltest: testfixture$(EXE) sqlite3$(EXE)
610 ./testfixture$(EXE) $(TOP)/test/all.test
612 soaktest: testfixture$(EXE) sqlite3$(EXE)
613 ./testfixture$(EXE) $(TOP)/test/all.test -soak=1
615 fulltestonly: testfixture$(EXE) sqlite3$(EXE)
616 ./testfixture$(EXE) $(TOP)/test/full.test
618 queryplantest: testfixture$(EXE) sqlite3$(EXE)
619 ./testfixture$(EXE) $(TOP)/test/permutations.test queryplanner
621 test: testfixture$(EXE) sqlite3$(EXE)
622 ./testfixture$(EXE) $(TOP)/test/veryquick.test
624 # The next two rules are used to support the "threadtest" target. Building
625 # threadtest runs a few thread-safety tests that are implemented in C. This
626 # target is invoked by the releasetest.tcl script.
628 threadtest3$(EXE): sqlite3.o $(TOP)/test/threadtest3.c $(TOP)/test/tt3_checkpoint.c
629 $(TCCX) -O2 sqlite3.o $(TOP)/test/threadtest3.c \
630 -o threadtest3$(EXE) $(THREADLIB)
632 threadtest: threadtest3$(EXE)
633 ./threadtest3$(EXE)
635 TEST_EXTENSION = $(SHPREFIX)testloadext.$(SO)
636 $(TEST_EXTENSION): $(TOP)/src/test_loadext.c
637 $(MKSHLIB) $(TOP)/src/test_loadext.c -o $(TEST_EXTENSION)
639 extensiontest: testfixture$(EXE) $(TEST_EXTENSION)
640 ./testfixture$(EXE) $(TOP)/test/loadext.test
642 showdb$(EXE): $(TOP)/tool/showdb.c sqlite3.o
643 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o showdb$(EXE) \
644 $(TOP)/tool/showdb.c sqlite3.o $(THREADLIB)
646 showstat4$(EXE): $(TOP)/tool/showstat4.c sqlite3.o
647 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o showstat4$(EXE) \
648 $(TOP)/tool/showstat4.c sqlite3.o $(THREADLIB)
650 showjournal$(EXE): $(TOP)/tool/showjournal.c sqlite3.o
651 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o showjournal$(EXE) \
652 $(TOP)/tool/showjournal.c sqlite3.o $(THREADLIB)
654 showwal$(EXE): $(TOP)/tool/showwal.c sqlite3.o
655 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o showwal$(EXE) \
656 $(TOP)/tool/showwal.c sqlite3.o $(THREADLIB)
658 fts3view$(EXE): $(TOP)/ext/fts3/tool/fts3view.c sqlite3.o
659 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o fts3view$(EXE) \
660 $(TOP)/ext/fts3/tool/fts3view.c sqlite3.o $(THREADLIB)
662 rollback-test$(EXE): $(TOP)/tool/rollback-test.c sqlite3.o
663 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o rollback-test$(EXE) \
664 $(TOP)/tool/rollback-test.c sqlite3.o $(THREADLIB)
666 LogEst$(EXE): $(TOP)/tool/logest.c sqlite3.h
667 $(TCC) -o LogEst$(EXE) $(TOP)/tool/logest.c
669 wordcount$(EXE): $(TOP)/test/wordcount.c sqlite3.c
670 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o wordcount$(EXE) \
671 $(TOP)/test/wordcount.c sqlite3.c
673 speedtest1$(EXE): $(TOP)/test/speedtest1.c sqlite3.o
674 $(TCC) -I. -o speedtest1$(EXE) $(TOP)/test/speedtest1.c sqlite3.o $(THREADLIB)
676 # This target will fail if the SQLite amalgamation contains any exported
677 # symbols that do not begin with "sqlite3_". It is run as part of the
678 # releasetest.tcl script.
680 checksymbols: sqlite3.o
681 nm -g --defined-only sqlite3.o | grep -v " sqlite3_" ; test $$? -ne 0
683 # Build the amalgamation-autoconf package.
685 dist: sqlite3.c
686 TOP=$(TOP) sh $(TOP)/tool/mkautoconfamal.sh
689 # Standard install and cleanup targets
691 install: sqlite3 libsqlite3.a sqlite3.h
692 mv sqlite3 /usr/bin
693 mv libsqlite3.a /usr/lib
694 mv sqlite3.h /usr/include
696 clean:
697 rm -f *.o sqlite3 sqlite3.exe libsqlite3.a sqlite3.h opcodes.*
698 rm -f lemon lemon.exe lempar.c parse.* sqlite*.tar.gz
699 rm -f mkkeywordhash mkkeywordhash.exe keywordhash.h
700 rm -f $(PUBLISH)
701 rm -f *.da *.bb *.bbg gmon.out
702 rm -rf quota2a quota2b quota2c
703 rm -rf tsrc target_source
704 rm -f testloadext.dll libtestloadext.so
705 rm -f amalgamation-testfixture amalgamation-testfixture.exe
706 rm -f fts3-testfixture fts3-testfixture.exe
707 rm -f testfixture testfixture.exe
708 rm -f threadtest3 threadtest3.exe
709 rm -f LogEst LogEst.exe
710 rm -f fts3view fts3view.exe
711 rm -f rollback-test rollback-test.exe
712 rm -f showdb showdb.exe
713 rm -f showjournal showjournal.exe
714 rm -f showstat4 showstat4.exe
715 rm -f showwal showwal.exe
716 rm -f speedtest1 speedtest1.exe
717 rm -f wordcount wordcount.exe
718 rm -f sqlite3.c sqlite3-*.c fts?amal.c tclsqlite3.c
719 rm -f sqlite3rc.h
720 rm -f shell.c sqlite3ext.h
721 rm -f sqlite3_analyzer sqlite3_analyzer.exe sqlite3_analyzer.c
722 rm -f sqlite-*-output.vsix
723 rm -f mptester mptester.exe