tech-userlevel archive

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

Re: Improvement for bmake: boolean values



On Wed, Mar 25, 2009 at 01:57:30PM +0200, Aleksey Cheusov wrote:
> 
> To solve these problems I propose to implement new function for
> bmake, say "yesno", treating 1 and [Yy][Ee][Ss] as logical true,
> and 0 and [Nn][Oo] as logical false.
> 
> Example:
>    MKMAN = yes # or YES|...|NO|No|nO|1|0
>    ...
>    .if yesno(MKMAN)
>        # make man pages here
>    .else
>        # do not make man pages here
>    .end
> 
> In my view this can make mk code cleaner and boolean values in bmake
> much easier to understand and use.

Not really, especially given the parser in bmake.
Adding any more functions will just lead to more buggy makefiles!

Oh - and the compare strings would need to be language dependant!

And calling the function yesno() isn't a good name either!

        David

-- 
David Laight: david%l8s.co.uk@localhost


Home | Main Index | Thread Index | Old Index