[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Feature idea: required version flag
From: |
Greg Chicares |
Subject: |
Re: Feature idea: required version flag |
Date: |
Mon, 03 Nov 2008 15:24:28 +0000 |
User-agent: |
Thunderbird 2.0.0.17 (Windows/20080914) |
On 2008-11-03 13:46Z, Stephan Beal wrote:
>
> i know we've discussed the topic of "how to check if the user is
> running Make version XYZ or higher" before, but i just had another
> idea for helping to solve this...
What's wrong with the solutions already discussed?
If you don't want to write the test in a makefile, then run
`make --version` and parse the output; you could write a wrapper
script to do that.
> Consider this common makefile header:
> #!/usr/bin/make -f
> # Requires GNU Make 3.80+!
> default: all
>
> What if we could replace the first line with:
>
> #!/usr/bin/make -R=3.80 -f
>
> (i picked -R off the top of my head (for "Required version") - maybe
> -R is already in use)
To see that it is:
make --help | grep '[-]R'
> In this invokation, make would refuse to run if its version is less
> than 3.80. If its an older make, it would probably puke on the unknown
> -R flag and die anyway, so we're protected either way.
How would you distinguish that mode of failure from other modes?