Makefile.ioctl-c revision 1.25
1# $NetBSD: Makefile.ioctl-c,v 1.25 2013/04/06 13:48:12 uebayasi Exp $ 2 3# NOTE: <bsd.own.mk> needs to be previously .included for NETBSDSRCDIR 4 5# We are trying to get the list of .h files that define all ioctls 6# This version grabs the non-obsolete .h files from the set lists 7# and silently ignores any that don't exist in ${DESTDIR}. 8# NB: The compiler uses the .h files in ${NETBSDSRCDIR}. 9 10SETBASE=${NETBSDSRCDIR}/distrib/sets/lists/comp 11SETFILES:=${SETBASE}/mi 12.for md in md.${MACHINE} /md.${MACHINE}.${MACHINE_ARCH} 13.if exists(${SETBASE}/${md}) 14SETFILES:= ${SETFILES} ${SETBASE}/${md} 15.endif 16.endfor 17 18.if !make(cleandir) && !make(obj) && !make(includes) && !make(install) 19DEPFILEGLOB = ${TOOL_SED} -ne '/\/usr\/include\/.*\.h[ ]/{s/[ ]obsolete$$//;t' -e 's/xenio//;t' -e 's,\.\([^ ]*\).*,${DESTDIR}\1,;p;}' ${SETFILES} 20DEPFILES != ${DEPFILEGLOB} | xargs egrep -l '(_IO\(|_IOR\(|_IOW\(|_IOWR\()' 2>/dev/null || : 21.endif 22 23${PROG}-ioctl.c: mkioctls Makefile ${DEPFILES} ${SETFILES} 24 ${_MKTARGET_CREATE} 25 AWK=${TOOL_AWK:Q} CC="${CC}" DESTDIR="${DESTDIR}" SED=${TOOL_SED:Q} \ 26 ${HOST_SH} ${NETBSDSRCDIR}/usr.bin/kdump/mkioctls \ 27 ${DEPFILES} >${.TARGET} 28 29SRCS+= ${PROG}-ioctl.c 30CLEANFILES+= ${PROG}-ioctl.c 31DPSRCS+= ${PROG}-ioctl.c 32 33${DEPFILES}: .PRECIOUS 34