11.9Sriastrad# $NetBSD: Makefile.inc,v 1.9 2022/07/20 01:11:39 riastradh Exp $
21.2Sriastrad
31.2Sriastrad# Common makefile cruft for drm2 code.
41.2Sriastrad
51.2Sriastrad# XXX All the -D crap needs to go in a header file instead so changing
61.2Sriastrad# it correctly triggers rebuilds.
71.2Sriastrad
81.6SriastradCOPTS+=		-fwrapv
91.6Sriastrad
101.5Sriastrad# Overrides first.
111.2SriastradCPPFLAGS+=	-I${S}/external/bsd/drm2/include
121.6SriastradCPPFLAGS+=	-I${S}/external/bsd/drm2/include/drm
131.5Sriastrad
141.5SriastradCPPFLAGS+=	-I${S}/external/bsd/common/include
151.5Sriastrad
161.5Sriastrad# Then upstream.
171.4SriastradCPPFLAGS+=	-I${S}/external/bsd/drm2/dist/include
181.4SriastradCPPFLAGS+=	-I${S}/external/bsd/drm2/dist/include/drm
191.6SriastradCPPFLAGS+=	-I${S}/external/bsd/drm2/dist/include/uapi
201.5Sriastrad
211.6SriastradCPPFLAGS+=	-D__KERNEL__
221.5Sriastrad
231.6Sriastrad.if ${MACHINE_ARCH} == "i386"
241.6SriastradCPPFLAGS+=	-DCONFIG_X86
251.6SriastradCPPFLAGS+=	-DCONFIG_X86_PAT
261.6Sriastrad.elif ${MACHINE_ARCH} == "x86_64"
271.6SriastradCPPFLAGS+=	-DCONFIG_X86
281.6SriastradCPPFLAGS+=	-DCONFIG_X86_64
291.6SriastradCPPFLAGS+=	-DCONFIG_X86_PAT
301.6Sriastrad.elif ${MACHINE} == "evbarm"
311.6SriastradCPPFLAGS+=	-DCONFIG_ARM
321.6Sriastrad.elif ${MACHINE_ARCH} == "aarch64"
331.7SriastradCPPFLAGS+=	-DCONFIG_ARM64
341.9Sriastrad.elif ${MACHINE_ARCH} == "alpha"
351.9SriastradCPPFLAGS+=	-Ualpha
361.6Sriastrad.endif
371.2Sriastrad
381.5SriastradCPPFLAGS+=	-DCONFIG_BACKLIGHT_CLASS_DEVICE=0
391.5SriastradCPPFLAGS+=	-DCONFIG_BACKLIGHT_CLASS_DEVICE_MODULE=0
401.7SriastradCPPFLAGS+=	-DCONFIG_DRM_FBDEV_EMULATION=1
411.7SriastradCPPFLAGS+=	-DCONFIG_DRM_FBDEV_OVERALLOC=100
421.5SriastradCPPFLAGS+=	-DCONFIG_FB=0
431.6SriastradCPPFLAGS+=	-DCONFIG_LOCKDEP=0
441.6SriastradCPPFLAGS+=	-DCONFIG_PCI=1
451.6Sriastrad
461.6SriastradCWARNFLAGS+=	-Wno-missing-field-initializers
471.5Sriastrad
481.8Sriastrad# Needed for drmums modules.
491.8SriastradCPPFLAGS+=	-DCONFIG_DRM_LEGACY
501.8Sriastrad
511.2Sriastrad# XXX Is this the right place to set this?
521.2SriastradCPPFLAGS+=	-DDIAGNOSTIC
53