1 ###############################################################################
2 # The following macros should be defined before this script is
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
15 # OPTS Extra compiler command-line options.
17 # EXE The suffix to add to executable files. ".exe" for windows
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.
27 # TCL_FLAGS Extra compiler options needed for programs that use the
30 # LIBTCL Linker options needed to link against the TCL library.
32 # READLINE_FLAGS Compiler options needed for programs that use the
35 # LIBREADLINE Linker options needed by programs using readline() must
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 \
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.
80 $(TOP
)/src
/analyze.c \
85 $(TOP
)/src
/btmutex.c \
88 $(TOP
)/src
/btreeInt.h \
90 $(TOP
)/src
/callback.c \
91 $(TOP
)/src
/complete.c \
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 \
108 $(TOP
)/src
/malloc.c \
114 $(TOP
)/src
/memjournal.c \
117 $(TOP
)/src
/mutex_noop.c \
118 $(TOP
)/src
/mutex_unix.c \
119 $(TOP
)/src
/mutex_w32.c \
120 $(TOP
)/src
/notify.c \
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 \
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 \
143 $(TOP
)/src
/sqlite.h.in \
144 $(TOP
)/src
/sqlite3ext.h \
145 $(TOP
)/src
/sqliteInt.h \
146 $(TOP
)/src
/sqliteLimit.h \
148 $(TOP
)/src
/tclsqlite.c \
149 $(TOP
)/src
/threads.c \
150 $(TOP
)/src
/tokenize.c \
151 $(TOP
)/src
/trigger.c \
153 $(TOP
)/src
/update.c \
155 $(TOP
)/src
/vacuum.c \
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 \
168 $(TOP
)/src
/walker.c \
170 $(TOP
)/src
/whereInt.h
172 # Source code for extensions
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
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
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
211 $(TOP
)/ext
/icu
/sqliteicu.h \
214 $(TOP
)/ext
/rtree
/sqlite3rtree.h \
215 $(TOP
)/ext
/rtree
/rtree.h \
216 $(TOP
)/ext
/rtree
/rtree.c
218 $(TOP
)/ext
/userauth
/userauth.c \
219 $(TOP
)/ext
/userauth
/sqlite3userauth.h
221 # Generated source code files
232 # Source code to the test files.
235 $(TOP
)/ext
/fts3
/fts3_term.c \
236 $(TOP
)/ext
/fts3
/fts3_test.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.
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
299 $(TOP
)/src
/attach.c \
300 $(TOP
)/src
/backup.c \
306 $(TOP
)/src
/insert.c \
311 $(TOP
)/src
/os_unix.c \
312 $(TOP
)/src
/os_win.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 \
325 $(TOP
)/src
/vdbeapi.c \
326 $(TOP
)/src
/vdbeaux.c \
328 $(TOP
)/src
/vdbemem.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.
342 $(TOP
)/src
/btreeInt.h \
344 $(TOP
)/src
/hwtime.h \
349 $(TOP
)/src
/os_common.h \
350 $(TOP
)/src
/os_setup.h \
351 $(TOP
)/src
/os_win.h \
353 $(TOP
)/src
/pcache.h \
356 $(TOP
)/src
/sqlite3ext.h \
357 $(TOP
)/src
/sqliteInt.h \
358 $(TOP
)/src
/sqliteLimit.h \
360 $(TOP
)/src
/vdbeInt.h \
361 $(TOP
)/src
/whereInt.h
363 # Header files used by extensions
366 $(TOP
)/ext
/fts1
/fts1.h \
367 $(TOP
)/ext
/fts1
/fts1_hash.h \
368 $(TOP
)/ext
/fts1
/fts1_tokenizer.h
370 $(TOP
)/ext
/fts2
/fts2.h \
371 $(TOP
)/ext
/fts2
/fts2_hash.h \
372 $(TOP
)/ext
/fts2
/fts2_tokenizer.h
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
379 $(TOP
)/ext
/rtree
/rtree.h
381 $(TOP
)/ext
/icu
/sqliteicu.h
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
) \
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
)
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
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
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
461 # Rules to build individual *.o files from files in the src directory.
463 %.o
: $(TOP
)/src
/%.c
$(HDR
)
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.
484 parse.c
: $(TOP
)/src
/parse.y lemon
$(TOP
)/addopcodes.awk
485 cp
$(TOP
)/src
/parse.y .
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
)
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.
684 TOP
=$(TOP
) sh
$(TOP
)/tool
/mkautoconfamal.sh
687 # Standard install and cleanup targets
689 install: sqlite3 libsqlite3.a sqlite3.h
691 mv libsqlite3.a
/usr
/lib
692 mv sqlite3.h
/usr
/include
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
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
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