Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / sqlite / sqlite-src-3080704 / main.mk
blob4a7ac02710bf841c6ca4a4976e13cdfaf42f935f
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 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/resolve.c \
139 $(TOP)/src/rowset.c \
140 $(TOP)/src/select.c \
141 $(TOP)/src/status.c \
142 $(TOP)/src/shell.c \
143 $(TOP)/src/sqlite.h.in \
144 $(TOP)/src/sqlite3ext.h \
145 $(TOP)/src/sqliteInt.h \
146 $(TOP)/src/sqliteLimit.h \
147 $(TOP)/src/table.c \
148 $(TOP)/src/tclsqlite.c \
149 $(TOP)/src/threads.c \
150 $(TOP)/src/tokenize.c \
151 $(TOP)/src/trigger.c \
152 $(TOP)/src/utf.c \
153 $(TOP)/src/update.c \
154 $(TOP)/src/util.c \
155 $(TOP)/src/vacuum.c \
156 $(TOP)/src/vdbe.c \
157 $(TOP)/src/vdbe.h \
158 $(TOP)/src/vdbeapi.c \
159 $(TOP)/src/vdbeaux.c \
160 $(TOP)/src/vdbeblob.c \
161 $(TOP)/src/vdbemem.c \
162 $(TOP)/src/vdbesort.c \
163 $(TOP)/src/vdbetrace.c \
164 $(TOP)/src/vdbeInt.h \
165 $(TOP)/src/vtab.c \
166 $(TOP)/src/wal.c \
167 $(TOP)/src/wal.h \
168 $(TOP)/src/walker.c \
169 $(TOP)/src/where.c \
170 $(TOP)/src/whereInt.h
172 # Source code for extensions
174 SRC += \
175 $(TOP)/ext/fts1/fts1.c \
176 $(TOP)/ext/fts1/fts1.h \
177 $(TOP)/ext/fts1/fts1_hash.c \
178 $(TOP)/ext/fts1/fts1_hash.h \
179 $(TOP)/ext/fts1/fts1_porter.c \
180 $(TOP)/ext/fts1/fts1_tokenizer.h \
181 $(TOP)/ext/fts1/fts1_tokenizer1.c
182 SRC += \
183 $(TOP)/ext/fts2/fts2.c \
184 $(TOP)/ext/fts2/fts2.h \
185 $(TOP)/ext/fts2/fts2_hash.c \
186 $(TOP)/ext/fts2/fts2_hash.h \
187 $(TOP)/ext/fts2/fts2_icu.c \
188 $(TOP)/ext/fts2/fts2_porter.c \
189 $(TOP)/ext/fts2/fts2_tokenizer.h \
190 $(TOP)/ext/fts2/fts2_tokenizer.c \
191 $(TOP)/ext/fts2/fts2_tokenizer1.c
192 SRC += \
193 $(TOP)/ext/fts3/fts3.c \
194 $(TOP)/ext/fts3/fts3.h \
195 $(TOP)/ext/fts3/fts3Int.h \
196 $(TOP)/ext/fts3/fts3_aux.c \
197 $(TOP)/ext/fts3/fts3_expr.c \
198 $(TOP)/ext/fts3/fts3_hash.c \
199 $(TOP)/ext/fts3/fts3_hash.h \
200 $(TOP)/ext/fts3/fts3_icu.c \
201 $(TOP)/ext/fts3/fts3_porter.c \
202 $(TOP)/ext/fts3/fts3_snippet.c \
203 $(TOP)/ext/fts3/fts3_tokenizer.h \
204 $(TOP)/ext/fts3/fts3_tokenizer.c \
205 $(TOP)/ext/fts3/fts3_tokenizer1.c \
206 $(TOP)/ext/fts3/fts3_tokenize_vtab.c \
207 $(TOP)/ext/fts3/fts3_unicode.c \
208 $(TOP)/ext/fts3/fts3_unicode2.c \
209 $(TOP)/ext/fts3/fts3_write.c
210 SRC += \
211 $(TOP)/ext/icu/sqliteicu.h \
212 $(TOP)/ext/icu/icu.c
213 SRC += \
214 $(TOP)/ext/rtree/sqlite3rtree.h \
215 $(TOP)/ext/rtree/rtree.h \
216 $(TOP)/ext/rtree/rtree.c
217 SRC += \
218 $(TOP)/ext/userauth/userauth.c \
219 $(TOP)/ext/userauth/sqlite3userauth.h
221 # Generated source code files
223 SRC += \
224 keywordhash.h \
225 opcodes.c \
226 opcodes.h \
227 parse.c \
228 parse.h \
229 sqlite3.h
232 # Source code to the test files.
234 TESTSRC = \
235 $(TOP)/ext/fts3/fts3_term.c \
236 $(TOP)/ext/fts3/fts3_test.c \
237 $(TOP)/src/test1.c \
238 $(TOP)/src/test2.c \
239 $(TOP)/src/test3.c \
240 $(TOP)/src/test4.c \
241 $(TOP)/src/test5.c \
242 $(TOP)/src/test6.c \
243 $(TOP)/src/test7.c \
244 $(TOP)/src/test8.c \
245 $(TOP)/src/test9.c \
246 $(TOP)/src/test_autoext.c \
247 $(TOP)/src/test_async.c \
248 $(TOP)/src/test_backup.c \
249 $(TOP)/src/test_btree.c \
250 $(TOP)/src/test_config.c \
251 $(TOP)/src/test_demovfs.c \
252 $(TOP)/src/test_devsym.c \
253 $(TOP)/src/test_fs.c \
254 $(TOP)/src/test_func.c \
255 $(TOP)/src/test_hexio.c \
256 $(TOP)/src/test_init.c \
257 $(TOP)/src/test_intarray.c \
258 $(TOP)/src/test_journal.c \
259 $(TOP)/src/test_malloc.c \
260 $(TOP)/src/test_multiplex.c \
261 $(TOP)/src/test_mutex.c \
262 $(TOP)/src/test_onefile.c \
263 $(TOP)/src/test_osinst.c \
264 $(TOP)/src/test_pcache.c \
265 $(TOP)/src/test_quota.c \
266 $(TOP)/src/test_rtree.c \
267 $(TOP)/src/test_schema.c \
268 $(TOP)/src/test_server.c \
269 $(TOP)/src/test_stat.c \
270 $(TOP)/src/test_sqllog.c \
271 $(TOP)/src/test_superlock.c \
272 $(TOP)/src/test_syscall.c \
273 $(TOP)/src/test_tclvar.c \
274 $(TOP)/src/test_thread.c \
275 $(TOP)/src/test_vfs.c \
276 $(TOP)/src/test_wsd.c
278 # Extensions to be statically loaded.
280 TESTSRC += \
281 $(TOP)/ext/misc/amatch.c \
282 $(TOP)/ext/misc/closure.c \
283 $(TOP)/ext/misc/fileio.c \
284 $(TOP)/ext/misc/fuzzer.c \
285 $(TOP)/ext/misc/ieee754.c \
286 $(TOP)/ext/misc/nextchar.c \
287 $(TOP)/ext/misc/percentile.c \
288 $(TOP)/ext/misc/regexp.c \
289 $(TOP)/ext/misc/spellfix.c \
290 $(TOP)/ext/misc/totype.c \
291 $(TOP)/ext/misc/wholenumber.c \
292 $(TOP)/ext/misc/vfslog.c
295 #TESTSRC += $(TOP)/ext/fts2/fts2_tokenizer.c
296 #TESTSRC += $(TOP)/ext/fts3/fts3_tokenizer.c
298 TESTSRC2 = \
299 $(TOP)/src/attach.c \
300 $(TOP)/src/backup.c \
301 $(TOP)/src/btree.c \
302 $(TOP)/src/build.c \
303 $(TOP)/src/date.c \
304 $(TOP)/src/expr.c \
305 $(TOP)/src/func.c \
306 $(TOP)/src/insert.c \
307 $(TOP)/src/wal.c \
308 $(TOP)/src/main.c \
309 $(TOP)/src/mem5.c \
310 $(TOP)/src/os.c \
311 $(TOP)/src/os_unix.c \
312 $(TOP)/src/os_win.c \
313 $(TOP)/src/pager.c \
314 $(TOP)/src/pragma.c \
315 $(TOP)/src/prepare.c \
316 $(TOP)/src/printf.c \
317 $(TOP)/src/random.c \
318 $(TOP)/src/pcache.c \
319 $(TOP)/src/pcache1.c \
320 $(TOP)/src/select.c \
321 $(TOP)/src/threads.c \
322 $(TOP)/src/tokenize.c \
323 $(TOP)/src/utf.c \
324 $(TOP)/src/util.c \
325 $(TOP)/src/vdbeapi.c \
326 $(TOP)/src/vdbeaux.c \
327 $(TOP)/src/vdbe.c \
328 $(TOP)/src/vdbemem.c \
329 $(TOP)/src/where.c \
330 parse.c \
331 $(TOP)/ext/fts3/fts3.c \
332 $(TOP)/ext/fts3/fts3_aux.c \
333 $(TOP)/ext/fts3/fts3_expr.c \
334 $(TOP)/ext/fts3/fts3_tokenizer.c \
335 $(TOP)/ext/fts3/fts3_write.c \
336 $(TOP)/ext/async/sqlite3async.c
338 # Header files used by all library source files.
340 HDR = \
341 $(TOP)/src/btree.h \
342 $(TOP)/src/btreeInt.h \
343 $(TOP)/src/hash.h \
344 $(TOP)/src/hwtime.h \
345 keywordhash.h \
346 $(TOP)/src/mutex.h \
347 opcodes.h \
348 $(TOP)/src/os.h \
349 $(TOP)/src/os_common.h \
350 $(TOP)/src/os_setup.h \
351 $(TOP)/src/os_win.h \
352 $(TOP)/src/pager.h \
353 $(TOP)/src/pcache.h \
354 parse.h \
355 sqlite3.h \
356 $(TOP)/src/sqlite3ext.h \
357 $(TOP)/src/sqliteInt.h \
358 $(TOP)/src/sqliteLimit.h \
359 $(TOP)/src/vdbe.h \
360 $(TOP)/src/vdbeInt.h \
361 $(TOP)/src/whereInt.h
363 # Header files used by extensions
365 EXTHDR += \
366 $(TOP)/ext/fts1/fts1.h \
367 $(TOP)/ext/fts1/fts1_hash.h \
368 $(TOP)/ext/fts1/fts1_tokenizer.h
369 EXTHDR += \
370 $(TOP)/ext/fts2/fts2.h \
371 $(TOP)/ext/fts2/fts2_hash.h \
372 $(TOP)/ext/fts2/fts2_tokenizer.h
373 EXTHDR += \
374 $(TOP)/ext/fts3/fts3.h \
375 $(TOP)/ext/fts3/fts3Int.h \
376 $(TOP)/ext/fts3/fts3_hash.h \
377 $(TOP)/ext/fts3/fts3_tokenizer.h
378 EXTHDR += \
379 $(TOP)/ext/rtree/rtree.h
380 EXTHDR += \
381 $(TOP)/ext/icu/sqliteicu.h
382 EXTHDR += \
383 $(TOP)/ext/userauth/sqlite3userauth.h
385 # This is the default Makefile target. The objects listed here
386 # are what get build when you type just "make" with no arguments.
388 all: sqlite3.h libsqlite3.a sqlite3$(EXE)
390 libsqlite3.a: $(LIBOBJ)
391 $(AR) libsqlite3.a $(LIBOBJ)
392 $(RANLIB) libsqlite3.a
394 sqlite3$(EXE): $(TOP)/src/shell.c libsqlite3.a sqlite3.h
395 $(TCCX) $(READLINE_FLAGS) -o sqlite3$(EXE) \
396 $(TOP)/src/shell.c \
397 libsqlite3.a $(LIBREADLINE) $(TLIBS) $(THREADLIB)
399 mptester$(EXE): sqlite3.c $(TOP)/mptest/mptest.c
400 $(TCCX) -o $@ -I. $(TOP)/mptest/mptest.c sqlite3.c \
401 $(TLIBS) $(THREADLIB)
403 sqlite3.o: sqlite3.c
404 $(TCCX) -I. -c sqlite3.c
406 # This target creates a directory named "tsrc" and fills it with
407 # copies of all of the C source code and header files needed to
408 # build on the target system. Some of the C source code and header
409 # files are automatically generated. This target takes care of
410 # all that automatic generation.
412 target_source: $(SRC) $(TOP)/tool/vdbe-compress.tcl
413 rm -rf tsrc
414 mkdir tsrc
415 cp -f $(SRC) tsrc
416 rm tsrc/sqlite.h.in tsrc/parse.y
417 tclsh $(TOP)/tool/vdbe-compress.tcl $(OPTS) <tsrc/vdbe.c >vdbe.new
418 mv vdbe.new tsrc/vdbe.c
419 touch target_source
421 sqlite3.c: target_source $(TOP)/tool/mksqlite3c.tcl
422 tclsh $(TOP)/tool/mksqlite3c.tcl
423 cp tsrc/shell.c tsrc/sqlite3ext.h .
424 echo '#ifndef USE_SYSTEM_SQLITE' >tclsqlite3.c
425 cat sqlite3.c >>tclsqlite3.c
426 echo '#endif /* USE_SYSTEM_SQLITE */' >>tclsqlite3.c
427 cat $(TOP)/src/tclsqlite.c >>tclsqlite3.c
429 sqlite3.c-debug: target_source $(TOP)/tool/mksqlite3c.tcl
430 tclsh $(TOP)/tool/mksqlite3c.tcl --linemacros
431 echo '#ifndef USE_SYSTEM_SQLITE' >tclsqlite3.c
432 cat sqlite3.c >>tclsqlite3.c
433 echo '#endif /* USE_SYSTEM_SQLITE */' >>tclsqlite3.c
434 echo '#line 1 "tclsqlite.c"' >>tclsqlite3.c
435 cat $(TOP)/src/tclsqlite.c >>tclsqlite3.c
437 sqlite3-all.c: sqlite3.c $(TOP)/tool/split-sqlite3c.tcl
438 tclsh $(TOP)/tool/split-sqlite3c.tcl
440 fts2amal.c: target_source $(TOP)/ext/fts2/mkfts2amal.tcl
441 tclsh $(TOP)/ext/fts2/mkfts2amal.tcl
443 fts3amal.c: target_source $(TOP)/ext/fts3/mkfts3amal.tcl
444 tclsh $(TOP)/ext/fts3/mkfts3amal.tcl
446 # Rules to build the LEMON compiler generator
448 lemon: $(TOP)/tool/lemon.c $(TOP)/src/lempar.c
449 $(BCC) -o lemon $(TOP)/tool/lemon.c
450 cp $(TOP)/src/lempar.c .
452 # Rules to build individual *.o files from generated *.c files. This
453 # applies to:
455 # parse.o
456 # opcodes.o
458 %.o: %.c $(HDR)
459 $(TCCX) -c $<
461 # Rules to build individual *.o files from files in the src directory.
463 %.o: $(TOP)/src/%.c $(HDR)
464 $(TCCX) -c $<
466 tclsqlite.o: $(TOP)/src/tclsqlite.c $(HDR)
467 $(TCCX) $(TCL_FLAGS) -c $(TOP)/src/tclsqlite.c
471 # Rules to build opcodes.c and opcodes.h
473 opcodes.c: opcodes.h $(TOP)/mkopcodec.awk
474 $(NAWK) -f $(TOP)/mkopcodec.awk opcodes.h >opcodes.c
476 opcodes.h: parse.h $(TOP)/src/vdbe.c $(TOP)/mkopcodeh.awk
477 cat parse.h $(TOP)/src/vdbe.c | \
478 $(NAWK) -f $(TOP)/mkopcodeh.awk >opcodes.h
480 # Rules to build parse.c and parse.h - the outputs of lemon.
482 parse.h: parse.c
484 parse.c: $(TOP)/src/parse.y lemon $(TOP)/addopcodes.awk
485 cp $(TOP)/src/parse.y .
486 rm -f parse.h
487 ./lemon $(OPTS) parse.y
488 mv parse.h parse.h.temp
489 $(NAWK) -f $(TOP)/addopcodes.awk parse.h.temp >parse.h
491 sqlite3.h: $(TOP)/src/sqlite.h.in $(TOP)/manifest.uuid $(TOP)/VERSION $(TOP)/ext/rtree/sqlite3rtree.h
492 tclsh $(TOP)/tool/mksqlite3h.tcl $(TOP) >sqlite3.h
494 keywordhash.h: $(TOP)/tool/mkkeywordhash.c
495 $(BCC) -o mkkeywordhash $(OPTS) $(TOP)/tool/mkkeywordhash.c
496 ./mkkeywordhash >keywordhash.h
500 # Rules to build the extension objects.
502 icu.o: $(TOP)/ext/icu/icu.c $(HDR) $(EXTHDR)
503 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/icu/icu.c
505 fts2.o: $(TOP)/ext/fts2/fts2.c $(HDR) $(EXTHDR)
506 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2.c
508 fts2_hash.o: $(TOP)/ext/fts2/fts2_hash.c $(HDR) $(EXTHDR)
509 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_hash.c
511 fts2_icu.o: $(TOP)/ext/fts2/fts2_icu.c $(HDR) $(EXTHDR)
512 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_icu.c
514 fts2_porter.o: $(TOP)/ext/fts2/fts2_porter.c $(HDR) $(EXTHDR)
515 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_porter.c
517 fts2_tokenizer.o: $(TOP)/ext/fts2/fts2_tokenizer.c $(HDR) $(EXTHDR)
518 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_tokenizer.c
520 fts2_tokenizer1.o: $(TOP)/ext/fts2/fts2_tokenizer1.c $(HDR) $(EXTHDR)
521 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_tokenizer1.c
523 fts3.o: $(TOP)/ext/fts3/fts3.c $(HDR) $(EXTHDR)
524 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3.c
526 fts3_aux.o: $(TOP)/ext/fts3/fts3_aux.c $(HDR) $(EXTHDR)
527 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_aux.c
529 fts3_expr.o: $(TOP)/ext/fts3/fts3_expr.c $(HDR) $(EXTHDR)
530 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_expr.c
532 fts3_hash.o: $(TOP)/ext/fts3/fts3_hash.c $(HDR) $(EXTHDR)
533 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_hash.c
535 fts3_icu.o: $(TOP)/ext/fts3/fts3_icu.c $(HDR) $(EXTHDR)
536 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_icu.c
538 fts3_snippet.o: $(TOP)/ext/fts3/fts3_snippet.c $(HDR) $(EXTHDR)
539 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_snippet.c
541 fts3_porter.o: $(TOP)/ext/fts3/fts3_porter.c $(HDR) $(EXTHDR)
542 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_porter.c
544 fts3_tokenizer.o: $(TOP)/ext/fts3/fts3_tokenizer.c $(HDR) $(EXTHDR)
545 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer.c
547 fts3_tokenizer1.o: $(TOP)/ext/fts3/fts3_tokenizer1.c $(HDR) $(EXTHDR)
548 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer1.c
550 fts3_tokenize_vtab.o: $(TOP)/ext/fts3/fts3_tokenize_vtab.c $(HDR) $(EXTHDR)
551 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenize_vtab.c
553 fts3_unicode.o: $(TOP)/ext/fts3/fts3_unicode.c $(HDR) $(EXTHDR)
554 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_unicode.c
556 fts3_unicode2.o: $(TOP)/ext/fts3/fts3_unicode2.c $(HDR) $(EXTHDR)
557 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_unicode2.c
559 fts3_write.o: $(TOP)/ext/fts3/fts3_write.c $(HDR) $(EXTHDR)
560 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_write.c
562 rtree.o: $(TOP)/ext/rtree/rtree.c $(HDR) $(EXTHDR)
563 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/rtree/rtree.c
565 userauth.o: $(TOP)/ext/userauth/userauth.c $(HDR) $(EXTHDR)
566 $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/userauth/userauth.c
569 # Rules for building test programs and for running tests
571 tclsqlite3: $(TOP)/src/tclsqlite.c libsqlite3.a
572 $(TCCX) $(TCL_FLAGS) -DTCLSH=1 -o tclsqlite3 \
573 $(TOP)/src/tclsqlite.c libsqlite3.a $(LIBTCL) $(THREADLIB)
575 sqlite3_analyzer.c: sqlite3.c $(TOP)/src/test_stat.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl
576 echo "#define TCLSH 2" > $@
577 cat sqlite3.c $(TOP)/src/test_stat.c $(TOP)/src/tclsqlite.c >> $@
578 echo "static const char *tclsh_main_loop(void){" >> $@
579 echo "static const char *zMainloop = " >> $@
580 $(NAWK) -f $(TOP)/tool/tostr.awk $(TOP)/tool/spaceanal.tcl >> $@
581 echo "; return zMainloop; }" >> $@
583 sqlite3_analyzer$(EXE): sqlite3_analyzer.c
584 $(TCCX) $(TCL_FLAGS) sqlite3_analyzer.c -o $@ $(LIBTCL) $(THREADLIB)
586 # Rules to build the 'testfixture' application.
588 TESTFIXTURE_FLAGS = -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
589 TESTFIXTURE_FLAGS += -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE
591 testfixture$(EXE): $(TESTSRC2) libsqlite3.a $(TESTSRC) $(TOP)/src/tclsqlite.c
592 $(TCCX) $(TCL_FLAGS) -DTCLSH=1 $(TESTFIXTURE_FLAGS) \
593 $(TESTSRC) $(TESTSRC2) $(TOP)/src/tclsqlite.c \
594 -o testfixture$(EXE) $(LIBTCL) libsqlite3.a $(THREADLIB)
596 amalgamation-testfixture$(EXE): sqlite3.c $(TESTSRC) $(TOP)/src/tclsqlite.c
597 $(TCCX) $(TCL_FLAGS) -DTCLSH=1 $(TESTFIXTURE_FLAGS) \
598 $(TESTSRC) $(TOP)/src/tclsqlite.c sqlite3.c \
599 -o testfixture$(EXE) $(LIBTCL) $(THREADLIB)
601 fts3-testfixture$(EXE): sqlite3.c fts3amal.c $(TESTSRC) $(TOP)/src/tclsqlite.c
602 $(TCCX) $(TCL_FLAGS) -DTCLSH=1 $(TESTFIXTURE_FLAGS) \
603 -DSQLITE_ENABLE_FTS3=1 \
604 $(TESTSRC) $(TOP)/src/tclsqlite.c sqlite3.c fts3amal.c \
605 -o testfixture$(EXE) $(LIBTCL) $(THREADLIB)
607 fulltest: testfixture$(EXE) sqlite3$(EXE)
608 ./testfixture$(EXE) $(TOP)/test/all.test
610 soaktest: testfixture$(EXE) sqlite3$(EXE)
611 ./testfixture$(EXE) $(TOP)/test/all.test -soak=1
613 fulltestonly: testfixture$(EXE) sqlite3$(EXE)
614 ./testfixture$(EXE) $(TOP)/test/full.test
616 queryplantest: testfixture$(EXE) sqlite3$(EXE)
617 ./testfixture$(EXE) $(TOP)/test/permutations.test queryplanner
619 test: testfixture$(EXE) sqlite3$(EXE)
620 ./testfixture$(EXE) $(TOP)/test/veryquick.test
622 # The next two rules are used to support the "threadtest" target. Building
623 # threadtest runs a few thread-safety tests that are implemented in C. This
624 # target is invoked by the releasetest.tcl script.
626 threadtest3$(EXE): sqlite3.o $(TOP)/test/threadtest3.c $(TOP)/test/tt3_checkpoint.c
627 $(TCCX) -O2 sqlite3.o $(TOP)/test/threadtest3.c \
628 -o threadtest3$(EXE) $(THREADLIB)
630 threadtest: threadtest3$(EXE)
631 ./threadtest3$(EXE)
633 TEST_EXTENSION = $(SHPREFIX)testloadext.$(SO)
634 $(TEST_EXTENSION): $(TOP)/src/test_loadext.c
635 $(MKSHLIB) $(TOP)/src/test_loadext.c -o $(TEST_EXTENSION)
637 extensiontest: testfixture$(EXE) $(TEST_EXTENSION)
638 ./testfixture$(EXE) $(TOP)/test/loadext.test
640 showdb$(EXE): $(TOP)/tool/showdb.c sqlite3.o
641 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o showdb$(EXE) \
642 $(TOP)/tool/showdb.c sqlite3.o $(THREADLIB)
644 showstat4$(EXE): $(TOP)/tool/showstat4.c sqlite3.o
645 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o showstat4$(EXE) \
646 $(TOP)/tool/showstat4.c sqlite3.o $(THREADLIB)
648 showjournal$(EXE): $(TOP)/tool/showjournal.c sqlite3.o
649 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o showjournal$(EXE) \
650 $(TOP)/tool/showjournal.c sqlite3.o $(THREADLIB)
652 showwal$(EXE): $(TOP)/tool/showwal.c sqlite3.o
653 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o showwal$(EXE) \
654 $(TOP)/tool/showwal.c sqlite3.o $(THREADLIB)
656 fts3view$(EXE): $(TOP)/ext/fts3/tool/fts3view.c sqlite3.o
657 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o fts3view$(EXE) \
658 $(TOP)/ext/fts3/tool/fts3view.c sqlite3.o $(THREADLIB)
660 rollback-test$(EXE): $(TOP)/tool/rollback-test.c sqlite3.o
661 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o rollback-test$(EXE) \
662 $(TOP)/tool/rollback-test.c sqlite3.o $(THREADLIB)
664 LogEst$(EXE): $(TOP)/tool/logest.c sqlite3.h
665 $(TCC) -o LogEst$(EXE) $(TOP)/tool/logest.c
667 wordcount$(EXE): $(TOP)/test/wordcount.c sqlite3.c
668 $(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o wordcount$(EXE) \
669 $(TOP)/test/wordcount.c sqlite3.c
671 speedtest1$(EXE): $(TOP)/test/speedtest1.c sqlite3.o
672 $(TCC) -I. -o speedtest1$(EXE) $(TOP)/test/speedtest1.c sqlite3.o $(THREADLIB)
674 # This target will fail if the SQLite amalgamation contains any exported
675 # symbols that do not begin with "sqlite3_". It is run as part of the
676 # releasetest.tcl script.
678 checksymbols: sqlite3.o
679 nm -g --defined-only sqlite3.o | grep -v " sqlite3_" ; test $$? -ne 0
681 # Build the amalgamation-autoconf package.
683 dist: sqlite3.c
684 TOP=$(TOP) sh $(TOP)/tool/mkautoconfamal.sh
687 # Standard install and cleanup targets
689 install: sqlite3 libsqlite3.a sqlite3.h
690 mv sqlite3 /usr/bin
691 mv libsqlite3.a /usr/lib
692 mv sqlite3.h /usr/include
694 clean:
695 rm -f *.o sqlite3 sqlite3.exe libsqlite3.a sqlite3.h opcodes.*
696 rm -f lemon lemon.exe lempar.c parse.* sqlite*.tar.gz
697 rm -f mkkeywordhash mkkeywordhash.exe keywordhash.h
698 rm -f $(PUBLISH)
699 rm -f *.da *.bb *.bbg gmon.out
700 rm -rf quota2a quota2b quota2c
701 rm -rf tsrc target_source
702 rm -f testloadext.dll libtestloadext.so
703 rm -f amalgamation-testfixture amalgamation-testfixture.exe
704 rm -f fts3-testfixture fts3-testfixture.exe
705 rm -f testfixture testfixture.exe
706 rm -f threadtest3 threadtest3.exe
707 rm -f LogEst LogEst.exe
708 rm -f fts3view fts3view.exe
709 rm -f rollback-test rollback-test.exe
710 rm -f showdb showdb.exe
711 rm -f showjournal showjournal.exe
712 rm -f showstat4 showstat4.exe
713 rm -f showwal showwal.exe
714 rm -f speedtest1 speedtest1.exe
715 rm -f wordcount wordcount.exe
716 rm -f sqlite3.c sqlite3-*.c fts?amal.c tclsqlite3.c
717 rm -f sqlite3rc.h
718 rm -f shell.c sqlite3ext.h
719 rm -f sqlite3_analyzer sqlite3_analyzer.exe sqlite3_analyzer.c
720 rm -f sqlite-*-output.vsix
721 rm -f mptester mptester.exe