Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Dec 2023 20:54:25 -0800
From:      "Simon J. Gerraty" <sjg@juniper.net>
To:        Jessica Clarke <jrtc27@freebsd.org>
Cc:        Warner Losh <imp@bsdimp.com>, src-committers <src-committers@freebsd.org>, "<dev-commits-src-all@freebsd.org>" <dev-commits-src-all@freebsd.org>, "<dev-commits-src-main@freebsd.org>" <dev-commits-src-main@freebsd.org>, <sjg@juniper.net>
Subject:   Re: git: 83d0b8c089d8 - main - bsdinstall generate opt_osname.h in include
Message-ID:  <58331.1701924865@kaos.jnpr.net>
In-Reply-To: <D51E0060-60C3-4D56-96C5-B51F1D07DD6C@freebsd.org>
References:  <202312070235.3B72ZoZp043061@gitrepo.freebsd.org> <CANCZdfpm=GD5_5tf3LCrhVWcv95jb86mj23JEAX=2dsKyJQ5rQ@mail.gmail.com> <71239.1701921562@kaos.jnpr.net> <D51E0060-60C3-4D56-96C5-B51F1D07DD6C@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Jessica Clarke <jrtc27@freebsd.org> wrote:
> > Warner Losh <imp@bsdimp.com> wrote:
> >> Silly question: why not just add it to CFLAGS with
> >> -DOSNAME=3D\"${OSNAME}\" rather than generating this file?
> >
> > Actually it is an excellent question - I've no idea why opt_osname.h is
> > needed.
>=20
> To quote the motivation from brd@=E2=80=99s original review:
>=20
> > 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?58331.1701924865>