sqlite/Makefile.in
drh 271cbff6c6 :-) (CVS 97)
FossilOrigin-Name: 3b9689cc35acd3008ca32b6b9882f4e625381c6e
2000-06-15 11:32:11 +00:00

226 lines
5.4 KiB
Makefile

#!/usr/make
#
# Makefile for SQLITE
# The toplevel directory of the source tree
#
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
# will run on the target platform.
#
TCC = @TARGET_CC@ @TARGET_CFLAGS@ -I. -I${TOP}/src
# Tools used to build a static library.
#
AR = @TARGET_AR@
RANLIB = @TARGET_RANLIB@
# Compiler options needed for programs that use the GDBM library.
#
GDBM_FLAGS = @TARGET_GDBM_INC@
# The library that programs using GDBM must link against.
#
LIBGDBM = @TARGET_GDBM_LIBS@
# 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@
# 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@
# Object files for the SQLite library.
#
LIBOBJ = build.o dbbe.o delete.o expr.o insert.o \
main.o parse.o select.o tokenize.o update.o \
util.o vdbe.o where.o
# All of the source code files.
#
SRC = \
$(TOP)/src/build.c \
$(TOP)/src/dbbe.c \
$(TOP)/src/dbbe.h \
$(TOP)/src/delete.c \
$(TOP)/src/expr.c \
$(TOP)/src/insert.c \
$(TOP)/src/main.c \
$(TOP)/src/parse.y \
$(TOP)/src/select.c \
$(TOP)/src/shell.c \
$(TOP)/src/sqlite.h \
$(TOP)/src/sqliteInt.h \
$(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
# This is the default Makefile target. The objects listed here
# are what get build when you type just "make" with no arguments.
#
all: libsqlite.a sqlite.h sqlite
# 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)
$(AR) libsqlite.a $(LIBOBJ)
$(RANLIB) libsqlite.a
sqlite: $(TOP)/src/shell.c libsqlite.a sqlite.h
$(TCC) $(READLINE_FLAGS) -o sqlite $(TOP)/src/shell.c \
libsqlite.a $(LIBGDBM) $(LIBREADLINE)
# 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 = \
$(TOP)/src/sqlite.h \
$(TOP)/src/sqliteInt.h \
$(TOP)/src/dbbe.h \
$(TOP)/src/vdbe.h \
parse.h
build.o: $(TOP)/src/build.c $(HDR)
$(TCC) $(GDBM_FLAGS) -c $(TOP)/src/build.c
dbbe.o: $(TOP)/src/dbbe.c $(HDR)
$(TCC) $(GDBM_FLAGS) -c $(TOP)/src/dbbe.c
main.o: $(TOP)/src/main.c $(HDR)
$(TCC) $(GDBM_FLAGS) -c $(TOP)/src/main.c
parse.o: parse.c $(HDR)
$(TCC) $(GDBM_FLAGS) -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
cp $(TOP)/src/sqlite.h .
tokenize.o: $(TOP)/src/tokenize.c $(HDR)
$(TCC) $(GDBM_FLAGS) -c $(TOP)/src/tokenize.c
util.o: $(TOP)/src/util.c $(HDR)
$(TCC) $(GDBM_FLAGS) -c $(TOP)/src/util.c
vdbe.o: $(TOP)/src/vdbe.c $(HDR)
$(TCC) $(GDBM_FLAGS) -c $(TOP)/src/vdbe.c
where.o: $(TOP)/src/where.c $(HDR)
$(TCC) $(GDBM_FLAGS) -c $(TOP)/src/where.c
delete.o: $(TOP)/src/delete.c $(HDR)
$(TCC) $(GDBM_FLAGS) -c $(TOP)/src/delete.c
expr.o: $(TOP)/src/expr.c $(HDR)
$(TCC) $(GDBM_FLAGS) -c $(TOP)/src/expr.c
insert.o: $(TOP)/src/insert.c $(HDR)
$(TCC) $(GDBM_FLAGS) -c $(TOP)/src/insert.c
select.o: $(TOP)/src/select.c $(HDR)
$(TCC) $(GDBM_FLAGS) -c $(TOP)/src/select.c
update.o: $(TOP)/src/update.c $(HDR)
$(TCC) $(GDBM_FLAGS) -c $(TOP)/src/update.c
gdbmdump: $(TOP)/tool/gdbmdump.c
$(TCC) $(GDBM_FLAGS) -o gdbmdump $(TOP)/tool/gdbmdump.c $(LIBGDBM)
tclsqlite: $(TOP)/src/tclsqlite.c libsqlite.a
$(TCC) $(TCL_FLAGS) -DTCLSH=1 -o tclsqlite \
$(TOP)/src/tclsqlite.c libsqlite.a $(LIBGDBM) $(LIBTCL)
test: tclsqlite
./tclsqlite $(TOP)/test/all.test
sqlite.tar.gz:
pwd=`pwd`; cd $(TOP)/..; tar czf $$pwd/sqlite.tar.gz sqlite
index.html: $(TOP)/www/index.tcl sqlite.tar.gz last_change
tclsh $(TOP)/www/index.tcl >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
fileformat.html: $(TOP)/www/fileformat.tcl
tclsh $(TOP)/www/fileformat.tcl >fileformat.html
lang.html: $(TOP)/www/lang.tcl
tclsh $(TOP)/www/lang.tcl >lang.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
# Files to be published on the website.
#
PUBLISH = \
sqlite.tar.gz \
index.html \
sqlite.html \
changes.html \
fileformat.html \
lang.html \
opcode.html \
arch.html \
arch.png \
c_interface.html
website: $(PUBLISH)
publish: $(PUBLISH)
chmod 0644 $(PUBLISH)
scp $(PUBLISH) hwaci@oak.he.net:public_html/sw/sqlite
clean:
rm -f *.o sqlite libsqlite.a sqlite.h
rm -f lemon lempar.c parse.* sqlite.tar.gz
rm -f $(PUBLISH)
rm -f *.da *.bb *.bbg gmon.out