diff --git a/usr.bin/file/tests/Makefile b/usr.bin/file/tests/Makefile index cd3d00ae742..cdbe994e1c9 100644 --- a/usr.bin/file/tests/Makefile +++ b/usr.bin/file/tests/Makefile @@ -2,7 +2,18 @@ PACKAGE= tests ATF_TESTS_SH= file_test SRCDIR= ${SRCTOP}/contrib/file/tests -_files!= echo ${SRCDIR}/*.testfile ${SRCDIR}/*.flags ${SRCDIR}/*.result ${SRCDIR}/*.magic +_files!= echo ${SRCDIR}/*.testfile ${SRCDIR}/*.flags ${SRCDIR}/*.magic +_results!= echo ${SRCDIR}/*.result ${PACKAGE}FILES+=${_files} +# Generate normalized .result files in the obj directory, ensuring each ends +# with a newline (some upstream result files are missing one). Install those +# instead of the originals from contrib. +.for _r in ${_results} +${_r:T}: ${_r} + awk 1 ${.ALLSRC} > ${.TARGET} +${PACKAGE}FILES+= ${_r:T} +CLEANFILES+= ${_r:T} +.endfor + .include