[gtkmm/use-dllexport: 21/60] NMake Makefiles: Add rules to generate versioned items
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm/use-dllexport: 21/60] NMake Makefiles: Add rules to generate versioned items
- Date: Mon, 8 Jun 2020 02:43:46 +0000 (UTC)
commit bf4916a8fbba8280ce9da94ce3cae09838e80035
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Thu Mar 12 15:57:19 2020 +0800
NMake Makefiles: Add rules to generate versioned items
This adds rules to generate gtkmm/gtkmm.rc and
[gdk|gtk]mm/[gdk|gtk]mmconfig.h from their .in counterparts by reading
from configure.ac.
MSVC_NMake/Makefile.vc | 4 ++++
MSVC_NMake/generate-msvc.mak | 52 +++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 55 insertions(+), 1 deletion(-)
---
diff --git a/MSVC_NMake/Makefile.vc b/MSVC_NMake/Makefile.vc
index 0e517dd1..e0f1e454 100644
--- a/MSVC_NMake/Makefile.vc
+++ b/MSVC_NMake/Makefile.vc
@@ -33,6 +33,10 @@ VALID_MSC = TRUE
!if "$(VALID_MSC)" == "TRUE"
+!ifdef GENERATE_VERSIONED_FILES
+!include pkg-ver.mak
+!endif
+
# Include the Makefile portion to convert the source and header lists
# into the lists we need for compilation and introspection
!include create-lists-msvc.mak
diff --git a/MSVC_NMake/generate-msvc.mak b/MSVC_NMake/generate-msvc.mak
index 2b904bef..2ed32279 100644
--- a/MSVC_NMake/generate-msvc.mak
+++ b/MSVC_NMake/generate-msvc.mak
@@ -33,4 +33,54 @@ vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm4-demo\demo_resources.c: \
$(gtkmm_demo_example_sources) \
$(gtkmm_demo_resources) \
..\demos\gtk-demo\demo.gresource.xml
- $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=..\demos\gtk-demo --generate-source
..\demos\gtk-demo\demo.gresource.xml
\ No newline at end of file
+ $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=..\demos\gtk-demo --generate-source
..\demos\gtk-demo\demo.gresource.xml
+
+
+prep-git-build: pkg-ver.mak
+
+gtkmm\gtkmm.rc: pkg-ver.mak
+ @echo Generating $@...
+ @copy $@.in $@
+ @$(PERL) -pi.bak -e "s/\@GTKMM_MAJOR_VERSION\@/$(PKG_MAJOR_VERSION)/g" $@
+ @$(PERL) -pi.bak -e "s/\@GTKMM_MINOR_VERSION\@/$(PKG_MINOR_VERSION)/g" $@
+ @$(PERL) -pi.bak -e "s/\@GTKMM_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/\@GTKMM_MODULE_NAME\@/gtkmm-$(GTKMM_MAJOR_VERSION).$(GTKMM_MINOR_VERSION)/g" $@
+ @del $@.bak
+
+# You may change GTKMM_DISABLE_DEPRECATED and GTKMM_STATIC_LIB if you know what you are doing
+gdkmm\gdkmmconfig.h: pkg-ver.mak ..\gdk\gdkmmconfig.h.in
+ @echo Generating $@...
+ @if not exist $(@D) mkdir $(@D)
+ @copy ..\gdk\$(@F).in $@
+ @$(PERL) -pi.bak -e "s/\#undef GDKMM_DISABLE_DEPRECATED/\/\* \#undef GDKMM_DISABLE_DEPRECATED \*\//g"
$@
+ @$(PERL) -pi.bak -e "s/\#undef GDKMM_STATIC_LIB/\/\* \#undef GDKMM_STATIC_LIB \*\//g" $@
+ @$(PERL) -pi.bak -e "s/\#undef GDKMM_MAJOR_VERSION/\#define GDKMM_MAJOR_VERSION
$(PKG_MAJOR_VERSION)/g" $@
+ @$(PERL) -pi.bak -e "s/\#undef GDKMM_MINOR_VERSION/\#define GDKMM_MINOR_VERSION
$(PKG_MINOR_VERSION)/g" $@
+ @$(PERL) -pi.bak -e "s/\#undef GDKMM_MICRO_VERSION/\#define GDKMM_MICRO_VERSION
$(PKG_MICRO_VERSION)/g" $@
+ @del $@.bak
+
+gtkmm\gtkmmconfig.h: pkg-ver.mak ..\gtk\gtkmmconfig.h.in
+ @echo Generating $@...
+ @copy ..\gtk\$(@F).in $@
+ @$(PERL) -pi.bak -e "s/\#undef GTKMM_ATKMM_ENABLED/\#define GTKMM_ATKMM_ENABLED 1/g" $@
+ @$(PERL) -pi.bak -e "s/\#undef GTKMM_DISABLE_DEPRECATED/\/\* \#undef GTKMM_DISABLE_DEPRECATED \*\//g"
$@
+ @$(PERL) -pi.bak -e "s/\#undef GTKMM_STATIC_LIB/\/\* \#undef GTKMM_STATIC_LIB \*\//g" $@
+ @$(PERL) -pi.bak -e "s/\#undef GTKMM_MAJOR_VERSION/\#define GTKMM_MAJOR_VERSION
$(PKG_MAJOR_VERSION)/g" $@
+ @$(PERL) -pi.bak -e "s/\#undef GTKMM_MINOR_VERSION/\#define GTKMM_MINOR_VERSION
$(PKG_MINOR_VERSION)/g" $@
+ @$(PERL) -pi.bak -e "s/\#undef GTKMM_MICRO_VERSION/\#define GTKMM_MICRO_VERSION
$(PKG_MICRO_VERSION)/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
+ $(MAKE) /f Makefile.vc CFG=$(CFG) GENERATE_VERSIONED_FILES=1 gdkmm\gdkmmconfig.h gtkmm\gtkmm.rc
gtkmm\gtkmmconfig.h
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]