Re: buildworld: specifying an alternate make.conf

From: Matthew Seaman <matthew_at_FreeBSD.org>
Date: Tue, 03 Oct 2023 13:52:57 UTC
On 03/10/2023 13:48, Ede Wolf wrote:

> to my understanding of man make and make.conf, which admittedly is very 
> limited, I should be able to specify an alternate make.conf with this 
> syntax:
> 
> # make -D __MAKE_CONF=<PATH>/make.conf buildworld
> 
> Now, since this looks somewhat strage - nowhere else I have found make 
> variables with double underscores - and before wasting hours of 
> compiling, I am wondering, is above correct? Or did I miss[understand] 
> anything?

Adding a leading underscore to a variable name is a common idiom for 
"this variable is implementation defined, do not mess with it."  Two 
underscores re-emphasizes all that, and typically means the value is 
considered private and internal -- useful in languages which have no 
built-in capability to hide their internals.

In your case, however, it seems that overriding __MAKE_CONF really is 
the documented method of pointing your build environment at a different 
make.conf file.  Presumably the concept was that almost everyone would 
just edit /etc/make.conf to suit themselves, and almost no-one would 
ever need to switch between alternative make.conf files.

Note: if you're trying to configure building the base system, then you 
probably want to customize /etc/src.conf as described in the src.conf(5) 
man page.  There's a lot of overlap between make.conf and src.conf, but 
make.conf also affects building ports whereas src.conf only applies to 
building the base system.

	Cheers,

	Matthew