Home | History | Annotate | Line # | Download | only in kdump
      1 #	$NetBSD: Makefile.ioctl-c,v 1.40 2024/04/01 18:33:24 riastradh 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 SETBASES=	${NETBSDSRCDIR}/distrib/sets/lists/comp \
     11 		${NETBSDSRCDIR}/distrib/sets/lists/xcomp
     12 
     13 .for sb in ${SETBASES}
     14 .if exists(${sb}/mi)
     15 SETFILES:=${SETFILES} ${sb}/mi
     16 .endif
     17 .for md in md.${MACHINE} /md.${MACHINE}.${MACHINE_ARCH}
     18 .if exists(${sb}/${md})
     19 SETFILES:= ${SETFILES} ${sb}/${md}
     20 .endif
     21 .endfor
     22 .endfor
     23 .if ${MKDTRACE} != "no"
     24 EXTRAS=	${NETBSDSRCDIR}/external/cddl/osnet/dist/uts/common/sys/dtrace.h
     25 .endif
     26 
     27 .if !make(cleandir) && !make(obj) && !make(includes) && !make(install)
     28 DEPFILEGLOB = ${TOOL_SED} \
     29     -ne '/\/usr\/.*include\/.*\.h[ 	]/{s/[ 	,]obsolete//;t' \
     30     -e "s/xorg_server_ver=${XORG_SERVER_VER}//;t skipserver" \
     31     -e "s/xorg_server_ver=//;t" \
     32     -e ":skipserver" \
     33     -e 's/xenio//;t' \
     34     -e 's,\.\([^ 	]*\).*,${DESTDIR}\1,;p;}' ${SETFILES}
     35 DEPFILES != (${DEPFILEGLOB}; echo ${EXTRAS}) | xargs egrep -l '(_IO\(|_IOR\(|_IOW\(|_IOWR\()' 2>/dev/null || :
     36 .endif
     37 
     38 
     39 SRCS+=		${PROG}-ioctl.c
     40 CLEANFILES+=	${PROG}-ioctl.c
     41 DPSRCS+=	${PROG}-ioctl.c
     42 CPPFLAGS+=	-I${DESTDIR}/usr/X11R7/include/libdrm
     43 CPPFLAGS+=	-I${DESTDIR}/usr/X11R7/include/pixman-1
     44 CPPFLAGS+=	-I${DESTDIR}/usr/X11R7/include
     45 CPPFLAGS+=	-I${NETBSDSRCDIR}/sys/external/bsd/libnv/dist
     46 .if ${MKDTRACE} != "no"
     47 CPPFLAGS+=	-I${NETBSDSRCDIR}/external/cddl/osnet/sys
     48 CPPFLAGS+=	-I${NETBSDSRCDIR}/external/cddl/osnet/dist/uts/common
     49 CWARNFLAGS+=	-Wno-unknown-pragmas
     50 .endif
     51 CPPFLAGS+=	-D_DEV_IC_BT8XX_H_
     52 CPPFLAGS+=	-D_ALTQ_ALTQ_JOBS_H_	# redefinition of inline
     53 CPPFLAGS+=	-D_I915_DRM_H_		# Dup ioctls
     54 # Once upon a time these only conflicted with themselves, but noe
     55 # the i915 version conflicts with base ioctls, so that one is now
     56 # always must be excluded.
     57 # De-select one, dup ioctls
     58 CPPFLAGS+=	-D_VIA_DRM_H_		# Missing header
     59 CPPFLAGS+=	-DQXL_DRM_H		# Dup ioctls
     60 CPPFLAGS+=	-D__R128_DRM_H__	# Dup ioctls
     61 CPPFLAGS+=	-D__SIS_DRM_H__		# Dup ioctls
     62 CPPFLAGS+=	-D__SAVAGE_DRM_H__	# Dup ioctls
     63 #CPPFLAGS+=	-D__RADEON_DRM_H__	# Dup ioctls
     64 CPPFLAGS+=	-D__MACH64_DRM_H__	# Dup ioctls
     65 CPPFLAGS+=	-D__MGA_DRM_H__		# Dup ioctls
     66 CPPFLAGS+=	-D_SYS_ELFDEFINITIONS_H_	# collides with sys/exec_elf.h
     67 
     68 ${PROG}-ioctl.c: mkioctls Makefile ${DEPFILES} ${SETFILES}
     69 	${_MKTARGET_CREATE}
     70 	AWK=${TOOL_AWK:q} CC=${CC:q} DESTDIR=${DESTDIR:q} SED=${TOOL_SED:q} \
     71 	    NETBSDSRCDIR=${NETBSDSRCDIR:q} CPPFLAGS=${CPPFLAGS:q} \
     72 	    ${HOST_SH} ${NETBSDSRCDIR}/usr.bin/kdump/mkioctls \
     73 	    ${DEPFILES} >${.TARGET}
     74 
     75 ${DEPFILES}: .PRECIOUS
     76