[glibmm] NMake Makefiles: Fix generating [glib|gio]mm[config.h|.rc]
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm] NMake Makefiles: Fix generating [glib|gio]mm[config.h|.rc]
- Date: Wed, 22 Jul 2020 07:47:24 +0000 (UTC)
commit 72a22f37f233408166e0d4a0432beb00cce4a483
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Wed Jul 22 15:24:00 2020 +0800
NMake Makefiles: Fix generating [glib|gio]mm[config.h|.rc]
This fixes the build process so that we won't need to generate them
unnecessarily (i.e. when building from a release tarball built with autotools).
Also streamline the build process that we no longer need to explicitly run
the 'prep-git-build' target before building, where we generate
[glib|gio]mm[config.h|.rc], and if needed, gmmproc and generate_wrap_init.pl,
as part of the normal 'all' target if necessary
MSVC_NMake/Makefile.vc | 1 +
MSVC_NMake/build-rules-msvc.mak | 6 ++-
MSVC_NMake/generate-msvc.mak | 111 ++++++++++++++++++++++------------------
README.win32 | 7 ++-
4 files changed, 69 insertions(+), 56 deletions(-)
---
diff --git a/MSVC_NMake/Makefile.vc b/MSVC_NMake/Makefile.vc
index 9f9a3109..8507e35e 100644
--- a/MSVC_NMake/Makefile.vc
+++ b/MSVC_NMake/Makefile.vc
@@ -36,6 +36,7 @@ VALID_MSC = TRUE
!ifdef GENERATE_VERSIONED_FILES
!include pkg-ver.mak
+DO_REAL_GEN = 1
!endif
all: $(GIOMM_LIB) $(GLIBMM_EXTRA_DEFS_GEN_LIB) examples all-build-info
diff --git a/MSVC_NMake/build-rules-msvc.mak b/MSVC_NMake/build-rules-msvc.mak
index 71e4f992..20640d79 100644
--- a/MSVC_NMake/build-rules-msvc.mak
+++ b/MSVC_NMake/build-rules-msvc.mak
@@ -36,7 +36,8 @@ $<
@if exist ..\glib\glibmm\$(<B) $(CXX) $(LIBGLIBMM_CFLAGS) $(CFLAGS_NOGL) /Fo$(@D)\ /Fd$(@D)\ /c
..\glib\glibmm\$(<B)
{..\glib\src\}.ccg{vs$(VSVER)\$(CFG)\$(PLAT)\glibmm\}.obj:
- @if not exist $(@D)\private\ $(MAKE) /f Makefile.vc CFG=$(CFG) $(@D)\private
+ @if not exist $(@D)\private\ md $(@D)\private
+ @if not exist ..\tools\gmmproc $(MAKE) /f Makefile.vc CFG=$(CFG) ..\tools\gmmproc
@for %%s in ($(<D)\*.ccg) do @if not exist ..\glib\glibmm\%%~ns.cc if not exist $(@D)\%%~ns.cc
$(PERL) -I ../tools/pm -- ../tools/gmmproc -I ../tools/m4 --defs $(<D:\=/) %%~ns $(<D:\=/) $(@D)
@if exist $(@D)\$(<B).cc $(CXX) $(LIBGLIBMM_CFLAGS) $(CFLAGS_NOGL) /Fo$(@D)\ /Fd$(@D)\ /c
$(@D)\$(<B).cc
@if exist ..\glib\glibmm\$(<B).cc $(CXX) $(LIBGLIBMM_CFLAGS) $(CFLAGS_NOGL) /Fo$(@D)\ /Fd$(@D)\ /c
..\glib\glibmm\$(<B).cc
@@ -57,7 +58,8 @@ $<
<<
{..\gio\src\}.ccg{vs$(VSVER)\$(CFG)\$(PLAT)\giomm\}.obj:
- @if not exist $(@D)\private\ $(MAKE) /f Makefile.vc CFG=$(CFG) $(@D)\private
+ @if not exist $(@D)\private\ md $(@D)\private
+ @if not exist ..\tools\gmmproc $(MAKE) /f Makefile.vc CFG=$(CFG) ..\tools\gmmproc
@for %%s in ($(<D)\*.ccg) do @if not exist ..\gio\giomm\%%~ns.cc if not exist $(@D)\%%~ns.cc $(PERL)
-I ../tools/pm -- ../tools/gmmproc -I ../tools/m4 --defs $(<D:\=/) %%~ns $(<D:\=/) $(@D)
@if exist $(@D)\$(<B).cc $(CXX) $(LIBGIOMM_CFLAGS) $(CFLAGS_NOGL) /Fo$(@D)\ /Fd$(@D)\ /c
$(@D)\$(<B).cc
@if exist ..\gio\giomm\$(<B).cc $(CXX) $(LIBGIOMM_CFLAGS) $(CFLAGS_NOGL) /Fo$(@D)\ /Fd$(@D)\ /c
$(@D)\$(<B).cc
diff --git a/MSVC_NMake/generate-msvc.mak b/MSVC_NMake/generate-msvc.mak
index ba4b708d..ca38d204 100644
--- a/MSVC_NMake/generate-msvc.mak
+++ b/MSVC_NMake/generate-msvc.mak
@@ -20,70 +20,83 @@ vs$(VSVER)\$(CFG)\$(PLAT)\gschema.compiled: ..\examples\settings\org.gtkmm.demo.
$(GLIB_COMPILE_SCHEMAS) --targetdir=$(@D) $(**D)
# Generate wrap_init.cc files
-vs$(VSVER)\$(CFG)\$(PLAT)\glibmm\wrap_init.cc: $(glibmm_real_hg)
+vs$(VSVER)\$(CFG)\$(PLAT)\glibmm\wrap_init.cc: $(glibmm_real_hg) ..\tools\generate_wrap_init.pl
@if not exist ..\glib\glibmm\wrap_init.cc $(PERL) -- "../tools/generate_wrap_init.pl"
--namespace=Glib --parent_dir=glibmm $(glibmm_real_hg:\=/)>$@
-vs$(VSVER)\$(CFG)\$(PLAT)\giomm\wrap_init.cc: $(giomm_real_hg)
+vs$(VSVER)\$(CFG)\$(PLAT)\giomm\wrap_init.cc: $(giomm_real_hg) ..\tools\generate_wrap_init.pl
@if not exist ..\gio\giomm\wrap_init.cc $(PERL) -- "../tools/generate_wrap_init.pl" --namespace=Gio
--parent_dir=giomm $(giomm_real_hg:\=/)>$@
# Generate pre-generated resources and configuration headers (builds from GIT)
prep-git-build: pkg-ver.mak
+ $(MAKE) /f Makefile.vc CFG=$(CFG) GENERATE_VERSIONED_FILES=1 glibmm\glibmm.rc giomm\giomm.rc
giomm\giommconfig.h
gen-perl-scripts-real: pkg-ver.mak
$(MAKE) /f Makefile.vc CFG=$(CFG) GENERATE_VERSIONED_FILES=1 ..\tools\gmmproc
..\tools\generate_wrap_init.pl
-glibmm\glibmm.rc: pkg-ver.mak glibmm\glibmm.rc.in glibmm\glibmmconfig.h
- @echo Generating $@...
- @copy $@.in $@
- @$(PERL) -pi.bak -e "s/\@GLIBMM_MAJOR_VERSION\@/$(PKG_MAJOR_VERSION)/g" $@
- @$(PERL) -pi.bak -e "s/\@GLIBMM_MINOR_VERSION\@/$(PKG_MINOR_VERSION)/g" $@
- @$(PERL) -pi.bak -e "s/\@GLIBMM_MICRO_VERSION\@/$(PKG_MICRO_VERSION)/g" $@
- @$(PERL) -pi.bak -e
"s/\@PACKAGE_VERSION\@/$(PKG_MAJOR_VERSION).$(PKG_MINOR_VERSION).$(PKG_MICRO_VERSION)/g" $@
- @$(PERL) -pi.bak -e
"s/\@GLIBMM_MODULE_NAME\@/glibmm-$(GLIBMM_MAJOR_VERSION).$(GLIBMM_MINOR_VERSION)/g" $@
- @del $@.bak
+glibmm\glibmm.rc: ..\configure.ac glibmm\glibmm.rc.in glibmm\glibmmconfig.h
+ @if not "$(DO_REAL_GEN)" == "1" if exist pkg-ver.mak del pkg-ver.mak
+ @if not exist pkg-ver.mak $(MAKE) /f Makefile.vc CFG=$(CFG) prep-git-build
+ @if "$(DO_REAL_GEN)" == "1" echo Generating $@...
+ @if "$(DO_REAL_GEN)" == "1" copy $@.in $@
+ @if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\@GLIBMM_MAJOR_VERSION\@/$(PKG_MAJOR_VERSION)/g" $@
+ @if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\@GLIBMM_MINOR_VERSION\@/$(PKG_MINOR_VERSION)/g" $@
+ @if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\@GLIBMM_MICRO_VERSION\@/$(PKG_MICRO_VERSION)/g" $@
+ @if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e
"s/\@PACKAGE_VERSION\@/$(PKG_MAJOR_VERSION).$(PKG_MINOR_VERSION).$(PKG_MICRO_VERSION)/g" $@
+ @if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e
"s/\@GLIBMM_MODULE_NAME\@/glibmm-$(GLIBMM_MAJOR_VERSION).$(GLIBMM_MINOR_VERSION)/g" $@
+ @if "$(DO_REAL_GEN)" == "1" del $@.bak
-glibmm\glibmmconfig.h: ..\glib\glibmmconfig.h.in
- @echo Copying $@ from $**...
- @copy $** $@
+glibmm\glibmmconfig.h: ..\configure.ac ..\glib\glibmmconfig.h.in
+ @if not "$(DO_REAL_GEN)" == "1" if exist pkg-ver.mak del pkg-ver.mak
+ @if not exist pkg-ver.mak $(MAKE) /f Makefile.vc CFG=$(CFG) prep-git-build
+ @if "$(DO_REAL_GEN)" == "1" echo Copying $@ from ..\glib\glibmmconfig.h.in...
+ @if "$(DO_REAL_GEN)" == "1" copy ..\glib\glibmmconfig.h.in $@
-giomm\giomm.rc: pkg-ver.mak
- @echo Generating $@...
- @copy $@.in $@
- @$(PERL) -pi.bak -e "s/\@GIOMM_MAJOR_VERSION\@/$(PKG_MAJOR_VERSION)/g" $@
- @$(PERL) -pi.bak -e "s/\@GIOMM_MINOR_VERSION\@/$(PKG_MINOR_VERSION)/g" $@
- @$(PERL) -pi.bak -e "s/\@GIOMM_MICRO_VERSION\@/$(PKG_MICRO_VERSION)/g" $@
- @$(PERL) -pi.bak -e
"s/\@PACKAGE_VERSION\@/$(PKG_MAJOR_VERSION).$(PKG_MINOR_VERSION).$(PKG_MICRO_VERSION)/g" $@
- @$(PERL) -pi.bak -e "s/\@GIOMM_MODULE_NAME\@/giomm-$(GLIBMM_MAJOR_VERSION).$(GLIBMM_MINOR_VERSION)/g"
$@
- @del $@.bak
+giomm\giomm.rc: ..\configure.ac
+ @if not "$(DO_REAL_GEN)" == "1" if exist pkg-ver.mak del pkg-ver.mak
+ @if not exist pkg-ver.mak $(MAKE) /f Makefile.vc CFG=$(CFG) prep-git-build
+ @if "$(DO_REAL_GEN)" == "1" echo Generating $@...
+ @if "$(DO_REAL_GEN)" == "1" copy $@.in $@
+ @if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\@GIOMM_MAJOR_VERSION\@/$(PKG_MAJOR_VERSION)/g" $@
+ @if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\@GIOMM_MINOR_VERSION\@/$(PKG_MINOR_VERSION)/g" $@
+ @if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\@GIOMM_MICRO_VERSION\@/$(PKG_MICRO_VERSION)/g" $@
+ @if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e
"s/\@PACKAGE_VERSION\@/$(PKG_MAJOR_VERSION).$(PKG_MINOR_VERSION).$(PKG_MICRO_VERSION)/g" $@
+ @if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e
"s/\@GIOMM_MODULE_NAME\@/giomm-$(GLIBMM_MAJOR_VERSION).$(GLIBMM_MINOR_VERSION)/g" $@
+ @if "$(DO_REAL_GEN)" == "1" del $@.bak
# You may change GIOMM_DISABLE_DEPRECATED and GIOMM_STATIC_LIB if you know what you are doing
-giomm\giommconfig.h: pkg-ver.mak ..\gio\giommconfig.h.in
- @echo Generating $@...
- @copy ..\gio\$(@F).in $@
- @$(PERL) -pi.bak -e "s/\#undef GIOMM_DISABLE_DEPRECATED/\/\* \#undef GIOMM_DISABLE_DEPRECATED \*\//g"
$@
- @$(PERL) -pi.bak -e "s/\#undef GIOMM_STATIC_LIB/\/\* \#undef GIOMM_STATIC_LIB \*\//g" $@
- @$(PERL) -pi.bak -e "s/\#undef GIOMM_MAJOR_VERSION/\#define GIOMM_MAJOR_VERSION
$(PKG_MAJOR_VERSION)/g" $@
- @$(PERL) -pi.bak -e "s/\#undef GIOMM_MINOR_VERSION/\#define GIOMM_MINOR_VERSION
$(PKG_MINOR_VERSION)/g" $@
- @$(PERL) -pi.bak -e "s/\#undef GIOMM_MICRO_VERSION/\#define GIOMM_MICRO_VERSION
$(PKG_MICRO_VERSION)/g" $@
- @del $@.bak
+giomm\giommconfig.h: ..\configure.ac ..\gio\giommconfig.h.in
+ @if not "$(DO_REAL_GEN)" == "1" if exist pkg-ver.mak del pkg-ver.mak
+ @if not exist pkg-ver.mak $(MAKE) /f Makefile.vc CFG=$(CFG) prep-git-build
+ @if "$(DO_REAL_GEN)" == "1" echo Generating $@...
+ @if "$(DO_REAL_GEN)" == "1" copy ..\gio\$(@F).in $@
+ @if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\#undef GIOMM_DISABLE_DEPRECATED/\/\* \#undef
GIOMM_DISABLE_DEPRECATED \*\//g" $@
+ @if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\#undef GIOMM_STATIC_LIB/\/\* \#undef
GIOMM_STATIC_LIB \*\//g" $@
+ @if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\#undef GIOMM_MAJOR_VERSION/\#define
GIOMM_MAJOR_VERSION $(PKG_MAJOR_VERSION)/g" $@
+ @if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\#undef GIOMM_MINOR_VERSION/\#define
GIOMM_MINOR_VERSION $(PKG_MINOR_VERSION)/g" $@
+ @if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\#undef GIOMM_MICRO_VERSION/\#define
GIOMM_MICRO_VERSION $(PKG_MICRO_VERSION)/g" $@
+ @if "$(DO_REAL_GEN)" == "1" del $@.bak
-..\tools\gmmproc: ..\tools\gmmproc.in
- @echo Generating $@...
- @copy $** $@
- @$(PERL) -pi.bak -e "s/\@PERL\@/$(PERL:\=\/)/g" $@
- @$(PERL) -pi.bak -e "s/\@prefix\@/$(PREFIX_REAL:\=\/)/g" $@
- @$(PERL) -pi.bak -e "s/\@exec_prefix\@/$(PREFIX_REAL:\=\/)/g" $@
- @$(PERL) -pi.bak -e "s/\@libdir\@/$(PREFIX_REAL:\=\/)\/share/g" $@
- @$(PERL) -pi.bak -e "s/\@M4\@/$(M4:\=\/)/g" $@
- @$(PERL) -pi.bak -e
"s/\@GLIBMM_MODULE_NAME\@/glibmm-$(GLIBMM_MAJOR_VERSION).$(GLIBMM_MINOR_VERSION)/g" $@
- @$(PERL) -pi.bak -e
"s/\@PACKAGE_VERSION\@/$(PKG_MAJOR_VERSION).$(PKG_MINOR_VERSION).$(PKG_MICRO_VERSION)/g" $@
- @del $@.bak
+..\tools\gmmproc: ..\configure.ac ..\tools\gmmproc.in
+ @if not "$(DO_REAL_GEN)" == "1" if exist pkg-ver.mak del pkg-ver.mak
+ @if not exist pkg-ver.mak $(MAKE) /f Makefile.vc CFG=$(CFG) gen-perl-scripts-real
+ @if "$(DO_REAL_GEN)" == "1" echo Generating $@...
+ @if "$(DO_REAL_GEN)" == "1" copy ..\tools\gmmproc.in $@
+ @if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\@PERL\@/$(PERL:\=\/)/g" $@
+ @if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\@prefix\@/$(PREFIX_REAL:\=\/)/g" $@
+ @if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\@exec_prefix\@/$(PREFIX_REAL:\=\/)/g" $@
+ @if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\@libdir\@/$(PREFIX_REAL:\=\/)\/share/g" $@
+ @if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\@M4\@/$(M4:\=\/)/g" $@
+ @if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e
"s/\@GLIBMM_MODULE_NAME\@/glibmm-$(GLIBMM_MAJOR_VERSION).$(GLIBMM_MINOR_VERSION)/g" $@
+ @if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e
"s/\@PACKAGE_VERSION\@/$(PKG_MAJOR_VERSION).$(PKG_MINOR_VERSION).$(PKG_MICRO_VERSION)/g" $@
+ @if "$(DO_REAL_GEN)" == "1" del $@.bak
-..\tools\generate_wrap_init.pl: ..\tools\generate_wrap_init.pl.in
- @echo Generating $@...
- @copy $** $@
- @$(PERL) -pi.bak -e "s/\@PERL\@/$(PERL:\=\/)/g" $@
- @del $@.bak
+..\tools\generate_wrap_init.pl: ..\configure.ac ..\tools\generate_wrap_init.pl.in
+ @if not "$(DO_REAL_GEN)" == "1" if exist pkg-ver.mak del pkg-ver.mak
+ @if not exist pkg-ver.mak $(MAKE) /f Makefile.vc CFG=$(CFG) gen-perl-scripts-real
+ @if "$(DO_REAL_GEN)" == "1" echo Generating $@...
+ @if "$(DO_REAL_GEN)" == "1" copy ..\tools\generate_wrap_init.pl.in $@
+ @if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\@PERL\@/$(PERL:\=\/)/g" $@
+ @if "$(DO_REAL_GEN)" == "1" del $@.bak
pkg-ver.mak: ..\configure.ac
@echo Generating version info Makefile Snippet...
@@ -97,5 +110,3 @@ pkg-ver.mak: ..\configure.ac
@echo for /f "tokens=1,2,3 delims=." %%%%a IN ("%glibmm_ver%") do (echo PKG_MAJOR_VERSION=%%%%a^&
echo PKG_MINOR_VERSION=%%%%b^& echo PKG_MICRO_VERSION=%%%%c)^>$@>>pkg-ver.bat
@pkg-ver.bat
@del ver.txt pkg-ver.bat
- $(MAKE) /f Makefile.vc CFG=$(CFG) GENERATE_VERSIONED_FILES=1 glibmm\glibmm.rc giomm\giomm.rc
giomm\giommconfig.h
- $(MAKE) /f Makefile.vc CFG=$(CFG) gen-perl-scripts-real
diff --git a/README.win32 b/README.win32
index ecf547a1..4bdd73c4 100644
--- a/README.win32
+++ b/README.win32
@@ -91,8 +91,8 @@ with a few manual steps required, namely to:
-Make a new copy of the entire source tree to some location, where the build
is to be done; then in $(srcroot)\MSVC_NMake run
- nmake /f Makefile.vc CFG=[release|debug] prep-git-build, which will copy and generate
- the following files with the proper info (this step may also be needed if the following
+ nmake /f Makefile.vc CFG=[release|debug], which will first copy and generate
+ the following files with the proper info (this step will also be run if the following
files are not present in the unpacked source tarball):
--$(srcroot)\MSVC_NMake\glibmm\glibmmconfig.h
--$(srcroot)\MSVC_NMake\giomm\giommconfig.h
@@ -107,8 +107,7 @@ builds out-of-the-box). For builds from the release tarballs, running
nmake /f Makefile.vc CFG=[release|debug] gen-perl-scripts-real will also generate
$(srcroot)\tools\gmmproc and $(srcroot)\tools\generate_wrap_init.pl for you.
-Note that the prep-git-build and the gen-perl-scripts-real targets will require a working PERL
-installation.
+Note that to generate any of the above 6 files, a PERL installation is also required.
3. Glibmm methods and signals not available on win32
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]