Makefile.msc 30 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103
  1. #### DO NOT EDIT ####
  2. # This makefile is automatically generated from the Makefile.msc at
  3. # the root of the canonical SQLite source tree (not the
  4. # amalgamation tarball) using the tool/mkmsvcmin.tcl
  5. # script.
  6. #
  7. #
  8. # nmake Makefile for SQLite
  9. #
  10. ###############################################################################
  11. ############################## START OF OPTIONS ###############################
  12. ###############################################################################
  13. # The toplevel directory of the source tree. This is the directory
  14. # that contains this "Makefile.msc".
  15. #
  16. TOP = .
  17. # Optionally set EXTRA_SRC to a list of C files to append to
  18. # the generated sqlite3.c. Any sqlite3 extensions added this
  19. # way may require manual editing, as described in
  20. # https://sqlite.org/forum/forumpost/903f721f3e7c0d25
  21. #
  22. !IFNDEF EXTRA_SRC
  23. EXTRA_SRC =
  24. !ENDIF
  25. # Set this non-0 to enable full warnings (-W4, etc) when compiling.
  26. #
  27. !IFNDEF USE_FULLWARN
  28. USE_FULLWARN = 1
  29. !ENDIF
  30. # Set this non-0 to enable treating warnings as errors (-WX, etc) when
  31. # compiling.
  32. #
  33. !IFNDEF USE_FATAL_WARN
  34. USE_FATAL_WARN = 0
  35. !ENDIF
  36. # Set this non-0 to enable full runtime error checks (-RTC1, etc). This
  37. # has no effect if (any) optimizations are enabled.
  38. #
  39. !IFNDEF USE_RUNTIME_CHECKS
  40. USE_RUNTIME_CHECKS = 0
  41. !ENDIF
  42. # Set this non-0 to create a SQLite amalgamation file that excludes the
  43. # various built-in extensions.
  44. #
  45. !IFNDEF MINIMAL_AMALGAMATION
  46. MINIMAL_AMALGAMATION = 0
  47. !ENDIF
  48. # Set this non-0 to use "stdcall" calling convention for the core library
  49. # and shell executable.
  50. #
  51. !IFNDEF USE_STDCALL
  52. USE_STDCALL = 0
  53. !ENDIF
  54. # Use the USE_SEH=0 option on the nmake command line to omit structured
  55. # exception handling (SEH) support. SEH is on by default.
  56. #
  57. !IFNDEF USE_SEH
  58. USE_SEH = 1
  59. !ENDIF
  60. # Use STATICALLY_LINK_TCL=1 to statically link against TCL
  61. #
  62. !IFNDEF STATICALLY_LINK_TCL
  63. STATICALLY_LINK_TCL = 0
  64. !ELSEIF $(STATICALLY_LINK_TCL)!=0
  65. CCOPTS = $(CCOPTS) -DSTATIC_BUILD
  66. !ENDIF
  67. # Set this non-0 to have the shell executable link against the core dynamic
  68. # link library.
  69. #
  70. !IFNDEF DYNAMIC_SHELL
  71. DYNAMIC_SHELL = 0
  72. !ENDIF
  73. # Set this non-0 to enable extra code that attempts to detect misuse of the
  74. # SQLite API.
  75. #
  76. !IFNDEF API_ARMOR
  77. API_ARMOR = 0
  78. !ENDIF
  79. # If necessary, create a list of harmless compiler warnings to disable when
  80. # compiling the various tools. For the SQLite source code itself, warnings,
  81. # if any, will be disabled from within it.
  82. #
  83. !IFNDEF NO_WARN
  84. !IF $(USE_FULLWARN)!=0
  85. NO_WARN = -wd4054 -wd4055 -wd4100 -wd4127 -wd4130 -wd4152 -wd4189 -wd4206
  86. NO_WARN = $(NO_WARN) -wd4210 -wd4232 -wd4244 -wd4305 -wd4306 -wd4702 -wd4706
  87. !ENDIF
  88. !ENDIF
  89. # Set this non-0 to use the library paths and other options necessary for
  90. # Windows Phone 8.1.
  91. #
  92. !IFNDEF USE_WP81_OPTS
  93. USE_WP81_OPTS = 0
  94. !ENDIF
  95. # Set this non-0 to split the SQLite amalgamation file into chunks to
  96. # be used for debugging with Visual Studio.
  97. #
  98. !IFNDEF SPLIT_AMALGAMATION
  99. SPLIT_AMALGAMATION = 0
  100. !ENDIF
  101. # Set this non-0 to dynamically link to the MSVC runtime library.
  102. #
  103. !IFNDEF USE_CRT_DLL
  104. USE_CRT_DLL = 0
  105. !ENDIF
  106. # Set this non-0 to link to the RPCRT4 library.
  107. #
  108. !IFNDEF USE_RPCRT4_LIB
  109. USE_RPCRT4_LIB = 0
  110. !ENDIF
  111. # Set this non-0 to generate assembly code listings for the source code
  112. # files.
  113. #
  114. !IFNDEF USE_LISTINGS
  115. USE_LISTINGS = 0
  116. !ENDIF
  117. # Set this non-0 to attempt setting the native compiler automatically
  118. # for cross-compiling the command line tools needed during the compilation
  119. # process.
  120. #
  121. !IFNDEF XCOMPILE
  122. XCOMPILE = 0
  123. !ENDIF
  124. # Set this non-0 to use the native libraries paths for cross-compiling
  125. # the command line tools needed during the compilation process.
  126. #
  127. !IFNDEF USE_NATIVE_LIBPATHS
  128. USE_NATIVE_LIBPATHS = 0
  129. !ENDIF
  130. # Set this 0 to skip the compiling and embedding of version resources.
  131. #
  132. !IFNDEF USE_RC
  133. USE_RC = 1
  134. !ENDIF
  135. # Set this non-0 to compile binaries suitable for the WinRT environment.
  136. # This setting does not apply to any binaries that require Tcl to operate
  137. # properly (i.e. the text fixture, etc).
  138. #
  139. !IFNDEF FOR_WINRT
  140. FOR_WINRT = 0
  141. !ENDIF
  142. # Set this non-0 to compile binaries suitable for the UWP environment.
  143. # This setting does not apply to any binaries that require Tcl to operate
  144. # properly (i.e. the text fixture, etc).
  145. #
  146. !IFNDEF FOR_UWP
  147. FOR_UWP = 0
  148. !ENDIF
  149. # Set this non-0 to compile binaries suitable for the Windows 10 platform.
  150. #
  151. !IFNDEF FOR_WIN10
  152. FOR_WIN10 = 0
  153. !ENDIF
  154. # Set this to non-0 to create and use PDBs.
  155. #
  156. !IFNDEF SYMBOLS
  157. SYMBOLS = 1
  158. !ENDIF
  159. # Set this to non-0 to use the SQLite debugging heap subsystem.
  160. #
  161. !IFNDEF MEMDEBUG
  162. MEMDEBUG = 0
  163. !ENDIF
  164. # Set this to non-0 to use the Win32 native heap subsystem.
  165. #
  166. !IFNDEF WIN32HEAP
  167. WIN32HEAP = 0
  168. !ENDIF
  169. # Set this to non-0 to enable OSTRACE() macros, which can be useful when
  170. # debugging.
  171. #
  172. !IFNDEF OSTRACE
  173. OSTRACE = 0
  174. !ENDIF
  175. # enable address sanitizer using ASAN=1 on the command-line.
  176. #
  177. !IFNDEF ASAN
  178. ASAN = 0
  179. !ENDIF
  180. # Set this to one of the following values to enable various debugging
  181. # features. Each level includes the debugging options from the previous
  182. # levels. Currently, the recognized values for DEBUG are:
  183. #
  184. # 0 == NDEBUG: Disables assert() and other runtime diagnostics.
  185. # 1 == SQLITE_ENABLE_API_ARMOR: extra attempts to detect misuse of the API.
  186. # 2 == Disables NDEBUG and all optimizations and then enables PDBs.
  187. # 3 == SQLITE_DEBUG: Enables various diagnostics messages and code.
  188. # 4 == SQLITE_WIN32_MALLOC_VALIDATE: Validate the Win32 native heap per call.
  189. # 5 == SQLITE_DEBUG_OS_TRACE: Enables output from the OSTRACE() macros.
  190. # 6 == SQLITE_ENABLE_IOTRACE: Enables output from the IOTRACE() macros.
  191. #
  192. !IFNDEF DEBUG
  193. DEBUG = 0
  194. !ENDIF
  195. # Enable use of available compiler optimizations? Normally, this should be
  196. # non-zero. Setting this to zero, thus disabling all compiler optimizations,
  197. # can be useful for testing.
  198. #
  199. !IFNDEF OPTIMIZATIONS
  200. OPTIMIZATIONS = 2
  201. !ENDIF
  202. # Set this to non-0 to enable support for the session extension.
  203. #
  204. !IFNDEF SESSION
  205. SESSION = 0
  206. !ENDIF
  207. # Set this to non-0 to enable support for the rbu extension.
  208. #
  209. !IFNDEF RBU
  210. RBU = 0
  211. !ENDIF
  212. # Set this to non-0 to enable support for blocking locks.
  213. #
  214. !IFNDEF SETLK_TIMEOUT
  215. SETLK_TIMEOUT = 0
  216. !ENDIF
  217. # Set the source code file to be used by executables and libraries when
  218. # they need the amalgamation.
  219. #
  220. !IFNDEF SQLITE3C
  221. !IF $(SPLIT_AMALGAMATION)!=0
  222. SQLITE3C = sqlite3-all.c
  223. !ELSE
  224. SQLITE3C = sqlite3.c
  225. !ENDIF
  226. !ENDIF
  227. # Set the include code file to be used by executables and libraries when
  228. # they need SQLite.
  229. #
  230. !IFNDEF SQLITE3H
  231. SQLITE3H = sqlite3.h
  232. !ENDIF
  233. # This is the name to use for the SQLite dynamic link library (DLL).
  234. #
  235. !IFNDEF SQLITE3DLL
  236. !IF $(FOR_WIN10)!=0
  237. SQLITE3DLL = winsqlite3.dll
  238. !ELSE
  239. SQLITE3DLL = sqlite3.dll
  240. !ENDIF
  241. !ENDIF
  242. # This is the name to use for the SQLite import library (LIB).
  243. #
  244. !IFNDEF SQLITE3LIB
  245. !IF $(FOR_WIN10)!=0
  246. SQLITE3LIB = winsqlite3.lib
  247. !ELSE
  248. SQLITE3LIB = sqlite3.lib
  249. !ENDIF
  250. !ENDIF
  251. # This is the name to use for the SQLite shell executable (EXE).
  252. #
  253. !IFNDEF SQLITE3EXE
  254. !IF $(FOR_WIN10)!=0
  255. SQLITE3EXE = winsqlite3shell.exe
  256. !ELSE
  257. SQLITE3EXE = sqlite3.exe
  258. !ENDIF
  259. !ENDIF
  260. # This is the argument used to set the program database (PDB) file for the
  261. # SQLite shell executable (EXE).
  262. #
  263. !IFNDEF SQLITE3EXEPDB
  264. !IF $(FOR_WIN10)!=0
  265. SQLITE3EXEPDB =
  266. !ELSE
  267. SQLITE3EXEPDB = /pdb:sqlite3sh.pdb
  268. !ENDIF
  269. !ENDIF
  270. # These are the "standard" SQLite compilation options used when compiling for
  271. # the Windows platform.
  272. #
  273. !IFNDEF OPT_FEATURE_FLAGS
  274. OPT_FEATURE_FLAGS = $(OPT_XTRA)
  275. !IF $(MINIMAL_AMALGAMATION)==0
  276. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS3=1
  277. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS5=1
  278. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RTREE=1
  279. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_GEOPOLY=1
  280. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_STMTVTAB=1
  281. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBPAGE_VTAB=1
  282. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBSTAT_VTAB=1
  283. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_BYTECODE_VTAB=1
  284. !ENDIF
  285. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_COLUMN_METADATA=1
  286. !ENDIF
  287. # Additional feature-options above and beyond what are normally used can be
  288. # be added using OPTIONS=.... on the command-line. These values are
  289. # appended to the OPT_FEATURE_FLAGS variable.
  290. #
  291. !IFDEF OPTIONS
  292. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) $(OPTIONS)
  293. !ENDIF
  294. # Should the session extension be enabled? If so, add compilation options
  295. # to enable it.
  296. #
  297. !IF $(SESSION)!=0
  298. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_SESSION=1
  299. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_PREUPDATE_HOOK=1
  300. !ENDIF
  301. # Always enable math functions on Windows
  302. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_MATH_FUNCTIONS
  303. # Should the rbu extension be enabled? If so, add compilation options
  304. # to enable it.
  305. #
  306. !IF $(RBU)!=0
  307. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RBU=1
  308. !ENDIF
  309. # Should structured exception handling (SEH) be enabled for WAL mode in
  310. # the core library? It is on by default. Only omit it if the
  311. # USE_SEH=0 option is provided on the nmake command-line.
  312. #
  313. !IF $(USE_SEH)==0
  314. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_OMIT_SEH=1
  315. !ENDIF
  316. # These are the "extended" SQLite compilation options used when compiling for
  317. # the Windows 10 platform.
  318. #
  319. !IFNDEF EXT_FEATURE_FLAGS
  320. !IF $(FOR_WIN10)!=0
  321. EXT_FEATURE_FLAGS = $(EXT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS4=1
  322. EXT_FEATURE_FLAGS = $(EXT_FEATURE_FLAGS) -DSQLITE_SYSTEM_MALLOC=1
  323. EXT_FEATURE_FLAGS = $(EXT_FEATURE_FLAGS) -DSQLITE_OMIT_LOCALTIME=1
  324. !ELSE
  325. EXT_FEATURE_FLAGS =
  326. !ENDIF
  327. !ENDIF
  328. !IF $(SETLK_TIMEOUT)!=0
  329. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_SETLK_TIMEOUT
  330. !ENDIF
  331. ###############################################################################
  332. ############################### END OF OPTIONS ################################
  333. ###############################################################################
  334. # When compiling for the Windows 10 platform, the PLATFORM macro must be set
  335. # to an appropriate value (e.g. x86, x64, arm, arm64, etc).
  336. #
  337. !IF $(FOR_WIN10)!=0
  338. !IFNDEF PLATFORM
  339. !ERROR Using the FOR_WIN10 option requires a value for PLATFORM.
  340. !ENDIF
  341. !ENDIF
  342. # This assumes that MSVC is always installed in 32-bit Program Files directory
  343. # and sets the variable for use in locating other 32-bit installs accordingly.
  344. #
  345. PROGRAMFILES_X86 = $(VCINSTALLDIR)\..\..
  346. PROGRAMFILES_X86 = $(PROGRAMFILES_X86:\\=\)
  347. # Check for the predefined command macro CC. This should point to the compiler
  348. # binary for the target platform. If it is not defined, simply define it to
  349. # the legacy default value 'cl.exe'.
  350. #
  351. !IFNDEF CC
  352. CC = cl.exe
  353. !ENDIF
  354. # Check for the predefined command macro CSC. This should point to a working
  355. # C Sharp compiler binary. If it is not defined, simply define it to the
  356. # legacy default value 'csc.exe'.
  357. #
  358. !IFNDEF CSC
  359. CSC = csc.exe
  360. !ENDIF
  361. # Check for the command macro LD. This should point to the linker binary for
  362. # the target platform. If it is not defined, simply define it to the legacy
  363. # default value 'link.exe'.
  364. #
  365. !IFNDEF LD
  366. LD = link.exe
  367. !ENDIF
  368. # Check for the predefined command macro RC. This should point to the resource
  369. # compiler binary for the target platform. If it is not defined, simply define
  370. # it to the legacy default value 'rc.exe'.
  371. #
  372. !IFNDEF RC
  373. RC = rc.exe
  374. !ENDIF
  375. # Check for the MSVC runtime library path macro. Otherwise, this value will
  376. # default to the 'lib' directory underneath the MSVC installation directory.
  377. #
  378. !IFNDEF CRTLIBPATH
  379. CRTLIBPATH = $(VCINSTALLDIR)\lib
  380. !ENDIF
  381. CRTLIBPATH = $(CRTLIBPATH:\\=\)
  382. # Check for the command macro NCC. This should point to the compiler binary
  383. # for the platform the compilation process is taking place on. If it is not
  384. # defined, simply define it to have the same value as the CC macro. When
  385. # cross-compiling, it is suggested that this macro be modified via the command
  386. # line (since nmake itself does not provide a built-in method to guess it).
  387. # For example, to use the x86 compiler when cross-compiling for x64, a command
  388. # line similar to the following could be used (all on one line):
  389. #
  390. # nmake /f Makefile.msc sqlite3.dll
  391. # XCOMPILE=1 USE_NATIVE_LIBPATHS=1
  392. #
  393. # Alternatively, the full path and file name to the compiler binary for the
  394. # platform the compilation process is taking place may be specified (all on
  395. # one line):
  396. #
  397. # nmake /f Makefile.msc sqlite3.dll
  398. # "NCC=""%VCINSTALLDIR%\bin\cl.exe"""
  399. # USE_NATIVE_LIBPATHS=1
  400. #
  401. !IFDEF NCC
  402. NCC = $(NCC:\\=\)
  403. !ELSEIF $(XCOMPILE)!=0
  404. NCC = "$(VCINSTALLDIR)\bin\$(CC)"
  405. NCC = $(NCC:\\=\)
  406. !ELSE
  407. NCC = $(CC)
  408. !ENDIF
  409. # Check for the MSVC native runtime library path macro. Otherwise,
  410. # this value will default to the 'lib' directory underneath the MSVC
  411. # installation directory.
  412. #
  413. !IFNDEF NCRTLIBPATH
  414. NCRTLIBPATH = $(VCINSTALLDIR)\lib
  415. !ENDIF
  416. NCRTLIBPATH = $(NCRTLIBPATH:\\=\)
  417. # Check for the Platform SDK library path macro. Otherwise, this
  418. # value will default to the 'lib' directory underneath the Windows
  419. # SDK installation directory (the environment variable used appears
  420. # to be available when using Visual C++ 2008 or later via the
  421. # command line).
  422. #
  423. !IFNDEF NSDKLIBPATH
  424. NSDKLIBPATH = $(WINDOWSSDKDIR)\lib
  425. !ENDIF
  426. NSDKLIBPATH = $(NSDKLIBPATH:\\=\)
  427. # Check for the UCRT library path macro. Otherwise, this value will
  428. # default to the version-specific, platform-specific 'lib' directory
  429. # underneath the Windows SDK installation directory.
  430. #
  431. !IFNDEF UCRTLIBPATH
  432. UCRTLIBPATH = $(WINDOWSSDKDIR)\lib\$(WINDOWSSDKLIBVERSION)\ucrt\$(PLATFORM)
  433. !ENDIF
  434. UCRTLIBPATH = $(UCRTLIBPATH:\\=\)
  435. # C compiler and options for use in building executables that
  436. # will run on the platform that is doing the build.
  437. #
  438. !IF $(USE_FULLWARN)!=0
  439. BCC = $(NCC) -nologo -W4 -Fd$*.pdb $(CCOPTS) $(BCCOPTS)
  440. !ELSE
  441. BCC = $(NCC) -nologo -W3 -Fd$*.pdb $(CCOPTS) $(BCCOPTS)
  442. !ENDIF
  443. # Check if assembly code listings should be generated for the source
  444. # code files to be compiled.
  445. #
  446. !IF $(USE_LISTINGS)!=0
  447. BCC = $(BCC) -FAcs
  448. !ENDIF
  449. # Check if the native library paths should be used when compiling
  450. # the command line tools used during the compilation process. If
  451. # so, set the necessary macro now.
  452. #
  453. !IF $(USE_NATIVE_LIBPATHS)!=0
  454. NLTLIBPATHS = "/LIBPATH:$(NCRTLIBPATH)" "/LIBPATH:$(NSDKLIBPATH)"
  455. !IFDEF NUCRTLIBPATH
  456. NUCRTLIBPATH = $(NUCRTLIBPATH:\\=\)
  457. NLTLIBPATHS = $(NLTLIBPATHS) "/LIBPATH:$(NUCRTLIBPATH)"
  458. !ENDIF
  459. !ENDIF
  460. # C compiler and options for use in building executables that
  461. # will run on the target platform. (BCC and TCC are usually the
  462. # same unless your are cross-compiling.)
  463. #
  464. !IF $(USE_FULLWARN)!=0
  465. TCC = $(CC) -nologo -W4 -DINCLUDE_MSVC_H=1 $(CCOPTS) $(TCCOPTS)
  466. !ELSE
  467. TCC = $(CC) -nologo -W3 $(CCOPTS) $(TCCOPTS)
  468. !ENDIF
  469. # Check if warnings should be treated as errors when compiling.
  470. #
  471. !IF $(USE_FATAL_WARN)!=0
  472. TCC = $(TCC) -WX
  473. !ENDIF
  474. TCC = $(TCC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) -fp:precise
  475. RCC = $(RC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) $(RCOPTS) $(RCCOPTS)
  476. # Check if we want to use the "stdcall" calling convention when compiling.
  477. # This is not supported by the compilers for non-x86 platforms. It should
  478. # also be noted here that building any target with these "stdcall" options
  479. # will most likely fail if the Tcl library is also required. This is due
  480. # to how the Tcl library functions are declared and exported (i.e. without
  481. # an explicit calling convention, which results in "cdecl").
  482. #
  483. !IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
  484. !IF "$(PLATFORM)"=="x86"
  485. CORE_CCONV_OPTS = -Gz -guard:cf -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
  486. SHELL_CCONV_OPTS = -Gz -guard:cf -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
  487. !ELSE
  488. !IFNDEF PLATFORM
  489. CORE_CCONV_OPTS = -Gz -guard:cf -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
  490. SHELL_CCONV_OPTS = -Gz -guard:cf -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
  491. !ELSE
  492. CORE_CCONV_OPTS =
  493. SHELL_CCONV_OPTS =
  494. !ENDIF
  495. !ENDIF
  496. !ELSE
  497. CORE_CCONV_OPTS =
  498. SHELL_CCONV_OPTS =
  499. !ENDIF
  500. # These are additional compiler options used for the core library.
  501. #
  502. !IFNDEF CORE_COMPILE_OPTS
  503. !IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
  504. CORE_COMPILE_OPTS = $(CORE_CCONV_OPTS) -DSQLITE_API=__declspec(dllexport)
  505. !ELSE
  506. CORE_COMPILE_OPTS = $(CORE_CCONV_OPTS)
  507. !ENDIF
  508. !ENDIF
  509. # These are the additional targets that the core library should depend on
  510. # when linking.
  511. #
  512. !IFNDEF CORE_LINK_DEP
  513. !IF $(DYNAMIC_SHELL)!=0
  514. CORE_LINK_DEP =
  515. !ELSEIF $(FOR_WIN10)==0 || "$(PLATFORM)"=="x86"
  516. CORE_LINK_DEP = sqlite3.def
  517. !ELSE
  518. CORE_LINK_DEP =
  519. !ENDIF
  520. !ENDIF
  521. # These are additional linker options used for the core library.
  522. #
  523. !IFNDEF CORE_LINK_OPTS
  524. !IF $(DYNAMIC_SHELL)!=0
  525. CORE_LINK_OPTS =
  526. !ELSEIF $(FOR_WIN10)==0 || "$(PLATFORM)"=="x86"
  527. CORE_LINK_OPTS = /DEF:sqlite3.def
  528. !ELSE
  529. CORE_LINK_OPTS =
  530. !ENDIF
  531. !ENDIF
  532. # These are additional compiler options used for the shell executable.
  533. #
  534. !IFNDEF SHELL_COMPILE_OPTS
  535. !IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
  536. SHELL_COMPILE_OPTS = $(SHELL_CCONV_OPTS) -DSQLITE_API=__declspec(dllimport)
  537. !ELSE
  538. SHELL_COMPILE_OPTS = $(SHELL_CCONV_OPTS)
  539. !ENDIF
  540. !ENDIF
  541. # This is the source code that the shell executable should be compiled
  542. # with.
  543. #
  544. !IFNDEF SHELL_CORE_SRC
  545. !IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
  546. SHELL_CORE_SRC =
  547. !ELSE
  548. SHELL_CORE_SRC = $(SQLITE3C)
  549. !ENDIF
  550. !ENDIF
  551. # This is the core library that the shell executable should depend on.
  552. #
  553. !IFNDEF SHELL_CORE_DEP
  554. !IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
  555. SHELL_CORE_DEP = $(SQLITE3DLL)
  556. !ELSE
  557. SHELL_CORE_DEP =
  558. !ENDIF
  559. !ENDIF
  560. # This is the core library that the shell executable should link with.
  561. #
  562. !IFNDEF SHELL_CORE_LIB
  563. !IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
  564. SHELL_CORE_LIB = $(SQLITE3LIB)
  565. !ELSE
  566. SHELL_CORE_LIB =
  567. !ENDIF
  568. !ENDIF
  569. # These are additional linker options used for the shell executable.
  570. #
  571. !IFNDEF SHELL_LINK_OPTS
  572. SHELL_LINK_OPTS = $(SHELL_CORE_LIB)
  573. !ENDIF
  574. # Check if assembly code listings should be generated for the source
  575. # code files to be compiled.
  576. #
  577. !IF $(USE_LISTINGS)!=0
  578. TCC = $(TCC) -FAcs
  579. !ENDIF
  580. # When compiling the library for use in the WinRT environment,
  581. # the following compile-time options must be used as well to
  582. # disable use of Win32 APIs that are not available and to enable
  583. # use of Win32 APIs that are specific to Windows 8 and/or WinRT.
  584. #
  585. !IF $(FOR_WINRT)!=0
  586. TCC = $(TCC) -DSQLITE_OS_WINRT=1
  587. RCC = $(RCC) -DSQLITE_OS_WINRT=1
  588. TCC = $(TCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
  589. RCC = $(RCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
  590. !ENDIF
  591. # C compiler options for the Windows 10 platform (needs MSVC 2015).
  592. #
  593. !IF $(FOR_WIN10)!=0
  594. TCC = $(TCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
  595. BCC = $(BCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
  596. !ENDIF
  597. # Also, we need to dynamically link to the correct MSVC runtime
  598. # when compiling for WinRT (e.g. debug or release) OR if the
  599. # USE_CRT_DLL option is set to force dynamically linking to the
  600. # MSVC runtime library.
  601. #
  602. !IF $(FOR_WINRT)!=0 || $(USE_CRT_DLL)!=0
  603. !IF $(DEBUG)>1
  604. TCC = $(TCC) -MDd
  605. BCC = $(BCC) -MDd
  606. !ELSE
  607. TCC = $(TCC) -MD
  608. BCC = $(BCC) -MD
  609. !ENDIF
  610. !ELSE
  611. !IF $(DEBUG)>1
  612. TCC = $(TCC) -MTd
  613. BCC = $(BCC) -MTd
  614. !ELSE
  615. TCC = $(TCC) -MT
  616. BCC = $(BCC) -MT
  617. !ENDIF
  618. !ENDIF
  619. # Define -DNDEBUG to compile without debugging (i.e., for production usage)
  620. # Omitting the define will cause extra debugging code to be inserted and
  621. # includes extra comments when "EXPLAIN stmt" is used.
  622. #
  623. !IF $(DEBUG)==0
  624. TCC = $(TCC) -DNDEBUG
  625. BCC = $(BCC) -DNDEBUG
  626. RCC = $(RCC) -DNDEBUG
  627. !ENDIF
  628. !IF $(DEBUG)>0 || $(API_ARMOR)!=0 || $(FOR_WIN10)!=0
  629. TCC = $(TCC) -DSQLITE_ENABLE_API_ARMOR=1
  630. RCC = $(RCC) -DSQLITE_ENABLE_API_ARMOR=1
  631. !ENDIF
  632. !IF $(DEBUG)>2
  633. TCC = $(TCC) -DSQLITE_DEBUG=1
  634. RCC = $(RCC) -DSQLITE_DEBUG=1
  635. !IF $(DYNAMIC_SHELL)==0
  636. TCC = $(TCC) -DSQLITE_ENABLE_WHERETRACE -DSQLITE_ENABLE_SELECTTRACE
  637. RCC = $(RCC) -DSQLITE_ENABLE_WHERETRACE -DSQLITE_ENABLE_SELECTTRACE
  638. !ENDIF
  639. !ENDIF
  640. !IF $(DEBUG)>4 || $(OSTRACE)!=0
  641. TCC = $(TCC) -DSQLITE_FORCE_OS_TRACE=1 -DSQLITE_DEBUG_OS_TRACE=1
  642. RCC = $(RCC) -DSQLITE_FORCE_OS_TRACE=1 -DSQLITE_DEBUG_OS_TRACE=1
  643. !ENDIF
  644. !IF $(DEBUG)>5
  645. TCC = $(TCC) -DSQLITE_ENABLE_IOTRACE=1
  646. RCC = $(RCC) -DSQLITE_ENABLE_IOTRACE=1
  647. !ENDIF
  648. # Prevent warnings about "insecure" MSVC runtime library functions
  649. # being used.
  650. #
  651. TCC = $(TCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
  652. BCC = $(BCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
  653. RCC = $(RCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
  654. # Prevent warnings about "deprecated" POSIX functions being used.
  655. #
  656. TCC = $(TCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
  657. BCC = $(BCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
  658. RCC = $(RCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
  659. # Use the SQLite debugging heap subsystem?
  660. #
  661. !IF $(MEMDEBUG)!=0
  662. TCC = $(TCC) -DSQLITE_MEMDEBUG=1
  663. RCC = $(RCC) -DSQLITE_MEMDEBUG=1
  664. # Use native Win32 heap subsystem instead of malloc/free?
  665. #
  666. !ELSEIF $(WIN32HEAP)!=0
  667. TCC = $(TCC) -DSQLITE_WIN32_MALLOC=1
  668. RCC = $(RCC) -DSQLITE_WIN32_MALLOC=1
  669. # Validate the heap on every call into the native Win32 heap subsystem?
  670. #
  671. !IF $(DEBUG)>3
  672. TCC = $(TCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1
  673. RCC = $(RCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1
  674. !ENDIF
  675. !ENDIF
  676. # Address sanitizer if ASAN=1
  677. #
  678. !IF $(ASAN)>0
  679. TCC = $(TCC) /fsanitize=address
  680. !ENDIF
  681. # Compiler options needed for programs that use the readline() library.
  682. #
  683. !IFNDEF READLINE_FLAGS
  684. READLINE_FLAGS = -DHAVE_READLINE=0
  685. !ENDIF
  686. # The library that programs using readline() must link against.
  687. #
  688. !IFNDEF LIBREADLINE
  689. LIBREADLINE =
  690. !ENDIF
  691. # Should the database engine be compiled threadsafe
  692. #
  693. TCC = $(TCC) -DSQLITE_THREADSAFE=1
  694. RCC = $(RCC) -DSQLITE_THREADSAFE=1
  695. # Do threads override each others locks by default (1), or do we test (-1)
  696. #
  697. TCC = $(TCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1
  698. RCC = $(RCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1
  699. # Any target libraries which libsqlite must be linked against
  700. #
  701. !IFNDEF TLIBS
  702. TLIBS =
  703. !ENDIF
  704. # Enable/disable loadable extensions, and other optional features
  705. # based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*).
  706. # The same set of OMIT and ENABLE flags should be passed to the
  707. # LEMON parser generator and the mkkeywordhash tool as well.
  708. # These are the required SQLite compilation options used when compiling for
  709. # the Windows platform.
  710. #
  711. REQ_FEATURE_FLAGS = $(REQ_FEATURE_FLAGS) -DSQLITE_MAX_TRIGGER_DEPTH=100
  712. # If we are linking to the RPCRT4 library, enable features that need it.
  713. #
  714. !IF $(USE_RPCRT4_LIB)!=0
  715. REQ_FEATURE_FLAGS = $(REQ_FEATURE_FLAGS) -DSQLITE_WIN32_USE_UUID=1
  716. !ENDIF
  717. # Add the required and optional SQLite compilation options into the command
  718. # lines used to invoke the MSVC code and resource compilers.
  719. #
  720. TCC = $(TCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS)
  721. RCC = $(RCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS)
  722. # Add in any optional parameters specified on the commane line, e.g.
  723. # nmake /f Makefile.msc all "OPTS=-DSQLITE_ENABLE_FOO=1 -DSQLITE_OMIT_FOO=1"
  724. #
  725. TCC = $(TCC) $(OPTS)
  726. RCC = $(RCC) $(OPTS)
  727. # If compiling for debugging, add some defines.
  728. #
  729. !IF $(DEBUG)>1
  730. TCC = $(TCC) -D_DEBUG
  731. BCC = $(BCC) -D_DEBUG
  732. RCC = $(RCC) -D_DEBUG
  733. !ENDIF
  734. # If optimizations are enabled or disabled (either implicitly or
  735. # explicitly), add the necessary flags.
  736. #
  737. !IF $(DEBUG)>1 || $(OPTIMIZATIONS)==0
  738. TCC = $(TCC) -Od
  739. BCC = $(BCC) -Od
  740. !IF $(USE_RUNTIME_CHECKS)!=0
  741. TCC = $(TCC) -RTC1
  742. BCC = $(BCC) -RTC1
  743. !ENDIF
  744. !ELSEIF $(OPTIMIZATIONS)>=3
  745. TCC = $(TCC) -Ox
  746. BCC = $(BCC) -Ox
  747. !ELSEIF $(OPTIMIZATIONS)==2
  748. TCC = $(TCC) -O2
  749. BCC = $(BCC) -O2
  750. !ELSEIF $(OPTIMIZATIONS)==1
  751. TCC = $(TCC) -O1
  752. BCC = $(BCC) -O1
  753. !ENDIF
  754. # If symbols are enabled (or compiling for debugging), enable PDBs.
  755. #
  756. !IF $(DEBUG)>1 || $(SYMBOLS)!=0
  757. TCC = $(TCC) -Zi
  758. BCC = $(BCC) -Zi
  759. !ENDIF
  760. # Command line prefixes for compiling code, compiling resources,
  761. # linking, etc.
  762. #
  763. LTCOMPILE = $(TCC) -Fo$@ -Fd$*.pdb
  764. LTRCOMPILE = $(RCC) -r
  765. LTLIB = lib.exe
  766. LTLINK = $(TCC) -Fe$@
  767. # If requested, link to the RPCRT4 library.
  768. #
  769. !IF $(USE_RPCRT4_LIB)!=0
  770. LTLIBS = $(LTLIBS) rpcrt4.lib
  771. !ENDIF
  772. # If a platform was set, force the linker to target that.
  773. # Note that the vcvars*.bat family of batch files typically
  774. # set this for you. Otherwise, the linker will attempt
  775. # to deduce the binary type based on the object files.
  776. !IFDEF PLATFORM
  777. LTLINKOPTS = /NOLOGO /MACHINE:$(PLATFORM)
  778. LTLIBOPTS = /NOLOGO /MACHINE:$(PLATFORM)
  779. !ELSEIF "$(VISUALSTUDIOVERSION)"=="12.0" || \
  780. "$(VISUALSTUDIOVERSION)"=="14.0" || \
  781. "$(VISUALSTUDIOVERSION)"=="15.0"
  782. LTLINKOPTS = /NOLOGO /MACHINE:x86
  783. LTLIBOPTS = /NOLOGO /MACHINE:x86
  784. !ELSE
  785. LTLINKOPTS = /NOLOGO
  786. LTLIBOPTS = /NOLOGO
  787. !ENDIF
  788. # When compiling for use in the WinRT environment, the following
  789. # linker option must be used to mark the executable as runnable
  790. # only in the context of an application container.
  791. #
  792. !IF $(FOR_WINRT)!=0
  793. LTLINKOPTS = $(LTLINKOPTS) /APPCONTAINER
  794. !IF "$(VISUALSTUDIOVERSION)"=="12.0" || "$(VISUALSTUDIOVERSION)"=="14.0"
  795. !IFNDEF STORELIBPATH
  796. !IF "$(PLATFORM)"=="x86"
  797. STORELIBPATH = $(CRTLIBPATH)\store
  798. !ELSEIF "$(PLATFORM)"=="x64"
  799. STORELIBPATH = $(CRTLIBPATH)\store\amd64
  800. !ELSEIF "$(PLATFORM)"=="ARM"
  801. STORELIBPATH = $(CRTLIBPATH)\store\arm
  802. !ELSE
  803. STORELIBPATH = $(CRTLIBPATH)\store
  804. !ENDIF
  805. !ENDIF
  806. STORELIBPATH = $(STORELIBPATH:\\=\)
  807. LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(STORELIBPATH)"
  808. !ENDIF
  809. !ENDIF
  810. # When compiling for Windows Phone 8.1, an extra library path is
  811. # required.
  812. #
  813. !IF $(USE_WP81_OPTS)!=0
  814. !IFNDEF WP81LIBPATH
  815. !IF "$(PLATFORM)"=="x86"
  816. WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86
  817. !ELSEIF "$(PLATFORM)"=="ARM"
  818. WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\ARM
  819. !ELSE
  820. WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86
  821. !ENDIF
  822. !ENDIF
  823. !ENDIF
  824. # When compiling for Windows Phone 8.1, some extra linker options
  825. # are also required.
  826. #
  827. !IF $(USE_WP81_OPTS)!=0
  828. !IFDEF WP81LIBPATH
  829. LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(WP81LIBPATH)"
  830. !ENDIF
  831. LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE
  832. LTLINKOPTS = $(LTLINKOPTS) WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelHost.lib
  833. LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:kernel32.lib /NODEFAULTLIB:ole32.lib
  834. !ENDIF
  835. # When compiling for UWP or the Windows 10 platform, some extra linker
  836. # options are also required.
  837. #
  838. !IF $(FOR_UWP)!=0 || $(FOR_WIN10)!=0
  839. LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE /NODEFAULTLIB:kernel32.lib
  840. LTLINKOPTS = $(LTLINKOPTS) mincore.lib
  841. !IFDEF PSDKLIBPATH
  842. LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(PSDKLIBPATH)"
  843. !ENDIF
  844. !ENDIF
  845. !IF $(FOR_WIN10)!=0
  846. LTLINKOPTS = $(LTLINKOPTS) /guard:cf "/LIBPATH:$(UCRTLIBPATH)"
  847. !IF $(DEBUG)>1
  848. LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:libucrtd.lib /DEFAULTLIB:ucrtd.lib
  849. !ELSE
  850. LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib
  851. !ENDIF
  852. !ENDIF
  853. # If either debugging or symbols are enabled, enable PDBs.
  854. #
  855. !IF $(DEBUG)>1 || $(SYMBOLS)!=0
  856. LDFLAGS = /DEBUG $(LDOPTS)
  857. !ELSE
  858. LDFLAGS = $(LDOPTS)
  859. !ENDIF
  860. # You should not have to change anything below this line
  861. ###############################################################################
  862. # Object files for the amalgamation.
  863. #
  864. LIBOBJS1 = sqlite3.lo
  865. # Determine the real value of LIBOBJ based on the 'configure' script
  866. #
  867. LIBOBJ = $(LIBOBJS1)
  868. # Determine if embedded resource compilation and usage are enabled.
  869. #
  870. !IF $(USE_RC)!=0
  871. LIBRESOBJS = sqlite3res.lo
  872. !ELSE
  873. LIBRESOBJS =
  874. !ENDIF
  875. # Additional compiler options for the shell. These are only effective
  876. # when the shell is not being dynamically linked.
  877. #
  878. !IF $(DYNAMIC_SHELL)==0 && $(FOR_WIN10)==0
  879. SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_DQS=0
  880. SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_FTS4=1
  881. SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_EXPLAIN_COMMENTS=1
  882. SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_OFFSET_SQL_FUNC=1
  883. SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION=1
  884. SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_STMT_SCANSTATUS=1
  885. SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_STRICT_SUBTYPE=1
  886. !ENDIF
  887. # This is the default Makefile target. The objects listed here
  888. # are what get build when you type just "make" with no arguments.
  889. #
  890. core: dll shell
  891. # Targets that require the Tcl library.
  892. #
  893. tcl: $(ALL_TCL_TARGETS)
  894. # This Makefile target builds all of the standard binaries.
  895. #
  896. all: core tcl
  897. # Dynamic link library section.
  898. #
  899. dll: $(SQLITE3DLL)
  900. # Shell executable.
  901. #
  902. shell: $(SQLITE3EXE)
  903. # jimsh0 - replacement for tclsh
  904. #
  905. jimsh0.exe: $(TOP)\autosetup\jimsh0.c
  906. cl -DHAVE__FULLPATH=1 $(TOP)\autosetup\jimsh0.c
  907. $(SQLITE3DLL): $(LIBOBJ) $(LIBRESOBJS) $(CORE_LINK_DEP)
  908. $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL $(CORE_LINK_OPTS) /OUT:$@ $(LIBOBJ) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
  909. Replace.exe:
  910. $(CSC) /target:exe $(TOP)\Replace.cs
  911. sqlite3.def: Replace.exe $(LIBOBJ)
  912. echo EXPORTS > sqlite3.def
  913. dumpbin /all $(LIBOBJ) \
  914. | .\Replace.exe "^\s+/EXPORT:_?(sqlite3(?:session|changeset|changegroup|rebaser|rbu)?_[^@,]*)(?:@\d+|,DATA)?$$" $$1 true \
  915. | sort >> sqlite3.def
  916. $(SQLITE3EXE): shell.c $(SHELL_CORE_DEP) $(LIBRESOBJS) $(SHELL_CORE_SRC) $(SQLITE3H)
  917. $(LTLINK) $(SHELL_COMPILE_OPTS) $(READLINE_FLAGS) shell.c $(SHELL_CORE_SRC) \
  918. /link $(SQLITE3EXEPDB) $(LDFLAGS) $(LTLINKOPTS) $(SHELL_LINK_OPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS)
  919. # Rule to build the amalgamation
  920. #
  921. sqlite3.lo: $(SQLITE3C)
  922. $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(SQLITE3C)
  923. # Rule to build the Win32 resources object file.
  924. #
  925. !IF $(USE_RC)!=0
  926. _HASHCHAR=^#
  927. !IF ![echo !IFNDEF VERSION > rcver.vc] && \
  928. ![for /F "delims=" %V in ('type "$(SQLITE3H)" ^| "%SystemRoot%\System32\find.exe" "$(_HASHCHAR)define SQLITE_VERSION "') do (echo VERSION = ^^%V >> rcver.vc)] && \
  929. ![echo !ENDIF >> rcver.vc]
  930. !INCLUDE rcver.vc
  931. !ENDIF
  932. RESOURCE_VERSION = $(VERSION:^#=)
  933. RESOURCE_VERSION = $(RESOURCE_VERSION:define=)
  934. RESOURCE_VERSION = $(RESOURCE_VERSION:SQLITE_VERSION=)
  935. RESOURCE_VERSION = $(RESOURCE_VERSION:"=)
  936. RESOURCE_VERSION = $(RESOURCE_VERSION:.=,)
  937. $(LIBRESOBJS): $(TOP)\sqlite3.rc rcver.vc $(SQLITE3H)
  938. echo #ifndef SQLITE_RESOURCE_VERSION > sqlite3rc.h
  939. echo #define SQLITE_RESOURCE_VERSION $(RESOURCE_VERSION) >> sqlite3rc.h
  940. echo #endif >> sqlite3rc.h
  941. $(LTRCOMPILE) -fo $(LIBRESOBJS) -DRC_VERONLY $(TOP)\sqlite3.rc
  942. !ENDIF
  943. clean:
  944. del /Q *.exp *.lo *.ilk *.lib *.obj *.ncb *.pdb *.sdf *.suo 2>NUL
  945. del /Q *.bsc *.cod *.da *.bb *.bbg *.vc gmon.out 2>NUL
  946. del /Q sqlite3.def tclsqlite3.def ctime.c pragma.h 2>NUL
  947. del /Q $(SQLITE3EXE) $(SQLITE3DLL) Replace.exe 2>NUL