[librsvg/master.msvc: 4/5] NMake Makefiles: Fix and revamp




commit f0b53a299325c06c20f6fc04ce9a9db827b9103d
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Thu Jul 8 17:27:13 2021 +0800

    NMake Makefiles: Fix and revamp
    
    Make the Visual Studio builds adapt to the more-thoroughly rustified
    librsvg, and clean up things a bit, by:
    
    *  Updating the call to 'cargo' to better-match what is done in the
       autotools builds.  Also fix building rsvg-convert.exe, as it is now
       handled by Cargo.
    
    *  Fixing the librsvg DLL build, as we need to go back to using .def files
       as we now only have Rust sources for librsvg (core) itself.
    
    *  Drop items that are no longer in the sources, to clean things up.
    
    *  Speed up the build a bit.
    
    *  Make more dependency-discovery configurable.
    
    Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/565>

 .gitignore                  |  4 +++
 win32/Makefile.vc           |  2 +-
 win32/build-rules-msvc.mak  | 64 +++++++++++++--------------------------------
 win32/config-msvc.mak.in    | 29 ++++++++++++++------
 win32/create-lists-msvc.mak | 22 ++--------------
 win32/generate-msvc.mak     | 27 ++++++++-----------
 win32/info-msvc.mak         |  2 +-
 win32/install-msvc.mak      |  5 ++--
 win32/rsvg-rust.mak         | 46 ++++++++++++++++++++++++++------
 9 files changed, 99 insertions(+), 102 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index de909c2a..fcdd8e61 100644
--- a/.gitignore
+++ b/.gitignore
@@ -76,6 +76,10 @@ tests/rsvg-test
 tests/*.log
 tests/*.trs
 win32/config-msvc.mak
+win32/*.bat
+win32/vs12
+win32/vs14
+win32/__pycache__
 Rsvg-2.0.gir
 Rsvg-2.0.typelib
 librsvg-2.0.vapi
diff --git a/win32/Makefile.vc b/win32/Makefile.vc
index e4d315e8..80d27c0a 100644
--- a/win32/Makefile.vc
+++ b/win32/Makefile.vc
@@ -32,7 +32,7 @@ VALID_MSC = TRUE
 # Include the Makefile portion to convert the source and header lists
 # into the lists we need for compilation and introspection
 
-all: $(RSVG_TOOLS) $(RSVG_EXTRA_TOOLS) $(EXTRA_TARGETS) build-info-librsvg
+all: $(RSVG_TOOLS) $(EXTRA_TARGETS) build-info-librsvg
 
 # Include the build rules for Rust builds, sources, DLLs and executables
 !include rsvg-rust.mak
diff --git a/win32/build-rules-msvc.mak b/win32/build-rules-msvc.mak
index 2200a183..a1ec221c 100644
--- a/win32/build-rules-msvc.mak
+++ b/win32/build-rules-msvc.mak
@@ -13,32 +13,21 @@
 #      $(CC)|$(CXX) $(cflags) /Fo$(destdir) /c @<<
 # $<
 # <<
-{..\librsvg\}.c{$(OUTDIR)\librsvg\}.obj:
-       @if not exist $(@D) $(MAKE) /f Makefile.vc CFG=$(CFG) $(@D)
+{$(OUTDIR)\librsvg\}.c{$(OUTDIR)\librsvg\}.obj:
        $(CC) $(LIBRSVG_CFLAGS) $(LIBRSVG_INCLUDES) /Fo$(@D)\ /Fd$(@D)\ /c @<<
 $<
 <<
 
 {..\gdk-pixbuf-loader\}.c{$(OUTDIR)\rsvg-gdk-pixbuf-loader\}.obj:
-       @if not exist $(@D) $(MAKE) /f Makefile.vc CFG=$(CFG) $(@D)
+       @if not exist $(@D)\ mkdir $(@D)
+       @if not exist $(@D)\..\librsvg\config.h copy .\config.h.win32 $(@D)\..\librsvg\config.h
        $(CC) $(RSVG_PIXBUF_LOADER_CFLAGS) $(TOOLS_DEP_INCLUDES) /Fo$(@D)\ /Fd$(@D)\ /c @<<
 $<
 <<
 
-{..\}.c{$(OUTDIR)\rsvg-tools\}.obj:
-       @if not exist $(@D) $(MAKE) /f Makefile.vc CFG=$(CFG) $(@D)
-       $(CC) $(BASE_CFLAGS) $(TOOLS_DEP_INCLUDES) /Fo$(@D)\ /Fd$(@D)\ /c @<<
-$<
-<<
-
-{..\tools\}.c{$(OUTDIR)\rsvg-tools\}.obj:
-       @if not exist $(@D) $(MAKE) /f Makefile.vc CFG=$(CFG) $(@D)
-       $(CC) $(BASE_CFLAGS) $(LIBRSVG_LOG_DOMAIN) $(TOOLS_DEP_INCLUDES) /Fo$(@D)\ /Fd$(@D)\ /c @<<
-$<
-<<
-
 {..\tests\}.c{$(OUTDIR)\rsvg-tests\}.obj:
-       @if not exist $(@D) $(MAKE) /f Makefile.vc CFG=$(CFG) $(@D)
+       @if not exist $(@D)\ mkdir $(@D)
+       @if not exist $(@D)\..\librsvg\config.h copy .\config.h.win32 $(@D)\..\librsvg\config.h
        $(CC) $(TEST_CFLAGS) $(LIBRSVG_LOG_DOMAIN) $(TOOLS_DEP_INCLUDES) /Fo$(@D)\ /Fd$(@D)\ /c @<<
 $<
 <<
@@ -53,19 +42,17 @@ $(LIBRSVG_LIB): $(LIBRSVG_DLL)
 # $(dependent_objects)
 # <<
 #      @-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;2
-$(LIBRSVG_DLL):        \
-$(RSVG_INTERNAL_LIB)           \
-$(OUTDIR)\librsvg\config.h     \
-$(librsvg_OBJS)
-       link /DLL $(LDFLAGS)    \
-       $(LIBRSVG_DEP_LIBS)     \
+$(LIBRSVG_DLL): $(RSVG_INTERNAL_LIB) $(librsvg_OBJS) $(LIBRSVG_DEF)
+       link /DLL $(LDFLAGS) $(LIBRSVG_DEP_LIBS)        \
        /implib:$(LIBRSVG_LIB)  \
-       -out:$@ @<<
+       -out:$@ /def:$(LIBRSVG_DEF) @<<
 $(librsvg_OBJS)
 <<
        @-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;2
 
-$(GDK_PIXBUF_SVG_LOADER): $(LIBRSVG_LIB) $(OUTDIR)\rsvg-gdk-pixbuf-loader\io-svg.obj
+$(GDK_PIXBUF_SVG_LOADER):      \
+$(LIBRSVG_LIB) \
+$(OUTDIR)\rsvg-gdk-pixbuf-loader\io-svg.obj
        link /DLL $(LDFLAGS) $** $(BASE_DEP_LIBS) /out:$@
        @-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;2
 
@@ -76,23 +63,10 @@ $(GDK_PIXBUF_SVG_LOADER): $(LIBRSVG_LIB) $(OUTDIR)\rsvg-gdk-pixbuf-loader\io-svg
 # $(dependent_objects)
 # <<
 #      @-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;1
-$(OUTDIR)\rsvg-convert.exe: $(LIBRSVG_LIB) $(OUTDIR)\rsvg-tools\rsvg-convert.obj
-
-$(OUTDIR)\rsvg-dimensions.exe: \
-       $(LIBRSVG_LIB)  \
-       $(OUTDIR)\rsvg-tools\rsvg-dimensions.obj        \
-       $(OUTDIR)\rsvg-tools\rsvg-tools-main.obj
-
-$(OUTDIR)\test-performance.exe:        \
-       $(LIBRSVG_LIB)  \
-       $(OUTDIR)\rsvg-tools\test-performance.obj       \
-       $(OUTDIR)\rsvg-tools\rsvg-tools-main.obj
-
-$(OUTDIR)\rsvg-convert.exe     \
-$(OUTDIR)\rsvg-dimensions.exe  \
-$(OUTDIR)\test-performance.exe:
-       link $(LDFLAGS) $** $(TOOLS_DEP_LIBS) /out:$@
-       @-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;1
+$(OUTDIR)\rsvg-convert.exe:    \
+vs$(VSVER)\$(CFG)\$(PLAT)\obj\rsvg_c_api\$(RUST_TARGET)-pc-windows-msvc\$(CFG)\rsvg-convert.exe
+       @copy /b $** $@
+       @if exist $(**D)\rsvg_convert.pdb copy /b $(**D)\rsvg_convert.pdb $(@D)
 
 # Include the rules for the test programs
 !include rsvg_tests_rules.mak
@@ -141,26 +115,24 @@ clean:
        @if exist $(OUTDIR)\Rsvg-$(RSVG_API_VER).gir del /f /q $(OUTDIR)\Rsvg-$(RSVG_API_VER).gir
        @-del /f /q $(OUTDIR)\*.dll
        @-del /f /q $(OUTDIR)\*.exe
-       @-del /f /q $(OUTDIR)\*.dll
        @-del /f /q $(OUTDIR)\*.pdb
        @-del /f /q $(OUTDIR)\*.ilk
        @-del /f /q $(OUTDIR)\*.exp
        @-del /f /q $(OUTDIR)\*.lib
        @-del /s /q $(OUTDIR)\rsvg-tests\*.obj
        @-del /s /q $(OUTDIR)\rsvg-tests\*.pdb
-       @-del /s /q $(OUTDIR)\rsvg-tools\*.obj
-       @-del /s /q $(OUTDIR)\rsvg-tools\*.pdb
        @-del /s /q $(OUTDIR)\rsvg-gdk-pixbuf-loader\*.obj
        @-del /s /q $(OUTDIR)\rsvg-gdk-pixbuf-loader\*.pdb
-       @-del /s /q $(OUTDIR)\rsvg-tools\*.pdb
        @-del /s /q $(OUTDIR)\librsvg\Rsvg_2_0_gir_list
        @-del /s /q $(OUTDIR)\librsvg\*.obj
        @-del /s /q $(OUTDIR)\librsvg\*.pdb
+       @-del /s /q $(OUTDIR)\librsvg\_rsvg_dummy.c
+       @-del /s /q $(OUTDIR)\librsvg\config.h
        @-rmdir /s /q $(OUTDIR)\output
        @-rmdir /s /q output
        @-rmdir /s /q $(OUTDIR)\rsvg-tests
-       @-rmdir /s /q $(OUTDIR)\rsvg-tools
        @-rmdir /s /q $(OUTDIR)\rsvg-gdk-pixbuf-loader
        @-rmdir /s /q $(OUTDIR)\librsvg
        $(MAKE) /f rsvg-rust.mak CFG=$(CFG) cargo-clean
        @-rmdir /s /q $(OUTDIR)\obj
+       @-del build-$(PLAT)-$(CFG)*.bat
diff --git a/win32/config-msvc.mak.in b/win32/config-msvc.mak.in
index 8568c061..4c42f753 100644
--- a/win32/config-msvc.mak.in
+++ b/win32/config-msvc.mak.in
@@ -20,11 +20,24 @@ LIBDIR=$(PREFIX)\lib
 INCLUDEDIR=$(PREFIX)\include
 !endif
 
-# Make import lib of gettext-runtime configurable
+# Make import libs of gettext-runtime, FreeType
+# HarfBuzz and libxml2 configurable
 !ifndef LIBINTL_LIB
 LIBINTL_LIB = intl.lib
 !endif
 
+!ifndef FREETYPE_LIB
+FREETYPE_LIB = freetype.lib
+!endif
+
+!ifndef HARFBUZZ_LIB
+HARFBUZZ_LIB = harfbuzz.lib
+!endif
+
+!ifndef LIBXML2_LIB
+LIBXML2_LIB = libxml2.lib
+!endif
+
 LDFLAGS = $(LDFLAGS) /libpath:$(LIBDIR)
 
 # These are the base minimum libraries required for building librsvg.
@@ -58,6 +71,9 @@ BASE_DEP_LIBS =                       \
        gobject-2.0.lib         \
        glib-2.0.lib            \
        cairo.lib               \
+       $(HARFBUZZ_LIB) \
+       $(FREETYPE_LIB) \
+       $(LIBXML2_LIB)  \
        $(LIBINTL_LIB)
 
 LIBRSVG_LOG_DOMAIN = /DG_LOG_DOMAIN=\"librsvg\"
@@ -70,7 +86,7 @@ LIBRSVG_CFLAGS =                              \
        /DRSVG_API=__declspec(dllexport)
 
 LIBRSVG_INCLUDES =                     \
-       /I..                            \
+       /I..\include                    \
        /I.\$(OUTDIR)\librsvg           \
        $(BASE_DEP_INCLUDES)            \
        /I$(INCLUDEDIR)\libxml2
@@ -90,7 +106,7 @@ TEST_DEP_LIBS =      \
        fontconfig.lib
 !endif
 
-RSVG_INTERNAL_LIB = $(OUTDIR)\obj\rsvg_c_api\$(RUST_TARGET)-pc-windows-msvc\$(CFG)\rsvg_c_api.lib
+RSVG_INTERNAL_LIB = $(OUTDIR)\obj\rsvg_c_api\$(RUST_TARGET)-pc-windows-msvc\$(CFG)\librsvg.lib
 
 LIBRSVG_DEP_LIBS =                     \
        $(RSVG_INTERNAL_LIB)            \
@@ -117,11 +133,12 @@ LIBRSVG_DLL_FILENAME = $(OUTDIR)\rsvg-$(RSVG_API_VER)-vs$(VSVER)
 
 LIBRSVG_DLL = $(LIBRSVG_DLL_FILENAME).dll
 LIBRSVG_LIB = $(OUTDIR)\rsvg-$(RSVG_API_VER).lib
+LIBRSVG_DEF = $(OUTDIR)\librsvg\librsvg.def
 
 GDK_PIXBUF_SVG_LOADER = $(OUTDIR)\libpixbufloader-svg.dll
 
 TOOLS_DEP_INCLUDES =           \
-       /I..                    \
+       /I..\include            \
        /I.\$(OUTDIR)\librsvg   \
        $(BASE_DEP_INCLUDES)
 
@@ -129,10 +146,6 @@ TOOLS_DEP_LIBS = $(BASE_DEP_LIBS)
 
 RSVG_TOOLS = $(OUTDIR)\rsvg-convert.exe
 
-RSVG_EXTRA_TOOLS =                     \
-       $(OUTDIR)\rsvg-dimensions.exe   \
-       $(OUTDIR)\test-performance.exe
-
 # Build Introspection if requested
 EXTRA_TARGETS = $(GDK_PIXBUF_SVG_LOADER)
 !ifdef INTROSPECTION
diff --git a/win32/create-lists-msvc.mak b/win32/create-lists-msvc.mak
index 06541a84..97087fdf 100644
--- a/win32/create-lists-msvc.mak
+++ b/win32/create-lists-msvc.mak
@@ -35,28 +35,10 @@ NULL=
 
 # For librsvg
 
-!if [call create-lists.bat header rsvg_objs.mak librsvg_real_SRCS]
-!endif
-
-!if [for %s in ($(librsvg_c_srcs:/=\)) do @call create-lists.bat file rsvg_objs.mak ..\%s]
-!endif
-
-!if [call create-lists.bat footer rsvg_objs.mak]
-!endif
-
 !if [call create-lists.bat header rsvg_objs.mak librsvg_real_pub_HDRS]
 !endif
 
-!if [for %s in ($(headers:/=\)) do @call create-lists.bat file rsvg_objs.mak ..\%s]
-!endif
-
-!if [call create-lists.bat footer rsvg_objs.mak]
-!endif
-
-!if [call create-lists.bat header rsvg_objs.mak librsvg_real_extra_pub_HDRS]
-!endif
-
-!if [for %s in ($(extra_inc_headers:/=\)) do @call create-lists.bat file rsvg_objs.mak ..\%s]
+!if [for %s in ($(librsvg_public_headers:/=\)) do @call create-lists.bat file rsvg_objs.mak ..\%s]
 !endif
 
 !if [call create-lists.bat footer rsvg_objs.mak]
@@ -65,7 +47,7 @@ NULL=
 !if [call create-lists.bat header rsvg_objs.mak librsvg_OBJS]
 !endif
 
-!if [for %c in ($(librsvg_c_srcs:/=\)) do @if "%~xc" == ".c" @call create-lists.bat file rsvg_objs.mak 
^$(OUTDIR)\librsvg\%~nc.obj]
+!if [for %c in ($(OUTDIR)\librsvg\_rsvg_dummy.c) do @if "%~xc" == ".c" @call create-lists.bat file 
rsvg_objs.mak ^$(OUTDIR)\librsvg\%~nc.obj]
 !endif
 
 !if [call create-lists.bat footer rsvg_objs.mak]
diff --git a/win32/generate-msvc.mak b/win32/generate-msvc.mak
index ed22a20e..2acbd65a 100644
--- a/win32/generate-msvc.mak
+++ b/win32/generate-msvc.mak
@@ -3,23 +3,18 @@
 # Items in here should not need to be edited unless
 # one is maintaining the NMake build files.
 
-# Copy the pre-defined config.h.win32
-$(OUTDIR)\librsvg\config.h: config.h.win32
-       @if not exist $(@D) $(MAKE) /f Makefile.vc CFG=$(CFG) $(@D)
-       @-copy $** $@
+$(OUTDIR)\librsvg\_rsvg_dummy.c:
+       @echo Generating dummy source file...
+       @if not exist $(@D)\ mkdir $(@D) 
+       echo static int __rsvg_dummy; > $@
 
-# Create the build directories
-$(OUTDIR)\librsvg                      \
-$(OUTDIR)\rsvg-gdk-pixbuf-loader       \
-$(OUTDIR)\rsvg-tools                   \
-$(OUTDIR)\rsvg-tests:
-       @-mkdir $@
+$(OUTDIR)\librsvg\librsvg.def: .\librsvg.symbols
+       @echo Generating $@...
+       @if not exist $(@D)\ mkdir $(@D) 
+       @echo EXPORTS>$@
+       $(CC) /EP $**>>$@
 
 # Generate listing file for introspection
-$(OUTDIR)\librsvg\Rsvg_2_0_gir_list:   \
-$(librsvg_real_pub_HDRS)               \
-$(librsvg_real_extra_pub_HDRS)         \
-$(librsvg_real_SRCS)
+$(OUTDIR)\librsvg\Rsvg_2_0_gir_list: $(librsvg_real_pub_HDRS)
        @if exist $@ del $@
-       @for %%s in ($(librsvg_real_pub_HDRS) $(librsvg_real_extra_pub_HDRS)) do echo %%s >> $@
-       @for %%s in ($(librsvg_real_SRCS)) do @if "%%~xs" == ".c" echo %%s >> $@
+       @for %%s in ($**) do echo %%s >> $@
diff --git a/win32/info-msvc.mak b/win32/info-msvc.mak
index 0ad8f212..631b3d9f 100644
--- a/win32/info-msvc.mak
+++ b/win32/info-msvc.mak
@@ -20,7 +20,7 @@ build-info-librsvg:
        @echo Build Type: $(BUILD_TYPE)
        @echo.
        @echo Built Tools:
-       @for %%t in ($(RSVG_TOOLS:.exe=) $(RSVG_EXTRA_TOOLS:.exe=)) do @echo %%~nt
+       @for %%t in ($(RSVG_TOOLS:.exe=)) do @echo %%~nt
        @echo.
        @echo Introspection: $(BUILD_INTROSPECTION)
 
diff --git a/win32/install-msvc.mak b/win32/install-msvc.mak
index 06252de0..0b541bd9 100644
--- a/win32/install-msvc.mak
+++ b/win32/install-msvc.mak
@@ -8,8 +8,9 @@ install: all
        @for %%x in (dll pdb) do @copy /b $(LIBRSVG_DLL_FILENAME).%%x $(PREFIX)\bin
        @copy /b $(LIBRSVG_LIB) $(PREFIX)\lib
        @for %%x in (dll pdb) do @copy /b $(OUTDIR)\libpixbufloader-svg.%%x 
$(PREFIX)\lib\gdk-pixbuf-2.0\2.10.0\loaders
-       @for %%f in ($(RSVG_TOOLS)) do @(for %%x in (exe pdb) do @copy %%~dpnf.%%x $(PREFIX)\bin)
-       @for %%h in ($(librsvg_real_pub_HDRS) $(librsvg_real_extra_pub_HDRS)) do @copy %%h 
$(PREFIX)\include\librsvg-$(RSVG_API_VER)\librsvg\%%h
+       @copy $(OUTDIR)\rsvg-convert.exe $(PREFIX)\bin
+       @-copy $(OUTDIR)\rsvg_convert.pdb $(PREFIX)\bin
+       @for %%h in ($(librsvg_real_pub_HDRS)) do @copy %%h 
$(PREFIX)\include\librsvg-$(RSVG_API_VER)\librsvg\%%~nxh
        @set PATH=$(PREFIX)\bin;$(BINDIR);$(PATH)
        @-gdk-pixbuf-query-loaders > loaders.cache
        @for %%f in (loaders.cache) do @if %%~zf equ 0 echo *** GDK-Pixbuf loaders cache is not generated.  
Run `gdk-pixbuf-query-loaders` in your ^$(PREFIX)\bin to generate it.
diff --git a/win32/rsvg-rust.mak b/win32/rsvg-rust.mak
index 91bd798b..722f1eec 100644
--- a/win32/rsvg-rust.mak
+++ b/win32/rsvg-rust.mak
@@ -43,9 +43,9 @@ DEFAULT_TARGET = stable-$(RUST_TARGET)-pc-windows-msvc
 RUSTUP_CMD = $(RUSTUP) default $(DEFAULT_TARGET)
 
 !if "$(CFG)" == "release" || "$(CFG)" == "Release"
-CARGO_CMD = $(CARGO) build $(CARGO_TARGET) --release
+CARGO_CMD = $(CARGO) --locked build $(CARGO_TARGET) --release
 !else
-CARGO_CMD = $(CARGO) build $(CARGO_TARGET)
+CARGO_CMD = $(CARGO) --locked build $(CARGO_TARGET)
 !endif
 
 # For building the Rust bits for ARM64 Windows, or when we are building on
@@ -55,7 +55,7 @@ CARGO_CMD = $(CARGO) build $(CARGO_TARGET)
 # and the calls to cargo and therefore rustc in a temporary .bat file and use
 # 'start /i ...' to call that .bat file
 !if $(FORCE_CROSS) > 0
-build-$(PLAT)-$(CFG).bat:
+build-$(PLAT)-$(CFG).pre.bat:
        @echo @echo off>$@
        @echo set CommandPromptType=>>$@
        @echo set DevEnvDir=>>$@
@@ -93,10 +93,24 @@ build-$(PLAT)-$(CFG).bat:
        @echo if "$(__VSCMD_PREINIT_PATH)" == "" set 
PATH=c:\Windows\system;c:\Windows;c:\Windows\system32\wbem;%HOMEPATH%\.cargo\bin>>$@
        @echo set CARGO_TARGET_DIR=win32\vs$(VSVER)\$(CFG)\$(PLAT)\obj\rsvg_c_api>>$@
        @echo set GTK_LIB_DIR=$(LIBDIR)>>$@
+       @echo set SYSTEM_DEPS_LIBXML2_LIB=$(LIBXML2_LIB:.lib=)>>$@
+       @if not "$(PKG_CONFIG_PATH)" == "" echo set PKG_CONFIG_PATH=$(PKG_CONFIG_PATH)>>$@
+       @if not "$(PKG_CONFIG)" == "" echo set PKG_CONFIG=$(PKG_CONFIG)>>$@
        @echo cd ..>>$@
-       @echo $(CARGO_CMD) --verbose>>$@
 
-vs$(VSVER)\$(CFG)\$(PLAT)\obj\rsvg_c_api\$(RUST_TARGET)-pc-windows-msvc\$(CFG)\rsvg_c_api.lib: 
build-$(PLAT)-$(CFG).bat
+build-$(PLAT)-$(CFG)-lib.bat: build-$(PLAT)-$(CFG).pre.bat
+       @type $**>$@
+       @echo $(CARGO_CMD) --verbose --lib>>$@
+
+build-$(PLAT)-$(CFG)-bin.bat: build-$(PLAT)-$(CFG).pre.bat
+       @type $**>$@
+       @echo $(CARGO_CMD) --verbose --bin rsvg-convert>>$@
+
+vs$(VSVER)\$(CFG)\$(PLAT)\obj\rsvg_c_api\$(RUST_TARGET)-pc-windows-msvc\$(CFG)\librsvg.lib: 
build-$(PLAT)-$(CFG)-lib.bat
+vs$(VSVER)\$(CFG)\$(PLAT)\obj\rsvg_c_api\$(RUST_TARGET)-pc-windows-msvc\$(CFG)\rsvg-convert.exe: 
build-$(PLAT)-$(CFG)-bin.bat
+
+vs$(VSVER)\$(CFG)\$(PLAT)\obj\rsvg_c_api\$(RUST_TARGET)-pc-windows-msvc\$(CFG)\librsvg.lib     \
+vs$(VSVER)\$(CFG)\$(PLAT)\obj\rsvg_c_api\$(RUST_TARGET)-pc-windows-msvc\$(CFG)\rsvg-convert.exe:
        @echo Please do not manually close the command window that pops up...
        @echo.
        @echo If this fails due to LNK1112 or a linker executable cannot be found, run
@@ -104,16 +118,32 @@ vs$(VSVER)\$(CFG)\$(PLAT)\obj\rsvg_c_api\$(RUST_TARGET)-pc-windows-msvc\$(CFG)\r
        @echo and then run 'start /i /wait cmd /c $**', and then continue
        @echo the build with your original NMake command line.
        @start "Building the Rust bits for $(PLAT) Windows MSVC Build, please do not close this console 
window..." /wait /i cmd /c $**
-       @del /f/q $**
 
 !else
-vs$(VSVER)\$(CFG)\$(PLAT)\obj\rsvg_c_api\$(RUST_TARGET)-pc-windows-msvc\$(CFG)\rsvg_c_api.lib:
+vs$(VSVER)\$(CFG)\$(PLAT)\obj\rsvg_c_api\$(RUST_TARGET)-pc-windows-msvc\$(CFG)\librsvg.lib:
+       @set PATH=%PATH%;%HOMEPATH%\.cargo\bin
+       @set CARGO_TARGET_DIR=win32\vs$(VSVER)\$(CFG)\$(PLAT)\obj\rsvg_c_api
+       @set GTK_LIB_DIR=$(LIBDIR);$(LIB)
+       @set SYSTEM_DEPS_LIBXML2_LIB=$(LIBXML2_LIB:.lib=)
+       @if not "$(PKG_CONFIG_PATH)" == "" set PKG_CONFIG_PATH=$(PKG_CONFIG_PATH)
+       @if not "$(PKG_CONFIG)" == "" set PKG_CONFIG=$(PKG_CONFIG)
+       $(RUSTUP_CMD)
+       @cd ..
+       $(CARGO_CMD) --verbose --lib
+       @cd win32
+       @set GTK_LIB_DIR=
+       @set CARGO_TARGET_DIR=
+
+vs$(VSVER)\$(CFG)\$(PLAT)\obj\rsvg_c_api\$(RUST_TARGET)-pc-windows-msvc\$(CFG)\rsvg-convert.exe:
        @set PATH=%PATH%;%HOMEPATH%\.cargo\bin
        @set CARGO_TARGET_DIR=win32\vs$(VSVER)\$(CFG)\$(PLAT)\obj\rsvg_c_api
        @set GTK_LIB_DIR=$(LIBDIR);$(LIB)
+       @set SYSTEM_DEPS_LIBXML2_LIB=$(LIBXML2_LIB:.lib=)
+       @if not "$(PKG_CONFIG_PATH)" == "" set PKG_CONFIG_PATH=$(PKG_CONFIG_PATH)
+       @if not "$(PKG_CONFIG)" == "" set PKG_CONFIG=$(PKG_CONFIG)
        $(RUSTUP_CMD)
        @cd ..
-       $(CARGO_CMD) --verbose
+       $(CARGO_CMD) --verbose --bin $(@B)
        @cd win32
        @set GTK_LIB_DIR=
        @set CARGO_TARGET_DIR=


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]