summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChun-wei Fan <fanchunwei@src.gnome.org>2020-07-23 17:29:33 +0800
committerChun-wei Fan <fanchunwei@src.gnome.org>2020-07-23 17:36:16 +0800
commit7202421d9392dca045450d1887fb5db23bc76293 (patch)
tree40f2d55cd70ef55eb4665da5412f50acc352b958
parentea8c893e3093c1555145b660847c6a254c1df7e3 (diff)
NMake Makefiles: Fix builds from release tarballs
This avoids needlessly enerating cairommconfig.h and cairomm.rc, and when we do need to generate these files, we ensure that they always have the right version info in them. Also streamline the build process that this file generating is done in the 'all' target, so that one does not need to use the -prep-git-build' target beforehand.
-rw-r--r--MSVC_NMake/Makefile.vc1
-rw-r--r--MSVC_NMake/generate-msvc.mak36
2 files changed, 21 insertions, 16 deletions
diff --git a/MSVC_NMake/Makefile.vc b/MSVC_NMake/Makefile.vc
index ada0e56..eb994ab 100644
--- a/MSVC_NMake/Makefile.vc
+++ b/MSVC_NMake/Makefile.vc
@@ -28,6 +28,7 @@ VALID_MSC = TRUE
!ifdef GENERATE_VERSIONED_FILES
!include pkg-ver.mak
+DO_REAL_GEN = 1
!endif
# Include the Makefile portion to convert the source and header lists
diff --git a/MSVC_NMake/generate-msvc.mak b/MSVC_NMake/generate-msvc.mak
index e7a7e6d..472007a 100644
--- a/MSVC_NMake/generate-msvc.mak
+++ b/MSVC_NMake/generate-msvc.mak
@@ -11,24 +11,28 @@ vs$(VSVER)\$(CFG)\$(PLAT)\cairomm\cairomm.def: $(GENDEF) $(cairomm_OBJS)
prep-git-build: pkg-ver.mak
$(MAKE) /f Makefile.vc CFG=$(CFG) GENERATE_VERSIONED_FILES=1 cairomm\cairomm.rc cairomm\cairommconfig.h
-cairomm\cairomm.rc: pkg-ver.mak cairomm\cairomm.rc.in
- @echo Generating $@...
- @copy $@.in $@
- @$(PERL) -pi.bak -e "s/\@CAIROMM_MAJOR_VERSION\@/$(PKG_MAJOR_VERSION)/g" $@
- @$(PERL) -pi.bak -e "s/\@CAIROMM_MINOR_VERSION\@/$(PKG_MINOR_VERSION)/g" $@
- @$(PERL) -pi.bak -e "s/\@CAIROMM_MICRO_VERSION\@/$(PKG_MICRO_VERSION)/g" $@
- @$(PERL) -pi.bak -e "s/\@VERSION\@/$(PKG_MAJOR_VERSION).$(PKG_MINOR_VERSION).$(PKG_MICRO_VERSION)/g" $@
- @del $@.bak
+cairomm\cairomm.rc: ..\configure.ac cairomm\cairomm.rc.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 $@.in $@
+ @if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\@CAIROMM_MAJOR_VERSION\@/$(PKG_MAJOR_VERSION)/g" $@
+ @if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\@CAIROMM_MINOR_VERSION\@/$(PKG_MINOR_VERSION)/g" $@
+ @if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\@CAIROMM_MICRO_VERSION\@/$(PKG_MICRO_VERSION)/g" $@
+ @if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\@VERSION\@/$(PKG_MAJOR_VERSION).$(PKG_MINOR_VERSION).$(PKG_MICRO_VERSION)/g" $@
+ @if "$(DO_REAL_GEN)" == "1" del $@.bak
# You may change CAIROMM_EXCEPTIONS_ENABLED if you know what you are doing
-cairomm\cairommconfig.h: pkg-ver.mak ..\cairommconfig.h.in
- @echo Generating $@...
- @copy ..\$(@F).in $@
- @$(PERL) -pi.bak -e "s/\#undef CAIROMM_EXCEPTIONS_ENABLED/\#define CAIROMM_EXCEPTIONS_ENABLED 1/g" $@
- @$(PERL) -pi.bak -e "s/\#undef CAIROMM_MAJOR_VERSION/\#define CAIROMM_MAJOR_VERSION $(PKG_MAJOR_VERSION)/g" $@
- @$(PERL) -pi.bak -e "s/\#undef CAIROMM_MINOR_VERSION/\#define CAIROMM_MINOR_VERSION $(PKG_MINOR_VERSION)/g" $@
- @$(PERL) -pi.bak -e "s/\#undef CAIROMM_MICRO_VERSION/\#define CAIROMM_MICRO_VERSION $(PKG_MICRO_VERSION)/g" $@
- @del $@.bak
+cairomm\cairommconfig.h: ..\configure.ac ..\cairommconfig.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 ..\$(@F).in $@
+ @if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\#undef CAIROMM_EXCEPTIONS_ENABLED/\#define CAIROMM_EXCEPTIONS_ENABLED 1/g" $@
+ @if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\#undef CAIROMM_MAJOR_VERSION/\#define CAIROMM_MAJOR_VERSION $(PKG_MAJOR_VERSION)/g" $@
+ @if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\#undef CAIROMM_MINOR_VERSION/\#define CAIROMM_MINOR_VERSION $(PKG_MINOR_VERSION)/g" $@
+ @if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\#undef CAIROMM_MICRO_VERSION/\#define CAIROMM_MICRO_VERSION $(PKG_MICRO_VERSION)/g" $@
+ @if "$(DO_REAL_GEN)" == "1" del $@.bak
pkg-ver.mak: ..\configure.ac
@echo Generating version info Makefile Snippet...