Makefile.ioctl-c revision 1.35
11.35Schs#	$NetBSD: Makefile.ioctl-c,v 1.35 2018/05/28 21:05:02 chs Exp $
21.5Slukem
31.5Slukem# NOTE: <bsd.own.mk> needs to be previously .included for NETBSDSRCDIR
41.1Smrg
51.24Sdsl# We are trying to get the list of .h files that define all ioctls
61.24Sdsl# This version grabs the non-obsolete .h files from the set lists
71.24Sdsl# and silently ignores any that don't exist in ${DESTDIR}.
81.24Sdsl# NB: The compiler uses the .h files in ${NETBSDSRCDIR}.
91.24Sdsl
101.26SchristosSETBASES=	${NETBSDSRCDIR}/distrib/sets/lists/comp \
111.26Schristos		${NETBSDSRCDIR}/distrib/sets/lists/xcomp
121.26Schristos
131.26Schristos.for sb in ${SETBASES}
141.26Schristos.if exists(${sb}/mi)
151.26SchristosSETFILES:=${SETFILES} ${sb}/mi
161.26Schristos.endif
171.24Sdsl.for md in md.${MACHINE} /md.${MACHINE}.${MACHINE_ARCH}
181.26Schristos.if exists(${sb}/${md})
191.26SchristosSETFILES:= ${SETFILES} ${sb}/${md}
201.24Sdsl.endif
211.24Sdsl.endfor
221.26Schristos.endfor
231.30Sjoerg.if ${MKDTRACE} != "no"
241.29SchristosEXTRAS=	${NETBSDSRCDIR}/external/cddl/osnet/dist/uts/common/sys/dtrace.h
251.29Schristos.endif
261.8Sthorpej
271.25Suebayasi.if !make(cleandir) && !make(obj) && !make(includes) && !make(install)
281.34SchristosDEPFILEGLOB = ${TOOL_SED} \
291.34Schristos    -ne '/\/usr\/.*include\/.*\.h[ 	]/{s/[ 	,]obsolete//;t' \
301.34Schristos    -e "s/xorg_server_ver=${XORG_SERVER_VER}//;t skipserver" \
311.34Schristos    -e "s/xorg_server_ver=//;t" \
321.34Schristos    -e ":skipserver" \
331.34Schristos    -e 's/xenio//;t' \
341.34Schristos    -e 's,\.\([^ 	]*\).*,${DESTDIR}\1,;p;}' ${SETFILES}
351.29SchristosDEPFILES != (${DEPFILEGLOB}; echo ${EXTRAS}) | xargs egrep -l '(_IO\(|_IOR\(|_IOW\(|_IOWR\()' 2>/dev/null || :
361.7Schristos.endif
371.6Schristos
381.24Sdsl${PROG}-ioctl.c: mkioctls Makefile ${DEPFILES} ${SETFILES}
391.10Slukem	${_MKTARGET_CREATE}
401.23Sapb	AWK=${TOOL_AWK:Q} CC="${CC}" DESTDIR="${DESTDIR}" SED=${TOOL_SED:Q} \
411.9Slukem	    ${HOST_SH} ${NETBSDSRCDIR}/usr.bin/kdump/mkioctls \
421.16Stron	    ${DEPFILES} >${.TARGET}
431.16Stron
441.16StronSRCS+=		${PROG}-ioctl.c
451.16StronCLEANFILES+=	${PROG}-ioctl.c
461.19SmattDPSRCS+=	${PROG}-ioctl.c
471.26SchristosCPPFLAGS+=	-I${DESTDIR}/usr/X11R7/include/libdrm
481.26SchristosCPPFLAGS+=	-I${DESTDIR}/usr/X11R7/include/pixman-1
491.26SchristosCPPFLAGS+=	-I${DESTDIR}/usr/X11R7/include
501.32Sknakahar.if ${MKDTRACE} != "no"
511.29SchristosCPPFLAGS+=	-I${NETBSDSRCDIR}/external/cddl/osnet/sys
521.29SchristosCPPFLAGS+=	-I${NETBSDSRCDIR}/external/cddl/osnet/dist/uts/common
531.35SchsCWARNFLAGS+=	-Wno-unknown-pragmas
541.33Smrg.endif
551.31SjoergCPPFLAGS+=	-D_DEV_IC_BT8XX_H_
561.26SchristosCPPFLAGS+=	-D_ALTQ_ALTQ_JOBS_H_	# redefinition of inline
571.26Schristos# De-select one, dup ioctls
581.26SchristosCPPFLAGS+=	-D_VIA_DRM_H_		# Missing header
591.28Schristos#CPPFLAGS+=	-D_I915_DRM_H_		# Dup ioctls
601.28SchristosCPPFLAGS+=	-DQXL_DRM_H		# Dup ioctls
611.26SchristosCPPFLAGS+=	-D__R128_DRM_H__	# Dup ioctls
621.26SchristosCPPFLAGS+=	-D__SIS_DRM_H__		# Dup ioctls
631.26SchristosCPPFLAGS+=	-D__SAVAGE_DRM_H__	# Dup ioctls
641.26SchristosCPPFLAGS+=	-D__RADEON_DRM_H__	# Dup ioctls
651.26SchristosCPPFLAGS+=	-D__MACH64_DRM_H__	# Dup ioctls
661.26SchristosCPPFLAGS+=	-D__MGA_DRM_H__		# Dup ioctls
671.2Smrg
681.6Schristos${DEPFILES}: .PRECIOUS
69