1 ###############################################################################
2 # The following macros should be defined before this script is
5 # TOP The toplevel directory of the source tree. This is the
6 # directory that contains this "Makefile.in" and the
7 # "configure.in" script.
9 # BCC C Compiler and options for use in building executables that
10 # will run on the platform that is doing the build.
12 # USLEEP If the target operating system supports the "usleep()" system
13 # call, then define the HAVE_USLEEP macro for all C modules.
15 # THREADSAFE If you want the SQLite library to be safe for use within a
16 # multi-threaded program, then define the following macro
19 # THREADLIB Specify any extra linker options needed to make the library
22 # OPTS Extra compiler command-line options.
24 # EXE The suffix to add to executable files. ".exe" for windows
27 # TCC C Compiler and options for use in building executables that
28 # will run on the target platform. This is usually the same
29 # as BCC, unless you are cross-compiling.
31 # AR Tools used to build a static library.
34 # TCL_FLAGS Extra compiler options needed for programs that use the
37 # LIBTCL Linker options needed to link against the TCL library.
39 # READLINE_FLAGS Compiler options needed for programs that use the
42 # LIBREADLINE Linker options needed by programs using readline() must
45 # ENCODING "UTF8" or "ISO8859"
47 # Once the macros above are defined, the rest of this make script will
48 # build the SQLite library and testing tools.
49 ################################################################################
51 # This is how we compile
53 TCCX
= $(TCC
) $(OPTS
) $(THREADSAFE
) $(USLEEP
) -I.
-I
$(TOP
)/src
56 # Source code to the test files.
62 $(TOP
)/src
/os_unix.c \
77 # Header files used by the VDBE submodule
83 # This is the default Makefile target. The objects listed here
84 # are what get build when you type just "make" with no arguments.
86 #all: sqlite3.h libsqlite3.a sqlite3$(EXE)
88 # Generate the file "last_change" which contains the date of change
89 # of the most recently modified source code file
92 cat
`for x in $(FILES); do echo "$x".c; done` | grep
'$$Id: ' |
sort +4 | tail
-1 \
93 | awk
'{print $$5,$$6}' >last_change
95 libsqlite3.a
: $(LIBOBJ
)
96 $(AR
) libsqlite3.a
$(LIBOBJ
)
97 $(RANLIB
) libsqlite3.a
99 sqlite3
$(EXE
): $(TOP
)/src
/shell.c libsqlite3.a sqlite3.h
100 $(TCCX
) $(READLINE_FLAGS
) -o sqlite3
$(EXE
) $(TOP
)/src
/shell.c \
101 libsqlite3.a
$(LIBREADLINE
) $(THREADLIB
)
103 objects
: $(LIBOBJ_ORIG
)
105 # This target creates a directory named "tsrc" and fills it with
106 # copies of all of the C source code and header files needed to
107 # build on the target system. Some of the C source code and header
108 # files are automatically generated. This target takes care of
109 # all that automatic generation.
111 target_source
: $(SRC
) $(VDBEHDR
) opcodes.c keywordhash.h
114 cp
$(SRC
) $(VDBEHDR
) tsrc
115 rm tsrc
/sqlite.h.in tsrc
/parse.y
116 cp parse.c opcodes.c keywordhash.h tsrc
117 cp
$(TOP
)/sqlite3.def tsrc
119 testfixture
$(EXE
): $(TOP
)/src
/tclsqlite.c libsqlite3.a
$(TESTSRC
)
120 $(TCCX
) $(TCL_FLAGS
) -DTCLSH
=1 -DSQLITE_TEST
=1 -o testfixture
$(EXE
) \
121 $(TESTSRC
) $(TOP
)/src
/tclsqlite.c \
122 libsqlite3.a
$(LIBTCL
) $(THREADLIB
)
124 crashtest
: $(TOP
)/src
/tclsqlite.c libsqlite3.a
$(TESTSRC
) $(TOP
)/src
/os_test.c
125 $(TCCX
) $(TCL_FLAGS
) -DOS_TEST
=1 -DTCLSH
=1 -DSQLITE_TEST
=1 \
127 $(TESTSRC
) $(TOP
)/src
/os_test.c
$(TOP
)/src
/tclsqlite.c \
128 libsqlite3.a
$(LIBTCL
) $(THREADLIB
)
130 fulltest
: testfixture
$(EXE
) sqlite3
$(EXE
) crashtest
131 .
/testfixture
$(EXE
) $(TOP
)/test/all.
test
133 test: testfixture
$(EXE
) sqlite3
$(EXE
)
134 .
/testfixture
$(EXE
) $(TOP
)/test/quick.
test
136 sqlite3_analyzer
$(EXE
): $(TOP
)/src
/tclsqlite.c libsqlite3.a
$(TESTSRC
) \
137 $(TOP
)/tool
/spaceanal.tcl
144 $(TOP
)/tool
/spaceanal.tcl
>spaceanal_tcl.h
145 $(TCCX
) $(TCL_FLAGS
) -DTCLSH
=2 -DSQLITE_TEST
=1 -o \
146 sqlite3_analyzer
$(EXE
) $(TESTSRC
) $(TOP
)/src
/tclsqlite.c \
147 libsqlite3.a
$(LIBTCL
) $(THREADLIB
)
149 # Standard install and cleanup targets
151 install: sqlite3 libsqlite3.a sqlite3.h
153 mv libsqlite3.a
/usr
/lib
154 mv sqlite3.h
/usr
/include
157 rm -f
*.o sqlite3 libsqlite3.a sqlite3.h opcodes.
*
158 rm -f lemon lempar.c parse.
* sqlite
*.
tar.gz mkkeywordhash keywordhash.h
160 rm -f
*.da
*.bb
*.bbg gmon.out