1 1.40 riastrad # $NetBSD: Makefile.ioctl-c,v 1.40 2024/04/01 18:33:24 riastradh Exp $ 2 1.5 lukem 3 1.5 lukem # NOTE: <bsd.own.mk> needs to be previously .included for NETBSDSRCDIR 4 1.1 mrg 5 1.24 dsl # We are trying to get the list of .h files that define all ioctls 6 1.24 dsl # This version grabs the non-obsolete .h files from the set lists 7 1.24 dsl # and silently ignores any that don't exist in ${DESTDIR}. 8 1.24 dsl # NB: The compiler uses the .h files in ${NETBSDSRCDIR}. 9 1.24 dsl 10 1.26 christos SETBASES= ${NETBSDSRCDIR}/distrib/sets/lists/comp \ 11 1.26 christos ${NETBSDSRCDIR}/distrib/sets/lists/xcomp 12 1.26 christos 13 1.26 christos .for sb in ${SETBASES} 14 1.26 christos .if exists(${sb}/mi) 15 1.26 christos SETFILES:=${SETFILES} ${sb}/mi 16 1.26 christos .endif 17 1.24 dsl .for md in md.${MACHINE} /md.${MACHINE}.${MACHINE_ARCH} 18 1.26 christos .if exists(${sb}/${md}) 19 1.26 christos SETFILES:= ${SETFILES} ${sb}/${md} 20 1.24 dsl .endif 21 1.24 dsl .endfor 22 1.26 christos .endfor 23 1.30 joerg .if ${MKDTRACE} != "no" 24 1.29 christos EXTRAS= ${NETBSDSRCDIR}/external/cddl/osnet/dist/uts/common/sys/dtrace.h 25 1.29 christos .endif 26 1.8 thorpej 27 1.25 uebayasi .if !make(cleandir) && !make(obj) && !make(includes) && !make(install) 28 1.34 christos DEPFILEGLOB = ${TOOL_SED} \ 29 1.34 christos -ne '/\/usr\/.*include\/.*\.h[ ]/{s/[ ,]obsolete//;t' \ 30 1.34 christos -e "s/xorg_server_ver=${XORG_SERVER_VER}//;t skipserver" \ 31 1.34 christos -e "s/xorg_server_ver=//;t" \ 32 1.34 christos -e ":skipserver" \ 33 1.34 christos -e 's/xenio//;t' \ 34 1.34 christos -e 's,\.\([^ ]*\).*,${DESTDIR}\1,;p;}' ${SETFILES} 35 1.29 christos DEPFILES != (${DEPFILEGLOB}; echo ${EXTRAS}) | xargs egrep -l '(_IO\(|_IOR\(|_IOW\(|_IOWR\()' 2>/dev/null || : 36 1.7 christos .endif 37 1.6 christos 38 1.16 tron 39 1.16 tron SRCS+= ${PROG}-ioctl.c 40 1.16 tron CLEANFILES+= ${PROG}-ioctl.c 41 1.19 matt DPSRCS+= ${PROG}-ioctl.c 42 1.26 christos CPPFLAGS+= -I${DESTDIR}/usr/X11R7/include/libdrm 43 1.26 christos CPPFLAGS+= -I${DESTDIR}/usr/X11R7/include/pixman-1 44 1.26 christos CPPFLAGS+= -I${DESTDIR}/usr/X11R7/include 45 1.38 rmind CPPFLAGS+= -I${NETBSDSRCDIR}/sys/external/bsd/libnv/dist 46 1.32 knakahar .if ${MKDTRACE} != "no" 47 1.29 christos CPPFLAGS+= -I${NETBSDSRCDIR}/external/cddl/osnet/sys 48 1.29 christos CPPFLAGS+= -I${NETBSDSRCDIR}/external/cddl/osnet/dist/uts/common 49 1.35 chs CWARNFLAGS+= -Wno-unknown-pragmas 50 1.33 mrg .endif 51 1.31 joerg CPPFLAGS+= -D_DEV_IC_BT8XX_H_ 52 1.26 christos CPPFLAGS+= -D_ALTQ_ALTQ_JOBS_H_ # redefinition of inline 53 1.39 mrg CPPFLAGS+= -D_I915_DRM_H_ # Dup ioctls 54 1.39 mrg # Once upon a time these only conflicted with themselves, but noe 55 1.39 mrg # the i915 version conflicts with base ioctls, so that one is now 56 1.39 mrg # always must be excluded. 57 1.26 christos # De-select one, dup ioctls 58 1.26 christos CPPFLAGS+= -D_VIA_DRM_H_ # Missing header 59 1.28 christos CPPFLAGS+= -DQXL_DRM_H # Dup ioctls 60 1.26 christos CPPFLAGS+= -D__R128_DRM_H__ # Dup ioctls 61 1.26 christos CPPFLAGS+= -D__SIS_DRM_H__ # Dup ioctls 62 1.26 christos CPPFLAGS+= -D__SAVAGE_DRM_H__ # Dup ioctls 63 1.39 mrg #CPPFLAGS+= -D__RADEON_DRM_H__ # Dup ioctls 64 1.26 christos CPPFLAGS+= -D__MACH64_DRM_H__ # Dup ioctls 65 1.26 christos CPPFLAGS+= -D__MGA_DRM_H__ # Dup ioctls 66 1.40 riastrad CPPFLAGS+= -D_SYS_ELFDEFINITIONS_H_ # collides with sys/exec_elf.h 67 1.2 mrg 68 1.36 christos ${PROG}-ioctl.c: mkioctls Makefile ${DEPFILES} ${SETFILES} 69 1.36 christos ${_MKTARGET_CREATE} 70 1.37 christos AWK=${TOOL_AWK:q} CC=${CC:q} DESTDIR=${DESTDIR:q} SED=${TOOL_SED:q} \ 71 1.36 christos NETBSDSRCDIR=${NETBSDSRCDIR:q} CPPFLAGS=${CPPFLAGS:q} \ 72 1.36 christos ${HOST_SH} ${NETBSDSRCDIR}/usr.bin/kdump/mkioctls \ 73 1.36 christos ${DEPFILES} >${.TARGET} 74 1.36 christos 75 1.6 christos ${DEPFILES}: .PRECIOUS 76