Makefile.ioctl-c revision 1.24 1 # $NetBSD: Makefile.ioctl-c,v 1.24 2013/04/04 22:35:28 dsl 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
10 SETBASE=${NETBSDSRCDIR}/distrib/sets/lists/comp
11 SETFILES:=${SETBASE}/mi
12 .for md in md.${MACHINE} /md.${MACHINE}.${MACHINE_ARCH}
13 .if exists(${SETBASE}/${md})
14 SETFILES:= ${SETFILES} ${SETBASE}/${md}
15 .endif
16 .endfor
17
18 .if !make(cleandir) && !make(obj) && !make(includes)
19 DEPFILEGLOB != ${TOOL_SED} -ne '/\/usr\/include\/.*\.h[ ]/{s/[ ]obsolete$$//;t' -e 's/xenio//;t' -e 's,\.\([^ ]*\).*,${DESTDIR}\1,;p;}' ${SETFILES}
20 DEPFILES != egrep -l '(_IO\(|_IOR\(|_IOW\(|_IOWR\()' ${DEPFILEGLOB} 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
29 SRCS+= ${PROG}-ioctl.c
30 CLEANFILES+= ${PROG}-ioctl.c
31 DPSRCS+= ${PROG}-ioctl.c
32
33 ${DEPFILES}: .PRECIOUS
34