sqlcipher/main.mk

622 lines
19 KiB
Makefile
Raw Normal View History

2008-07-30 13:15:43 +00:00
###############################################################################
# The following macros should be defined before this script is
# invoked:
#
# TOP The toplevel directory of the source tree. This is the
# directory that contains this "Makefile.in" and the
# "configure.in" script.
#
# BCC C Compiler and options for use in building executables that
# will run on the platform that is doing the build.
#
# THREADLIB Specify any extra linker options needed to make the library
# thread safe
#
# OPTS Extra compiler command-line options.
#
# EXE The suffix to add to executable files. ".exe" for windows
# and "" for Unix.
#
# TCC C Compiler and options for use in building executables that
# will run on the target platform. This is usually the same
# as BCC, unless you are cross-compiling.
#
# AR Tools used to build a static library.
# RANLIB
#
# TCL_FLAGS Extra compiler options needed for programs that use the
# TCL library.
#
# LIBTCL Linker options needed to link against the TCL library.
#
# READLINE_FLAGS Compiler options needed for programs that use the
# readline() library.
#
# LIBREADLINE Linker options needed by programs using readline() must
# link against.
#
# NAWK Nawk compatible awk program. Older (obsolete?) solaris
# systems need this to avoid using the original AT&T AWK.
#
# Once the macros above are defined, the rest of this make script will
# build the SQLite library and testing tools.
################################################################################
# This is how we compile
#
2009-02-20 20:33:35 +00:00
TCCX = $(TCC) $(OPTS) -I. -I$(TOP)/src -I$(TOP)
TCCX += -I$(TOP)/ext/rtree -I$(TOP)/ext/icu -I$(TOP)/ext/fts3
2009-05-08 09:27:02 +00:00
TCCX += -I$(TOP)/ext/async
2008-07-30 13:15:43 +00:00
# Object files for the SQLite library.
#
2009-02-20 20:33:35 +00:00
LIBOBJ+= alter.o analyze.o attach.o auth.o \
backup.o bitvec.o btmutex.o btree.o build.o \
2010-05-18 16:22:17 +00:00
callback.o complete.o ctime.o date.o delete.o expr.o fault.o fkey.o \
2011-05-06 02:37:34 +00:00
fts3.o fts3_aux.o fts3_expr.o fts3_hash.o fts3_icu.o fts3_porter.o \
2011-08-17 17:17:32 +00:00
fts3_snippet.o fts3_tokenizer.o fts3_tokenizer1.o \
2012-07-18 18:42:52 +00:00
fts3_unicode.o fts3_unicode2.o \
2011-08-17 17:17:32 +00:00
fts3_write.o func.o global.o hash.o \
2009-02-20 20:33:35 +00:00
icu.o insert.o journal.o legacy.o loadext.o \
main.o malloc.o mem0.o mem1.o mem2.o mem3.o mem5.o \
memjournal.o \
mutex.o mutex_noop.o mutex_os2.o mutex_unix.o mutex_w32.o \
2009-04-21 14:39:00 +00:00
notify.o opcodes.o os.o os_os2.o os_unix.o os_win.o \
2009-02-20 20:33:35 +00:00
pager.o parse.o pcache.o pcache1.o pragma.o prepare.o printf.o \
random.o resolve.o rowset.o rtree.o select.o status.o \
table.o tokenize.o trigger.o \
2008-07-30 13:15:43 +00:00
update.o util.o vacuum.o \
2011-12-26 19:52:17 +00:00
vdbe.o vdbeapi.o vdbeaux.o vdbeblob.o vdbemem.o vdbesort.o \
vdbetrace.o wal.o walker.o where.o utf.o vtab.o
2009-02-20 20:33:35 +00:00
2008-07-30 13:15:43 +00:00
# All of the source code files.
#
SRC = \
$(TOP)/src/alter.c \
$(TOP)/src/analyze.c \
$(TOP)/src/attach.c \
$(TOP)/src/auth.c \
2009-02-20 20:33:35 +00:00
$(TOP)/src/backup.c \
2008-07-30 13:15:43 +00:00
$(TOP)/src/bitvec.c \
$(TOP)/src/btmutex.c \
$(TOP)/src/btree.c \
$(TOP)/src/btree.h \
$(TOP)/src/btreeInt.h \
$(TOP)/src/build.c \
$(TOP)/src/callback.c \
$(TOP)/src/complete.c \
2010-05-18 16:22:17 +00:00
$(TOP)/src/ctime.c \
2008-07-30 13:15:43 +00:00
$(TOP)/src/date.c \
$(TOP)/src/delete.c \
$(TOP)/src/expr.c \
$(TOP)/src/fault.c \
2009-12-03 21:24:07 +00:00
$(TOP)/src/fkey.c \
2008-07-30 13:15:43 +00:00
$(TOP)/src/func.c \
$(TOP)/src/global.c \
$(TOP)/src/hash.c \
$(TOP)/src/hash.h \
$(TOP)/src/hwtime.h \
$(TOP)/src/insert.c \
$(TOP)/src/journal.c \
$(TOP)/src/legacy.c \
$(TOP)/src/loadext.c \
$(TOP)/src/main.c \
$(TOP)/src/malloc.c \
2009-02-20 20:33:35 +00:00
$(TOP)/src/mem0.c \
2008-07-30 13:15:43 +00:00
$(TOP)/src/mem1.c \
$(TOP)/src/mem2.c \
$(TOP)/src/mem3.c \
$(TOP)/src/mem5.c \
2009-02-20 20:33:35 +00:00
$(TOP)/src/memjournal.c \
2008-07-30 13:15:43 +00:00
$(TOP)/src/mutex.c \
$(TOP)/src/mutex.h \
2009-02-20 20:33:35 +00:00
$(TOP)/src/mutex_noop.c \
2008-07-30 13:15:43 +00:00
$(TOP)/src/mutex_os2.c \
$(TOP)/src/mutex_unix.c \
$(TOP)/src/mutex_w32.c \
2009-04-21 14:39:00 +00:00
$(TOP)/src/notify.c \
2008-07-30 13:15:43 +00:00
$(TOP)/src/os.c \
$(TOP)/src/os.h \
$(TOP)/src/os_common.h \
$(TOP)/src/os_os2.c \
$(TOP)/src/os_unix.c \
$(TOP)/src/os_win.c \
$(TOP)/src/pager.c \
$(TOP)/src/pager.h \
$(TOP)/src/parse.y \
2009-02-20 20:33:35 +00:00
$(TOP)/src/pcache.c \
$(TOP)/src/pcache.h \
$(TOP)/src/pcache1.c \
2008-07-30 13:15:43 +00:00
$(TOP)/src/pragma.c \
$(TOP)/src/prepare.c \
$(TOP)/src/printf.c \
$(TOP)/src/random.c \
2009-02-20 20:33:35 +00:00
$(TOP)/src/resolve.c \
$(TOP)/src/rowset.c \
2008-07-30 13:15:43 +00:00
$(TOP)/src/select.c \
$(TOP)/src/status.c \
$(TOP)/src/shell.c \
$(TOP)/src/sqlite.h.in \
$(TOP)/src/sqlite3ext.h \
$(TOP)/src/sqliteInt.h \
$(TOP)/src/sqliteLimit.h \
$(TOP)/src/table.c \
$(TOP)/src/tclsqlite.c \
$(TOP)/src/tokenize.c \
$(TOP)/src/trigger.c \
$(TOP)/src/utf.c \
$(TOP)/src/update.c \
$(TOP)/src/util.c \
$(TOP)/src/vacuum.c \
$(TOP)/src/vdbe.c \
$(TOP)/src/vdbe.h \
$(TOP)/src/vdbeapi.c \
$(TOP)/src/vdbeaux.c \
$(TOP)/src/vdbeblob.c \
$(TOP)/src/vdbemem.c \
2011-12-26 19:52:17 +00:00
$(TOP)/src/vdbesort.c \
2009-12-19 20:56:40 +00:00
$(TOP)/src/vdbetrace.c \
2008-07-30 13:15:43 +00:00
$(TOP)/src/vdbeInt.h \
$(TOP)/src/vtab.c \
2010-07-22 13:16:22 +00:00
$(TOP)/src/wal.c \
$(TOP)/src/wal.h \
2009-02-20 20:33:35 +00:00
$(TOP)/src/walker.c \
2008-07-30 13:15:43 +00:00
$(TOP)/src/where.c
# Source code for extensions
#
SRC += \
$(TOP)/ext/fts1/fts1.c \
$(TOP)/ext/fts1/fts1.h \
$(TOP)/ext/fts1/fts1_hash.c \
$(TOP)/ext/fts1/fts1_hash.h \
$(TOP)/ext/fts1/fts1_porter.c \
$(TOP)/ext/fts1/fts1_tokenizer.h \
$(TOP)/ext/fts1/fts1_tokenizer1.c
SRC += \
$(TOP)/ext/fts2/fts2.c \
$(TOP)/ext/fts2/fts2.h \
$(TOP)/ext/fts2/fts2_hash.c \
$(TOP)/ext/fts2/fts2_hash.h \
$(TOP)/ext/fts2/fts2_icu.c \
$(TOP)/ext/fts2/fts2_porter.c \
$(TOP)/ext/fts2/fts2_tokenizer.h \
$(TOP)/ext/fts2/fts2_tokenizer.c \
$(TOP)/ext/fts2/fts2_tokenizer1.c
SRC += \
$(TOP)/ext/fts3/fts3.c \
$(TOP)/ext/fts3/fts3.h \
2009-12-19 20:56:40 +00:00
$(TOP)/ext/fts3/fts3Int.h \
2011-05-06 02:37:34 +00:00
$(TOP)/ext/fts3/fts3_aux.c \
2009-02-20 20:33:35 +00:00
$(TOP)/ext/fts3/fts3_expr.c \
2008-07-30 13:15:43 +00:00
$(TOP)/ext/fts3/fts3_hash.c \
$(TOP)/ext/fts3/fts3_hash.h \
$(TOP)/ext/fts3/fts3_icu.c \
$(TOP)/ext/fts3/fts3_porter.c \
2009-12-19 20:56:40 +00:00
$(TOP)/ext/fts3/fts3_snippet.c \
2008-07-30 13:15:43 +00:00
$(TOP)/ext/fts3/fts3_tokenizer.h \
$(TOP)/ext/fts3/fts3_tokenizer.c \
2009-12-19 20:56:40 +00:00
$(TOP)/ext/fts3/fts3_tokenizer1.c \
2012-07-18 18:42:52 +00:00
$(TOP)/ext/fts3/fts3_unicode.c \
$(TOP)/ext/fts3/fts3_unicode2.c \
2009-12-19 20:56:40 +00:00
$(TOP)/ext/fts3/fts3_write.c
2008-07-30 13:15:43 +00:00
SRC += \
2009-02-20 20:33:35 +00:00
$(TOP)/ext/icu/sqliteicu.h \
2009-12-03 21:24:07 +00:00
$(TOP)/ext/icu/icu.c
2008-07-30 13:15:43 +00:00
SRC += \
$(TOP)/ext/rtree/rtree.h \
$(TOP)/ext/rtree/rtree.c
# Generated source code files
#
SRC += \
keywordhash.h \
opcodes.c \
opcodes.h \
parse.c \
parse.h \
sqlite3.h
# Source code to the test files.
#
TESTSRC = \
2011-08-17 17:17:32 +00:00
$(TOP)/ext/fts3/fts3_term.c \
$(TOP)/ext/fts3/fts3_test.c \
2008-07-30 13:15:43 +00:00
$(TOP)/src/test1.c \
$(TOP)/src/test2.c \
$(TOP)/src/test3.c \
$(TOP)/src/test4.c \
$(TOP)/src/test5.c \
$(TOP)/src/test6.c \
$(TOP)/src/test7.c \
$(TOP)/src/test8.c \
$(TOP)/src/test9.c \
$(TOP)/src/test_autoext.c \
$(TOP)/src/test_async.c \
2009-02-20 20:33:35 +00:00
$(TOP)/src/test_backup.c \
2008-07-30 13:15:43 +00:00
$(TOP)/src/test_btree.c \
$(TOP)/src/test_config.c \
2010-07-22 13:16:22 +00:00
$(TOP)/src/test_demovfs.c \
2008-07-30 13:15:43 +00:00
$(TOP)/src/test_devsym.c \
$(TOP)/src/test_func.c \
2011-05-06 02:37:34 +00:00
$(TOP)/src/test_fuzzer.c \
2008-07-30 13:15:43 +00:00
$(TOP)/src/test_hexio.c \
2009-12-03 21:24:07 +00:00
$(TOP)/src/test_init.c \
2009-12-19 20:56:40 +00:00
$(TOP)/src/test_intarray.c \
2009-02-20 20:33:35 +00:00
$(TOP)/src/test_journal.c \
2008-07-30 13:15:43 +00:00
$(TOP)/src/test_malloc.c \
2011-02-16 21:14:46 +00:00
$(TOP)/src/test_multiplex.c \
2008-07-30 13:15:43 +00:00
$(TOP)/src/test_mutex.c \
$(TOP)/src/test_onefile.c \
$(TOP)/src/test_osinst.c \
2009-02-20 20:33:35 +00:00
$(TOP)/src/test_pcache.c \
2011-02-16 21:14:46 +00:00
$(TOP)/src/test_quota.c \
$(TOP)/src/test_rtree.c \
2008-07-30 13:15:43 +00:00
$(TOP)/src/test_schema.c \
$(TOP)/src/test_server.c \
2010-07-22 13:16:22 +00:00
$(TOP)/src/test_stat.c \
2011-02-16 21:14:46 +00:00
$(TOP)/src/test_superlock.c \
2011-05-06 02:37:34 +00:00
$(TOP)/src/test_syscall.c \
2008-07-30 13:15:43 +00:00
$(TOP)/src/test_tclvar.c \
$(TOP)/src/test_thread.c \
2010-07-22 13:16:22 +00:00
$(TOP)/src/test_vfs.c \
2011-05-06 02:37:34 +00:00
$(TOP)/src/test_wholenumber.c \
2009-12-03 21:24:07 +00:00
$(TOP)/src/test_wsd.c
2008-07-30 13:15:43 +00:00
#TESTSRC += $(TOP)/ext/fts2/fts2_tokenizer.c
#TESTSRC += $(TOP)/ext/fts3/fts3_tokenizer.c
TESTSRC2 = \
2010-07-22 13:16:22 +00:00
$(TOP)/src/attach.c \
$(TOP)/src/backup.c \
$(TOP)/src/btree.c \
$(TOP)/src/build.c \
$(TOP)/src/date.c \
$(TOP)/src/expr.c \
$(TOP)/src/func.c \
$(TOP)/src/insert.c \
$(TOP)/src/wal.c \
$(TOP)/src/mem5.c \
$(TOP)/src/os.c \
$(TOP)/src/os_os2.c \
$(TOP)/src/os_unix.c \
$(TOP)/src/os_win.c \
$(TOP)/src/pager.c \
$(TOP)/src/pragma.c \
$(TOP)/src/prepare.c \
$(TOP)/src/printf.c \
$(TOP)/src/random.c \
$(TOP)/src/pcache.c \
$(TOP)/src/pcache1.c \
$(TOP)/src/select.c \
$(TOP)/src/tokenize.c \
$(TOP)/src/utf.c \
$(TOP)/src/util.c \
$(TOP)/src/vdbeapi.c \
$(TOP)/src/vdbeaux.c \
$(TOP)/src/vdbe.c \
$(TOP)/src/vdbemem.c \
$(TOP)/src/where.c \
parse.c \
$(TOP)/ext/fts3/fts3.c \
2011-05-06 02:37:34 +00:00
$(TOP)/ext/fts3/fts3_aux.c \
2010-07-22 13:16:22 +00:00
$(TOP)/ext/fts3/fts3_expr.c \
$(TOP)/ext/fts3/fts3_tokenizer.c \
$(TOP)/ext/fts3/fts3_write.c \
2009-05-08 09:27:02 +00:00
$(TOP)/ext/async/sqlite3async.c
2008-07-30 13:15:43 +00:00
# Header files used by all library source files.
#
HDR = \
$(TOP)/src/btree.h \
$(TOP)/src/btreeInt.h \
$(TOP)/src/hash.h \
$(TOP)/src/hwtime.h \
keywordhash.h \
$(TOP)/src/mutex.h \
opcodes.h \
$(TOP)/src/os.h \
$(TOP)/src/os_common.h \
$(TOP)/src/pager.h \
2009-02-20 20:33:35 +00:00
$(TOP)/src/pcache.h \
2008-07-30 13:15:43 +00:00
parse.h \
sqlite3.h \
$(TOP)/src/sqlite3ext.h \
$(TOP)/src/sqliteInt.h \
$(TOP)/src/sqliteLimit.h \
$(TOP)/src/vdbe.h \
$(TOP)/src/vdbeInt.h
# Header files used by extensions
#
EXTHDR += \
$(TOP)/ext/fts1/fts1.h \
$(TOP)/ext/fts1/fts1_hash.h \
$(TOP)/ext/fts1/fts1_tokenizer.h
EXTHDR += \
$(TOP)/ext/fts2/fts2.h \
$(TOP)/ext/fts2/fts2_hash.h \
$(TOP)/ext/fts2/fts2_tokenizer.h
EXTHDR += \
$(TOP)/ext/fts3/fts3.h \
2009-12-19 20:56:40 +00:00
$(TOP)/ext/fts3/fts3Int.h \
2008-07-30 13:15:43 +00:00
$(TOP)/ext/fts3/fts3_hash.h \
$(TOP)/ext/fts3/fts3_tokenizer.h
EXTHDR += \
$(TOP)/ext/rtree/rtree.h
2009-02-20 20:33:35 +00:00
EXTHDR += \
$(TOP)/ext/icu/sqliteicu.h
2008-07-30 13:15:43 +00:00
# This is the default Makefile target. The objects listed here
# are what get build when you type just "make" with no arguments.
#
all: sqlite3.h libsqlite3.a sqlite3$(EXE)
libsqlite3.a: $(LIBOBJ)
$(AR) libsqlite3.a $(LIBOBJ)
$(RANLIB) libsqlite3.a
sqlite3$(EXE): $(TOP)/src/shell.c libsqlite3.a sqlite3.h
$(TCCX) $(READLINE_FLAGS) -o sqlite3$(EXE) \
$(TOP)/src/shell.c \
libsqlite3.a $(LIBREADLINE) $(TLIBS) $(THREADLIB)
2011-12-26 19:52:17 +00:00
sqlite3.o: sqlite3.c
$(TCCX) -c sqlite3.c
2008-07-30 13:15:43 +00:00
# This target creates a directory named "tsrc" and fills it with
# copies of all of the C source code and header files needed to
# build on the target system. Some of the C source code and header
# files are automatically generated. This target takes care of
# all that automatic generation.
#
2009-08-11 20:01:51 +00:00
target_source: $(SRC) $(TOP)/tool/vdbe-compress.tcl
2008-07-30 13:15:43 +00:00
rm -rf tsrc
mkdir tsrc
cp -f $(SRC) tsrc
rm tsrc/sqlite.h.in tsrc/parse.y
2009-08-11 20:01:51 +00:00
tclsh $(TOP)/tool/vdbe-compress.tcl <tsrc/vdbe.c >vdbe.new
mv vdbe.new tsrc/vdbe.c
2008-07-30 13:15:43 +00:00
touch target_source
sqlite3.c: target_source $(TOP)/tool/mksqlite3c.tcl
tclsh $(TOP)/tool/mksqlite3c.tcl
2011-02-16 21:14:46 +00:00
echo '#ifndef USE_SYSTEM_SQLITE' >tclsqlite3.c
cat sqlite3.c >>tclsqlite3.c
echo '#endif /* USE_SYSTEM_SQLITE */' >>tclsqlite3.c
2008-07-30 13:15:43 +00:00
cat $(TOP)/src/tclsqlite.c >>tclsqlite3.c
2011-12-26 19:52:17 +00:00
sqlite3.c-debug: target_source $(TOP)/tool/mksqlite3c.tcl
tclsh $(TOP)/tool/mksqlite3c.tcl --linemacros
echo '#ifndef USE_SYSTEM_SQLITE' >tclsqlite3.c
cat sqlite3.c >>tclsqlite3.c
echo '#endif /* USE_SYSTEM_SQLITE */' >>tclsqlite3.c
echo '#line 1 "tclsqlite.c"' >>tclsqlite3.c
cat $(TOP)/src/tclsqlite.c >>tclsqlite3.c
sqlite3-all.c: sqlite3.c $(TOP)/tool/split-sqlite3c.tcl
tclsh $(TOP)/tool/split-sqlite3c.tcl
2008-07-30 13:15:43 +00:00
fts2amal.c: target_source $(TOP)/ext/fts2/mkfts2amal.tcl
tclsh $(TOP)/ext/fts2/mkfts2amal.tcl
fts3amal.c: target_source $(TOP)/ext/fts3/mkfts3amal.tcl
tclsh $(TOP)/ext/fts3/mkfts3amal.tcl
# Rules to build the LEMON compiler generator
#
2009-08-11 20:01:51 +00:00
lemon: $(TOP)/tool/lemon.c $(TOP)/src/lempar.c
2008-07-30 13:15:43 +00:00
$(BCC) -o lemon $(TOP)/tool/lemon.c
2009-08-11 20:01:51 +00:00
cp $(TOP)/src/lempar.c .
2008-07-30 13:15:43 +00:00
# Rules to build individual *.o files from generated *.c files. This
# applies to:
#
# parse.o
# opcodes.o
#
%.o: %.c $(HDR)
$(TCCX) -c $<
# Rules to build individual *.o files from files in the src directory.
#
%.o: $(TOP)/src/%.c $(HDR)
$(TCCX) -c $<
tclsqlite.o: $(TOP)/src/tclsqlite.c $(HDR)
$(TCCX) $(TCL_FLAGS) -c $(TOP)/src/tclsqlite.c
# Rules to build opcodes.c and opcodes.h
#
opcodes.c: opcodes.h $(TOP)/mkopcodec.awk
2011-12-26 19:52:17 +00:00
$(NAWK) -f $(TOP)/mkopcodec.awk opcodes.h >opcodes.c
2008-07-30 13:15:43 +00:00
opcodes.h: parse.h $(TOP)/src/vdbe.c $(TOP)/mkopcodeh.awk
2009-02-20 20:33:35 +00:00
cat parse.h $(TOP)/src/vdbe.c | \
$(NAWK) -f $(TOP)/mkopcodeh.awk >opcodes.h
2008-07-30 13:15:43 +00:00
# Rules to build parse.c and parse.h - the outputs of lemon.
#
parse.h: parse.c
parse.c: $(TOP)/src/parse.y lemon $(TOP)/addopcodes.awk
cp $(TOP)/src/parse.y .
rm -f parse.h
./lemon $(OPTS) parse.y
mv parse.h parse.h.temp
2010-07-22 13:16:22 +00:00
$(NAWK) -f $(TOP)/addopcodes.awk parse.h.temp >parse.h
2008-07-30 13:15:43 +00:00
2009-12-03 21:24:07 +00:00
sqlite3.h: $(TOP)/src/sqlite.h.in $(TOP)/manifest.uuid $(TOP)/VERSION
tclsh $(TOP)/tool/mksqlite3h.tcl $(TOP) >sqlite3.h
2008-07-30 13:15:43 +00:00
keywordhash.h: $(TOP)/tool/mkkeywordhash.c
$(BCC) -o mkkeywordhash $(OPTS) $(TOP)/tool/mkkeywordhash.c
./mkkeywordhash >keywordhash.h
# Rules to build the extension objects.
#
icu.o: $(TOP)/ext/icu/icu.c $(HDR) $(EXTHDR)
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/icu/icu.c
fts2.o: $(TOP)/ext/fts2/fts2.c $(HDR) $(EXTHDR)
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2.c
fts2_hash.o: $(TOP)/ext/fts2/fts2_hash.c $(HDR) $(EXTHDR)
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_hash.c
fts2_icu.o: $(TOP)/ext/fts2/fts2_icu.c $(HDR) $(EXTHDR)
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_icu.c
fts2_porter.o: $(TOP)/ext/fts2/fts2_porter.c $(HDR) $(EXTHDR)
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_porter.c
fts2_tokenizer.o: $(TOP)/ext/fts2/fts2_tokenizer.c $(HDR) $(EXTHDR)
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_tokenizer.c
fts2_tokenizer1.o: $(TOP)/ext/fts2/fts2_tokenizer1.c $(HDR) $(EXTHDR)
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_tokenizer1.c
fts3.o: $(TOP)/ext/fts3/fts3.c $(HDR) $(EXTHDR)
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3.c
2011-05-06 02:37:34 +00:00
fts3_aux.o: $(TOP)/ext/fts3/fts3_aux.c $(HDR) $(EXTHDR)
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_aux.c
2009-02-20 20:33:35 +00:00
fts3_expr.o: $(TOP)/ext/fts3/fts3_expr.c $(HDR) $(EXTHDR)
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_expr.c
2008-07-30 13:15:43 +00:00
fts3_hash.o: $(TOP)/ext/fts3/fts3_hash.c $(HDR) $(EXTHDR)
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_hash.c
fts3_icu.o: $(TOP)/ext/fts3/fts3_icu.c $(HDR) $(EXTHDR)
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_icu.c
2009-12-19 20:56:40 +00:00
fts3_snippet.o: $(TOP)/ext/fts3/fts3_snippet.c $(HDR) $(EXTHDR)
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_snippet.c
2008-07-30 13:15:43 +00:00
fts3_porter.o: $(TOP)/ext/fts3/fts3_porter.c $(HDR) $(EXTHDR)
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_porter.c
fts3_tokenizer.o: $(TOP)/ext/fts3/fts3_tokenizer.c $(HDR) $(EXTHDR)
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer.c
fts3_tokenizer1.o: $(TOP)/ext/fts3/fts3_tokenizer1.c $(HDR) $(EXTHDR)
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer1.c
2012-07-18 18:42:52 +00:00
fts3_unicode.o: $(TOP)/ext/fts3/fts3_unicode.c $(HDR) $(EXTHDR)
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_unicode.c
fts3_unicode2.o: $(TOP)/ext/fts3/fts3_unicode2.c $(HDR) $(EXTHDR)
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_unicode2.c
2009-12-19 20:56:40 +00:00
fts3_write.o: $(TOP)/ext/fts3/fts3_write.c $(HDR) $(EXTHDR)
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_write.c
2008-07-30 13:15:43 +00:00
rtree.o: $(TOP)/ext/rtree/rtree.c $(HDR) $(EXTHDR)
$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/rtree/rtree.c
# Rules for building test programs and for running tests
#
tclsqlite3: $(TOP)/src/tclsqlite.c libsqlite3.a
$(TCCX) $(TCL_FLAGS) -DTCLSH=1 -o tclsqlite3 \
$(TOP)/src/tclsqlite.c libsqlite3.a $(LIBTCL) $(THREADLIB)
2011-12-26 19:52:17 +00:00
sqlite3_analyzer.c: sqlite3.c $(TOP)/src/test_stat.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl
echo "#define TCLSH 2" > $@
cat sqlite3.c $(TOP)/src/test_stat.c $(TOP)/src/tclsqlite.c >> $@
echo "static const char *tclsh_main_loop(void){" >> $@
echo "static const char *zMainloop = " >> $@
$(NAWK) -f $(TOP)/tool/tostr.awk $(TOP)/tool/spaceanal.tcl >> $@
echo "; return zMainloop; }" >> $@
sqlite3_analyzer$(EXE): sqlite3_analyzer.c
$(TCCX) $(TCL_FLAGS) sqlite3_analyzer.c -o $@ $(LIBTCL) $(THREADLIB)
2008-07-30 13:15:43 +00:00
# Rules to build the 'testfixture' application.
#
2010-07-22 13:16:22 +00:00
TESTFIXTURE_FLAGS = -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
2008-07-30 13:15:43 +00:00
TESTFIXTURE_FLAGS += -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE
testfixture$(EXE): $(TESTSRC2) libsqlite3.a $(TESTSRC) $(TOP)/src/tclsqlite.c
2010-07-22 13:16:22 +00:00
$(TCCX) $(TCL_FLAGS) -DTCLSH=1 $(TESTFIXTURE_FLAGS) \
2008-07-30 13:15:43 +00:00
$(TESTSRC) $(TESTSRC2) $(TOP)/src/tclsqlite.c \
-o testfixture$(EXE) $(LIBTCL) $(THREADLIB) libsqlite3.a
amalgamation-testfixture$(EXE): sqlite3.c $(TESTSRC) $(TOP)/src/tclsqlite.c
2010-07-22 13:16:22 +00:00
$(TCCX) $(TCL_FLAGS) -DTCLSH=1 $(TESTFIXTURE_FLAGS) \
2008-07-30 13:15:43 +00:00
$(TESTSRC) $(TOP)/src/tclsqlite.c sqlite3.c \
-o testfixture$(EXE) $(LIBTCL) $(THREADLIB)
fts3-testfixture$(EXE): sqlite3.c fts3amal.c $(TESTSRC) $(TOP)/src/tclsqlite.c
2010-07-22 13:16:22 +00:00
$(TCCX) $(TCL_FLAGS) -DTCLSH=1 $(TESTFIXTURE_FLAGS) \
2008-07-30 13:15:43 +00:00
-DSQLITE_ENABLE_FTS3=1 \
$(TESTSRC) $(TOP)/src/tclsqlite.c sqlite3.c fts3amal.c \
-o testfixture$(EXE) $(LIBTCL) $(THREADLIB)
fulltest: testfixture$(EXE) sqlite3$(EXE)
./testfixture$(EXE) $(TOP)/test/all.test
soaktest: testfixture$(EXE) sqlite3$(EXE)
2010-07-22 13:16:22 +00:00
./testfixture$(EXE) $(TOP)/test/all.test -soak=1
2008-07-30 13:15:43 +00:00
test: testfixture$(EXE) sqlite3$(EXE)
./testfixture$(EXE) $(TOP)/test/veryquick.test
2011-02-16 21:14:46 +00:00
# The next two rules are used to support the "threadtest" target. Building
# threadtest runs a few thread-safety tests that are implemented in C. This
# target is invoked by the releasetest.tcl script.
#
2011-05-06 02:37:34 +00:00
threadtest3$(EXE): sqlite3.o $(TOP)/test/threadtest3.c $(TOP)/test/tt3_checkpoint.c
$(TCCX) -O2 sqlite3.o $(TOP)/test/threadtest3.c \
2011-02-16 21:14:46 +00:00
-o threadtest3$(EXE) $(THREADLIB)
threadtest: threadtest3$(EXE)
./threadtest3$(EXE)
2008-07-30 13:15:43 +00:00
TEST_EXTENSION = $(SHPREFIX)testloadext.$(SO)
$(TEST_EXTENSION): $(TOP)/src/test_loadext.c
$(MKSHLIB) $(TOP)/src/test_loadext.c -o $(TEST_EXTENSION)
extensiontest: testfixture$(EXE) $(TEST_EXTENSION)
./testfixture$(EXE) $(TOP)/test/loadext.test
2011-12-26 19:52:17 +00:00
# This target will fail if the SQLite amalgamation contains any exported
# symbols that do not begin with "sqlite3_". It is run as part of the
# releasetest.tcl script.
#
checksymbols: sqlite3.o
nm -g --defined-only sqlite3.o | grep -v " sqlite3_" ; test $$? -ne 0
2008-07-30 13:15:43 +00:00
# Standard install and cleanup targets
#
install: sqlite3 libsqlite3.a sqlite3.h
mv sqlite3 /usr/bin
mv libsqlite3.a /usr/lib
mv sqlite3.h /usr/include
clean:
2011-12-26 19:52:17 +00:00
rm -f *.o sqlite3 sqlite3.exe libsqlite3.a sqlite3.h opcodes.*
rm -f lemon lemon.exe lempar.c parse.* sqlite*.tar.gz
rm -f mkkeywordhash mkkeywordhash.exe keywordhash.h
2008-07-30 13:15:43 +00:00
rm -f $(PUBLISH)
rm -f *.da *.bb *.bbg gmon.out
2012-05-15 23:05:34 +00:00
rm -rf quota2a quota2b quota2c
2008-07-30 13:15:43 +00:00
rm -rf tsrc target_source
rm -f testloadext.dll libtestloadext.so
2011-12-26 19:52:17 +00:00
rm -f amalgamation-testfixture amalgamation-testfixture.exe
rm -f fts3-testfixture fts3-testfixture.exe
rm -f testfixture testfixture.exe
rm -f threadtest3 threadtest3.exe
2009-02-20 20:33:35 +00:00
rm -f sqlite3.c fts?amal.c tclsqlite3.c
2011-12-26 19:52:17 +00:00
rm -f sqlite3_analyzer sqlite3_analyzer.exe sqlite3_analyzer.c