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: Stephan Beal
Subject: Re: checking for specific/minimal Make version in Make code?
Date: Fri, 26 Sep 2008 16:42:40 +0200

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]