Makefile.ioctl-c revision 1.28
1#	$NetBSD: Makefile.ioctl-c,v 1.28 2015/02/07 14:37:42 christos 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
10SETBASES=	${NETBSDSRCDIR}/distrib/sets/lists/comp \
11		${NETBSDSRCDIR}/distrib/sets/lists/xcomp
12
13.for sb in ${SETBASES}
14.if exists(${sb}/mi)
15SETFILES:=${SETFILES} ${sb}/mi
16.endif
17.for md in md.${MACHINE} /md.${MACHINE}.${MACHINE_ARCH}
18.if exists(${sb}/${md})
19SETFILES:= ${SETFILES} ${sb}/${md}
20.endif
21.endfor
22.endfor
23
24.if !make(cleandir) && !make(obj) && !make(includes) && !make(install)
25DEPFILEGLOB = ${TOOL_SED} -ne '/\/usr\/.*include\/.*\.h[ 	]/{s/[ 	]obsolete$$//;t' -e 's/xenio//;t' -e 's,\.\([^ 	]*\).*,${DESTDIR}\1,;p;}' ${SETFILES}
26DEPFILES != ${DEPFILEGLOB} | xargs egrep -l '(_IO\(|_IOR\(|_IOW\(|_IOWR\()' 2>/dev/null || :
27.endif
28
29${PROG}-ioctl.c: mkioctls Makefile ${DEPFILES} ${SETFILES}
30	${_MKTARGET_CREATE}
31	AWK=${TOOL_AWK:Q} CC="${CC}" DESTDIR="${DESTDIR}" SED=${TOOL_SED:Q} \
32	    ${HOST_SH} ${NETBSDSRCDIR}/usr.bin/kdump/mkioctls \
33	    ${DEPFILES} >${.TARGET}
34
35SRCS+=		${PROG}-ioctl.c
36CLEANFILES+=	${PROG}-ioctl.c
37DPSRCS+=	${PROG}-ioctl.c
38CPPFLAGS+=	-I${DESTDIR}/usr/X11R7/include/libdrm
39CPPFLAGS+=	-I${DESTDIR}/usr/X11R7/include/pixman-1
40CPPFLAGS+=	-I${DESTDIR}/usr/X11R7/include
41CPPFLAGS+=	-D_ALTQ_ALTQ_JOBS_H_	# redefinition of inline
42# De-select one, dup ioctls
43CPPFLAGS+=	-D_VIA_DRM_H_		# Missing header
44#CPPFLAGS+=	-D_I915_DRM_H_		# Dup ioctls
45CPPFLAGS+=	-DQXL_DRM_H		# Dup ioctls
46CPPFLAGS+=	-D__R128_DRM_H__	# Dup ioctls
47CPPFLAGS+=	-D__SIS_DRM_H__		# Dup ioctls
48CPPFLAGS+=	-D__SAVAGE_DRM_H__	# Dup ioctls
49CPPFLAGS+=	-D__RADEON_DRM_H__	# Dup ioctls
50CPPFLAGS+=	-D__MACH64_DRM_H__	# Dup ioctls
51CPPFLAGS+=	-D__MGA_DRM_H__		# Dup ioctls
52
53${DEPFILES}: .PRECIOUS
54