make sure termlen is not used uninitialized.
[AROS-Contrib.git] / sqlite3 / main.mk
blob8a52ee2c89563fd2e6aa90ada93668781eb76896
1 ###############################################################################
2 # The following macros should be defined before this script is
3 # invoked:
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
17 # appropriately:
19 # THREADLIB Specify any extra linker options needed to make the library
20 # thread safe
22 # OPTS Extra compiler command-line options.
24 # EXE The suffix to add to executable files. ".exe" for windows
25 # and "" for Unix.
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.
32 # RANLIB
34 # TCL_FLAGS Extra compiler options needed for programs that use the
35 # TCL library.
37 # LIBTCL Linker options needed to link against the TCL library.
39 # READLINE_FLAGS Compiler options needed for programs that use the
40 # readline() library.
42 # LIBREADLINE Linker options needed by programs using readline() must
43 # link against.
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.
58 TESTSRC = \
59 $(TOP)/src/btree.c \
60 $(TOP)/src/date.c \
61 $(TOP)/src/func.c \
62 $(TOP)/src/os_unix.c \
63 $(TOP)/src/os_win.c \
64 $(TOP)/src/pager.c \
65 $(TOP)/src/pragma.c \
66 $(TOP)/src/printf.c \
67 $(TOP)/src/test1.c \
68 $(TOP)/src/test2.c \
69 $(TOP)/src/test3.c \
70 $(TOP)/src/test4.c \
71 $(TOP)/src/test5.c \
72 $(TOP)/src/utf.c \
73 $(TOP)/src/util.c \
74 $(TOP)/src/vdbe.c \
75 $(TOP)/src/md5.c
77 # Header files used by the VDBE submodule
79 VDBEHDR = \
80 $(HDR) \
81 $(TOP)/src/vdbeInt.h
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
91 last_change: $(FILES)
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
112 rm -rf tsrc
113 mkdir tsrc
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 \
126 -o crashtest \
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
138 sed \
139 -e '/^#/d' \
140 -e 's,\\,\\\\,g' \
141 -e 's,",\\",g' \
142 -e 's,^,",' \
143 -e 's,$$,\\n",' \
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
152 mv sqlite3 /usr/bin
153 mv libsqlite3.a /usr/lib
154 mv sqlite3.h /usr/include
156 cleanup:
157 rm -f *.o sqlite3 libsqlite3.a sqlite3.h opcodes.*
158 rm -f lemon lempar.c parse.* sqlite*.tar.gz mkkeywordhash keywordhash.h
159 rm -f $(PUBLISH)
160 rm -f *.da *.bb *.bbg gmon.out
161 rm -rf tsrc