1#	$NetBSD: Makefile,v 1.51 2022/07/15 04:18:55 mrg Exp $
2
3.include "../../../Makefile.serverlib"
4.include "../../../Makefile.servermod"
5
6LIB=	xorgos
7
8.PATH:	${X11SRCDIR.xorg-server}/hw/xfree86/os-support
9.PATH:	${X11SRCDIR.xorg-server}/hw/xfree86/os-support/bsd
10.PATH:	${X11SRCDIR.xorg-server}/hw/xfree86/os-support/shared
11SRCS.bsd=	\
12		bsd_VTsw.c bsd_bell.c bsd_init.c bsd_pci.c \
13		kmod_noop.c pm_noop.c \
14		posix_tty.c sigio.c vidmem.c
15
16.PATH:	${X11SRCDIR.xorg-server}/hw/xfree86/os-support/linux
17.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
18SRCS.bsd+=	i386_video.c lnx_agp.c
19.for _FN in ${SRCS.bsd}
20.if ${MACHINE_ARCH} == "i386"
21CPPFLAGS.${_FN}+=	-DPCCONS_SUPPORT -DHAS_APERTURE_DRV
22CPPFLAGS.${_FN}+=	-DUSE_I386_IOPL
23.else
24CPPFLAGS.${_FN}+=	-DUSE_AMD64_IOPL
25.endif
26CPPFLAGS.${_FN}+=	-DPCVT_SUPPORT -DWSCONS_SUPPORT \
27			-DUSESTDRES -DHAVE_SYSV_IPC \
28			-DHAS_MTRR_BUILTIN
29.endfor
30.endif
31
32.if ${MACHINE_CPU} == "powerpc" || ${MACHINE} == "hppa"
33SRCS.bsd+=	ppc_video.c
34.  if ${MACHINE} != "evbppc"
35SRCS.bsd+=	lnx_agp.c
36.  else
37SRCS.bsd+=	agp_noop.c
38.  endif
39.for _FN in ${SRCS.bsd}
40CPPFLAGS.${_FN}=	-DWSCONS_SUPPORT -DPCVT_SUPPORT -DUSESTDRES -DHAVE_SYSV_IPC
41.endfor
42.endif
43
44.if ${MACHINE_ARCH} == "alpha"
45SRCS.bsd+=	alpha_video.c agp_noop.c
46.for _FN in ${SRCS.bsd}
47CPPFLAGS.${_FN}=	-DWSCONS_SUPPORT -DUSESTDRES -DHAVE_SYSV_IPC -DUSE_ALPHA_PIO
48.endfor
49.endif
50
51.if ${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "sparc64"
52SRCS.bsd+=	ppc_video.c agp_noop.c
53SRCS.bus+=	netbsdSbus.c
54.for _FN in ${SRCS.bsd}
55CPPFLAGS.${_FN}=	-DWSCONS_SUPPORT -DPCVT_SUPPORT -DUSESTDRES -DHAVE_SYSV_IPC
56.endfor
57.endif
58
59.if ${MACHINE} == "ews4800mips" || \
60    ${MACHINE} == "hpcmips" || \
61    ${MACHINE} == "newsmips" || \
62    ${MACHINE} == "sgimips" || \
63    ${MACHINE} == "evbmips"
64SRCS.bsd+=	ppc_video.c agp_noop.c
65.for _FN in ${SRCS.bsd}
66CPPFLAGS.${_FN}=	-DWSCONS_SUPPORT -DPCVT_SUPPORT  -DUSESTDRES -DHAVE_SYSV_IPC
67.endfor
68.endif
69
70.if ${MACHINE} == "cats" || \
71    ${MACHINE} == "evbarm" || \
72    ${MACHINE} == "hpcarm" || \
73    ${MACHINE} == "iyonix" || \
74    ${MACHINE} == "shark" || \
75    ${MACHINE} == "netwinder" || \
76    ${MACHINE} == "zaurus"
77SRCS.bsd+=      ppc_video.c agp_noop.c
78.for _FN in ${SRCS.bsd}
79CPPFLAGS.${_FN}=        -DWSCONS_SUPPORT -DPCVT_SUPPORT -DUSESTDRES -DHAVE_SYSV_IPC
80.endfor
81.endif
82
83.if ${MACHINE} == "shark"
84CPPFLAGS.ppc_video.c += -DPCI_MAGIC_IO_RANGE=0xf0000000
85.endif
86
87.if ${MACHINE} == "dreamcast" || \
88    ${MACHINE} == "hpcsh"
89SRCS.bsd+=	ppc_video.c agp_noop.c
90.for _FN in ${SRCS.bsd}
91CPPFLAGS.${_FN}=	-DWSCONS_SUPPORT -DUSESTDRES -DHAVE_SYSV_IPC
92.endfor
93.endif
94
95.if ${MACHINE} == "amiga" || \
96    ${MACHINE} == "hp300" || \
97    ${MACHINE} == "luna68k" || \
98    ${MACHINE} == "mac68k"
99SRCS.bsd+=	ppc_video.c agp_noop.c
100.for _FN in ${SRCS.bsd}
101CPPFLAGS.${_FN}=	-DWSCONS_SUPPORT -DUSESTDRES -DHAVE_SYSV_IPC
102.endfor
103.endif
104
105.if ${MACHINE} == "pmax" || \
106    ${MACHINE} == "vax"
107SRCS.bsd+=	ppc_video.c agp_noop.c
108.for _FN in ${SRCS.bsd}
109CPPFLAGS.${_FN}=	-DWSCONS_SUPPORT -DUSESTDRES -DHAVE_SYSV_IPC
110.endfor
111.endif
112
113# some platforms will probably need ioperm_noop.c
114
115.PATH:	${X11SRCDIR.xorg-server}/hw/xfree86/os-support/bus
116SRCS.bus+=	Pci.c
117
118.if ${MACHINE} == "macppc" || ${MACHINE} == "cats" || \
119    ${MACHINE} == "sgimips" || ${MACHINE} == "shark" || \
120    ${MACHINE} == "netwinder" || ${MACHINE_ARCH} == "sparc" || \
121    ${MACHINE_ARCH} == "sparc64" || ${MACHINE_ARCH} == "alpha" || \
122    ${MACHINE} == "prep" || ${MACHINE} == "bebox" || \
123    ${MACHINE} == "ofppc" || ${MACHINE} == "ibmnws"
124#SRCS.bus+=	netbsdPci.c
125.endif
126
127.if ${MACHINE} == "sparc" || ${MACHINE} == "sparc64" || \
128    ${MACHINE_ARCH} == "powerpc" || ${MACHINE} == "netwinder"
129#CPPFLAGS.netbsdPci.c+= -DPCI_VIA_TTYE0
130.endif
131
132.if     ${MACHINE} == "macppc" || ${MACHINE} == "cats" || \
133	${MACHINE} == "sgimips" || ${MACHINE_ARCH} == "sparc64" || \
134	${MACHINE_ARCH} == "sparc" || ${MACHINE} == "netwinder" || \
135	${MACHINE} == "shark" || ${MACHINE} == "ofppc" || \
136	${MACHINE_ARCH} == "alpha" || ${MACHINE} == "prep" || \
137	${MACHINE} == "bebox" || ${MACHINE} == "ibmnws"
138#SRCS.misc+=     CBUSmemcpy.c CIODelay.c CSlowBcopy.c
139.endif
140
141# All platforms get this.
142SRCS.bus+=	nobus.c
143
144.PATH:		${X11SRCDIR.xorg-server}/hw/xfree86/os-support/misc
145SRCS.misc+=     SlowBcopy.c
146
147SRCS=	${SRCS.bsd} ${SRCS.bus} ${SRCS.misc}
148
149CPPFLAGS+=	-I${X11SRCDIR.xorg-server}/hw/xfree86/common \
150		-I${X11SRCDIR.xorg-server}/hw/xfree86/os-support \
151		-I${X11SRCDIR.xorg-server}/hw/xfree86/os-support/bsd \
152		-I${X11SRCDIR.xorg-server}/hw/xfree86/os-support/bus \
153		-I${X11SRCDIR.xorg-server}/hw/xfree86/os-support/misc \
154		-I${X11SRCDIR.xorg-server}/include \
155		-I${X11SRCDIR.xorg-server}/miext/damage \
156		-I${X11SRCDIR.xorg-server}/render \
157		-I${X11SRCDIR.xorg-server}/present \
158		-I${DESTDIR}${X11INCDIR}/X11 \
159		-I${DESTDIR}${X11INCDIR}/X11/extensions \
160		-I${DESTDIR}${X11INCDIR}/pixman-1 \
161		-I${X11SRCDIR.xorg-server}/mi \
162		-I${X11SRCDIR.xorg-server}/Xext \
163		-I${X11SRCDIR.xorg-server}/hw/xfree86/os-support/shared \
164		-I${X11SRCDIR.xorg-server}/../include
165.if ${X11DRI} != "no"
166CPPFLAGS+=	${X11FLAGS.DRI}
167.endif
168
169CWARNFLAGS.clang+=	-Wno-error=empty-body
170
171.include <bsd.x11.mk>
172.include <bsd.lib.mk>
173