Makefile.msc 87 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847
  1. #
  2. # nmake Makefile for SQLite
  3. #
  4. ###############################################################################
  5. ############################## START OF OPTIONS ###############################
  6. ###############################################################################
  7. # The toplevel directory of the source tree. This is the directory
  8. # that contains this "Makefile.msc".
  9. #
  10. TOP = .
  11. # <<mark>>
  12. # Set this non-0 to create and use the SQLite amalgamation file.
  13. #
  14. !IFNDEF USE_AMALGAMATION
  15. USE_AMALGAMATION = 1
  16. !ENDIF
  17. # <</mark>>
  18. # Optionally set EXTRA_SRC to a list of C files to append to
  19. # the generated sqlite3.c.
  20. #
  21. !IFNDEF EXTRA_SRC
  22. EXTRA_SRC =
  23. !ENDIF
  24. # Set this non-0 to enable full warnings (-W4, etc) when compiling.
  25. #
  26. !IFNDEF USE_FULLWARN
  27. USE_FULLWARN = 1
  28. !ENDIF
  29. # Set this non-0 to enable treating warnings as errors (-WX, etc) when
  30. # compiling.
  31. #
  32. !IFNDEF USE_FATAL_WARN
  33. USE_FATAL_WARN = 0
  34. !ENDIF
  35. # Set this non-0 to enable full runtime error checks (-RTC1, etc). This
  36. # has no effect if (any) optimizations are enabled.
  37. #
  38. !IFNDEF USE_RUNTIME_CHECKS
  39. USE_RUNTIME_CHECKS = 0
  40. !ENDIF
  41. # Set this non-0 to create a SQLite amalgamation file that excludes the
  42. # various built-in extensions.
  43. #
  44. !IFNDEF MINIMAL_AMALGAMATION
  45. MINIMAL_AMALGAMATION = 0
  46. !ENDIF
  47. # Set this non-0 to use "stdcall" calling convention for the core library
  48. # and shell executable.
  49. #
  50. !IFNDEF USE_STDCALL
  51. USE_STDCALL = 0
  52. !ENDIF
  53. # Use the USE_SEH=0 option on the nmake command line to omit structured
  54. # exception handling (SEH) support. SEH is on by default.
  55. #
  56. !IFNDEF USE_SEH
  57. USE_SEH = 1
  58. !ENDIF
  59. # Use STATICALLY_LINK_TCL=1 to statically link against TCL
  60. #
  61. !IFNDEF STATICALLY_LINK_TCL
  62. STATICALLY_LINK_TCL = 0
  63. !ELSEIF $(STATICALLY_LINK_TCL)!=0
  64. CCOPTS = $(CCOPTS) -DSTATIC_BUILD
  65. !ENDIF
  66. # Set this non-0 to have the shell executable link against the core dynamic
  67. # link library.
  68. #
  69. !IFNDEF DYNAMIC_SHELL
  70. DYNAMIC_SHELL = 0
  71. !ENDIF
  72. # Set this non-0 to enable extra code that attempts to detect misuse of the
  73. # SQLite API.
  74. #
  75. !IFNDEF API_ARMOR
  76. API_ARMOR = 0
  77. !ENDIF
  78. # If necessary, create a list of harmless compiler warnings to disable when
  79. # compiling the various tools. For the SQLite source code itself, warnings,
  80. # if any, will be disabled from within it.
  81. #
  82. !IFNDEF NO_WARN
  83. !IF $(USE_FULLWARN)!=0
  84. NO_WARN = -wd4054 -wd4055 -wd4100 -wd4127 -wd4130 -wd4152 -wd4189 -wd4206
  85. NO_WARN = $(NO_WARN) -wd4210 -wd4232 -wd4244 -wd4305 -wd4306 -wd4702 -wd4706
  86. !ENDIF
  87. !ENDIF
  88. # Set this non-0 to use the library paths and other options necessary for
  89. # Windows Phone 8.1.
  90. #
  91. !IFNDEF USE_WP81_OPTS
  92. USE_WP81_OPTS = 0
  93. !ENDIF
  94. # Set this non-0 to split the SQLite amalgamation file into chunks to
  95. # be used for debugging with Visual Studio.
  96. #
  97. !IFNDEF SPLIT_AMALGAMATION
  98. SPLIT_AMALGAMATION = 0
  99. !ENDIF
  100. # <<mark>>
  101. # Set this non-0 to have this makefile assume the Tcl shell executable
  102. # (tclsh*.exe) is available in the PATH. By default, this is disabled
  103. # for compatibility with older build environments. This setting only
  104. # applies if TCLSH_CMD is not set manually.
  105. #
  106. !IFNDEF USE_TCLSH_IN_PATH
  107. USE_TCLSH_IN_PATH = 0
  108. !ENDIF
  109. # Set this non-0 to use zlib, possibly compiling it from source code.
  110. #
  111. !IFNDEF USE_ZLIB
  112. USE_ZLIB = 0
  113. !ENDIF
  114. # Set this non-0 to build zlib from source code. This is enabled by
  115. # default and in that case it will be assumed that the ZLIBDIR macro
  116. # points to the top-level source code directory for zlib.
  117. #
  118. !IFNDEF BUILD_ZLIB
  119. BUILD_ZLIB = 1
  120. !ENDIF
  121. # Set this non-0 to use the International Components for Unicode (ICU).
  122. #
  123. !IFNDEF USE_ICU
  124. USE_ICU = 0
  125. !ENDIF
  126. # <</mark>>
  127. # Set this non-0 to dynamically link to the MSVC runtime library.
  128. #
  129. !IFNDEF USE_CRT_DLL
  130. USE_CRT_DLL = 0
  131. !ENDIF
  132. # Set this non-0 to link to the RPCRT4 library.
  133. #
  134. !IFNDEF USE_RPCRT4_LIB
  135. USE_RPCRT4_LIB = 0
  136. !ENDIF
  137. # Set this non-0 to generate assembly code listings for the source code
  138. # files.
  139. #
  140. !IFNDEF USE_LISTINGS
  141. USE_LISTINGS = 0
  142. !ENDIF
  143. # Set this non-0 to attempt setting the native compiler automatically
  144. # for cross-compiling the command line tools needed during the compilation
  145. # process.
  146. #
  147. !IFNDEF XCOMPILE
  148. XCOMPILE = 0
  149. !ENDIF
  150. # Set this non-0 to use the native libraries paths for cross-compiling
  151. # the command line tools needed during the compilation process.
  152. #
  153. !IFNDEF USE_NATIVE_LIBPATHS
  154. USE_NATIVE_LIBPATHS = 0
  155. !ENDIF
  156. # Set this 0 to skip the compiling and embedding of version resources.
  157. #
  158. !IFNDEF USE_RC
  159. USE_RC = 1
  160. !ENDIF
  161. # Set this non-0 to compile binaries suitable for the WinRT environment.
  162. # This setting does not apply to any binaries that require Tcl to operate
  163. # properly (i.e. the text fixture, etc).
  164. #
  165. !IFNDEF FOR_WINRT
  166. FOR_WINRT = 0
  167. !ENDIF
  168. # Set this non-0 to compile binaries suitable for the UWP environment.
  169. # This setting does not apply to any binaries that require Tcl to operate
  170. # properly (i.e. the text fixture, etc).
  171. #
  172. !IFNDEF FOR_UWP
  173. FOR_UWP = 0
  174. !ENDIF
  175. # Set this non-0 to compile binaries suitable for the Windows 10 platform.
  176. #
  177. !IFNDEF FOR_WIN10
  178. FOR_WIN10 = 0
  179. !ENDIF
  180. # <<mark>>
  181. # Set this non-0 to skip attempting to look for and/or link with the Tcl
  182. # runtime library.
  183. #
  184. !IFNDEF NO_TCL
  185. NO_TCL = 0
  186. !ENDIF
  187. # <</mark>>
  188. # Set this to non-0 to create and use PDBs.
  189. #
  190. !IFNDEF SYMBOLS
  191. SYMBOLS = 1
  192. !ENDIF
  193. # Set this to non-0 to use the SQLite debugging heap subsystem.
  194. #
  195. !IFNDEF MEMDEBUG
  196. MEMDEBUG = 0
  197. !ENDIF
  198. # Set this to non-0 to use the Win32 native heap subsystem.
  199. #
  200. !IFNDEF WIN32HEAP
  201. WIN32HEAP = 0
  202. !ENDIF
  203. # Set this to non-0 to enable OSTRACE() macros, which can be useful when
  204. # debugging.
  205. #
  206. !IFNDEF OSTRACE
  207. OSTRACE = 0
  208. !ENDIF
  209. # enable address sanitizer using ASAN=1 on the command-line.
  210. #
  211. !IFNDEF ASAN
  212. ASAN = 0
  213. !ENDIF
  214. # Set this to one of the following values to enable various debugging
  215. # features. Each level includes the debugging options from the previous
  216. # levels. Currently, the recognized values for DEBUG are:
  217. #
  218. # 0 == NDEBUG: Disables assert() and other runtime diagnostics.
  219. # 1 == SQLITE_ENABLE_API_ARMOR: extra attempts to detect misuse of the API.
  220. # 2 == Disables NDEBUG and all optimizations and then enables PDBs.
  221. # 3 == SQLITE_DEBUG: Enables various diagnostics messages and code.
  222. # 4 == SQLITE_WIN32_MALLOC_VALIDATE: Validate the Win32 native heap per call.
  223. # 5 == SQLITE_DEBUG_OS_TRACE: Enables output from the OSTRACE() macros.
  224. # 6 == SQLITE_ENABLE_IOTRACE: Enables output from the IOTRACE() macros.
  225. #
  226. !IFNDEF DEBUG
  227. DEBUG = 0
  228. !ENDIF
  229. # <<mark>>
  230. # By default, use --linemacros=1 argument to the mksqlite3c.tcl tool, which
  231. # is used to build the amalgamation. This can be turned off to ease debug
  232. # of the amalgamation away from the source tree.
  233. #
  234. !IFNDEF NO_LINEMACROS
  235. NO_LINEMACROS = 0
  236. !ENDIF
  237. # <</mark>>
  238. # Enable use of available compiler optimizations? Normally, this should be
  239. # non-zero. Setting this to zero, thus disabling all compiler optimizations,
  240. # can be useful for testing.
  241. #
  242. !IFNDEF OPTIMIZATIONS
  243. OPTIMIZATIONS = 2
  244. !ENDIF
  245. # Set this to non-0 to enable support for the session extension.
  246. #
  247. !IFNDEF SESSION
  248. SESSION = 0
  249. !ENDIF
  250. # Set this to non-0 to enable support for the rbu extension.
  251. #
  252. !IFNDEF RBU
  253. RBU = 0
  254. !ENDIF
  255. # Set the source code file to be used by executables and libraries when
  256. # they need the amalgamation.
  257. #
  258. !IFNDEF SQLITE3C
  259. !IF $(SPLIT_AMALGAMATION)!=0
  260. SQLITE3C = sqlite3-all.c
  261. !ELSE
  262. SQLITE3C = sqlite3.c
  263. !ENDIF
  264. !ENDIF
  265. # Set the include code file to be used by executables and libraries when
  266. # they need SQLite.
  267. #
  268. !IFNDEF SQLITE3H
  269. SQLITE3H = sqlite3.h
  270. !ENDIF
  271. # This is the name to use for the SQLite dynamic link library (DLL).
  272. #
  273. !IFNDEF SQLITE3DLL
  274. !IF $(FOR_WIN10)!=0
  275. SQLITE3DLL = winsqlite3.dll
  276. !ELSE
  277. SQLITE3DLL = sqlite3.dll
  278. !ENDIF
  279. !ENDIF
  280. # This is the name to use for the SQLite import library (LIB).
  281. #
  282. !IFNDEF SQLITE3LIB
  283. !IF $(FOR_WIN10)!=0
  284. SQLITE3LIB = winsqlite3.lib
  285. !ELSE
  286. SQLITE3LIB = sqlite3.lib
  287. !ENDIF
  288. !ENDIF
  289. # This is the name to use for the SQLite shell executable (EXE).
  290. #
  291. !IFNDEF SQLITE3EXE
  292. !IF $(FOR_WIN10)!=0
  293. SQLITE3EXE = winsqlite3shell.exe
  294. !ELSE
  295. SQLITE3EXE = sqlite3.exe
  296. !ENDIF
  297. !ENDIF
  298. # This is the argument used to set the program database (PDB) file for the
  299. # SQLite shell executable (EXE).
  300. #
  301. !IFNDEF SQLITE3EXEPDB
  302. !IF $(FOR_WIN10)!=0
  303. SQLITE3EXEPDB =
  304. !ELSE
  305. SQLITE3EXEPDB = /pdb:sqlite3sh.pdb
  306. !ENDIF
  307. !ENDIF
  308. # <<mark>>
  309. # These are the names of the customized Tcl header files used by various parts
  310. # of this makefile when the stdcall calling convention is in use. It is not
  311. # used for any other purpose.
  312. #
  313. !IFNDEF SQLITETCLH
  314. SQLITETCLH = sqlite_tcl.h
  315. !ENDIF
  316. !IFNDEF SQLITETCLDECLSH
  317. SQLITETCLDECLSH = sqlite_tclDecls.h
  318. !ENDIF
  319. # This is the name to use for the dynamic link library (DLL) containing the
  320. # Tcl bindings for SQLite.
  321. #
  322. !IFNDEF SQLITE3TCLDLL
  323. SQLITE3TCLDLL = tclsqlite3.dll
  324. !ENDIF
  325. # These are the additional targets that the targets that integrate with the
  326. # Tcl library should depend on when compiling, etc.
  327. #
  328. !IFNDEF SQLITE_TCL_DEP
  329. !IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
  330. SQLITE_TCL_DEP = $(SQLITETCLDECLSH) $(SQLITETCLH)
  331. !ELSE
  332. SQLITE_TCL_DEP =
  333. !ENDIF
  334. !ENDIF
  335. # <</mark>>
  336. # These are the "standard" SQLite compilation options used when compiling for
  337. # the Windows platform.
  338. #
  339. !IFNDEF OPT_FEATURE_FLAGS
  340. OPT_FEATURE_FLAGS = $(OPT_XTRA)
  341. !IF $(MINIMAL_AMALGAMATION)==0
  342. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS3=1
  343. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS5=1
  344. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RTREE=1
  345. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_GEOPOLY=1
  346. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_STMTVTAB=1
  347. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBPAGE_VTAB=1
  348. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBSTAT_VTAB=1
  349. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_BYTECODE_VTAB=1
  350. !ENDIF
  351. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_COLUMN_METADATA=1
  352. !ENDIF
  353. # Additional feature-options above and beyond what are normally used can be
  354. # be added using OPTIONS=.... on the command-line. These values are
  355. # appended to the OPT_FEATURE_FLAGS variable.
  356. #
  357. !IFDEF OPTIONS
  358. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) $(OPTIONS)
  359. !ENDIF
  360. # Should the session extension be enabled? If so, add compilation options
  361. # to enable it.
  362. #
  363. !IF $(SESSION)!=0
  364. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_SESSION=1
  365. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_PREUPDATE_HOOK=1
  366. !ENDIF
  367. # Always enable math functions on Windows
  368. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_MATH_FUNCTIONS
  369. # Should the rbu extension be enabled? If so, add compilation options
  370. # to enable it.
  371. #
  372. !IF $(RBU)!=0
  373. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RBU=1
  374. !ENDIF
  375. # Should structured exception handling (SEH) be enabled for WAL mode in
  376. # the core library? It is on by default. Only omit it if the
  377. # USE_SEH=0 option is provided on the nmake command-line.
  378. #
  379. !IF $(USE_SEH)==0
  380. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_OMIT_SEH=1
  381. !ENDIF
  382. # These are the "extended" SQLite compilation options used when compiling for
  383. # the Windows 10 platform.
  384. #
  385. !IFNDEF EXT_FEATURE_FLAGS
  386. !IF $(FOR_WIN10)!=0
  387. EXT_FEATURE_FLAGS = $(EXT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS4=1
  388. EXT_FEATURE_FLAGS = $(EXT_FEATURE_FLAGS) -DSQLITE_SYSTEM_MALLOC=1
  389. EXT_FEATURE_FLAGS = $(EXT_FEATURE_FLAGS) -DSQLITE_OMIT_LOCALTIME=1
  390. !ELSE
  391. EXT_FEATURE_FLAGS =
  392. !ENDIF
  393. !ENDIF
  394. ###############################################################################
  395. ############################### END OF OPTIONS ################################
  396. ###############################################################################
  397. # When compiling for the Windows 10 platform, the PLATFORM macro must be set
  398. # to an appropriate value (e.g. x86, x64, arm, arm64, etc).
  399. #
  400. !IF $(FOR_WIN10)!=0
  401. !IFNDEF PLATFORM
  402. !ERROR Using the FOR_WIN10 option requires a value for PLATFORM.
  403. !ENDIF
  404. !ENDIF
  405. # This assumes that MSVC is always installed in 32-bit Program Files directory
  406. # and sets the variable for use in locating other 32-bit installs accordingly.
  407. #
  408. PROGRAMFILES_X86 = $(VCINSTALLDIR)\..\..
  409. PROGRAMFILES_X86 = $(PROGRAMFILES_X86:\\=\)
  410. # Check for the predefined command macro CC. This should point to the compiler
  411. # binary for the target platform. If it is not defined, simply define it to
  412. # the legacy default value 'cl.exe'.
  413. #
  414. !IFNDEF CC
  415. CC = cl.exe
  416. !ENDIF
  417. # Check for the predefined command macro CSC. This should point to a working
  418. # C Sharp compiler binary. If it is not defined, simply define it to the
  419. # legacy default value 'csc.exe'.
  420. #
  421. !IFNDEF CSC
  422. CSC = csc.exe
  423. !ENDIF
  424. # Check for the command macro LD. This should point to the linker binary for
  425. # the target platform. If it is not defined, simply define it to the legacy
  426. # default value 'link.exe'.
  427. #
  428. !IFNDEF LD
  429. LD = link.exe
  430. !ENDIF
  431. # Check for the predefined command macro RC. This should point to the resource
  432. # compiler binary for the target platform. If it is not defined, simply define
  433. # it to the legacy default value 'rc.exe'.
  434. #
  435. !IFNDEF RC
  436. RC = rc.exe
  437. !ENDIF
  438. # Check for the MSVC runtime library path macro. Otherwise, this value will
  439. # default to the 'lib' directory underneath the MSVC installation directory.
  440. #
  441. !IFNDEF CRTLIBPATH
  442. CRTLIBPATH = $(VCINSTALLDIR)\lib
  443. !ENDIF
  444. CRTLIBPATH = $(CRTLIBPATH:\\=\)
  445. # Check for the command macro NCC. This should point to the compiler binary
  446. # for the platform the compilation process is taking place on. If it is not
  447. # defined, simply define it to have the same value as the CC macro. When
  448. # cross-compiling, it is suggested that this macro be modified via the command
  449. # line (since nmake itself does not provide a built-in method to guess it).
  450. # For example, to use the x86 compiler when cross-compiling for x64, a command
  451. # line similar to the following could be used (all on one line):
  452. #
  453. # nmake /f Makefile.msc sqlite3.dll
  454. # XCOMPILE=1 USE_NATIVE_LIBPATHS=1
  455. #
  456. # Alternatively, the full path and file name to the compiler binary for the
  457. # platform the compilation process is taking place may be specified (all on
  458. # one line):
  459. #
  460. # nmake /f Makefile.msc sqlite3.dll
  461. # "NCC=""%VCINSTALLDIR%\bin\cl.exe"""
  462. # USE_NATIVE_LIBPATHS=1
  463. #
  464. !IFDEF NCC
  465. NCC = $(NCC:\\=\)
  466. !ELSEIF $(XCOMPILE)!=0
  467. NCC = "$(VCINSTALLDIR)\bin\$(CC)"
  468. NCC = $(NCC:\\=\)
  469. !ELSE
  470. NCC = $(CC)
  471. !ENDIF
  472. # Check for the MSVC native runtime library path macro. Otherwise,
  473. # this value will default to the 'lib' directory underneath the MSVC
  474. # installation directory.
  475. #
  476. !IFNDEF NCRTLIBPATH
  477. NCRTLIBPATH = $(VCINSTALLDIR)\lib
  478. !ENDIF
  479. NCRTLIBPATH = $(NCRTLIBPATH:\\=\)
  480. # Check for the Platform SDK library path macro. Otherwise, this
  481. # value will default to the 'lib' directory underneath the Windows
  482. # SDK installation directory (the environment variable used appears
  483. # to be available when using Visual C++ 2008 or later via the
  484. # command line).
  485. #
  486. !IFNDEF NSDKLIBPATH
  487. NSDKLIBPATH = $(WINDOWSSDKDIR)\lib
  488. !ENDIF
  489. NSDKLIBPATH = $(NSDKLIBPATH:\\=\)
  490. # Check for the UCRT library path macro. Otherwise, this value will
  491. # default to the version-specific, platform-specific 'lib' directory
  492. # underneath the Windows SDK installation directory.
  493. #
  494. !IFNDEF UCRTLIBPATH
  495. UCRTLIBPATH = $(WINDOWSSDKDIR)\lib\$(WINDOWSSDKLIBVERSION)\ucrt\$(PLATFORM)
  496. !ENDIF
  497. UCRTLIBPATH = $(UCRTLIBPATH:\\=\)
  498. # C compiler and options for use in building executables that
  499. # will run on the platform that is doing the build.
  500. #
  501. !IF $(USE_FULLWARN)!=0
  502. BCC = $(NCC) -nologo -W4 -Fd$*.pdb $(CCOPTS) $(BCCOPTS)
  503. !ELSE
  504. BCC = $(NCC) -nologo -W3 -Fd$*.pdb $(CCOPTS) $(BCCOPTS)
  505. !ENDIF
  506. # Check if assembly code listings should be generated for the source
  507. # code files to be compiled.
  508. #
  509. !IF $(USE_LISTINGS)!=0
  510. BCC = $(BCC) -FAcs
  511. !ENDIF
  512. # Check if the native library paths should be used when compiling
  513. # the command line tools used during the compilation process. If
  514. # so, set the necessary macro now.
  515. #
  516. !IF $(USE_NATIVE_LIBPATHS)!=0
  517. NLTLIBPATHS = "/LIBPATH:$(NCRTLIBPATH)" "/LIBPATH:$(NSDKLIBPATH)"
  518. !IFDEF NUCRTLIBPATH
  519. NUCRTLIBPATH = $(NUCRTLIBPATH:\\=\)
  520. NLTLIBPATHS = $(NLTLIBPATHS) "/LIBPATH:$(NUCRTLIBPATH)"
  521. !ENDIF
  522. !ENDIF
  523. # C compiler and options for use in building executables that
  524. # will run on the target platform. (BCC and TCC are usually the
  525. # same unless your are cross-compiling.)
  526. #
  527. !IF $(USE_FULLWARN)!=0
  528. TCC = $(CC) -nologo -W4 -DINCLUDE_MSVC_H=1 $(CCOPTS) $(TCCOPTS)
  529. !ELSE
  530. TCC = $(CC) -nologo -W3 $(CCOPTS) $(TCCOPTS)
  531. !ENDIF
  532. # Check if warnings should be treated as errors when compiling.
  533. #
  534. !IF $(USE_FATAL_WARN)!=0
  535. TCC = $(TCC) -WX
  536. !ENDIF
  537. TCC = $(TCC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) -I$(TOP)\src -fp:precise
  538. RCC = $(RC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) -I$(TOP)\src $(RCOPTS) $(RCCOPTS)
  539. # Check if we want to use the "stdcall" calling convention when compiling.
  540. # This is not supported by the compilers for non-x86 platforms. It should
  541. # also be noted here that building any target with these "stdcall" options
  542. # will most likely fail if the Tcl library is also required. This is due
  543. # to how the Tcl library functions are declared and exported (i.e. without
  544. # an explicit calling convention, which results in "cdecl").
  545. #
  546. !IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
  547. !IF "$(PLATFORM)"=="x86"
  548. CORE_CCONV_OPTS = -Gz -guard:cf -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
  549. SHELL_CCONV_OPTS = -Gz -guard:cf -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
  550. # <<mark>>
  551. TEST_CCONV_OPTS = -Gz -guard:cf -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall -DINCLUDE_SQLITE_TCL_H=1 -DSQLITE_TCLAPI=__cdecl
  552. # <</mark>>
  553. !ELSE
  554. !IFNDEF PLATFORM
  555. CORE_CCONV_OPTS = -Gz -guard:cf -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
  556. SHELL_CCONV_OPTS = -Gz -guard:cf -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
  557. # <<mark>>
  558. TEST_CCONV_OPTS = -Gz -guard:cf -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall -DINCLUDE_SQLITE_TCL_H=1 -DSQLITE_TCLAPI=__cdecl
  559. # <</mark>>
  560. !ELSE
  561. CORE_CCONV_OPTS =
  562. SHELL_CCONV_OPTS =
  563. # <<mark>>
  564. TEST_CCONV_OPTS =
  565. # <</mark>>
  566. !ENDIF
  567. !ENDIF
  568. !ELSE
  569. CORE_CCONV_OPTS =
  570. SHELL_CCONV_OPTS =
  571. # <<mark>>
  572. TEST_CCONV_OPTS =
  573. # <</mark>>
  574. !ENDIF
  575. # These are additional compiler options used for the core library.
  576. #
  577. !IFNDEF CORE_COMPILE_OPTS
  578. !IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
  579. CORE_COMPILE_OPTS = $(CORE_CCONV_OPTS) -DSQLITE_API=__declspec(dllexport)
  580. !ELSE
  581. CORE_COMPILE_OPTS = $(CORE_CCONV_OPTS)
  582. !ENDIF
  583. !ENDIF
  584. # These are the additional targets that the core library should depend on
  585. # when linking.
  586. #
  587. !IFNDEF CORE_LINK_DEP
  588. !IF $(DYNAMIC_SHELL)!=0
  589. CORE_LINK_DEP =
  590. !ELSEIF $(FOR_WIN10)==0 || "$(PLATFORM)"=="x86"
  591. CORE_LINK_DEP = sqlite3.def
  592. !ELSE
  593. CORE_LINK_DEP =
  594. !ENDIF
  595. !ENDIF
  596. # These are additional linker options used for the core library.
  597. #
  598. !IFNDEF CORE_LINK_OPTS
  599. !IF $(DYNAMIC_SHELL)!=0
  600. CORE_LINK_OPTS =
  601. !ELSEIF $(FOR_WIN10)==0 || "$(PLATFORM)"=="x86"
  602. CORE_LINK_OPTS = /DEF:sqlite3.def
  603. !ELSE
  604. CORE_LINK_OPTS =
  605. !ENDIF
  606. !ENDIF
  607. # These are additional compiler options used for the shell executable.
  608. #
  609. !IFNDEF SHELL_COMPILE_OPTS
  610. !IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
  611. SHELL_COMPILE_OPTS = $(SHELL_CCONV_OPTS) -DSQLITE_API=__declspec(dllimport)
  612. !ELSE
  613. SHELL_COMPILE_OPTS = $(SHELL_CCONV_OPTS)
  614. !ENDIF
  615. !ENDIF
  616. # This is the source code that the shell executable should be compiled
  617. # with.
  618. #
  619. !IFNDEF SHELL_CORE_SRC
  620. !IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
  621. SHELL_CORE_SRC =
  622. # <<mark>>
  623. !ELSEIF $(USE_AMALGAMATION)==0
  624. SHELL_CORE_SRC =
  625. # <</mark>>
  626. !ELSE
  627. SHELL_CORE_SRC = $(SQLITE3C)
  628. !ENDIF
  629. !ENDIF
  630. # This is the core library that the shell executable should depend on.
  631. #
  632. !IFNDEF SHELL_CORE_DEP
  633. !IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
  634. SHELL_CORE_DEP = $(SQLITE3DLL)
  635. # <<mark>>
  636. !ELSEIF $(USE_AMALGAMATION)==0
  637. SHELL_CORE_DEP = libsqlite3.lib
  638. # <</mark>>
  639. !ELSE
  640. SHELL_CORE_DEP =
  641. !ENDIF
  642. !ENDIF
  643. # <<mark>>
  644. # If zlib support is enabled, add the dependencies for it.
  645. #
  646. !IF $(USE_ZLIB)!=0 && $(BUILD_ZLIB)!=0
  647. SHELL_CORE_DEP = zlib $(SHELL_CORE_DEP)
  648. TESTFIXTURE_DEP = zlib $(TESTFIXTURE_DEP)
  649. !ENDIF
  650. # <</mark>>
  651. # This is the core library that the shell executable should link with.
  652. #
  653. !IFNDEF SHELL_CORE_LIB
  654. !IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
  655. SHELL_CORE_LIB = $(SQLITE3LIB)
  656. # <<mark>>
  657. !ELSEIF $(USE_AMALGAMATION)==0
  658. SHELL_CORE_LIB = libsqlite3.lib
  659. # <</mark>>
  660. !ELSE
  661. SHELL_CORE_LIB =
  662. !ENDIF
  663. !ENDIF
  664. # These are additional linker options used for the shell executable.
  665. #
  666. !IFNDEF SHELL_LINK_OPTS
  667. SHELL_LINK_OPTS = $(SHELL_CORE_LIB)
  668. !ENDIF
  669. # Check if assembly code listings should be generated for the source
  670. # code files to be compiled.
  671. #
  672. !IF $(USE_LISTINGS)!=0
  673. TCC = $(TCC) -FAcs
  674. !ENDIF
  675. # When compiling the library for use in the WinRT environment,
  676. # the following compile-time options must be used as well to
  677. # disable use of Win32 APIs that are not available and to enable
  678. # use of Win32 APIs that are specific to Windows 8 and/or WinRT.
  679. #
  680. !IF $(FOR_WINRT)!=0
  681. TCC = $(TCC) -DSQLITE_OS_WINRT=1
  682. RCC = $(RCC) -DSQLITE_OS_WINRT=1
  683. TCC = $(TCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
  684. RCC = $(RCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
  685. !ENDIF
  686. # C compiler options for the Windows 10 platform (needs MSVC 2015).
  687. #
  688. !IF $(FOR_WIN10)!=0
  689. TCC = $(TCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
  690. BCC = $(BCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
  691. !ENDIF
  692. # Also, we need to dynamically link to the correct MSVC runtime
  693. # when compiling for WinRT (e.g. debug or release) OR if the
  694. # USE_CRT_DLL option is set to force dynamically linking to the
  695. # MSVC runtime library.
  696. #
  697. !IF $(FOR_WINRT)!=0 || $(USE_CRT_DLL)!=0
  698. !IF $(DEBUG)>1
  699. TCC = $(TCC) -MDd
  700. BCC = $(BCC) -MDd
  701. !ELSE
  702. TCC = $(TCC) -MD
  703. BCC = $(BCC) -MD
  704. !ENDIF
  705. !ELSE
  706. !IF $(DEBUG)>1
  707. TCC = $(TCC) -MTd
  708. BCC = $(BCC) -MTd
  709. !ELSE
  710. TCC = $(TCC) -MT
  711. BCC = $(BCC) -MT
  712. !ENDIF
  713. !ENDIF
  714. # <<mark>>
  715. # The mksqlite3c.tcl and mksqlite3h.tcl scripts will pull in
  716. # any extension header files by default. For non-amalgamation
  717. # builds, we need to make sure the compiler can find these.
  718. #
  719. !IF $(USE_AMALGAMATION)==0
  720. TCC = $(TCC) -I$(TOP)\ext\fts3
  721. RCC = $(RCC) -I$(TOP)\ext\fts3
  722. TCC = $(TCC) -I$(TOP)\ext\rtree
  723. RCC = $(RCC) -I$(TOP)\ext\rtree
  724. TCC = $(TCC) -I$(TOP)\ext\session
  725. RCC = $(RCC) -I$(TOP)\ext\session
  726. !ENDIF
  727. # The mksqlite3c.tcl script accepts some options on the command
  728. # line. When compiling with debugging enabled, some of these
  729. # options are necessary in order to allow debugging symbols to
  730. # work correctly with Visual Studio when using the amalgamation.
  731. #
  732. !IFNDEF MKSQLITE3C_TOOL
  733. !IF $(MINIMAL_AMALGAMATION)!=0
  734. MKSQLITE3C_TOOL = $(TOP)\tool\mksqlite3c-noext.tcl
  735. !ELSE
  736. MKSQLITE3C_TOOL = $(TOP)\tool\mksqlite3c.tcl
  737. !ENDIF
  738. !ENDIF
  739. !IFNDEF MKSQLITE3C_ARGS
  740. !IF $(DEBUG)>1 && $(NO_LINEMACROS)==0
  741. MKSQLITE3C_ARGS = --linemacros=1
  742. !ELSE
  743. MKSQLITE3C_ARGS = --linemacros=0
  744. !ENDIF
  745. !IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
  746. MKSQLITE3C_ARGS = $(MKSQLITE3C_ARGS) --useapicall
  747. !ENDIF
  748. !ENDIF
  749. # The mksqlite3h.tcl script accepts some options on the command line.
  750. # When compiling with stdcall support, some of these options are
  751. # necessary.
  752. #
  753. !IFNDEF MKSQLITE3H_ARGS
  754. !IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
  755. MKSQLITE3H_ARGS = --useapicall
  756. !ELSE
  757. MKSQLITE3H_ARGS =
  758. !ENDIF
  759. !ENDIF
  760. # <</mark>>
  761. # Define -DNDEBUG to compile without debugging (i.e., for production usage)
  762. # Omitting the define will cause extra debugging code to be inserted and
  763. # includes extra comments when "EXPLAIN stmt" is used.
  764. #
  765. !IF $(DEBUG)==0
  766. TCC = $(TCC) -DNDEBUG
  767. BCC = $(BCC) -DNDEBUG
  768. RCC = $(RCC) -DNDEBUG
  769. !ENDIF
  770. !IF $(DEBUG)>0 || $(API_ARMOR)!=0 || $(FOR_WIN10)!=0
  771. TCC = $(TCC) -DSQLITE_ENABLE_API_ARMOR=1
  772. RCC = $(RCC) -DSQLITE_ENABLE_API_ARMOR=1
  773. !ENDIF
  774. !IF $(DEBUG)>2
  775. TCC = $(TCC) -DSQLITE_DEBUG=1
  776. RCC = $(RCC) -DSQLITE_DEBUG=1
  777. !IF $(DYNAMIC_SHELL)==0
  778. TCC = $(TCC) -DSQLITE_ENABLE_WHERETRACE -DSQLITE_ENABLE_SELECTTRACE
  779. RCC = $(RCC) -DSQLITE_ENABLE_WHERETRACE -DSQLITE_ENABLE_SELECTTRACE
  780. !ENDIF
  781. !ENDIF
  782. !IF $(DEBUG)>4 || $(OSTRACE)!=0
  783. TCC = $(TCC) -DSQLITE_FORCE_OS_TRACE=1 -DSQLITE_DEBUG_OS_TRACE=1
  784. RCC = $(RCC) -DSQLITE_FORCE_OS_TRACE=1 -DSQLITE_DEBUG_OS_TRACE=1
  785. !ENDIF
  786. !IF $(DEBUG)>5
  787. TCC = $(TCC) -DSQLITE_ENABLE_IOTRACE=1
  788. RCC = $(RCC) -DSQLITE_ENABLE_IOTRACE=1
  789. !ENDIF
  790. # Prevent warnings about "insecure" MSVC runtime library functions
  791. # being used.
  792. #
  793. TCC = $(TCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
  794. BCC = $(BCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
  795. RCC = $(RCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
  796. # Prevent warnings about "deprecated" POSIX functions being used.
  797. #
  798. TCC = $(TCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
  799. BCC = $(BCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
  800. RCC = $(RCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
  801. # Use the SQLite debugging heap subsystem?
  802. #
  803. !IF $(MEMDEBUG)!=0
  804. TCC = $(TCC) -DSQLITE_MEMDEBUG=1
  805. RCC = $(RCC) -DSQLITE_MEMDEBUG=1
  806. # Use native Win32 heap subsystem instead of malloc/free?
  807. #
  808. !ELSEIF $(WIN32HEAP)!=0
  809. TCC = $(TCC) -DSQLITE_WIN32_MALLOC=1
  810. RCC = $(RCC) -DSQLITE_WIN32_MALLOC=1
  811. # Validate the heap on every call into the native Win32 heap subsystem?
  812. #
  813. !IF $(DEBUG)>3
  814. TCC = $(TCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1
  815. RCC = $(RCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1
  816. !ENDIF
  817. !ENDIF
  818. # Address sanitizer if ASAN=1
  819. #
  820. !IF $(ASAN)>0
  821. TCC = $(TCC) /fsanitize=address
  822. !ENDIF
  823. # <<mark>>
  824. # The locations of the Tcl header and library files. Also, the library that
  825. # non-stubs enabled programs using Tcl must link against. These variables
  826. # (TCLINCDIR, TCLLIBDIR, and LIBTCL) may be overridden via the environment
  827. # prior to running nmake in order to match the actual installed location and
  828. # version on this machine.
  829. #
  830. !IF $(STATICALLY_LINK_TCL)!=0
  831. TCLSUFFIX = s
  832. !ENDIF
  833. !IFNDEF TCLSUFFIX
  834. TCLSUFFIX =
  835. !ENDIF
  836. !IFNDEF TCLDIR
  837. TCLDIR = C:\Tcl
  838. !ENDIF
  839. !IFNDEF TCLVERSION
  840. !IF EXISTS("$(TCLDIR)\lib\tcl90$(TCLSUFFIX).lib")
  841. TCLVERSION = 90
  842. !ELSEIF EXISTS("$(TCLDIR)\lib\tcl86$(TCLSUFFIX).lib")
  843. TCLVERSION = 86
  844. !ELSEIF EXISTS("$(TCLDIR)\lib\tcl86t.lib")
  845. TCLSUFFIX = t
  846. TCLVERSION = 86
  847. !ELSE
  848. TCLVERSION = 90
  849. !ENDIF
  850. !ENDIF
  851. !IFNDEF TCLINCDIR
  852. TCLINCDIR = $(TCLDIR)\include
  853. !ENDIF
  854. !IFNDEF TCLLIBDIR
  855. TCLLIBDIR = $(TCLDIR)\lib
  856. !ENDIF
  857. !IFNDEF LIBTCL
  858. LIBTCL = tcl$(TCLVERSION)$(TCLSUFFIX).lib
  859. !ENDIF
  860. !IFNDEF TCLLIBS
  861. !IF $(STATICALLY_LINK_TCL)!=0
  862. TCLLIBS = /NODEFAULTLIB:libucrt.lib netapi32.lib user32.lib ucrt.lib
  863. !ELSE
  864. TCLLIBS =
  865. !ENDIF
  866. !ENDIF
  867. !IFNDEF LIBTCLSTUB
  868. !IF EXISTS("$(TCLLIBDIR)\tclstub$(TCLSUFFIX).lib")
  869. LIBTCLSTUB = tclstub$(TCLSUFFIX).lib
  870. !ELSE
  871. LIBTCLSTUB = tclstub$(TCLVERSION)$(TCLSUFFIX).lib
  872. !ENDIF
  873. !ENDIF
  874. !IFNDEF LIBTCLPATH
  875. LIBTCLPATH = $(TCLDIR)\bin
  876. !ENDIF
  877. # The locations of the zlib header and library files. These variables
  878. # (ZLIBINCDIR, ZLIBLIBDIR, and ZLIBLIB) may be overridden via the environment
  879. # prior to running nmake in order to match the actual installed (or source
  880. # code) location on this machine.
  881. #
  882. !IFNDEF ZLIBDIR
  883. ZLIBDIR = $(TOP)\compat\zlib
  884. !ENDIF
  885. !IFNDEF ZLIBINCDIR
  886. ZLIBINCDIR = $(ZLIBDIR)
  887. !ENDIF
  888. !IFNDEF ZLIBLIBDIR
  889. ZLIBLIBDIR = $(ZLIBDIR)
  890. !ENDIF
  891. !IFNDEF ZLIBLIB
  892. !IF $(DYNAMIC_SHELL)!=0
  893. ZLIBLIB = zdll.lib
  894. !ELSE
  895. ZLIBLIB = zlib.lib
  896. !ENDIF
  897. !ENDIF
  898. # The locations of the ICU header and library files. These variables
  899. # (ICUINCDIR, ICULIBDIR, and LIBICU) may be overridden via the environment
  900. # prior to running nmake in order to match the actual installed location on
  901. # this machine.
  902. #
  903. !IFNDEF ICUDIR
  904. ICUDIR = $(TOP)\compat\icu
  905. !ENDIF
  906. !IFNDEF ICUINCDIR
  907. ICUINCDIR = $(ICUDIR)\include
  908. !ENDIF
  909. !IFNDEF ICULIBDIR
  910. ICULIBDIR = $(ICUDIR)\lib
  911. !ENDIF
  912. !IFNDEF LIBICU
  913. LIBICU = icuuc.lib icuin.lib
  914. !ENDIF
  915. # This is the command to use for tclsh - normally just "tclsh", but we may
  916. # know the specific version we want to use. This variable (TCLSH_CMD) may be
  917. # overridden via the environment prior to running nmake in order to select a
  918. # specific Tcl shell to use.
  919. #
  920. !IFNDEF TCLSH_CMD
  921. !IF EXISTS("$(TCLDIR)\bin\tclsh$(TCLVERSION).exe")
  922. TCLSH_CMD = $(TCLDIR)\bin\tclsh$(TCLVERSION).exe
  923. !ELSEIF EXISTS("$(TCLDIR)\bin\tclsh90.exe")
  924. TCLSH_CMD = $(TCLDIR)\bin\tclsh90.exe
  925. !ELSEIF EXISTS("$(TCLDIR)\bin\tclsh86.exe")
  926. TCLSH_CMD = $(TCLDIR)\bin\tclsh86.exe
  927. !ELSEIF EXISTS("$(TCLDIR)\bin\tclsh86t.exe")
  928. TCLSH_CMD = $(TCLDIR)\bin\tclsh86t.exe
  929. !ELSEIF EXISTS("$(TCLDIR)\bin\tclsh.exe")
  930. TCLSH_CMD = $(TCLDIR)\bin\tclsh.exe
  931. !ELSE
  932. TCLSH_CMD = tclsh
  933. !ENDIF
  934. !ENDIF
  935. # A light-weight TCLSH replacement that can be used for code generation
  936. # but which is not adequate for testing. This is "jimsh0" by default,
  937. # with source code in the repository. To force the whole build to use
  938. # the full, official tclsh, add WITHOUT_JIMSH=1 to the nmake command line.
  939. #
  940. !IFDEF WITHOUT_JIMSH
  941. JIM_TCLSH = $(TCLSH_CMD)
  942. !ENDIF
  943. !IFNDEF JIM_TCLSH
  944. JIM_TCLSH = jimsh0.exe
  945. !ENDIF
  946. # <</mark>>
  947. # Compiler options needed for programs that use the readline() library.
  948. #
  949. !IFNDEF READLINE_FLAGS
  950. READLINE_FLAGS = -DHAVE_READLINE=0
  951. !ENDIF
  952. # The library that programs using readline() must link against.
  953. #
  954. !IFNDEF LIBREADLINE
  955. LIBREADLINE =
  956. !ENDIF
  957. # Should the database engine be compiled threadsafe
  958. #
  959. TCC = $(TCC) -DSQLITE_THREADSAFE=1
  960. RCC = $(RCC) -DSQLITE_THREADSAFE=1
  961. # Do threads override each others locks by default (1), or do we test (-1)
  962. #
  963. TCC = $(TCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1
  964. RCC = $(RCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1
  965. # Any target libraries which libsqlite must be linked against
  966. #
  967. !IFNDEF TLIBS
  968. TLIBS =
  969. !ENDIF
  970. # Flags controlling use of the in memory btree implementation
  971. #
  972. # SQLITE_TEMP_STORE is 0 to force temporary tables to be in a file, 1 to
  973. # default to file, 2 to default to memory, and 3 to force temporary
  974. # tables to always be in memory.
  975. #
  976. TCC = $(TCC) -DSQLITE_TEMP_STORE=1
  977. RCC = $(RCC) -DSQLITE_TEMP_STORE=1
  978. # Enable/disable loadable extensions, and other optional features
  979. # based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*).
  980. # The same set of OMIT and ENABLE flags should be passed to the
  981. # LEMON parser generator and the mkkeywordhash tool as well.
  982. # These are the required SQLite compilation options used when compiling for
  983. # the Windows platform.
  984. #
  985. REQ_FEATURE_FLAGS = $(REQ_FEATURE_FLAGS) -DSQLITE_MAX_TRIGGER_DEPTH=100
  986. # If we are linking to the RPCRT4 library, enable features that need it.
  987. #
  988. !IF $(USE_RPCRT4_LIB)!=0
  989. REQ_FEATURE_FLAGS = $(REQ_FEATURE_FLAGS) -DSQLITE_WIN32_USE_UUID=1
  990. !ENDIF
  991. # Add the required and optional SQLite compilation options into the command
  992. # lines used to invoke the MSVC code and resource compilers.
  993. #
  994. TCC = $(TCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS)
  995. RCC = $(RCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS)
  996. # Add in any optional parameters specified on the commane line, e.g.
  997. # nmake /f Makefile.msc all "OPTS=-DSQLITE_ENABLE_FOO=1 -DSQLITE_OMIT_FOO=1"
  998. #
  999. TCC = $(TCC) $(OPTS)
  1000. RCC = $(RCC) $(OPTS)
  1001. # If compiling for debugging, add some defines.
  1002. #
  1003. !IF $(DEBUG)>1
  1004. TCC = $(TCC) -D_DEBUG
  1005. BCC = $(BCC) -D_DEBUG
  1006. RCC = $(RCC) -D_DEBUG
  1007. !ENDIF
  1008. # If optimizations are enabled or disabled (either implicitly or
  1009. # explicitly), add the necessary flags.
  1010. #
  1011. !IF $(DEBUG)>1 || $(OPTIMIZATIONS)==0
  1012. TCC = $(TCC) -Od
  1013. BCC = $(BCC) -Od
  1014. !IF $(USE_RUNTIME_CHECKS)!=0
  1015. TCC = $(TCC) -RTC1
  1016. BCC = $(BCC) -RTC1
  1017. !ENDIF
  1018. !ELSEIF $(OPTIMIZATIONS)>=3
  1019. TCC = $(TCC) -Ox
  1020. BCC = $(BCC) -Ox
  1021. !ELSEIF $(OPTIMIZATIONS)==2
  1022. TCC = $(TCC) -O2
  1023. BCC = $(BCC) -O2
  1024. !ELSEIF $(OPTIMIZATIONS)==1
  1025. TCC = $(TCC) -O1
  1026. BCC = $(BCC) -O1
  1027. !ENDIF
  1028. # If symbols are enabled (or compiling for debugging), enable PDBs.
  1029. #
  1030. !IF $(DEBUG)>1 || $(SYMBOLS)!=0
  1031. TCC = $(TCC) -Zi
  1032. BCC = $(BCC) -Zi
  1033. !ENDIF
  1034. # <<mark>>
  1035. # If zlib support is enabled, add the compiler options for it.
  1036. #
  1037. !IF $(USE_ZLIB)!=0
  1038. TCC = $(TCC) -DSQLITE_HAVE_ZLIB=1
  1039. RCC = $(RCC) -DSQLITE_HAVE_ZLIB=1
  1040. TCC = $(TCC) -I$(ZLIBINCDIR)
  1041. RCC = $(RCC) -I$(ZLIBINCDIR)
  1042. !ENDIF
  1043. # If ICU support is enabled, add the compiler options for it.
  1044. #
  1045. !IF $(USE_ICU)!=0
  1046. TCC = $(TCC) -DSQLITE_ENABLE_ICU=1
  1047. RCC = $(RCC) -DSQLITE_ENABLE_ICU=1
  1048. TCC = $(TCC) -I$(TOP)\ext\icu
  1049. RCC = $(RCC) -I$(TOP)\ext\icu
  1050. TCC = $(TCC) -I$(ICUINCDIR)
  1051. RCC = $(RCC) -I$(ICUINCDIR)
  1052. !ENDIF
  1053. # <</mark>>
  1054. # Command line prefixes for compiling code, compiling resources,
  1055. # linking, etc.
  1056. #
  1057. LTCOMPILE = $(TCC) -Fo$@ -Fd$*.pdb
  1058. LTRCOMPILE = $(RCC) -r
  1059. LTLIB = lib.exe
  1060. LTLINK = $(TCC) -Fe$@
  1061. # If requested, link to the RPCRT4 library.
  1062. #
  1063. !IF $(USE_RPCRT4_LIB)!=0
  1064. LTLIBS = $(LTLIBS) rpcrt4.lib
  1065. !ENDIF
  1066. # If a platform was set, force the linker to target that.
  1067. # Note that the vcvars*.bat family of batch files typically
  1068. # set this for you. Otherwise, the linker will attempt
  1069. # to deduce the binary type based on the object files.
  1070. !IFDEF PLATFORM
  1071. LTLINKOPTS = /NOLOGO /MACHINE:$(PLATFORM)
  1072. LTLIBOPTS = /NOLOGO /MACHINE:$(PLATFORM)
  1073. !ELSEIF "$(VISUALSTUDIOVERSION)"=="12.0" || \
  1074. "$(VISUALSTUDIOVERSION)"=="14.0" || \
  1075. "$(VISUALSTUDIOVERSION)"=="15.0"
  1076. LTLINKOPTS = /NOLOGO /MACHINE:x86
  1077. LTLIBOPTS = /NOLOGO /MACHINE:x86
  1078. !ELSE
  1079. LTLINKOPTS = /NOLOGO
  1080. LTLIBOPTS = /NOLOGO
  1081. !ENDIF
  1082. # When compiling for use in the WinRT environment, the following
  1083. # linker option must be used to mark the executable as runnable
  1084. # only in the context of an application container.
  1085. #
  1086. !IF $(FOR_WINRT)!=0
  1087. LTLINKOPTS = $(LTLINKOPTS) /APPCONTAINER
  1088. !IF "$(VISUALSTUDIOVERSION)"=="12.0" || "$(VISUALSTUDIOVERSION)"=="14.0"
  1089. !IFNDEF STORELIBPATH
  1090. !IF "$(PLATFORM)"=="x86"
  1091. STORELIBPATH = $(CRTLIBPATH)\store
  1092. !ELSEIF "$(PLATFORM)"=="x64"
  1093. STORELIBPATH = $(CRTLIBPATH)\store\amd64
  1094. !ELSEIF "$(PLATFORM)"=="ARM"
  1095. STORELIBPATH = $(CRTLIBPATH)\store\arm
  1096. !ELSE
  1097. STORELIBPATH = $(CRTLIBPATH)\store
  1098. !ENDIF
  1099. !ENDIF
  1100. STORELIBPATH = $(STORELIBPATH:\\=\)
  1101. LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(STORELIBPATH)"
  1102. !ENDIF
  1103. !ENDIF
  1104. # When compiling for Windows Phone 8.1, an extra library path is
  1105. # required.
  1106. #
  1107. !IF $(USE_WP81_OPTS)!=0
  1108. !IFNDEF WP81LIBPATH
  1109. !IF "$(PLATFORM)"=="x86"
  1110. WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86
  1111. !ELSEIF "$(PLATFORM)"=="ARM"
  1112. WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\ARM
  1113. !ELSE
  1114. WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86
  1115. !ENDIF
  1116. !ENDIF
  1117. !ENDIF
  1118. # When compiling for Windows Phone 8.1, some extra linker options
  1119. # are also required.
  1120. #
  1121. !IF $(USE_WP81_OPTS)!=0
  1122. !IFDEF WP81LIBPATH
  1123. LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(WP81LIBPATH)"
  1124. !ENDIF
  1125. LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE
  1126. LTLINKOPTS = $(LTLINKOPTS) WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelHost.lib
  1127. LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:kernel32.lib /NODEFAULTLIB:ole32.lib
  1128. !ENDIF
  1129. # When compiling for UWP or the Windows 10 platform, some extra linker
  1130. # options are also required.
  1131. #
  1132. !IF $(FOR_UWP)!=0 || $(FOR_WIN10)!=0
  1133. LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE /NODEFAULTLIB:kernel32.lib
  1134. LTLINKOPTS = $(LTLINKOPTS) mincore.lib
  1135. !IFDEF PSDKLIBPATH
  1136. LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(PSDKLIBPATH)"
  1137. !ENDIF
  1138. !ENDIF
  1139. !IF $(FOR_WIN10)!=0
  1140. LTLINKOPTS = $(LTLINKOPTS) /guard:cf "/LIBPATH:$(UCRTLIBPATH)"
  1141. !IF $(DEBUG)>1
  1142. LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:libucrtd.lib /DEFAULTLIB:ucrtd.lib
  1143. !ELSE
  1144. LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib
  1145. !ENDIF
  1146. !ENDIF
  1147. # If either debugging or symbols are enabled, enable PDBs.
  1148. #
  1149. !IF $(DEBUG)>1 || $(SYMBOLS)!=0
  1150. LDFLAGS = /DEBUG $(LDOPTS)
  1151. !ELSE
  1152. LDFLAGS = $(LDOPTS)
  1153. !ENDIF
  1154. # <<mark>>
  1155. # Start with the Tcl related linker options.
  1156. #
  1157. !IF $(NO_TCL)==0
  1158. TCLLIBPATHS = $(TCLLIBPATHS) /LIBPATH:$(TCLLIBDIR)
  1159. TCLLIBS = $(TCLLIBS) $(LIBTCL)
  1160. !ENDIF
  1161. # If zlib support is enabled, add the linker options for it.
  1162. #
  1163. !IF $(USE_ZLIB)!=0
  1164. LTLIBPATHS = $(LTLIBPATHS) /LIBPATH:$(ZLIBLIBDIR)
  1165. LTLIBS = $(LTLIBS) $(ZLIBLIB)
  1166. !ENDIF
  1167. # If ICU support is enabled, add the linker options for it.
  1168. #
  1169. !IF $(USE_ICU)!=0
  1170. LTLIBPATHS = $(LTLIBPATHS) /LIBPATH:$(ICULIBDIR)
  1171. LTLIBS = $(LTLIBS) $(LIBICU)
  1172. !ENDIF
  1173. # <</mark>>
  1174. # You should not have to change anything below this line
  1175. ###############################################################################
  1176. # <<mark>>
  1177. # Object files for the SQLite library (non-amalgamation).
  1178. #
  1179. LIBOBJS0 = vdbe.lo parse.lo alter.lo analyze.lo attach.lo auth.lo \
  1180. backup.lo bitvec.lo btmutex.lo btree.lo build.lo \
  1181. callback.lo complete.lo ctime.lo \
  1182. date.lo dbpage.lo dbstat.lo delete.lo \
  1183. expr.lo fault.lo fkey.lo \
  1184. fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo \
  1185. fts3_porter.lo fts3_snippet.lo fts3_tokenizer.lo fts3_tokenizer1.lo \
  1186. fts3_tokenize_vtab.lo fts3_unicode.lo fts3_unicode2.lo fts3_write.lo \
  1187. fts5.lo \
  1188. func.lo global.lo hash.lo \
  1189. icu.lo insert.lo json.lo legacy.lo loadext.lo \
  1190. main.lo malloc.lo mem0.lo mem1.lo mem2.lo mem3.lo mem5.lo \
  1191. memdb.lo memjournal.lo \
  1192. mutex.lo mutex_noop.lo mutex_unix.lo mutex_w32.lo \
  1193. notify.lo opcodes.lo os.lo os_kv.lo os_unix.lo os_win.lo \
  1194. pager.lo pcache.lo pcache1.lo pragma.lo prepare.lo printf.lo \
  1195. random.lo resolve.lo rowset.lo rtree.lo \
  1196. sqlite3session.lo select.lo sqlite3rbu.lo status.lo stmt.lo \
  1197. table.lo threads.lo tokenize.lo treeview.lo trigger.lo \
  1198. update.lo upsert.lo util.lo vacuum.lo \
  1199. vdbeapi.lo vdbeaux.lo vdbeblob.lo vdbemem.lo vdbesort.lo \
  1200. vdbetrace.lo vdbevtab.lo wal.lo walker.lo where.lo wherecode.lo \
  1201. whereexpr.lo \
  1202. window.lo utf.lo vtab.lo
  1203. # <</mark>>
  1204. # Object files for the amalgamation.
  1205. #
  1206. LIBOBJS1 = sqlite3.lo
  1207. # Determine the real value of LIBOBJ based on the 'configure' script
  1208. #
  1209. # <<mark>>
  1210. !IF $(USE_AMALGAMATION)==0
  1211. LIBOBJ = $(LIBOBJS0)
  1212. !ELSE
  1213. # <</mark>>
  1214. LIBOBJ = $(LIBOBJS1)
  1215. # <<mark>>
  1216. !ENDIF
  1217. # <</mark>>
  1218. # Determine if embedded resource compilation and usage are enabled.
  1219. #
  1220. !IF $(USE_RC)!=0
  1221. LIBRESOBJS = sqlite3res.lo
  1222. !ELSE
  1223. LIBRESOBJS =
  1224. !ENDIF
  1225. # <<mark>>
  1226. # Core source code files, part 1.
  1227. #
  1228. SRC00 = \
  1229. $(TOP)\src\alter.c \
  1230. $(TOP)\src\analyze.c \
  1231. $(TOP)\src\attach.c \
  1232. $(TOP)\src\auth.c \
  1233. $(TOP)\src\backup.c \
  1234. $(TOP)\src\bitvec.c \
  1235. $(TOP)\src\btmutex.c \
  1236. $(TOP)\src\btree.c \
  1237. $(TOP)\src\build.c \
  1238. $(TOP)\src\callback.c \
  1239. $(TOP)\src\complete.c \
  1240. $(TOP)\src\ctime.c \
  1241. $(TOP)\src\date.c \
  1242. $(TOP)\src\dbpage.c \
  1243. $(TOP)\src\dbstat.c \
  1244. $(TOP)\src\delete.c \
  1245. $(TOP)\src\expr.c \
  1246. $(TOP)\src\fault.c \
  1247. $(TOP)\src\fkey.c \
  1248. $(TOP)\src\func.c \
  1249. $(TOP)\src\global.c \
  1250. $(TOP)\src\hash.c \
  1251. $(TOP)\src\insert.c \
  1252. $(TOP)\src\json.c \
  1253. $(TOP)\src\legacy.c \
  1254. $(TOP)\src\loadext.c \
  1255. $(TOP)\src\main.c \
  1256. $(TOP)\src\malloc.c \
  1257. $(TOP)\src\mem0.c \
  1258. $(TOP)\src\mem1.c \
  1259. $(TOP)\src\mem2.c \
  1260. $(TOP)\src\mem3.c \
  1261. $(TOP)\src\mem5.c \
  1262. $(TOP)\src\memdb.c \
  1263. $(TOP)\src\memjournal.c \
  1264. $(TOP)\src\mutex.c \
  1265. $(TOP)\src\mutex_noop.c \
  1266. $(TOP)\src\mutex_unix.c \
  1267. $(TOP)\src\mutex_w32.c \
  1268. $(TOP)\src\notify.c \
  1269. $(TOP)\src\os.c \
  1270. $(TOP)\src\os_kv.c \
  1271. $(TOP)\src\os_unix.c \
  1272. $(TOP)\src\os_win.c
  1273. # Core source code files, part 2.
  1274. #
  1275. SRC01 = \
  1276. $(TOP)\src\pager.c \
  1277. $(TOP)\src\pcache.c \
  1278. $(TOP)\src\pcache1.c \
  1279. $(TOP)\src\pragma.c \
  1280. $(TOP)\src\prepare.c \
  1281. $(TOP)\src\printf.c \
  1282. $(TOP)\src\random.c \
  1283. $(TOP)\src\resolve.c \
  1284. $(TOP)\src\rowset.c \
  1285. $(TOP)\src\select.c \
  1286. $(TOP)\src\status.c \
  1287. $(TOP)\src\table.c \
  1288. $(TOP)\src\threads.c \
  1289. $(TOP)\src\tclsqlite.c \
  1290. $(TOP)\src\tokenize.c \
  1291. $(TOP)\src\treeview.c \
  1292. $(TOP)\src\trigger.c \
  1293. $(TOP)\src\utf.c \
  1294. $(TOP)\src\update.c \
  1295. $(TOP)\src\upsert.c \
  1296. $(TOP)\src\util.c \
  1297. $(TOP)\src\vacuum.c \
  1298. $(TOP)\src\vdbe.c \
  1299. $(TOP)\src\vdbeapi.c \
  1300. $(TOP)\src\vdbeaux.c \
  1301. $(TOP)\src\vdbeblob.c \
  1302. $(TOP)\src\vdbemem.c \
  1303. $(TOP)\src\vdbesort.c \
  1304. $(TOP)\src\vdbetrace.c \
  1305. $(TOP)\src\vdbevtab.c \
  1306. $(TOP)\src\vtab.c \
  1307. $(TOP)\src\wal.c \
  1308. $(TOP)\src\walker.c \
  1309. $(TOP)\src\where.c \
  1310. $(TOP)\src\wherecode.c \
  1311. $(TOP)\src\whereexpr.c \
  1312. $(TOP)\src\window.c
  1313. # Core miscellaneous files.
  1314. #
  1315. SRC03 = \
  1316. $(TOP)\src\parse.y
  1317. # Core header files, part 1.
  1318. #
  1319. SRC04 = \
  1320. $(TOP)\src\btree.h \
  1321. $(TOP)\src\btreeInt.h \
  1322. $(TOP)\src\hash.h \
  1323. $(TOP)\src\hwtime.h \
  1324. $(TOP)\src\msvc.h \
  1325. $(TOP)\src\mutex.h \
  1326. $(TOP)\src\os.h \
  1327. $(TOP)\src\os_common.h \
  1328. $(TOP)\src\os_setup.h \
  1329. $(TOP)\src\os_win.h
  1330. # Core header files, part 2.
  1331. #
  1332. SRC05 = \
  1333. $(TOP)\src\pager.h \
  1334. $(TOP)\src\pcache.h \
  1335. $(TOP)\src\pragma.h \
  1336. $(TOP)\src\sqlite.h.in \
  1337. $(TOP)\src\sqlite3ext.h \
  1338. $(TOP)\src\sqliteInt.h \
  1339. $(TOP)\src\sqliteLimit.h \
  1340. $(TOP)\src\vdbe.h \
  1341. $(TOP)\src\vdbeInt.h \
  1342. $(TOP)\src\vxworks.h \
  1343. $(TOP)\src\wal.h \
  1344. $(TOP)\src\whereInt.h
  1345. # Extension source code files, part 2.
  1346. #
  1347. SRC07 = \
  1348. $(TOP)\ext\fts3\fts3.c \
  1349. $(TOP)\ext\fts3\fts3_aux.c \
  1350. $(TOP)\ext\fts3\fts3_expr.c \
  1351. $(TOP)\ext\fts3\fts3_hash.c \
  1352. $(TOP)\ext\fts3\fts3_icu.c \
  1353. $(TOP)\ext\fts3\fts3_porter.c \
  1354. $(TOP)\ext\fts3\fts3_snippet.c \
  1355. $(TOP)\ext\fts3\fts3_tokenizer.c \
  1356. $(TOP)\ext\fts3\fts3_tokenizer1.c \
  1357. $(TOP)\ext\fts3\fts3_tokenize_vtab.c \
  1358. $(TOP)\ext\fts3\fts3_unicode.c \
  1359. $(TOP)\ext\fts3\fts3_unicode2.c \
  1360. $(TOP)\ext\fts3\fts3_write.c \
  1361. $(TOP)\ext\icu\icu.c \
  1362. $(TOP)\ext\rtree\rtree.c \
  1363. $(TOP)\ext\session\sqlite3session.c \
  1364. $(TOP)\ext\rbu\sqlite3rbu.c \
  1365. $(TOP)\ext\misc\stmt.c
  1366. # Extension header files, part 2.
  1367. #
  1368. SRC09 = \
  1369. $(TOP)\ext\fts3\fts3.h \
  1370. $(TOP)\ext\fts3\fts3Int.h \
  1371. $(TOP)\ext\fts3\fts3_hash.h \
  1372. $(TOP)\ext\fts3\fts3_tokenizer.h \
  1373. $(TOP)\ext\icu\sqliteicu.h \
  1374. $(TOP)\ext\rtree\rtree.h \
  1375. $(TOP)\ext\rtree\geopoly.c \
  1376. $(TOP)\ext\rbu\sqlite3rbu.h \
  1377. $(TOP)\ext\session\sqlite3session.h
  1378. # Generated source code files
  1379. #
  1380. SRC10 = \
  1381. opcodes.c \
  1382. parse.c
  1383. # Generated header files
  1384. #
  1385. SRC11 = \
  1386. keywordhash.h \
  1387. opcodes.h \
  1388. parse.h \
  1389. shell.c \
  1390. $(SQLITE3H)
  1391. # Generated Tcl header files
  1392. #
  1393. !IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
  1394. SRC12 = \
  1395. $(SQLITETCLH) \
  1396. $(SQLITETCLDECLSH)
  1397. !ELSE
  1398. SRC12 =
  1399. !ENDIF
  1400. # All source code files.
  1401. #
  1402. SRC = $(SRC00) $(SRC01) $(SRC03) $(SRC04) $(SRC05) $(SRC07) $(SRC09) $(SRC10) $(SRC11) $(SRC12)
  1403. # Source code to the test files.
  1404. #
  1405. TESTSRC = \
  1406. $(TOP)\src\test1.c \
  1407. $(TOP)\src\test2.c \
  1408. $(TOP)\src\test3.c \
  1409. $(TOP)\src\test4.c \
  1410. $(TOP)\src\test5.c \
  1411. $(TOP)\src\test6.c \
  1412. $(TOP)\src\test8.c \
  1413. $(TOP)\src\test9.c \
  1414. $(TOP)\src\test_autoext.c \
  1415. $(TOP)\src\test_backup.c \
  1416. $(TOP)\src\test_bestindex.c \
  1417. $(TOP)\src\test_blob.c \
  1418. $(TOP)\src\test_btree.c \
  1419. $(TOP)\src\test_config.c \
  1420. $(TOP)\src\test_delete.c \
  1421. $(TOP)\src\test_demovfs.c \
  1422. $(TOP)\src\test_devsym.c \
  1423. $(TOP)\src\test_fs.c \
  1424. $(TOP)\src\test_func.c \
  1425. $(TOP)\src\test_hexio.c \
  1426. $(TOP)\src\test_init.c \
  1427. $(TOP)\src\test_intarray.c \
  1428. $(TOP)\src\test_journal.c \
  1429. $(TOP)\src\test_malloc.c \
  1430. $(TOP)\src\test_md5.c \
  1431. $(TOP)\src\test_multiplex.c \
  1432. $(TOP)\src\test_mutex.c \
  1433. $(TOP)\src\test_onefile.c \
  1434. $(TOP)\src\test_osinst.c \
  1435. $(TOP)\src\test_pcache.c \
  1436. $(TOP)\src\test_quota.c \
  1437. $(TOP)\src\test_rtree.c \
  1438. $(TOP)\src\test_schema.c \
  1439. $(TOP)\src\test_superlock.c \
  1440. $(TOP)\src\test_syscall.c \
  1441. $(TOP)\src\test_tclsh.c \
  1442. $(TOP)\src\test_tclvar.c \
  1443. $(TOP)\src\test_thread.c \
  1444. $(TOP)\src\test_vdbecov.c \
  1445. $(TOP)\src\test_vfs.c \
  1446. $(TOP)\src\test_windirent.c \
  1447. $(TOP)\src\test_window.c \
  1448. $(TOP)\src\test_wsd.c \
  1449. $(TOP)\ext\fts3\fts3_term.c \
  1450. $(TOP)\ext\fts3\fts3_test.c \
  1451. $(TOP)\ext\rbu\test_rbu.c \
  1452. $(TOP)\ext\session\test_session.c
  1453. # Statically linked extensions.
  1454. #
  1455. TESTEXT = \
  1456. $(TOP)\ext\expert\sqlite3expert.c \
  1457. $(TOP)\ext\expert\test_expert.c \
  1458. $(TOP)\ext\misc\amatch.c \
  1459. $(TOP)\ext\misc\appendvfs.c \
  1460. $(TOP)\ext\misc\basexx.c \
  1461. $(TOP)\ext\misc\carray.c \
  1462. $(TOP)\ext\misc\cksumvfs.c \
  1463. $(TOP)\ext\misc\closure.c \
  1464. $(TOP)\ext\misc\csv.c \
  1465. $(TOP)\ext\misc\decimal.c \
  1466. $(TOP)\ext\misc\eval.c \
  1467. $(TOP)\ext\misc\explain.c \
  1468. $(TOP)\ext\misc\fileio.c \
  1469. $(TOP)\ext\misc\fuzzer.c \
  1470. $(TOP)\ext\fts5\fts5_tcl.c \
  1471. $(TOP)\ext\fts5\fts5_test_mi.c \
  1472. $(TOP)\ext\fts5\fts5_test_tok.c \
  1473. $(TOP)\ext\misc\ieee754.c \
  1474. $(TOP)\ext\misc\mmapwarm.c \
  1475. $(TOP)\ext\misc\nextchar.c \
  1476. $(TOP)\ext\misc\normalize.c \
  1477. $(TOP)\ext\misc\percentile.c \
  1478. $(TOP)\ext\misc\prefixes.c \
  1479. $(TOP)\ext\misc\qpvtab.c \
  1480. $(TOP)\ext\misc\randomjson.c \
  1481. $(TOP)\ext\misc\regexp.c \
  1482. $(TOP)\ext\misc\remember.c \
  1483. $(TOP)\ext\misc\series.c \
  1484. $(TOP)\ext\misc\spellfix.c \
  1485. $(TOP)\ext\misc\stmtrand.c \
  1486. $(TOP)\ext\misc\totype.c \
  1487. $(TOP)\ext\misc\unionvtab.c \
  1488. $(TOP)\ext\misc\wholenumber.c \
  1489. $(TOP)\ext\rtree\test_rtreedoc.c \
  1490. $(TOP)\ext\recover\sqlite3recover.c \
  1491. $(TOP)\ext\recover\test_recover.c \
  1492. $(TOP)\ext\intck\test_intck.c \
  1493. $(TOP)\ext\intck\sqlite3intck.c \
  1494. $(TOP)\ext\recover\dbdata.c
  1495. # If use of zlib is enabled, add the "zipfile.c" source file.
  1496. #
  1497. !IF $(USE_ZLIB)!=0
  1498. TESTEXT = $(TESTEXT) $(TOP)\ext\misc\zipfile.c
  1499. !ENDIF
  1500. # Source code to the library files needed by the test fixture
  1501. # (non-amalgamation)
  1502. #
  1503. TESTSRC2 = \
  1504. $(SRC00) \
  1505. $(SRC01) \
  1506. $(SRC07) \
  1507. $(SRC10) \
  1508. fts5.c
  1509. # Header files used by all library source files.
  1510. #
  1511. HDR = \
  1512. $(TOP)\src\btree.h \
  1513. $(TOP)\src\btreeInt.h \
  1514. $(TOP)\src\hash.h \
  1515. $(TOP)\src\hwtime.h \
  1516. keywordhash.h \
  1517. $(TOP)\src\msvc.h \
  1518. $(TOP)\src\mutex.h \
  1519. opcodes.h \
  1520. $(TOP)\src\os.h \
  1521. $(TOP)\src\os_common.h \
  1522. $(TOP)\src\os_setup.h \
  1523. $(TOP)\src\os_win.h \
  1524. $(TOP)\src\pager.h \
  1525. $(TOP)\src\pcache.h \
  1526. parse.h \
  1527. $(TOP)\src\pragma.h \
  1528. $(SQLITE3H) \
  1529. sqlite3ext.h \
  1530. $(TOP)\src\sqliteInt.h \
  1531. $(TOP)\src\sqliteLimit.h \
  1532. $(TOP)\src\vdbe.h \
  1533. $(TOP)\src\vdbeInt.h \
  1534. $(TOP)\src\vxworks.h \
  1535. $(TOP)\src\whereInt.h
  1536. # Header files used by extensions
  1537. #
  1538. EXTHDR = $(EXTHDR) \
  1539. $(TOP)\ext\fts3\fts3.h \
  1540. $(TOP)\ext\fts3\fts3Int.h \
  1541. $(TOP)\ext\fts3\fts3_hash.h \
  1542. $(TOP)\ext\fts3\fts3_tokenizer.h
  1543. EXTHDR = $(EXTHDR) \
  1544. $(TOP)\ext\rtree\rtree.h \
  1545. $(TOP)\ext\rtree\geopoly.c
  1546. EXTHDR = $(EXTHDR) \
  1547. $(TOP)\ext\icu\sqliteicu.h
  1548. EXTHDR = $(EXTHDR) \
  1549. $(TOP)\ext\rtree\sqlite3rtree.h
  1550. EXTHDR = $(EXTHDR) \
  1551. $(TOP)\ext\session\sqlite3session.h
  1552. # executables needed for testing
  1553. #
  1554. TESTPROGS = \
  1555. testfixture.exe \
  1556. $(SQLITE3EXE) \
  1557. sqlite3_analyzer.exe \
  1558. sqlite3_checker.exe \
  1559. sqldiff.exe \
  1560. dbhash.exe \
  1561. sqltclsh.exe
  1562. # Databases containing fuzzer test cases
  1563. #
  1564. FUZZDATA = \
  1565. $(TOP)\test\fuzzdata1.db \
  1566. $(TOP)\test\fuzzdata2.db \
  1567. $(TOP)\test\fuzzdata3.db \
  1568. $(TOP)\test\fuzzdata4.db \
  1569. $(TOP)\test\fuzzdata5.db \
  1570. $(TOP)\test\fuzzdata6.db \
  1571. $(TOP)\test\fuzzdata7.db \
  1572. $(TOP)\test\fuzzdata8.db
  1573. # <</mark>>
  1574. # Additional compiler options for the shell. These are only effective
  1575. # when the shell is not being dynamically linked.
  1576. #
  1577. !IF $(DYNAMIC_SHELL)==0 && $(FOR_WIN10)==0
  1578. SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_DQS=0
  1579. SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_FTS4=1
  1580. SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_EXPLAIN_COMMENTS=1
  1581. SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_OFFSET_SQL_FUNC=1
  1582. SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION=1
  1583. SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_STMT_SCANSTATUS=1
  1584. SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_STRICT_SUBTYPE=1
  1585. !ENDIF
  1586. # <<mark>>
  1587. # Extra compiler options for various test tools.
  1588. #
  1589. MPTESTER_COMPILE_OPTS = -DSQLITE_ENABLE_FTS5
  1590. FUZZERSHELL_COMPILE_OPTS =
  1591. FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -I$(TOP)\test -I$(TOP)\ext\recover
  1592. FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_MEMSYS5
  1593. FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_OSS_FUZZ
  1594. FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_BYTECODE_VTAB
  1595. FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_DBPAGE_VTAB
  1596. FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_DBSTAT_VTAB
  1597. FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_BYTECODE_VTAB
  1598. FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_DESERIALIZE
  1599. FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_EXPLAIN_COMMENTS
  1600. FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_FTS3_PARENTHESIS
  1601. FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_FTS4
  1602. FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_FTS5
  1603. FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_GEOPOLY
  1604. FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_MATH_FUNCTIONS
  1605. FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_MEMSYS5
  1606. FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_NORMALIZE
  1607. FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_OFFSET_SQL_FUNC
  1608. FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_PREUPDATE_HOOK
  1609. FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_RTREE
  1610. FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_SESSION
  1611. FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_STMTVTAB
  1612. FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
  1613. FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_STAT4
  1614. FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_STMT_SCANSTATUS
  1615. FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_MAX_MEMORY=50000000
  1616. FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_MAX_MMAP_SIZE=0
  1617. FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_OMIT_LOAD_EXTENSION
  1618. FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_PRINTF_PRECISION_LIMIT=1000
  1619. FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_PRIVATE=""
  1620. FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_STRICT_SUBTYPE=1
  1621. FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_STATIC_RANDOMJSON
  1622. FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_MAX_MEMORY=50000000
  1623. FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_PRINTF_PRECISION_LIMIT=1000
  1624. FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_OMIT_LOAD_EXTENSION
  1625. FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_FTS4
  1626. FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_FTS5
  1627. FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_RTREE
  1628. FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_GEOPOLY
  1629. FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_DBSTAT_VTAB
  1630. FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_BYTECODE_VTAB
  1631. FUZZCHECK_SRC = $(FUZZCHECK_SRC) $(TOP)\test\fuzzcheck.c
  1632. FUZZCHECK_SRC = $(FUZZCHECK_SRC) $(TOP)\test\ossfuzz.c
  1633. FUZZCHECK_SRC = $(FUZZCHECK_SRC) $(TOP)\test\fuzzinvariants.c
  1634. FUZZCHECK_SRC = $(FUZZCHECK_SRC) $(TOP)\test\vt02.c
  1635. FUZZCHECK_SRC = $(FUZZCHECK_SRC) $(TOP)\ext\recover\dbdata.c
  1636. FUZZCHECK_SRC = $(FUZZCHECK_SRC) $(TOP)\ext\recover\sqlite3recover.c
  1637. FUZZCHECK_SRC = $(FUZZCHECK_SRC) $(TOP)\ext\misc\percentile.c
  1638. FUZZCHECK_SRC = $(FUZZCHECK_SRC) $(TOP)\ext\misc\randomjson.c
  1639. OSSSHELL_SRC = $(TOP)\test\ossshell.c $(TOP)\test\ossfuzz.c
  1640. DBFUZZ_COMPILE_OPTS = -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION
  1641. KV_COMPILE_OPTS = -DSQLITE_THREADSAFE=0 -DSQLITE_DIRECT_OVERFLOW_READ
  1642. ST_COMPILE_OPTS = -DSQLITE_THREADSAFE=0
  1643. # Standard options to testfixture.
  1644. #
  1645. TESTOPTS = --verbose=file --output=test-out.txt
  1646. # Extra targets for the "all" target that require Tcl.
  1647. #
  1648. !IF $(NO_TCL)==0
  1649. ALL_TCL_TARGETS = $(SQLITE3TCLDLL)
  1650. !ELSE
  1651. ALL_TCL_TARGETS =
  1652. !ENDIF
  1653. # <</mark>>
  1654. # This is the default Makefile target. The objects listed here
  1655. # are what get build when you type just "make" with no arguments.
  1656. #
  1657. core: dll libsqlite3.lib shell
  1658. # Targets that require the Tcl library.
  1659. #
  1660. tcl: $(ALL_TCL_TARGETS)
  1661. # This Makefile target builds all of the standard binaries.
  1662. #
  1663. all: core tcl
  1664. # Dynamic link library section.
  1665. #
  1666. dll: $(SQLITE3DLL)
  1667. # Shell executable.
  1668. #
  1669. shell: $(SQLITE3EXE)
  1670. # jimsh0 - replacement for tclsh
  1671. #
  1672. jimsh0.exe: $(TOP)\autosetup\jimsh0.c
  1673. cl -DHAVE__FULLPATH=1 $(TOP)\autosetup\jimsh0.c
  1674. # <<mark>>
  1675. libsqlite3.lib: $(LIBOBJ)
  1676. $(LTLIB) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS)
  1677. libtclsqlite3.lib: tclsqlite.lo libsqlite3.lib
  1678. $(LTLIB) $(LTLIBOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCLSTUB) $(TLIBS)
  1679. tclsqlite3.def: tclsqlite.lo
  1680. echo EXPORTS > tclsqlite3.def
  1681. dumpbin /all tclsqlite.lo \
  1682. | $(TCLSH_CMD) $(TOP)\tool\replace.tcl include "^\s+/EXPORT:_?((?:Sqlite3|Tclsqlite3)_[^@]*)(?:@\d+)?$$" \1 \
  1683. | sort >> tclsqlite3.def
  1684. pkgIndex.tcl: $(TOP)\VERSION
  1685. for /F %%V in ('type "$(TOP)\VERSION"') do ( \
  1686. echo package ifneeded sqlite3 @version@ [list load [file join $$dir $(SQLITE3TCLDLL)] Sqlite3] \
  1687. | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact @version@ %%V > pkgIndex.tcl \
  1688. )
  1689. $(SQLITE3TCLDLL): libtclsqlite3.lib $(LIBRESOBJS) tclsqlite3.def pkgIndex.tcl
  1690. $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /DEF:tclsqlite3.def /OUT:$@ libtclsqlite3.lib $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
  1691. tclextension: $(SQLITE3TCLDLL)
  1692. tclextension-install: $(SQLITE3TCLDLL)
  1693. $(TCLSH_CMD) $(TOP)\tool\buildtclext.tcl --install-only
  1694. tclextension-uninstall:
  1695. $(TCLSH_CMD) $(TOP)\tool\buildtclext.tcl --uninstall
  1696. tclextension-list:
  1697. $(TCLSH_CMD) $(TOP)\tool\buildtclext.tcl --info
  1698. # <</mark>>
  1699. $(SQLITE3DLL): $(LIBOBJ) $(LIBRESOBJS) $(CORE_LINK_DEP)
  1700. $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL $(CORE_LINK_OPTS) /OUT:$@ $(LIBOBJ) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
  1701. # <<block2>>
  1702. sqlite3.def: libsqlite3.lib $(JIM_TCLSH)
  1703. echo EXPORTS > sqlite3.def
  1704. dumpbin /all libsqlite3.lib \
  1705. | $(JIM_TCLSH) $(TOP)\tool\replace.tcl include "^\s+1 _?(sqlite3(?:session|changeset|changegroup|rebaser|rbu)?_[^@]*)(?:@\d+)?$$" \1 \
  1706. | sort >> sqlite3.def
  1707. # <</block2>>
  1708. $(SQLITE3EXE): shell.c $(SHELL_CORE_DEP) $(LIBRESOBJS) $(SHELL_CORE_SRC) $(SQLITE3H)
  1709. $(LTLINK) $(SHELL_COMPILE_OPTS) $(READLINE_FLAGS) shell.c $(SHELL_CORE_SRC) \
  1710. /link $(SQLITE3EXEPDB) $(LDFLAGS) $(LTLINKOPTS) $(SHELL_LINK_OPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS)
  1711. # <<mark>>
  1712. sqldiff.exe: $(TOP)\tool\sqldiff.c $(TOP)\ext\misc\sqlite3_stdio.h $(TOP)\ext\misc\sqlite3_stdio.c $(SQLITE3C) $(SQLITE3H) $(LIBRESOBJS)
  1713. $(LTLINK) $(NO_WARN) -I$(TOP)\ext\misc $(TOP)\tool\sqldiff.c $(TOP)\ext\misc\sqlite3_stdio.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS) $(LIBRESOBJS)
  1714. dbhash.exe: $(TOP)\tool\dbhash.c $(SQLITE3C) $(SQLITE3H)
  1715. $(LTLINK) $(NO_WARN) $(TOP)\tool\dbhash.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
  1716. RSYNC_SRC = \
  1717. $(TOP)\tool\sqlite3_rsync.c \
  1718. $(SQLITE3C)
  1719. RSYNC_OPT = \
  1720. -DSQLITE_ENABLE_DBPAGE_VTAB \
  1721. -DSQLITE_THREADSAFE=0 \
  1722. -DSQLITE_OMIT_LOAD_EXTENSION \
  1723. -DSQLITE_OMIT_DEPRECATED
  1724. sqlite3_rsync.exe: $(RSYNC_SRC) $(LIBRESOBJS)
  1725. $(LTLINK) $(RSYNC_OPT) $(NO_WARN) $(RSYNC_SRC) /link $(LDFLAGS) $(LTLINKOPTS) $(LIBRESOBJS)
  1726. scrub.exe: $(TOP)\ext\misc\scrub.c $(SQLITE3C) $(SQLITE3H)
  1727. $(LTLINK) $(NO_WARN) -DSCRUB_STANDALONE=1 $(TOP)\ext\misc\scrub.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
  1728. srcck1.exe: $(TOP)\tool\srcck1.c
  1729. $(BCC) $(NO_WARN) -Fe$@ $(TOP)\tool\srcck1.c
  1730. sourcetest: srcck1.exe $(SQLITE3C)
  1731. srcck1.exe $(SQLITE3C)
  1732. src-verify.exe: $(TOP)\tool\src-verify.c
  1733. $(LTLINK) $(NO_WARN) $(TOP)\tool\src-verify.c
  1734. verify-source: src-verify.exe
  1735. src-verify.exe $(TOP)
  1736. fuzzershell.exe: $(TOP)\tool\fuzzershell.c $(SQLITE3C) $(SQLITE3H)
  1737. $(LTLINK) $(NO_WARN) $(FUZZERSHELL_COMPILE_OPTS) $(TOP)\tool\fuzzershell.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
  1738. dbfuzz.exe: $(TOP)\test\dbfuzz.c $(SQLITE3C) $(SQLITE3H)
  1739. $(LTLINK) $(NO_WARN) $(DBFUZZ_COMPILE_OPTS) $(TOP)\test\dbfuzz.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
  1740. fuzzcheck.exe: $(FUZZCHECK_SRC) $(SQLITE3C) $(SQLITE3H)
  1741. $(LTLINK) /F 8388608 $(NO_WARN) $(FUZZCHECK_OPTS) $(FUZZCHECK_SRC) $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
  1742. fuzzcheck-asan.exe: $(FUZZCHECK_SRC) $(SQLITE3C) $(SQLITE3H)
  1743. $(LTLINK) $(NO_WARN) /fsanitize=address $(FUZZCHECK_OPTS) $(FUZZCHECK_SRC) $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
  1744. run-fuzzcheck: fuzzcheck.exe fuzzcheck-asan.exe
  1745. fuzzcheck --spinner $(FUZZDB)
  1746. fuzzcheck-asan --spinner $(FUZZDB)
  1747. ossshell.exe: $(OSSSHELL_SRC) $(SQLITE3C) $(SQLITE3H)
  1748. $(LTLINK) $(NO_WARN) $(FUZZCHECK_OPTS) $(OSSSHELL_SRC) $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
  1749. sessionfuzz.exe: zlib $(TOP)\test\sessionfuzz.c $(SQLITE3C) $(SQLITE3H)
  1750. $(LTLINK) $(NO_WARN) -I$(ZLIBINCDIR) $(TOP)\test\sessionfuzz.c /link $(LDFLAGS) $(LTLINKOPTS) /LIBPATH:$(ZLIBLIBDIR) $(ZLIBLIB)
  1751. mptester.exe: $(TOP)\mptest\mptest.c $(SQLITE3C) $(SQLITE3H)
  1752. $(LTLINK) $(NO_WARN) $(MPTESTER_COMPILE_OPTS) $(TOP)\mptest\mptest.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
  1753. MPTEST1 = mptester mptest.db $(TOP)\mptest\crash01.test --repeat 20
  1754. MPTEST2 = mptester mptest.db $(TOP)\mptest\multiwrite01.test --repeat 20
  1755. mptest: mptester.exe
  1756. del /Q mptest.db 2>NUL
  1757. $(MPTEST1) --journalmode DELETE
  1758. $(MPTEST2) --journalmode WAL
  1759. $(MPTEST1) --journalmode WAL
  1760. $(MPTEST2) --journalmode PERSIST
  1761. $(MPTEST1) --journalmode PERSIST
  1762. $(MPTEST2) --journalmode TRUNCATE
  1763. $(MPTEST1) --journalmode TRUNCATE
  1764. $(MPTEST2) --journalmode DELETE
  1765. # This target creates a directory named "tsrc" and fills it with
  1766. # copies of all of the C source code and header files needed to
  1767. # build on the target system. Some of the C source code and header
  1768. # files are automatically generated. This target takes care of
  1769. # all that automatic generation.
  1770. #
  1771. .target_source: $(SRC) $(TOP)\tool\vdbe-compress.tcl fts5.c $(SQLITE_TCL_DEP) $(JIM_TCLSH)
  1772. -rmdir /Q/S tsrc 2>NUL
  1773. -mkdir tsrc
  1774. $(JIM_TCLSH) $(TOP)\tool\cp.tcl $(SRC00) $(SRC01) $(SRC03) $(SRC04) $(SRC05) $(SRC07) $(SRC09) $(SRC10) $(SRC11) $(SRC12) fts5.c fts5.h tsrc
  1775. copy /B tsrc\fts5.c +,,
  1776. copy /B tsrc\fts5.h +,,
  1777. del /Q tsrc\sqlite.h.in tsrc\parse.y 2>NUL
  1778. $(JIM_TCLSH) $(TOP)\tool\vdbe-compress.tcl $(OPTS) < tsrc\vdbe.c > vdbe.new
  1779. move vdbe.new tsrc\vdbe.c
  1780. echo > .target_source
  1781. sqlite3.c: .target_source sqlite3ext.h sqlite3session.h $(MKSQLITE3C_TOOL) src-verify.exe $(JIM_TCLSH)
  1782. $(JIM_TCLSH) $(MKSQLITE3C_TOOL) $(MKSQLITE3C_ARGS) $(EXTRA_SRC)
  1783. sqlite3-all.c: sqlite3.c $(TOP)\tool\split-sqlite3c.tcl $(JIM_TCLSH)
  1784. $(JIM_TCLSH) $(TOP)\tool\split-sqlite3c.tcl
  1785. # <</mark>>
  1786. # Rule to build the amalgamation
  1787. #
  1788. sqlite3.lo: $(SQLITE3C)
  1789. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(SQLITE3C)
  1790. # <<mark>>
  1791. # Rules to build the LEMON compiler generator
  1792. #
  1793. lempar.c: $(TOP)\tool\lempar.c
  1794. copy /Y $(TOP)\tool\lempar.c .
  1795. copy /B lempar.c +,,
  1796. lemon.exe: $(TOP)\tool\lemon.c lempar.c
  1797. $(BCC) $(NO_WARN) -Daccess=_access \
  1798. -Fe$@ $(TOP)\tool\lemon.c /link $(LDFLAGS) $(NLTLINKOPTS) $(NLTLIBPATHS)
  1799. # <<mark>>
  1800. # Rules to build the source-id generator tool
  1801. #
  1802. mksourceid.exe: $(TOP)\tool\mksourceid.c
  1803. $(BCC) $(NO_WARN) -Fe$@ $(TOP)\tool\mksourceid.c /link $(LDFLAGS) $(NLTLINKOPTS) $(NLTLIBPATHS)
  1804. # Rules to build individual *.lo files from generated *.c files. This
  1805. # applies to:
  1806. #
  1807. # parse.lo
  1808. # opcodes.lo
  1809. #
  1810. parse.lo: parse.c $(HDR)
  1811. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c parse.c
  1812. opcodes.lo: opcodes.c
  1813. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c opcodes.c
  1814. # <</mark>>
  1815. # Rule to build the Win32 resources object file.
  1816. #
  1817. !IF $(USE_RC)!=0
  1818. # <<block1>>
  1819. $(LIBRESOBJS): $(TOP)\src\sqlite3.rc $(SQLITE3H) $(TOP)\VERSION $(JIM_TCLSH)
  1820. echo #ifndef SQLITE_RESOURCE_VERSION > sqlite3rc.h
  1821. for /F %%V in ('type "$(TOP)\VERSION"') do ( \
  1822. echo #define SQLITE_RESOURCE_VERSION %%V \
  1823. | $(JIM_TCLSH) $(TOP)\tool\replace.tcl exact . ^, >> sqlite3rc.h \
  1824. )
  1825. echo #endif >> sqlite3rc.h
  1826. $(LTRCOMPILE) -fo $(LIBRESOBJS) $(TOP)\src\sqlite3.rc
  1827. # <</block1>>
  1828. !ENDIF
  1829. # <<mark>>
  1830. # Rules to build individual *.lo files from files in the src directory.
  1831. #
  1832. alter.lo: $(TOP)\src\alter.c $(HDR)
  1833. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\alter.c
  1834. analyze.lo: $(TOP)\src\analyze.c $(HDR)
  1835. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\analyze.c
  1836. attach.lo: $(TOP)\src\attach.c $(HDR)
  1837. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\attach.c
  1838. auth.lo: $(TOP)\src\auth.c $(HDR)
  1839. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\auth.c
  1840. backup.lo: $(TOP)\src\backup.c $(HDR)
  1841. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\backup.c
  1842. bitvec.lo: $(TOP)\src\bitvec.c $(HDR)
  1843. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\bitvec.c
  1844. btmutex.lo: $(TOP)\src\btmutex.c $(HDR)
  1845. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\btmutex.c
  1846. btree.lo: $(TOP)\src\btree.c $(HDR) $(TOP)\src\pager.h
  1847. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\btree.c
  1848. build.lo: $(TOP)\src\build.c $(HDR)
  1849. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\build.c
  1850. callback.lo: $(TOP)\src\callback.c $(HDR)
  1851. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\callback.c
  1852. complete.lo: $(TOP)\src\complete.c $(HDR)
  1853. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\complete.c
  1854. ctime.lo: $(TOP)\src\ctime.c $(HDR)
  1855. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\ctime.c
  1856. date.lo: $(TOP)\src\date.c $(HDR)
  1857. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\date.c
  1858. dbpage.lo: $(TOP)\src\dbpage.c $(HDR)
  1859. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\dbpage.c
  1860. dbstat.lo: $(TOP)\src\dbstat.c $(HDR)
  1861. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\dbstat.c
  1862. delete.lo: $(TOP)\src\delete.c $(HDR)
  1863. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\delete.c
  1864. expr.lo: $(TOP)\src\expr.c $(HDR)
  1865. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\expr.c
  1866. fault.lo: $(TOP)\src\fault.c $(HDR)
  1867. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\fault.c
  1868. fkey.lo: $(TOP)\src\fkey.c $(HDR)
  1869. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\fkey.c
  1870. func.lo: $(TOP)\src\func.c $(HDR)
  1871. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\func.c
  1872. global.lo: $(TOP)\src\global.c $(HDR)
  1873. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\global.c
  1874. hash.lo: $(TOP)\src\hash.c $(HDR)
  1875. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\hash.c
  1876. insert.lo: $(TOP)\src\insert.c $(HDR)
  1877. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\insert.c
  1878. json.lo: $(TOP)\src\json.c $(HDR)
  1879. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\json.c
  1880. legacy.lo: $(TOP)\src\legacy.c $(HDR)
  1881. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\legacy.c
  1882. loadext.lo: $(TOP)\src\loadext.c $(HDR)
  1883. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\loadext.c
  1884. main.lo: $(TOP)\src\main.c $(HDR)
  1885. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\main.c
  1886. malloc.lo: $(TOP)\src\malloc.c $(HDR)
  1887. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\malloc.c
  1888. mem0.lo: $(TOP)\src\mem0.c $(HDR)
  1889. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem0.c
  1890. mem1.lo: $(TOP)\src\mem1.c $(HDR)
  1891. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem1.c
  1892. mem2.lo: $(TOP)\src\mem2.c $(HDR)
  1893. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem2.c
  1894. mem3.lo: $(TOP)\src\mem3.c $(HDR)
  1895. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem3.c
  1896. mem5.lo: $(TOP)\src\mem5.c $(HDR)
  1897. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mem5.c
  1898. memdb.lo: $(TOP)\src\memdb.c $(HDR)
  1899. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\memdb.c
  1900. memjournal.lo: $(TOP)\src\memjournal.c $(HDR)
  1901. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\memjournal.c
  1902. mutex.lo: $(TOP)\src\mutex.c $(HDR)
  1903. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex.c
  1904. mutex_noop.lo: $(TOP)\src\mutex_noop.c $(HDR)
  1905. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex_noop.c
  1906. mutex_unix.lo: $(TOP)\src\mutex_unix.c $(HDR)
  1907. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex_unix.c
  1908. mutex_w32.lo: $(TOP)\src\mutex_w32.c $(HDR)
  1909. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\mutex_w32.c
  1910. notify.lo: $(TOP)\src\notify.c $(HDR)
  1911. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\notify.c
  1912. pager.lo: $(TOP)\src\pager.c $(HDR) $(TOP)\src\pager.h
  1913. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pager.c
  1914. pcache.lo: $(TOP)\src\pcache.c $(HDR) $(TOP)\src\pcache.h
  1915. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pcache.c
  1916. pcache1.lo: $(TOP)\src\pcache1.c $(HDR) $(TOP)\src\pcache.h
  1917. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pcache1.c
  1918. os.lo: $(TOP)\src\os.c $(HDR)
  1919. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\os.c
  1920. os_kv.lo: $(TOP)\src\os_kv.c $(HDR)
  1921. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\os_kv.c
  1922. os_unix.lo: $(TOP)\src\os_unix.c $(HDR)
  1923. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\os_unix.c
  1924. os_win.lo: $(TOP)\src\os_win.c $(HDR)
  1925. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\os_win.c
  1926. pragma.lo: $(TOP)\src\pragma.c $(HDR)
  1927. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\pragma.c
  1928. prepare.lo: $(TOP)\src\prepare.c $(HDR)
  1929. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\prepare.c
  1930. printf.lo: $(TOP)\src\printf.c $(HDR)
  1931. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\printf.c
  1932. random.lo: $(TOP)\src\random.c $(HDR)
  1933. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\random.c
  1934. resolve.lo: $(TOP)\src\resolve.c $(HDR)
  1935. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\resolve.c
  1936. rowset.lo: $(TOP)\src\rowset.c $(HDR)
  1937. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\rowset.c
  1938. select.lo: $(TOP)\src\select.c $(HDR)
  1939. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\select.c
  1940. status.lo: $(TOP)\src\status.c $(HDR)
  1941. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\status.c
  1942. table.lo: $(TOP)\src\table.c $(HDR)
  1943. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\table.c
  1944. threads.lo: $(TOP)\src\threads.c $(HDR)
  1945. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\threads.c
  1946. tokenize.lo: $(TOP)\src\tokenize.c keywordhash.h $(HDR)
  1947. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\tokenize.c
  1948. treeview.lo: $(TOP)\src\treeview.c $(HDR)
  1949. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\treeview.c
  1950. trigger.lo: $(TOP)\src\trigger.c $(HDR)
  1951. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\trigger.c
  1952. update.lo: $(TOP)\src\update.c $(HDR)
  1953. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\update.c
  1954. upsert.lo: $(TOP)\src\upsert.c $(HDR)
  1955. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\upsert.c
  1956. utf.lo: $(TOP)\src\utf.c $(HDR)
  1957. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\utf.c
  1958. util.lo: $(TOP)\src\util.c $(HDR)
  1959. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\util.c
  1960. vacuum.lo: $(TOP)\src\vacuum.c $(HDR)
  1961. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vacuum.c
  1962. vdbe.lo: $(TOP)\src\vdbe.c $(HDR)
  1963. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbe.c
  1964. vdbeapi.lo: $(TOP)\src\vdbeapi.c $(HDR)
  1965. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbeapi.c
  1966. vdbeaux.lo: $(TOP)\src\vdbeaux.c $(HDR)
  1967. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbeaux.c
  1968. vdbeblob.lo: $(TOP)\src\vdbeblob.c $(HDR)
  1969. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbeblob.c
  1970. vdbemem.lo: $(TOP)\src\vdbemem.c $(HDR)
  1971. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbemem.c
  1972. vdbesort.lo: $(TOP)\src\vdbesort.c $(HDR)
  1973. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbesort.c
  1974. vdbetrace.lo: $(TOP)\src\vdbetrace.c $(HDR)
  1975. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbetrace.c
  1976. vdbevtab.lo: $(TOP)\src\vdbevtab.c $(HDR)
  1977. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vdbevtab.c
  1978. vtab.lo: $(TOP)\src\vtab.c $(HDR)
  1979. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\vtab.c
  1980. wal.lo: $(TOP)\src\wal.c $(HDR)
  1981. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\wal.c
  1982. walker.lo: $(TOP)\src\walker.c $(HDR)
  1983. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\walker.c
  1984. where.lo: $(TOP)\src\where.c $(HDR)
  1985. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\where.c
  1986. wherecode.lo: $(TOP)\src\wherecode.c $(HDR)
  1987. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\wherecode.c
  1988. whereexpr.lo: $(TOP)\src\whereexpr.c $(HDR)
  1989. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\whereexpr.c
  1990. window.lo: $(TOP)\src\window.c $(HDR)
  1991. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\window.c
  1992. tclsqlite.lo: $(TOP)\src\tclsqlite.c $(HDR) $(SQLITE_TCL_DEP)
  1993. $(LTCOMPILE) $(NO_WARN) -DUSE_TCL_STUBS=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c
  1994. tclsqlite-shell.lo: $(TOP)\src\tclsqlite.c $(HDR) $(SQLITE_TCL_DEP)
  1995. $(LTCOMPILE) $(NO_WARN) -DTCLSH -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c
  1996. tclsqlite3.exe: tclsqlite-shell.lo $(SQLITE3C) $(SQLITE3H) $(LIBRESOBJS)
  1997. $(LTLINK) $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) /OUT:$@ tclsqlite-shell.lo $(LIBRESOBJS) $(TCLLIBS) $(LTLIBS) $(TLIBS)
  1998. # Rules to build opcodes.c and opcodes.h
  1999. #
  2000. opcodes.c: opcodes.h $(TOP)\tool\mkopcodec.tcl $(JIM_TCLSH)
  2001. $(JIM_TCLSH) $(TOP)\tool\mkopcodec.tcl opcodes.h > opcodes.c
  2002. opcodes.h: parse.h $(TOP)\src\vdbe.c $(TOP)\tool\mkopcodeh.tcl $(JIM_TCLSH)
  2003. type parse.h $(TOP)\src\vdbe.c | $(JIM_TCLSH) $(TOP)\tool\mkopcodeh.tcl > opcodes.h
  2004. # Rules to build parse.c and parse.h - the outputs of lemon.
  2005. #
  2006. parse.h: parse.c
  2007. parse.c: $(TOP)\src\parse.y lemon.exe
  2008. del /Q parse.y parse.h parse.h.temp 2>NUL
  2009. copy /Y $(TOP)\src\parse.y .
  2010. copy /B parse.y +,,
  2011. .\lemon.exe $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) $(OPTS) -S parse.y
  2012. $(SQLITE3H): $(TOP)\src\sqlite.h.in $(TOP)\manifest mksourceid.exe $(TOP)\VERSION $(JIM_TCLSH)
  2013. $(JIM_TCLSH) $(TOP)\tool\mksqlite3h.tcl "$(TOP:\=/)" > $(SQLITE3H) $(MKSQLITE3H_ARGS)
  2014. sqlite3ext.h: .target_source
  2015. !IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
  2016. type tsrc\sqlite3ext.h | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "\(\*\)" "(SQLITE_CALLBACK *)" \
  2017. | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "\(\*" "(SQLITE_APICALL *" > sqlite3ext.h
  2018. copy /Y sqlite3ext.h tsrc\sqlite3ext.h
  2019. !ELSE
  2020. copy /Y tsrc\sqlite3ext.h sqlite3ext.h
  2021. copy /B sqlite3ext.h +,,
  2022. !ENDIF
  2023. sqlite3session.h: $(TOP)\ext\session\sqlite3session.h
  2024. copy /Y $(TOP)\ext\session\sqlite3session.h .
  2025. copy /B sqlite3session.h +,,
  2026. mkkeywordhash.exe: $(TOP)\tool\mkkeywordhash.c
  2027. $(BCC) $(NO_WARN) -Fe$@ $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) $(OPTS) \
  2028. $(TOP)\tool\mkkeywordhash.c /link $(LDFLAGS) $(NLTLINKOPTS) $(NLTLIBPATHS)
  2029. keywordhash.h: $(TOP)\tool\mkkeywordhash.c mkkeywordhash.exe
  2030. .\mkkeywordhash.exe > keywordhash.h
  2031. # Source and header files that shell.c depends on
  2032. SHELL_DEP = \
  2033. $(TOP)\src\shell.c.in \
  2034. $(TOP)\ext\expert\sqlite3expert.c \
  2035. $(TOP)\ext\expert\sqlite3expert.h \
  2036. $(TOP)\ext\intck\sqlite3intck.c \
  2037. $(TOP)\ext\intck\sqlite3intck.h \
  2038. $(TOP)\ext\misc\appendvfs.c \
  2039. $(TOP)\ext\misc\base64.c \
  2040. $(TOP)\ext\misc\base85.c \
  2041. $(TOP)\ext\misc\completion.c \
  2042. $(TOP)\ext\misc\decimal.c \
  2043. $(TOP)\ext\misc\fileio.c \
  2044. $(TOP)\ext\misc\ieee754.c \
  2045. $(TOP)\ext\misc\memtrace.c \
  2046. $(TOP)\ext\misc\pcachetrace.c \
  2047. $(TOP)\ext\misc\percentile.c \
  2048. $(TOP)\ext\misc\regexp.c \
  2049. $(TOP)\ext\misc\series.c \
  2050. $(TOP)\ext\misc\sha1.c \
  2051. $(TOP)\ext\misc\shathree.c \
  2052. $(TOP)\ext\misc\sqlar.c \
  2053. $(TOP)\ext\misc\sqlite3_stdio.c \
  2054. $(TOP)\ext\misc\sqlite3_stdio.h \
  2055. $(TOP)\ext\misc\uint.c \
  2056. $(TOP)\ext\misc\vfstrace.c \
  2057. $(TOP)\ext\misc\zipfile.c \
  2058. $(TOP)\ext\recover\dbdata.c \
  2059. $(TOP)\ext\recover\sqlite3recover.c \
  2060. $(TOP)\ext\recover\sqlite3recover.h \
  2061. $(TOP)\src\test_windirent.c \
  2062. $(TOP)\src\test_windirent.h
  2063. # If use of zlib is enabled, add the "zipfile.c" source file.
  2064. #
  2065. !IF $(USE_ZLIB)!=0
  2066. SHELL_DEP = $(SHELL_DEP) $(TOP)\ext\misc\sqlar.c
  2067. SHELL_DEP = $(SHELL_DEP) $(TOP)\ext\misc\zipfile.c
  2068. !ENDIF
  2069. shell.c: $(SHELL_DEP) $(TOP)\tool\mkshellc.tcl $(JIM_TCLSH)
  2070. $(JIM_TCLSH) $(TOP)\tool\mkshellc.tcl > shell.c
  2071. zlib:
  2072. pushd $(ZLIBDIR) && $(MAKE) /f win32\Makefile.msc clean $(ZLIBLIB) && popd
  2073. # Rules to build the extension objects.
  2074. #
  2075. icu.lo: $(TOP)\ext\icu\icu.c $(HDR) $(EXTHDR)
  2076. $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\icu\icu.c
  2077. fts3.lo: $(TOP)\ext\fts3\fts3.c $(HDR) $(EXTHDR)
  2078. $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3.c
  2079. fts3_aux.lo: $(TOP)\ext\fts3\fts3_aux.c $(HDR) $(EXTHDR)
  2080. $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_aux.c
  2081. fts3_expr.lo: $(TOP)\ext\fts3\fts3_expr.c $(HDR) $(EXTHDR)
  2082. $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_expr.c
  2083. fts3_hash.lo: $(TOP)\ext\fts3\fts3_hash.c $(HDR) $(EXTHDR)
  2084. $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_hash.c
  2085. fts3_icu.lo: $(TOP)\ext\fts3\fts3_icu.c $(HDR) $(EXTHDR)
  2086. $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_icu.c
  2087. fts3_snippet.lo: $(TOP)\ext\fts3\fts3_snippet.c $(HDR) $(EXTHDR)
  2088. $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_snippet.c
  2089. fts3_porter.lo: $(TOP)\ext\fts3\fts3_porter.c $(HDR) $(EXTHDR)
  2090. $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_porter.c
  2091. fts3_tokenizer.lo: $(TOP)\ext\fts3\fts3_tokenizer.c $(HDR) $(EXTHDR)
  2092. $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenizer.c
  2093. fts3_tokenizer1.lo: $(TOP)\ext\fts3\fts3_tokenizer1.c $(HDR) $(EXTHDR)
  2094. $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenizer1.c
  2095. fts3_tokenize_vtab.lo: $(TOP)\ext\fts3\fts3_tokenize_vtab.c $(HDR) $(EXTHDR)
  2096. $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_tokenize_vtab.c
  2097. fts3_unicode.lo: $(TOP)\ext\fts3\fts3_unicode.c $(HDR) $(EXTHDR)
  2098. $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_unicode.c
  2099. fts3_unicode2.lo: $(TOP)\ext\fts3\fts3_unicode2.c $(HDR) $(EXTHDR)
  2100. $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_unicode2.c
  2101. fts3_write.lo: $(TOP)\ext\fts3\fts3_write.c $(HDR) $(EXTHDR)
  2102. $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_write.c
  2103. stmt.lo: $(TOP)\ext\misc\stmt.c $(HDR) $(EXTHDR)
  2104. $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\misc\stmt.c
  2105. rtree.lo: $(TOP)\ext\rtree\rtree.c $(HDR) $(EXTHDR)
  2106. $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\rtree\rtree.c
  2107. sqlite3session.lo: $(TOP)\ext\session\sqlite3session.c $(HDR) $(EXTHDR)
  2108. $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\session\sqlite3session.c
  2109. # FTS5 things
  2110. #
  2111. FTS5_SRC = \
  2112. $(TOP)\ext\fts5\fts5.h \
  2113. $(TOP)\ext\fts5\fts5Int.h \
  2114. $(TOP)\ext\fts5\fts5_aux.c \
  2115. $(TOP)\ext\fts5\fts5_buffer.c \
  2116. $(TOP)\ext\fts5\fts5_main.c \
  2117. $(TOP)\ext\fts5\fts5_config.c \
  2118. $(TOP)\ext\fts5\fts5_expr.c \
  2119. $(TOP)\ext\fts5\fts5_hash.c \
  2120. $(TOP)\ext\fts5\fts5_index.c \
  2121. fts5parse.c fts5parse.h \
  2122. $(TOP)\ext\fts5\fts5_storage.c \
  2123. $(TOP)\ext\fts5\fts5_tokenize.c \
  2124. $(TOP)\ext\fts5\fts5_unicode2.c \
  2125. $(TOP)\ext\fts5\fts5_varint.c \
  2126. $(TOP)\ext\fts5\fts5_vocab.c
  2127. LSM1_SRC = \
  2128. $(TOP)\ext\lsm1\lsm.h \
  2129. $(TOP)\ext\lsm1\lsmInt.h \
  2130. $(TOP)\ext\lsm1\lsm_ckpt.c \
  2131. $(TOP)\ext\lsm1\lsm_file.c \
  2132. $(TOP)\ext\lsm1\lsm_log.c \
  2133. $(TOP)\ext\lsm1\lsm_main.c \
  2134. $(TOP)\ext\lsm1\lsm_mem.c \
  2135. $(TOP)\ext\lsm1\lsm_mutex.c \
  2136. $(TOP)\ext\lsm1\lsm_shared.c \
  2137. $(TOP)\ext\lsm1\lsm_sorted.c \
  2138. $(TOP)\ext\lsm1\lsm_str.c \
  2139. $(TOP)\ext\lsm1\lsm_tree.c \
  2140. $(TOP)\ext\lsm1\lsm_unix.c \
  2141. $(TOP)\ext\lsm1\lsm_varint.c \
  2142. $(TOP)\ext\lsm1\lsm_vtab.c \
  2143. $(TOP)\ext\lsm1\lsm_win32.c
  2144. fts5parse.c: $(TOP)\ext\fts5\fts5parse.y lemon.exe
  2145. copy /Y $(TOP)\ext\fts5\fts5parse.y .
  2146. copy /B fts5parse.y +,,
  2147. del /Q fts5parse.h 2>NUL
  2148. .\lemon.exe $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) $(OPTS) -S fts5parse.y
  2149. fts5parse.h: fts5parse.c
  2150. fts5.c: $(FTS5_SRC) $(JIM_TCLSH)
  2151. $(JIM_TCLSH) $(TOP)\ext\fts5\tool\mkfts5c.tcl
  2152. copy /Y $(TOP)\ext\fts5\fts5.h .
  2153. copy /B fts5.h +,,
  2154. lsm1.c: $(LSM1_SRC) $(JIM_TCLSH)
  2155. $(JIM_TCLSH) $(TOP)\ext\lsm1\tool\mklsm1c.tcl
  2156. copy /Y $(TOP)\ext\lsm1\lsm.h .
  2157. copy /B lsm.h +,,
  2158. fts5.lo: fts5.c $(HDR) $(EXTHDR)
  2159. $(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c fts5.c
  2160. fts5_ext.lo: fts5.c $(HDR) $(EXTHDR)
  2161. $(LTCOMPILE) $(NO_WARN) -c fts5.c
  2162. fts5.dll: fts5_ext.lo
  2163. $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /OUT:$@ fts5_ext.lo
  2164. sqlite3rbu.lo: $(TOP)\ext\rbu\sqlite3rbu.c $(HDR) $(EXTHDR)
  2165. $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\rbu\sqlite3rbu.c
  2166. # Rules to build the 'testfixture' application.
  2167. #
  2168. # If using the amalgamation, use sqlite3.c directly to build the test
  2169. # fixture. Otherwise link against libsqlite3.lib. (This distinction is
  2170. # necessary because the test fixture requires non-API symbols which are
  2171. # hidden when the library is built via the amalgamation).
  2172. #
  2173. TESTFIXTURE_FLAGS = -DTCLSH_INIT_PROC=sqlite3TestInit -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
  2174. TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_SERVER=1 -DSQLITE_PRIVATE=""
  2175. TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_CORE $(NO_WARN)
  2176. TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_SERIES_CONSTRAINT_VERIFY=1
  2177. TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_DEFAULT_PAGE_SIZE=1024
  2178. TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_ENABLE_STMTVTAB=1
  2179. TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_ENABLE_DBPAGE_VTAB=1
  2180. TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_ENABLE_BYTECODE_VTAB=1
  2181. TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_CKSUMVFS_STATIC=1
  2182. TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) $(TEST_CCONV_OPTS)
  2183. TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_STATIC_RANDOMJSON
  2184. TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_STRICT_SUBTYPE=1
  2185. TESTFIXTURE_SRC0 = $(TESTEXT) $(TESTSRC2)
  2186. TESTFIXTURE_SRC1 = $(TESTEXT) $(SQLITE3C)
  2187. !IF $(USE_AMALGAMATION)==0
  2188. TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC0)
  2189. !ELSE
  2190. TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC1)
  2191. !ENDIF
  2192. !IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
  2193. sqlite_tclDecls.h:
  2194. echo #ifndef SQLITE_TCLAPI > $(SQLITETCLDECLSH)
  2195. echo # define SQLITE_TCLAPI >> $(SQLITETCLDECLSH)
  2196. echo #endif >> $(SQLITETCLDECLSH)
  2197. type "$(TCLINCDIR)\tclDecls.h" \
  2198. | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "^(EXTERN(?: CONST\d+?)?\s+?[^\(]*?\s+?)Tcl_" "\1 SQLITE_TCLAPI Tcl_" \
  2199. | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "^(EXTERN\s+?(?:void|VOID)\s+?)TclFreeObj" "\1 SQLITE_TCLAPI TclFreeObj" \
  2200. | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "\(\*tcl_" "(SQLITE_TCLAPI *tcl_" \
  2201. | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "\(\*tclFreeObj" "(SQLITE_TCLAPI *tclFreeObj" \
  2202. | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "\(\*" "(SQLITE_TCLAPI *" >> $(SQLITETCLDECLSH)
  2203. sqlite_tcl.h:
  2204. type "$(TCLINCDIR)\tcl.h" | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact tclDecls.h sqlite_tclDecls.h \
  2205. | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "typedef (.*?)\(Tcl_" "typedef \1 (SQLITE_TCLAPI Tcl_" \
  2206. | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact "void (*freeProc)" "void (SQLITE_TCLAPI *freeProc)" \
  2207. | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact "Tcl_HashEntry *(*findProc)" "Tcl_HashEntry *(SQLITE_TCLAPI *findProc)" \
  2208. | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact "Tcl_HashEntry *(*createProc)" "Tcl_HashEntry *(SQLITE_TCLAPI *createProc)" >> $(SQLITETCLH)
  2209. !ENDIF
  2210. testfixture.exe: $(TESTFIXTURE_SRC) $(TESTFIXTURE_DEP) $(SQLITE3H) $(LIBRESOBJS) $(HDR) $(SQLITE_TCL_DEP)
  2211. $(LTLINK) -DSQLITE_NO_SYNC=1 $(TESTFIXTURE_FLAGS) \
  2212. -DBUILD_sqlite -I$(TCLINCDIR) \
  2213. $(TESTFIXTURE_SRC) \
  2214. /link $(LDFLAGS) $(LTLINKOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) $(LIBRESOBJS) $(TCLLIBS) $(LTLIBS) $(TLIBS)
  2215. extensiontest: testfixture.exe testloadext.dll
  2216. @set PATH=$(LIBTCLPATH);$(PATH)
  2217. .\testfixture.exe $(TOP)\test\loadext.test $(TESTOPTS)
  2218. tool-zip: testfixture.exe sqlite3.exe sqldiff.exe sqlite3_analyzer.exe sqlite3_rsync.exe $(TOP)\tool\mktoolzip.tcl
  2219. .\testfixture.exe $(TOP)\tool\mktoolzip.tcl
  2220. coretestprogs: testfixture.exe sqlite3.exe
  2221. testprogs: $(TESTPROGS) srcck1.exe fuzzcheck.exe sessionfuzz.exe
  2222. fulltest: alltest fuzztest
  2223. alltest: $(TESTPROGS)
  2224. @set PATH=$(LIBTCLPATH);$(PATH)
  2225. .\testfixture.exe $(TOP)\test\all.test $(TESTOPTS)
  2226. soaktest: $(TESTPROGS)
  2227. @set PATH=$(LIBTCLPATH);$(PATH)
  2228. .\testfixture.exe $(TOP)\test\all.test -soak=1 $(TESTOPTS)
  2229. fulltestonly: $(TESTPROGS) fuzztest
  2230. @set PATH=$(LIBTCLPATH);$(PATH)
  2231. .\testfixture.exe $(TOP)\test\full.test
  2232. queryplantest: testfixture.exe shell
  2233. @set PATH=$(LIBTCLPATH);$(PATH)
  2234. .\testfixture.exe $(TOP)\test\permutations.test queryplanner $(TESTOPTS)
  2235. fuzztest: fuzzcheck.exe
  2236. .\fuzzcheck.exe $(FUZZDATA)
  2237. # Legacy testing target for third-party integrators. The SQLite
  2238. # developers seldom use this target themselves. Instead
  2239. # they use "nmake /f Makefile.msc devtest" which runs tests on
  2240. # a standard set of options
  2241. #
  2242. test: $(TESTPROGS) sourcetest fuzztest tcltest
  2243. # Minimal testing that runs in less than 3 minutes (on a fast machine)
  2244. #
  2245. quicktest: testfixture.exe sourcetest
  2246. @set PATH=$(LIBTCLPATH);$(PATH)
  2247. .\testfixture.exe $(TOP)\test\extraquick.test $(TESTOPTS)
  2248. # This is the common case. Run many tests that do not take too long,
  2249. # including fuzzcheck, sqlite3_analyzer, and sqldiff tests.
  2250. #
  2251. # The veryquick.test TCL tests.
  2252. #
  2253. tcltest: testfixture.exe
  2254. @set PATH=$(LIBTCLPATH);$(PATH)
  2255. .\testfixture.exe $(TOP)\test\veryquick.test $(TESTOPTS)
  2256. # Runs all the same tests cases as the "tcltest" target but uses
  2257. # the testrunner.tcl script to run them in multiple cores
  2258. # concurrently.
  2259. testrunner: testfixture.exe
  2260. .\testfixture.exe $(TOP)\test\testrunner.tcl
  2261. # This is the testing target preferred by the core SQLite developers.
  2262. # It runs tests under a standard configuration. The devs run
  2263. # "nmake /f Makefile.msc devtest" prior to each check-in, at a minimum.
  2264. # Probably other tests too, but at least this one.
  2265. #
  2266. devtest: srctree-check sourcetest
  2267. $(TCLSH_CMD) $(TOP)\test\testrunner.tcl mdevtest
  2268. mdevtest:
  2269. $(TCLSH_CMD) $(TOP)\test\testrunner.tcl mdevtest
  2270. # Validate that various generated files in the source tree
  2271. # are up-to-date.
  2272. #
  2273. srctree-check: $(TOP)\tool\srctree-check.tcl
  2274. $(TCLSH_CMD) $(TOP)\tool\srctree-check.tcl
  2275. # Testing for a release
  2276. #
  2277. releasetest:
  2278. $(TCLSH_CMD) $(TOP)\test\testrunner.tcl release
  2279. smoketest: $(TESTPROGS)
  2280. @set PATH=$(LIBTCLPATH);$(PATH)
  2281. .\testfixture.exe $(TOP)\test\main.test $(TESTOPTS)
  2282. shelltest: $(TESTPROGS)
  2283. .\testfixture.exe $(TOP)\test\permutations.test shell
  2284. sqlite3_analyzer.c: $(SQLITE3C) $(SQLITE3H) $(TOP)\src\tclsqlite.c $(TOP)\tool\spaceanal.tcl $(TOP)\tool\mkccode.tcl $(TOP)\tool\sqlite3_analyzer.c.in $(TOP)\ext\misc\sqlite3_stdio.h $(TOP)\ext\misc\sqlite3_stdio.c $(SQLITE_TCL_DEP)
  2285. $(TCLSH_CMD) $(TOP)\tool\mkccode.tcl $(TOP)\tool\sqlite3_analyzer.c.in > $@
  2286. sqlite3_analyzer.exe: sqlite3_analyzer.c $(LIBRESOBJS)
  2287. $(LTLINK) $(NO_WARN) -DBUILD_sqlite -I$(TCLINCDIR) sqlite3_analyzer.c \
  2288. /link $(LDFLAGS) $(LTLINKOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) $(LIBRESOBJS) $(TCLLIBS) $(LTLIBS) $(TLIBS)
  2289. sqltclsh.c: sqlite3.c $(TOP)\src\tclsqlite.c $(TOP)\tool\sqltclsh.tcl $(TOP)\ext\misc\appendvfs.c $(TOP)\tool\mkccode.tcl $(TOP)\tool\sqltclsh.c.in
  2290. $(TCLSH_CMD) $(TOP)\tool\mkccode.tcl $(TOP)\tool\sqltclsh.c.in >sqltclsh.c
  2291. sqltclsh.exe: sqltclsh.c $(SHELL_CORE_DEP) $(LIBRESOBJS)
  2292. $(LTLINK) $(NO_WARN) -DBUILD_sqlite -I$(TCLINCDIR) sqltclsh.c \
  2293. /link $(LDFLAGS) $(LTLINKOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) $(LIBRESOBJS) $(TCLLIBS) $(LTLIBS) $(TLIBS)
  2294. sqlite3_expert.exe: $(SQLITE3C) $(TOP)\ext\expert\sqlite3expert.h $(TOP)\ext\expert\sqlite3expert.c $(TOP)\ext\expert\expert.c
  2295. $(LTLINK) $(NO_WARN) $(TOP)\ext\expert\sqlite3expert.c $(TOP)\ext\expert\expert.c $(SQLITE3C) $(TLIBS)
  2296. CHECKER_DEPS =\
  2297. $(TOP)\tool\mkccode.tcl \
  2298. sqlite3.c \
  2299. $(TOP)\src\tclsqlite.c \
  2300. $(TOP)\ext\repair\sqlite3_checker.tcl \
  2301. $(TOP)\ext\repair\checkindex.c \
  2302. $(TOP)\ext\repair\checkfreelist.c \
  2303. $(TOP)\ext\misc\btreeinfo.c \
  2304. $(TOP)\ext\repair\sqlite3_checker.c.in
  2305. sqlite3_checker.c: $(CHECKER_DEPS)
  2306. $(TCLSH_CMD) $(TOP)\tool\mkccode.tcl $(TOP)\ext\repair\sqlite3_checker.c.in > $@
  2307. sqlite3_checker.exe: sqlite3_checker.c $(LIBRESOBJS)
  2308. $(LTLINK) $(NO_WARN) -DBUILD_sqlite -I$(TCLINCDIR) sqlite3_checker.c \
  2309. /link $(LDFLAGS) $(LTLINKOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) $(LIBRESOBJS) $(TCLLIBS) $(LTLIBS) $(TLIBS)
  2310. dbdump.exe: $(TOP)\ext\misc\dbdump.c $(SQLITE3C) $(SQLITE3H) $(LIBRESOBJS)
  2311. $(LTLINK) $(NO_WARN) -DDBDUMP_STANDALONE $(TOP)\ext\misc\dbdump.c $(SQLITE3C) \
  2312. /link $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS)
  2313. testloadext.lo: $(TOP)\src\test_loadext.c $(SQLITE3H)
  2314. $(LTCOMPILE) $(NO_WARN) -c $(TOP)\src\test_loadext.c
  2315. testloadext.dll: testloadext.lo
  2316. $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /OUT:$@ testloadext.lo
  2317. dbtotxt.exe: $(TOP)\tool\dbtotxt.c
  2318. $(LTLINK) $(NO_WARN) $(TOP)\tool\dbtotxt.c /link $(LDFLAGS) $(LTLINKOPTS)
  2319. showdb.exe: $(TOP)\tool\showdb.c $(SQLITE3C) $(SQLITE3H)
  2320. $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
  2321. $(TOP)\tool\showdb.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
  2322. showstat4.exe: $(TOP)\tool\showstat4.c $(SQLITE3C) $(SQLITE3H)
  2323. $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
  2324. $(TOP)\tool\showstat4.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
  2325. showjournal.exe: $(TOP)\tool\showjournal.c $(SQLITE3C) $(SQLITE3H)
  2326. $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
  2327. $(TOP)\tool\showjournal.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
  2328. showwal.exe: $(TOP)\tool\showwal.c $(SQLITE3C) $(SQLITE3H)
  2329. $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
  2330. $(TOP)\tool\showwal.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
  2331. showshm.exe: $(TOP)\tool\showshm.c
  2332. $(LTLINK) $(NO_WARN) $(TOP)\tool\showshm.c /link $(LDFLAGS) $(LTLINKOPTS)
  2333. index_usage.exe: $(TOP)\tool\index_usage.c $(SQLITE3C) $(SQLITE3H)
  2334. $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
  2335. $(TOP)\tool\index_usage.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
  2336. changeset.exe: $(TOP)\ext\session\changeset.c $(SQLITE3C) $(SQLITE3H)
  2337. $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
  2338. -DSQLITE_ENABLE_SESSION=1 -DSQLITE_ENABLE_PREUPDATE_HOOK=1 \
  2339. $(TOP)\ext\session\changeset.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
  2340. changesetfuzz.exe: $(TOP)\ext\session\changesetfuzz.c $(SQLITE3C) $(SQLITE3H)
  2341. $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
  2342. -DSQLITE_ENABLE_SESSION=1 -DSQLITE_ENABLE_PREUPDATE_HOOK=1 \
  2343. $(TOP)\ext\session\changesetfuzz.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
  2344. fts3view.exe: $(TOP)\ext\fts3\tool\fts3view.c $(SQLITE3C) $(SQLITE3H)
  2345. $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
  2346. $(TOP)\ext\fts3\tool\fts3view.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
  2347. rollback-test.exe: $(TOP)\tool\rollback-test.c $(SQLITE3C) $(SQLITE3H)
  2348. $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
  2349. $(TOP)\tool\rollback-test.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
  2350. atrc.exe: $(TOP)\test\atrc.c $(SQLITE3C) $(SQLITE3H)
  2351. $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
  2352. $(TOP)\test\atrc.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
  2353. LogEst.exe: $(TOP)\tool\logest.c $(SQLITE3H)
  2354. $(LTLINK) $(NO_WARN) $(TOP)\tool\LogEst.c /link $(LDFLAGS) $(LTLINKOPTS)
  2355. wordcount.exe: $(TOP)\test\wordcount.c $(SQLITE3C) $(SQLITE3H)
  2356. $(LTLINK) $(NO_WARN) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
  2357. $(TOP)\test\wordcount.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
  2358. speedtest1.exe: $(TOP)\test\speedtest1.c $(SQLITE3C) $(SQLITE3H)
  2359. $(LTLINK) $(NO_WARN) $(ST_COMPILE_OPTS) -DSQLITE_OMIT_LOAD_EXTENSION \
  2360. $(TOP)\test\speedtest1.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
  2361. kvtest.exe: $(TOP)\test\kvtest.c $(SQLITE3C) $(SQLITE3H)
  2362. $(LTLINK) $(NO_WARN) $(KV_COMPILE_OPTS) \
  2363. $(TOP)\test\kvtest.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
  2364. rbu.exe: $(TOP)\ext\rbu\rbu.c $(TOP)\ext\rbu\sqlite3rbu.c $(SQLITE3C) $(SQLITE3H)
  2365. $(LTLINK) $(NO_WARN) -DSQLITE_ENABLE_RBU \
  2366. $(TOP)\ext\rbu\rbu.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
  2367. THREADTEST3_SRC = \
  2368. $(TOP)\test\threadtest3.c \
  2369. $(TOP)\test\tt3_checkpoint.c \
  2370. $(TOP)\test\tt3_index.c \
  2371. $(TOP)\test\tt3_vacuum.c \
  2372. $(TOP)\test\tt3_stress.c \
  2373. $(TOP)\test\tt3_lookaside1.c
  2374. threadtest3.exe: $(THREADTEST3_SRC) $(TOP)\src\test_multiplex.c $(SQLITE3C) $(SQLITE3H)
  2375. $(LTLINK) $(NO_WARN) $(TOP)\test\threadtest3.c $(TOP)\src\test_multiplex.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
  2376. # Display key variables that control which version of TCL is to be used.
  2377. #
  2378. tcl-env:
  2379. @echo TCLDIR = $(TCLDIR)
  2380. @echo TCLVERSION = $(TCLVERSION)
  2381. @echo TCLSUFFIX = $(TCLSUFFIX)
  2382. @echo LIBTCL = $(LIBTCL)
  2383. @echo LIBTCLSTUB = $(LIBTCLSTUB)
  2384. @echo TCLSH_CMD = $(TCLSH_CMD)
  2385. LSMDIR=$(TOP)\ext\lsm1
  2386. !INCLUDE $(LSMDIR)\Makefile.msc
  2387. moreclean: clean
  2388. del /Q $(SQLITE3C) $(SQLITE3H) 2>NUL
  2389. # <</mark>>
  2390. clean:
  2391. del /Q *.exp *.lo *.ilk *.lib *.obj *.ncb *.pdb *.sdf *.suo 2>NUL
  2392. del /Q *.bsc *.def *.cod *.da *.bb *.bbg *.vc gmon.out 2>NUL
  2393. del /Q $(SQLITE3EXE) $(SQLITE3DLL) Replace.exe 2>NUL
  2394. # <<mark>>
  2395. del /Q $(SQLITE3TCLDLL) pkgIndex.tcl 2>NUL
  2396. del /Q opcodes.c opcodes.h 2>NUL
  2397. del /Q lemon.* lempar.c parse.* 2>NUL
  2398. del /Q mksourceid.* mkkeywordhash.* keywordhash.h 2>NUL
  2399. del /Q notasharedlib.* 2>NUL
  2400. -rmdir /Q/S .deps 2>NUL
  2401. -rmdir /Q/S .libs 2>NUL
  2402. -rmdir /Q/S tsrc 2>NUL
  2403. del /Q .target_source 2>NUL
  2404. del /Q tclsqlite3.exe $(SQLITETCLH) $(SQLITETCLDECLSH) 2>NUL
  2405. del /Q lsm.dll lsmtest.exe 2>NUL
  2406. del /Q atrc.exe changesetfuzz.exe dbtotxt.exe index_usage.exe 2>NUL
  2407. del /Q testloadext.dll 2>NUL
  2408. del /Q testfixture.exe test.db 2>NUL
  2409. del /Q LogEst.exe fts3view.exe rollback-test.exe showdb.exe dbdump.exe 2>NUL
  2410. del /Q changeset.exe 2>NUL
  2411. del /Q showjournal.exe showstat4.exe showwal.exe speedtest1.exe 2>NUL
  2412. del /Q mptester.exe wordcount.exe rbu.exe srcck1.exe 2>NUL
  2413. del /Q sqlite3.c sqlite3-*.c sqlite3.h 2>NUL
  2414. del /Q sqlite3rc.h 2>NUL
  2415. del /Q shell.c sqlite3ext.h sqlite3session.h 2>NUL
  2416. del /Q sqlite3_analyzer.exe sqlite3_analyzer.c sqlite3_rsync.exe 2>NUL
  2417. del /Q sqlite-*-output.vsix 2>NUL
  2418. del /Q fuzzershell.exe fuzzcheck.exe sqldiff.exe dbhash.exe 2>NUL
  2419. del /Q sqltclsh.* 2>NUL
  2420. del /Q dbfuzz.exe sessionfuzz.exe threadtest3.exe 2>NUL
  2421. del /Q kvtest.exe ossshell.exe scrub.exe 2>NUL
  2422. del /Q showshm.exe sqlite3_checker.* sqlite3_expert.exe 2>NUL
  2423. del /Q fts5.* fts5parse.* 2>NUL
  2424. del /Q lsm.h lsm1.c 2>NUL
  2425. del /q src-verify.exe 2>NUL
  2426. # <</mark>>