2 # This makefile is automatically generated from the Makefile.msc at
3 # the root of the canonical SQLite source tree (not the
4 # amalgamation tarball) using the tool/mkmsvcmin.tcl
9 # nmake Makefile for SQLite
11 ###############################################################################
12 ############################## START OF OPTIONS ###############################
13 ###############################################################################
15 # The toplevel directory of the source tree. This is the directory
16 # that contains this "Makefile.msc".
21 # Set this non-0 to enable full warnings (-W4, etc) when compiling.
27 # Set this non-0 to enable full runtime error checks (-RTC1, etc). This
28 # has no effect if (any) optimizations are enabled.
30 !IFNDEF USE_RUNTIME_CHECKS
31 USE_RUNTIME_CHECKS = 0
34 # Set this non-0 to use "stdcall" calling convention for the core library
35 # and shell executable.
41 # Set this non-0 to have the shell executable link against the core dynamic
48 # Set this non-0 to enable extra code that attempts to detect misuse of the
55 # If necessary, create a list of harmless compiler warnings to disable when
56 # compiling the various tools. For the SQLite source code itself, warnings,
57 # if any, will be disabled from within it.
60 !IF $(USE_FULLWARN)!=0
61 NO_WARN = -wd4054 -wd4055 -wd4100 -wd4127 -wd4130 -wd4152 -wd4189 -wd4206
62 NO_WARN = $(NO_WARN) -wd4210 -wd4232 -wd4305 -wd4306 -wd4702 -wd4706
66 # Set this non-0 to use the library paths and other options necessary for
73 # Set this non-0 to split the SQLite amalgamation file into chunks to
74 # be used for debugging with Visual Studio.
76 !IFNDEF SPLIT_AMALGAMATION
77 SPLIT_AMALGAMATION = 0
81 # Set this non-0 to dynamically link to the MSVC runtime library.
87 # Set this non-0 to link to the RPCRT4 library.
89 !IFNDEF USE_RPCRT4_LIB
93 # Set this non-0 to generate assembly code listings for the source code
100 # Set this non-0 to attempt setting the native compiler automatically
101 # for cross-compiling the command line tools needed during the compilation
108 # Set this non-0 to use the native libraries paths for cross-compiling
109 # the command line tools needed during the compilation process.
111 !IFNDEF USE_NATIVE_LIBPATHS
112 USE_NATIVE_LIBPATHS = 0
115 # Set this 0 to skip the compiling and embedding of version resources.
121 # Set this non-0 to compile binaries suitable for the WinRT environment.
122 # This setting does not apply to any binaries that require Tcl to operate
123 # properly (i.e. the text fixture, etc).
129 # Set this non-0 to compile binaries suitable for the UWP environment.
130 # This setting does not apply to any binaries that require Tcl to operate
131 # properly (i.e. the text fixture, etc).
137 # Set this non-0 to compile binaries suitable for the Windows 10 platform.
144 # Set this to non-0 to create and use PDBs.
150 # Set this to non-0 to use the SQLite debugging heap subsystem.
156 # Set this to non-0 to use the Win32 native heap subsystem.
162 # Set this to non-0 to enable OSTRACE() macros, which can be useful when
169 # Set this to one of the following values to enable various debugging
170 # features. Each level includes the debugging options from the previous
171 # levels. Currently, the recognized values for DEBUG are:
173 # 0 == NDEBUG: Disables assert() and other runtime diagnostics.
174 # 1 == SQLITE_ENABLE_API_ARMOR: extra attempts to detect misuse of the API.
175 # 2 == Disables NDEBUG and all optimizations and then enables PDBs.
176 # 3 == SQLITE_DEBUG: Enables various diagnostics messages and code.
177 # 4 == SQLITE_WIN32_MALLOC_VALIDATE: Validate the Win32 native heap per call.
178 # 5 == SQLITE_DEBUG_OS_TRACE: Enables output from the OSTRACE() macros.
179 # 6 == SQLITE_ENABLE_IOTRACE: Enables output from the IOTRACE() macros.
185 # Enable use of available compiler optimizations? Normally, this should be
186 # non-zero. Setting this to zero, thus disabling all compiler optimizations,
187 # can be useful for testing.
189 !IFNDEF OPTIMIZATIONS
193 # Set this to non-0 to enable support for the session extension.
199 # Set the source code file to be used by executables and libraries when
200 # they need the amalgamation.
203 !IF $(SPLIT_AMALGAMATION)!=0
204 SQLITE3C = sqlite3-all.c
210 # Set the include code file to be used by executables and libraries when
217 # This is the name to use for the SQLite dynamic link library (DLL).
221 SQLITE3DLL = winsqlite3.dll
223 SQLITE3DLL = sqlite3.dll
227 # This is the name to use for the SQLite import library (LIB).
231 SQLITE3LIB = winsqlite3.lib
233 SQLITE3LIB = sqlite3.lib
237 # This is the name to use for the SQLite shell executable (EXE).
241 SQLITE3EXE = winsqlite3shell.exe
243 SQLITE3EXE = sqlite3.exe
247 # This is the argument used to set the program database (PDB) file for the
248 # SQLite shell executable (EXE).
250 !IFNDEF SQLITE3EXEPDB
254 SQLITE3EXEPDB = /pdb:sqlite3sh.pdb
258 # These are the "standard" SQLite compilation options used when compiling for
259 # the Windows platform.
261 !IFNDEF OPT_FEATURE_FLAGS
262 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS3=1
263 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RTREE=1
264 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_COLUMN_METADATA=1
267 # Should the session extension be enabled? If so, add compilation options
271 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_SESSION=1
272 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_PREUPDATE_HOOK=1
275 # These are the "extended" SQLite compilation options used when compiling for
276 # the Windows 10 platform.
278 !IFNDEF EXT_FEATURE_FLAGS
280 EXT_FEATURE_FLAGS = $(EXT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS4=1
281 EXT_FEATURE_FLAGS = $(EXT_FEATURE_FLAGS) -DSQLITE_SYSTEM_MALLOC=1
282 EXT_FEATURE_FLAGS = $(EXT_FEATURE_FLAGS) -DSQLITE_OMIT_LOCALTIME=1
288 ###############################################################################
289 ############################### END OF OPTIONS ################################
290 ###############################################################################
292 # When compiling for the Windows 10 platform, the PLATFORM macro must be set
293 # to an appropriate value (e.g. x86, x64, arm, arm64, etc).
297 !ERROR Using the FOR_WIN10 option requires a value for PLATFORM.
301 # This assumes that MSVC is always installed in 32-bit Program Files directory
302 # and sets the variable for use in locating other 32-bit installs accordingly.
304 PROGRAMFILES_X86 = $(VCINSTALLDIR)\..\..
305 PROGRAMFILES_X86 = $(PROGRAMFILES_X86:\\=\)
307 # Check for the predefined command macro CC. This should point to the compiler
308 # binary for the target platform. If it is not defined, simply define it to
309 # the legacy default value 'cl.exe'.
315 # Check for the predefined command macro CSC. This should point to a working
316 # C Sharp compiler binary. If it is not defined, simply define it to the
317 # legacy default value 'csc.exe'.
323 # Check for the command macro LD. This should point to the linker binary for
324 # the target platform. If it is not defined, simply define it to the legacy
325 # default value 'link.exe'.
331 # Check for the predefined command macro RC. This should point to the resource
332 # compiler binary for the target platform. If it is not defined, simply define
333 # it to the legacy default value 'rc.exe'.
339 # Check for the MSVC runtime library path macro. Otherwise, this value will
340 # default to the 'lib' directory underneath the MSVC installation directory.
343 CRTLIBPATH = $(VCINSTALLDIR)\lib
346 CRTLIBPATH = $(CRTLIBPATH:\\=\)
348 # Check for the command macro NCC. This should point to the compiler binary
349 # for the platform the compilation process is taking place on. If it is not
350 # defined, simply define it to have the same value as the CC macro. When
351 # cross-compiling, it is suggested that this macro be modified via the command
352 # line (since nmake itself does not provide a built-in method to guess it).
353 # For example, to use the x86 compiler when cross-compiling for x64, a command
354 # line similar to the following could be used (all on one line):
356 # nmake /f Makefile.msc sqlite3.dll
357 # XCOMPILE=1 USE_NATIVE_LIBPATHS=1
359 # Alternatively, the full path and file name to the compiler binary for the
360 # platform the compilation process is taking place may be specified (all on
363 # nmake /f Makefile.msc sqlite3.dll
364 # "NCC=""%VCINSTALLDIR%\bin\cl.exe"""
365 # USE_NATIVE_LIBPATHS=1
369 !ELSEIF $(XCOMPILE)!=0
370 NCC = "$(VCINSTALLDIR)\bin\$(CC)"
376 # Check for the MSVC native runtime library path macro. Otherwise,
377 # this value will default to the 'lib' directory underneath the MSVC
378 # installation directory.
381 NCRTLIBPATH = $(VCINSTALLDIR)\lib
384 NCRTLIBPATH = $(NCRTLIBPATH:\\=\)
386 # Check for the Platform SDK library path macro. Otherwise, this
387 # value will default to the 'lib' directory underneath the Windows
388 # SDK installation directory (the environment variable used appears
389 # to be available when using Visual C++ 2008 or later via the
393 NSDKLIBPATH = $(WINDOWSSDKDIR)\lib
396 NSDKLIBPATH = $(NSDKLIBPATH:\\=\)
398 # Check for the UCRT library path macro. Otherwise, this value will
399 # default to the version-specific, platform-specific 'lib' directory
400 # underneath the Windows SDK installation directory.
403 UCRTLIBPATH = $(WINDOWSSDKDIR)\lib\$(WINDOWSSDKLIBVERSION)\ucrt\$(PLATFORM)
406 UCRTLIBPATH = $(UCRTLIBPATH:\\=\)
408 # C compiler and options for use in building executables that
409 # will run on the platform that is doing the build.
411 !IF $(USE_FULLWARN)!=0
412 BCC = $(NCC) -nologo -W4 $(CCOPTS) $(BCCOPTS)
414 BCC = $(NCC) -nologo -W3 $(CCOPTS) $(BCCOPTS)
417 # Check if assembly code listings should be generated for the source
418 # code files to be compiled.
420 !IF $(USE_LISTINGS)!=0
424 # Check if the native library paths should be used when compiling
425 # the command line tools used during the compilation process. If
426 # so, set the necessary macro now.
428 !IF $(USE_NATIVE_LIBPATHS)!=0
429 NLTLIBPATHS = "/LIBPATH:$(NCRTLIBPATH)" "/LIBPATH:$(NSDKLIBPATH)"
432 NUCRTLIBPATH = $(NUCRTLIBPATH:\\=\)
433 NLTLIBPATHS = $(NLTLIBPATHS) "/LIBPATH:$(NUCRTLIBPATH)"
437 # C compiler and options for use in building executables that
438 # will run on the target platform. (BCC and TCC are usually the
439 # same unless your are cross-compiling.)
441 !IF $(USE_FULLWARN)!=0
442 TCC = $(CC) -nologo -W4 -DINCLUDE_MSVC_H=1 $(CCOPTS) $(TCCOPTS)
444 TCC = $(CC) -nologo -W3 $(CCOPTS) $(TCCOPTS)
447 TCC = $(TCC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) -fp:precise
448 RCC = $(RC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) $(RCOPTS) $(RCCOPTS)
450 # Check if we want to use the "stdcall" calling convention when compiling.
451 # This is not supported by the compilers for non-x86 platforms. It should
452 # also be noted here that building any target with these "stdcall" options
453 # will most likely fail if the Tcl library is also required. This is due
454 # to how the Tcl library functions are declared and exported (i.e. without
455 # an explicit calling convention, which results in "cdecl").
457 !IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
458 !IF "$(PLATFORM)"=="x86"
459 CORE_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
460 SHELL_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
463 CORE_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
464 SHELL_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
475 # These are additional compiler options used for the core library.
477 !IFNDEF CORE_COMPILE_OPTS
478 !IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
479 CORE_COMPILE_OPTS = $(CORE_CCONV_OPTS) -DSQLITE_API=__declspec(dllexport)
481 CORE_COMPILE_OPTS = $(CORE_CCONV_OPTS)
485 # These are the additional targets that the core library should depend on
488 !IFNDEF CORE_LINK_DEP
489 !IF $(DYNAMIC_SHELL)!=0
491 !ELSEIF $(FOR_WIN10)==0 || "$(PLATFORM)"=="x86"
492 CORE_LINK_DEP = sqlite3.def
498 # These are additional linker options used for the core library.
500 !IFNDEF CORE_LINK_OPTS
501 !IF $(DYNAMIC_SHELL)!=0
503 !ELSEIF $(FOR_WIN10)==0 || "$(PLATFORM)"=="x86"
504 CORE_LINK_OPTS = /DEF:sqlite3.def
510 # These are additional compiler options used for the shell executable.
512 !IFNDEF SHELL_COMPILE_OPTS
513 !IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
514 SHELL_COMPILE_OPTS = $(SHELL_CCONV_OPTS) -DSQLITE_API=__declspec(dllimport)
516 SHELL_COMPILE_OPTS = $(SHELL_CCONV_OPTS)
520 # This is the source code that the shell executable should be compiled
523 !IFNDEF SHELL_CORE_SRC
524 !IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
527 SHELL_CORE_SRC = $(SQLITE3C)
531 # This is the core library that the shell executable should depend on.
533 !IFNDEF SHELL_CORE_DEP
534 !IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
535 SHELL_CORE_DEP = $(SQLITE3DLL)
541 # This is the core library that the shell executable should link with.
543 !IFNDEF SHELL_CORE_LIB
544 !IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
545 SHELL_CORE_LIB = $(SQLITE3LIB)
551 # These are additional linker options used for the shell executable.
553 !IFNDEF SHELL_LINK_OPTS
554 SHELL_LINK_OPTS = $(SHELL_CORE_LIB)
557 # Check if assembly code listings should be generated for the source
558 # code files to be compiled.
560 !IF $(USE_LISTINGS)!=0
564 # When compiling the library for use in the WinRT environment,
565 # the following compile-time options must be used as well to
566 # disable use of Win32 APIs that are not available and to enable
567 # use of Win32 APIs that are specific to Windows 8 and/or WinRT.
570 TCC = $(TCC) -DSQLITE_OS_WINRT=1
571 RCC = $(RCC) -DSQLITE_OS_WINRT=1
572 TCC = $(TCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
573 RCC = $(RCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
576 # C compiler options for the Windows 10 platform (needs MSVC 2015).
579 TCC = $(TCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
580 BCC = $(BCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
583 # Also, we need to dynamically link to the correct MSVC runtime
584 # when compiling for WinRT (e.g. debug or release) OR if the
585 # USE_CRT_DLL option is set to force dynamically linking to the
586 # MSVC runtime library.
588 !IF $(FOR_WINRT)!=0 || $(USE_CRT_DLL)!=0
607 # Define -DNDEBUG to compile without debugging (i.e., for production usage)
608 # Omitting the define will cause extra debugging code to be inserted and
609 # includes extra comments when "EXPLAIN stmt" is used.
612 TCC = $(TCC) -DNDEBUG
613 BCC = $(BCC) -DNDEBUG
614 RCC = $(RCC) -DNDEBUG
617 !IF $(DEBUG)>0 || $(API_ARMOR)!=0 || $(FOR_WIN10)!=0
618 TCC = $(TCC) -DSQLITE_ENABLE_API_ARMOR=1
619 RCC = $(RCC) -DSQLITE_ENABLE_API_ARMOR=1
623 TCC = $(TCC) -DSQLITE_DEBUG=1
624 RCC = $(RCC) -DSQLITE_DEBUG=1
627 !IF $(DEBUG)>4 || $(OSTRACE)!=0
628 TCC = $(TCC) -DSQLITE_FORCE_OS_TRACE=1 -DSQLITE_DEBUG_OS_TRACE=1
629 RCC = $(RCC) -DSQLITE_FORCE_OS_TRACE=1 -DSQLITE_DEBUG_OS_TRACE=1
633 TCC = $(TCC) -DSQLITE_ENABLE_IOTRACE=1
634 RCC = $(RCC) -DSQLITE_ENABLE_IOTRACE=1
637 # Prevent warnings about "insecure" MSVC runtime library functions
640 TCC = $(TCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
641 BCC = $(BCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
642 RCC = $(RCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
644 # Prevent warnings about "deprecated" POSIX functions being used.
646 TCC = $(TCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
647 BCC = $(BCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
648 RCC = $(RCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
650 # Use the SQLite debugging heap subsystem?
653 TCC = $(TCC) -DSQLITE_MEMDEBUG=1
654 RCC = $(RCC) -DSQLITE_MEMDEBUG=1
656 # Use native Win32 heap subsystem instead of malloc/free?
658 !ELSEIF $(WIN32HEAP)!=0
659 TCC = $(TCC) -DSQLITE_WIN32_MALLOC=1
660 RCC = $(RCC) -DSQLITE_WIN32_MALLOC=1
662 # Validate the heap on every call into the native Win32 heap subsystem?
665 TCC = $(TCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1
666 RCC = $(RCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1
671 # Compiler options needed for programs that use the readline() library.
673 !IFNDEF READLINE_FLAGS
674 READLINE_FLAGS = -DHAVE_READLINE=0
677 # The library that programs using readline() must link against.
683 # Should the database engine be compiled threadsafe
685 TCC = $(TCC) -DSQLITE_THREADSAFE=1
686 RCC = $(RCC) -DSQLITE_THREADSAFE=1
688 # Do threads override each others locks by default (1), or do we test (-1)
690 TCC = $(TCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1
691 RCC = $(RCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1
693 # Any target libraries which libsqlite must be linked against
699 # Flags controlling use of the in memory btree implementation
701 # SQLITE_TEMP_STORE is 0 to force temporary tables to be in a file, 1 to
702 # default to file, 2 to default to memory, and 3 to force temporary
703 # tables to always be in memory.
705 TCC = $(TCC) -DSQLITE_TEMP_STORE=1
706 RCC = $(RCC) -DSQLITE_TEMP_STORE=1
708 # Enable/disable loadable extensions, and other optional features
709 # based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*).
710 # The same set of OMIT and ENABLE flags should be passed to the
711 # LEMON parser generator and the mkkeywordhash tool as well.
713 # These are the required SQLite compilation options used when compiling for
714 # the Windows platform.
716 REQ_FEATURE_FLAGS = $(REQ_FEATURE_FLAGS) -DSQLITE_MAX_TRIGGER_DEPTH=100
718 # If we are linking to the RPCRT4 library, enable features that need it.
720 !IF $(USE_RPCRT4_LIB)!=0
721 REQ_FEATURE_FLAGS = $(REQ_FEATURE_FLAGS) -DSQLITE_WIN32_USE_UUID=1
724 # Add the required and optional SQLite compilation options into the command
725 # lines used to invoke the MSVC code and resource compilers.
727 TCC = $(TCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS)
728 RCC = $(RCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS)
730 # Add in any optional parameters specified on the commane line, e.g.
731 # nmake /f Makefile.msc all "OPTS=-DSQLITE_ENABLE_FOO=1 -DSQLITE_OMIT_FOO=1"
736 # If compiling for debugging, add some defines.
739 TCC = $(TCC) -D_DEBUG
740 BCC = $(BCC) -D_DEBUG
741 RCC = $(RCC) -D_DEBUG
744 # If optimizations are enabled or disabled (either implicitly or
745 # explicitly), add the necessary flags.
747 !IF $(DEBUG)>1 || $(OPTIMIZATIONS)==0
750 !IF $(USE_RUNTIME_CHECKS)!=0
754 !ELSEIF $(OPTIMIZATIONS)>=3
757 !ELSEIF $(OPTIMIZATIONS)==2
760 !ELSEIF $(OPTIMIZATIONS)==1
765 # If symbols are enabled (or compiling for debugging), enable PDBs.
767 !IF $(DEBUG)>1 || $(SYMBOLS)!=0
773 # Command line prefixes for compiling code, compiling resources,
776 LTCOMPILE = $(TCC) -Fo$@
777 LTRCOMPILE = $(RCC) -r
779 LTLINK = $(TCC) -Fe$@
781 # If requested, link to the RPCRT4 library.
783 !IF $(USE_RPCRT4_LIB)!=0
784 LTLINK = $(LTLINK) rpcrt4.lib
787 # If a platform was set, force the linker to target that.
788 # Note that the vcvars*.bat family of batch files typically
789 # set this for you. Otherwise, the linker will attempt
790 # to deduce the binary type based on the object files.
792 LTLINKOPTS = /NOLOGO /MACHINE:$(PLATFORM)
793 LTLIBOPTS = /NOLOGO /MACHINE:$(PLATFORM)
799 # When compiling for use in the WinRT environment, the following
800 # linker option must be used to mark the executable as runnable
801 # only in the context of an application container.
804 LTLINKOPTS = $(LTLINKOPTS) /APPCONTAINER
805 !IF "$(VISUALSTUDIOVERSION)"=="12.0" || "$(VISUALSTUDIOVERSION)"=="14.0"
807 !IF "$(PLATFORM)"=="x86"
808 STORELIBPATH = $(CRTLIBPATH)\store
809 !ELSEIF "$(PLATFORM)"=="x64"
810 STORELIBPATH = $(CRTLIBPATH)\store\amd64
811 !ELSEIF "$(PLATFORM)"=="ARM"
812 STORELIBPATH = $(CRTLIBPATH)\store\arm
814 STORELIBPATH = $(CRTLIBPATH)\store
817 STORELIBPATH = $(STORELIBPATH:\\=\)
818 LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(STORELIBPATH)"
822 # When compiling for Windows Phone 8.1, an extra library path is
825 !IF $(USE_WP81_OPTS)!=0
827 !IF "$(PLATFORM)"=="x86"
828 WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86
829 !ELSEIF "$(PLATFORM)"=="ARM"
830 WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\ARM
832 WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86
837 # When compiling for Windows Phone 8.1, some extra linker options
840 !IF $(USE_WP81_OPTS)!=0
842 LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(WP81LIBPATH)"
844 LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE
845 LTLINKOPTS = $(LTLINKOPTS) WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelHost.lib
846 LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:kernel32.lib /NODEFAULTLIB:ole32.lib
849 # When compiling for UWP or the Windows 10 platform, some extra linker
850 # options are also required.
852 !IF $(FOR_UWP)!=0 || $(FOR_WIN10)!=0
853 LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE /NODEFAULTLIB:kernel32.lib
854 LTLINKOPTS = $(LTLINKOPTS) mincore.lib
856 LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(PSDKLIBPATH)"
861 LTLINKOPTS = $(LTLINKOPTS) /guard:cf "/LIBPATH:$(UCRTLIBPATH)"
863 LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:libucrtd.lib /DEFAULTLIB:ucrtd.lib
865 LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib
869 # If either debugging or symbols are enabled, enable PDBs.
871 !IF $(DEBUG)>1 || $(SYMBOLS)!=0
872 LDFLAGS = /DEBUG $(LDOPTS)
878 # You should not have to change anything below this line
879 ###############################################################################
882 # Object files for the amalgamation.
884 LIBOBJS1 = sqlite3.lo
886 # Determine the real value of LIBOBJ based on the 'configure' script
890 # Determine if embedded resource compilation and usage are enabled.
893 LIBRESOBJS = sqlite3res.lo
899 # Additional compiler options for the shell. These are only effective
900 # when the shell is not being dynamically linked.
902 !IF $(DYNAMIC_SHELL)==0 && $(FOR_WIN10)==0
903 SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_SHELL_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS
907 # This is the default Makefile target. The objects listed here
908 # are what get build when you type just "make" with no arguments.
912 # Dynamic link library section.
921 $(SQLITE3DLL): $(LIBOBJ) $(LIBRESOBJS) $(CORE_LINK_DEP)
922 $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL $(CORE_LINK_OPTS) /OUT:$@ $(LIBOBJ) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
925 $(CSC) /target:exe $(TOP)\Replace.cs
927 sqlite3.def: Replace.exe $(LIBOBJ)
928 echo EXPORTS > sqlite3.def
929 dumpbin /all $(LIBOBJ) \
930 | .\Replace.exe "^\s+/EXPORT:_?(sqlite3_[^@,]*)(?:@\d+|,DATA)?$$" $$1 true \
931 | sort >> sqlite3.def
933 $(SQLITE3EXE): $(TOP)\shell.c $(SHELL_CORE_DEP) $(LIBRESOBJS) $(SHELL_CORE_SRC) $(SQLITE3H)
934 $(LTLINK) $(SHELL_COMPILE_OPTS) $(READLINE_FLAGS) $(TOP)\shell.c $(SHELL_CORE_SRC) \
935 /link $(SQLITE3EXEPDB) $(LDFLAGS) $(LTLINKOPTS) $(SHELL_LINK_OPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS)
938 # Rule to build the amalgamation
940 sqlite3.lo: $(SQLITE3C)
941 $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(SQLITE3C)
944 # Rule to build the Win32 resources object file.
948 !IF ![echo !IFNDEF VERSION > rcver.vc] && \
949 ![for /F "delims=" %V in ('type "$(SQLITE3H)" ^| find "$(_HASHCHAR)define SQLITE_VERSION "') do (echo VERSION = ^^%V >> rcver.vc)] && \
950 ![echo !ENDIF >> rcver.vc]
954 RESOURCE_VERSION = $(VERSION:^#=)
955 RESOURCE_VERSION = $(RESOURCE_VERSION:define=)
956 RESOURCE_VERSION = $(RESOURCE_VERSION:SQLITE_VERSION=)
957 RESOURCE_VERSION = $(RESOURCE_VERSION:"=)
958 RESOURCE_VERSION = $(RESOURCE_VERSION:.=,)
960 $(LIBRESOBJS): $(TOP)\sqlite3.rc rcver.vc $(SQLITE3H)
961 echo #ifndef SQLITE_RESOURCE_VERSION > sqlite3rc.h
962 echo #define SQLITE_RESOURCE_VERSION $(RESOURCE_VERSION) >> sqlite3rc.h
963 echo #endif >> sqlite3rc.h
964 $(LTRCOMPILE) -fo $(LIBRESOBJS) -DRC_VERONLY $(TOP)\sqlite3.rc
969 del /Q *.exp *.lo *.ilk *.lib *.obj *.ncb *.pdb *.sdf *.suo 2>NUL
970 del /Q *.bsc *.def *.cod *.da *.bb *.bbg *.vc gmon.out 2>NUL
971 del /Q $(SQLITE3EXE) $(SQLITE3DLL) Replace.exe 2>NUL