17c478bdstevel@tonic-gate#ident	"%Z%%M%	%I%	%E% SMI"
27c478bdstevel@tonic-gate#
37c478bdstevel@tonic-gate###############################################################################
47c478bdstevel@tonic-gate# The following macros should be defined before this script is
57c478bdstevel@tonic-gate# invoked:
67c478bdstevel@tonic-gate#
77c478bdstevel@tonic-gate# TOP              The toplevel directory of the source tree.  This is the
87c478bdstevel@tonic-gate#                  directory that contains this "Makefile.in" and the
97c478bdstevel@tonic-gate#                  "configure.in" script.
107c478bdstevel@tonic-gate#
117c478bdstevel@tonic-gate# BCC              C Compiler and options for use in building executables that
127c478bdstevel@tonic-gate#                  will run on the platform that is doing the build.
137c478bdstevel@tonic-gate#
147c478bdstevel@tonic-gate# USLEEP           If the target operating system supports the "usleep()" system
157c478bdstevel@tonic-gate#                  call, then define the HAVE_USLEEP macro for all C modules.
167c478bdstevel@tonic-gate#
177c478bdstevel@tonic-gate# THREADSAFE       If you want the SQLite library to be safe for use within a 
187c478bdstevel@tonic-gate#                  multi-threaded program, then define the following macro
197c478bdstevel@tonic-gate#                  appropriately:
207c478bdstevel@tonic-gate#
217c478bdstevel@tonic-gate# THREADLIB        Specify any extra linker options needed to make the library
227c478bdstevel@tonic-gate#                  thread safe
237c478bdstevel@tonic-gate#
247c478bdstevel@tonic-gate# OPTS             Extra compiler command-line options.
257c478bdstevel@tonic-gate#
267c478bdstevel@tonic-gate# EXE              The suffix to add to executable files.  ".exe" for windows
277c478bdstevel@tonic-gate#                  and "" for Unix.
287c478bdstevel@tonic-gate#
297c478bdstevel@tonic-gate# TCC              C Compiler and options for use in building executables that 
307c478bdstevel@tonic-gate#                  will run on the target platform.  This is usually the same
317c478bdstevel@tonic-gate#                  as BCC, unless you are cross-compiling.
327c478bdstevel@tonic-gate#
337c478bdstevel@tonic-gate# AR               Tools used to build a static library.
347c478bdstevel@tonic-gate# RANLIB
357c478bdstevel@tonic-gate#
367c478bdstevel@tonic-gate# TCL_FLAGS        Extra compiler options needed for programs that use the
377c478bdstevel@tonic-gate#                  TCL library.
387c478bdstevel@tonic-gate#
397c478bdstevel@tonic-gate# LIBTCL           Linker options needed to link against the TCL library.
407c478bdstevel@tonic-gate#
417c478bdstevel@tonic-gate# READLINE_FLAGS   Compiler options needed for programs that use the
427c478bdstevel@tonic-gate#                  readline() library.
437c478bdstevel@tonic-gate#
447c478bdstevel@tonic-gate# LIBREADLINE      Linker options needed by programs using readline() must
457c478bdstevel@tonic-gate#                  link against.
467c478bdstevel@tonic-gate#
477c478bdstevel@tonic-gate# ENCODING         "UTF8" or "ISO8859"
487c478bdstevel@tonic-gate#
497c478bdstevel@tonic-gate# Once the macros above are defined, the rest of this make script will
507c478bdstevel@tonic-gate# build the SQLite library and testing tools.
517c478bdstevel@tonic-gate################################################################################
527c478bdstevel@tonic-gate
537c478bdstevel@tonic-gate# This is how we compile
547c478bdstevel@tonic-gate#
557c478bdstevel@tonic-gateTCCX = $(TCC) $(OPTS) $(THREADSAFE) $(USLEEP) -I. -I$(TOP)/src
567c478bdstevel@tonic-gate
577c478bdstevel@tonic-gate# Object files for the SQLite library.
587c478bdstevel@tonic-gate#
597c478bdstevel@tonic-gateLIBOBJ = attach.o auth.o btree.o btree_rb.o build.o copy.o date.o delete.o \
607c478bdstevel@tonic-gate         expr.o func.o hash.o insert.o \
617c478bdstevel@tonic-gate         main.o opcodes.o os.o pager.o parse.o pragma.o printf.o random.o \
627c478bdstevel@tonic-gate         select.o table.o tokenize.o trigger.o update.o util.o \
637c478bdstevel@tonic-gate         vacuum.o vdbe.o vdbeaux.o where.o tclsqlite.o
647c478bdstevel@tonic-gate
657c478bdstevel@tonic-gate# All of the source code files.
667c478bdstevel@tonic-gate#
677c478bdstevel@tonic-gateSRC = \
687c478bdstevel@tonic-gate  $(TOP)/src/attach.c \
697c478bdstevel@tonic-gate  $(TOP)/src/auth.c \
707c478bdstevel@tonic-gate  $(TOP)/src/btree.c \
717c478bdstevel@tonic-gate  $(TOP)/src/btree.h \
727c478bdstevel@tonic-gate  $(TOP)/src/btree_rb.c \
737c478bdstevel@tonic-gate  $(TOP)/src/build.c \
747c478bdstevel@tonic-gate  $(TOP)/src/copy.c \
757c478bdstevel@tonic-gate  $(TOP)/src/date.c \
767c478bdstevel@tonic-gate  $(TOP)/src/delete.c \
777c478bdstevel@tonic-gate  $(TOP)/src/encode.c \
787c478bdstevel@tonic-gate  $(TOP)/src/expr.c \
797c478bdstevel@tonic-gate  $(TOP)/src/func.c \
807c478bdstevel@tonic-gate  $(TOP)/src/hash.c \
817c478bdstevel@tonic-gate  $(TOP)/src/hash.h \
827c478bdstevel@tonic-gate  $(TOP)/src/insert.c \
837c478bdstevel@tonic-gate  $(TOP)/src/main.c \
847c478bdstevel@tonic-gate  $(TOP)/src/os.c \
857c478bdstevel@tonic-gate  $(TOP)/src/pager.c \
867c478bdstevel@tonic-gate  $(TOP)/src/pager.h \
877c478bdstevel@tonic-gate  $(TOP)/src/parse.y \
887c478bdstevel@tonic-gate  $(TOP)/src/pragma.c \
897c478bdstevel@tonic-gate  $(TOP)/src/printf.c \
907c478bdstevel@tonic-gate  $(TOP)/src/random.c \
917c478bdstevel@tonic-gate  $(TOP)/src/select.c \
927c478bdstevel@tonic-gate  $(TOP)/src/shell.c \
937c478bdstevel@tonic-gate  $(TOP)/src/sqlite.h.in \
947c478bdstevel@tonic-gate  $(TOP)/src/sqliteInt.h \
957c478bdstevel@tonic-gate  $(TOP)/src/table.c \
967c478bdstevel@tonic-gate  $(TOP)/src/tclsqlite.c \
977c478bdstevel@tonic-gate  $(TOP)/src/tokenize.c \
987c478bdstevel@tonic-gate  $(TOP)/src/trigger.c \
997c478bdstevel@tonic-gate  $(TOP)/src/update.c \
1007c478bdstevel@tonic-gate  $(TOP)/src/util.c \
1017c478bdstevel@tonic-gate  $(TOP)/src/vacuum.c \
1027c478bdstevel@tonic-gate  $(TOP)/src/vdbe.c \
1037c478bdstevel@tonic-gate  $(TOP)/src/vdbe.h \
1047c478bdstevel@tonic-gate  $(TOP)/src/vdbeaux.c \
1057c478bdstevel@tonic-gate  $(TOP)/src/vdbeInt.h \
1067c478bdstevel@tonic-gate  $(TOP)/src/where.c
1077c478bdstevel@tonic-gate
1087c478bdstevel@tonic-gate# Source code to the test files.
1097c478bdstevel@tonic-gate#
1107c478bdstevel@tonic-gateTESTSRC = \
1117c478bdstevel@tonic-gate  $(TOP)/src/btree.c \
1127c478bdstevel@tonic-gate  $(TOP)/src/func.c \
1137c478bdstevel@tonic-gate  $(TOP)/src/os.c \
1147c478bdstevel@tonic-gate  $(TOP)/src/pager.c \
1157c478bdstevel@tonic-gate  $(TOP)/src/test1.c \
1167c478bdstevel@tonic-gate  $(TOP)/src/test2.c \
1177c478bdstevel@tonic-gate  $(TOP)/src/test3.c \
1187c478bdstevel@tonic-gate  $(TOP)/src/test4.c \
1197c478bdstevel@tonic-gate  $(TOP)/src/vdbe.c \
1207c478bdstevel@tonic-gate  $(TOP)/src/md5.c
1217c478bdstevel@tonic-gate
1227c478bdstevel@tonic-gate# Header files used by all library source files.
1237c478bdstevel@tonic-gate#
1247c478bdstevel@tonic-gateHDR = \
1257c478bdstevel@tonic-gate   sqlite.h  \
1267c478bdstevel@tonic-gate   $(TOP)/src/btree.h \
1277c478bdstevel@tonic-gate   config.h \
1287c478bdstevel@tonic-gate   $(TOP)/src/hash.h \
1297c478bdstevel@tonic-gate   opcodes.h \
1307c478bdstevel@tonic-gate   $(TOP)/src/os.h \
1317c478bdstevel@tonic-gate   $(TOP)/src/sqliteInt.h  \
1327c478bdstevel@tonic-gate   $(TOP)/src/vdbe.h \
1337c478bdstevel@tonic-gate   parse.h
1347c478bdstevel@tonic-gate
1357c478bdstevel@tonic-gate# Header files used by the VDBE submodule
1367c478bdstevel@tonic-gate#
1377c478bdstevel@tonic-gateVDBEHDR = \
1387c478bdstevel@tonic-gate   $(HDR) \
1397c478bdstevel@tonic-gate   $(TOP)/src/vdbeInt.h
1407c478bdstevel@tonic-gate
1417c478bdstevel@tonic-gate# This is the default Makefile target.  The objects listed here
1427c478bdstevel@tonic-gate# are what get build when you type just "make" with no arguments.
1437c478bdstevel@tonic-gate#
1447c478bdstevel@tonic-gateall:	sqlite.h config.h libsqlite.a sqlite$(EXE)
1457c478bdstevel@tonic-gate
1467c478bdstevel@tonic-gate# Generate the file "last_change" which contains the date of change
1477c478bdstevel@tonic-gate# of the most recently modified source code file
1487c478bdstevel@tonic-gate#
1497c478bdstevel@tonic-gatelast_change:	$(SRC)
1507c478bdstevel@tonic-gate	cat $(SRC) | grep '$$Id: ' | sort +4 | tail -1 \
1517c478bdstevel@tonic-gate          | awk '{print $$5,$$6}' >last_change
1527c478bdstevel@tonic-gate
1537c478bdstevel@tonic-gatelibsqlite.a:	$(LIBOBJ)
1547c478bdstevel@tonic-gate	$(AR) libsqlite.a $(LIBOBJ)
1557c478bdstevel@tonic-gate	$(RANLIB) libsqlite.a
1567c478bdstevel@tonic-gate
1577c478bdstevel@tonic-gatesqlite$(EXE):	$(TOP)/src/shell.c libsqlite.a sqlite.h
1587c478bdstevel@tonic-gate	$(TCCX) $(READLINE_FLAGS) -o sqlite$(EXE) $(TOP)/src/shell.c \
1597c478bdstevel@tonic-gate		libsqlite.a $(LIBREADLINE) $(THREADLIB)
1607c478bdstevel@tonic-gate
1617c478bdstevel@tonic-gatesqlite_analyzer$(EXE):	$(TOP)/src/tclsqlite.c libsqlite.a $(TESTSRC) \
1627c478bdstevel@tonic-gate			$(TOP)/tool/spaceanal.tcl
1637c478bdstevel@tonic-gate	sed \
1647c478bdstevel@tonic-gate	  -e '/^#/d' \
1657c478bdstevel@tonic-gate	  -e 's,\\,\\\\,g' \
1667c478bdstevel@tonic-gate	  -e 's,",\\",g' \
1677c478bdstevel@tonic-gate	  -e 's,^,",' \
1687c478bdstevel@tonic-gate	  -e 's,$$,\\n",' \
1697c478bdstevel@tonic-gate	  $(TOP)/tool/spaceanal.tcl >spaceanal_tcl.h
1707c478bdstevel@tonic-gate	$(TCCX) $(TCL_FLAGS) -DTCLSH=2 -DSQLITE_TEST=1 -static -o \
1717c478bdstevel@tonic-gate 		sqlite_analyzer$(EXE) $(TESTSRC) $(TOP)/src/tclsqlite.c \
1727c478bdstevel@tonic-gate		libsqlite.a $(LIBTCL)
1737c478bdstevel@tonic-gate
1747c478bdstevel@tonic-gate
1757c478bdstevel@tonic-gate# This target creates a directory named "tsrc" and fills it with
1767c478bdstevel@tonic-gate# copies of all of the C source code and header files needed to
1777c478bdstevel@tonic-gate# build on the target system.  Some of the C source code and header
1787c478bdstevel@tonic-gate# files are automatically generated.  This target takes care of
1797c478bdstevel@tonic-gate# all that automatic generation.
1807c478bdstevel@tonic-gate#
1817c478bdstevel@tonic-gatetarget_source:	$(SRC) $(VDBEHDR) opcodes.c
1827c478bdstevel@tonic-gate	rm -rf tsrc
1837c478bdstevel@tonic-gate	mkdir tsrc
1847c478bdstevel@tonic-gate	cp $(SRC) $(VDBEHDR) tsrc
1857c478bdstevel@tonic-gate	rm tsrc/sqlite.h.in tsrc/parse.y
1867c478bdstevel@tonic-gate	cp parse.c opcodes.c tsrc
1877c478bdstevel@tonic-gate
1887c478bdstevel@tonic-gate# Rules to build the LEMON compiler generator
1897c478bdstevel@tonic-gate#
1907c478bdstevel@tonic-gatelemon:	$(TOP)/tool/lemon.c $(TOP)/tool/lempar.c
1917c478bdstevel@tonic-gate	$(BCC) -o lemon $(TOP)/tool/lemon.c
1927c478bdstevel@tonic-gate	cp $(TOP)/tool/lempar.c .
1937c478bdstevel@tonic-gate
1947c478bdstevel@tonic-gatebtree.o:	$(TOP)/src/btree.c $(HDR) $(TOP)/src/pager.h
1957c478bdstevel@tonic-gate	$(TCCX) -c $(TOP)/src/btree.c
1967c478bdstevel@tonic-gate
1977c478bdstevel@tonic-gatebtree_rb.o:	$(TOP)/src/btree_rb.c $(HDR)
1987c478bdstevel@tonic-gate	$(TCCX) -c $(TOP)/src/btree_rb.c
1997c478bdstevel@tonic-gate
2007c478bdstevel@tonic-gatebuild.o:	$(TOP)/src/build.c $(HDR)
2017c478bdstevel@tonic-gate	$(TCCX) -c $(TOP)/src/build.c
2027c478bdstevel@tonic-gate
2037c478bdstevel@tonic-gatemain.o:	$(TOP)/src/main.c $(HDR)
2047c478bdstevel@tonic-gate	$(TCCX) -c $(TOP)/src/main.c
2057c478bdstevel@tonic-gate
2067c478bdstevel@tonic-gatepager.o:	$(TOP)/src/pager.c $(HDR) $(TOP)/src/pager.h
2077c478bdstevel@tonic-gate	$(TCCX) -c $(TOP)/src/pager.c
2087c478bdstevel@tonic-gate
2097c478bdstevel@tonic-gateopcodes.o:	opcodes.c
2107c478bdstevel@tonic-gate	$(TCCX) -c opcodes.c
2117c478bdstevel@tonic-gate
2127c478bdstevel@tonic-gateopcodes.c:	$(TOP)/src/vdbe.c
2137c478bdstevel@tonic-gate	echo '/* Automatically generated file.  Do not edit */' >opcodes.c
2147c478bdstevel@tonic-gate	echo 'char *sqliteOpcodeNames[] = { "???", ' >>opcodes.c
2157c478bdstevel@tonic-gate	grep '^case OP_' $(TOP)/src/vdbe.c | \
2167c478bdstevel@tonic-gate	  sed -e 's/^.*OP_/  "/' -e 's/:.*$$/", /' >>opcodes.c
2177c478bdstevel@tonic-gate	echo '};' >>opcodes.c
2187c478bdstevel@tonic-gate
2197c478bdstevel@tonic-gateopcodes.h:	$(TOP)/src/vdbe.h
2207c478bdstevel@tonic-gate	echo '/* Automatically generated file.  Do not edit */' >opcodes.h
2217c478bdstevel@tonic-gate	grep '^case OP_' $(TOP)/src/vdbe.c | \
2227c478bdstevel@tonic-gate	  sed -e 's/://' | \
2237c478bdstevel@tonic-gate	  awk '{printf "#define %-30s %3d\n", $$2, ++cnt}' >>opcodes.h
2247c478bdstevel@tonic-gate
2257c478bdstevel@tonic-gateos.o:	$(TOP)/src/os.c $(HDR)
2267c478bdstevel@tonic-gate	$(TCCX) -c $(TOP)/src/os.c
2277c478bdstevel@tonic-gate
2287c478bdstevel@tonic-gateparse.o:	parse.c $(HDR)
2297c478bdstevel@tonic-gate	$(TCCX) -c parse.c
2307c478bdstevel@tonic-gate
2317c478bdstevel@tonic-gateparse.h:	parse.c
2327c478bdstevel@tonic-gate
2337c478bdstevel@tonic-gateparse.c:	$(TOP)/src/parse.y lemon
2347c478bdstevel@tonic-gate	cp $(TOP)/src/parse.y .
2357c478bdstevel@tonic-gate	./lemon parse.y
2367c478bdstevel@tonic-gate
2377c478bdstevel@tonic-gate# The config.h file will contain a single #define that tells us how
2387c478bdstevel@tonic-gate# many bytes are in a pointer.  This only works if a pointer is the
2397c478bdstevel@tonic-gate# same size on the host as it is on the target.  If you are cross-compiling
2407c478bdstevel@tonic-gate# to a target with a different pointer size, you'll need to manually
2417c478bdstevel@tonic-gate# configure the config.h file.
2427c478bdstevel@tonic-gate#
2437c478bdstevel@tonic-gateconfig.h:	
2447c478bdstevel@tonic-gate	echo '#include <stdio.h>' >temp.c
2457c478bdstevel@tonic-gate	echo 'int main(){printf(' >>temp.c
2467c478bdstevel@tonic-gate	echo '"#define SQLITE_PTR_SZ %d",sizeof(char*));' >>temp.c
2477c478bdstevel@tonic-gate	echo 'exit(0);}' >>temp.c
2487c478bdstevel@tonic-gate	$(BCC) -o temp temp.c
2497c478bdstevel@tonic-gate	./temp >config.h
2507c478bdstevel@tonic-gate	echo >>config.h
2517c478bdstevel@tonic-gate	rm -f temp.c temp
2527c478bdstevel@tonic-gate
2537c478bdstevel@tonic-gatesqlite.h:	$(TOP)/src/sqlite.h.in 
2547c478bdstevel@tonic-gate	sed -e s/--VERS--/`cat ${TOP}/VERSION`/ \
2557c478bdstevel@tonic-gate            -e s/--ENCODING--/$(ENCODING)/ \
2567c478bdstevel@tonic-gate                 $(TOP)/src/sqlite.h.in >sqlite.h
2577c478bdstevel@tonic-gate
2587c478bdstevel@tonic-gatetokenize.o:	$(TOP)/src/tokenize.c $(HDR)
2597c478bdstevel@tonic-gate	$(TCCX) -c $(TOP)/src/tokenize.c
2607c478bdstevel@tonic-gate
2617c478bdstevel@tonic-gatetrigger.o:	$(TOP)/src/trigger.c $(HDR)
2627c478bdstevel@tonic-gate	$(TCCX) -c $(TOP)/src/trigger.c
2637c478bdstevel@tonic-gate
2647c478bdstevel@tonic-gateutil.o:	$(TOP)/src/util.c $(HDR)
2657c478bdstevel@tonic-gate	$(TCCX) -c $(TOP)/src/util.c
2667c478bdstevel@tonic-gate
2677c478bdstevel@tonic-gatevacuum.o:	$(TOP)/src/vacuum.c $(HDR)
2687c478bdstevel@tonic-gate	$(TCCX) -c $(TOP)/src/vacuum.c
2697c478bdstevel@tonic-gate
2707c478bdstevel@tonic-gatevdbe.o:	$(TOP)/src/vdbe.c $(VDBEHDR)
2717c478bdstevel@tonic-gate	$(TCCX) -c $(TOP)/src/vdbe.c
2727c478bdstevel@tonic-gate
2737c478bdstevel@tonic-gatevdbeaux.o:	$(TOP)/src/vdbeaux.c $(VDBEHDR)
2747c478bdstevel@tonic-gate	$(TCCX) -c $(TOP)/src/vdbeaux.c
2757c478bdstevel@tonic-gate
2767c478bdstevel@tonic-gatewhere.o:	$(TOP)/src/where.c $(HDR)
2777c478bdstevel@tonic-gate	$(TCCX) -c $(TOP)/src/where.c
2787c478bdstevel@tonic-gate
2797c478bdstevel@tonic-gatecopy.o:	$(TOP)/src/copy.c $(HDR)
2807c478bdstevel@tonic-gate	$(TCCX) -c $(TOP)/src/copy.c
2817c478bdstevel@tonic-gate
2827c478bdstevel@tonic-gatedate.o:	$(TOP)/src/date.c $(HDR)
2837c478bdstevel@tonic-gate	$(TCCX) -c $(TOP)/src/date.c
2847c478bdstevel@tonic-gate
2857c478bdstevel@tonic-gatedelete.o:	$(TOP)/src/delete.c $(HDR)
2867c478bdstevel@tonic-gate	$(TCCX) -c $(TOP)/src/delete.c
2877c478bdstevel@tonic-gate
2887c478bdstevel@tonic-gateencode.o:	$(TOP)/src/encode.c
2897c478bdstevel@tonic-gate	$(TCCX) -c $(TOP)/src/encode.c
2907c478bdstevel@tonic-gate
2917c478bdstevel@tonic-gateexpr.o:	$(TOP)/src/expr.c $(HDR)
2927c478bdstevel@tonic-gate	$(TCCX) -c $(TOP)/src/expr.c
2937c478bdstevel@tonic-gate
2947c478bdstevel@tonic-gatefunc.o:	$(TOP)/src/func.c $(HDR)
2957c478bdstevel@tonic-gate	$(TCCX) -c $(TOP)/src/func.c
2967c478bdstevel@tonic-gate
2977c478bdstevel@tonic-gatehash.o:	$(TOP)/src/hash.c $(HDR)
2987c478bdstevel@tonic-gate	$(TCCX) -c $(TOP)/src/hash.c
2997c478bdstevel@tonic-gate
3007c478bdstevel@tonic-gateinsert.o:	$(TOP)/src/insert.c $(HDR)
3017c478bdstevel@tonic-gate	$(TCCX) -c $(TOP)/src/insert.c
3027c478bdstevel@tonic-gate
3037c478bdstevel@tonic-gaterandom.o:	$(TOP)/src/random.c $(HDR)
3047c478bdstevel@tonic-gate	$(TCCX) -c $(TOP)/src/random.c
3057c478bdstevel@tonic-gate
3067c478bdstevel@tonic-gateselect.o:	$(TOP)/src/select.c $(HDR)
3077c478bdstevel@tonic-gate	$(TCCX) -c $(TOP)/src/select.c
3087c478bdstevel@tonic-gate
3097c478bdstevel@tonic-gatetable.o:	$(TOP)/src/table.c $(HDR)
3107c478bdstevel@tonic-gate	$(TCCX) -c $(TOP)/src/table.c
3117c478bdstevel@tonic-gate
3127c478bdstevel@tonic-gateupdate.o:	$(TOP)/src/update.c $(HDR)
3137c478bdstevel@tonic-gate	$(TCCX) -c $(TOP)/src/update.c
3147c478bdstevel@tonic-gate
3157c478bdstevel@tonic-gatetclsqlite.o:	$(TOP)/src/tclsqlite.c $(HDR)
3167c478bdstevel@tonic-gate	$(TCCX) $(TCL_FLAGS) -c $(TOP)/src/tclsqlite.c
3177c478bdstevel@tonic-gate
3187c478bdstevel@tonic-gatepragma.o:	$(TOP)/src/pragma.c $(HDR)
3197c478bdstevel@tonic-gate	$(TCCX) $(TCL_FLAGS) -c $(TOP)/src/pragma.c
3207c478bdstevel@tonic-gate
3217c478bdstevel@tonic-gateprintf.o:	$(TOP)/src/printf.c $(HDR)
3227c478bdstevel@tonic-gate	$(TCCX) $(TCL_FLAGS) -c $(TOP)/src/printf.c
3237c478bdstevel@tonic-gate
3247c478bdstevel@tonic-gateattach.o:	$(TOP)/src/attach.c $(HDR)
3257c478bdstevel@tonic-gate	$(TCCX) -c $(TOP)/src/attach.c
3267c478bdstevel@tonic-gate
3277c478bdstevel@tonic-gateauth.o:	$(TOP)/src/auth.c $(HDR)
3287c478bdstevel@tonic-gate	$(TCCX) -c $(TOP)/src/auth.c
3297c478bdstevel@tonic-gate
3307c478bdstevel@tonic-gatetclsqlite:	$(TOP)/src/tclsqlite.c libsqlite.a
3317c478bdstevel@tonic-gate	$(TCCX) $(TCL_FLAGS) -DTCLSH=1 -o tclsqlite \
3327c478bdstevel@tonic-gate		$(TOP)/src/tclsqlite.c libsqlite.a $(LIBTCL)
3337c478bdstevel@tonic-gate
3347c478bdstevel@tonic-gatetestfixture$(EXE):	$(TOP)/src/tclsqlite.c libsqlite.a $(TESTSRC)
3357c478bdstevel@tonic-gate	$(TCCX) $(TCL_FLAGS) -DTCLSH=1 -DSQLITE_TEST=1 -o testfixture$(EXE) \
3367c478bdstevel@tonic-gate		$(TESTSRC) $(TOP)/src/tclsqlite.c \
3377c478bdstevel@tonic-gate		libsqlite.a $(LIBTCL) $(THREADLIB)
3387c478bdstevel@tonic-gate
3397c478bdstevel@tonic-gatefulltest:	testfixture$(EXE) sqlite$(EXE)
3407c478bdstevel@tonic-gate	./testfixture$(EXE) $(TOP)/test/all.test
3417c478bdstevel@tonic-gate
3427c478bdstevel@tonic-gatetest:	testfixture$(EXE) sqlite$(EXE)
3437c478bdstevel@tonic-gate	./testfixture$(EXE) $(TOP)/test/quick.test
3447c478bdstevel@tonic-gate
3457c478bdstevel@tonic-gateindex.html:	$(TOP)/www/index.tcl last_change
3467c478bdstevel@tonic-gate	tclsh $(TOP)/www/index.tcl `cat $(TOP)/VERSION` >index.html
3477c478bdstevel@tonic-gate
3487c478bdstevel@tonic-gatesqlite.html:	$(TOP)/www/sqlite.tcl
3497c478bdstevel@tonic-gate	tclsh $(TOP)/www/sqlite.tcl >sqlite.html
3507c478bdstevel@tonic-gate
3517c478bdstevel@tonic-gatec_interface.html:	$(TOP)/www/c_interface.tcl
3527c478bdstevel@tonic-gate	tclsh $(TOP)/www/c_interface.tcl >c_interface.html
3537c478bdstevel@tonic-gate
3547c478bdstevel@tonic-gatechanges.html:	$(TOP)/www/changes.tcl
3557c478bdstevel@tonic-gate	tclsh $(TOP)/www/changes.tcl >changes.html
3567c478bdstevel@tonic-gate
3577c478bdstevel@tonic-gatelang.html:	$(TOP)/www/lang.tcl
3587c478bdstevel@tonic-gate	tclsh $(TOP)/www/lang.tcl >lang.html
3597c478bdstevel@tonic-gate
3607c478bdstevel@tonic-gatevdbe.html:	$(TOP)/www/vdbe.tcl
3617c478bdstevel@tonic-gate	tclsh $(TOP)/www/vdbe.tcl >vdbe.html
3627c478bdstevel@tonic-gate
3637c478bdstevel@tonic-gatearch.html:	$(TOP)/www/arch.tcl
3647c478bdstevel@tonic-gate	tclsh $(TOP)/www/arch.tcl >arch.html
3657c478bdstevel@tonic-gate
3667c478bdstevel@tonic-gatearch.png:	$(TOP)/www/arch.png
3677c478bdstevel@tonic-gate	cp $(TOP)/www/arch.png .
3687c478bdstevel@tonic-gate
3697c478bdstevel@tonic-gateopcode.html:	$(TOP)/www/opcode.tcl $(TOP)/src/vdbe.c
3707c478bdstevel@tonic-gate	tclsh $(TOP)/www/opcode.tcl $(TOP)/src/vdbe.c >opcode.html
3717c478bdstevel@tonic-gate
3727c478bdstevel@tonic-gatemingw.html:	$(TOP)/www/mingw.tcl
3737c478bdstevel@tonic-gate	tclsh $(TOP)/www/mingw.tcl >mingw.html
3747c478bdstevel@tonic-gate
3757c478bdstevel@tonic-gatetclsqlite.html:	$(TOP)/www/tclsqlite.tcl
3767c478bdstevel@tonic-gate	tclsh $(TOP)/www/tclsqlite.tcl >tclsqlite.html
3777c478bdstevel@tonic-gate
3787c478bdstevel@tonic-gatespeed.html:	$(TOP)/www/speed.tcl
3797c478bdstevel@tonic-gate	tclsh $(TOP)/www/speed.tcl >speed.html
3807c478bdstevel@tonic-gate
3817c478bdstevel@tonic-gatefaq.html:	$(TOP)/www/faq.tcl
3827c478bdstevel@tonic-gate	tclsh $(TOP)/www/faq.tcl >faq.html
3837c478bdstevel@tonic-gate
3847c478bdstevel@tonic-gateformatchng.html:	$(TOP)/www/formatchng.tcl
3857c478bdstevel@tonic-gate	tclsh $(TOP)/www/formatchng.tcl >formatchng.html
3867c478bdstevel@tonic-gate
3877c478bdstevel@tonic-gateconflict.html:	$(TOP)/www/conflict.tcl
3887c478bdstevel@tonic-gate	tclsh $(TOP)/www/conflict.tcl >conflict.html
3897c478bdstevel@tonic-gate
3907c478bdstevel@tonic-gatedownload.html:	$(TOP)/www/download.tcl
3917c478bdstevel@tonic-gate	tclsh $(TOP)/www/download.tcl >download.html
3927c478bdstevel@tonic-gate
3937c478bdstevel@tonic-gateomitted.html:	$(TOP)/www/omitted.tcl
3947c478bdstevel@tonic-gate	tclsh $(TOP)/www/omitted.tcl >omitted.html
3957c478bdstevel@tonic-gate
3967c478bdstevel@tonic-gatedatatypes.html:	$(TOP)/www/datatypes.tcl
3977c478bdstevel@tonic-gate	tclsh $(TOP)/www/datatypes.tcl >datatypes.html
3987c478bdstevel@tonic-gate
3997c478bdstevel@tonic-gatequickstart.html:	$(TOP)/www/quickstart.tcl
4007c478bdstevel@tonic-gate	tclsh $(TOP)/www/quickstart.tcl >quickstart.html
4017c478bdstevel@tonic-gate
4027c478bdstevel@tonic-gatefileformat.html:	$(TOP)/www/fileformat.tcl
4037c478bdstevel@tonic-gate	tclsh $(TOP)/www/fileformat.tcl >fileformat.html
4047c478bdstevel@tonic-gate
4057c478bdstevel@tonic-gatenulls.html:	$(TOP)/www/nulls.tcl
4067c478bdstevel@tonic-gate	tclsh $(TOP)/www/nulls.tcl >nulls.html
4077c478bdstevel@tonic-gate
4087c478bdstevel@tonic-gate
4097c478bdstevel@tonic-gate# Files to be published on the website.
4107c478bdstevel@tonic-gate#
4117c478bdstevel@tonic-gateDOC = \
4127c478bdstevel@tonic-gate  index.html \
4137c478bdstevel@tonic-gate  sqlite.html \
4147c478bdstevel@tonic-gate  changes.html \
4157c478bdstevel@tonic-gate  lang.html \
4167c478bdstevel@tonic-gate  opcode.html \
4177c478bdstevel@tonic-gate  arch.html \
4187c478bdstevel@tonic-gate  arch.png \
4197c478bdstevel@tonic-gate  vdbe.html \
4207c478bdstevel@tonic-gate  c_interface.html \
4217c478bdstevel@tonic-gate  mingw.html \
4227c478bdstevel@tonic-gate  tclsqlite.html \
4237c478bdstevel@tonic-gate  download.html \
4247c478bdstevel@tonic-gate  speed.html \
4257c478bdstevel@tonic-gate  faq.html \
4267c478bdstevel@tonic-gate  formatchng.html \
4277c478bdstevel@tonic-gate  conflict.html \
4287c478bdstevel@tonic-gate  omitted.html \
4297c478bdstevel@tonic-gate  datatypes.html \
4307c478bdstevel@tonic-gate  quickstart.html \
4317c478bdstevel@tonic-gate  fileformat.html \
4327c478bdstevel@tonic-gate  nulls.html
4337c478bdstevel@tonic-gate
4347c478bdstevel@tonic-gatedoc:	$(DOC)
4357c478bdstevel@tonic-gate	mkdir -p doc
4367c478bdstevel@tonic-gate	mv $(DOC) doc
4377c478bdstevel@tonic-gate
4387c478bdstevel@tonic-gateinstall:	sqlite libsqlite.a sqlite.h
4397c478bdstevel@tonic-gate	mv sqlite /usr/bin
4407c478bdstevel@tonic-gate	mv libsqlite.a /usr/lib
4417c478bdstevel@tonic-gate	mv sqlite.h /usr/include
4427c478bdstevel@tonic-gate
4437c478bdstevel@tonic-gateclean:	
4447c478bdstevel@tonic-gate	rm -f *.o sqlite libsqlite.a sqlite.h opcodes.*
4457c478bdstevel@tonic-gate	rm -f lemon lempar.c parse.* sqlite*.tar.gz
4467c478bdstevel@tonic-gate	rm -f $(PUBLISH)
4477c478bdstevel@tonic-gate	rm -f *.da *.bb *.bbg gmon.out
4487c478bdstevel@tonic-gate	rm -rf tsrc
449