tech-userlevel archive

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

Re: make: new modifyer :Y



 >> with more elegant
 >> 
 >>   .if ${MKXXX:Y}
 >>   .endif
 >> 
 >> Find the patch in the attachment. Objections?

> Yeah, I'm not a fan of "Y" - it's too terse, and seems to be an obscure
> idiom for a longer sequence.
...
> Unfortunately, the other side of the coin wrt brevity is comprehension,

I believe :Y name is self-explanatory. "Y" here means "Yes". Just like
"M" in ":M" means Match, "O" means Order in :O, "S" means "Substitute"
in :S and so on.

So, the following statement in bmake

    .if ${VARNAME:Y}

means 

    if VARNAME is set to Yes

The above bmake statement is almost as clear as in pure English sentense.

Another reason to make this modifier single-letter is that we check
variables for boolean true/false very often, hundreds and hundreds of
times in pkgsrc and base system. Some other single-letter modifiers like
:D and :L are used very rarely.

> I'm not sure what the 'Y' modifier in other
> make programs does,

Nothing. FreeBSD and OpenBSD make do not provide :Y.
NetBSD make is way ahead of them.

> but I'm fairly sure it's not this - the NetBSD make(1)
> program is used in many places you would not even think of.
:Y doesn't break backward compatibility.
So, it cannot break an existing code.

> Regards,
> Alistair

-- 
Best regards, Aleksey Cheusov.


Home | Main Index | Thread Index | Old Index