diff --git a/lib/libsysdecode/Makefile b/lib/libsysdecode/Makefile index a37d05de20c4..97af7dc7cade 100644 --- a/lib/libsysdecode/Makefile +++ b/lib/libsysdecode/Makefile @@ -129,12 +129,17 @@ tables.h: mktables # mkioctls runs find(1) for headers so needs to rebuild every time. This used # to be a hack only done in buildworld. .if !defined(_SKIP_BUILD) -ioctl.c: .PHONY +ioctl.c.tmp: .PHONY .endif -ioctl.c: mkioctls .META +ioctl.c.tmp: mkioctls .META env CPP="${CPP}" MK_PF="${MK_PF}" \ /bin/sh ${.CURDIR}/mkioctls ${SYSROOT:U${DESTDIR}}${INCLUDEDIR} > ${.TARGET} +ioctl.c: ioctl.c.tmp + if [ ! -e ${.TARGET} ] || ! cmp -s ${.TARGET} ${.TARGET}.tmp; then \ + mv -f ${.TARGET}.tmp ${.TARGET}; \ + fi + beforedepend: ioctl.c tables.h .include