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

(cherry picked from commit 3c9a2f383f)
This commit is contained in:
Colin Percival committed 2026-01-30 13:00:35 -08:00
1 parent d76b8a928d
commit 3ab15ea660
1 file changed
+2 -1
+2 -1
View File
@@ -1,6 +1,7 @@
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