Makefile revision 1.62 1 # $NetBSD: Makefile,v 1.62 2025/10/27 10:29:41 jmcneill Exp $
2
3 # Link the gallium mega driver.
4
5 LIBISMODULE= yes
6 LIBISCXX= yes
7
8 NOLINT= # Lots of "Unsupported platform" due to undefined __GNUC__
9
10 .include <bsd.own.mk>
11
12 .include "../mesa-which.mk"
13
14 SHLIB_MAJOR= 0
15
16 LIB= gallium_dri
17 DRIDIR= ${X11USRLIBDIR}/modules/dri
18 DRIDEBUGDIR= ${DEBUGDIR}${X11USRLIBDIR}/modules/dri
19
20 LLVM_INCLUDE_OBJDIR!= cd ${NETBSDSRCDIR}/external/apache2/llvm/include && ${PRINTOBJDIR}
21
22 CWARNFLAGS.clang += -Wno-atomic-alignment -Wno-unknown-warning-option -Wno-implicit-int-float-conversion -Wno-c99-designator
23
24 CXXFLAGS+= -std=c++14
25 CFLAGS+= -std=gnu11
26 CPPFLAGS+= -I${DESTDIR}${X11INCDIR}/libdrm \
27 -I${NETBSDSRCDIR}/external/apache2/llvm/dist/llvm/include \
28 -I${LLVM_INCLUDE_OBJDIR} -I${NETBSDSRCDIR}/external/apache2/llvm/config
29
30 CFLAGS+= -pthread
31 LDFLAGS+= -pthread
32
33 LDFLAGS+= -Wl,--build-id=sha1
34
35 # Reduce debugging for these extremely large objects.
36 .if ${MKDEBUG:Uno} != "no"
37 #CXXFLAGS+= -g1
38 #CFLAGS+= -g1
39 .endif
40
41 GALLIUM_SUBDIRS= \
42 auxiliary \
43 auxiliary/cso_cache \
44 auxiliary/draw \
45 auxiliary/driver_ddebug \
46 auxiliary/driver_noop \
47 auxiliary/driver_rbug \
48 auxiliary/driver_trace \
49 auxiliary/hud \
50 auxiliary/indices \
51 auxiliary/nir \
52 auxiliary/os \
53 auxiliary/pipebuffer \
54 auxiliary/pipe-loader \
55 auxiliary/postprocess \
56 auxiliary/rbug \
57 auxiliary/renderonly \
58 auxiliary/rtasm \
59 auxiliary/tessellator \
60 auxiliary/tgsi \
61 auxiliary/translate \
62 auxiliary/util \
63 auxiliary/vl \
64 drivers/noop \
65 drivers/rbug \
66 drivers/softpipe \
67 winsys/sw/dri \
68 winsys/sw/kms-dri \
69 winsys/sw/null \
70 winsys/sw/wrapper \
71 frontends/dri
72
73 GALLIUM_SUBDIRS_VDPAU= \
74 frontends/vdpau
75
76 GALLIUM_SUBDIRS_LLVMPIPE= \
77 auxiliary/gallivm \
78 drivers/llvmpipe
79
80 GALLIUM_SUBDIRS_ATI= \
81 drivers/radeon \
82 drivers/radeonsi \
83 drivers/r300 \
84 drivers/r300/compiler \
85 drivers/r600 \
86 drivers/r600/sb \
87 drivers/r600/sfn \
88 winsys/radeon/drm \
89 winsys/amdgpu/drm
90
91 GALLIUM_SUBDIRS_I915= \
92 drivers/i915 \
93 winsys/i915/drm
94
95 GALLIUM_SUBDIRS_IRIS= \
96 drivers/iris \
97 winsys/iris/drm
98
99 GALLIUM_SUBDIRS_CROCUS= \
100 drivers/crocus \
101 winsys/crocus/drm
102
103 GALLIUM_SUBDIRS_NOUVEAU= \
104 drivers/nouveau \
105 drivers/nouveau/nv30 \
106 drivers/nouveau/nv50 \
107 drivers/nouveau/codegen \
108 drivers/nouveau/nvc0 \
109 winsys/nouveau/drm
110
111 BUILD_RADEON=0
112 BUILD_NOUVEAU=0
113 BUILD_VDPAU=0
114 BUILD_LLVMPIPE=0
115 BUILD_I915=0
116 BUILD_IRIS=0
117 BUILD_CROCUS=0
118 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
119 BUILD_I915=1
120 #BUILD_IRIS=1
121 #BUILD_CROCUS=1
122 .endif
123 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" || ${MACHINE} == "evbarm"
124 BUILD_NOUVEAU=1
125 . if ${MKLLVMRT} != "no"
126 BUILD_RADEON=1
127 . endif
128 BUILD_VDPAU=1
129 .endif
130
131 .if ${MACHINE_ARCH} == "i386" || \
132 ${MACHINE_ARCH} == "x86_64" || \
133 ${MACHINE_ARCH} == "powerpc" || \
134 ${MACHINE_ARCH} == "powerpc64" || \
135 !empty(MACHINE_ARCH:Maarch64*) || \
136 !empty(MACHINE_ARCH:Mmips*) || \
137 !empty(MACHINE_ARCH:Mearm*) || \
138 !empty(MACHINE_ARCH:Marm*)
139 . if ${MKLLVMRT} != "no"
140 BUILD_LLVMPIPE=1
141 . endif
142 .endif
143
144 DRIVERS= kms_swrast swrast
145 .if ${BUILD_RADEON} == 1
146 DRIVERS+= r600 r300 radeonsi
147 GALLIUM_SUBDIRS+= ${GALLIUM_SUBDIRS_ATI}
148 .endif
149 .if ${BUILD_NOUVEAU} == 1
150 DRIVERS+= nouveau
151 GALLIUM_SUBDIRS+= ${GALLIUM_SUBDIRS_NOUVEAU}
152 .endif
153 .if ${BUILD_VDPAU} == 1
154 GALLIUM_SUBDIRS+= ${GALLIUM_SUBDIRS_VDPAU}
155 .endif
156 .if ${BUILD_I915} == 1
157 GALLIUM_SUBDIRS+= ${GALLIUM_SUBDIRS_I915}
158 .endif
159 .if ${BUILD_IRIS} == 1
160 GALLIUM_SUBDIRS+= ${GALLIUM_SUBDIRS_IRIS}
161 .endif
162 .if ${BUILD_CROCUS} == 1
163 GALLIUM_SUBDIRS+= ${GALLIUM_SUBDIRS_CROCUS}
164 .endif
165 .if ${BUILD_LLVMPIPE} == 1
166 GALLIUM_SUBDIRS+= ${GALLIUM_SUBDIRS_LLVMPIPE}
167 .endif
168
169 GALLIUM_SOURCES.auxiliary/cso_cache= \
170 cso_cache.c \
171 cso_context.c \
172 cso_hash.c
173
174 GALLIUM_SOURCES.auxiliary/draw= \
175 draw_context.c \
176 draw_fs.c \
177 draw_gs.c \
178 draw_pipe_aaline.c \
179 draw_pipe_aapoint.c \
180 draw_pipe.c \
181 draw_pipe_clip.c \
182 draw_pipe_cull.c \
183 draw_pipe_flatshade.c \
184 draw_pipe_offset.c \
185 draw_pipe_pstipple.c \
186 draw_pipe_stipple.c \
187 draw_pipe_twoside.c \
188 draw_pipe_unfilled.c \
189 draw_pipe_user_cull.c \
190 draw_pipe_util.c \
191 draw_pipe_validate.c \
192 draw_pipe_vbuf.c \
193 draw_pipe_wide_line.c \
194 draw_pipe_wide_point.c \
195 draw_prim_assembler.c \
196 draw_pt.c \
197 draw_pt_emit.c \
198 draw_pt_fetch.c \
199 draw_pt_fetch_shade_emit.c \
200 draw_pt_fetch_shade_pipeline.c \
201 draw_pt_post_vs.c \
202 draw_pt_so_emit.c \
203 draw_pt_util.c \
204 draw_pt_vsplit.c \
205 draw_tess.c \
206 draw_vertex.c \
207 draw_vs.c \
208 draw_vs_exec.c \
209 draw_vs_variant.c
210
211 .if ${MKLLVMRT} != "no"
212 GALLIUM_SOURCES.auxiliary/draw+= \
213 draw_llvm.c \
214 draw_llvm_sample.c \
215 draw_pt_fetch_shade_pipeline_llvm.c \
216 draw_vs_llvm.c
217 .endif
218
219 GALLIUM_SOURCES.auxiliary/hud= \
220 font.c \
221 hud_context.c \
222 hud_cpu.c \
223 hud_nic.c \
224 hud_cpufreq.c \
225 hud_diskstat.c \
226 hud_sensors_temp.c \
227 hud_fps.c \
228 hud_driver_query.c
229 GALLIUM_SOURCES.auxiliary/indices= \
230 u_primconvert.c
231 GALLIUM_SOURCES.auxiliary/os= \
232 os_process.c
233 GALLIUM_SOURCES.auxiliary/pipe-loader= \
234 pipe_loader.c \
235 pipe_loader_drm.c \
236 pipe_loader_sw.c
237
238 .for _f in ${GALLIUM_SOURCES.auxiliary/pipe-loader}
239 CPPFLAGS.${_f} += -DHAVE_PIPE_LOADER_KMS=1 \
240 -DHAVE_PIPE_LOADER_DRI=1 \
241 -DGALLIUM_STATIC_TARGETS=1 \
242 -I${X11SRCDIR.Mesa}/src/gallium/winsys \
243 -I${X11SRCDIR.Mesa}/src/loader \
244 -I${X11SRCDIR.Mesa}/../src/util
245 .endfor
246
247 GALLIUM_SOURCES.auxiliary/pipebuffer= \
248 pb_buffer_fenced.c \
249 pb_bufmgr_cache.c \
250 pb_bufmgr_debug.c \
251 pb_bufmgr_mm.c \
252 pb_bufmgr_slab.c \
253 pb_cache.c \
254 pb_slab.c \
255 pb_validate.c
256 GALLIUM_SOURCES.auxiliary/postprocess= \
257 pp_celshade.c \
258 pp_colors.c \
259 pp_init.c \
260 pp_mlaa.c \
261 pp_run.c \
262 pp_program.c
263 GALLIUM_SOURCES.auxiliary/rbug= \
264 rbug_connection.c \
265 RBUGrbug_context.c \
266 RBUGrbug_core.c \
267 rbug_demarshal.c \
268 rbug_texture.c \
269 rbug_shader.c
270 GALLIUM_SOURCES.auxiliary/rtasm= \
271 rtasm_cpu.c \
272 rtasm_execmem.c \
273 rtasm_x86sse.c
274 GALLIUM_SOURCES.auxiliary/tessellator= \
275 p_tessellator.cpp \
276 tessellator.cpp
277 GALLIUM_SOURCES.auxiliary/tgsi= \
278 tgsi_aa_point.c \
279 tgsi_build.c \
280 tgsi_dump.c \
281 tgsi_exec.c \
282 tgsi_emulate.c \
283 tgsi_from_mesa.c \
284 tgsi_info.c \
285 tgsi_iterate.c \
286 tgsi_lowering.c \
287 tgsi_parse.c \
288 tgsi_point_sprite.c \
289 tgsi_sanity.c \
290 tgsi_scan.c \
291 tgsi_strings.c \
292 tgsi_text.c \
293 tgsi_transform.c \
294 tgsi_two_side.c \
295 tgsi_ureg.c \
296 tgsi_util.c
297 GALLIUM_SOURCES.auxiliary/translate= \
298 translate.c \
299 translate_cache.c \
300 translate_generic.c \
301 translate_sse.c
302 GALLIUM_SOURCES.auxiliary/util= \
303 u_async_debug.c \
304 u_bitmask.c \
305 u_blitter.c \
306 u_cache.c \
307 u_compute.c \
308 u_debug_flush.c \
309 u_debug_image.c \
310 u_dl.c \
311 u_draw.c \
312 u_draw_quad.c \
313 u_driconf.c \
314 u_dump_defines.c \
315 u_dump_state.c \
316 u_framebuffer.c \
317 u_gen_mipmap.c \
318 u_handle_table.c \
319 u_helpers.c \
320 u_index_modify.c \
321 u_linear.c \
322 u_live_shader_cache.c \
323 u_log.c \
324 u_network.c \
325 u_prim.c \
326 u_prim_restart.c \
327 u_pstipple.c \
328 u_resource.c \
329 u_sampler.c \
330 u_screen.c \
331 u_simple_shaders.c \
332 u_split_draw.c \
333 u_suballoc.c \
334 u_surface.c \
335 u_tests.c \
336 u_texture.c \
337 u_tile.c \
338 u_trace_gallium.c \
339 u_transfer.c \
340 u_transfer_helper.c \
341 u_threaded_context.c \
342 u_upload_mgr.c \
343 u_vbuf.c \
344 u_vertex_state_cache.c
345 GALLIUM_SOURCES.auxiliary/nir = \
346 nir_draw_helpers.c \
347 nir_to_tgsi.c \
348 tgsi_to_nir.c
349
350 .if ${MKLLVMRT} != "no"
351 GALLIUM_SOURCES.auxiliary/nir+= nir_to_tgsi_info.c
352 .endif
353
354 GALLIUM_SOURCES.auxiliary/vl= \
355 vl_bicubic_filter.c \
356 vl_compositor.c \
357 vl_compositor_cs.c \
358 vl_compositor_gfx.c \
359 vl_csc.c \
360 vl_decoder.c \
361 vl_deint_filter.c \
362 vl_idct.c \
363 vl_matrix_filter.c \
364 vl_mc.c \
365 vl_median_filter.c \
366 vl_mpeg12_bitstream.c \
367 vl_mpeg12_decoder.c \
368 vl_vertex_buffers.c \
369 vl_video_buffer.c \
370 vl_winsys_dri.c \
371 vl_zscan.c
372
373 # Generated
374 .PATH: ${X11SRCDIR.Mesa}/../src/gallium/auxiliary
375 GALLIUM_SOURCES.auxiliary= \
376 u_indices_gen.c \
377 u_tracepoints.c \
378 u_unfilled_gen.c
379 .for _f in ${GALLIUM_SOURCES.auxiliary/vl}
380 CPPFLAGS.${_f} += -I${X11SRCDIR.Mesa}/src/loader
381 .endfor
382 .for _f in ${GALLIUM_SOURCES.auxiliary/util}
383 CPPFLAGS.${_f} += -I${X11SRCDIR.Mesa}/../src/gallium/auxiliary
384 .endfor
385 .for _f in ${GALLIUM_SOURCES.auxiliary}
386 CPPFLAGS.${_f} += -I${X11SRCDIR.Mesa}/src/gallium/auxiliary/util
387 CPPFLAGS.${_f} += -I${X11SRCDIR.Mesa}/src/util
388 .endfor
389
390 GALLIUM_SOURCES.auxiliary/renderonly= \
391 renderonly.c
392
393 .if ${MKLLVMRT} != "no"
394 GALLIUM_SOURCES.auxiliary/gallivm= \
395 lp_bld_arit.c \
396 lp_bld_arit_overflow.c \
397 lp_bld_assert.c \
398 lp_bld_bitarit.c \
399 lp_bld_const.c \
400 lp_bld_conv.c \
401 lp_bld_coro.c \
402 lp_bld_flow.c \
403 lp_bld_format_aos_array.c \
404 lp_bld_format_aos.c \
405 lp_bld_format_float.c \
406 lp_bld_format.c \
407 lp_bld_format_soa.c \
408 lp_bld_format_s3tc.c \
409 lp_bld_format_srgb.c \
410 lp_bld_format_yuv.c \
411 lp_bld_gather.c \
412 lp_bld_init.c \
413 lp_bld_intr.c \
414 lp_bld_ir_common.c \
415 lp_bld_logic.c \
416 lp_bld_misc.cpp \
417 lp_bld_nir.c \
418 lp_bld_nir_soa.c \
419 lp_bld_pack.c \
420 lp_bld_printf.c \
421 lp_bld_quad.c \
422 lp_bld_sample_aos.c \
423 lp_bld_sample.c \
424 lp_bld_sample_soa.c \
425 lp_bld_struct.c \
426 lp_bld_swizzle.c \
427 lp_bld_tgsi_action.c \
428 lp_bld_tgsi_aos.c \
429 lp_bld_tgsi.c \
430 lp_bld_tgsi_info.c \
431 lp_bld_tgsi_soa.c \
432 lp_bld_type.c \
433 lp_bld_debug.cpp
434 .endif
435
436 .for _f in ${GALLIUM_SOURCES.auxiliary/gallivm}
437 CPPFLAGS.${_f} += -I${X11SRCDIR.Mesa}/src/gallium/auxiliary/util
438 .endfor
439
440 CPPFLAGS.lp_texture.c += -I${X11SRCDIR.Mesa}/../src
441
442 GALLIUM_SOURCES.auxiliary/driver_ddebug = \
443 dd_context.c \
444 dd_draw.c \
445 dd_screen.c
446
447 GALLIUM_SOURCES.auxiliary/driver_noop = \
448 noop_pipe.c \
449 noop_state.c
450
451 GALLIUM_SOURCES.auxiliary/driver_trace = \
452 tr_context.c \
453 tr_dump.c \
454 tr_dump_state.c \
455 tr_screen.c \
456 tr_texture.c
457
458 GALLIUM_SOURCES.auxiliary/driver_rbug = \
459 DRIVERrbug_core.c \
460 DRIVERrbug_context.c \
461 rbug_objects.c \
462 rbug_screen.c
463 # Conflicts with auxiliary/rbug/ files
464 BUILDSYMLINKS+= ${X11SRCDIR.Mesa}/src/gallium/auxiliary/rbug/rbug_core.c RBUGrbug_core.c
465 BUILDSYMLINKS+= ${X11SRCDIR.Mesa}/src/gallium/auxiliary/rbug/rbug_context.c RBUGrbug_context.c
466 BUILDSYMLINKS+= ${X11SRCDIR.Mesa}/src/gallium/auxiliary/driver_rbug/rbug_core.c DRIVERrbug_core.c
467 BUILDSYMLINKS+= ${X11SRCDIR.Mesa}/src/gallium/auxiliary/driver_rbug/rbug_context.c DRIVERrbug_context.c
468 CPPFLAGS.DRIVERrbug_core.c+= -I${X11SRCDIR.Mesa}/src/gallium/auxiliary
469 CPPFLAGS.DRIVERrbug_core.c+= -I${X11SRCDIR.Mesa}/src/gallium/auxiliary/driver_rbug
470 CPPFLAGS.DRIVERrbug_core.c+= -I${X11SRCDIR.Mesa}/src/gallium/drivers
471 CPPFLAGS.DRIVERrbug_context.c+= -I${X11SRCDIR.Mesa}/src/gallium/auxiliary
472 CPPFLAGS.DRIVERrbug_context.c+= -I${X11SRCDIR.Mesa}/src/gallium/auxiliary/driver_rbug
473 CPPFLAGS.DRIVERrbug_context.c+= -I${X11SRCDIR.Mesa}/src/gallium/drivers
474
475 GALLIUM_SOURCES.drivers/i915= \
476 i915_blit.c \
477 i915_clear.c \
478 i915_context.c \
479 i915_debug.c \
480 i915_debug_fp.c \
481 i915_flush.c \
482 i915_fpc_emit.c \
483 i915_fpc_optimize.c \
484 i915_fpc_translate.c \
485 i915_nir.c \
486 i915_prim_emit.c \
487 i915_prim_vbuf.c \
488 i915_query.c \
489 i915_resource_buffer.c \
490 i915_resource.c \
491 i915_resource_texture.c \
492 i915_screen.c \
493 i915_state.c \
494 i915_state_derived.c \
495 i915_state_dynamic.c \
496 i915_state_emit.c \
497 i915_state_fpc.c \
498 i915_state_immediate.c \
499 i915_state_sampler.c \
500 i915_state_static.c \
501 i915_surface.c
502
503 GALLIUM_SOURCES.winsys/i915/drm= \
504 i915_drm_batchbuffer.c \
505 i915_drm_buffer.c \
506 i915_drm_fence.c \
507 i915_drm_winsys.c
508
509 GALLIUM_SOURCES.drivers/iris= \
510 iris_batch.c \
511 iris_binder.c \
512 iris_blit.c \
513 iris_border_color.c \
514 iris_bufmgr.c \
515 iris_clear.c \
516 iris_context.c \
517 iris_disk_cache.c \
518 iris_draw.c \
519 iris_fence.c \
520 iris_fine_fence.c \
521 iris_formats.c \
522 iris_measure.c \
523 iris_monitor.c \
524 iris_perf.c \
525 iris_performance_query.c \
526 iris_pipe_control.c \
527 iris_program.c \
528 iris_program_cache.c \
529 iris_resolve.c \
530 iris_resource.c \
531 iris_screen.c
532
533 GALLIUM_SOURCES.winsys/iris/drm= \
534 iris_drm_winsys.c
535
536 IRIS_GENS_BLORP= 80 90 110 120 125
537
538 .for _gen in ${IRIS_GENS_BLORP}
539 BUILDSYMLINKS+= ${X11SRCDIR.Mesa}/src/gallium/drivers/iris/iris_blorp.c ${_gen}_iris_blorp.c
540 BUILDSYMLINKS+= ${X11SRCDIR.Mesa}/src/gallium/drivers/iris/iris_query.c ${_gen}_iris_query.c
541 BUILDSYMLINKS+= ${X11SRCDIR.Mesa}/src/gallium/drivers/iris/iris_state.c ${_gen}_iris_state.c
542 GALLIIUM_SOURCES.drivers/iris+= ${_gen}_iris_blorp.c ${_gen}_iris_query.c ${_gen}_iris_state.c
543
544 CPPFLAGS.${_gen}_iris_blorp.c+= -DGFX_VERx10=${_gen}
545 CPPFLAGS.${_gen}_iris_query.c+= -DGFX_VERx10=${_gen}
546 CPPFLAGS.${_gen}_iris_state.c+= -DGFX_VERx10=${_gen}
547 .endfor
548
549 .for _f in ${GALLIUM_SOURCES.drivers/iris}
550 CPPFLAGS.${_f} += -I${X11SRCDIR.Mesa}/src/intel
551 .endfor
552
553 GALLIUM_SOURCES.drivers/crocus= \
554 crocus_batch.c \
555 crocus_blit.c \
556 crocus_blorp.c \
557 crocus_blt.c \
558 crocus_bufmgr.c \
559 crocus_clear.c \
560 crocus_context.c \
561 crocus_disk_cache.c \
562 crocus_draw.c \
563 crocus_fence.c \
564 crocus_fine_fence.c \
565 crocus_formats.c \
566 crocus_monitor.c \
567 crocus_pipe_control.c \
568 crocus_program.c \
569 crocus_program_cache.c \
570 crocus_query.c \
571 crocus_resolve.c \
572 crocus_resource.c \
573 crocus_screen.c \
574 crocus_state.c
575
576 GALLIUM_SOURCES.winsys/crocus/drm= \
577 crocus_drm_winsys.c
578
579 CROCUS_GENS_BLORP= 40 45 50 60 70 75 80
580
581 .for _gen in ${CROCUS_GENS_BLORP}
582 BUILDSYMLINKS+= ${X11SRCDIR.Mesa}/src/gallium/drivers/crocus/crocus_blorp.c ${_gen}_crocus_blorp.c
583 BUILDSYMLINKS+= ${X11SRCDIR.Mesa}/src/gallium/drivers/crocus/crocus_query.c ${_gen}_crocus_query.c
584 BUILDSYMLINKS+= ${X11SRCDIR.Mesa}/src/gallium/drivers/crocus/crocus_state.c ${_gen}_crocus_state.c
585 BUILDSYMLINKS+= ${X11SRCDIR.Mesa}/src/gallium/drivers/crocus/crocus_blt.c ${_gen}_crocus_bltec
586 GALLIIUM_SOURCES.drivers/iris+= ${_gen}_crocus_blorp.c ${_gen}_crocus_query.c ${_gen}_crocus_state.c ${_gen}_crocus_blt.c
587
588 CPPFLAGS.${_gen}_crocus_blorp.c+= -DGFX_VERx10=${_gen}
589 CPPFLAGS.${_gen}_crocus_query.c+= -DGFX_VERx10=${_gen}
590 CPPFLAGS.${_gen}_crocus_state.c+= -DGFX_VERx10=${_gen}
591 CPPFLAGS.${_gen}_crocus_blt.c+= -DGFX_VERx10=${_gen}
592 .endfor
593
594 .for _f in ${GALLIUM_SOURCES.drivers/crocus}
595 CPPFLAGS.${_f} += -I${X11SRCDIR.Mesa}/src/intel
596 .endfor
597
598 # Conflicts with r600/radeon_video.c and radeon/radeon_video.c
599 BUILDSYMLINKS+= ${X11SRCDIR.Mesa}/src/gallium/drivers/r600/radeon_video.c r600_radeon_video.c
600 BUILDSYMLINKS+= ${X11SRCDIR.Mesa}/src/gallium/drivers/radeon/radeon_video.c radeon_radeon_video.c
601 BUILDSYMLINKS+= ${X11SRCDIR.Mesa}/src/gallium/drivers/r600/radeon_vce.c r600_radeon_vce.c
602 BUILDSYMLINKS+= ${X11SRCDIR.Mesa}/src/gallium/drivers/radeon/radeon_vce.c radeon_radeon_vce.c
603 BUILDSYMLINKS+= ${X11SRCDIR.Mesa}/src/gallium/drivers/r600/radeon_uvd.c r600_radeon_uvd.c
604 BUILDSYMLINKS+= ${X11SRCDIR.Mesa}/src/gallium/drivers/radeon/radeon_uvd.c radeon_radeon_uvd.c
605
606 GALLIUM_SOURCES.drivers/radeon = \
607 cayman_msaa.c \
608 r600_buffer_common.c \
609 r600_pipe_common.c \
610 r600_query.c \
611 r600_streamout.c \
612 r600_texture.c \
613 radeon_radeon_uvd.c \
614 radeon_uvd_enc.c \
615 radeon_uvd_enc_1_1.c \
616 radeon_vce_40_2_2.c \
617 radeon_vce_50.c \
618 radeon_vce_52.c \
619 radeon_vcn_dec.c \
620 radeon_vcn_dec_jpeg.c \
621 radeon_vcn_enc.c \
622 radeon_vcn_enc_1_2.c \
623 radeon_vcn_enc_2_0.c \
624 radeon_vcn_enc_3_0.c \
625 radeon_radeon_vce.c \
626 radeon_radeon_video.c \
627
628 GALLIUM_SOURCES.drivers/r600 = \
629 eg_debug.c \
630 r600_gpu_load.c \
631 r600_perfcounter.c \
632 r600_radeon_vce.c \
633 r600_radeon_video.c \
634 compute_memory_pool.c \
635 r600_viewport.c \
636 eg_asm.c \
637 evergreen_compute.c \
638 evergreen_hw_context.c \
639 evergreen_state.c \
640 r600_asm.c \
641 r600_blit.c \
642 r600_dump.c \
643 r600_hw_context.c \
644 r600_isa.c \
645 r600_pipe.c \
646 r600_shader.c \
647 r600_state.c \
648 r600_state_common.c \
649 r600_uvd.c \
650 r600_radeon_uvd.c \
651 r600_test_dma.c \
652 r700_asm.c
653 GALLIUM_SOURCES.drivers/r600/sb = \
654 sb_bc_builder.cpp \
655 sb_bc_decoder.cpp \
656 sb_bc_dump.cpp \
657 sb_bc_finalize.cpp \
658 sb_bc_parser.cpp \
659 sb_context.cpp \
660 sb_core.cpp \
661 sb_dce_cleanup.cpp \
662 sb_def_use.cpp \
663 sb_dump.cpp \
664 sb_expr.cpp \
665 sb_gcm.cpp \
666 sb_gvn.cpp \
667 sb_if_conversion.cpp \
668 sb_ir.cpp \
669 sb_liveness.cpp \
670 sb_pass.cpp \
671 sb_peephole.cpp \
672 sb_psi_ops.cpp \
673 sb_ra_checker.cpp \
674 sb_ra_coalesce.cpp \
675 sb_ra_init.cpp \
676 sb_sched.cpp \
677 sb_shader.cpp \
678 sb_ssa_builder.cpp \
679 sb_valtable.cpp
680 GALLIUM_SOURCES.drivers/r600/sfn = \
681 sfn_nir_vectorize_vs_inputs.c \
682 sfn_alu_defines.cpp \
683 sfn_liverange.cpp \
684 sfn_callstack.cpp \
685 sfn_nir.cpp \
686 sfn_conditionaljumptracker.cpp \
687 sfn_nir_legalize_image_load_store.cpp \
688 sfn_debug.cpp \
689 sfn_nir_lower_64bit.cpp \
690 sfn_emitaluinstruction.cpp \
691 sfn_nir_lower_alu.cpp \
692 sfn_emitinstruction.cpp \
693 sfn_nir_lower_fs_out_to_vector.cpp \
694 sfn_emitssboinstruction.cpp \
695 sfn_nir_lower_tess_io.cpp \
696 sfn_emittexinstruction.cpp \
697 sfn_instruction_alu.cpp \
698 sfn_shader_base.cpp \
699 sfn_instruction_base.cpp \
700 sfn_shader_compute.cpp \
701 sfn_instruction_block.cpp \
702 sfn_shader_fragment.cpp \
703 sfn_instruction_cf.cpp \
704 sfn_shader_geometry.cpp \
705 sfn_instruction_export.cpp \
706 sfn_shader_tcs.cpp \
707 sfn_instruction_fetch.cpp \
708 sfn_shader_tess_eval.cpp \
709 sfn_instruction_gds.cpp \
710 sfn_shader_vertex.cpp \
711 sfn_instruction_lds.cpp \
712 sfn_shaderio.cpp \
713 sfn_instruction_misc.cpp \
714 sfn_value.cpp \
715 sfn_instruction_tex.cpp \
716 sfn_value_gpr.cpp \
717 sfn_instructionvisitor.cpp \
718 sfn_valuepool.cpp \
719 sfn_ir_to_assembly.cpp \
720 sfn_vertexstageexport.cpp
721
722 GALLIUM_SOURCES.drivers/r300 = \
723 r300_blit.c \
724 r300_chipset.c \
725 r300_context.c \
726 r300_debug.c \
727 r300_emit.c \
728 r300_flush.c \
729 r300_fs.c \
730 r300_hyperz.c \
731 r300_query.c \
732 r300_render.c \
733 r300_render_stencilref.c \
734 r300_render_translate.c \
735 r300_resource.c \
736 r300_screen_buffer.c \
737 r300_screen.c \
738 r300_state.c \
739 r300_state_derived.c \
740 r300_texture.c \
741 r300_texture_desc.c \
742 r300_tgsi_to_rc.c \
743 r300_transfer.c \
744 r300_vs.c \
745 r300_vs_draw.c
746
747 CPPFLAGS.r300_state_derived.c = ${CC_WNO_STRINGOP_OVERREAD}
748
749 GALLIUM_SOURCES.drivers/r300/compiler = \
750 memory_pool.c \
751 r300_fragprog.c \
752 r300_fragprog_emit.c \
753 r300_fragprog_swizzle.c \
754 r3xx_fragprog.c \
755 r3xx_vertprog.c \
756 r3xx_vertprog_dump.c \
757 r500_fragprog.c \
758 r500_fragprog_emit.c \
759 radeon_code.c \
760 radeon_compiler.c \
761 radeon_compiler_util.c \
762 radeon_dataflow.c \
763 radeon_dataflow_deadcode.c \
764 radeon_dataflow_swizzles.c \
765 radeon_emulate_branches.c \
766 radeon_emulate_loops.c \
767 radeon_inline_literals.c \
768 radeon_list.c \
769 radeon_opcodes.c \
770 radeon_optimize.c \
771 radeon_pair_dead_sources.c \
772 radeon_pair_regalloc.c \
773 radeon_pair_schedule.c \
774 radeon_pair_translate.c \
775 radeon_program_alu.c \
776 radeon_program.c \
777 radeon_program_pair.c \
778 radeon_program_print.c \
779 radeon_program_tex.c \
780 radeon_remove_constants.c \
781 radeon_rename_regs.c \
782 radeon_variable.c \
783 radeon_vert_fc.c
784
785 GALLIUM_SOURCES.drivers/radeonsi = \
786 gfx10_query.c \
787 gfx10_shader_ngg.c \
788 si_blit.c \
789 si_buffer.c \
790 si_clear.c \
791 si_compute.c \
792 si_compute_blit.c \
793 si_cp_dma.c \
794 si_cp_reg_shadowing.c \
795 si_debug.c \
796 si_descriptors.c \
797 si_fence.c \
798 si_get.c \
799 si_gfx_cs.c \
800 si_gpu_load.c \
801 si_pipe.c \
802 si_pm4.c \
803 si_perfcounter.c \
804 si_query.c \
805 si_nir_optim.c \
806 si_shader.c \
807 si_sdma_copy_image.c \
808 si_shader_llvm.c \
809 si_shader_llvm_gs.c \
810 si_shader_llvm_ps.c \
811 si_shader_llvm_resources.c \
812 si_shader_llvm_tess.c \
813 si_shader_llvm_vs.c \
814 si_shader_nir.c \
815 si_shaderlib_nir.c \
816 si_shaderlib_tgsi.c \
817 si_sqtt.c \
818 si_state.c \
819 si_state_binning.c \
820 si_state_draw_gfx6.cpp \
821 si_state_draw_gfx7.cpp \
822 si_state_draw_gfx8.cpp \
823 si_state_draw_gfx9.cpp \
824 si_state_draw_gfx10.cpp \
825 si_state_draw_gfx103.cpp \
826 si_state_msaa.c \
827 si_state_shaders.c \
828 si_state_streamout.c \
829 si_state_viewport.c \
830 si_test_blit.c \
831 si_test_dma_perf.c \
832 si_texture.c \
833 si_uvd.c
834
835 .PATH: ${X11SRCDIR.Mesa}/src/gallium/drivers/radeonsi
836 BUILDSYMLINKS+= ${X11SRCDIR.Mesa}/src/gallium/drivers/radeonsi/si_state_draw.cpp si_state_draw_gfx6.cpp
837 BUILDSYMLINKS+= ${X11SRCDIR.Mesa}/src/gallium/drivers/radeonsi/si_state_draw.cpp si_state_draw_gfx7.cpp
838 BUILDSYMLINKS+= ${X11SRCDIR.Mesa}/src/gallium/drivers/radeonsi/si_state_draw.cpp si_state_draw_gfx8.cpp
839 BUILDSYMLINKS+= ${X11SRCDIR.Mesa}/src/gallium/drivers/radeonsi/si_state_draw.cpp si_state_draw_gfx9.cpp
840 BUILDSYMLINKS+= ${X11SRCDIR.Mesa}/src/gallium/drivers/radeonsi/si_state_draw.cpp si_state_draw_gfx10.cpp
841 BUILDSYMLINKS+= ${X11SRCDIR.Mesa}/src/gallium/drivers/radeonsi/si_state_draw.cpp si_state_draw_gfx103.cpp
842
843 CPPFLAGS.si_state_draw_gfx6.cpp += -DGFX_VER=6
844 CPPFLAGS.si_state_draw_gfx7.cpp += -DGFX_VER=7
845 CPPFLAGS.si_state_draw_gfx8.cpp += -DGFX_VER=8
846 CPPFLAGS.si_state_draw_gfx9.cpp += -DGFX_VER=9
847 CPPFLAGS.si_state_draw_gfx10.cpp += -DGFX_VER=10
848 CPPFLAGS.si_state_draw_gfx103.cpp += -DGFX_VER=103
849
850 .for _f in ${GALLIUM_SOURCES.drivers/radeon}
851 CPPFLAGS.${_f} += -I${X11SRCDIR.Mesa}/src/gallium/drivers/radeon
852 .endfor
853
854 .for _f in ${GALLIUM_SOURCES.drivers/r300} ${GALLIUM_SOURCES.drivers/r300/compiler}
855 CPPFLAGS.${_f} += -I${X11SRCDIR.Mesa}/src/gallium/drivers/r300 \
856 -I${X11SRCDIR.Mesa}/src/gallium/drivers/r300/compiler
857 .endfor
858
859 .for _f in ${GALLIUM_SOURCES.drivers/r600} ${GALLIUM_SOURCES.drivers/r600/sb} ${GALLIUM_SOURCES.drivers/radeonsi} ${GALLIUM_SOURCES.drivers/r600/sfn}
860 CPPFLAGS.${_f} += -I${X11SRCDIR.Mesa}/src/gallium/drivers/r600
861 CPPFLAGS.${_f} += -I${X11SRCDIR.Mesa}/../src/gallium/drivers/r600
862 CPPFLAGS.${_f} += -I${X11SRCDIR.Mesa}/src/amd/common
863 CPPFLAGS.${_f} += -I${X11SRCDIR.Mesa}/../src/amd/common
864 CPPFLAGS.${_f} += -I${X11SRCDIR.Mesa}/src/amd/llvm
865 .endfor
866
867 .for _f in ${GALLIUM_SOURCES.drivers/radeon}
868 CPPFLAGS.${_f} += -I${X11SRCDIR.Mesa}/src/gallium/drivers/radeonsi
869 CPPFLAGS.${_f} += -I${X11SRCDIR.Mesa}/src/amd/common
870 CPPFLAGS.${_f} += -I${X11SRCDIR.Mesa}/src/amd/llvm
871 .endfor
872
873 GALLIUM_SOURCES.drivers/nouveau = \
874 nouveau_buffer.c \
875 nouveau_fence.c \
876 nouveau_heap.c \
877 nouveau_mm.c \
878 nouveau_screen.c \
879 nouveau_video.c \
880 nouveau_vp3_video_bsp.c \
881 nouveau_vp3_video.c \
882 nouveau_vp3_video_vp.c
883
884 GALLIUM_SOURCES.drivers/nouveau/nv30 = \
885 nv30_clear.c \
886 nv30_context.c \
887 nv30_draw.c \
888 nv30_format.c \
889 nv30_fragprog.c \
890 nv30_fragtex.c \
891 nv30_miptree.c \
892 nv30_push.c \
893 nv30_query.c \
894 nv30_resource.c \
895 nv30_screen.c \
896 nv30_state.c \
897 nv30_state_validate.c \
898 nv30_texture.c \
899 nv30_transfer.c \
900 nv30_vbo.c \
901 nv30_vertprog.c \
902 nv40_verttex.c \
903 nvfx_fragprog.c \
904 nvfx_vertprog.c
905
906 GALLIUM_SOURCES.drivers/nouveau/nv50 = \
907 nv50_compute.c \
908 nv50_context.c \
909 nv50_formats.c \
910 nv50_miptree.c \
911 nv50_program.c \
912 nv50_push.c \
913 nv50_query.c \
914 nv50_query_hw.c \
915 nv50_query_hw_metric.c \
916 nv50_query_hw_sm.c \
917 nv50_resource.c \
918 nv50_screen.c \
919 nv50_shader_state.c \
920 nv50_state.c \
921 nv50_state_validate.c \
922 nv50_surface.c \
923 nv50_tex.c \
924 nv50_transfer.c \
925 nv50_vbo.c \
926 nv84_video_bsp.c \
927 nv84_video.c \
928 nv84_video_vp.c \
929 nv98_video_bsp.c \
930 nv98_video.c \
931 nv98_video_ppp.c \
932 nv98_video_vp.c
933
934 GALLIUM_SOURCES.drivers/nouveau/codegen = \
935 nv50_ir.cpp \
936 nv50_ir_bb.cpp \
937 nv50_ir_build_util.cpp \
938 nv50_ir_emit_gk110.cpp \
939 nv50_ir_emit_gm107.cpp \
940 nv50_ir_emit_gv100.cpp \
941 nv50_ir_emit_nv50.cpp \
942 nv50_ir_emit_nvc0.cpp \
943 nv50_ir_from_common.cpp \
944 nv50_ir_from_nir.cpp \
945 nv50_ir_from_tgsi.cpp \
946 nv50_ir_graph.cpp \
947 nv50_ir_lowering_gm107.cpp \
948 nv50_ir_lowering_gv100.cpp \
949 nv50_ir_lowering_helper.cpp \
950 nv50_ir_lowering_nv50.cpp \
951 nv50_ir_lowering_nvc0.cpp \
952 nv50_ir_peephole.cpp \
953 nv50_ir_print.cpp \
954 nv50_ir_ra.cpp \
955 nv50_ir_serialize.cpp \
956 nv50_ir_ssa.cpp \
957 nv50_ir_target.cpp \
958 nv50_ir_target_gv100.cpp \
959 nv50_ir_target_nv50.cpp \
960 nv50_ir_util.cpp \
961 nv50_ir_target_gm107.cpp \
962 nv50_ir_target_nvc0.cpp
963
964 GALLIUM_SOURCES.drivers/nouveau/nvc0 = \
965 nvc0_compute.c \
966 nvc0_context.c \
967 nvc0_formats.c \
968 nvc0_miptree.c \
969 nvc0_resource.c \
970 nvc0_screen.c \
971 nvc0_state.c \
972 nvc0_state_validate.c \
973 nvc0_surface.c \
974 nvc0_tex.c \
975 nvc0_transfer.c \
976 nvc0_vbo.c \
977 nvc0_vbo_translate.c \
978 nvc0_program.c \
979 nvc0_shader_state.c \
980 nvc0_query.c \
981 nvc0_query_hw.c \
982 nvc0_query_hw_metric.c \
983 nvc0_query_hw_sm.c \
984 nvc0_query_sw.c \
985 nve4_compute.c \
986 nvc0_video.c \
987 nvc0_video_bsp.c \
988 nvc0_video_vp.c \
989 nvc0_video_ppp.c
990
991 GALLIUM_SOURCES.winsys/nouveau/drm = \
992 nouveau_drm_winsys.c
993
994 .for _f in ${GALLIUM_SOURCES.drivers/nouveau} \
995 ${GALLIUM_SOURCES.drivers/nouveau/nv30} \
996 ${GALLIUM_SOURCES.drivers/nouveau/nv50} \
997 ${GALLIUM_SOURCES.drivers/nouveau/codegen} \
998 ${GALLIUM_SOURCES.drivers/nouveau/nvc0} \
999 ${GALLIUM_SOURCES.winsys/nouveau/drm}
1000 CPPFLAGS.${_f} += -I${X11SRCDIR.Mesa}/src/gallium/drivers/nouveau \
1001 -I${DESTDIR}${X11INCDIR}/libdrm/nouveau
1002 .endfor
1003
1004 GALLIUM_SOURCES.winsys/radeon/drm = \
1005 radeon_drm_bo.c \
1006 radeon_drm_cs.c \
1007 radeon_drm_surface.c \
1008 radeon_drm_winsys.c
1009
1010 GALLIUM_SOURCES.winsys/amdgpu/drm = \
1011 amdgpu_bo.c \
1012 amdgpu_cs.c \
1013 amdgpu_surface.c \
1014 amdgpu_winsys.c
1015
1016 .for _f in ${GALLIUM_SOURCES.winsys/amdgpu/drm}
1017 CPPFLAGS.${_f} += -I${X11SRCDIR.Mesa}/src/amd
1018 CPPFLAGS.${_f} += -I${X11SRCDIR.Mesa}/src/amd/common
1019 CPPFLAGS.${_f} += -I${X11SRCDIR.Mesa}/../src/amd/common
1020 CPPFLAGS.${_f} += -I${X11SRCDIR.Mesa}/src/amd/llvm
1021 .endfor
1022
1023 GALLIUM_SOURCES.frontends/vdpau = \
1024 bitmap.c \
1025 decode.c \
1026 device.c \
1027 ftab.c \
1028 htab.c \
1029 mixer.c \
1030 output.c \
1031 preemption.c \
1032 presentation.c \
1033 query.c \
1034 surface.c
1035
1036 GALLIUM_SOURCES.drivers/llvmpipe = \
1037 lp_bld_alpha.c \
1038 lp_bld_blend_aos.c \
1039 lp_bld_blend.c \
1040 lp_bld_blend_logicop.c \
1041 lp_bld_depth.c \
1042 lp_bld_interp.c \
1043 lp_clear.c \
1044 lp_context.c \
1045 lp_cs_tpool.c \
1046 lp_draw_arrays.c \
1047 lp_fence.c \
1048 lp_flush.c \
1049 lp_jit.c \
1050 lp_linear.c \
1051 lp_linear_fastpath.c \
1052 lp_linear_interp.c \
1053 lp_linear_sampler.c \
1054 lp_memory.c \
1055 lp_perf.c \
1056 lp_query.c \
1057 lp_rast.c \
1058 lp_rast_debug.c \
1059 lp_rast_linear.c \
1060 lp_rast_linear_fallback.c \
1061 lp_rast_rect.c \
1062 lp_rast_tri.c \
1063 lp_scene.c \
1064 lp_scene_queue.c \
1065 lp_screen.c \
1066 lp_setup.c \
1067 lp_setup_analysis.c \
1068 lp_setup_line.c \
1069 lp_setup_point.c \
1070 lp_setup_rect.c \
1071 lp_setup_tri.c \
1072 lp_setup_vbuf.c \
1073 lp_state_blend.c \
1074 lp_state_clip.c \
1075 lp_state_cs.c \
1076 lp_state_derived.c \
1077 lp_state_fs.c \
1078 lp_state_fs_analysis.c \
1079 lp_state_fs_fastpath.c \
1080 lp_state_fs_linear.c \
1081 lp_state_fs_linear_llvm.c \
1082 lp_state_gs.c \
1083 lp_state_rasterizer.c \
1084 lp_state_sampler.c \
1085 lp_state_setup.c \
1086 lp_state_so.c \
1087 lp_state_surface.c \
1088 lp_state_tess.c \
1089 lp_state_vertex.c \
1090 lp_state_vs.c \
1091 lp_surface.c \
1092 lp_tex_sample.c \
1093 lp_texture.c
1094
1095 GALLIUM_SOURCES.drivers/softpipe = \
1096 sp_buffer.c \
1097 sp_clear.c \
1098 sp_context.c \
1099 sp_compute.c \
1100 sp_draw_arrays.c \
1101 sp_fence.c \
1102 sp_flush.c \
1103 sp_fs_exec.c \
1104 sp_image.c \
1105 sp_prim_vbuf.c \
1106 sp_quad_blend.c \
1107 sp_quad_depth_test.c \
1108 sp_quad_fs.c \
1109 sp_quad_pipe.c \
1110 sp_quad_stipple.c \
1111 sp_query.c \
1112 sp_screen.c \
1113 sp_setup.c \
1114 sp_state_blend.c \
1115 sp_state_clip.c \
1116 sp_state_derived.c \
1117 sp_state_image.c \
1118 sp_state_rasterizer.c \
1119 sp_state_sampler.c \
1120 sp_state_shader.c \
1121 sp_state_so.c \
1122 sp_state_surface.c \
1123 sp_state_vertex.c \
1124 sp_surface.c \
1125 sp_tex_sample.c \
1126 sp_tex_tile_cache.c \
1127 sp_texture.c \
1128 sp_tile_cache.c
1129
1130 GALLIUM_SOURCES.winsys/sw/null = \
1131 null_sw_winsys.c
1132
1133 GALLIUM_SOURCES.winsys/sw/wrapper = \
1134 wrapper_sw_winsys.c
1135
1136 GALLIUM_SOURCES.winsys/sw/dri = \
1137 dri_sw_winsys.c
1138
1139 GALLIUM_SOURCES.winsys/sw/kms-dri = \
1140 kms_dri_sw_winsys.c
1141
1142 GALLIUM_SOURCES.frontends/dri = \
1143 dri_context.c \
1144 dri_drawable.c \
1145 dri_helpers.c \
1146 dri_query_renderer.c \
1147 dri_screen.c \
1148 drisw.c \
1149 dri2.c
1150
1151 # missing
1152 CPPFLAGS+= \
1153 -DGALLIUM_SOFTPIPE \
1154 -DGALLIUM_STATIC_TARGETS=1 \
1155 -DMESA_EGL_NO_X11_HEADERS
1156
1157 .for _d in ${GALLIUM_SUBDIRS}
1158 SRCS+= ${GALLIUM_SOURCES.${_d}}
1159 .PATH: ${X11SRCDIR.Mesa}/src/gallium/${_d}
1160 . for _s in ${GALLIUM_SOURCES.${_d}}
1161 CPPFLAGS.${_s}+= -I${X11SRCDIR.Mesa}/src/gallium/${_d}
1162 . endfor
1163 .endfor
1164
1165 #. if defined(${GALLIUM_SOURCES.${_d}})
1166 #SRCS+= ${GALLIUM_SOURCES.${_d}}
1167 #. endif
1168
1169 .include "../libloader.mk"
1170
1171 .if ${BUILD_RADEON} == 1
1172 CFLAGS+= -pthread
1173 LDFLAGS+= -pthread
1174 .endif
1175
1176 LIBDPLIBS+= X11-xcb ${.CURDIR}/../libX11/libX11-xcb
1177 LIBDPLIBS+= xcb-dri2 ${.CURDIR}/../libxcb/dri2
1178 LIBDPLIBS+= xcb ${.CURDIR}/../libxcb/libxcb
1179 LIBDPLIBS+= drm ${.CURDIR}/../libdrm
1180 .if ${BUILD_I915} == 1 || ${BUILD_IRIS} == 1 || ${BUILD_CROCUS} == 1
1181 LIBDPLIBS+= drm_intel ${.CURDIR}/../libdrm_intel
1182 .endif
1183 .if ${BUILD_RADEON} == 1
1184 LIBDPLIBS+= drm_radeon ${.CURDIR}/../libdrm_radeon
1185 LIBDPLIBS+= drm_amdgpu ${.CURDIR}/../libdrm_amdgpu
1186 .endif # ${BUILD_RADEON} == 1
1187 .if ${BUILD_NOUVEAU} == 1
1188 LIBDPLIBS+= drm_nouveau ${.CURDIR}/../libdrm_nouveau
1189 .endif # ${BUILD_NOUVEAU} == 1
1190 LIBDPLIBS+= glapi ${.CURDIR}/../libglapi${OLD_SUFFIX}
1191 LIBDPLIBS+= expat ${.CURDIR}/../../../../../external/mit/expat/lib/libexpat
1192 LIBDPLIBS+= terminfo ${.CURDIR}/../../../../../lib/libterminfo
1193 LIBDPLIBS+= execinfo ${.CURDIR}/../../../../../lib/libexecinfo
1194
1195 LIBDPLIBS+= elf ${NETBSDSRCDIR}/external/bsd/elftoolchain/lib/libelf
1196 LIBDPLIBS+= z ${.CURDIR}/../../../../../lib/libz
1197 LIBDPLIBS+= m ${.CURDIR}/../../../../../lib/libm
1198
1199 # gallium drivers requiring LLVM
1200 .if ${BUILD_LLVMPIPE} == 1 || ${BUILD_RADEON} == 1
1201
1202 LLVMRT_LIBS= \
1203 MCJIT \
1204 ExecutionEngine \
1205 ExecutionEngineOrcTargetProcess \
1206 ExecutionEngineOrcShared \
1207 Orc \
1208 RuntimeDyld
1209
1210 .if ${BUILD_RADEON} == 1
1211 LLVMRT_LIBS+= \
1212 AMDGPUCodeGen \
1213 AMDGPUMCTargetDesc \
1214 AMDGPUTargetInfo \
1215 AMDGPUAsmParser \
1216 AMDGPUDisassembler \
1217 AMDGPUUtils
1218 .endif
1219
1220 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
1221 # XXX duplicates
1222 LLVMRT_LIBS+= \
1223 X86Disassembler \
1224 X86CodeGen \
1225 X86MCTargetDesc \
1226 X86Disassembler \
1227 X86MCTargetDesc \
1228 X86TargetInfo
1229 .endif
1230
1231 .if ${MACHINE_CPU} == "aarch64"
1232 LLVMRT_LIBS+= \
1233 AArch64AsmParser \
1234 AArch64CodeGen \
1235 AArch64MCTargetDesc \
1236 AArch64Utils \
1237 AArch64Disassembler \
1238 AArch64TargetInfo
1239 .endif
1240
1241 .if ${MACHINE_CPU} == "arm"
1242 LLVMRT_LIBS+= \
1243 ARMCodeGen \
1244 ARMDisassembler \
1245 ARMTargetInfo \
1246 ARMMCTargetDesc \
1247 ARMAsmParser \
1248 ARMUtils
1249 .endif
1250
1251 .if ${MACHINE_CPU} == "mips"
1252 LLVMRT_LIBS+= \
1253 MipsCodeGen \
1254 MipsDisassembler \
1255 MipsAsmParser \
1256 MipsMCTargetDesc \
1257 MipsTargetInfo
1258 .endif
1259
1260 .if ${MACHINE_CPU} == "powerpc"
1261 LLVMRT_LIBS+= \
1262 PowerPCCodeGen \
1263 PowerPCDisassembler \
1264 PowerPCTargetInfo \
1265 PowerPCMCTargetDesc \
1266 PowerPCAsmParser
1267 .endif
1268
1269 LLVMRT_LIBS+= \
1270 Passes \
1271 TransformsCoroutines \
1272 ObjCARC \
1273 GlobalISel \
1274 MCDisassembler \
1275 SelectionDAG \
1276 AsmPrinter \
1277 CodeGen \
1278 TransformsCFGuard \
1279 Target \
1280 InstCombine \
1281 ScalarOpts \
1282 DebugInfoCodeView \
1283 DebugInfoDWARF \
1284 Object \
1285 BitReader \
1286 TextAPI \
1287 MIRParser \
1288 MCParser \
1289 MC \
1290 ipo \
1291 BitWriter \
1292 FrontendOpenMP \
1293 Instrumentation \
1294 IRReader \
1295 AsmParser \
1296 Vectorize \
1297 TransformsAggressiveInstCombine \
1298 ProfileData \
1299 TransformsUtils \
1300 Analysis \
1301 IR \
1302 Remarks \
1303 BitstreamReader \
1304 Linker \
1305 BinaryFormat \
1306 Support \
1307 Demangle
1308
1309 .include "${NETBSDSRCDIR}/external/apache2/llvm/link.mk"
1310
1311 .endif # ${BUILD_LLVM_PIPE} == 1 || ${BUILD_RADEON} == 1
1312
1313 LDFLAGS+= -Wl,--version-script=${X11SRCDIR.Mesa}/src/gallium/targets/dri/dri.sym
1314 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" || ${MACHINE_CPU} == "aarch64"
1315 LDFLAGS+= -Wl,-z,defs
1316 .endif
1317
1318 ## build mesagallium parts
1319 MESA_SRC_MODULES= main math vbo state_tracker program asm_s
1320 .if ${BUILD_RADEON} == 1
1321 MESA_SRC_MODULES+= amd
1322 .endif
1323
1324 .include "../libmesa.mk"
1325 .include "../libglsl.mk"
1326
1327 # Special addition for just gallium; it misses the rest of asm_c files.
1328 .PATH: ${X11SRCDIR.Mesa}/src/mesa/x86
1329 SRCS+= common_x86.c
1330
1331 .if ${MACHINE} == "amd64" || ${MACHINE} == "i386"
1332 SRCS+= streaming-load-memcpy.c
1333 CPPFLAGS.streaming-load-memcpy.c+= -msse4.1
1334 .endif
1335
1336 # Needs 64bit atomics
1337 CPPFLAGS.i386+= -march=i586
1338 CPPFLAGS+= ${CPPFLAGS.${XORG_MACHINE_ARCH:U${MACHINE_ARCH}}}
1339
1340 CPPFLAGS.r600_pipe_common.c+= -DMESA_LLVM_VERSION_STRING=\"${LLVM_VERSION}\"
1341 CPPFLAGS.si_get.c+= -DMESA_LLVM_VERSION_STRING=\"${LLVM_VERSION}\"
1342 CPPFLAGS.lp_screen.c+= -DMESA_LLVM_VERSION_STRING=\"${LLVM_VERSION}\"
1343 CPPFLAGS.lp_bld_intr.c+= -DMESA_LLVM_VERSION_STRING=\"${LLVM_VERSION}\"
1344 CPPFLAGS.lp_bld_type.c+= -DMESA_LLVM_VERSION_STRING=\"${LLVM_VERSION}\"
1345
1346 .include "../driver.mk"
1347
1348
1349 .PATH: ${X11SRCDIR.Mesa}/src/gallium/targets/dri
1350 SRCS+= target.c
1351
1352 CPPFLAGS+= \
1353 -I${X11SRCDIR.Mesa}/src/gallium/include \
1354 -I${X11SRCDIR.Mesa}/src/gallium/auxiliary \
1355 -I${X11SRCDIR.Mesa}/src/gallium/drivers \
1356 -I${X11SRCDIR.Mesa}/../src/mesa/drivers/dri/common
1357
1358 CPPFLAGS.target.c += \
1359 -DDRI_TARGET \
1360 -DGALLIUM_NOOP \
1361 -DGALLIUM_RBUG \
1362 -DGALLIUM_TRACE \
1363 -DGALLIUM_SOFTPIPE \
1364 -I${X11SRCDIR.Mesa}/src/gallium/frontends/dri \
1365 -I${X11SRCDIR.Mesa}/src/loader \
1366 -I${X11SRCDIR.Mesa}/../src/util \
1367 -I${X11SRCDIR.Mesa}/../src/gallium/drivers \
1368 -I${X11SRCDIR.Mesa}/src/gallium/winsys
1369
1370 .if ${BUILD_LLVMPIPE} == 1
1371 CPPFLAGS.target.c += \
1372 -DGALLIUM_LLVMPIPE
1373 .endif #${BUILD_LLVMPIPE} == 1
1374
1375 .if ${BUILD_I915} == 1
1376 CPPFLAGS.target.c += \
1377 -DGALLIUM_I915 \
1378 -DGALLIUM_ILO
1379 .endif
1380
1381 .if ${BUILD_IRIS} == 1
1382 CPPFLAGS.target.c += \
1383 -DGALLIUM_IRIS
1384 .endif
1385
1386 .if ${BUILD_CROCUS} == 1
1387 CPPFLAGS.target.c += \
1388 -DGALLIUM_CROCUS
1389 .endif
1390
1391 .if ${BUILD_RADEON} == 1
1392 CPPFLAGS.target.c += \
1393 -DGALLIUM_R200 \
1394 -DGALLIUM_R300 \
1395 -DGALLIUM_R600 \
1396 -DGALLIUM_RADEONSI
1397 .endif # ${BUILD_RADEON} == 1
1398
1399 .if ${BUILD_NOUVEAU} == 1
1400 CPPFLAGS.target.c += \
1401 -DGALLIUM_NOUVEAU
1402 .endif # ${BUILD_NOUVEAU} == 1
1403
1404 CWARNFLAGS.clang+= -Wno-error=constant-conversion \
1405 -Wno-error=tautological-constant-out-of-range-compare \
1406 -Wno-error=pointer-sign \
1407 -Wno-error=switch \
1408 -Wno-error=absolute-value \
1409 -Wno-error=tautological-compare \
1410 -Wno-error=static-in-inline \
1411 -Wno-error=logical-not-parentheses \
1412 -Wno-error=constant-logical-operand \
1413 -Wno-error=unknown-warning-option \
1414 -Wno-error=typedef-redefinition \
1415 -Wno-error=enum-conversion # https://bugs.freedesktop.org/show_bug.cgi?id=109761
1416
1417 CWARNFLAGS+= -Wno-error=stack-protector
1418
1419 .include <bsd.x11.mk>
1420 LIBDIR= ${X11USRLIBDIR}/modules/dri
1421
1422 .for _d in ${DRIVERS}
1423 SYMLINKS+= gallium_dri.so ${DRIDIR}/${_d}_dri.so
1424 SYMLINKS+= gallium_dri.so.${SHLIB_MAJOR} ${DRIDIR}/${_d}_dri.so.${SHLIB_MAJOR}
1425 .if ${MKDEBUG} != "no"
1426 SYMLINKS+= gallium_dri.so.${SHLIB_MAJOR}.debug ${DRIDEBUGDIR}/${_d}_dri.so.${SHLIB_MAJOR}.debug
1427 .endif
1428 .endfor
1429
1430 .if ${MACHINE_ARCH} == "sparc" || ${COMMON_MACHINE_ARCH:U} == "sparc"
1431 COPTS+= ${${ACTIVE_CC} == "clang":? -Wa,-Av8plus :}
1432 .endif
1433
1434 COPTS.u_atomic.c+= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 10:? -Wno-builtin-declaration-mismatch :}
1435
1436 .if ${MACHINE} == "vax" && ${HAVE_GCC:U0} >= 12
1437 # in extract_constrain_insn, at recog.cc:2698
1438 COPTS.sp_quad_depth_test.c+= -O0
1439 # in find_reloads_toplev, at reload.cc:4815
1440 COPTS.u_format_table.c+= -O0
1441 .endif
1442
1443 .if ${MACHINE} == "vax" && ${HAVE_GCC:U0} == 10
1444 # in fixup_reorder_chain, at cfgrtl.c:3985
1445 COPTS.nir_builtin_builder.c+= -O0
1446 # in fixup_reorder_chain, at cfgrtl.c:3985
1447 COPTS.nir_lower_int64.c+= -O0
1448 .endif
1449
1450 .if ${MACHINE_CPU} == "m68k" && ${HAVE_GCC:U0} == 12
1451 COPTS.vl_bicubic_filter.c+= -O1
1452 .endif
1453
1454 .include <bsd.lib.mk>
1455 # Don't regenerate c files
1456 .y.c:
1457