help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: checking for specific/minimal Make version in Make code?


From: kalyan
Subject: Re: checking for specific/minimal Make version in Make code?
Date: Sun, 28 Sep 2008 00:00:25 +0530

It will fail where the make version shows 4 digits (for example 3.79.1) and we need to check availability of a 3 digit make (for example 3.81)..
I cant think of any immediate way to tackle these sort of arithmetic situations though...but seems very interesting

regards
kalyan


On Fri, Sep 26, 2008 at 8:12 PM, Stephan Beal <address@hidden> wrote:
On Fri, Sep 26, 2008 at 3:08 PM, Dave Korn <address@hidden> wrote:
>  $(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.

Great! Here's one solution, in case anyone's interested:

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/


_______________________________________________


reply via email to

[Prev in Thread] Current Thread [Next in Thread]