etc/protocols - sync with NetBSD-8
[minix.git] / external / mit / xorg / lib / dri / Makefile
blobc8c1d772f1b4f45d7051484835bfeece61e21541
1 # $NetBSD: Makefile,v 1.26 2015/01/05 18:51:10 gson Exp $
3 # Link the mesa_dri_drivers mega driver.
5 .include <bsd.own.mk>
7 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
9 LIBISMODULE= yes
10 LIBISCXX= yes
12 SHLIB_MAJOR= 0
14 LIB= mesa_dri_drivers
15 DRIDIR= ${X11USRLIBDIR}/modules/dri
16 DRIDEBUGDIR= ${DEBUGDIR}${X11USRLIBDIR}/modules/dri
18 # -I${X11SRCDIR.MesaLib}/src/mesa/drivers/dri/${MODULE}/server \
20 CPPFLAGS+= \
21 -I${X11SRCDIR.MesaLib}/src/egl/main \
22 -I${X11SRCDIR.MesaLib}/src/egl/drivers/dri \
23 -I${X11SRCDIR.MesaLib}/../src/mesa/drivers/dri/common \
24 -I${DESTDIR}${X11INCDIR}/libdrm
26 #CPPFLAGS+= -D_NETBSD_SOURCE -DPTHREADS
27 .if defined(__MINIX)
28 CPPFLAGS+= -DHAVE_PTHREAD=1
29 LDADD+= -lmthread
30 DPADD+= ${LIBMTHREAD}
31 CWARNFLAGS.clang+= -Wno-\#warnings
32 #LSC: For clang 3.4
33 CWARNFLAGS.clang+= -Wno-attributes
34 .endif # defined(__MINIX)
37 # We don't actually build this on non-x86 at all, currently.
38 # The following if statements are not effective since we only
39 # get here for x86
40 .if ${MACHINE_ARCH} == "alpha"
41 DRIVERS= r200 radeon
42 .elif ${MACHINE} == "macppc" || ${MACHINE} == "ofppc"
43 DRIVERS= r200 radeon
44 .elif ${MACHINE_ARCH} == "sparc64" || ${MACHINE_ARCH} == "sparc"
45 DRIVERS= r200 radeon
46 .elif ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
47 DRIVERS= i915 i965 r200 radeon
48 .elif ${MACHINE} == "prep" || ${MACHINE} == "bebox"
49 DRIVERS= r200 radeon
50 .endif
52 DRI_SUBDIRS= ${DRIVERS}
54 DRI_SOURCES.i915 = \
55 i830_context.c \
56 i830_state.c \
57 i830_texblend.c \
58 i830_texstate.c \
59 i830_vtbl.c \
60 i915_tex_layout.c \
61 i915_texstate.c \
62 i915_context.c \
63 i915_debug_fp.c \
64 i915_fragprog.c \
65 i915_program.c \
66 i915_state.c \
67 i915_vtbl.c \
69 I915_INTEL_FILES = \
70 intel_render.c \
71 intel_regions.c \
72 intel_buffer_objects.c \
73 intel_batchbuffer.c \
74 intel_clear.c \
75 intel_extensions.c \
76 intel_mipmap_tree.c \
77 intel_tex_layout.c \
78 intel_tex_image.c \
79 intel_tex_subimage.c \
80 intel_tex_copy.c \
81 intel_tex_validate.c \
82 intel_tex.c \
83 intel_pixel.c \
84 intel_pixel_bitmap.c \
85 intel_pixel_copy.c \
86 intel_pixel_draw.c \
87 intel_pixel_read.c \
88 intel_buffers.c \
89 intel_blit.c \
90 intel_context.c \
91 intel_screen.c \
92 intel_state.c \
93 intel_syncobj.c \
94 intel_tris.c \
95 intel_fbo.c
97 .for _f in ${I915_INTEL_FILES}
98 BUILDSYMLINKS+= ${X11SRCDIR.MesaLib}/src/mesa/drivers/dri/i915/${_f} i915_${_f}
99 DRI_SOURCES.i915+= i915_${_f}
100 CPPFLAGS.i915_${_f}+= -I${X11SRCDIR.MesaLib}/src/mesa/drivers/dri/i915
101 .endfor
103 DRI_SOURCES.i965 = \
104 brw_binding_tables.c \
105 brw_blorp.cpp \
106 brw_blorp_blit.cpp \
107 brw_blorp_blit_eu.cpp \
108 brw_cc.c \
109 brw_cfg.cpp \
110 brw_clear.c \
111 brw_clip.c \
112 brw_clip_line.c \
113 brw_clip_point.c \
114 brw_clip_state.c \
115 brw_clip_tri.c \
116 brw_clip_unfilled.c \
117 brw_clip_util.c \
118 brw_context.c \
119 brw_cubemap_normalize.cpp \
120 brw_curbe.c \
121 brw_dead_control_flow.cpp \
122 brw_device_info.c \
123 brw_disasm.c \
124 brw_draw.c \
125 brw_draw_upload.c \
126 brw_eu.c \
127 brw_eu_compact.c \
128 brw_eu_emit.c \
129 brw_eu_util.c \
130 brw_fs.cpp \
131 brw_fs_channel_expressions.cpp \
132 brw_fs_copy_propagation.cpp \
133 brw_fs_cse.cpp \
134 brw_fs_dead_code_eliminate.cpp \
135 brw_fs_fp.cpp \
136 brw_fs_generator.cpp \
137 brw_fs_live_variables.cpp \
138 brw_fs_peephole_predicated_break.cpp \
139 brw_fs_reg_allocate.cpp \
140 brw_fs_register_coalesce.cpp \
141 brw_fs_saturate_propagation.cpp \
142 brw_fs_sel_peephole.cpp \
143 brw_fs_vector_splitting.cpp \
144 brw_fs_visitor.cpp \
145 brw_gs.c \
146 brw_gs_emit.c \
147 brw_gs_state.c \
148 brw_gs_surface_state.c \
149 brw_gs.c \
150 brw_gs_emit.c \
151 brw_gs_state.c \
152 brw_gs_surface_state.c \
153 brw_interpolation_map.c \
154 brw_lower_texture_gradients.cpp \
155 brw_lower_unnormalized_offset.cpp \
156 brw_meta_updownsample.c \
157 brw_meta_stencil_blit.c \
158 brw_meta_util.c \
159 brw_meta_fast_clear.c \
160 brw_misc_state.c \
161 brw_object_purgeable.c \
162 brw_performance_monitor.c \
163 brw_program.c \
164 brw_primitive_restart.c \
165 brw_queryobj.c \
166 brw_reset.c \
167 brw_sampler_state.c \
168 brw_schedule_instructions.cpp \
169 brw_sf.c \
170 brw_sf_emit.c \
171 brw_sf_state.c \
172 brw_shader.cpp \
173 brw_state_batch.c \
174 brw_state_cache.c \
175 brw_state_dump.c \
176 brw_state_upload.c \
177 brw_surface_formats.c \
178 brw_tex.c \
179 brw_tex_layout.c \
180 brw_urb.c \
181 brw_util.c \
182 brw_vec4.cpp \
183 brw_vec4_copy_propagation.cpp \
184 brw_vec4_cse.cpp \
185 brw_vec4_generator.cpp \
186 brw_vec4_gs.c \
187 brw_vec4_gs_visitor.cpp \
188 brw_vec4_live_variables.cpp \
189 brw_vec4_reg_allocate.cpp \
190 brw_vec4_visitor.cpp \
191 brw_vec4_vp.cpp \
192 brw_vec4_vs_visitor.cpp \
193 brw_vs.c \
194 brw_vs_state.c \
195 brw_vs_surface_state.c \
196 brw_wm.c \
197 brw_wm_iz.cpp \
198 brw_wm_state.c \
199 brw_wm_surface_state.c \
200 gen6_blorp.cpp \
201 gen6_cc.c \
202 gen6_clip_state.c \
203 gen6_depth_state.c \
204 gen6_depthstencil.c \
205 gen6_gs_state.c \
206 gen6_multisample_state.c \
207 gen6_queryobj.c \
208 gen6_sampler_state.c \
209 gen6_scissor_state.c \
210 gen6_sf_state.c \
211 gen6_sol.c \
212 gen6_surface_state.c \
213 gen6_urb.c \
214 gen6_viewport_state.c \
215 gen6_vs_state.c \
216 gen6_wm_state.c \
217 gen7_blorp.cpp \
218 gen7_disable.c \
219 gen7_gs_state.c \
220 gen7_misc_state.c \
221 gen7_sf_state.c \
222 gen7_sol_state.c \
223 gen7_urb.c \
224 gen7_viewport_state.c \
225 gen7_vs_state.c \
226 gen7_wm_state.c \
227 gen7_wm_surface_state.c \
228 gen8_blend_state.c \
229 gen8_depth_state.c \
230 gen8_disable.c \
231 gen8_draw_upload.c \
232 gen8_gs_state.c \
233 gen8_misc_state.c \
234 gen8_multisample_state.c \
235 gen8_sf_state.c \
236 gen8_sol_state.c \
237 gen8_surface_state.c \
238 gen8_viewport_state.c \
239 gen8_vs_state.c \
240 gen8_wm_depth_stencil.c \
241 gen8_ps_state.c
243 I965_INTEL_FILES = \
244 intel_asm_annotation.c \
245 intel_batchbuffer.c \
246 intel_blit.c \
247 intel_buffer_objects.c \
248 intel_buffers.c \
249 intel_copy_image.c \
250 intel_debug.c \
251 intel_extensions.c \
252 intel_fbo.c \
253 intel_mipmap_tree.c \
254 intel_resolve_map.c \
255 intel_screen.c \
256 intel_pixel.c \
257 intel_pixel_bitmap.c \
258 intel_pixel_copy.c \
259 intel_pixel_draw.c \
260 intel_pixel_read.c \
261 intel_state.c \
262 intel_syncobj.c \
263 intel_tex.c \
264 intel_tex_copy.c \
265 intel_tex_image.c \
266 intel_tex_subimage.c \
267 intel_tex_validate.c \
268 intel_upload.c \
270 .for _f in ${I965_INTEL_FILES}
271 BUILDSYMLINKS+= ${X11SRCDIR.MesaLib}/src/mesa/drivers/dri/i965/${_f} i965_${_f}
272 DRI_SOURCES.i965+= i965_${_f}
273 CPPFLAGS.i965_${_f} += -I${X11SRCDIR.MesaLib}/src/mesa/drivers/dri/i965
274 .endfor
276 DRI_SOURCES.r200 = \
277 r200_context.c \
278 r200_ioctl.c \
279 r200_state.c \
280 r200_state_init.c \
281 r200_cmdbuf.c \
282 r200_tex.c \
283 r200_texstate.c \
284 r200_tcl.c \
285 r200_swtcl.c \
286 r200_maos.c \
287 r200_sanity.c \
288 r200_fragshader.c \
289 r200_vertprog.c \
290 r200_blit.c \
292 R200_RADEON_FILES= \
293 radeon_buffer_objects.c \
294 radeon_common_context.c \
295 radeon_common.c \
296 radeon_dma.c \
297 radeon_debug.c \
298 radeon_fbo.c \
299 radeon_fog.c \
300 radeon_mipmap_tree.c \
301 radeon_pixel_read.c \
302 radeon_queryobj.c \
303 radeon_span.c \
304 radeon_texture.c \
305 radeon_tex_copy.c \
306 radeon_tile.c \
307 radeon_screen.c
309 .for _f in ${R200_RADEON_FILES}
310 BUILDSYMLINKS+= ${X11SRCDIR.MesaLib}/src/mesa/drivers/dri/radeon/${_f} r200_${_f}
311 DRI_SOURCES.r200+= r200_${_f}
312 .endfor
314 .for _f in ${DRI_SOURCES.r200}
315 CPPFLAGS.${_f} += -I${X11SRCDIR.MesaLib}/src/mesa/drivers/dri/r200/server \
316 -I${X11SRCDIR.MesaLib}/src/mesa/drivers/dri/r200 \
317 -I${X11SRCDIR.MesaLib}/src/mesa/drivers/dri/radeon/server \
318 -I${X11SRCDIR.MesaLib}/src/mesa/drivers/dri/radeon \
319 -DRADEON_R200
320 .endfor
322 DRI_SOURCES.radeon = \
323 radeon_buffer_objects.c \
324 radeon_common_context.c \
325 radeon_common.c \
326 radeon_dma.c \
327 radeon_debug.c \
328 radeon_fbo.c \
329 radeon_fog.c \
330 radeon_mipmap_tree.c \
331 radeon_pixel_read.c \
332 radeon_queryobj.c \
333 radeon_span.c \
334 radeon_texture.c \
335 radeon_tex_copy.c \
336 radeon_tile.c \
337 radeon_context.c \
338 radeon_ioctl.c \
339 radeon_screen.c \
340 radeon_state.c \
341 radeon_state_init.c \
342 radeon_tex.c \
343 radeon_texstate.c \
344 radeon_tcl.c \
345 radeon_swtcl.c \
346 radeon_maos.c \
347 radeon_sanity.c \
348 radeon_blit.c
350 .for _f in ${DRI_SOURCES.radeon}
351 CPPFLAGS.${_f} += -I${X11SRCDIR.MesaLib}/src/mesa/drivers/dri/radeon/server \
352 -I${X11SRCDIR.MesaLib}/src/mesa/drivers/dri/radeon \
353 -DRADEON_R100
354 .endfor
356 .for _d in ${DRI_SUBDIRS}
357 SRCS+= ${DRI_SOURCES.${_d}}
358 .PATH: ${X11SRCDIR.MesaLib}/src/mesa/drivers/dri/${_d}
359 .endfor
361 LIBDPLIBS+= expat ${NETBSDSRCDIR}/external/mit/expat/lib/libexpat
362 LIBDPLIBS+= m ${NETBSDSRCDIR}/lib/libm
363 LIBDPLIBS+= glapi ${.CURDIR}/../libglapi
364 LIBDPLIBS+= drm ${.CURDIR}/../libdrm
365 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
366 LIBDPLIBS+= drm_intel ${.CURDIR}/../libdrm_intel
367 .endif
368 LIBDPLIBS+= drm_radeon ${.CURDIR}/../libdrm_radeon
370 MESA_SRC_MODULES= main math math_xform vbo tnl swrast ss common asm_c program asm_s
371 .include "../libmesa.mk"
372 .include "../libglsl.mk"
374 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
375 SRCS+= streaming-load-memcpy.c
376 CPPFLAGS.streaming-load-memcpy.c+= -msse4.1
377 .endif
379 .include "../driver.mk"
381 .for _d in ${DRIVERS}
382 SYMLINKS+= mesa_dri_drivers.so.${SHLIB_MAJOR} ${DRIDIR}/${_d}_dri.so.${SHLIB_MAJOR}
383 SYMLINKS+= ${_d}_dri.so.${SHLIB_MAJOR} ${DRIDIR}/${_d}_dri.so
384 .if ${MKDEBUG} != "no"
385 SYMLINKS+= mesa_dri_drivers.so.${SHLIB_MAJOR}.debug ${DRIDEBUGDIR}/${_d}_dri.so.${SHLIB_MAJOR}.debug
386 .endif
387 .endfor
389 .endif
391 PKGCONFIG= dri
392 PKGDIST.dri= ${X11SRCDIR.MesaLib}/src/mesa/drivers/dri
393 .include "${.CURDIR}/../libGL/mesa-ver.mk"
394 PKGCONFIG_VERSION.dri= ${MESA_VER}
396 # XXX remove these from bsd.x11.mk
397 PKGCONFIG_SED_FLAGS= \
398 -e "s,@DRI_DRIVER_INSTALL_DIR@,${X11USRLIBDIR}/modules/dri,; \
399 s,@DRI_PC_REQ_PRIV@,,"
401 FILESDIR= /etc
402 FILES= drirc
404 .PATH: ${X11SRCDIR.MesaLib}/src/mesa/drivers/dri/common
406 .include <bsd.x11.mk>
407 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
408 LIBDIR= ${X11USRLIBDIR}/modules/dri
410 CWARNFLAGS.clang+= -Wno-error=initializer-overrides -Wno-error=switch \
411 -Wno-error=tautological-constant-out-of-range-compare
413 .include <bsd.lib.mk>
414 .else
415 .include <bsd.inc.mk>
416 .endif
417 # Don't re-build .c files when .y files change
418 .y.c: