Subject: Re: new feature for src/usr.bin/make: read-only variables
To: None <tech-userlevel@NetBSD.org, tech-pkg@NetBSD.org>
From: Roland Illig <rillig@NetBSD.org>
List: tech-userlevel
Date: 09/04/2005 00:17:19
Simon J. Gerraty wrote:
>>This patch adds a new feature to make(1). Variables can be marked
>>read-only, so there is no chance of overwriting them accidentally. The
>>intended usage is:
> 
> 
>>.BEGIN_READONLY:
>>CFLAGS.NetBSD=   -Wall
>>CFLAGS.SunOS=    -O
>>CFLAGS.IRIX=     -v
>>.END_READONLY:
> 
> 
>>PROG= foobar
>>.READONLY: PROG
> 
> 
> Ignoring the merits of the idea (I'm not sure how much use it would get);
> The .READONLY form I could live with but not the .BEGIN/.END form.
> 
> Also, what are the semantics of a "readonly" variable when overridden on the
> command line?  POSIX says the command line takes precedence - which is a 
> generally useful property.

I'm more and more convinced that it has been nothing but a nice thought. 
At the first moment I liked it, but the interferences with .for 
variables and the command line are not obvious, so this would require 
much additional thought. I think I'll retire from implementing this.

Roland