[SR-Dev] git:ser_core_cvs: make: fail if make version < 3.80

Andrei Pelinescu-Onciul andrei at iptel.org
Fri Apr 3 16:05:09 CEST 2009


Module: sip-router
Branch: ser_core_cvs
Commit: 96d9c662abfdc108f64925ad89931c7a5df54c49
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=96d9c662abfdc108f64925ad89931c7a5df54c49

Author: Andrei Pelinescu-Onciul <andrei at iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei at iptel.org>
Date:   Fri Apr  3 11:06:57 2009 +0000

make: fail if make version < 3.80

---

 INSTALL  |    2 +-
 Makefile |   10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/INSTALL b/INSTALL
index 0da2303..eca400b 100644
--- a/INSTALL
+++ b/INSTALL
@@ -53,7 +53,7 @@ Requirements:
 - bison or yacc (Berkley yacc)
 - flex
 - GNU make (on Linux this is the standard "make", on *BSD and Solaris is
- called "gmake") version >= 3.80.
+ called "gmake") version >= 3.80 (recommended 3.81).
 - sed and tr (used in the makefiles)
 - GNU tar ("gtar" on Solaris) and gzip if you want "make tar" to work
 - GNU install, BSD install or Solaris install if you want "make
diff --git a/Makefile b/Makefile
index 4c75fe0..fd3a20e 100644
--- a/Makefile
+++ b/Makefile
@@ -61,6 +61,16 @@
 #               $(MAKE) invocation (andrei)
 #
 
+# check make version
+# required 3.80, recommended 3.81
+req_ver=3.80
+# the check below works for version number of the type x.yy or x.yy.z*
+# (from the GNU Make Cookbook)
+ifeq (,$(filter $(req_ver),$(firstword $(sort $(MAKE_VERSION) $(req_ver)))))
+$(error make version $(MAKE_VERSION) not supported, use at least $(req_ver))
+endif
+
+
 auto_gen=lex.yy.c cfg.tab.c #lexx, yacc etc
 auto_gen_others=cfg.tab.h  # auto generated, non-c
 




More information about the sr-dev mailing list