[pangomm] NMake Makefiles: Separate outdir and intdir by toolset version
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pangomm] NMake Makefiles: Separate outdir and intdir by toolset version
- Date: Thu, 27 Feb 2020 09:46:59 +0000 (UTC)
commit 8d58ba7539147059ca95a24b2e9831eb47633ee2
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Thu Feb 27 16:46:40 2020 +0800
NMake Makefiles: Separate outdir and intdir by toolset version
This reduces the chances of builds by different Visual Studio versions become
mixed up with other versions, and makes the build tree cleaner. Note that
Visaul Studio 2015 through 2019 are treated as the same toolset version since
they link to the same CRT.
.gitignore | 1 +
MSVC_NMake/build-rules-msvc.mak | 68 ++++++++++++++++++++--------------------
MSVC_NMake/config-msvc.mak | 19 ++++++-----
MSVC_NMake/create-lists-msvc.mak | 6 ++--
MSVC_NMake/generate-msvc.mak | 12 +++----
MSVC_NMake/install.mak | 10 +++---
6 files changed, 60 insertions(+), 56 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 7b930fe..64d3910 100644
--- a/.gitignore
+++ b/.gitignore
@@ -25,6 +25,7 @@ stamp-h?
/tools/extra_defs_gen/generate_extra_defs
/MSVC_NMake/pangomm/pangomm.rc
/MSVC_NMake/pangomm/pangommconfig.h
+/MSVC_NMake/pkg-ver.mak
untracked/build_scripts/
untracked/docs/
untracked/pango/
diff --git a/MSVC_NMake/build-rules-msvc.mak b/MSVC_NMake/build-rules-msvc.mak
index 2a61506..c4d488e 100644
--- a/MSVC_NMake/build-rules-msvc.mak
+++ b/MSVC_NMake/build-rules-msvc.mak
@@ -13,28 +13,28 @@
# $(CC)|$(CXX) $(cflags) /Fo$(destdir) /c @<<
# $<
# <<
-{$(CFG)\$(PLAT)\pangomm\}.cc{$(CFG)\$(PLAT)\pangomm\}.obj::
- $(CXX) $(PANGOMM_CFLAGS) $(CFLAGS_NOGL) /Fo$(CFG)\$(PLAT)\pangomm\ /c @<<
+{vs$(VSVER)\$(CFG)\$(PLAT)\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) $(PANGOMM_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 @<<
$<
<<
-{..\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 @<<
$<
-<<
-{..\pango\src\}.ccg{$(CFG)\$(PLAT)\pangomm\}.obj:
+{..\pango\src\}.ccg{vs$(VSVER)\$(CFG)\$(PLAT)\pangomm\}.obj:
@if not exist $(@D)\private\ $(MAKE) /f Makefile.vc CFG=$(CFG) $(@D)\private
@for %%s in ($(<D)\*.ccg) do @if not exist ..\pango\pangomm\%%~ns.cc if not exist $(@D)\%%~ns.cc
$(PERL) -- $(GMMPROC_DIR)/gmmproc -I ../tools/m4 --defs $(<D:\=/) %%~ns $(<D:\=/) $(@D)
- @if exist $(@D)\$(<B).cc $(CXX) $(PANGOMM_CFLAGS) $(CFLAGS_NOGL) /Fo$(@D)\ /c $(@D)\$(<B).cc
- @if exist ..\pango\pangomm\$(<B).cc $(CXX) $(PANGOMM_CFLAGS) $(CFLAGS_NOGL) /Fo$(@D)\ /c
..\pango\pangomm\$(<B).cc
+ @if exist $(@D)\$(<B).cc $(CXX) $(LIBPANGOMM_CFLAGS) $(CFLAGS_NOGL) /Fo$(@D)\ /Fd$(@D)\ /c
$(@D)\$(<B).cc
+ @if exist ..\pango\pangomm\$(<B).cc $(CXX) $(LIBPANGOMM_CFLAGS) $(CFLAGS_NOGL) /Fo$(@D)\ /Fd$(@D)\ /c
..\pango\pangomm\$(<B).cc
+ @if exist ..\untracked\pango\pangomm\$(<B).cc $(CXX) $(LIBPANGOMM_CFLAGS) $(CFLAGS_NOGL) /Fo$(@D)\
/Fd$(@D)\ /c ..\pango\pangomm\$(<B).cc
-{.\pangomm\}.rc{$(CFG)\$(PLAT)\pangomm\}.res:
+{.\pangomm\}.rc{vs$(VSVER)\$(CFG)\$(PLAT)\pangomm\}.res:
rc /fo$@ $<
# Rules for building .lib files
@@ -47,8 +47,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:vs$(VSVER)\$(CFG)\$(PLAT)\pangomm\pangomm.def -out:$@ @<<
$(pangomm_OBJS)
<<
@@ -63,28 +63,28 @@ $(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)\pangomm\private\*.h
- @-del /f /q $(CFG)\$(PLAT)\pangomm\*.h
- @-del /f /q $(CFG)\$(PLAT)\pangomm\*.cc
- @-del /f /q $(CFG)\$(PLAT)\gendef\*.obj
- @-rd $(CFG)\$(PLAT)\pangomm\private
- @-rd $(CFG)\$(PLAT)\pangomm
- @-rd $(CFG)\$(PLAT)\gendef
- @-del pkg-ver.mak
- @-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)\pangomm\private\*.h
+ @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\pangomm\*.h
+ @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\pangomm\*.cc
+ @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\gendef\*.pdb
+ @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\gendef\*.obj
+ @-rd vs$(VSVER)\$(CFG)\$(PLAT)\pangomm\private
+ @-rd vs$(VSVER)\$(CFG)\$(PLAT)\pangomm
+ @-rd vs$(VSVER)\$(CFG)\$(PLAT)\gendef
.SUFFIXES: .cc .h .ccg .hg .obj
diff --git a/MSVC_NMake/config-msvc.mak b/MSVC_NMake/config-msvc.mak
index 81e44fc..b1e535d 100644
--- a/MSVC_NMake/config-msvc.mak
+++ b/MSVC_NMake/config-msvc.mak
@@ -24,8 +24,12 @@ DEBUG_SUFFIX = -d
DEBUG_SUFFIX =
!endif
-PANGOMM_BASE_CFLAGS = \
- /I$(CFG)\$(PLAT) \
+!ifndef GMMPROC_DIR
+GMMPROC_DIR=$(PREFIX)\share\glibmm-$(GLIBMM_MAJOR_VERSION).$(GLIBMM_MINOR_VERSION)\proc
+!endif
+
+PANGOMM_BASE_CFLAGS = \
+ /Ivs$(VSVER)\$(CFG)\$(PLAT) \
/I..\pango /I..\pango\pangomm /I.\pangomm \
/wd4530 /std:c++17 \
/FImsvc_recommended_pragmas.h
@@ -63,12 +67,11 @@ 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
-
-GENDEF = $(CFG)\$(PLAT)\gendef.exe
-GOBJECT_LIBS = gobject-2.0.lib gmodule-2.0.lib glib-2.0.lib
+PANGOMM_DLL = vs$(VSVER)\$(CFG)\$(PLAT)\$(PANGOMM_LIBNAME).dll
+PANGOMM_LIB = vs$(VSVER)\$(CFG)\$(PLAT)\$(PANGOMM_LIBNAME).lib
+GENDEF = vs$(VSVER)\$(CFG)\$(PLAT)\gendef.exe
+GOBJECT_LIBS = gobject-$(GLIB_API_VERSION).lib glib-$(GLIB_API_VERSION).lib
CAIRO_LIB = cairo.lib
-PANGO_LIBS = pangocairo-1.0.lib pango-1.0.lib $(GOBJECT_LIBS) $(CAIRO_LIB)
+PANGO_LIBS = pangocairo-$(PANGO_API_VERSION).lib pango-$(PANGO_API_VERSION).lib $(GOBJECT_LIBS) $(CAIRO_LIB)
PANGOMM_DEP_LIBS = $(GLIBMM_LIB) $(CAIROMM_LIB) $(LIBSIGC_LIB) $(PANGO_LIBS)
diff --git a/MSVC_NMake/create-lists-msvc.mak b/MSVC_NMake/create-lists-msvc.mak
index 49289c7..3ab1b5a 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 2c46858..53991a6 100644
--- a/MSVC_NMake/generate-msvc.mak
+++ b/MSVC_NMake/generate-msvc.mak
@@ -4,17 +4,17 @@
# one is maintaining the NMake build files.
# Create the build directories
-$(CFG)\$(PLAT)\gendef \
-$(CFG)\$(PLAT)\pangomm \
-$(CFG)\$(PLAT)\pangomm\private:
+vs$(VSVER)\$(CFG)\$(PLAT)\gendef \
+vs$(VSVER)\$(CFG)\$(PLAT)\pangomm \
+vs$(VSVER)\$(CFG)\$(PLAT)\pangomm\private:
@-md $@
# 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
# Generate wrap_init.cc files
-$(CFG)\$(PLAT)\pangomm\wrap_init.cc: $(pangomm_real_hg)
+vs$(VSVER)\$(CFG)\$(PLAT)\pangomm\wrap_init.cc: $(pangomm_real_hg)
@if not exist ..\pango\pangomm\wrap_init.cc $(PERL) -- "$(GMMPROC_DIR)/generate_wrap_init.pl"
--namespace=Pango --parent_dir=pangomm $(pangomm_real_hg:\=/)>$@
# Generate pre-generated resources and configuration headers (builds from GIT)
diff --git a/MSVC_NMake/install.mak b/MSVC_NMake/install.mak
index 5b0e6bf..8605b35 100644
--- a/MSVC_NMake/install.mak
+++ b/MSVC_NMake/install.mak
@@ -6,15 +6,15 @@ install: all
@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
@if not exist $(PREFIX)\share\pangomm-$(PANGOMM_MAJOR_VERSION).$(PANGOMM_MINOR_VERSION)\proc\m4\
@mkdir $(PREFIX)\share\pangomm-$(PANGOMM_MAJOR_VERSION).$(PANGOMM_MINOR_VERSION)\proc\m4
- @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 @if exist ..\untracked\pango\pangomm\%h copy
..\untracked\pango\pangomm\%h
"$(PREFIX)\include\pangomm-$(PANGOMM_MAJOR_VERSION).$(PANGOMM_MINOR_VERSION)\pangomm\%h"
@for %h in ($(files_built_h) $(files_extra_h)) do @if exist ..\pango\pangomm\%h if not exist
..\untracked\pango\pangomm\%h copy ..\pango\pangomm\%h
"$(PREFIX)\include\pangomm-$(PANGOMM_MAJOR_VERSION).$(PANGOMM_MINOR_VERSION)\pangomm\%h"
- @for %h in ($(files_built_h) $(files_extra_h)) do @if exist $(CFG)\$(PLAT)\pangomm\%h copy
$(CFG)\$(PLAT)\pangomm\%h
"$(PREFIX)\include\pangomm-$(PANGOMM_MAJOR_VERSION).$(PANGOMM_MINOR_VERSION)\pangomm\%h"
+ @for %h in ($(files_built_h) $(files_extra_h)) do @if exist vs$(VSVER)\$(CFG)\$(PLAT)\pangomm\%h copy
vs$(VSVER)\$(CFG)\$(PLAT)\pangomm\%h
"$(PREFIX)\include\pangomm-$(PANGOMM_MAJOR_VERSION).$(PANGOMM_MINOR_VERSION)\pangomm\%h"
@for %h in ($(pangomm_generated_private_headers)) do @if exist ..\untracked\pango\pangomm\private\%h
copy ..\pango\pangomm\private\%h
"$(PREFIX)\include\pangomm-$(PANGOMM_MAJOR_VERSION).$(PANGOMM_MINOR_VERSION)\pangomm\private\%h"
@for %h in ($(pangomm_generated_private_headers)) do @if exist ..\pango\pangomm\private\%h if not
exist ..\untracked\pango\pangomm\private\%h copy ..\pango\pangomm\private\%h
"$(PREFIX)\include\pangomm-$(PANGOMM_MAJOR_VERSION).$(PANGOMM_MINOR_VERSION)\pangomm\private\%h"
- @for %h in ($(pangomm_generated_private_headers)) do @if exist $(CFG)\$(PLAT)\pangomm\private\%h copy
$(CFG)\$(PLAT)\pangomm\private\%h
"$(PREFIX)\include\pangomm-$(PANGOMM_MAJOR_VERSION).$(PANGOMM_MINOR_VERSION)\pangomm\private\%h"
+ @for %h in ($(pangomm_generated_private_headers)) do @if exist
vs$(VSVER)\$(CFG)\$(PLAT)\pangomm\private\%h copy vs$(VSVER)\$(CFG)\$(PLAT)\pangomm\private\%h
"$(PREFIX)\include\pangomm-$(PANGOMM_MAJOR_VERSION).$(PANGOMM_MINOR_VERSION)\pangomm\private\%h"
@copy ".\pangomm\pangommconfig.h"
"$(PREFIX)\lib\pangomm-$(PANGOMM_MAJOR_VERSION).$(PANGOMM_MINOR_VERSION)\include\"
@copy ..\tools\m4\*.m4
$(PREFIX)\share\pangomm-$(PANGOMM_MAJOR_VERSION).$(PANGOMM_MINOR_VERSION)\proc\m4
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]