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