[atkmm/atkmm-2-28] NMake Makefiles: Add rules to generate pre-configure items
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [atkmm/atkmm-2-28] NMake Makefiles: Add rules to generate pre-configure items
- Date: Thu, 27 Feb 2020 10:30:48 +0000 (UTC)
commit 5ea9c6716ed474a1c8b865b4587eedf4ee651070
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Thu Feb 27 18:23:52 2020 +0800
NMake Makefiles: Add rules to generate pre-configure items
This will allow building from GIT checkouts easier, where we need the
full atkmmconfig.h and atkmm.rc to carry out our builds with NMake.
.gitignore | 1 +
MSVC_NMake/Makefile.vc | 4 ++++
MSVC_NMake/generate-msvc.mak | 37 +++++++++++++++++++++++++++++++++++++
3 files changed, 42 insertions(+)
---
diff --git a/.gitignore b/.gitignore
index 803cc97..2ffd368 100644
--- a/.gitignore
+++ b/.gitignore
@@ -31,3 +31,4 @@ stamp-h?
/MSVC_NMake/atkmm/atkmm.rc
/MSVC_NMake/atkmm/atkmmconfig.h
+/MSVC_NMake/pkg-ver.mak
diff --git a/MSVC_NMake/Makefile.vc b/MSVC_NMake/Makefile.vc
index 0b6fb10..5a7f020 100644
--- a/MSVC_NMake/Makefile.vc
+++ b/MSVC_NMake/Makefile.vc
@@ -27,6 +27,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 192ea2c..fe20511 100644
--- a/MSVC_NMake/generate-msvc.mak
+++ b/MSVC_NMake/generate-msvc.mak
@@ -11,3 +11,40 @@ vs$(PDBVER)\$(CFG)\$(PLAT)\atkmm:
# Generate .def files
vs$(PDBVER)\$(CFG)\$(PLAT)\atkmm\atkmm.def: $(GENDEF) vs$(PDBVER)\$(CFG)\$(PLAT)\atkmm $(atkmm_OBJS)
vs$(PDBVER)\$(CFG)\$(PLAT)\gendef.exe $@ $(ATKMM_LIBNAME) vs$(PDBVER)\$(CFG)\$(PLAT)\atkmm\*.obj
+
+# Generate pre-generated resources and configuration headers (builds from GIT)
+prep-git-build: pkg-ver.mak
+
+atkmm\atkmm.rc: pkg-ver.mak atkmm\atkmm.rc.in
+ @echo Generating $@...
+ @copy $@.in $@
+ @$(PERL) -pi.bak -e "s/\@ATKMM_MAJOR_VERSION\@/$(PKG_MAJOR_VERSION)/g" $@
+ @$(PERL) -pi.bak -e "s/\@ATKMM_MINOR_VERSION\@/$(PKG_MINOR_VERSION)/g" $@
+ @$(PERL) -pi.bak -e "s/\@ATKMM_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/\@ATKMM_MODULE_NAME\@/atkmm-$(ATKMM_MAJOR_VERSION).$(ATKMM_MINOR_VERSION)/g" $@
+ @del $@.bak
+
+# You may change ATKMM_STATIC_LIB if you know what you are doing
+atkmm\atkmmconfig.h: pkg-ver.mak ..\atk\atkmmconfig.h.in
+ @echo Generating $@...
+ @copy ..\atk\$(@F).in $@
+ @$(PERL) -pi.bak -e "s/\#undef ATKMM_STATIC_LIB/\/\* \#undef ATKMM_STATIC_LIB \*\//g" $@
+ @$(PERL) -pi.bak -e "s/\#undef ATKMM_MAJOR_VERSION/\#define ATKMM_MAJOR_VERSION
$(PKG_MAJOR_VERSION)/g" $@
+ @$(PERL) -pi.bak -e "s/\#undef ATKMM_MINOR_VERSION/\#define ATKMM_MINOR_VERSION
$(PKG_MINOR_VERSION)/g" $@
+ @$(PERL) -pi.bak -e "s/\#undef ATKMM_MICRO_VERSION/\#define ATKMM_MICRO_VERSION
$(PKG_MICRO_VERSION)/g" $@
+ @del $@.bak
+
+pkg-ver.mak: ..\configure.ac
+ @echo Generating version info Makefile Snippet...
+ @$(PERL) -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 atkmm_ver=^<ver.txt>>pkg-ver.bat
+ @echo for /f "tokens=1,2,3 delims=." %%%%a IN ("%atkmm_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 atkmm\atkmm.rc atkmm\atkmmconfig.h
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]