|
From: | kalyan |
Subject: | Re: checking for specific/minimal Make version in Make code? |
Date: | Sun, 28 Sep 2008 00:00:25 +0530 |
On Fri, Sep 26, 2008 at 3:08 PM, Dave Korn <address@hidden> wrote:Great! Here's one solution, in case anyone's interested:
> $(MAKE_VERSION) has all the info you need toimplement a check. Dunno what
> version it was first introduced in, but if it's not defined, it's gotta be
> pretty old.
MAKE_REQUIRED_VERSION := 380# MAKE_VERSION stripped of any dots
VERSION_CHECK := \
$(shell \
test $$(echo $(MAKE_VERSION) | sed -e 's/\.//g') -ge \
"$(MAKE_REQUIRED_VERSION)" 2>/dev/null \
&& echo 1 || echo 0)
ifneq (1,$(VERSION_CHECK))
$(error Your make is too old! Time to upgrade!)
endif
Also works when MAKE_VERSION is undefined.
Happy hacking!
--
----- stephan beal
http://wanderinghorse.net/home/stephan/
_______________________________________________
[Prev in Thread] | Current Thread | [Next in Thread] |