Re: FreeBSD make fails on BUILT_SOURCES file
Nate Bargmann <[email protected]> Thu, 25 Sep 2025 20:18:02 -0500
| Newsgroups | gmane.comp.sysutils.automake.general |
|---|---|
| Organization | Amateur Radio! |
| Message-ID | <slrgq25bk4rypuygoag2tkapsuh6rjijuyojvojyx3vent6zy2@dgzj5h4nbrzh> |
--aqakjhi5say2u5va
Content-Type: text/plain; protected-headers=v1; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Subject: Re: FreeBSD make fails on BUILT_SOURCES file
MIME-Version: 1.0
* On 2025 25 Sep 13:41 -0500, Jan Engelhardt wrote:
>=20
> * diff produces a "line-by-line comparison" (terminology from the manpage=
).
> This is highly wasteful, because in the context of Makefile, we are only
> interested in a byte-by-byte comparison and stopping at the first misma=
tch.
> Use cmp.
>=20
> * It is odd to see that they properly used --format=3D%cd for the first p=
art,
> but then completely forget that there is --format=3D%h for the second p=
art and
> instead did... barbershop nonsense with | head | cut .
I won't speculate. I do thank you for your assistance, Jan.
> Anyway. Altogether, something like
>=20
> hamlibdatetime.h: hamlibdatetime.h.in FORCE
> ${AM_V_at}if test -d $(top_srcdir)/.git; then \
> echo "/* This date time is from the last non-merge commit to Hamlib. */=
" >[email protected]; \
> echo "#define HAMLIBDATETIME "\"$$(TZ=3DUTC git --git-dir=3D$(top_srcdi=
r)/.git log --no-merges --date=3D'format-local:%Y-%m-%dT%H:%M:%SZ SHA=3D' -=
-format=3D'%cd' -n 1)$$(git --git-dir=3D$(top_srcdir)/.git log --no-merges =
-n 1 --format=3D'%h'\" >[email protected]; \
> else \
> cp ${srcdir}/hamlibdatetime.h.in [email protected]; \
> fi
> ${AM_V_at}if ! cmp $@ [email protected] >/dev/null 2>/dev/null; then mv [email protected] $@; =
fi; rm -f [email protected]
>=20
> might just fix it for good.
Except I did have to close a parentheses at the end of the second 'echo'
line and then add a '>' to append to the .tmp file instead of
overwriting the line from the first 'echo'.
I really appreciate the refactor and so far it seems to be working.
With your permission I will credit you as the author when I commit the
changes.
- Nate
--=20
"The optimist proclaims that we live in the best of all
possible worlds. The pessimist fears this is true."
Web: https://www.n0nb.us
Projects: https://github.com/N0NB
GPG fingerprint: 82D6 4F6B 0E67 CD41 F689 BBA6 FB2C 5130 D55A 8819
--aqakjhi5say2u5va
Content-Type: application/pgp-signature; name="signature.asc"
-----BEGIN PGP SIGNATURE-----
iFwEABECAB0WIQSC1k9rDmfNQfaJu6b7LFEw1VqIGQUCaNXpygAKCRD7LFEw1VqI
GXfhAJjx4ZEozk5MYIQKGSrBbG715bqyAJ4n2VtKaa5uJJZ5VFYcI2t0w6XGFw==
=nKPY
-----END PGP SIGNATURE-----
--aqakjhi5say2u5va--