]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Backport of tooling support for including the debug build in the VSIX package.
authormistachkin <mistachkin@noemail.net>
Fri, 12 Oct 2012 18:22:51 +0000 (18:22 +0000)
committermistachkin <mistachkin@noemail.net>
Fri, 12 Oct 2012 18:22:51 +0000 (18:22 +0000)
FossilOrigin-Name: c188896719cb6b942936e27fab4ead52e2c63c54

Makefile.msc
manifest
manifest.uuid
tool/build-all-msvc.bat
tool/mkvsix.tcl

index 2b79c2b9b7b7093c0863a3769bc63fcbd6c8ae62..db997fd34bb5791f693605ac1d81b9f2273bbfc5 100644 (file)
@@ -9,49 +9,75 @@ TOP = .
 
 # Set this non-0 to create and use the SQLite amalgamation file.
 #
+!IFNDEF USE_AMALGAMATION
 USE_AMALGAMATION = 1
+!ENDIF
 
 # Set this non-0 to use the International Components for Unicode (ICU).
 #
+!IFNDEF USE_ICU
 USE_ICU = 0
+!ENDIF
 
 # Set this non-0 to dynamically link to the MSVC runtime library.
 #
+!IFNDEF USE_CRT_DLL
 USE_CRT_DLL = 0
+!ENDIF
 
 # Set this non-0 to attempt setting the native compiler automatically
 # for cross-compiling the command line tools needed during the compilation
 # process.
 #
+!IFNDEF XCOMPILE
 XCOMPILE = 0
+!ENDIF
 
 # Set this non-0 to use the native libraries paths for cross-compiling
 # the command line tools needed during the compilation process.
 #
+!IFNDEF USE_NATIVE_LIBPATHS
 USE_NATIVE_LIBPATHS = 0
+!ENDIF
+
+# Set this 0 to skip the compiling and embedding of version resources.
+#
+!IFNDEF USE_RC
+USE_RC = 1
+!ENDIF
 
 # Set this non-0 to compile binaries suitable for the WinRT environment.
 # This setting does not apply to any binaries that require Tcl to operate
 # properly (i.e. the text fixture, etc).
 #
+!IFNDEF FOR_WINRT
 FOR_WINRT = 0
+!ENDIF
 
 # Set this non-0 to skip attempting to look for and/or link with the Tcl
 # runtime library.
 #
+!IFNDEF NO_TCL
 NO_TCL = 0
+!ENDIF
 
 # Set this to non-0 to create and use PDBs.
 #
+!IFNDEF SYMBOLS
 SYMBOLS = 1
+!ENDIF
 
 # Set this to non-0 to use the SQLite debugging heap subsystem.
 #
+!IFNDEF MEMDEBUG
 MEMDEBUG = 0
+!ENDIF
 
 # Set this to non-0 to use the Win32 native heap subsystem.
 #
+!IFNDEF WIN32HEAP
 WIN32HEAP = 0
+!ENDIF
 
 # Set this to one of the following values to enable various debugging
 # features.  Each level includes the debugging options from the previous
@@ -64,7 +90,9 @@ WIN32HEAP = 0
 # 4 == SQLITE_DEBUG_OS_TRACE: Enables output from the OSTRACE() macros.
 # 5 == SQLITE_ENABLE_IOTRACE: Enables output from the IOTRACE() macros.
 #
+!IFNDEF DEBUG
 DEBUG = 0
+!ENDIF
 
 # Check for the predefined command macro CC.  This should point to the compiler
 # binary for the target platform.  If it is not defined, simply define it to
@@ -157,8 +185,8 @@ NLTLIBPATHS = "/LIBPATH:$(NCRTLIBPATH)" "/LIBPATH:$(NSDKLIBPATH)"
 # will run on the target platform.  (BCC and TCC are usually the
 # same unless your are cross-compiling.)
 #
-TCC = $(CC) -W3 -DSQLITE_OS_WIN=1 -I. -I$(TOP)\src -fp:precise
-RCC = $(RC) -DSQLITE_OS_WIN=1 -I. -I$(TOP)\src
+TCC = $(CC) -W3 -DSQLITE_OS_WIN=1 -I$(TOP) -I$(TOP)\src -fp:precise
+RCC = $(RC) -DSQLITE_OS_WIN=1 -I$(TOP) -I$(TOP)\src
 
 # When compiling the library for use in the WinRT environment,
 # the following compile-time options must be used as well to
@@ -168,8 +196,8 @@ RCC = $(RC) -DSQLITE_OS_WIN=1 -I. -I$(TOP)\src
 !IF $(FOR_WINRT)!=0
 TCC = $(TCC) -DSQLITE_OS_WINRT=1
 RCC = $(RCC) -DSQLITE_OS_WINRT=1
-TCC = $(TCC) -DWINAPI_FAMILY=WINAPI_PARTITION_APP
-RCC = $(RCC) -DWINAPI_FAMILY=WINAPI_PARTITION_APP
+TCC = $(TCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
+RCC = $(RCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
 !ENDIF
 
 # Also, we need to dynamically link to the correct MSVC runtime
@@ -180,14 +208,18 @@ RCC = $(RCC) -DWINAPI_FAMILY=WINAPI_PARTITION_APP
 !IF $(FOR_WINRT)!=0 || $(USE_CRT_DLL)!=0
 !IF $(DEBUG)>0
 TCC = $(TCC) -MDd
+BCC = $(BCC) -MDd
 !ELSE
 TCC = $(TCC) -MD
+BCC = $(BCC) -MD
 !ENDIF
 !ELSE
 !IF $(DEBUG)>0
 TCC = $(TCC) -MTd
+BCC = $(BCC) -MTd
 !ELSE
 TCC = $(TCC) -MT
+BCC = $(BCC) -MT
 !ENDIF
 !ENDIF
 
@@ -472,6 +504,14 @@ LIBOBJ = $(LIBOBJS0)
 LIBOBJ = $(LIBOBJS1)
 !ENDIF
 
+# Determine if embedded resource compilation and usage are enabled.
+#
+!IF $(USE_RC)!=0
+LIBRESOBJS = sqlite3res.lo
+!ELSE
+LIBRESOBJS =
+!ENDIF
+
 # All of the source code files.
 #
 SRC = \
@@ -766,10 +806,10 @@ libsqlite3.lib:   $(LIBOBJ)
 libtclsqlite3.lib:     tclsqlite.lo libsqlite3.lib
        $(LTLIB) $(LTLIBOPTS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCL:tcl=tclstub) $(TLIBS)
 
-sqlite3.exe:   $(TOP)\src\shell.c libsqlite3.lib sqlite3res.lo sqlite3.h
+sqlite3.exe:   $(TOP)\src\shell.c libsqlite3.lib $(LIBRESOBJS) sqlite3.h
        $(LTLINK) $(READLINE_FLAGS) \
                $(TOP)\src\shell.c \
-               /link $(LTLINKOPTS) $(LTLIBPATHS) libsqlite3.lib sqlite3res.lo $(LIBREADLINE) $(LTLIBS) $(TLIBS)
+               /link $(LTLINKOPTS) $(LTLIBPATHS) libsqlite3.lib $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS)
 
 # This target creates a directory named "tsrc" and fills it with
 # copies of all of the C source code and header files needed to
@@ -819,14 +859,16 @@ opcodes.lo:       opcodes.c
 
 # Rule to build the Win32 resources object file.
 #
-sqlite3res.lo: $(TOP)\src\sqlite3.rc $(HDR)
+!IF $(USE_RC)!=0
+$(LIBRESOBJS): $(TOP)\src\sqlite3.rc $(HDR)
        echo #ifndef SQLITE_RESOURCE_VERSION > sqlite3rc.h
-       for /F %%V in ('type VERSION') do ( \
+       for /F %%V in ('type "$(TOP)\VERSION"') do ( \
                echo #define SQLITE_RESOURCE_VERSION %%V \
                        | $(NAWK) "/.*/ { gsub(/[.]/,\",\");print }" >> sqlite3rc.h \
        )
        echo #endif >> sqlite3rc.h
-       $(LTRCOMPILE) -fo sqlite3res.lo $(TOP)\src\sqlite3.rc
+       $(LTRCOMPILE) -fo $(LIBRESOBJS) $(TOP)\src\sqlite3.rc
+!ENDIF
 
 # Rules to build individual *.lo files from files in the src directory.
 #
@@ -1043,8 +1085,8 @@ tclsqlite.lo:     $(TOP)\src\tclsqlite.c $(HDR)
 tclsqlite-shell.lo:    $(TOP)\src\tclsqlite.c $(HDR)
        $(LTCOMPILE) -DTCLSH=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c
 
-tclsqlite3.exe:        tclsqlite-shell.lo libsqlite3.lib sqlite3res.lo
-       $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /OUT:$@ libsqlite3.lib tclsqlite-shell.lo sqlite3res.lo $(LTLIBS) $(TLIBS)
+tclsqlite3.exe:        tclsqlite-shell.lo libsqlite3.lib $(LIBRESOBJS)
+       $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /OUT:$@ libsqlite3.lib tclsqlite-shell.lo $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
 
 # Rules to build opcodes.c and opcodes.h
 #
@@ -1157,11 +1199,11 @@ TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC0)
 TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC1)
 !ENDIF
 
-testfixture.exe:       $(TESTFIXTURE_SRC) sqlite3res.lo $(HDR)
+testfixture.exe:       $(TESTFIXTURE_SRC) $(LIBRESOBJS) $(HDR)
        $(LTLINK) -DSQLITE_NO_SYNC=1 $(TESTFIXTURE_FLAGS) \
                -DBUILD_sqlite -I$(TCLINCDIR) \
                $(TESTFIXTURE_SRC) \
-               /link $(LTLINKOPTS) $(LTLIBPATHS) sqlite3res.lo $(LTLIBS) $(TLIBS)
+               /link $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
 
 fulltest:      testfixture.exe sqlite3.exe
        .\testfixture.exe $(TOP)\test\all.test
@@ -1169,6 +1211,9 @@ fulltest: testfixture.exe sqlite3.exe
 soaktest:      testfixture.exe sqlite3.exe
        .\testfixture.exe $(TOP)\test\all.test -soak=1
 
+fulltestonly:  testfixture.exe sqlite3.exe
+       .\testfixture.exe $(TOP)\test\full.test
+
 test:  testfixture.exe sqlite3.exe
        .\testfixture.exe $(TOP)\test\veryquick.test
 
@@ -1179,9 +1224,9 @@ sqlite3_analyzer.c: sqlite3.c $(TOP)\src\test_stat.c $(TOP)\src\tclsqlite.c $(TO
        $(NAWK) -f $(TOP)\tool\tostr.awk $(TOP)\tool\spaceanal.tcl >> $@
        echo ; return zMainloop; } >> $@
 
-sqlite3_analyzer.exe:  sqlite3_analyzer.c sqlite3res.lo
+sqlite3_analyzer.exe:  sqlite3_analyzer.c $(LIBRESOBJS)
        $(LTLINK) -DBUILD_sqlite -DTCLSH=2 -I$(TCLINCDIR) sqlite3_analyzer.c \
-               /link $(LTLINKOPTS) $(LTLIBPATHS) sqlite3res.lo $(LTLIBS) $(TLIBS)
+               /link $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
 
 clean:
        del /Q *.lo *.ilk *.lib *.obj *.pdb sqlite3.exe libsqlite3.lib
@@ -1214,5 +1259,5 @@ sqlite3.def: libsqlite3.lib
                | $(NAWK) "/ 1 _?sqlite3_/ { sub(/^.* _?/,\"\");print }" \
                | sort >> sqlite3.def
 
-sqlite3.dll: $(LIBOBJ) sqlite3res.lo sqlite3.def
-       $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /DEF:sqlite3.def /OUT:$@ $(LIBOBJ) sqlite3res.lo $(LTLIBS) $(TLIBS)
+sqlite3.dll: $(LIBOBJ) $(LIBRESOBJS) sqlite3.def
+       $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /DEF:sqlite3.def /OUT:$@ $(LIBOBJ) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
index 6cd0a460acc613e3825a5c7c2327b68f954a8a88..95a4199c00b9505b648bdde347b825982c7bc912 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,9 +1,9 @@
-C Version\s3.7.14.1
-D 2012-10-04T19:37:12.994
+C Backport\sof\stooling\ssupport\sfor\sincluding\sthe\sdebug\sbuild\sin\sthe\sVSIX\spackage.
+D 2012-10-12T18:22:51.788
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in abd5c10d21d1395f140d9e50ea999df8fa4d6376
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
-F Makefile.msc 2d696f01c228995e98b3b953a08b7bba1d48c130
+F Makefile.msc 1d8a5d3cf33b8b8d3247c99367a37af384cc7ebd
 F Makefile.vxworks 879f034a64062a364b21000266bbd5bc6e0c19b9
 F README cd04a36fbc7ea56932a4052d7d0b7f09f27c33d6
 F VERSION 9694dff497fc7e53037a5890f30ab069c26e8ab7
@@ -971,7 +971,7 @@ F test/wherelimit.test 5e9fd41e79bb2b2d588ed999d641d9c965619b31
 F test/win32lock.test b2a539e85ae6b2d78475e016a9636b4451dc7fb9
 F test/zeroblob.test caaecfb4f908f7bc086ed238668049f96774d688
 F test/zerodamage.test 0de750389990b1078bab203c712dc3fefd1d8b82
-F tool/build-all-msvc.bat 1a18aa39983ae7354d834bc55a850a54fc007576 x
+F tool/build-all-msvc.bat 76b835e0ab91e30f22d8aa48db9dea4d2dc59e9f x
 F tool/build-shell.sh b64a481901fc9ffe5ca8812a2a9255b6cfb77381
 F tool/checkSpacing.c 810e51703529a204fc4e1eb060e9ab663e3c06d2
 F tool/diffdb.c 7524b1b5df217c20cd0431f6789851a4e0cb191b
@@ -989,7 +989,7 @@ F tool/mksqlite3c-noext.tcl 8bce31074e4cbe631bb7676526a048335f4c9f02
 F tool/mksqlite3c.tcl 589c7f44e990be1b8443cfe4808dce392b0327fa
 F tool/mksqlite3h.tcl 78013ad79a5e492e5f764f3c7a8ef834255061f8
 F tool/mksqlite3internalh.tcl 3dca7bb5374cee003379b8cbac73714f610ef795
-F tool/mkvsix.tcl 19b2ab9ea16445953a76568a5bbe4cb864f92dfe
+F tool/mkvsix.tcl a27951f30bb39c3504196610f17f687fc0b1c94d
 F tool/offsets.c fe4262fdfa378e8f5499a42136d17bf3b98f6091
 F tool/omittest.tcl 4665982e95a6e5c1bd806cf7bc3dea95be422d77
 F tool/opcodeDoc.awk b3a2a3d5d3075b8bd90b7afe24283efdd586659c
@@ -1014,10 +1014,7 @@ F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
 F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
 F tool/win/sqlite.vsix 67d8a99aceb56384a81b3f30d6c71743146d2cc9
-P 81fd941da62956e32d1c4ffcdb39abecba7a6f3b
-R a82bf185a73888ab1f23d02429bade9e
-T +bgcolor * #d0c0ff
-T +sym-release *
-T +sym-version-3.7.14.1 *
-U drh
-Z 002ec98f7f5b76deaac3a726393245f3
+P 091570e46d04e84b67228e0bdbcd6e1fb60c6bdb
+R bcccfde8794119107a5caab4043fcd6f
+U mistachkin
+Z 3c221b4f8f4bd86b2446cbb21b2a832f
index e9782c2f27908f0f6d593d1acd2c1fdbef2af0bc..a6fe80536fd7231d222816ba49b7e8cd6d7d9f7f 100644 (file)
@@ -1 +1 @@
-091570e46d04e84b67228e0bdbcd6e1fb60c6bdb
\ No newline at end of file
+c188896719cb6b942936e27fab4ead52e2c63c54
\ No newline at end of file
index a2d7dae3a3e01371ea8609852a68ae05dfb0adee..989a2af7954d7bf3df9d5ab567ba4cefb01aa12b 100755 (executable)
@@ -10,6 +10,7 @@ SETLOCAL
 \r
 REM SET __ECHO=ECHO\r
 REM SET __ECHO2=ECHO\r
+REM SET __ECHO3=ECHO\r
 IF NOT DEFINED _AECHO (SET _AECHO=REM)\r
 IF NOT DEFINED _CECHO (SET _CECHO=REM)\r
 IF NOT DEFINED _VECHO (SET _VECHO=REM)\r
@@ -142,7 +143,7 @@ FOR %%P IN (%PLATFORMS%) DO (
   REM       be used for the name of the platform-specific binary directory via\r
   REM       the environment variables setup earlier.\r
   REM\r
-  CALL :fn_SetVariable %%P_NAME PLATFORMNAME\r
+  CALL :fn_CopyVariable %%P_NAME PLATFORMNAME\r
 \r
   REM\r
   REM NOTE: This is the inner loop.  There should be exactly one iteration.\r
@@ -181,129 +182,144 @@ FOR %%P IN (%PLATFORMS%) DO (
     REM\r
     SET PATH=%TOOLPATH%;%SystemRoot%\System32;%SystemRoot%\r
 \r
-    REM\r
-    REM NOTE: Launch a nested command shell to perform the following steps:\r
-    REM\r
-    REM       1. Setup the MSVC environment for this platform using the\r
-    REM          official batch file.\r
-    REM\r
-    REM       2. Make sure that no stale build output files are present.\r
-    REM\r
-    REM       3. Build the "sqlite3.dll" and "sqlite3.lib" binaries for this\r
-    REM          platform.\r
-    REM\r
-    REM       4. Copy the "sqlite3.dll" and "sqlite3.lib" binaries for this\r
-    REM          platform to the platform-specific directory beneath the\r
-    REM          binary directory.\r
-    REM\r
-    "%ComSpec%" /C (\r
+    FOR %%B IN (Debug Retail) DO (\r
       REM\r
-      REM NOTE: Attempt to setup the MSVC environment for this platform.\r
+      REM NOTE: When preparing the debug build, set the DEBUG and MEMDEBUG\r
+      REM       environment variables to be picked up by the MSVC makefile\r
+      REM       itself.\r
       REM\r
-      %__ECHO% CALL "%VCINSTALLDIR%\vcvarsall.bat" %%P\r
-\r
-      IF ERRORLEVEL 1 (\r
-        ECHO Failed to call "%VCINSTALLDIR%\vcvarsall.bat" for platform %%P.\r
-        GOTO errors\r
+      IF /I "%%B" == "Debug" (\r
+        SET DEBUG=2\r
+        SET MEMDEBUG=1\r
+      ) ELSE (\r
+        CALL :fn_UnsetVariable DEBUG\r
+        CALL :fn_UnsetVariable MEMDEBUG\r
       )\r
 \r
       REM\r
-      REM NOTE: If this batch file is not running in "what-if" mode, check to\r
-      REM       be sure we were actually able to setup the MSVC environment as\r
-      REM       current versions of their official batch file do not set the\r
-      REM       exit code upon failure.\r
+      REM NOTE: Launch a nested command shell to perform the following steps:\r
       REM\r
-      IF NOT DEFINED __ECHO (\r
-        IF NOT DEFINED WindowsSdkDir (\r
-          ECHO Cannot build, Windows SDK not found for platform %%P.\r
-          GOTO errors\r
-        )\r
-      )\r
-\r
+      REM       1. Setup the MSVC environment for this platform using the\r
+      REM          official batch file.\r
       REM\r
-      REM NOTE: When using MSVC 2012, the native SDK path cannot simply use\r
-      REM       the "lib" sub-directory beneath the location specified in the\r
-      REM       WindowsSdkDir environment variable because that location does\r
-      REM       not actually contain the necessary library files for x86.\r
-      REM       This must be done for each iteration because it relies upon\r
-      REM       the WindowsSdkDir environment variable being set by the batch\r
-      REM       file used to setup the MSVC environment.\r
+      REM       2. Make sure that no stale build output files are present.\r
       REM\r
-      IF DEFINED SET_NSDKLIBPATH (\r
-        CALL :fn_SetVariable WindowsSdkDir NSDKLIBPATH\r
-        CALL :fn_AppendVariable NSDKLIBPATH \lib\win8\um\x86\r
-      )\r
-\r
+      REM       3. Build the "sqlite3.dll" and "sqlite3.lib" binaries for this\r
+      REM          platform.\r
       REM\r
-      REM NOTE: Unless prevented from doing so, invoke NMAKE with the MSVC\r
-      REM       makefile to clean any stale build output from previous\r
-      REM       iterations of this loop and/or previous runs of this batch\r
-      REM       file, etc.\r
+      REM       4. Copy the "sqlite3.dll" and "sqlite3.lib" binaries for this\r
+      REM          platform to the platform-specific directory beneath the\r
+      REM          binary directory.\r
       REM\r
-      IF NOT DEFINED NOCLEAN (\r
-        %__ECHO% nmake -f Makefile.msc clean\r
+      "%ComSpec%" /C (\r
+        REM\r
+        REM NOTE: Attempt to setup the MSVC environment for this platform.\r
+        REM\r
+        %__ECHO3% CALL "%VCINSTALLDIR%\vcvarsall.bat" %%P\r
 \r
         IF ERRORLEVEL 1 (\r
-          ECHO Failed to clean for platform %%P.\r
+          ECHO Failed to call "%VCINSTALLDIR%\vcvarsall.bat" for platform %%P.\r
           GOTO errors\r
         )\r
-      ) ELSE (\r
+\r
         REM\r
-        REM NOTE: Even when the cleaning step has been disabled, we still need\r
-        REM       to remove the build output for the files we are specifically\r
-        REM       wanting to build for each platform.\r
+        REM NOTE: If this batch file is not running in "what-if" mode, check to\r
+        REM       be sure we were actually able to setup the MSVC environment\r
+        REM       as current versions of their official batch file do not set\r
+        REM       the exit code upon failure.\r
         REM\r
-        %__ECHO% DEL /Q sqlite3.dll sqlite3.lib sqlite3.pdb\r
-      )\r
+        IF NOT DEFINED __ECHO (\r
+          IF NOT DEFINED WindowsSdkDir (\r
+            ECHO Cannot build, Windows SDK not found for platform %%P.\r
+            GOTO errors\r
+          )\r
+        )\r
 \r
-      REM\r
-      REM NOTE: Invoke NMAKE with the MSVC makefile to build the "sqlite3.dll"\r
-      REM       binary.  The x86 compiler will be used to compile the native\r
-      REM       command line tools needed during the build process itself.\r
-      REM       Also, disable looking for and/or linking to the native Tcl\r
-      REM       runtime library.\r
-      REM\r
-      %__ECHO% nmake -f Makefile.msc sqlite3.dll "NCC=""%VCINSTALLDIR%\bin\cl.exe""" USE_NATIVE_LIBPATHS=1 NO_TCL=1 %NMAKE_ARGS%\r
+        REM\r
+        REM NOTE: When using MSVC 2012, the native SDK path cannot simply use\r
+        REM       the "lib" sub-directory beneath the location specified in the\r
+        REM       WindowsSdkDir environment variable because that location does\r
+        REM       not actually contain the necessary library files for x86.\r
+        REM       This must be done for each iteration because it relies upon\r
+        REM       the WindowsSdkDir environment variable being set by the batch\r
+        REM       file used to setup the MSVC environment.\r
+        REM\r
+        IF DEFINED SET_NSDKLIBPATH (\r
+          CALL :fn_CopyVariable WindowsSdkDir NSDKLIBPATH\r
+          CALL :fn_AppendVariable NSDKLIBPATH \lib\win8\um\x86\r
+        )\r
 \r
-      IF ERRORLEVEL 1 (\r
-        ECHO Failed to build "sqlite3.dll" for platform %%P.\r
-        GOTO errors\r
-      )\r
+        REM\r
+        REM NOTE: Unless prevented from doing so, invoke NMAKE with the MSVC\r
+        REM       makefile to clean any stale build output from previous\r
+        REM       iterations of this loop and/or previous runs of this batch\r
+        REM       file, etc.\r
+        REM\r
+        IF NOT DEFINED NOCLEAN (\r
+          %__ECHO% nmake -f Makefile.msc clean\r
+\r
+          IF ERRORLEVEL 1 (\r
+            ECHO Failed to clean for platform %%P.\r
+            GOTO errors\r
+          )\r
+        ) ELSE (\r
+          REM\r
+          REM NOTE: Even when the cleaning step has been disabled, we still\r
+          REM       need to remove the build output for the files we are\r
+          REM       specifically wanting to build for each platform.\r
+          REM\r
+          %__ECHO% DEL /Q sqlite3.dll sqlite3.lib sqlite3.pdb\r
+        )\r
 \r
-      REM\r
-      REM NOTE: Copy the "sqlite3.dll" file to the platform-specific directory\r
-      REM       beneath the binary directory.\r
-      REM\r
-      %__ECHO% XCOPY sqlite3.dll "%BINARYDIRECTORY%\%%D\" %FFLAGS% %DFLAGS%\r
+        REM\r
+        REM NOTE: Call NMAKE with the MSVC makefile to build the "sqlite3.dll"\r
+        REM       binary.  The x86 compiler will be used to compile the native\r
+        REM       command line tools needed during the build process itself.\r
+        REM       Also, disable looking for and/or linking to the native Tcl\r
+        REM       runtime library.\r
+        REM\r
+        %__ECHO% nmake -f Makefile.msc sqlite3.dll XCOMPILE=1 USE_NATIVE_LIBPATHS=1 NO_TCL=1 %NMAKE_ARGS%\r
 \r
-      IF ERRORLEVEL 1 (\r
-        ECHO Failed to copy "sqlite3.dll" to "%BINARYDIRECTORY%\%%D\".\r
-        GOTO errors\r
-      )\r
+        IF ERRORLEVEL 1 (\r
+          ECHO Failed to build %%B "sqlite3.dll" for platform %%P.\r
+          GOTO errors\r
+        )\r
 \r
-      REM\r
-      REM NOTE: Copy the "sqlite3.lib" file to the platform-specific directory\r
-      REM       beneath the binary directory.\r
-      REM\r
-      %__ECHO% XCOPY sqlite3.lib "%BINARYDIRECTORY%\%%D\" %FFLAGS% %DFLAGS%\r
+        REM\r
+        REM NOTE: Copy the "sqlite3.dll" file to the appropriate directory for\r
+        REM       the build and platform beneath the binary directory.\r
+        REM\r
+        %__ECHO% XCOPY sqlite3.dll "%BINARYDIRECTORY%\%%B\%%D\" %FFLAGS% %DFLAGS%\r
 \r
-      IF ERRORLEVEL 1 (\r
-        ECHO Failed to copy "sqlite3.lib" to "%BINARYDIRECTORY%\%%D\".\r
-        GOTO errors\r
-      )\r
+        IF ERRORLEVEL 1 (\r
+          ECHO Failed to copy "sqlite3.dll" to "%BINARYDIRECTORY%\%%B\%%D\".\r
+          GOTO errors\r
+        )\r
 \r
-      REM\r
-      REM NOTE: Copy the "sqlite3.pdb" file to the platform-specific directory\r
-      REM       beneath the binary directory unless we are prevented from doing\r
-      REM       so.\r
-      REM\r
-      IF NOT DEFINED NOSYMBOLS (\r
-        %__ECHO% XCOPY sqlite3.pdb "%BINARYDIRECTORY%\%%D\" %FFLAGS% %DFLAGS%\r
+        REM\r
+        REM NOTE: Copy the "sqlite3.lib" file to the appropriate directory for\r
+        REM       the build and platform beneath the binary directory.\r
+        REM\r
+        %__ECHO% XCOPY sqlite3.lib "%BINARYDIRECTORY%\%%B\%%D\" %FFLAGS% %DFLAGS%\r
 \r
         IF ERRORLEVEL 1 (\r
-          ECHO Failed to copy "sqlite3.pdb" to "%BINARYDIRECTORY%\%%D\".\r
+          ECHO Failed to copy "sqlite3.lib" to "%BINARYDIRECTORY%\%%B\%%D\".\r
           GOTO errors\r
         )\r
+\r
+        REM\r
+        REM NOTE: Copy the "sqlite3.pdb" file to the appropriate directory for\r
+        REM       the build and platform beneath the binary directory unless we\r
+        REM       are prevented from doing so.\r
+        REM\r
+        IF NOT DEFINED NOSYMBOLS (\r
+          %__ECHO% XCOPY sqlite3.pdb "%BINARYDIRECTORY%\%%B\%%D\" %FFLAGS% %DFLAGS%\r
+\r
+          IF ERRORLEVEL 1 (\r
+            ECHO Failed to copy "sqlite3.pdb" to "%BINARYDIRECTORY%\%%B\%%D\".\r
+            GOTO errors\r
+          )\r
+        )\r
       )\r
     )\r
   )\r
@@ -339,7 +355,7 @@ GOTO no_errors
   VERIFY MAYBE 2> NUL\r
   GOTO :EOF\r
 \r
-:fn_SetVariable\r
+:fn_CopyVariable\r
   SETLOCAL\r
   IF NOT DEFINED %1 GOTO :EOF\r
   IF "%2" == "" GOTO :EOF\r
index a7517786c51a8ba92f5bfb09974ea100e9c16890..6a84758cc8d9b97b27801a41380e002576bb5a22 100644 (file)
@@ -90,12 +90,13 @@ proc substFile { fileName } {
   return [writeFile $fileName [uplevel 1 [list subst [readFile $fileName]]]]
 }
 \f
-proc replacePlatform { fileName platformName } {
+proc replaceBuildAndPlatform { fileName buildName platformName } {
   #
   # NOTE: Returns the specified file name containing the platform name instead
   #       of platform placeholder tokens.
   #
-  return [string map [list <platform> $platformName] $fileName]
+  return [string map [list <build> $buildName <platform> $platformName] \
+      $fileName]
 }
 \f
 set script [file normalize [info script]]
@@ -249,12 +250,12 @@ if {![regexp -line -- $pattern $data dummy version]} then {
 if {![info exists fileNames(source)]} then {
   set fileNames(source) [list "" "" "" \
       [file join $sourceDirectory sqlite3.h] \
-      [file join $binaryDirectory <platform> sqlite3.lib] \
-      [file join $binaryDirectory <platform> sqlite3.dll]]
+      [file join $binaryDirectory <build> <platform> sqlite3.lib] \
+      [file join $binaryDirectory <build> <platform> sqlite3.dll]]
 
   if {![info exists no(symbols)]} then {
     lappend fileNames(source) \
-        [file join $binaryDirectory <platform> sqlite3.pdb]
+        [file join $binaryDirectory <build> <platform> sqlite3.pdb]
   }
 }
 
@@ -262,27 +263,31 @@ if {![info exists fileNames(destination)]} then {
   set fileNames(destination) [list \
       [file join $stagingDirectory extension.vsixmanifest] \
       [file join $stagingDirectory SDKManifest.xml] \
-      [file join $stagingDirectory DesignTime CommonConfiguration \
-          <platform> SQLite.WinRT.props] \
-      [file join $stagingDirectory DesignTime CommonConfiguration \
-          <platform> sqlite3.h] \
-      [file join $stagingDirectory DesignTime CommonConfiguration \
-          <platform> sqlite3.lib] \
-      [file join $stagingDirectory Redist CommonConfiguration \
-          <platform> sqlite3.dll]]
+      [file join $stagingDirectory DesignTime <build> <platform> \
+          SQLite.WinRT.props] \
+      [file join $stagingDirectory DesignTime <build> <platform> sqlite3.h] \
+      [file join $stagingDirectory DesignTime <build> <platform> sqlite3.lib] \
+      [file join $stagingDirectory Redist <build> <platform> sqlite3.dll]]
 
   if {![info exists no(symbols)]} then {
     lappend fileNames(destination) \
-        [file join $stagingDirectory Redist Debug \
-            <platform> sqlite3.pdb]
+        [file join $stagingDirectory Redist <build> <platform> sqlite3.pdb]
   }
 }
 
-if {![info exists fileNames(neutral)]} then {
-  set fileNames(neutral) [list 1 1 1 1 0 0]
+if {![info exists fileNames(buildNeutral)]} then {
+  set fileNames(buildNeutral) [list 1 1 1 1 0 0]
 
   if {![info exists no(symbols)]} then {
-    lappend fileNames(neutral) 0
+    lappend fileNames(buildNeutral) 0
+  }
+}
+
+if {![info exists fileNames(platformNeutral)]} then {
+  set fileNames(platformNeutral) [list 1 1 1 1 0 0]
+
+  if {![info exists no(symbols)]} then {
+    lappend fileNames(platformNeutral) 0
   }
 }
 
@@ -294,6 +299,31 @@ if {![info exists fileNames(subst)]} then {
   }
 }
 
+if {![info exists fileNames(noDebug)]} then {
+  set fileNames(noDebug) [list 0 0 0 0 0 0]
+
+  if {![info exists no(symbols)]} then {
+    lappend fileNames(noDebug) 0
+  }
+}
+
+if {![info exists fileNames(noRetail)]} then {
+  set fileNames(noRetail) [list 0 0 0 0 0 0]
+
+  if {![info exists no(symbols)]} then {
+    lappend fileNames(noRetail) 1
+  }
+}
+
+###############################################################################
+
+#
+# NOTE: Setup the list of builds supported by this script.
+#
+if {![info exists buildNames]} then {
+  set buildNames [list Debug Retail]
+}
+
 ###############################################################################
 
 #
@@ -338,45 +368,63 @@ eval $extractCommand
 #
 foreach sourceFileName $fileNames(source) \
     destinationFileName $fileNames(destination) \
-    isNeutral $fileNames(neutral) useSubst $fileNames(subst) {
+    buildNeutral $fileNames(buildNeutral) platformNeutral \
+    $fileNames(platformNeutral) useSubst $fileNames(subst) \
+    noDebug $fileNames(noDebug) noRetail $fileNames(noRetail) {
   #
-  # NOTE: If the current file is platform-neutral, then only one platform will
-  #       be processed for it, namely "neutral"; otherwise, each supported
-  #       platform will be processed for it individually.
+  # NOTE: If the current file is build-neutral, then only one build will
+  #       be processed for it, namely "CommonConfiguration"; otherwise, each
+  #       supported build will be processed for it individually.
   #
-  foreach platformName [expr {$isNeutral ? [list neutral] : $platformNames}] {
+  foreach buildName \
+      [expr {$buildNeutral ? [list CommonConfiguration] : $buildNames}] {
     #
-    # NOTE: Use the actual platform name in the destination file name.
+    # NOTE: Should the current file be skipped for this build?
     #
-    set newDestinationFileName [replacePlatform $destinationFileName \
-        $platformName]
+    if {[info exists no${buildName}] && [set no${buildName}]} then {
+      continue
+    }
 
     #
-    # NOTE: Does the source file need to be copied to the destination file?
+    # NOTE: If the current file is platform-neutral, then only one platform
+    #       will be processed for it, namely "neutral"; otherwise, each
+    #       supported platform will be processed for it individually.
     #
-    if {[string length $sourceFileName] > 0} then {
+    foreach platformName \
+        [expr {$platformNeutral ? [list neutral] : $platformNames}] {
       #
-      # NOTE: First, make sure the destination directory exists.
+      # NOTE: Use the actual platform name in the destination file name.
       #
-      file mkdir [file dirname $newDestinationFileName]
+      set newDestinationFileName [replaceBuildAndPlatform \
+          $destinationFileName $buildName $platformName]
 
       #
-      # NOTE: Then, copy the source file to the destination file verbatim.
+      # NOTE: Does the source file need to be copied to the destination file?
       #
-      file copy [replacePlatform $sourceFileName $platformName] \
-          $newDestinationFileName
-    }
+      if {[string length $sourceFileName] > 0} then {
+        #
+        # NOTE: First, make sure the destination directory exists.
+        #
+        file mkdir [file dirname $newDestinationFileName]
+
+        #
+        # NOTE: Then, copy the source file to the destination file verbatim.
+        #
+        file copy [replaceBuildAndPlatform $sourceFileName $buildName \
+            $platformName] $newDestinationFileName
+      }
 
-    #
-    # NOTE: Does the destination file contain dynamic replacements that must
-    #       be processed now?
-    #
-    if {$useSubst} then {
       #
-      # NOTE: Perform any dynamic replacements contained in the destination
-      #       file and then re-write it in-place.
+      # NOTE: Does the destination file contain dynamic replacements that must
+      #       be processed now?
       #
-      substFile $newDestinationFileName
+      if {$useSubst} then {
+        #
+        # NOTE: Perform any dynamic replacements contained in the destination
+        #       file and then re-write it in-place.
+        #
+        substFile $newDestinationFileName
+      }
     }
   }
 }