Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Aug 2018 10:59:50 +0000 (UTC)
From:      Alex Richardson <arichardson@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r338099 - head/lib/libsysdecode
Message-ID:  <201808201059.w7KAxoIt089728@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: arichardson
Date: Mon Aug 20 10:59:49 2018
New Revision: 338099
URL: https://svnweb.freebsd.org/changeset/base/338099

Log:
  Don't rebuild ioctl.c and relink libsysdecode if there are no changes
  
  Instead generate a temporary file and only overwrite ioctl.c if the
  files are actually different.
  
  Approved By:	jhb (mentor)

Modified:
  head/lib/libsysdecode/Makefile

Modified: head/lib/libsysdecode/Makefile
==============================================================================
--- head/lib/libsysdecode/Makefile	Mon Aug 20 10:39:53 2018	(r338098)
+++ head/lib/libsysdecode/Makefile	Mon Aug 20 10:59:49 2018	(r338099)
@@ -129,11 +129,16 @@ 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
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808201059.w7KAxoIt089728>