Module Name:    src
Committed By:   dsl
Date:           Thu Apr  4 22:35:29 UTC 2013

Modified Files:
        src/usr.bin/kdump: Makefile.ioctl-c

Log Message:
Extract a base list of .h files from the set lists instead of looking
  at the current contents of ${DESTDIR}.
Ignore missing files and also depend on the set lists themselves.
Should stop the build breaking here if there are extra files in DESTDIR (etc).
NB: The order of the .h files matters somewhat. Probably works by luck.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/usr.bin/kdump/Makefile.ioctl-c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/kdump/Makefile.ioctl-c
diff -u src/usr.bin/kdump/Makefile.ioctl-c:1.23 src/usr.bin/kdump/Makefile.ioctl-c:1.24
--- src/usr.bin/kdump/Makefile.ioctl-c:1.23	Sat Oct 25 22:23:55 2008
+++ src/usr.bin/kdump/Makefile.ioctl-c	Thu Apr  4 22:35:28 2013
@@ -1,14 +1,26 @@
-#	$NetBSD: Makefile.ioctl-c,v 1.23 2008/10/25 22:23:55 apb Exp $
+#	$NetBSD: Makefile.ioctl-c,v 1.24 2013/04/04 22:35:28 dsl Exp $
 
 # NOTE: <bsd.own.mk> needs to be previously .included for NETBSDSRCDIR
 
-DEPFILEGLOB=	${DESTDIR}/usr/include/*/*.h ${DESTDIR}/usr/include/*/*/*.h
+# We are trying to get the list of .h files that define all ioctls
+# This version grabs the non-obsolete .h files from the set lists
+# and silently ignores any that don't exist in ${DESTDIR}.
+# NB: The compiler uses the .h files in ${NETBSDSRCDIR}.
+
+SETBASE=${NETBSDSRCDIR}/distrib/sets/lists/comp
+SETFILES:=${SETBASE}/mi
+.for md in md.${MACHINE} /md.${MACHINE}.${MACHINE_ARCH}
+.if exists(${SETBASE}/${md})
+SETFILES:= ${SETFILES} ${SETBASE}/${md}
+.endif
+.endfor
 
 .if !make(cleandir) && !make(obj) && !make(includes)
-DEPFILES != egrep -l '(_IO\(|_IOR\(|_IOW\(|_IOWR\()' ${DEPFILEGLOB} | fgrep -v xenio
+DEPFILEGLOB != ${TOOL_SED} -ne '/\/usr\/include\/.*\.h[ 	]/{s/[ 	]obsolete$$//;t' -e 's/xenio//;t' -e 's,\.\([^ 	]*\).*,${DESTDIR}\1,;p;}' ${SETFILES}
+DEPFILES != egrep -l '(_IO\(|_IOR\(|_IOW\(|_IOWR\()' ${DEPFILEGLOB} 2>/dev/null || :
 .endif
 
-${PROG}-ioctl.c: mkioctls Makefile ${DEPFILES}
+${PROG}-ioctl.c: mkioctls Makefile ${DEPFILES} ${SETFILES}
 	${_MKTARGET_CREATE}
 	AWK=${TOOL_AWK:Q} CC="${CC}" DESTDIR="${DESTDIR}" SED=${TOOL_SED:Q} \
 	    ${HOST_SH} ${NETBSDSRCDIR}/usr.bin/kdump/mkioctls \

Reply via email to