Makefile.msc 87 KB

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