Browse code

make: fail if make version < 3.80

Andrei Pelinescu-Onciul authored on 03/04/2009 11:06:57
Showing 2 changed files
... ...
@@ -53,7 +53,7 @@ Requirements:
53 53
 - bison or yacc (Berkley yacc)
54 54
 - flex
55 55
 - GNU make (on Linux this is the standard "make", on *BSD and Solaris is
56
- called "gmake") version >= 3.80.
56
+ called "gmake") version >= 3.80 (recommended 3.81).
57 57
 - sed and tr (used in the makefiles)
58 58
 - GNU tar ("gtar" on Solaris) and gzip if you want "make tar" to work
59 59
 - GNU install, BSD install or Solaris install if you want "make
... ...
@@ -61,6 +61,16 @@
61 61
 #               $(MAKE) invocation (andrei)
62 62
 #
63 63
 
64
+# check make version
65
+# required 3.80, recommended 3.81
66
+req_ver=3.80
67
+# the check below works for version number of the type x.yy or x.yy.z*
68
+# (from the GNU Make Cookbook)
69
+ifeq (,$(filter $(req_ver),$(firstword $(sort $(MAKE_VERSION) $(req_ver)))))
70
+$(error make version $(MAKE_VERSION) not supported, use at least $(req_ver))
71
+endif
72
+
73
+
64 74
 auto_gen=lex.yy.c cfg.tab.c #lexx, yacc etc
65 75
 auto_gen_others=cfg.tab.h  # auto generated, non-c
66 76