Re: [RFC PATCH v3 01/15] Makefile: use common template for GIT-BUILD-OPTIONS
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Oct 23, 2024, 12:04 UTC
- Message-ID
- <ZxjmWMJ5u5pHZh9L@pks.im>
- In-Reply-To
- <CAPig+cR2QXmgFEpaQrvsAF1jV8nZavFjYQkMXp5zaYVER2CiSg@mail.gmail.com>
On Sat, Oct 19, 2024 at 01:00:46AM -0400, Eric Sunshine wrote:
Show 22 quoted lines
> On Fri, Oct 18, 2024 at 8:23 AM Patrick Steinhardt <ps@pks.im> wrote: > > Introduce a new "GIT-BUILD-OPTIONS.in" template to address this issue. > > This has multiple advantages: > > [...] > > - Some build systems complain when not all variables could be > > substituted, alerting us of mismatches. Others don't, but if we > > forgot to substitute such variables we now have a bogus string that > > will likely cause our tests to fail, if they have any meaning in the > > first place. > > Regarding the above... > > > + @sed \ > > + -e "s|@SHELL_PATH@|\'$(SHELL_PATH_SQ)\'|" \ > > + -e "s|@TEST_SHELL_PATH@|\'$(TEST_SHELL_PATH_SQ)\'|" \ > > + [...] > > + GIT-BUILD-OPTIONS.in >$@+ > > @if cmp $@+ $@ >/dev/null 2>&1; then $(RM) $@+; else mv $@+ $@; fi > > @if test -f GIT-BUILD-DIR; then rm GIT-BUILD-DIR; fi > > ... can't we `grep` whether any unsubstituted variables remain in $@+ > and complain if they do?
You mean with the new `GIT-BUILD-OPTIONS.in` template? Yes, we can. Meson generates such warnings automatically, but that of course does not help our Makefile.
I'll add that.
Patrick