[pangomm/pangomm-2-42] 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/pangomm-2-42] NMake Makefiles: Separate outdir and intdir by toolset version
- Date: Thu, 27 Feb 2020 08:49:47 +0000 (UTC)
commit 47bacb367d2704867f3df78cb7424c537cc998fa
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 | 67 ++++++++++++++++++++--------------------
MSVC_NMake/config-msvc.mak | 8 ++---
MSVC_NMake/create-lists-msvc.mak | 6 ++--
MSVC_NMake/detectenv-msvc.mak | 2 +-
MSVC_NMake/generate-msvc.mak | 12 +++----
MSVC_NMake/info-msvc.mak | 2 +-
MSVC_NMake/install.mak | 10 +++---
8 files changed, 55 insertions(+), 53 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 39ec259..b49f588 100644
--- a/MSVC_NMake/build-rules-msvc.mak
+++ b/MSVC_NMake/build-rules-msvc.mak
@@ -13,28 +13,29 @@
# $(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$(PDBVER)\$(CFG)\$(PLAT)\pangomm\}.cc{vs$(PDBVER)\$(CFG)\$(PLAT)\pangomm\}.obj::
+ $(CXX) $(PANGOMM_CFLAGS) $(CFLAGS_NOGL) /Fovs$(PDBVER)\$(CFG)\$(PLAT)\pangomm\
/Fdvs$(PDBVER)\$(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$(PDBVER)\$(CFG)\$(PLAT)\pangomm\}.obj::
+ $(CXX) $(PANGOMM_CFLAGS) $(CFLAGS_NOGL) /Fovs$(PDBVER)\$(CFG)\$(PLAT)\pangomm\
/Fdvs$(PDBVER)\$(CFG)\$(PLAT)\pangomm\ /c @<<
$<
<<
-{..\pango\pangomm\}.cc{$(CFG)\$(PLAT)\pangomm\}.obj::
- $(CXX) $(PANGOMM_CFLAGS) $(CFLAGS_NOGL) /Fo$(CFG)\$(PLAT)\pangomm\ /c @<<
+{..\pango\pangomm\}.cc{vs$(PDBVER)\$(CFG)\$(PLAT)\pangomm\}.obj::
+ $(CXX) $(PANGOMM_CFLAGS) $(CFLAGS_NOGL) /Fovs$(PDBVER)\$(CFG)\$(PLAT)\pangomm\
/Fdvs$(PDBVER)\$(CFG)\$(PLAT)\pangomm\ /c @<<
$<
<<
-{..\pango\src\}.ccg{$(CFG)\$(PLAT)\pangomm\}.obj:
+{..\pango\src\}.ccg{vs$(PDBVER)\$(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) $(PANGOMM_CFLAGS) $(CFLAGS_NOGL) /Fo$(@D)\ /Fd$(@D)\ /c $(@D)\$(<B).cc
+ @if exist ..\pango\pangomm\$(<B).cc $(CXX) $(PANGOMM_CFLAGS) $(CFLAGS_NOGL) /Fo$(@D)\ /Fd$(@D)\ /c
..\pango\pangomm\$(<B).cc
+ @if exist ..\untracked\pango\pangomm\$(<B).cc $(CXX) $(PANGOMM_CFLAGS) $(CFLAGS_NOGL) /Fo$(@D)\
/Fd$(@D)\ /c ..\pango\pangomm\$(<B).cc
-{.\pangomm\}.rc{$(CFG)\$(PLAT)\pangomm\}.res:
+{.\pangomm\}.rc{vs$(PDBVER)\$(CFG)\$(PLAT)\pangomm\}.res:
rc /fo$@ $<
# Rules for building .lib files
@@ -47,8 +48,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) $(PANGO_LIBS) $(CAIROMM_LIB) $(GLIBMM_LIB) $(LIBSIGC_LIB)
/implib:$(PANGOMM_LIB) /def:$(CFG)\$(PLAT)\pangomm\pangomm.def -out:$@ @<<
+$(PANGOMM_DLL): vs$(PDBVER)\$(CFG)\$(PLAT)\pangomm\pangomm.def $(pangomm_OBJS)
+ link /DLL $(LDFLAGS_NOLTCG) $(PANGO_LIBS) $(CAIROMM_LIB) $(GLIBMM_LIB) $(LIBSIGC_LIB)
/implib:$(PANGOMM_LIB) /def:vs$(PDBVER)\$(CFG)\$(PLAT)\pangomm\pangomm.def -out:$@ @<<
$(pangomm_OBJS)
<<
@-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;2
@@ -62,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$(PDBVER)\$(CFG)\$(PLAT)\}.exe:
+ @if not exist vs$(PDBVER)\$(CFG)\$(PLAT)\gendef\ $(MAKE) -f Makefile.vc CFG=$(CFG)
vs$(PDBVER)\$(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$(PDBVER)\$(CFG)\$(PLAT)\*.exe
+ @-del /f /q vs$(PDBVER)\$(CFG)\$(PLAT)\*.dll
+ @-del /f /q vs$(PDBVER)\$(CFG)\$(PLAT)\*.pdb
+ @-del /f /q vs$(PDBVER)\$(CFG)\$(PLAT)\*.ilk
+ @-del /f /q vs$(PDBVER)\$(CFG)\$(PLAT)\*.exp
+ @-del /f /q vs$(PDBVER)\$(CFG)\$(PLAT)\*.lib
+ @-del /f /q vs$(PDBVER)\$(CFG)\$(PLAT)\pangomm\*.def
+ @-del /f /q vs$(PDBVER)\$(CFG)\$(PLAT)\pangomm\*.res
+ @-del /f /q vs$(PDBVER)\$(CFG)\$(PLAT)\pangomm\*.pdb
+ @-del /f /q vs$(PDBVER)\$(CFG)\$(PLAT)\pangomm\*.obj
+ @-del /f /q vs$(PDBVER)\$(CFG)\$(PLAT)\pangomm\private\*.h
+ @-del /f /q vs$(PDBVER)\$(CFG)\$(PLAT)\pangomm\*.h
+ @-del /f /q vs$(PDBVER)\$(CFG)\$(PLAT)\pangomm\*.cc
+ @-del /f /q vs$(PDBVER)\$(CFG)\$(PLAT)\gendef\*.pdb
+ @-del /f /q vs$(PDBVER)\$(CFG)\$(PLAT)\gendef\*.obj
+ @-rd vs$(PDBVER)\$(CFG)\$(PLAT)\pangomm\private
+ @-rd vs$(PDBVER)\$(CFG)\$(PLAT)\pangomm
+ @-rd vs$(PDBVER)\$(CFG)\$(PLAT)\gendef
.SUFFIXES: .cc .h .ccg .hg .obj
diff --git a/MSVC_NMake/config-msvc.mak b/MSVC_NMake/config-msvc.mak
index f355886..c2b7eaf 100644
--- a/MSVC_NMake/config-msvc.mak
+++ b/MSVC_NMake/config-msvc.mak
@@ -30,7 +30,7 @@ GMMPROC_DIR=$(PREFIX)\share\glibmm-$(GLIBMM_MAJOR_VERSION).$(GLIBMM_MINOR_VERSIO
!endif
PANGOMM_BASE_CFLAGS = \
- /I$(CFG)\$(PLAT) \
+ /Ivs$(PDBVER)\$(CFG)\$(PLAT) \
/I..\pango /I..\pango\pangomm /I.\pangomm \
/wd4530 /EHsc \
/FImsvc_recommended_pragmas.h
@@ -64,10 +64,10 @@ LIBSIGC_LIB = $(LIBSIGC_LIBNAME).lib
PANGOMM_LIBNAME = pangomm-vc$(PDBVER)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$(PDBVER)\$(CFG)\$(PLAT)\$(PANGOMM_LIBNAME).dll
+PANGOMM_LIB = vs$(PDBVER)\$(CFG)\$(PLAT)\$(PANGOMM_LIBNAME).lib
-GENDEF = $(CFG)\$(PLAT)\gendef.exe
+GENDEF = vs$(PDBVER)\$(CFG)\$(PLAT)\gendef.exe
GOBJECT_LIBS = gobject-$(GLIB_API_VERSION).lib glib-$(GLIB_API_VERSION).lib
PANGO_LIBS = pangocairo-$(PANGO_API_VERSION).lib pango-$(PANGO_API_VERSION).lib $(GOBJECT_LIBS) cairo.lib
diff --git a/MSVC_NMake/create-lists-msvc.mak b/MSVC_NMake/create-lists-msvc.mak
index 48bba62..8646f3b 100644
--- a/MSVC_NMake/create-lists-msvc.mak
+++ b/MSVC_NMake/create-lists-msvc.mak
@@ -42,13 +42,13 @@ files_extra_ph_int = $(files_extra_ph:/=\)
!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^$(PDBVER)\^$(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^$(PDBVER)\^$(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^$(PDBVER)\^$(CFG)\^$(PLAT)\pangomm\pangomm.res]
!endif
!if [call create-lists.bat footer pangomm.mak]
diff --git a/MSVC_NMake/detectenv-msvc.mak b/MSVC_NMake/detectenv-msvc.mak
index 9a92c11..634fe68 100644
--- a/MSVC_NMake/detectenv-msvc.mak
+++ b/MSVC_NMake/detectenv-msvc.mak
@@ -8,7 +8,7 @@
# in $(GLIB_PREFIX)\lib.
!if "$(PREFIX)" == ""
-PREFIX = ..\..\vs$(VSVER)\$(PLAT)
+PREFIX = ..\..\vs$(PDBVER)\$(PLAT)
!endif
# Location of the PERL interpreter, for running glib-mkenums. glib-mkenums
diff --git a/MSVC_NMake/generate-msvc.mak b/MSVC_NMake/generate-msvc.mak
index 2c46858..3a0c11d 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$(PDBVER)\$(CFG)\$(PLAT)\gendef \
+vs$(PDBVER)\$(CFG)\$(PLAT)\pangomm \
+vs$(PDBVER)\$(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$(PDBVER)\$(CFG)\$(PLAT)\pangomm\pangomm.def: $(GENDEF) vs$(PDBVER)\$(CFG)\$(PLAT)\pangomm $(pangomm_OBJS)
+ vs$(PDBVER)\$(CFG)\$(PLAT)\gendef.exe $@ $(PANGOMM_LIBNAME) vs$(PDBVER)\$(CFG)\$(PLAT)\pangomm\*.obj
# Generate wrap_init.cc files
-$(CFG)\$(PLAT)\pangomm\wrap_init.cc: $(pangomm_real_hg)
+vs$(PDBVER)\$(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/info-msvc.mak b/MSVC_NMake/info-msvc.mak
index 8716809..c83765f 100644
--- a/MSVC_NMake/info-msvc.mak
+++ b/MSVC_NMake/info-msvc.mak
@@ -10,7 +10,7 @@ all-build-info:
help:
@echo.
@echo ============================
- @echo Building atkmm Using NMake
+ @echo Building pangomm Using NMake
@echo ============================
@echo nmake /f Makefile.vc CFG=[release^|debug] ^<PREFIX=PATH^> <option1=xxx option2=xxx>
@echo.
diff --git a/MSVC_NMake/install.mak b/MSVC_NMake/install.mak
index 4b5f9bb..8768d7c 100644
--- a/MSVC_NMake/install.mak
+++ b/MSVC_NMake/install.mak
@@ -5,15 +5,15 @@ 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$(PDBVER)\$(CFG)\$(PLAT)\$(PANGOMM_LIBNAME).dll $(PREFIX)\bin
+ @copy /b vs$(PDBVER)\$(CFG)\$(PLAT)\$(PANGOMM_LIBNAME).pdb $(PREFIX)\bin
+ @copy /b vs$(PDBVER)\$(CFG)\$(PLAT)\$(PANGOMM_LIBNAME).lib $(PREFIX)\lib
@copy ..\pango\pangomm.h
"$(PREFIX)\include\pangomm-$(PANGOMM_MAJOR_VERSION).$(PANGOMM_MINOR_VERSION)\"
@for %h in ($(files_extra_h)) do @copy ..\pango\pangomm\%h
"$(PREFIX)\include\pangomm-$(PANGOMM_MAJOR_VERSION).$(PANGOMM_MINOR_VERSION)\pangomm\%h"
@for %h in ($(files_built_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)) 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)) 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)) do @if exist vs$(PDBVER)\$(CFG)\$(PLAT)\pangomm\%h copy
vs$(PDBVER)\$(CFG)\$(PLAT)\pangomm\%h
"$(PREFIX)\include\pangomm-$(PANGOMM_MAJOR_VERSION).$(PANGOMM_MINOR_VERSION)\pangomm\%h"
@for %h in ($(files_built_h)) do @if exist ..\untracked\pango\pangomm\private\%h copy
..\untracked\pango\pangomm\private\%h
"$(PREFIX)\include\pangomm-$(PANGOMM_MAJOR_VERSION).$(PANGOMM_MINOR_VERSION)\pangomm\private\%h"
@for %h in ($(PANGOMM_BUILD_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_BUILD_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_BUILD_PRIVATE_HEADERS)) do @if exist
vs$(PDBVER)\$(CFG)\$(PLAT)\pangomm\private\%h copy vs$(PDBVER)\$(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\"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]