[pangomm/master.msvc.improvements] NMake Makefiles: Split outdir and intdir by toolset version



commit 99227c1edc4e73c1936961c63d530a66e989c80e
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Fri Feb 21 17:44:24 2020 +0800

    NMake Makefiles: Split outdir and intdir by toolset version
    
    This avoids confusion and mixups when different toolset versions are
    being used, and ensure better that the same toolset is used throughout.

 MSVC_NMake/build-rules-msvc.mak  | 49 ++++++++++++++++++++--------------------
 MSVC_NMake/config-msvc.mak       |  6 ++---
 MSVC_NMake/create-lists-msvc.mak |  6 ++---
 MSVC_NMake/generate-msvc.mak     |  8 +++----
 MSVC_NMake/install.mak           |  6 ++---
 5 files changed, 38 insertions(+), 37 deletions(-)
---
diff --git a/MSVC_NMake/build-rules-msvc.mak b/MSVC_NMake/build-rules-msvc.mak
index fef3e33..1f72955 100644
--- a/MSVC_NMake/build-rules-msvc.mak
+++ b/MSVC_NMake/build-rules-msvc.mak
@@ -13,20 +13,20 @@
 #      $(CC)|$(CXX) $(cflags) /Fo$(destdir) /c @<<
 # $<
 # <<
-{..\pango\pangomm\}.cc{$(CFG)\$(PLAT)\pangomm\}.obj::
-       $(CXX) $(LIBPANGOMM_CFLAGS) $(CFLAGS_NOGL) /Fo$(CFG)\$(PLAT)\pangomm\ /c @<<
+{..\pango\pangomm\}.cc{vs$(VSVER)\$(CFG)\$(PLAT)\pangomm\}.obj::
+       $(CXX) $(LIBPANGOMM_CFLAGS) $(CFLAGS_NOGL) /Fovs$(VSVER)\$(CFG)\$(PLAT)\pangomm\ 
/Fdvs$(VSVER)\$(CFG)\$(PLAT)\pangomm\ /c @<<
 $<
 <<
 
-{..\untracked\pango\pangomm\}.cc{$(CFG)\$(PLAT)\pangomm\}.obj::
-       $(CXX) $(LIBPANGOMM_CFLAGS) $(CFLAGS_NOGL) /Fo$(CFG)\$(PLAT)\pangomm\ /c @<<
+{..\untracked\pango\pangomm\}.cc{vs$(VSVER)\$(CFG)\$(PLAT)\pangomm\}.obj::
+       $(CXX) $(LIBPANGOMM_CFLAGS) $(CFLAGS_NOGL) /Fovs$(VSVER)\$(CFG)\$(PLAT)\pangomm\ 
/Fdvs$(VSVER)\$(CFG)\$(PLAT)\pangomm\ /c @<<
 $<
 <<
 
-{.\pangomm\}.rc{$(CFG)\$(PLAT)\pangomm\}.res:
+{.\pangomm\}.rc{vs$(VSVER)\$(CFG)\$(PLAT)\pangomm\}.res:
        rc /fo$@ $<
 
-{..\untracked\MSVC_NMake\pangomm\}.rc{$(CFG)\$(PLAT)\pangomm\}.res:
+{..\untracked\MSVC_NMake\pangomm\}.rc{vs$(VSVER)\$(CFG)\$(PLAT)\pangomm\}.res:
        rc /fo$@ $<
 
 # Rules for building .lib files
@@ -39,8 +39,8 @@ $(PANGOMM_LIB): $(PANGOMM_DLL)
 # $(dependent_objects)
 # <<
 #      @-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;2
-$(PANGOMM_DLL): $(CFG)\$(PLAT)\pangomm\pangomm.def $(pangomm_OBJS)
-       link /DLL $(LDFLAGS_NOLTCG) $(PANGOMM_DEP_LIBS) /implib:$(PANGOMM_LIB) 
/def:$(CFG)\$(PLAT)\pangomm\pangomm.def -out:$@ @<<
+$(PANGOMM_DLL): vs$(VSVER)\$(CFG)\$(PLAT)\pangomm\pangomm.def $(pangomm_OBJS)
+       link /DLL $(LDFLAGS_NOLTCG) $(PANGOMM_DEP_LIBS) /implib:$(PANGOMM_LIB) /def:$(@D)\pangomm\pangomm.def 
-out:$@ @<<
 $(pangomm_OBJS)
 <<
 
@@ -55,21 +55,22 @@ $(pangomm_OBJS)
 #      @-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;1
 
 # For the gendef tool
-{.\gendef\}.cc{$(CFG)\$(PLAT)\}.exe:
-       @if not exist $(CFG)\$(PLAT)\gendef\ $(MAKE) -f Makefile.vc CFG=$(CFG) $(CFG)\$(PLAT)\gendef
-       $(CXX) $(PANGOMM_BASE_CFLAGS) $(CFLAGS) /Fo$(CFG)\$(PLAT)\gendef\ $< /link $(LDFLAGS) /out:$@
+{.\gendef\}.cc{vs$(VSVER)\$(CFG)\$(PLAT)\}.exe:
+       @if not exist vs$(VSVER)\$(CFG)\$(PLAT)\gendef\ $(MAKE) -f Makefile.vc CFG=$(CFG) 
vs$(VSVER)\$(CFG)\$(PLAT)\gendef
+       $(CXX) $(PANGOMM_BASE_CFLAGS) $(CFLAGS) /Fo$(@D)\gendef\ /Fd$(@D)\gendef\ $< /link $(LDFLAGS) /out:$@
 
 clean:
-       @-del /f /q $(CFG)\$(PLAT)\*.exe
-       @-del /f /q $(CFG)\$(PLAT)\*.dll
-       @-del /f /q $(CFG)\$(PLAT)\*.pdb
-       @-del /f /q $(CFG)\$(PLAT)\*.ilk
-       @-del /f /q $(CFG)\$(PLAT)\*.exp
-       @-del /f /q $(CFG)\$(PLAT)\*.lib
-       @-del /f /q $(CFG)\$(PLAT)\pangomm\*.def
-       @-del /f /q $(CFG)\$(PLAT)\pangomm\*.res
-       @-del /f /q $(CFG)\$(PLAT)\pangomm\*.obj
-       @-del /f /q $(CFG)\$(PLAT)\gendef\*.obj
-       @-rd $(CFG)\$(PLAT)\pangomm
-       @-rd $(CFG)\$(PLAT)\gendef
-       @-del /f /q vc$(PDBVER)0.pdb
+       @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\*.exe
+       @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\*.dll
+       @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\*.pdb
+       @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\*.ilk
+       @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\*.exp
+       @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\*.lib
+       @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\pangomm\*.def
+       @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\pangomm\*.res
+       @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\pangomm\*.pdb
+       @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\pangomm\*.obj
+       @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\gendef\*.pdb
+       @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\gendef\*.obj
+       @-rd vs$(VSVER)\$(CFG)\$(PLAT)\pangomm
+       @-rd vs$(VSVER)\$(CFG)\$(PLAT)\gendef
diff --git a/MSVC_NMake/config-msvc.mak b/MSVC_NMake/config-msvc.mak
index 07f10b5..d3a33b3 100644
--- a/MSVC_NMake/config-msvc.mak
+++ b/MSVC_NMake/config-msvc.mak
@@ -68,10 +68,10 @@ CAIROMM_LIB = $(CAIROMM_LIBNAME).lib
 
 PANGOMM_LIBNAME = pangomm-vc$(VSVER)0$(DEBUG_SUFFIX)-$(PANGOMM_MAJOR_VERSION)_$(PANGOMM_MINOR_VERSION)
 
-PANGOMM_DLL = $(CFG)\$(PLAT)\$(PANGOMM_LIBNAME).dll
-PANGOMM_LIB = $(CFG)\$(PLAT)\$(PANGOMM_LIBNAME).lib
+PANGOMM_DLL = vs$(VSVER)\$(CFG)\$(PLAT)\$(PANGOMM_LIBNAME).dll
+PANGOMM_LIB = vs$(VSVER)\$(CFG)\$(PLAT)\$(PANGOMM_LIBNAME).lib
 
-GENDEF = $(CFG)\$(PLAT)\gendef.exe
+GENDEF = vs$(VSVER)\$(CFG)\$(PLAT)\gendef.exe
 GOBJECT_LIBS = gobject-2.0.lib gmodule-2.0.lib glib-2.0.lib
 
 CAIRO_LIB = cairo.lib
diff --git a/MSVC_NMake/create-lists-msvc.mak b/MSVC_NMake/create-lists-msvc.mak
index cdd52e4..8ff561c 100644
--- a/MSVC_NMake/create-lists-msvc.mak
+++ b/MSVC_NMake/create-lists-msvc.mak
@@ -40,13 +40,13 @@ pangomm_generated_private_headers = $(files_hg:.hg=_p.h)
 !if [call create-lists.bat header pangomm.mak pangomm_OBJS]
 !endif
 
-!if [for %c in ($(files_built_cc)) do @if "%~xc" == ".cc" @call create-lists.bat file pangomm.mak 
^$(CFG)\^$(PLAT)\pangomm\%~nc.obj]
+!if [for %c in ($(files_built_cc)) do @if "%~xc" == ".cc" @call create-lists.bat file pangomm.mak 
vs^$(VSVER)\^$(CFG)\^$(PLAT)\pangomm\%~nc.obj]
 !endif
 
-!if [for %c in ($(files_extra_cc)) do @if "%~xc" == ".cc" @call create-lists.bat file pangomm.mak 
^$(CFG)\^$(PLAT)\pangomm\%~nc.obj]
+!if [for %c in ($(files_extra_cc)) do @if "%~xc" == ".cc" @call create-lists.bat file pangomm.mak 
vs^$(VSVER)\^$(CFG)\^$(PLAT)\pangomm\%~nc.obj]
 !endif
 
-!if [@call create-lists.bat file pangomm.mak ^$(CFG)\^$(PLAT)\pangomm\pangomm.res]
+!if [@call create-lists.bat file pangomm.mak vs^$(VSVER)\^$(CFG)\^$(PLAT)\pangomm\pangomm.res]
 !endif
 
 !if [call create-lists.bat footer pangomm.mak]
diff --git a/MSVC_NMake/generate-msvc.mak b/MSVC_NMake/generate-msvc.mak
index 5c857ae..9870a1e 100644
--- a/MSVC_NMake/generate-msvc.mak
+++ b/MSVC_NMake/generate-msvc.mak
@@ -4,10 +4,10 @@
 # one is maintaining the NMake build files.
 
 # Create the build directories
-$(CFG)\$(PLAT)\gendef  \
-$(CFG)\$(PLAT)\pangomm:
+vs$(VSVER)\$(CFG)\$(PLAT)\gendef       \
+vs$(VSVER)\$(CFG)\$(PLAT)\pangomm:
        @-mkdir $@
 
 # Generate .def files
-$(CFG)\$(PLAT)\pangomm\pangomm.def: $(GENDEF) $(CFG)\$(PLAT)\pangomm $(pangomm_OBJS)
-       $(CFG)\$(PLAT)\gendef.exe $@ $(PANGOMM_LIBNAME) $(CFG)\$(PLAT)\pangomm\*.obj
+vs$(VSVER)\$(CFG)\$(PLAT)\pangomm\pangomm.def: $(GENDEF) vs$(VSVER)\$(CFG)\$(PLAT)\pangomm $(pangomm_OBJS)
+       vs$(VSVER)\$(CFG)\$(PLAT)\gendef.exe $@ $(PANGOMM_LIBNAME) vs$(VSVER)\$(CFG)\$(PLAT)\pangomm\*.obj
diff --git a/MSVC_NMake/install.mak b/MSVC_NMake/install.mak
index 47bb220..663fa85 100644
--- a/MSVC_NMake/install.mak
+++ b/MSVC_NMake/install.mak
@@ -5,9 +5,9 @@ install: all
        @if not exist $(PREFIX)\bin\ mkdir $(PREFIX)\bin
        @if not exist $(PREFIX)\lib\pangomm-$(PANGOMM_MAJOR_VERSION).$(PANGOMM_MINOR_VERSION)\include\ mkdir 
$(PREFIX)\lib\pangomm-$(PANGOMM_MAJOR_VERSION).$(PANGOMM_MINOR_VERSION)\include
        @if not exist 
$(PREFIX)\include\pangomm-$(PANGOMM_MAJOR_VERSION).$(PANGOMM_MINOR_VERSION)\pangomm\private\ @mkdir 
$(PREFIX)\include\pangomm-$(PANGOMM_MAJOR_VERSION).$(PANGOMM_MINOR_VERSION)\pangomm\private
-       @copy /b $(CFG)\$(PLAT)\$(PANGOMM_LIBNAME).dll $(PREFIX)\bin
-       @copy /b $(CFG)\$(PLAT)\$(PANGOMM_LIBNAME).pdb $(PREFIX)\bin
-       @copy /b $(CFG)\$(PLAT)\$(PANGOMM_LIBNAME).lib $(PREFIX)\lib
+       @copy /b vs$(VSVER)\$(CFG)\$(PLAT)\$(PANGOMM_LIBNAME).dll $(PREFIX)\bin
+       @copy /b vs$(VSVER)\$(CFG)\$(PLAT)\$(PANGOMM_LIBNAME).pdb $(PREFIX)\bin
+       @copy /b vs$(VSVER)\$(CFG)\$(PLAT)\$(PANGOMM_LIBNAME).lib $(PREFIX)\lib
        @copy ..\pango\pangomm.h 
"$(PREFIX)\include\pangomm-$(PANGOMM_MAJOR_VERSION).$(PANGOMM_MINOR_VERSION)\"
        @for %h in ($(files_built_h) $(files_extra_h)) do @copy ..\pango\pangomm\%h 
"$(PREFIX)\include\pangomm-$(PANGOMM_MAJOR_VERSION).$(PANGOMM_MINOR_VERSION)\pangomm\%h"
        @for %h in ($(pangomm_generated_private_headers)) do @copy ..\pango\pangomm\private\%h 
"$(PREFIX)\include\pangomm-$(PANGOMM_MAJOR_VERSION).$(PANGOMM_MINOR_VERSION)\pangomm\private\%h"


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