瀏覽代碼

make: fail if make version < 3.80

Andrei Pelinescu-Onciul 16 年之前
父節點
當前提交
96d9c662ab
共有 2 個文件被更改,包括 11 次插入1 次删除
  1. 1 1
      INSTALL
  2. 10 0
      Makefile

+ 1 - 1
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

+ 10 - 0
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