Makefile.in 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  1. #!/usr/make
  2. #
  3. # Makefile for SQLITE
  4. #
  5. # This makefile is suppose to be configured automatically using the
  6. # autoconf. But if that does not work for you, you can configure
  7. # the makefile manually. Just set the parameters below to values that
  8. # work well for your system.
  9. #
  10. # If the configure script does not work out-of-the-box, you might
  11. # be able to get it to work by giving it some hints. See the comment
  12. # at the beginning of configure.in for additional information.
  13. #
  14. # The toplevel directory of the source tree. This is the directory
  15. # that contains this "Makefile.in" and the "configure.in" script.
  16. #
  17. TOP = @srcdir@
  18. # C Compiler and options for use in building executables that
  19. # will run on the platform that is doing the build.
  20. #
  21. BCC = @BUILD_CC@ @BUILD_CFLAGS@
  22. # C Compile and options for use in building executables that
  23. # will run on the target platform. (BCC and TCC are usually the
  24. # same unless your are cross-compiling.)
  25. #
  26. TCC = @TARGET_CC@ @TARGET_CFLAGS@ -I. -I${TOP}/src
  27. # Some standard variables and programs
  28. #
  29. prefix = @prefix@
  30. INSTALL = @INSTALL@
  31. LIBTOOL = ./libtool
  32. # Compiler options needed for programs that use the TCL library.
  33. #
  34. TCL_FLAGS = @TARGET_TCL_INC@
  35. # The library that programs using TCL must link against.
  36. #
  37. LIBTCL = @TARGET_TCL_LIBS@
  38. # Compiler options needed for programs that use the readline() library.
  39. #
  40. READLINE_FLAGS = -DHAVE_READLINE=@TARGET_HAVE_READLINE@ @TARGET_READLINE_INC@
  41. # The library that programs using readline() must link against.
  42. #
  43. LIBREADLINE = @TARGET_READLINE_LIBS@
  44. # Should the database engine assume text is coded as UTF-8 or iso8859?
  45. #
  46. # ENCODING = UTF8
  47. # ENCODING = ISO8859
  48. ENCODING = @ENCODING@
  49. # You should not have to change anything below this line
  50. ###############################################################################
  51. # Object files for the SQLite library.
  52. #
  53. LIBOBJ = btree.lo build.lo delete.lo expr.lo func.lo hash.lo insert.lo \
  54. main.lo os.lo pager.lo parse.lo printf.lo random.lo select.lo \
  55. table.lo tokenize.lo update.lo util.lo vdbe.lo where.lo trigger.lo
  56. # All of the source code files.
  57. #
  58. SRC = \
  59. $(TOP)/src/btree.c \
  60. $(TOP)/src/btree.h \
  61. $(TOP)/src/build.c \
  62. $(TOP)/src/delete.c \
  63. $(TOP)/src/expr.c \
  64. $(TOP)/src/func.c \
  65. $(TOP)/src/hash.c \
  66. $(TOP)/src/insert.c \
  67. $(TOP)/src/main.c \
  68. $(TOP)/src/os.c \
  69. $(TOP)/src/pager.c \
  70. $(TOP)/src/pager.h \
  71. $(TOP)/src/parse.y \
  72. $(TOP)/src/printf.c \
  73. $(TOP)/src/random.c \
  74. $(TOP)/src/select.c \
  75. $(TOP)/src/shell.c \
  76. $(TOP)/src/sqlite.h.in \
  77. $(TOP)/src/sqliteInt.h \
  78. $(TOP)/src/table.c \
  79. $(TOP)/src/tclsqlite.c \
  80. $(TOP)/src/tokenize.c \
  81. $(TOP)/src/update.c \
  82. $(TOP)/src/util.c \
  83. $(TOP)/src/vdbe.c \
  84. $(TOP)/src/vdbe.h \
  85. $(TOP)/src/where.c \
  86. $(TOP)/src/trigger.c
  87. # Source code to the test files.
  88. #
  89. TESTSRC = \
  90. $(TOP)/src/btree.c \
  91. $(TOP)/src/os.c \
  92. $(TOP)/src/pager.c \
  93. $(TOP)/src/test1.c \
  94. $(TOP)/src/test2.c \
  95. $(TOP)/src/test3.c \
  96. $(TOP)/src/md5.c
  97. # This is the default Makefile target. The objects listed here
  98. # are what get build when you type just "make" with no arguments.
  99. #
  100. all: sqlite.h libsqlite.la sqlite
  101. # Generate the file "last_change" which contains the date of change
  102. # of the most recently modified source code file
  103. #
  104. last_change: $(SRC)
  105. cat $(SRC) | grep '$$Id: ' | sort +4 | tail -1 \
  106. | awk '{print $$5,$$6}' >last_change
  107. libsqlite.la: $(LIBOBJ)
  108. $(LIBTOOL) $(TCC) -o libsqlite.la $(LIBOBJ) -rpath $(prefix)/lib
  109. libtclsqlite.la: tclsqlite.lo libsqlite.la
  110. $(LIBTOOL) $(TCC) -o libtclsqlite.la tclsqlite.lo \
  111. libsqlite.la $(LIBTCL) -rpath $(prefix)/lib
  112. sqlite: $(TOP)/src/shell.c libsqlite.la sqlite.h
  113. $(LIBTOOL) $(TCC) $(READLINE_FLAGS) -o sqlite $(TOP)/src/shell.c \
  114. libsqlite.la $(LIBREADLINE)
  115. # Rules to build the LEMON compiler generator
  116. #
  117. lemon: $(TOP)/tool/lemon.c $(TOP)/tool/lempar.c
  118. $(BCC) -o lemon $(TOP)/tool/lemon.c
  119. cp $(TOP)/tool/lempar.c .
  120. # Header files used by all library source files.
  121. #
  122. HDR = \
  123. sqlite.h \
  124. $(TOP)/src/btree.h \
  125. $(TOP)/src/os.h \
  126. $(TOP)/src/sqliteInt.h \
  127. $(TOP)/src/vdbe.h \
  128. parse.h
  129. btree.lo: $(TOP)/src/btree.c $(HDR) $(TOP)/src/pager.h
  130. $(LIBTOOL) $(TCC) -c $(TOP)/src/btree.c
  131. build.lo: $(TOP)/src/build.c $(HDR)
  132. $(LIBTOOL) $(TCC) -c $(TOP)/src/build.c
  133. main.lo: $(TOP)/src/main.c $(HDR)
  134. $(LIBTOOL) $(TCC) -c $(TOP)/src/main.c
  135. pager.lo: $(TOP)/src/pager.c $(HDR) $(TOP)/src/pager.h
  136. $(LIBTOOL) $(TCC) -c $(TOP)/src/pager.c
  137. os.lo: $(TOP)/src/os.c $(HDR)
  138. $(LIBTOOL) $(TCC) -c $(TOP)/src/os.c
  139. parse.lo: parse.c $(HDR)
  140. $(LIBTOOL) $(TCC) -c parse.c
  141. parse.h: parse.c
  142. parse.c: $(TOP)/src/parse.y lemon
  143. cp $(TOP)/src/parse.y .
  144. ./lemon parse.y
  145. sqlite.h: $(TOP)/src/sqlite.h.in
  146. sed -e s/--VERS--/`cat ${TOP}/VERSION`/ \
  147. -e s/--ENCODING--/$(ENCODING)/ \
  148. $(TOP)/src/sqlite.h.in >sqlite.h
  149. tokenize.lo: $(TOP)/src/tokenize.c $(HDR)
  150. $(LIBTOOL) $(TCC) -c $(TOP)/src/tokenize.c
  151. util.lo: $(TOP)/src/util.c $(HDR)
  152. $(LIBTOOL) $(TCC) -c $(TOP)/src/util.c
  153. vdbe.lo: $(TOP)/src/vdbe.c $(HDR)
  154. $(LIBTOOL) $(TCC) -c $(TOP)/src/vdbe.c
  155. where.lo: $(TOP)/src/where.c $(HDR)
  156. $(LIBTOOL) $(TCC) -c $(TOP)/src/where.c
  157. delete.lo: $(TOP)/src/delete.c $(HDR)
  158. $(LIBTOOL) $(TCC) -c $(TOP)/src/delete.c
  159. expr.lo: $(TOP)/src/expr.c $(HDR)
  160. $(LIBTOOL) $(TCC) -c $(TOP)/src/expr.c
  161. func.lo: $(TOP)/src/func.c $(HDR)
  162. $(LIBTOOL) $(TCC) -c $(TOP)/src/func.c
  163. hash.lo: $(TOP)/src/hash.c $(HDR)
  164. $(LIBTOOL) $(TCC) -c $(TOP)/src/hash.c
  165. insert.lo: $(TOP)/src/insert.c $(HDR)
  166. $(LIBTOOL) $(TCC) -c $(TOP)/src/insert.c
  167. random.lo: $(TOP)/src/random.c $(HDR)
  168. $(LIBTOOL) $(TCC) -c $(TOP)/src/random.c
  169. select.lo: $(TOP)/src/select.c $(HDR)
  170. $(LIBTOOL) $(TCC) -c $(TOP)/src/select.c
  171. table.lo: $(TOP)/src/table.c $(HDR)
  172. $(LIBTOOL) $(TCC) -c $(TOP)/src/table.c
  173. trigger.lo: $(TOP)/src/trigger.c $(HDR)
  174. $(LIBTOOL) $(TCC) -c $(TOP)/src/trigger.c
  175. update.lo: $(TOP)/src/update.c $(HDR)
  176. $(LIBTOOL) $(TCC) -c $(TOP)/src/update.c
  177. tclsqlite.lo: $(TOP)/src/tclsqlite.c $(HDR)
  178. $(LIBTOOL) $(TCC) $(TCL_FLAGS) -c $(TOP)/src/tclsqlite.c
  179. printf.lo: $(TOP)/src/printf.c $(HDR)
  180. $(LIBTOOL) $(TCC) $(TCL_FLAGS) -c $(TOP)/src/printf.c
  181. tclsqlite: $(TOP)/src/tclsqlite.c libsqlite.la
  182. $(LIBTOOL) $(TCC) $(TCL_FLAGS) -DTCLSH=1 -o tclsqlite \
  183. $(TOP)/src/tclsqlite.c libsqlite.la $(LIBTCL)
  184. testfixture: $(TOP)/src/tclsqlite.c libtclsqlite.la libsqlite.la $(TESTSRC)
  185. $(LIBTOOL) $(TCC) $(TCL_FLAGS) -DTCLSH=1 -DSQLITE_TEST=1\
  186. -o testfixture $(TESTSRC) $(TOP)/src/tclsqlite.c \
  187. libtclsqlite.la libsqlite.la $(LIBTCL)
  188. fulltest: testfixture sqlite
  189. ./testfixture $(TOP)/test/all.test
  190. test: testfixture sqlite
  191. ./testfixture $(TOP)/test/quick.test
  192. index.html: $(TOP)/www/index.tcl last_change
  193. tclsh $(TOP)/www/index.tcl `cat $(TOP)/VERSION` >index.html
  194. sqlite.html: $(TOP)/www/sqlite.tcl
  195. tclsh $(TOP)/www/sqlite.tcl >sqlite.html
  196. c_interface.html: $(TOP)/www/c_interface.tcl
  197. tclsh $(TOP)/www/c_interface.tcl >c_interface.html
  198. changes.html: $(TOP)/www/changes.tcl
  199. tclsh $(TOP)/www/changes.tcl >changes.html
  200. lang.html: $(TOP)/www/lang.tcl
  201. tclsh $(TOP)/www/lang.tcl >lang.html
  202. vdbe.html: $(TOP)/www/vdbe.tcl
  203. tclsh $(TOP)/www/vdbe.tcl >vdbe.html
  204. arch.html: $(TOP)/www/arch.tcl
  205. tclsh $(TOP)/www/arch.tcl >arch.html
  206. arch.png: $(TOP)/www/arch.png
  207. cp $(TOP)/www/arch.png .
  208. opcode.html: $(TOP)/www/opcode.tcl $(TOP)/src/vdbe.c
  209. tclsh $(TOP)/www/opcode.tcl $(TOP)/src/vdbe.c >opcode.html
  210. crosscompile.html: $(TOP)/www/crosscompile.tcl
  211. tclsh $(TOP)/www/crosscompile.tcl >crosscompile.html
  212. mingw.html: $(TOP)/www/mingw.tcl
  213. tclsh $(TOP)/www/mingw.tcl >mingw.html
  214. tclsqlite.html: $(TOP)/www/tclsqlite.tcl
  215. tclsh $(TOP)/www/tclsqlite.tcl >tclsqlite.html
  216. speed.html: $(TOP)/www/speed.tcl
  217. tclsh $(TOP)/www/speed.tcl >speed.html
  218. faq.html: $(TOP)/www/faq.tcl
  219. tclsh $(TOP)/www/faq.tcl >faq.html
  220. download.html: $(TOP)/www/download.tcl
  221. tclsh $(TOP)/www/download.tcl >download.html
  222. # Files to be published on the website.
  223. #
  224. DOC = \
  225. index.html \
  226. sqlite.html \
  227. changes.html \
  228. lang.html \
  229. opcode.html \
  230. arch.html \
  231. arch.png \
  232. vdbe.html \
  233. c_interface.html \
  234. crosscompile.html \
  235. mingw.html \
  236. tclsqlite.html \
  237. download.html \
  238. speed.html \
  239. faq.html
  240. doc: $(DOC)
  241. mkdir -p doc
  242. mv $(DOC) doc
  243. install: sqlite libsqlite.la sqlite.h
  244. $(LIBTOOL) $(INSTALL) libsqlite.la $(prefix)/lib
  245. $(LIBTOOL) $(INSTALL) sqlite $(prefix)/bin
  246. $(INSTALL) -m 0644 sqlite.h $(prefix)/include
  247. clean:
  248. rm -f *.lo *.la *.o sqlite libsqlite.la sqlite.h
  249. rm -rf .libs .deps
  250. rm -f lemon lempar.c parse.* sqlite*.tar.gz
  251. rm -f $(PUBLISH)
  252. rm -f *.da *.bb *.bbg gmon.out
  253. rm -f testfixture test.db
  254. rm -rf doc
  255. distclean: clean
  256. rm -f config.log config.status