[glibmm/glibmm-2-62] NMake Makefiles: Add targets to ease build from GIT checkouts
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm/glibmm-2-62] NMake Makefiles: Add targets to ease build from GIT checkouts
- Date: Wed, 26 Feb 2020 11:17:55 +0000 (UTC)
commit 1aae2c9ea866862487700e4ac877c95d8e492078
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Wed Feb 26 19:12:55 2020 +0800
NMake Makefiles: Add targets to ease build from GIT checkouts
This will enable one to generate the following files:
MSVC_NMake/glibmm/glibmmconfig.h
MSVC_NMake/glibmm/glibmm.rc
MSVC_NMake/giomm/giommconfig.h
MSVC_NMake/giomm/giomm.rc
when building from a GIT checkout.
This will also enable one to generate the following files:
tools/gmmproc
tools/generate_wrap_init.pl
from a GIT checkout or from a source tree unpacked from a release tarball so
that one can use these to build directly from a GIT checkout using NMake,
or to have gmmproc and generate_wrap_init.pl ready to use to build other
-mm libraries.
MSVC_NMake/Makefile.vc | 4 +++
MSVC_NMake/build-rules-msvc.mak | 3 ++
MSVC_NMake/create-lists-msvc.mak | 3 ++
MSVC_NMake/generate-msvc.mak | 74 ++++++++++++++++++++++++++++++++++++++++
README.win32 | 25 +++++++++-----
5 files changed, 100 insertions(+), 9 deletions(-)
---
diff --git a/MSVC_NMake/Makefile.vc b/MSVC_NMake/Makefile.vc
index 6f98bf8d..7eeba8f2 100644
--- a/MSVC_NMake/Makefile.vc
+++ b/MSVC_NMake/Makefile.vc
@@ -33,6 +33,10 @@ VALID_MSC = TRUE
# into the lists we need for compilation and introspection
!include create-lists-msvc.mak
+!ifdef GENERATE_VERSIONED_FILES
+!include pkg-ver.mak
+!endif
+
all: $(GIOMM_LIB) $(GLIBMM_EXTRA_DEFS_GEN_LIB) $(glibmm_ex) $(giomm_ex) all-build-info
tests: $(glibmm_tests) $(giomm_tests) all-build-info
diff --git a/MSVC_NMake/build-rules-msvc.mak b/MSVC_NMake/build-rules-msvc.mak
index da15b784..d9045e7f 100644
--- a/MSVC_NMake/build-rules-msvc.mak
+++ b/MSVC_NMake/build-rules-msvc.mak
@@ -234,6 +234,9 @@ clean:
@-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 pkg-ver.mak
+ @-del ..\tools\generate_wrap_init.pl
+ @-del ..\tools\gmmproc
@-del /f /q vs$(PDBVER)\$(CFG)\$(PLAT)\gschemas.compiled
@-del vs$(PDBVER)\$(CFG)\$(PLAT)\glib-extra-defs-gen\*.pdb
@-del vs$(PDBVER)\$(CFG)\$(PLAT)\glib-extra-defs-gen\*.obj
diff --git a/MSVC_NMake/create-lists-msvc.mak b/MSVC_NMake/create-lists-msvc.mak
index 3a6c0fa8..b7eb5f98 100644
--- a/MSVC_NMake/create-lists-msvc.mak
+++ b/MSVC_NMake/create-lists-msvc.mak
@@ -144,6 +144,9 @@ glibmm_files_extra_ph_int = $(glibmm_files_extra_ph:/=\)
!if [call create-lists.bat footer glibmm.mak]
!endif
+!if [for %d in ($(PREFIX)) do @echo PREFIX_REAL=%~dpnd>>glibmm.mak]
+!endif
+
!include glibmm.mak
!if [del /f /q glibmm.mak]
diff --git a/MSVC_NMake/generate-msvc.mak b/MSVC_NMake/generate-msvc.mak
index 5dade259..0b4f0161 100644
--- a/MSVC_NMake/generate-msvc.mak
+++ b/MSVC_NMake/generate-msvc.mak
@@ -34,3 +34,77 @@ vs$(PDBVER)\$(CFG)\$(PLAT)\glibmm\wrap_init.cc: $(glibmm_real_hg)
vs$(PDBVER)\$(CFG)\$(PLAT)\giomm\wrap_init.cc: $(giomm_real_hg)
@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
+ $(MAKE) /f Makefile.vc CFG=$(CFG) gen-perl-scripts-real
+
+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\glibmmconfig.h: ..\glib\glibmmconfig.h.in
+ @echo Copying $@ from $**...
+ @copy $** $@
+
+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
+
+# 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
+
+..\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\@/giomm-$(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\generate_wrap_init.pl: ..\tools\generate_wrap_init.pl.in
+ @echo Generating $@...
+ @copy $** $@
+ @$(PERL) -pi.bak -e "s/\@PERL\@/$(PERL:\=\/)/g" $@
+ @del $@.bak
+
+pkg-ver.mak: ..\configure.ac
+ @echo Generating version info Makefile Snippet...
+ @$(PERL) -00 -ne "print if /AC_INIT\(/" $** | \
+ $(PERL) -pe "tr/, /\n/s" | \
+ $(PERL) -ne "print if 2 .. 2" | \
+ $(PERL) -ne "print /\[(.*)\]/" > ver.txt
+ @echo @echo off>pkg-ver.bat
+ @echo.>>pkg-ver.bat
+ @echo set /p glibmm_ver=^<ver.txt>>pkg-ver.bat
+ @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
diff --git a/README.win32 b/README.win32
index cff86d10..b1303326 100644
--- a/README.win32
+++ b/README.win32
@@ -76,13 +76,15 @@ with a few manual steps required, namely to:
to install the XML::Parser PERL module as well, which requires libexpat.
-Make a new copy of the entire source tree to some location, where the build
- is to be done; then:
---Copy $(srcroot)\glib\glibmmconfig.h.in to $(srcroot)\MSVC_NMake\glibmm\glibmmconfig.h
---Copy $(srcroot)\gio\giommconfig.h.in to $(srcroot)\MSVC_NMake\giomm\giommconfig.h
---Copy $(srcroot)\MSVC_NMake\glibmm\glibmm.rc.in to $(srcroot)\MSVC_NMake\glibmm\glibmm.rc
---Copy $(srcroot)\MSVC_NMake\giomm\giomm.rc.in to $(srcroot)\MSVC_NMake\giomm\giomm.rc
---Copy $(srcroot)\tools\gmmproc.in to $(srcroot)\tools\gmmproc
---Copy $(srcroot)\tools\generate_wrap_init.pl.in to $(srcroot)\tools\generate_wrap_init.pl
+ 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:
+ --$(srcroot)\MSVC_NMake\glibmm\glibmmconfig.h
+ --$(srcroot)\MSVC_NMake\giomm\giommconfig.h
+ --$(srcroot)\MSVC_NMake\glibmm\glibmm.rc
+ --$(srcroot)\MSVC_NMake\giomm\giomm.rc
+ --$(srcroot)\tools\gmmproc
+ --$(srcroot)\tools\generate_wrap_init.pl
After copying the above 6 files, you need to ensure that they reflect on the package version
that best matches your checkout status and the paths in $(srcroot)\tools\gmmproc and
@@ -90,8 +92,13 @@ $(srcroot)\tools\generate_wrap_init.pl (the items enclosed between the @...@'s)
on where you intend for nmake /f Makefile.vc CFG=$(CFG) install to install to (i.e. $(PREFIX)).
For giommconfig.h, it is recommended to keep GIOMM_STATIC_LIB and GIOMM_DISABLE_DEPRECATED
undefined unless you know what you are doing (remember, the NMake Makefiles only support DLL
-builds out-of-the-box). You may ignore the fields in glibmmconfig.h the values between
-#ifdef GLIBMM_CONFIGURE and #endif /* GLIBMM_CONFIGURE */.
+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.
+
3. Glibmm methods and signals not available on win32
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]