Makefile.vxworks 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667
  1. #!/usr/make
  2. #
  3. # Makefile for SQLITE on VxWorks
  4. ifeq ($(FORCPU),)
  5. FORCPU = SH32gnule
  6. endif
  7. TOOL_FAMILY = gnu
  8. include $(WIND_USR)/tool/gnu/make.$(FORCPU)
  9. #### The toplevel directory of the source tree. This is the directory
  10. # that contains this "Makefile.in" and the "configure.in" script.
  11. #
  12. TOP = .
  13. #### C Compiler and options for use in building executables that
  14. # will run on the platform that is doing the build.
  15. #
  16. BCC = gcc -g -O2
  17. #BCC = /opt/ancic/bin/c89 -0
  18. #### If the target operating system supports the "usleep()" system
  19. # call, then define the HAVE_USLEEP macro for all C modules.
  20. #
  21. USLEEP =
  22. #USLEEP = -DHAVE_USLEEP=1
  23. #### If you want the SQLite library to be safe for use within a
  24. # multi-threaded program, then define the following macro
  25. # appropriately:
  26. #
  27. THREADSAFE = -DSQLITE_THREADSAFE=1
  28. #THREADSAFE = -DSQLITE_THREADSAFE=0
  29. #### Specify any extra linker options needed to make the library
  30. # thread safe
  31. #
  32. #THREADLIB = -lpthread
  33. THREADLIB =
  34. #### Specify any extra libraries needed to access required functions.
  35. #
  36. ifeq ($(CPU),SH32)
  37. # for SH4 shared library
  38. TLIBS_SHARED += -L$(WIND_USR)/lib/sh/SH32/commonle/PIC
  39. else
  40. # for all other CPUs shared library
  41. TLIBS_SHARED += $(LD_LINK_PATH_ATEND) $(LD_PARTIAL_LAST_FLAGS)
  42. endif
  43. # for static library
  44. TLIBS += $(LD_LINK_PATH_ATEND) $(LD_PARTIAL_LAST_FLAGS)
  45. #### Leave SQLITE_DEBUG undefined for maximum speed. Use SQLITE_DEBUG=1
  46. # to check for memory leaks. Use SQLITE_DEBUG=2 to print a log of all
  47. # malloc()s and free()s in order to track down memory leaks.
  48. #
  49. # SQLite uses some expensive assert() statements in the inner loop.
  50. # You can make the library go almost twice as fast if you compile
  51. # with -DNDEBUG=1
  52. #
  53. #OPTS = -DSQLITE_DEBUG=2
  54. #OPTS = -DSQLITE_DEBUG=1
  55. #OPTS =
  56. OPTS = -DNDEBUG=1 -DSQLITE_OS_UNIX=1 $(THREADSAFE)
  57. OPTS += -DSQLITE_OMIT_LOAD_EXTENSION=1
  58. OPTS += -DSQLITE_ENABLE_LOCKING_STYLE=1
  59. OPTS += -DSQLITE_THREAD_OVERRIDE_LOCK=0
  60. OPTS += -DSQLITE_ENABLE_COLUMN_METADATA=1
  61. OPTS += -DHAVE_FDATASYNC=1
  62. #### The suffix to add to executable files. ".exe" for windows.
  63. # Nothing for unix.
  64. #
  65. EXE = .vxe
  66. #EXE =
  67. #### C Compile and options for use in building executables that
  68. # will run on the target platform. This is usually the same
  69. # as BCC, unless you are cross-compiling.
  70. #
  71. #TCC = gcc -O6
  72. #TCC = gcc -g -O0 -Wall
  73. #TCC = gcc -g -O0 -Wall -fprofile-arcs -ftest-coverage
  74. #TCC = /opt/mingw/bin/i386-mingw32-gcc -O6
  75. TCC = $(CC) $(DEFINE_CC) -O2 -g -mrtp $(CC_ARCH_SPEC) -D_REENTRANT=1 -D_VX_CPU=_VX_$(CPU) -D_VX_TOOL_FAMILY=$(TOOL_FAMILY) -D_VX_TOOL=$(TOOL)
  76. TCC += -I$(WIND_USR)/h -I$(WIND_USR)/h/wrn/coreip
  77. #TCC = /opt/ansic/bin/c89 -O +z -Wl,-a,archive
  78. #TCC_SHARED = $(TCC) -fPIC
  79. TCC_SHARED = $(TCC)
  80. #### Tools used to build a static library.
  81. #
  82. #ARX = ar cr
  83. #ARX = /opt/mingw/bin/i386-mingw32-ar cr
  84. AR += cr
  85. #RANLIB = ranlib
  86. #RANLIB = /opt/mingw/bin/i386-mingw32-ranlib
  87. #MKSHLIB = gcc -shared
  88. #SO = so
  89. #SHPREFIX = lib
  90. MKSHLIB = $(CC) $(DEFINE_CC) -mrtp -shared $(CC_ARCH_SPEC) -D_VX_CPU=_VX_$(CPU) -D_VX_TOOL_FAMILY=$(TOOL_FAMILY) -D_VX_TOOL=$(TOOL)
  91. SO = so
  92. SHPREFIX = lib
  93. #### Extra compiler options needed for programs that use the TCL library.
  94. #
  95. #TCL_FLAGS =
  96. #TCL_FLAGS = -DSTATIC_BUILD=1
  97. TCL_FLAGS = -I/home/drh/tcltk/8.5linux
  98. #TCL_FLAGS = -I/home/drh/tcltk/8.5win -DSTATIC_BUILD=1
  99. #TCL_FLAGS = -I/home/drh/tcltk/8.3hpux
  100. #### Linker options needed to link against the TCL library.
  101. #
  102. #LIBTCL = -ltcl -lm -ldl
  103. LIBTCL = /home/drh/tcltk/8.5linux/libtcl8.5g.a -lm -ldl
  104. #LIBTCL = /home/drh/tcltk/8.5win/libtcl85s.a -lmsvcrt
  105. #LIBTCL = /home/drh/tcltk/8.3hpux/libtcl8.3.a -ldld -lm -lc
  106. #### Additional objects for SQLite library when TCL support is enabled.
  107. TCLOBJ =
  108. #TCLOBJ = tclsqlite.o
  109. #### Compiler options needed for programs that use the readline() library.
  110. #
  111. READLINE_FLAGS =
  112. #READLINE_FLAGS = -DHAVE_READLINE=1 -I/usr/include/readline
  113. #### Linker options needed by programs using readline() must link against.
  114. #
  115. LIBREADLINE =
  116. #LIBREADLINE = -static -lreadline -ltermcap
  117. #### Which "awk" program provides nawk compatibilty
  118. #
  119. # NAWK = nawk
  120. NAWK = awk
  121. #### Pasted and adapted main.mk file
  122. ###############################################################################
  123. # The following macros should be defined before this script is
  124. # invoked:
  125. #
  126. # TOP The toplevel directory of the source tree. This is the
  127. # directory that contains this "Makefile.in" and the
  128. # "configure.in" script.
  129. #
  130. # BCC C Compiler and options for use in building executables that
  131. # will run on the platform that is doing the build.
  132. #
  133. # THREADLIB Specify any extra linker options needed to make the library
  134. # thread safe
  135. #
  136. # OPTS Extra compiler command-line options.
  137. #
  138. # EXE The suffix to add to executable files. ".exe" for windows
  139. # and "" for Unix.
  140. #
  141. # TCC C Compiler and options for use in building executables that
  142. # will run on the target platform. This is usually the same
  143. # as BCC, unless you are cross-compiling.
  144. #
  145. # AR Tools used to build a static library.
  146. # RANLIB
  147. #
  148. # TCL_FLAGS Extra compiler options needed for programs that use the
  149. # TCL library.
  150. #
  151. # LIBTCL Linker options needed to link against the TCL library.
  152. #
  153. # READLINE_FLAGS Compiler options needed for programs that use the
  154. # readline() library.
  155. #
  156. # LIBREADLINE Linker options needed by programs using readline() must
  157. # link against.
  158. #
  159. # NAWK Nawk compatible awk program. Older (obsolete?) solaris
  160. # systems need this to avoid using the original AT&T AWK.
  161. #
  162. # Once the macros above are defined, the rest of this make script will
  163. # build the SQLite library and testing tools.
  164. ################################################################################
  165. # This is how we compile
  166. #
  167. TCCX = $(TCC) $(OPTS) -I. -I$(TOP)/src -I$(TOP)
  168. TCCX_SHARED = $(TCC_SHARED) $(OPTS) -I. -I$(TOP)/src -I$(TOP) \
  169. -I$(TOP)/ext/rtree -I$(TOP)/ext/icu -I$(TOP)/ext/fts3 \
  170. -I$(TOP)/ext/async
  171. # Object files for the SQLite library.
  172. #
  173. LIBOBJ+= alter.o analyze.o attach.o auth.o \
  174. backup.o bitvec.o btmutex.o btree.o build.o \
  175. callback.o complete.o date.o delete.o expr.o fault.o \
  176. fts3.o fts3_expr.o fts3_hash.o fts3_icu.o fts3_porter.o \
  177. fts3_tokenizer.o fts3_tokenizer1.o \
  178. func.o global.o hash.o \
  179. icu.o insert.o journal.o legacy.o loadext.o \
  180. main.o malloc.o mem0.o mem1.o mem2.o mem3.o mem5.o \
  181. memjournal.o \
  182. mutex.o mutex_noop.o mutex_unix.o mutex_w32.o \
  183. notify.o opcodes.o os.o os_unix.o os_win.o \
  184. pager.o parse.o pcache.o pcache1.o pragma.o prepare.o printf.o \
  185. random.o resolve.o rowset.o rtree.o select.o status.o \
  186. table.o tokenize.o trigger.o \
  187. update.o util.o vacuum.o \
  188. vdbe.o vdbeapi.o vdbeaux.o vdbeblob.o vdbemem.o \
  189. walker.o where.o utf.o vtab.o
  190. # All of the source code files.
  191. #
  192. SRC = \
  193. $(TOP)/src/alter.c \
  194. $(TOP)/src/analyze.c \
  195. $(TOP)/src/attach.c \
  196. $(TOP)/src/auth.c \
  197. $(TOP)/src/backup.c \
  198. $(TOP)/src/bitvec.c \
  199. $(TOP)/src/btmutex.c \
  200. $(TOP)/src/btree.c \
  201. $(TOP)/src/btree.h \
  202. $(TOP)/src/btreeInt.h \
  203. $(TOP)/src/build.c \
  204. $(TOP)/src/callback.c \
  205. $(TOP)/src/complete.c \
  206. $(TOP)/src/ctime.c \
  207. $(TOP)/src/date.c \
  208. $(TOP)/src/delete.c \
  209. $(TOP)/src/expr.c \
  210. $(TOP)/src/fault.c \
  211. $(TOP)/src/func.c \
  212. $(TOP)/src/global.c \
  213. $(TOP)/src/hash.c \
  214. $(TOP)/src/hash.h \
  215. $(TOP)/src/hwtime.h \
  216. $(TOP)/src/insert.c \
  217. $(TOP)/src/journal.c \
  218. $(TOP)/src/legacy.c \
  219. $(TOP)/src/loadext.c \
  220. $(TOP)/src/main.c \
  221. $(TOP)/src/malloc.c \
  222. $(TOP)/src/mem0.c \
  223. $(TOP)/src/mem1.c \
  224. $(TOP)/src/mem2.c \
  225. $(TOP)/src/mem3.c \
  226. $(TOP)/src/mem5.c \
  227. $(TOP)/src/memjournal.c \
  228. $(TOP)/src/mutex.c \
  229. $(TOP)/src/mutex.h \
  230. $(TOP)/src/mutex_noop.c \
  231. $(TOP)/src/mutex_unix.c \
  232. $(TOP)/src/mutex_w32.c \
  233. $(TOP)/src/notify.c \
  234. $(TOP)/src/os.c \
  235. $(TOP)/src/os.h \
  236. $(TOP)/src/os_common.h \
  237. $(TOP)/src/os_unix.c \
  238. $(TOP)/src/os_win.c \
  239. $(TOP)/src/pager.c \
  240. $(TOP)/src/pager.h \
  241. $(TOP)/src/parse.y \
  242. $(TOP)/src/pcache.c \
  243. $(TOP)/src/pcache.h \
  244. $(TOP)/src/pcache1.c \
  245. $(TOP)/src/pragma.c \
  246. $(TOP)/src/prepare.c \
  247. $(TOP)/src/printf.c \
  248. $(TOP)/src/random.c \
  249. $(TOP)/src/resolve.c \
  250. $(TOP)/src/rowset.c \
  251. $(TOP)/src/select.c \
  252. $(TOP)/src/status.c \
  253. $(TOP)/src/shell.c \
  254. $(TOP)/src/sqlite.h.in \
  255. $(TOP)/src/sqlite3ext.h \
  256. $(TOP)/src/sqliteInt.h \
  257. $(TOP)/src/sqliteLimit.h \
  258. $(TOP)/src/table.c \
  259. $(TOP)/src/tclsqlite.c \
  260. $(TOP)/src/tokenize.c \
  261. $(TOP)/src/trigger.c \
  262. $(TOP)/src/utf.c \
  263. $(TOP)/src/update.c \
  264. $(TOP)/src/util.c \
  265. $(TOP)/src/vacuum.c \
  266. $(TOP)/src/vdbe.c \
  267. $(TOP)/src/vdbe.h \
  268. $(TOP)/src/vdbeapi.c \
  269. $(TOP)/src/vdbeaux.c \
  270. $(TOP)/src/vdbeblob.c \
  271. $(TOP)/src/vdbemem.c \
  272. $(TOP)/src/vdbeInt.h \
  273. $(TOP)/src/vtab.c \
  274. $(TOP)/src/walker.c \
  275. $(TOP)/src/where.c
  276. # Source code for extensions
  277. #
  278. SRC += \
  279. $(TOP)/ext/fts1/fts1.c \
  280. $(TOP)/ext/fts1/fts1.h \
  281. $(TOP)/ext/fts1/fts1_hash.c \
  282. $(TOP)/ext/fts1/fts1_hash.h \
  283. $(TOP)/ext/fts1/fts1_porter.c \
  284. $(TOP)/ext/fts1/fts1_tokenizer.h \
  285. $(TOP)/ext/fts1/fts1_tokenizer1.c
  286. SRC += \
  287. $(TOP)/ext/fts2/fts2.c \
  288. $(TOP)/ext/fts2/fts2.h \
  289. $(TOP)/ext/fts2/fts2_hash.c \
  290. $(TOP)/ext/fts2/fts2_hash.h \
  291. $(TOP)/ext/fts2/fts2_icu.c \
  292. $(TOP)/ext/fts2/fts2_porter.c \
  293. $(TOP)/ext/fts2/fts2_tokenizer.h \
  294. $(TOP)/ext/fts2/fts2_tokenizer.c \
  295. $(TOP)/ext/fts2/fts2_tokenizer1.c
  296. SRC += \
  297. $(TOP)/ext/fts3/fts3.c \
  298. $(TOP)/ext/fts3/fts3.h \
  299. $(TOP)/ext/fts3/fts3_expr.c \
  300. $(TOP)/ext/fts3/fts3_expr.h \
  301. $(TOP)/ext/fts3/fts3_hash.c \
  302. $(TOP)/ext/fts3/fts3_hash.h \
  303. $(TOP)/ext/fts3/fts3_icu.c \
  304. $(TOP)/ext/fts3/fts3_porter.c \
  305. $(TOP)/ext/fts3/fts3_tokenizer.h \
  306. $(TOP)/ext/fts3/fts3_tokenizer.c \
  307. $(TOP)/ext/fts3/fts3_tokenizer1.c
  308. SRC += \
  309. $(TOP)/ext/icu/sqliteicu.h \
  310. $(TOP)/ext/icu/icu.c
  311. SRC += \
  312. $(TOP)/ext/rtree/rtree.h \
  313. $(TOP)/ext/rtree/rtree.c
  314. # Generated source code files
  315. #
  316. SRC += \
  317. keywordhash.h \
  318. opcodes.c \
  319. opcodes.h \
  320. parse.c \
  321. parse.h \
  322. sqlite3.h
  323. # Source code to the test files.
  324. #
  325. TESTSRC = \
  326. $(TOP)/src/test1.c \
  327. $(TOP)/src/test2.c \
  328. $(TOP)/src/test3.c \
  329. $(TOP)/src/test4.c \
  330. $(TOP)/src/test5.c \
  331. $(TOP)/src/test6.c \
  332. $(TOP)/src/test7.c \
  333. $(TOP)/src/test8.c \
  334. $(TOP)/src/test9.c \
  335. $(TOP)/src/test_autoext.c \
  336. $(TOP)/src/test_async.c \
  337. $(TOP)/src/test_backup.c \
  338. $(TOP)/src/test_btree.c \
  339. $(TOP)/src/test_config.c \
  340. $(TOP)/src/test_devsym.c \
  341. $(TOP)/src/test_func.c \
  342. $(TOP)/src/test_hexio.c \
  343. $(TOP)/src/test_journal.c \
  344. $(TOP)/src/test_malloc.c \
  345. $(TOP)/src/test_md5.c \
  346. $(TOP)/src/test_mutex.c \
  347. $(TOP)/src/test_onefile.c \
  348. $(TOP)/src/test_osinst.c \
  349. $(TOP)/src/test_pcache.c \
  350. $(TOP)/src/test_schema.c \
  351. $(TOP)/src/test_server.c \
  352. $(TOP)/src/test_tclvar.c \
  353. $(TOP)/src/test_thread.c \
  354. $(TOP)/src/test_vfs.c \
  355. $(TOP)/src/test_wsd.c \
  356. #TESTSRC += $(TOP)/ext/fts2/fts2_tokenizer.c
  357. #TESTSRC += $(TOP)/ext/fts3/fts3_tokenizer.c
  358. TESTSRC2 = \
  359. $(TOP)/src/attach.c $(TOP)/src/backup.c $(TOP)/src/btree.c \
  360. $(TOP)/src/build.c $(TOP)/src/ctime.c $(TOP)/src/date.c \
  361. $(TOP)/src/expr.c $(TOP)/src/func.c $(TOP)/src/insert.c $(TOP)/src/os.c \
  362. $(TOP)/src/os_unix.c $(TOP)/src/os_win.c \
  363. $(TOP)/src/pager.c $(TOP)/src/pragma.c $(TOP)/src/prepare.c \
  364. $(TOP)/src/printf.c $(TOP)/src/random.c $(TOP)/src/pcache.c \
  365. $(TOP)/src/pcache1.c $(TOP)/src/select.c $(TOP)/src/tokenize.c \
  366. $(TOP)/src/utf.c $(TOP)/src/util.c $(TOP)/src/vdbeapi.c $(TOP)/src/vdbeaux.c \
  367. $(TOP)/src/vdbe.c $(TOP)/src/vdbemem.c $(TOP)/src/where.c parse.c \
  368. $(TOP)/ext/fts3/fts3.c $(TOP)/ext/fts3/fts3_expr.c \
  369. $(TOP)/ext/fts3/fts3_tokenizer.c \
  370. $(TOP)/ext/async/sqlite3async.c
  371. # Header files used by all library source files.
  372. #
  373. HDR = \
  374. $(TOP)/src/btree.h \
  375. $(TOP)/src/btreeInt.h \
  376. $(TOP)/src/hash.h \
  377. $(TOP)/src/hwtime.h \
  378. keywordhash.h \
  379. $(TOP)/src/mutex.h \
  380. opcodes.h \
  381. $(TOP)/src/os.h \
  382. $(TOP)/src/os_common.h \
  383. $(TOP)/src/pager.h \
  384. $(TOP)/src/pcache.h \
  385. parse.h \
  386. sqlite3.h \
  387. $(TOP)/src/sqlite3ext.h \
  388. $(TOP)/src/sqliteInt.h \
  389. $(TOP)/src/sqliteLimit.h \
  390. $(TOP)/src/vdbe.h \
  391. $(TOP)/src/vdbeInt.h
  392. # Header files used by extensions
  393. #
  394. EXTHDR += \
  395. $(TOP)/ext/fts1/fts1.h \
  396. $(TOP)/ext/fts1/fts1_hash.h \
  397. $(TOP)/ext/fts1/fts1_tokenizer.h
  398. EXTHDR += \
  399. $(TOP)/ext/fts2/fts2.h \
  400. $(TOP)/ext/fts2/fts2_hash.h \
  401. $(TOP)/ext/fts2/fts2_tokenizer.h
  402. EXTHDR += \
  403. $(TOP)/ext/fts3/fts3.h \
  404. $(TOP)/ext/fts3/fts3_expr.h \
  405. $(TOP)/ext/fts3/fts3_hash.h \
  406. $(TOP)/ext/fts3/fts3_tokenizer.h
  407. EXTHDR += \
  408. $(TOP)/ext/rtree/rtree.h
  409. EXTHDR += \
  410. $(TOP)/ext/icu/sqliteicu.h
  411. # This is the default Makefile target. The objects listed here
  412. # are what get build when you type just "make" with no arguments.
  413. #
  414. all: sqlite3.h libsqlite3.a sqlite3$(EXE)
  415. libsqlite3.a: $(LIBOBJ)
  416. $(AR) libsqlite3.a $(LIBOBJ)
  417. $(RANLIB) libsqlite3.a
  418. $(SHPREFIX)sqlite3.$(SO): $(LIBOBJ)
  419. $(MKSHLIB) -o $(SHPREFIX)sqlite3.$(SO) $(LIBOBJ) $(TLIBS_SHARED)
  420. sqlite3$(EXE): $(TOP)/src/shell.c libsqlite3.a sqlite3.h
  421. $(TCCX) $(READLINE_FLAGS) -o sqlite3$(EXE) \
  422. $(TOP)/src/shell.c \
  423. $(LIBREADLINE) $(TLIBS) $(THREADLIB) -L. -lsqlite3
  424. # This target creates a directory named "tsrc" and fills it with
  425. # copies of all of the C source code and header files needed to
  426. # build on the target system. Some of the C source code and header
  427. # files are automatically generated. This target takes care of
  428. # all that automatic generation.
  429. #
  430. target_source: $(SRC)
  431. rm -rf tsrc
  432. mkdir tsrc
  433. cp -f $(SRC) tsrc
  434. rm tsrc/sqlite.h.in tsrc/parse.y
  435. touch target_source
  436. sqlite3.c: target_source $(TOP)/tool/mksqlite3c.tcl
  437. tclsh $(TOP)/tool/mksqlite3c.tcl
  438. cp sqlite3.c tclsqlite3.c
  439. cat $(TOP)/src/tclsqlite.c >>tclsqlite3.c
  440. fts2amal.c: target_source $(TOP)/ext/fts2/mkfts2amal.tcl
  441. tclsh $(TOP)/ext/fts2/mkfts2amal.tcl
  442. fts3amal.c: target_source $(TOP)/ext/fts3/mkfts3amal.tcl
  443. tclsh $(TOP)/ext/fts3/mkfts3amal.tcl
  444. # Rules to build the LEMON compiler generator
  445. #
  446. lemon: $(TOP)/tool/lemon.c $(TOP)/src/lempar.c
  447. $(BCC) -o lemon $(TOP)/tool/lemon.c
  448. cp $(TOP)/src/lempar.c .
  449. # Rules to build individual *.o files from generated *.c files. This
  450. # applies to:
  451. #
  452. # parse.o
  453. # opcodes.o
  454. #
  455. %.o: %.c $(HDR)
  456. $(TCCX_SHARED) -c $<
  457. # Rules to build individual *.o files from files in the src directory.
  458. #
  459. %.o: $(TOP)/src/%.c $(HDR)
  460. $(TCCX_SHARED) -c $<
  461. tclsqlite.o: $(TOP)/src/tclsqlite.c $(HDR)
  462. $(TCCX_SHARED) $(TCL_FLAGS) -c $(TOP)/src/tclsqlite.c
  463. # Rules to build opcodes.c and opcodes.h
  464. #
  465. opcodes.c: opcodes.h $(TOP)/mkopcodec.awk
  466. $(NAWK) -f $(TOP)/mkopcodec.awk opcodes.h >opcodes.c
  467. opcodes.h: parse.h $(TOP)/src/vdbe.c $(TOP)/mkopcodeh.awk
  468. cat parse.h $(TOP)/src/vdbe.c | \
  469. $(NAWK) -f $(TOP)/mkopcodeh.awk >opcodes.h
  470. # Rules to build parse.c and parse.h - the outputs of lemon.
  471. #
  472. parse.h: parse.c
  473. parse.c: $(TOP)/src/parse.y lemon $(TOP)/addopcodes.awk
  474. cp $(TOP)/src/parse.y .
  475. rm -f parse.h
  476. ./lemon $(OPTS) parse.y
  477. mv parse.h parse.h.temp
  478. awk -f $(TOP)/addopcodes.awk parse.h.temp >parse.h
  479. sqlite3.h: $(TOP)/src/sqlite.h.in
  480. sed -e s/--VERS--/`cat ${TOP}/VERSION`/ \
  481. -e s/--VERSION-NUMBER--/`cat ${TOP}/VERSION | sed 's/[^0-9]/ /g' | $(NAWK) '{printf "%d%03d%03d",$$1,$$2,$$3}'`/ \
  482. $(TOP)/src/sqlite.h.in >sqlite3.h
  483. keywordhash.h: $(TOP)/tool/mkkeywordhash.c
  484. $(BCC) -o mkkeywordhash $(OPTS) $(TOP)/tool/mkkeywordhash.c
  485. ./mkkeywordhash >keywordhash.h
  486. # Rules to build the extension objects.
  487. #
  488. icu.o: $(TOP)/ext/icu/icu.c $(HDR) $(EXTHDR)
  489. $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/icu/icu.c
  490. fts2.o: $(TOP)/ext/fts2/fts2.c $(HDR) $(EXTHDR)
  491. $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2.c
  492. fts2_hash.o: $(TOP)/ext/fts2/fts2_hash.c $(HDR) $(EXTHDR)
  493. $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_hash.c
  494. fts2_icu.o: $(TOP)/ext/fts2/fts2_icu.c $(HDR) $(EXTHDR)
  495. $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_icu.c
  496. fts2_porter.o: $(TOP)/ext/fts2/fts2_porter.c $(HDR) $(EXTHDR)
  497. $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_porter.c
  498. fts2_tokenizer.o: $(TOP)/ext/fts2/fts2_tokenizer.c $(HDR) $(EXTHDR)
  499. $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_tokenizer.c
  500. fts2_tokenizer1.o: $(TOP)/ext/fts2/fts2_tokenizer1.c $(HDR) $(EXTHDR)
  501. $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_tokenizer1.c
  502. fts3.o: $(TOP)/ext/fts3/fts3.c $(HDR) $(EXTHDR)
  503. $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3.c
  504. fts3_expr.o: $(TOP)/ext/fts3/fts3_expr.c $(HDR) $(EXTHDR)
  505. $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_expr.c
  506. fts3_hash.o: $(TOP)/ext/fts3/fts3_hash.c $(HDR) $(EXTHDR)
  507. $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_hash.c
  508. fts3_icu.o: $(TOP)/ext/fts3/fts3_icu.c $(HDR) $(EXTHDR)
  509. $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_icu.c
  510. fts3_porter.o: $(TOP)/ext/fts3/fts3_porter.c $(HDR) $(EXTHDR)
  511. $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_porter.c
  512. fts3_tokenizer.o: $(TOP)/ext/fts3/fts3_tokenizer.c $(HDR) $(EXTHDR)
  513. $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer.c
  514. fts3_tokenizer1.o: $(TOP)/ext/fts3/fts3_tokenizer1.c $(HDR) $(EXTHDR)
  515. $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer1.c
  516. rtree.o: $(TOP)/ext/rtree/rtree.c $(HDR) $(EXTHDR)
  517. $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/rtree/rtree.c
  518. # Rules for building test programs and for running tests
  519. #
  520. tclsqlite3: $(TOP)/src/tclsqlite.c libsqlite3.a
  521. $(TCCX_SHARED) $(TCL_FLAGS) -DTCLSH=1 -o tclsqlite3 \
  522. $(TOP)/src/tclsqlite.c libsqlite3.a $(LIBTCL) $(THREADLIB)
  523. # Rules to build the 'testfixture' application.
  524. #
  525. TESTFIXTURE_FLAGS = -DTCLSH=1 -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
  526. TESTFIXTURE_FLAGS += -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE
  527. testfixture$(EXE): $(TESTSRC2) libsqlite3.a $(TESTSRC) $(TOP)/src/tclsqlite.c
  528. $(TCCX) $(TCL_FLAGS) $(TESTFIXTURE_FLAGS) \
  529. $(TESTSRC) $(TESTSRC2) $(TOP)/src/tclsqlite.c \
  530. -o testfixture$(EXE) $(LIBTCL) $(THREADLIB) libsqlite3.a
  531. amalgamation-testfixture$(EXE): sqlite3.c $(TESTSRC) $(TOP)/src/tclsqlite.c
  532. $(TCCX) $(TCL_FLAGS) $(TESTFIXTURE_FLAGS) \
  533. $(TESTSRC) $(TOP)/src/tclsqlite.c sqlite3.c \
  534. -o testfixture$(EXE) $(LIBTCL) $(THREADLIB)
  535. fts3-testfixture$(EXE): sqlite3.c fts3amal.c $(TESTSRC) $(TOP)/src/tclsqlite.c
  536. $(TCCX) $(TCL_FLAGS) $(TESTFIXTURE_FLAGS) \
  537. -DSQLITE_ENABLE_FTS3=1 \
  538. $(TESTSRC) $(TOP)/src/tclsqlite.c sqlite3.c fts3amal.c \
  539. -o testfixture$(EXE) $(LIBTCL) $(THREADLIB)
  540. fulltest: testfixture$(EXE) sqlite3$(EXE)
  541. ./testfixture$(EXE) $(TOP)/test/all.test
  542. soaktest: testfixture$(EXE) sqlite3$(EXE)
  543. ./testfixture$(EXE) $(TOP)/test/all.test -soak=1
  544. fulltestonly: testfixture$(EXE) sqlite3$(EXE)
  545. ./testfixture$(EXE) $(TOP)/test/full.test
  546. test: testfixture$(EXE) sqlite3$(EXE)
  547. ./testfixture$(EXE) $(TOP)/test/veryquick.test
  548. sqlite3_analyzer$(EXE): $(TOP)/src/tclsqlite.c sqlite3.c $(TESTSRC) \
  549. $(TOP)/tool/spaceanal.tcl
  550. sed \
  551. -e '/^#/d' \
  552. -e 's,\\,\\\\,g' \
  553. -e 's,",\\",g' \
  554. -e 's,^,",' \
  555. -e 's,$$,\\n",' \
  556. $(TOP)/tool/spaceanal.tcl >spaceanal_tcl.h
  557. $(TCCX) $(TCL_FLAGS) $(TESTFIXTURE_FLAGS) \
  558. -DTCLSH=2 -DSQLITE_TEST=1 -DSQLITE_DEBUG=1 -DSQLITE_PRIVATE="" \
  559. $(TESTSRC) $(TOP)/src/tclsqlite.c sqlite3.c \
  560. -o sqlite3_analyzer$(EXE) \
  561. $(LIBTCL) $(THREADLIB)
  562. TEST_EXTENSION = $(SHPREFIX)testloadext.$(SO)
  563. $(TEST_EXTENSION): $(TOP)/src/test_loadext.c
  564. $(MKSHLIB) $(TOP)/src/test_loadext.c -o $(TEST_EXTENSION)
  565. extensiontest: testfixture$(EXE) $(TEST_EXTENSION)
  566. ./testfixture$(EXE) $(TOP)/test/loadext.test
  567. clean:
  568. rm -f *.o sqlite3$(EXE) libsqlite3.a sqlite3.h opcodes.*
  569. rm -f lemon lempar.c parse.* sqlite*.tar.gz mkkeywordhash keywordhash.h
  570. rm -f $(PUBLISH)
  571. rm -f *.da *.bb *.bbg gmon.out
  572. rm -rf quota2a quota2b quota2c
  573. rm -rf tsrc target_source
  574. rm -f testloadext.dll libtestloadext.so
  575. rm -f sqlite3.c fts?amal.c tclsqlite3.c
  576. rm -f sqlite3rc.h
  577. rm -f shell.c sqlite3ext.h
  578. rm -f $(SHPREFIX)sqlite3.$(SO)