Re: git: 83d0b8c089d8 - main - bsdinstall generate opt_osname.h in include

From: Simon J. Gerraty <sjg_at_juniper.net>
Date: Thu, 07 Dec 2023 04:54:25 UTC
Jessica Clarke <jrtc27@freebsd.org> wrote:
> > Warner Losh <imp@bsdimp.com> wrote:
> >> Silly question: why not just add it to CFLAGS with
> >> -DOSNAME=\"${OSNAME}\" rather than generating this file?
> >
> > Actually it is an excellent question - I've no idea why opt_osname.h is
> > needed.
> 
> To quote the motivation from brd@’s original review:
> 
> > The reason I did it using a file is so that make(1) would detect a
> > change a rebuild if you change the value and do another build.

A fair point.  Of course moot if using META_MODE.
The other benefit of the header is only the files that include it will
be rebuilt when the value changes whereas (with META_MODE) everything
will be rebuilt if value is in CFLAGS.

That can be mitigated by using per object CFLAGS, but all in all the
header is a simpler solution.

--sjg