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