2001-09-28 05:34:43 +04:00
|
|
|
#!/usr/make
|
|
|
|
#
|
|
|
|
# Makefile for SQLITE
|
|
|
|
#
|
|
|
|
# This is a template makefile for SQLite. Most people prefer to
|
|
|
|
# use the autoconf generated "configure" script to generate the
|
|
|
|
# makefile automatically. But that does not work for everybody
|
|
|
|
# and in every situation. If you are having problems with the
|
|
|
|
# "configure" script, you might want to try this makefile as an
|
|
|
|
# alternative. Create a copy of this file, edit the parameters
|
|
|
|
# below and type "make".
|
|
|
|
#
|
|
|
|
|
|
|
|
#### The toplevel directory of the source tree. This is the directory
|
|
|
|
# that contains this "Makefile.in" and the "configure.in" script.
|
|
|
|
#
|
|
|
|
TOP = ../sqlite
|
|
|
|
|
|
|
|
#### C Compiler and options for use in building executables that
|
|
|
|
# will run on the platform that is doing the build.
|
|
|
|
#
|
|
|
|
BCC = gcc -g -O2
|
2001-10-06 20:33:02 +04:00
|
|
|
#BCC = /opt/ancic/bin/c89 -0
|
2001-09-28 05:34:43 +04:00
|
|
|
|
|
|
|
#### If the target operating system supports the "usleep()" system
|
|
|
|
# call, then define the HAVE_USLEEP macro for all C modules.
|
|
|
|
#
|
|
|
|
#USLEEP =
|
|
|
|
USLEEP = -DHAVE_USLEEP=1
|
|
|
|
|
|
|
|
#### Leave MEMORY_DEBUG undefined for maximum speed. Use MEMORY_DEBUG=1
|
|
|
|
# to check for memory leaks. Use MEMORY_DEBUG=2 to print a log of all
|
|
|
|
# malloc()s and free()s in order to track down memory leaks.
|
|
|
|
#
|
|
|
|
# SQLite uses some expensive assert() statements in the inner loop.
|
|
|
|
# You can make the library go almost twice as fast if you compile
|
|
|
|
# with -DNDEBUG=1
|
|
|
|
#
|
|
|
|
#OPTS = -DMEMORY_DEBUG=2
|
|
|
|
#OPTS = -DMEMORY_DEBUG=1
|
|
|
|
#OPTS =
|
|
|
|
OPTS = -DNDEBUG=1
|
|
|
|
|
|
|
|
#### Compiler flags that change according to the operating system.
|
|
|
|
#
|
|
|
|
#OSFLAGS = -DOS_UNIX=0 -DOS_WIN=1
|
|
|
|
OSFLAGS = -DOS_UNIX=1 -DOS_WIN=0
|
|
|
|
|
|
|
|
#### The suffix to add to executable files. ".exe" for windows.
|
|
|
|
# Nothing for unix.
|
|
|
|
#
|
|
|
|
#EXE = .exe
|
|
|
|
EXE =
|
|
|
|
|
|
|
|
#### C Compile 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.
|
|
|
|
#
|
|
|
|
TCC = gcc -O6
|
|
|
|
#TCC = gcc -g -O0 -Wall
|
2001-10-15 04:44:35 +04:00
|
|
|
#TCC = gcc -g -O0 -Wall -fprofile-arcs -ftest-coverage
|
2001-09-28 05:34:43 +04:00
|
|
|
#TCC = /opt/mingw/bin/i386-mingw32-gcc -O6
|
2001-10-06 20:33:02 +04:00
|
|
|
#TCC = /opt/ansic/bin/c89 -O +z -Wl,-a,archive
|
2001-09-28 05:34:43 +04:00
|
|
|
|
|
|
|
#### Tools used to build a static library.
|
|
|
|
#
|
|
|
|
AR = ar cr
|
|
|
|
#AR = /opt/mingw/bin/i386-mingw32-ar cr
|
|
|
|
RANLIB = ranlib
|
|
|
|
#RANLIB = /opt/mingw/bin/i386-mingw32-ranlib
|
|
|
|
|
|
|
|
#### Extra compiler options needed for programs that use the TCL library.
|
|
|
|
#
|
|
|
|
#TCL_FLAGS =
|
|
|
|
#TCL_FLAGS = -DSTATIC_BUILD=1
|
|
|
|
TCL_FLAGS = -I/home/drh/tcltk/8.4linux
|
|
|
|
#TCL_FLAGS = -I/home/drh/tcltk/8.4win -DSTATIC_BUILD=1
|
2001-10-06 20:33:02 +04:00
|
|
|
#TCL_FLAGS = -I/home/drh/tcltk/8.3hpux
|
2001-09-28 05:34:43 +04:00
|
|
|
|
|
|
|
#### Linker options needed to link against the TCL library.
|
|
|
|
#
|
|
|
|
#LIBTCL = -ltcl -lm -ldl
|
|
|
|
LIBTCL = /home/drh/tcltk/8.4linux/libtcl8.4g.a -lm -ldl
|
|
|
|
#LIBTCL = /home/drh/tcltk/8.4win/libtcl84s.a -lmsvcrt
|
2001-10-06 20:33:02 +04:00
|
|
|
#LIBTCL = /home/drh/tcltk/8.3hpux/libtcl8.3.a -ldld -lm -lc
|
2001-09-28 05:34:43 +04:00
|
|
|
|
|
|
|
#### Compiler options needed for programs that use the readline() library.
|
|
|
|
#
|
|
|
|
#READLINE_FLAGS =
|
|
|
|
READLINE_FLAGS = -DHAVE_READLINE=1 -I/usr/include/readline
|
|
|
|
|
|
|
|
#### Linker options needed by programs using readline() must link against.
|
|
|
|
#
|
|
|
|
#LIBREADLINE =
|
2001-12-05 03:46:02 +03:00
|
|
|
LIBREADLINE = -static -lreadline -ltermcap
|
2001-09-28 05:34:43 +04:00
|
|
|
|
|
|
|
#### Should the database engine assume text is coded as UTF-8 or iso8859?
|
|
|
|
#
|
|
|
|
# ENCODING = UTF8
|
|
|
|
ENCODING = ISO8859
|
|
|
|
|
|
|
|
# You should not have to change anything below this line
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
# This is how we compile
|
|
|
|
#
|
|
|
|
TCCX = $(TCC) $(OPTS) $(OSFLAGS) $(USLEEP) -I. -I$(TOP)/src
|
|
|
|
|
|
|
|
# Object files for the SQLite library.
|
|
|
|
#
|
|
|
|
LIBOBJ = btree.o build.o delete.o expr.o hash.o insert.o \
|
|
|
|
main.o os.o pager.o parse.o printf.o random.o select.o table.o \
|
|
|
|
tokenize.o update.o util.o vdbe.o where.o tclsqlite.o
|
|
|
|
|
|
|
|
# All of the source code files.
|
|
|
|
#
|
|
|
|
SRC = \
|
|
|
|
$(TOP)/src/btree.c \
|
|
|
|
$(TOP)/src/btree.h \
|
|
|
|
$(TOP)/src/build.c \
|
|
|
|
$(TOP)/src/delete.c \
|
|
|
|
$(TOP)/src/expr.c \
|
|
|
|
$(TOP)/src/hash.c \
|
|
|
|
$(TOP)/src/hash.h \
|
|
|
|
$(TOP)/src/insert.c \
|
|
|
|
$(TOP)/src/main.c \
|
|
|
|
$(TOP)/src/os.c \
|
|
|
|
$(TOP)/src/pager.c \
|
|
|
|
$(TOP)/src/pager.h \
|
|
|
|
$(TOP)/src/parse.y \
|
|
|
|
$(TOP)/src/printf.c \
|
|
|
|
$(TOP)/src/random.c \
|
|
|
|
$(TOP)/src/select.c \
|
|
|
|
$(TOP)/src/shell.c \
|
|
|
|
$(TOP)/src/sqlite.h.in \
|
|
|
|
$(TOP)/src/sqliteInt.h \
|
|
|
|
$(TOP)/src/table.c \
|
|
|
|
$(TOP)/src/tclsqlite.c \
|
|
|
|
$(TOP)/src/tokenize.c \
|
|
|
|
$(TOP)/src/update.c \
|
|
|
|
$(TOP)/src/util.c \
|
|
|
|
$(TOP)/src/vdbe.c \
|
|
|
|
$(TOP)/src/vdbe.h \
|
|
|
|
$(TOP)/src/where.c
|
|
|
|
|
|
|
|
# Source code to the test files.
|
|
|
|
#
|
|
|
|
TESTSRC = \
|
|
|
|
$(TOP)/src/btree.c \
|
2001-10-12 21:30:04 +04:00
|
|
|
$(TOP)/src/os.c \
|
2001-09-28 05:34:43 +04:00
|
|
|
$(TOP)/src/pager.c \
|
|
|
|
$(TOP)/src/test1.c \
|
|
|
|
$(TOP)/src/test2.c \
|
|
|
|
$(TOP)/src/test3.c \
|
|
|
|
$(TOP)/src/md5.c
|
|
|
|
|
|
|
|
# Header files used by all library source files.
|
|
|
|
#
|
|
|
|
HDR = \
|
|
|
|
sqlite.h \
|
|
|
|
$(TOP)/src/btree.h \
|
|
|
|
$(TOP)/src/hash.h \
|
|
|
|
$(TOP)/src/os.h \
|
|
|
|
$(TOP)/src/sqliteInt.h \
|
|
|
|
$(TOP)/src/vdbe.h \
|
|
|
|
parse.h
|
|
|
|
|
|
|
|
# This is the default Makefile target. The objects listed here
|
|
|
|
# are what get build when you type just "make" with no arguments.
|
|
|
|
#
|
|
|
|
all: sqlite.h libsqlite.a sqlite$(EXE)
|
|
|
|
|
|
|
|
# Generate the file "last_change" which contains the date of change
|
|
|
|
# of the most recently modified source code file
|
|
|
|
#
|
|
|
|
last_change: $(SRC)
|
|
|
|
cat $(SRC) | grep '$$Id: ' | sort +4 | tail -1 \
|
|
|
|
| awk '{print $$5,$$6}' >last_change
|
|
|
|
|
|
|
|
libsqlite.a: $(LIBOBJ) tclsqlite.o
|
|
|
|
$(AR) libsqlite.a $(LIBOBJ) tclsqlite.o
|
|
|
|
$(RANLIB) libsqlite.a
|
|
|
|
|
|
|
|
sqlite$(EXE): $(TOP)/src/shell.c libsqlite.a sqlite.h
|
|
|
|
$(TCCX) $(READLINE_FLAGS) -o sqlite$(EXE) $(TOP)/src/shell.c \
|
|
|
|
libsqlite.a $(LIBREADLINE)
|
|
|
|
|
|
|
|
# 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.
|
|
|
|
#
|
|
|
|
target_source: $(SRC) $(HDR)
|
|
|
|
rm -rf tsrc
|
|
|
|
mkdir tsrc
|
|
|
|
cp $(SRC) $(HDR) tsrc
|
|
|
|
rm tsrc/sqlite.h.in tsrc/parse.y
|
|
|
|
cp parse.c tsrc
|
|
|
|
|
|
|
|
# Rules to build the LEMON compiler generator
|
|
|
|
#
|
|
|
|
lemon: $(TOP)/tool/lemon.c $(TOP)/tool/lempar.c
|
|
|
|
$(BCC) -o lemon $(TOP)/tool/lemon.c
|
|
|
|
cp $(TOP)/tool/lempar.c .
|
|
|
|
|
|
|
|
btree.o: $(TOP)/src/btree.c $(HDR) $(TOP)/src/pager.h
|
|
|
|
$(TCCX) -c $(TOP)/src/btree.c
|
|
|
|
|
|
|
|
build.o: $(TOP)/src/build.c $(HDR)
|
|
|
|
$(TCCX) -c $(TOP)/src/build.c
|
|
|
|
|
|
|
|
main.o: $(TOP)/src/main.c $(HDR)
|
|
|
|
$(TCCX) -c $(TOP)/src/main.c
|
|
|
|
|
|
|
|
pager.o: $(TOP)/src/pager.c $(HDR) $(TOP)/src/pager.h
|
|
|
|
$(TCCX) -c $(TOP)/src/pager.c
|
|
|
|
|
|
|
|
os.o: $(TOP)/src/os.c $(HDR)
|
|
|
|
$(TCCX) -c $(TOP)/src/os.c
|
|
|
|
|
|
|
|
parse.o: parse.c $(HDR)
|
|
|
|
$(TCCX) -c parse.c
|
|
|
|
|
|
|
|
parse.h: parse.c
|
|
|
|
|
|
|
|
parse.c: $(TOP)/src/parse.y lemon
|
|
|
|
cp $(TOP)/src/parse.y .
|
|
|
|
./lemon parse.y
|
|
|
|
|
|
|
|
sqlite.h: $(TOP)/src/sqlite.h.in
|
|
|
|
sed -e s/--VERS--/`cat ${TOP}/VERSION`/ \
|
|
|
|
-e s/--ENCODING--/$(ENCODING)/ \
|
|
|
|
$(TOP)/src/sqlite.h.in >sqlite.h
|
|
|
|
|
|
|
|
tokenize.o: $(TOP)/src/tokenize.c $(HDR)
|
|
|
|
$(TCCX) -c $(TOP)/src/tokenize.c
|
|
|
|
|
|
|
|
util.o: $(TOP)/src/util.c $(HDR)
|
|
|
|
$(TCCX) -c $(TOP)/src/util.c
|
|
|
|
|
|
|
|
vdbe.o: $(TOP)/src/vdbe.c $(HDR)
|
|
|
|
$(TCCX) -c $(TOP)/src/vdbe.c
|
|
|
|
|
|
|
|
where.o: $(TOP)/src/where.c $(HDR)
|
|
|
|
$(TCCX) -c $(TOP)/src/where.c
|
|
|
|
|
|
|
|
delete.o: $(TOP)/src/delete.c $(HDR)
|
|
|
|
$(TCCX) -c $(TOP)/src/delete.c
|
|
|
|
|
|
|
|
expr.o: $(TOP)/src/expr.c $(HDR)
|
|
|
|
$(TCCX) -c $(TOP)/src/expr.c
|
|
|
|
|
|
|
|
hash.o: $(TOP)/src/hash.c $(HDR)
|
|
|
|
$(TCCX) -c $(TOP)/src/hash.c
|
|
|
|
|
|
|
|
insert.o: $(TOP)/src/insert.c $(HDR)
|
|
|
|
$(TCCX) -c $(TOP)/src/insert.c
|
|
|
|
|
|
|
|
random.o: $(TOP)/src/random.c $(HDR)
|
|
|
|
$(TCCX) -c $(TOP)/src/random.c
|
|
|
|
|
|
|
|
select.o: $(TOP)/src/select.c $(HDR)
|
|
|
|
$(TCCX) -c $(TOP)/src/select.c
|
|
|
|
|
|
|
|
table.o: $(TOP)/src/table.c $(HDR)
|
|
|
|
$(TCCX) -c $(TOP)/src/table.c
|
|
|
|
|
|
|
|
update.o: $(TOP)/src/update.c $(HDR)
|
|
|
|
$(TCCX) -c $(TOP)/src/update.c
|
|
|
|
|
|
|
|
tclsqlite.o: $(TOP)/src/tclsqlite.c $(HDR)
|
|
|
|
$(TCCX) $(TCL_FLAGS) -c $(TOP)/src/tclsqlite.c
|
|
|
|
|
|
|
|
printf.o: $(TOP)/src/printf.c $(HDR)
|
|
|
|
$(TCCX) $(TCL_FLAGS) -c $(TOP)/src/printf.c
|
|
|
|
|
|
|
|
tclsqlite: $(TOP)/src/tclsqlite.c libsqlite.a
|
|
|
|
$(TCCX) $(TCL_FLAGS) -DTCLSH=1 -o tclsqlite \
|
|
|
|
$(TOP)/src/tclsqlite.c libsqlite.a $(LIBTCL)
|
|
|
|
|
|
|
|
testfixture$(EXE): $(TOP)/src/tclsqlite.c libsqlite.a $(TESTSRC)
|
|
|
|
$(TCCX) $(TCL_FLAGS) -DTCLSH=1 -DSQLITE_TEST=1 -o testfixture$(EXE) \
|
|
|
|
$(TESTSRC) $(TOP)/src/tclsqlite.c \
|
|
|
|
libsqlite.a $(LIBTCL)
|
|
|
|
|
|
|
|
fulltest: testfixture$(EXE) sqlite$(EXE)
|
|
|
|
./testfixture$(EXE) $(TOP)/test/all.test
|
|
|
|
|
|
|
|
test: testfixture$(EXE) sqlite$(EXE)
|
|
|
|
./testfixture$(EXE) $(TOP)/test/quick.test
|
|
|
|
|
2001-09-28 21:47:14 +04:00
|
|
|
index.html: $(TOP)/www/index.tcl last_change
|
2001-09-28 05:34:43 +04:00
|
|
|
tclsh $(TOP)/www/index.tcl `cat $(TOP)/VERSION` >index.html
|
|
|
|
|
|
|
|
sqlite.html: $(TOP)/www/sqlite.tcl
|
|
|
|
tclsh $(TOP)/www/sqlite.tcl >sqlite.html
|
|
|
|
|
|
|
|
c_interface.html: $(TOP)/www/c_interface.tcl
|
|
|
|
tclsh $(TOP)/www/c_interface.tcl >c_interface.html
|
|
|
|
|
|
|
|
changes.html: $(TOP)/www/changes.tcl
|
|
|
|
tclsh $(TOP)/www/changes.tcl >changes.html
|
|
|
|
|
|
|
|
lang.html: $(TOP)/www/lang.tcl
|
|
|
|
tclsh $(TOP)/www/lang.tcl >lang.html
|
|
|
|
|
|
|
|
vdbe.html: $(TOP)/www/vdbe.tcl
|
|
|
|
tclsh $(TOP)/www/vdbe.tcl >vdbe.html
|
|
|
|
|
|
|
|
arch.html: $(TOP)/www/arch.tcl
|
|
|
|
tclsh $(TOP)/www/arch.tcl >arch.html
|
|
|
|
|
|
|
|
arch.png: $(TOP)/www/arch.png
|
|
|
|
cp $(TOP)/www/arch.png .
|
|
|
|
|
|
|
|
opcode.html: $(TOP)/www/opcode.tcl $(TOP)/src/vdbe.c
|
|
|
|
tclsh $(TOP)/www/opcode.tcl $(TOP)/src/vdbe.c >opcode.html
|
|
|
|
|
|
|
|
crosscompile.html: $(TOP)/www/crosscompile.tcl
|
|
|
|
tclsh $(TOP)/www/crosscompile.tcl >crosscompile.html
|
|
|
|
|
|
|
|
mingw.html: $(TOP)/www/mingw.tcl
|
|
|
|
tclsh $(TOP)/www/mingw.tcl >mingw.html
|
|
|
|
|
|
|
|
tclsqlite.html: $(TOP)/www/tclsqlite.tcl
|
|
|
|
tclsh $(TOP)/www/tclsqlite.tcl >tclsqlite.html
|
|
|
|
|
|
|
|
speed.html: $(TOP)/www/speed.tcl
|
|
|
|
tclsh $(TOP)/www/speed.tcl >speed.html
|
|
|
|
|
2001-11-24 03:31:46 +03:00
|
|
|
faq.html: $(TOP)/www/faq.tcl
|
|
|
|
tclsh $(TOP)/www/faq.tcl >faq.html
|
|
|
|
|
2001-12-22 22:27:39 +03:00
|
|
|
formatchng.html: $(TOP)/www/formatchng.tcl
|
|
|
|
tclsh $(TOP)/www/formatchng.tcl >formatchng.html
|
|
|
|
|
2001-09-28 21:47:14 +04:00
|
|
|
download.html: $(TOP)/www/download.tcl
|
|
|
|
tclsh $(TOP)/www/download.tcl >download.html
|
|
|
|
|
2001-09-28 05:34:43 +04:00
|
|
|
|
|
|
|
# Files to be published on the website.
|
|
|
|
#
|
2001-09-28 21:47:14 +04:00
|
|
|
DOC = \
|
2001-09-28 05:34:43 +04:00
|
|
|
index.html \
|
|
|
|
sqlite.html \
|
|
|
|
changes.html \
|
|
|
|
lang.html \
|
|
|
|
opcode.html \
|
|
|
|
arch.html \
|
|
|
|
arch.png \
|
|
|
|
vdbe.html \
|
|
|
|
c_interface.html \
|
|
|
|
crosscompile.html \
|
|
|
|
mingw.html \
|
|
|
|
tclsqlite.html \
|
2001-09-28 21:47:14 +04:00
|
|
|
download.html \
|
2001-11-24 03:31:46 +03:00
|
|
|
speed.html \
|
2001-12-22 22:27:39 +03:00
|
|
|
faq.html \
|
|
|
|
formatchng.html
|
2001-09-28 05:34:43 +04:00
|
|
|
|
2001-09-28 21:47:14 +04:00
|
|
|
doc: $(DOC)
|
|
|
|
mkdir -p doc
|
|
|
|
mv $(DOC) doc
|
2001-09-28 05:34:43 +04:00
|
|
|
|
|
|
|
install: sqlite libsqlite.a sqlite.h
|
|
|
|
mv sqlite /usr/bin
|
|
|
|
mv libsqlite.a /usr/lib
|
|
|
|
mv sqlite.h /usr/include
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f *.o sqlite libsqlite.a sqlite.h
|
2001-09-28 21:47:14 +04:00
|
|
|
rm -f lemon lempar.c parse.* sqlite*.tar.gz
|
2001-09-28 05:34:43 +04:00
|
|
|
rm -f $(PUBLISH)
|
|
|
|
rm -f *.da *.bb *.bbg gmon.out
|
|
|
|
rm -rf tsrc
|