Makefile.msc 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101
  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 the source code file to be used by executables and libraries when
  213. # they need the amalgamation.
  214. #
  215. !IFNDEF SQLITE3C
  216. !IF $(SPLIT_AMALGAMATION)!=0
  217. SQLITE3C = sqlite3-all.c
  218. !ELSE
  219. SQLITE3C = sqlite3.c
  220. !ENDIF
  221. !ENDIF
  222. # Set the include code file to be used by executables and libraries when
  223. # they need SQLite.
  224. #
  225. !IFNDEF SQLITE3H
  226. SQLITE3H = sqlite3.h
  227. !ENDIF
  228. # This is the name to use for the SQLite dynamic link library (DLL).
  229. #
  230. !IFNDEF SQLITE3DLL
  231. !IF $(FOR_WIN10)!=0
  232. SQLITE3DLL = winsqlite3.dll
  233. !ELSE
  234. SQLITE3DLL = sqlite3.dll
  235. !ENDIF
  236. !ENDIF
  237. # This is the name to use for the SQLite import library (LIB).
  238. #
  239. !IFNDEF SQLITE3LIB
  240. !IF $(FOR_WIN10)!=0
  241. SQLITE3LIB = winsqlite3.lib
  242. !ELSE
  243. SQLITE3LIB = sqlite3.lib
  244. !ENDIF
  245. !ENDIF
  246. # This is the name to use for the SQLite shell executable (EXE).
  247. #
  248. !IFNDEF SQLITE3EXE
  249. !IF $(FOR_WIN10)!=0
  250. SQLITE3EXE = winsqlite3shell.exe
  251. !ELSE
  252. SQLITE3EXE = sqlite3.exe
  253. !ENDIF
  254. !ENDIF
  255. # This is the argument used to set the program database (PDB) file for the
  256. # SQLite shell executable (EXE).
  257. #
  258. !IFNDEF SQLITE3EXEPDB
  259. !IF $(FOR_WIN10)!=0
  260. SQLITE3EXEPDB =
  261. !ELSE
  262. SQLITE3EXEPDB = /pdb:sqlite3sh.pdb
  263. !ENDIF
  264. !ENDIF
  265. # These are the "standard" SQLite compilation options used when compiling for
  266. # the Windows platform.
  267. #
  268. !IFNDEF OPT_FEATURE_FLAGS
  269. OPT_FEATURE_FLAGS = $(OPT_XTRA)
  270. !IF $(MINIMAL_AMALGAMATION)==0
  271. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS3=1
  272. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS5=1
  273. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RTREE=1
  274. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_GEOPOLY=1
  275. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_STMTVTAB=1
  276. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBPAGE_VTAB=1
  277. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBSTAT_VTAB=1
  278. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_BYTECODE_VTAB=1
  279. !ENDIF
  280. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_COLUMN_METADATA=1
  281. !ENDIF
  282. # Additional feature-options above and beyond what are normally used can be
  283. # be added using OPTIONS=.... on the command-line. These values are
  284. # appended to the OPT_FEATURE_FLAGS variable.
  285. #
  286. !IFDEF OPTIONS
  287. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) $(OPTIONS)
  288. !ENDIF
  289. # Should the session extension be enabled? If so, add compilation options
  290. # to enable it.
  291. #
  292. !IF $(SESSION)!=0
  293. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_SESSION=1
  294. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_PREUPDATE_HOOK=1
  295. !ENDIF
  296. # Always enable math functions on Windows
  297. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_MATH_FUNCTIONS
  298. # Should the rbu extension be enabled? If so, add compilation options
  299. # to enable it.
  300. #
  301. !IF $(RBU)!=0
  302. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RBU=1
  303. !ENDIF
  304. # Should structured exception handling (SEH) be enabled for WAL mode in
  305. # the core library? It is on by default. Only omit it if the
  306. # USE_SEH=0 option is provided on the nmake command-line.
  307. #
  308. !IF $(USE_SEH)==0
  309. OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_OMIT_SEH=1
  310. !ENDIF
  311. # These are the "extended" SQLite compilation options used when compiling for
  312. # the Windows 10 platform.
  313. #
  314. !IFNDEF EXT_FEATURE_FLAGS
  315. !IF $(FOR_WIN10)!=0
  316. EXT_FEATURE_FLAGS = $(EXT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS4=1
  317. EXT_FEATURE_FLAGS = $(EXT_FEATURE_FLAGS) -DSQLITE_SYSTEM_MALLOC=1
  318. EXT_FEATURE_FLAGS = $(EXT_FEATURE_FLAGS) -DSQLITE_OMIT_LOCALTIME=1
  319. !ELSE
  320. EXT_FEATURE_FLAGS =
  321. !ENDIF
  322. !ENDIF
  323. ###############################################################################
  324. ############################### END OF OPTIONS ################################
  325. ###############################################################################
  326. # When compiling for the Windows 10 platform, the PLATFORM macro must be set
  327. # to an appropriate value (e.g. x86, x64, arm, arm64, etc).
  328. #
  329. !IF $(FOR_WIN10)!=0
  330. !IFNDEF PLATFORM
  331. !ERROR Using the FOR_WIN10 option requires a value for PLATFORM.
  332. !ENDIF
  333. !ENDIF
  334. # This assumes that MSVC is always installed in 32-bit Program Files directory
  335. # and sets the variable for use in locating other 32-bit installs accordingly.
  336. #
  337. PROGRAMFILES_X86 = $(VCINSTALLDIR)\..\..
  338. PROGRAMFILES_X86 = $(PROGRAMFILES_X86:\\=\)
  339. # Check for the predefined command macro CC. This should point to the compiler
  340. # binary for the target platform. If it is not defined, simply define it to
  341. # the legacy default value 'cl.exe'.
  342. #
  343. !IFNDEF CC
  344. CC = cl.exe
  345. !ENDIF
  346. # Check for the predefined command macro CSC. This should point to a working
  347. # C Sharp compiler binary. If it is not defined, simply define it to the
  348. # legacy default value 'csc.exe'.
  349. #
  350. !IFNDEF CSC
  351. CSC = csc.exe
  352. !ENDIF
  353. # Check for the command macro LD. This should point to the linker binary for
  354. # the target platform. If it is not defined, simply define it to the legacy
  355. # default value 'link.exe'.
  356. #
  357. !IFNDEF LD
  358. LD = link.exe
  359. !ENDIF
  360. # Check for the predefined command macro RC. This should point to the resource
  361. # compiler binary for the target platform. If it is not defined, simply define
  362. # it to the legacy default value 'rc.exe'.
  363. #
  364. !IFNDEF RC
  365. RC = rc.exe
  366. !ENDIF
  367. # Check for the MSVC runtime library path macro. Otherwise, this value will
  368. # default to the 'lib' directory underneath the MSVC installation directory.
  369. #
  370. !IFNDEF CRTLIBPATH
  371. CRTLIBPATH = $(VCINSTALLDIR)\lib
  372. !ENDIF
  373. CRTLIBPATH = $(CRTLIBPATH:\\=\)
  374. # Check for the command macro NCC. This should point to the compiler binary
  375. # for the platform the compilation process is taking place on. If it is not
  376. # defined, simply define it to have the same value as the CC macro. When
  377. # cross-compiling, it is suggested that this macro be modified via the command
  378. # line (since nmake itself does not provide a built-in method to guess it).
  379. # For example, to use the x86 compiler when cross-compiling for x64, a command
  380. # line similar to the following could be used (all on one line):
  381. #
  382. # nmake /f Makefile.msc sqlite3.dll
  383. # XCOMPILE=1 USE_NATIVE_LIBPATHS=1
  384. #
  385. # Alternatively, the full path and file name to the compiler binary for the
  386. # platform the compilation process is taking place may be specified (all on
  387. # one line):
  388. #
  389. # nmake /f Makefile.msc sqlite3.dll
  390. # "NCC=""%VCINSTALLDIR%\bin\cl.exe"""
  391. # USE_NATIVE_LIBPATHS=1
  392. #
  393. !IFDEF NCC
  394. NCC = $(NCC:\\=\)
  395. !ELSEIF $(XCOMPILE)!=0
  396. NCC = "$(VCINSTALLDIR)\bin\$(CC)"
  397. NCC = $(NCC:\\=\)
  398. !ELSE
  399. NCC = $(CC)
  400. !ENDIF
  401. # Check for the MSVC native runtime library path macro. Otherwise,
  402. # this value will default to the 'lib' directory underneath the MSVC
  403. # installation directory.
  404. #
  405. !IFNDEF NCRTLIBPATH
  406. NCRTLIBPATH = $(VCINSTALLDIR)\lib
  407. !ENDIF
  408. NCRTLIBPATH = $(NCRTLIBPATH:\\=\)
  409. # Check for the Platform SDK library path macro. Otherwise, this
  410. # value will default to the 'lib' directory underneath the Windows
  411. # SDK installation directory (the environment variable used appears
  412. # to be available when using Visual C++ 2008 or later via the
  413. # command line).
  414. #
  415. !IFNDEF NSDKLIBPATH
  416. NSDKLIBPATH = $(WINDOWSSDKDIR)\lib
  417. !ENDIF
  418. NSDKLIBPATH = $(NSDKLIBPATH:\\=\)
  419. # Check for the UCRT library path macro. Otherwise, this value will
  420. # default to the version-specific, platform-specific 'lib' directory
  421. # underneath the Windows SDK installation directory.
  422. #
  423. !IFNDEF UCRTLIBPATH
  424. UCRTLIBPATH = $(WINDOWSSDKDIR)\lib\$(WINDOWSSDKLIBVERSION)\ucrt\$(PLATFORM)
  425. !ENDIF
  426. UCRTLIBPATH = $(UCRTLIBPATH:\\=\)
  427. # C compiler and options for use in building executables that
  428. # will run on the platform that is doing the build.
  429. #
  430. !IF $(USE_FULLWARN)!=0
  431. BCC = $(NCC) -nologo -W4 -Fd$*.pdb $(CCOPTS) $(BCCOPTS)
  432. !ELSE
  433. BCC = $(NCC) -nologo -W3 -Fd$*.pdb $(CCOPTS) $(BCCOPTS)
  434. !ENDIF
  435. # Check if assembly code listings should be generated for the source
  436. # code files to be compiled.
  437. #
  438. !IF $(USE_LISTINGS)!=0
  439. BCC = $(BCC) -FAcs
  440. !ENDIF
  441. # Check if the native library paths should be used when compiling
  442. # the command line tools used during the compilation process. If
  443. # so, set the necessary macro now.
  444. #
  445. !IF $(USE_NATIVE_LIBPATHS)!=0
  446. NLTLIBPATHS = "/LIBPATH:$(NCRTLIBPATH)" "/LIBPATH:$(NSDKLIBPATH)"
  447. !IFDEF NUCRTLIBPATH
  448. NUCRTLIBPATH = $(NUCRTLIBPATH:\\=\)
  449. NLTLIBPATHS = $(NLTLIBPATHS) "/LIBPATH:$(NUCRTLIBPATH)"
  450. !ENDIF
  451. !ENDIF
  452. # C compiler and options for use in building executables that
  453. # will run on the target platform. (BCC and TCC are usually the
  454. # same unless your are cross-compiling.)
  455. #
  456. !IF $(USE_FULLWARN)!=0
  457. TCC = $(CC) -nologo -W4 -DINCLUDE_MSVC_H=1 $(CCOPTS) $(TCCOPTS)
  458. !ELSE
  459. TCC = $(CC) -nologo -W3 $(CCOPTS) $(TCCOPTS)
  460. !ENDIF
  461. # Check if warnings should be treated as errors when compiling.
  462. #
  463. !IF $(USE_FATAL_WARN)!=0
  464. TCC = $(TCC) -WX
  465. !ENDIF
  466. TCC = $(TCC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) -fp:precise
  467. RCC = $(RC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) $(RCOPTS) $(RCCOPTS)
  468. # Check if we want to use the "stdcall" calling convention when compiling.
  469. # This is not supported by the compilers for non-x86 platforms. It should
  470. # also be noted here that building any target with these "stdcall" options
  471. # will most likely fail if the Tcl library is also required. This is due
  472. # to how the Tcl library functions are declared and exported (i.e. without
  473. # an explicit calling convention, which results in "cdecl").
  474. #
  475. !IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
  476. !IF "$(PLATFORM)"=="x86"
  477. CORE_CCONV_OPTS = -Gz -guard:cf -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
  478. SHELL_CCONV_OPTS = -Gz -guard:cf -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
  479. !ELSE
  480. !IFNDEF PLATFORM
  481. CORE_CCONV_OPTS = -Gz -guard:cf -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
  482. SHELL_CCONV_OPTS = -Gz -guard:cf -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
  483. !ELSE
  484. CORE_CCONV_OPTS =
  485. SHELL_CCONV_OPTS =
  486. !ENDIF
  487. !ENDIF
  488. !ELSE
  489. CORE_CCONV_OPTS =
  490. SHELL_CCONV_OPTS =
  491. !ENDIF
  492. # These are additional compiler options used for the core library.
  493. #
  494. !IFNDEF CORE_COMPILE_OPTS
  495. !IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
  496. CORE_COMPILE_OPTS = $(CORE_CCONV_OPTS) -DSQLITE_API=__declspec(dllexport)
  497. !ELSE
  498. CORE_COMPILE_OPTS = $(CORE_CCONV_OPTS)
  499. !ENDIF
  500. !ENDIF
  501. # These are the additional targets that the core library should depend on
  502. # when linking.
  503. #
  504. !IFNDEF CORE_LINK_DEP
  505. !IF $(DYNAMIC_SHELL)!=0
  506. CORE_LINK_DEP =
  507. !ELSEIF $(FOR_WIN10)==0 || "$(PLATFORM)"=="x86"
  508. CORE_LINK_DEP = sqlite3.def
  509. !ELSE
  510. CORE_LINK_DEP =
  511. !ENDIF
  512. !ENDIF
  513. # These are additional linker options used for the core library.
  514. #
  515. !IFNDEF CORE_LINK_OPTS
  516. !IF $(DYNAMIC_SHELL)!=0
  517. CORE_LINK_OPTS =
  518. !ELSEIF $(FOR_WIN10)==0 || "$(PLATFORM)"=="x86"
  519. CORE_LINK_OPTS = /DEF:sqlite3.def
  520. !ELSE
  521. CORE_LINK_OPTS =
  522. !ENDIF
  523. !ENDIF
  524. # These are additional compiler options used for the shell executable.
  525. #
  526. !IFNDEF SHELL_COMPILE_OPTS
  527. !IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
  528. SHELL_COMPILE_OPTS = $(SHELL_CCONV_OPTS) -DSQLITE_API=__declspec(dllimport)
  529. !ELSE
  530. SHELL_COMPILE_OPTS = $(SHELL_CCONV_OPTS)
  531. !ENDIF
  532. !ENDIF
  533. # This is the source code that the shell executable should be compiled
  534. # with.
  535. #
  536. !IFNDEF SHELL_CORE_SRC
  537. !IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
  538. SHELL_CORE_SRC =
  539. !ELSE
  540. SHELL_CORE_SRC = $(SQLITE3C)
  541. !ENDIF
  542. !ENDIF
  543. # This is the core library that the shell executable should depend on.
  544. #
  545. !IFNDEF SHELL_CORE_DEP
  546. !IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
  547. SHELL_CORE_DEP = $(SQLITE3DLL)
  548. !ELSE
  549. SHELL_CORE_DEP =
  550. !ENDIF
  551. !ENDIF
  552. # This is the core library that the shell executable should link with.
  553. #
  554. !IFNDEF SHELL_CORE_LIB
  555. !IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
  556. SHELL_CORE_LIB = $(SQLITE3LIB)
  557. !ELSE
  558. SHELL_CORE_LIB =
  559. !ENDIF
  560. !ENDIF
  561. # These are additional linker options used for the shell executable.
  562. #
  563. !IFNDEF SHELL_LINK_OPTS
  564. SHELL_LINK_OPTS = $(SHELL_CORE_LIB)
  565. !ENDIF
  566. # Check if assembly code listings should be generated for the source
  567. # code files to be compiled.
  568. #
  569. !IF $(USE_LISTINGS)!=0
  570. TCC = $(TCC) -FAcs
  571. !ENDIF
  572. # When compiling the library for use in the WinRT environment,
  573. # the following compile-time options must be used as well to
  574. # disable use of Win32 APIs that are not available and to enable
  575. # use of Win32 APIs that are specific to Windows 8 and/or WinRT.
  576. #
  577. !IF $(FOR_WINRT)!=0
  578. TCC = $(TCC) -DSQLITE_OS_WINRT=1
  579. RCC = $(RCC) -DSQLITE_OS_WINRT=1
  580. TCC = $(TCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
  581. RCC = $(RCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
  582. !ENDIF
  583. # C compiler options for the Windows 10 platform (needs MSVC 2015).
  584. #
  585. !IF $(FOR_WIN10)!=0
  586. TCC = $(TCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
  587. BCC = $(BCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
  588. !ENDIF
  589. # Also, we need to dynamically link to the correct MSVC runtime
  590. # when compiling for WinRT (e.g. debug or release) OR if the
  591. # USE_CRT_DLL option is set to force dynamically linking to the
  592. # MSVC runtime library.
  593. #
  594. !IF $(FOR_WINRT)!=0 || $(USE_CRT_DLL)!=0
  595. !IF $(DEBUG)>1
  596. TCC = $(TCC) -MDd
  597. BCC = $(BCC) -MDd
  598. !ELSE
  599. TCC = $(TCC) -MD
  600. BCC = $(BCC) -MD
  601. !ENDIF
  602. !ELSE
  603. !IF $(DEBUG)>1
  604. TCC = $(TCC) -MTd
  605. BCC = $(BCC) -MTd
  606. !ELSE
  607. TCC = $(TCC) -MT
  608. BCC = $(BCC) -MT
  609. !ENDIF
  610. !ENDIF
  611. # Define -DNDEBUG to compile without debugging (i.e., for production usage)
  612. # Omitting the define will cause extra debugging code to be inserted and
  613. # includes extra comments when "EXPLAIN stmt" is used.
  614. #
  615. !IF $(DEBUG)==0
  616. TCC = $(TCC) -DNDEBUG
  617. BCC = $(BCC) -DNDEBUG
  618. RCC = $(RCC) -DNDEBUG
  619. !ENDIF
  620. !IF $(DEBUG)>0 || $(API_ARMOR)!=0 || $(FOR_WIN10)!=0
  621. TCC = $(TCC) -DSQLITE_ENABLE_API_ARMOR=1
  622. RCC = $(RCC) -DSQLITE_ENABLE_API_ARMOR=1
  623. !ENDIF
  624. !IF $(DEBUG)>2
  625. TCC = $(TCC) -DSQLITE_DEBUG=1
  626. RCC = $(RCC) -DSQLITE_DEBUG=1
  627. !IF $(DYNAMIC_SHELL)==0
  628. TCC = $(TCC) -DSQLITE_ENABLE_WHERETRACE -DSQLITE_ENABLE_SELECTTRACE
  629. RCC = $(RCC) -DSQLITE_ENABLE_WHERETRACE -DSQLITE_ENABLE_SELECTTRACE
  630. !ENDIF
  631. !ENDIF
  632. !IF $(DEBUG)>4 || $(OSTRACE)!=0
  633. TCC = $(TCC) -DSQLITE_FORCE_OS_TRACE=1 -DSQLITE_DEBUG_OS_TRACE=1
  634. RCC = $(RCC) -DSQLITE_FORCE_OS_TRACE=1 -DSQLITE_DEBUG_OS_TRACE=1
  635. !ENDIF
  636. !IF $(DEBUG)>5
  637. TCC = $(TCC) -DSQLITE_ENABLE_IOTRACE=1
  638. RCC = $(RCC) -DSQLITE_ENABLE_IOTRACE=1
  639. !ENDIF
  640. # Prevent warnings about "insecure" MSVC runtime library functions
  641. # being used.
  642. #
  643. TCC = $(TCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
  644. BCC = $(BCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
  645. RCC = $(RCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
  646. # Prevent warnings about "deprecated" POSIX functions being used.
  647. #
  648. TCC = $(TCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
  649. BCC = $(BCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
  650. RCC = $(RCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
  651. # Use the SQLite debugging heap subsystem?
  652. #
  653. !IF $(MEMDEBUG)!=0
  654. TCC = $(TCC) -DSQLITE_MEMDEBUG=1
  655. RCC = $(RCC) -DSQLITE_MEMDEBUG=1
  656. # Use native Win32 heap subsystem instead of malloc/free?
  657. #
  658. !ELSEIF $(WIN32HEAP)!=0
  659. TCC = $(TCC) -DSQLITE_WIN32_MALLOC=1
  660. RCC = $(RCC) -DSQLITE_WIN32_MALLOC=1
  661. # Validate the heap on every call into the native Win32 heap subsystem?
  662. #
  663. !IF $(DEBUG)>3
  664. TCC = $(TCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1
  665. RCC = $(RCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1
  666. !ENDIF
  667. !ENDIF
  668. # Address sanitizer if ASAN=1
  669. #
  670. !IF $(ASAN)>0
  671. TCC = $(TCC) /fsanitize=address
  672. !ENDIF
  673. # Compiler options needed for programs that use the readline() library.
  674. #
  675. !IFNDEF READLINE_FLAGS
  676. READLINE_FLAGS = -DHAVE_READLINE=0
  677. !ENDIF
  678. # The library that programs using readline() must link against.
  679. #
  680. !IFNDEF LIBREADLINE
  681. LIBREADLINE =
  682. !ENDIF
  683. # Should the database engine be compiled threadsafe
  684. #
  685. TCC = $(TCC) -DSQLITE_THREADSAFE=1
  686. RCC = $(RCC) -DSQLITE_THREADSAFE=1
  687. # Do threads override each others locks by default (1), or do we test (-1)
  688. #
  689. TCC = $(TCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1
  690. RCC = $(RCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1
  691. # Any target libraries which libsqlite must be linked against
  692. #
  693. !IFNDEF TLIBS
  694. TLIBS =
  695. !ENDIF
  696. # Flags controlling use of the in memory btree implementation
  697. #
  698. # SQLITE_TEMP_STORE is 0 to force temporary tables to be in a file, 1 to
  699. # default to file, 2 to default to memory, and 3 to force temporary
  700. # tables to always be in memory.
  701. #
  702. TCC = $(TCC) -DSQLITE_TEMP_STORE=1
  703. RCC = $(RCC) -DSQLITE_TEMP_STORE=1
  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 *.def *.cod *.da *.bb *.bbg *.vc gmon.out 2>NUL
  946. del /Q $(SQLITE3EXE) $(SQLITE3DLL) Replace.exe 2>NUL