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