Ping: Make build reproducible

As recently fixed in sockstat (9934558460), having tests/Makefile
include files from the parent directory with SRCS= ../foo.c results
in a race condition as the parent build and the tests build try to
produce the same object file but contain different paths.

Use .PATH to tell make to find sockstat.c in the parent directory
but place the object file in the current object directory.

Reviewed by:	emaste, jrtc27, kevans
MFC after:	3 days
Sponsored by:	https://www.patreon.com/cperciva
Differential Revision:	https://reviews.freebsd.org/D53075
This commit is contained in:
Colin Percival 2025-10-13 08:58:10 -07:00
parent 16155cccc4
commit 3c9a2f383f

View file

@ -1,5 +1,6 @@
ATF_TESTS_C+= in_cksum_test
SRCS.in_cksum_test= in_cksum_test.c ../utils.c
.PATH: ${.CURDIR:H}
SRCS.in_cksum_test= in_cksum_test.c utils.c
PACKAGE= tests