2000-05-29 18:26:00 +04:00
|
|
|
#!/usr/make
|
|
|
|
#
|
|
|
|
# Makefile for SQLITE
|
2001-09-15 04:57:59 +04:00
|
|
|
#
|
|
|
|
# This makefile is suppose to be configured automatically using the
|
|
|
|
# autoconf. But if that does not work for you, you can configure
|
|
|
|
# the makefile manually. Just set the parameters below to values that
|
|
|
|
# work well for your system.
|
|
|
|
#
|
|
|
|
# If the configure script does not work out-of-the-box, you might
|
|
|
|
# be able to get it to work by giving it some hints. See the comment
|
|
|
|
# at the beginning of configure.in for additional information.
|
|
|
|
#
|
2000-05-29 18:26:00 +04:00
|
|
|
|
2001-09-15 04:57:59 +04:00
|
|
|
# The toplevel directory of the source tree. This is the directory
|
|
|
|
# that contains this "Makefile.in" and the "configure.in" script.
|
2000-05-29 18:26:00 +04:00
|
|
|
#
|
|
|
|
TOP = @srcdir@
|
|
|
|
|
|
|
|
# C Compiler and options for use in building executables that
|
|
|
|
# will run on the platform that is doing the build.
|
|
|
|
#
|
|
|
|
BCC = @BUILD_CC@ @BUILD_CFLAGS@
|
|
|
|
|
|
|
|
# C Compile and options for use in building executables that
|
2001-09-15 04:57:59 +04:00
|
|
|
# will run on the target platform. (BCC and TCC are usually the
|
|
|
|
# same unless your are cross-compiling.)
|
2000-05-29 18:26:00 +04:00
|
|
|
#
|
|
|
|
TCC = @TARGET_CC@ @TARGET_CFLAGS@ -I. -I${TOP}/src
|
|
|
|
|
|
|
|
# Tools used to build a static library.
|
|
|
|
#
|
|
|
|
AR = @TARGET_AR@
|
|
|
|
RANLIB = @TARGET_RANLIB@
|
|
|
|
|
2000-05-30 00:41:49 +04:00
|
|
|
# Compiler options needed for programs that use the TCL library.
|
|
|
|
#
|
|
|
|
TCL_FLAGS = @TARGET_TCL_INC@
|
|
|
|
|
|
|
|
# The library that programs using TCL must link against.
|
|
|
|
#
|
|
|
|
LIBTCL = @TARGET_TCL_LIBS@
|
|
|
|
|
2000-05-29 18:26:00 +04:00
|
|
|
# Compiler options needed for programs that use the readline() library.
|
|
|
|
#
|
|
|
|
READLINE_FLAGS = -DHAVE_READLINE=@TARGET_HAVE_READLINE@ @TARGET_READLINE_INC@
|
|
|
|
|
|
|
|
# The library that programs using readline() must link against.
|
|
|
|
#
|
|
|
|
LIBREADLINE = @TARGET_READLINE_LIBS@
|
|
|
|
|
2001-09-15 04:57:59 +04:00
|
|
|
# Should the database engine assume text is coded as UTF-8 or iso8859?
|
|
|
|
#
|
|
|
|
# ENCODING = UTF8
|
|
|
|
# ENCODING = ISO8859
|
|
|
|
ENCODING = @ENCODING@
|
|
|
|
|
|
|
|
# You should not have to change anything below this line
|
|
|
|
###############################################################################
|
|
|
|
|
2000-05-29 18:26:00 +04:00
|
|
|
# Object files for the SQLite library.
|
|
|
|
#
|
2001-09-13 18:46:09 +04:00
|
|
|
LIBOBJ = btree.o build.o delete.o expr.o insert.o \
|
2001-08-20 04:33:58 +04:00
|
|
|
main.o pager.o parse.o printf.o random.o select.o table.o \
|
2001-04-15 04:37:09 +04:00
|
|
|
tokenize.o update.o util.o vdbe.o where.o tclsqlite.o
|
2000-05-29 18:26:00 +04:00
|
|
|
|
2000-06-02 17:27:59 +04:00
|
|
|
# All of the source code files.
|
|
|
|
#
|
|
|
|
SRC = \
|
2001-08-20 04:33:58 +04:00
|
|
|
$(TOP)/src/btree.c \
|
2001-09-13 18:46:09 +04:00
|
|
|
$(TOP)/src/btree.h \
|
2000-06-02 17:27:59 +04:00
|
|
|
$(TOP)/src/build.c \
|
|
|
|
$(TOP)/src/delete.c \
|
|
|
|
$(TOP)/src/expr.c \
|
|
|
|
$(TOP)/src/insert.c \
|
|
|
|
$(TOP)/src/main.c \
|
2001-08-20 04:33:58 +04:00
|
|
|
$(TOP)/src/pager.c \
|
2001-09-13 18:46:09 +04:00
|
|
|
$(TOP)/src/pager.h \
|
2000-06-02 17:27:59 +04:00
|
|
|
$(TOP)/src/parse.y \
|
2000-10-09 02:20:57 +04:00
|
|
|
$(TOP)/src/printf.c \
|
2001-01-13 17:34:05 +03:00
|
|
|
$(TOP)/src/random.c \
|
2000-06-02 17:27:59 +04:00
|
|
|
$(TOP)/src/select.c \
|
|
|
|
$(TOP)/src/shell.c \
|
2000-08-17 14:22:34 +04:00
|
|
|
$(TOP)/src/sqlite.h.in \
|
2000-06-02 17:27:59 +04:00
|
|
|
$(TOP)/src/sqliteInt.h \
|
2000-09-29 17:30:53 +04:00
|
|
|
$(TOP)/src/table.c \
|
2000-06-02 17:27:59 +04:00
|
|
|
$(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
|
|
|
|
|
2001-04-15 04:37:09 +04:00
|
|
|
# Source code to the test files.
|
|
|
|
#
|
|
|
|
TESTSRC = \
|
2001-08-20 04:33:58 +04:00
|
|
|
$(TOP)/src/btree.c \
|
|
|
|
$(TOP)/src/pager.c \
|
2001-04-15 04:37:09 +04:00
|
|
|
$(TOP)/src/test1.c \
|
2001-08-20 04:33:58 +04:00
|
|
|
$(TOP)/src/test2.c \
|
|
|
|
$(TOP)/src/test3.c \
|
2001-07-02 02:12:01 +04:00
|
|
|
$(TOP)/src/md5.c
|
2001-04-15 04:37:09 +04:00
|
|
|
|
2000-05-29 18:26:00 +04:00
|
|
|
# This is the default Makefile target. The objects listed here
|
|
|
|
# are what get build when you type just "make" with no arguments.
|
|
|
|
#
|
2000-08-17 14:22:34 +04:00
|
|
|
all: sqlite.h libsqlite.a sqlite
|
2000-05-29 18:26:00 +04:00
|
|
|
|
2000-06-02 17:27:59 +04:00
|
|
|
# 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
|
|
|
|
|
2000-05-29 18:26:00 +04:00
|
|
|
libsqlite.a: $(LIBOBJ)
|
|
|
|
$(AR) libsqlite.a $(LIBOBJ)
|
|
|
|
$(RANLIB) libsqlite.a
|
|
|
|
|
2000-05-29 21:44:25 +04:00
|
|
|
sqlite: $(TOP)/src/shell.c libsqlite.a sqlite.h
|
2000-05-29 18:26:00 +04:00
|
|
|
$(TCC) $(READLINE_FLAGS) -o sqlite $(TOP)/src/shell.c \
|
2001-09-15 04:57:59 +04:00
|
|
|
libsqlite.a $(LIBREADLINE)
|
2000-05-29 18:26:00 +04:00
|
|
|
|
|
|
|
# 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 .
|
|
|
|
|
|
|
|
# Header files used by all library source files.
|
|
|
|
#
|
|
|
|
HDR = \
|
2000-08-17 14:22:34 +04:00
|
|
|
sqlite.h \
|
2001-09-13 18:46:09 +04:00
|
|
|
$(TOP)/src/btree.h \
|
2000-05-29 18:26:00 +04:00
|
|
|
$(TOP)/src/sqliteInt.h \
|
|
|
|
$(TOP)/src/vdbe.h \
|
|
|
|
parse.h
|
|
|
|
|
2001-09-13 18:46:09 +04:00
|
|
|
btree.o: $(TOP)/src/btree.c $(HDR) $(TOP)/src/pager.h
|
2001-09-15 04:57:59 +04:00
|
|
|
$(TCC) -c $(TOP)/src/btree.c
|
2001-08-20 04:33:58 +04:00
|
|
|
|
2000-05-29 18:26:00 +04:00
|
|
|
build.o: $(TOP)/src/build.c $(HDR)
|
2001-09-15 04:57:59 +04:00
|
|
|
$(TCC) -c $(TOP)/src/build.c
|
2000-05-29 18:26:00 +04:00
|
|
|
|
|
|
|
main.o: $(TOP)/src/main.c $(HDR)
|
2001-09-15 04:57:59 +04:00
|
|
|
$(TCC) -c $(TOP)/src/main.c
|
2000-05-29 18:26:00 +04:00
|
|
|
|
2001-09-13 18:46:09 +04:00
|
|
|
pager.o: $(TOP)/src/pager.c $(HDR) $(TOP)/src/pager.h
|
2001-09-15 04:57:59 +04:00
|
|
|
$(TCC) -c $(TOP)/src/pager.c
|
2001-08-20 04:33:58 +04:00
|
|
|
|
2000-05-29 18:26:00 +04:00
|
|
|
parse.o: parse.c $(HDR)
|
2001-09-15 04:57:59 +04:00
|
|
|
$(TCC) -c parse.c
|
2000-05-29 18:26:00 +04:00
|
|
|
|
|
|
|
parse.h: parse.c
|
|
|
|
|
|
|
|
parse.c: $(TOP)/src/parse.y lemon
|
|
|
|
cp $(TOP)/src/parse.y .
|
|
|
|
./lemon parse.y
|
|
|
|
|
2000-08-22 17:40:18 +04:00
|
|
|
sqlite.h: $(TOP)/src/sqlite.h.in
|
2001-04-05 19:57:13 +04:00
|
|
|
sed -e s/--VERS--/`cat ${TOP}/VERSION`/ \
|
2001-09-15 04:57:59 +04:00
|
|
|
-e s/--ENCODING--/$(ENCODING)/ \
|
2001-04-05 19:57:13 +04:00
|
|
|
$(TOP)/src/sqlite.h.in >sqlite.h
|
2000-05-29 21:44:25 +04:00
|
|
|
|
2000-05-29 18:26:00 +04:00
|
|
|
tokenize.o: $(TOP)/src/tokenize.c $(HDR)
|
2001-09-15 04:57:59 +04:00
|
|
|
$(TCC) -c $(TOP)/src/tokenize.c
|
2000-05-29 18:26:00 +04:00
|
|
|
|
|
|
|
util.o: $(TOP)/src/util.c $(HDR)
|
2001-09-15 04:57:59 +04:00
|
|
|
$(TCC) -c $(TOP)/src/util.c
|
2000-05-29 18:26:00 +04:00
|
|
|
|
|
|
|
vdbe.o: $(TOP)/src/vdbe.c $(HDR)
|
2001-09-15 04:57:59 +04:00
|
|
|
$(TCC) -c $(TOP)/src/vdbe.c
|
2000-05-29 18:26:00 +04:00
|
|
|
|
|
|
|
where.o: $(TOP)/src/where.c $(HDR)
|
2001-09-15 04:57:59 +04:00
|
|
|
$(TCC) -c $(TOP)/src/where.c
|
2000-05-29 18:26:00 +04:00
|
|
|
|
2000-05-31 19:34:51 +04:00
|
|
|
delete.o: $(TOP)/src/delete.c $(HDR)
|
2001-09-15 04:57:59 +04:00
|
|
|
$(TCC) -c $(TOP)/src/delete.c
|
2000-05-31 19:34:51 +04:00
|
|
|
|
|
|
|
expr.o: $(TOP)/src/expr.c $(HDR)
|
2001-09-15 04:57:59 +04:00
|
|
|
$(TCC) -c $(TOP)/src/expr.c
|
2000-05-31 19:34:51 +04:00
|
|
|
|
|
|
|
insert.o: $(TOP)/src/insert.c $(HDR)
|
2001-09-15 04:57:59 +04:00
|
|
|
$(TCC) -c $(TOP)/src/insert.c
|
2000-05-31 19:34:51 +04:00
|
|
|
|
2001-01-13 17:34:05 +03:00
|
|
|
random.o: $(TOP)/src/random.c $(HDR)
|
2001-09-15 04:57:59 +04:00
|
|
|
$(TCC) -c $(TOP)/src/random.c
|
2001-01-13 17:34:05 +03:00
|
|
|
|
2000-05-31 19:34:51 +04:00
|
|
|
select.o: $(TOP)/src/select.c $(HDR)
|
2001-09-15 04:57:59 +04:00
|
|
|
$(TCC) -c $(TOP)/src/select.c
|
2000-05-31 19:34:51 +04:00
|
|
|
|
2000-09-29 17:30:53 +04:00
|
|
|
table.o: $(TOP)/src/table.c $(HDR)
|
2001-09-15 04:57:59 +04:00
|
|
|
$(TCC) -c $(TOP)/src/table.c
|
2000-09-29 17:30:53 +04:00
|
|
|
|
2000-05-31 19:34:51 +04:00
|
|
|
update.o: $(TOP)/src/update.c $(HDR)
|
2001-09-15 04:57:59 +04:00
|
|
|
$(TCC) -c $(TOP)/src/update.c
|
2000-05-31 19:34:51 +04:00
|
|
|
|
2000-09-21 17:01:35 +04:00
|
|
|
tclsqlite.o: $(TOP)/src/tclsqlite.c $(HDR)
|
2001-09-15 04:57:59 +04:00
|
|
|
$(TCC) $(TCL_FLAGS) -c $(TOP)/src/tclsqlite.c
|
2000-09-21 17:01:35 +04:00
|
|
|
|
2000-10-09 02:20:57 +04:00
|
|
|
printf.o: $(TOP)/src/printf.c $(HDR)
|
2001-09-15 04:57:59 +04:00
|
|
|
$(TCC) $(TCL_FLAGS) -c $(TOP)/src/printf.c
|
2000-05-30 00:41:49 +04:00
|
|
|
|
|
|
|
tclsqlite: $(TOP)/src/tclsqlite.c libsqlite.a
|
2001-04-28 20:52:40 +04:00
|
|
|
$(TCC) $(TCL_FLAGS) -DTCLSH=1 -o tclsqlite \
|
2001-09-15 04:57:59 +04:00
|
|
|
$(TOP)/src/tclsqlite.c libsqlite.a $(LIBTCL)
|
2000-05-30 00:41:49 +04:00
|
|
|
|
2001-04-28 20:52:40 +04:00
|
|
|
testfixture: $(TOP)/src/tclsqlite.c libsqlite.a $(TESTSRC)
|
|
|
|
$(TCC) $(TCL_FLAGS) -DTCLSH=1 -DSQLITE_TEST=1 -o testfixture \
|
2001-07-23 18:33:02 +04:00
|
|
|
$(TESTSRC) $(TOP)/src/tclsqlite.c \
|
2001-09-15 04:57:59 +04:00
|
|
|
libsqlite.a $(LIBTCL)
|
2001-04-07 19:24:33 +04:00
|
|
|
|
2001-04-28 20:52:40 +04:00
|
|
|
test: testfixture sqlite
|
|
|
|
./testfixture $(TOP)/test/all.test
|
2000-05-30 00:41:49 +04:00
|
|
|
|
2000-05-29 21:44:25 +04:00
|
|
|
sqlite.tar.gz:
|
2000-06-03 23:28:48 +04:00
|
|
|
pwd=`pwd`; cd $(TOP)/..; tar czf $$pwd/sqlite.tar.gz sqlite
|
2000-05-29 22:32:16 +04:00
|
|
|
|
2000-06-03 23:28:48 +04:00
|
|
|
index.html: $(TOP)/www/index.tcl sqlite.tar.gz last_change
|
2000-08-17 14:22:34 +04:00
|
|
|
tclsh $(TOP)/www/index.tcl `cat $(TOP)/VERSION` >index.html
|
2000-05-29 21:44:25 +04:00
|
|
|
|
|
|
|
sqlite.html: $(TOP)/www/sqlite.tcl
|
|
|
|
tclsh $(TOP)/www/sqlite.tcl >sqlite.html
|
|
|
|
|
2000-05-29 22:32:16 +04:00
|
|
|
c_interface.html: $(TOP)/www/c_interface.tcl
|
|
|
|
tclsh $(TOP)/www/c_interface.tcl >c_interface.html
|
|
|
|
|
2000-05-31 06:27:49 +04:00
|
|
|
changes.html: $(TOP)/www/changes.tcl
|
|
|
|
tclsh $(TOP)/www/changes.tcl >changes.html
|
|
|
|
|
2000-06-08 23:38:36 +04:00
|
|
|
fileformat.html: $(TOP)/www/fileformat.tcl
|
|
|
|
tclsh $(TOP)/www/fileformat.tcl >fileformat.html
|
|
|
|
|
2000-06-09 01:53:06 +04:00
|
|
|
lang.html: $(TOP)/www/lang.tcl
|
|
|
|
tclsh $(TOP)/www/lang.tcl >lang.html
|
|
|
|
|
2000-06-23 21:02:08 +04:00
|
|
|
vdbe.html: $(TOP)/www/vdbe.tcl
|
|
|
|
tclsh $(TOP)/www/vdbe.tcl >vdbe.html
|
|
|
|
|
2000-06-09 05:58:35 +04:00
|
|
|
arch.html: $(TOP)/www/arch.tcl
|
|
|
|
tclsh $(TOP)/www/arch.tcl >arch.html
|
|
|
|
|
|
|
|
arch.png: $(TOP)/www/arch.png
|
|
|
|
cp $(TOP)/www/arch.png .
|
|
|
|
|
2000-06-09 18:14:32 +04:00
|
|
|
opcode.html: $(TOP)/www/opcode.tcl $(TOP)/src/vdbe.c
|
2000-06-09 05:58:35 +04:00
|
|
|
tclsh $(TOP)/www/opcode.tcl $(TOP)/src/vdbe.c >opcode.html
|
|
|
|
|
2000-07-31 22:56:15 +04:00
|
|
|
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
|
|
|
|
|
2000-10-01 02:46:05 +04:00
|
|
|
tclsqlite.html: $(TOP)/www/tclsqlite.tcl
|
|
|
|
tclsh $(TOP)/www/tclsqlite.tcl >tclsqlite.html
|
|
|
|
|
2000-06-09 05:58:35 +04:00
|
|
|
|
2000-05-29 22:32:16 +04:00
|
|
|
# Files to be published on the website.
|
|
|
|
#
|
|
|
|
PUBLISH = \
|
|
|
|
sqlite.tar.gz \
|
|
|
|
index.html \
|
|
|
|
sqlite.html \
|
2000-05-31 06:27:49 +04:00
|
|
|
changes.html \
|
2000-06-08 23:38:36 +04:00
|
|
|
fileformat.html \
|
2000-06-09 01:53:06 +04:00
|
|
|
lang.html \
|
2000-06-09 05:58:35 +04:00
|
|
|
opcode.html \
|
|
|
|
arch.html \
|
|
|
|
arch.png \
|
2000-06-23 21:02:08 +04:00
|
|
|
vdbe.html \
|
2000-07-31 22:56:15 +04:00
|
|
|
c_interface.html \
|
|
|
|
crosscompile.html \
|
2000-10-01 02:46:05 +04:00
|
|
|
mingw.html \
|
|
|
|
tclsqlite.html
|
2000-05-29 22:32:16 +04:00
|
|
|
|
2000-05-29 22:50:16 +04:00
|
|
|
website: $(PUBLISH)
|
|
|
|
|
2000-05-29 22:32:16 +04:00
|
|
|
publish: $(PUBLISH)
|
2000-06-15 15:32:11 +04:00
|
|
|
chmod 0644 $(PUBLISH)
|
2000-05-29 22:50:16 +04:00
|
|
|
scp $(PUBLISH) hwaci@oak.he.net:public_html/sw/sqlite
|
2000-05-29 22:32:16 +04:00
|
|
|
|
2000-08-22 17:47:56 +04:00
|
|
|
install: sqlite libsqlite.a sqlite.h
|
|
|
|
mv sqlite /usr/bin
|
|
|
|
mv libsqlite.a /usr/lib
|
|
|
|
mv sqlite.h /usr/include
|
|
|
|
|
2000-05-29 18:26:00 +04:00
|
|
|
clean:
|
2000-05-29 21:44:25 +04:00
|
|
|
rm -f *.o sqlite libsqlite.a sqlite.h
|
|
|
|
rm -f lemon lempar.c parse.* sqlite.tar.gz
|
2000-05-30 00:41:49 +04:00
|
|
|
rm -f $(PUBLISH)
|
2000-06-03 23:19:41 +04:00
|
|
|
rm -f *.da *.bb *.bbg gmon.out
|