1 # $NetBSD: Makefile,v 1.7 2015/09/23 05:28:14 mrg Exp $
3 # Link the gallium mega driver.
13 DRIDIR
= ${X11USRLIBDIR}/modules
/dri
14 DRIDEBUGDIR
= ${DEBUGDIR}${X11USRLIBDIR}/modules
/dri
16 DRIVERS
= kms_swrast swrast
17 .if
${MACHINE_ARCH} == "i386" ||
${MACHINE_ARCH} == "x86_64"
22 -I
${DESTDIR}${X11INCDIR}/libdrm
25 #CPPFLAGS+= -D_NETBSD_SOURCE -DPTHREADS
34 auxiliary
/pipebuffer \
35 auxiliary
/postprocess \
57 GALLIUM_SOURCES.auxiliary
/cso_cache
= \
61 GALLIUM_SOURCES.auxiliary
/draw
= \
70 draw_pipe_flatshade.c \
72 draw_pipe_pstipple.c \
75 draw_pipe_unfilled.c \
77 draw_pipe_validate.c \
79 draw_pipe_wide_line.c \
80 draw_pipe_wide_point.c \
81 draw_prim_assembler.c \
85 draw_pt_fetch_emit.c \
86 draw_pt_fetch_shade_emit.c \
87 draw_pt_fetch_shade_pipeline.c \
96 GALLIUM_SOURCES.auxiliary
/hud
= \
102 GALLIUM_SOURCES.auxiliary
/indices
= \
104 GALLIUM_SOURCES.auxiliary
/os
= \
108 GALLIUM_SOURCES.auxiliary
/pipebuffer
= \
115 pb_bufmgr_ondemand.c \
119 GALLIUM_SOURCES.auxiliary
/postprocess
= \
126 GALLIUM_SOURCES.auxiliary
/rbug
= \
133 GALLIUM_SOURCES.auxiliary
/rtasm
= \
137 GALLIUM_SOURCES.auxiliary
/tgsi
= \
151 GALLIUM_SOURCES.auxiliary
/translate
= \
154 translate_generic.c \
156 GALLIUM_SOURCES.auxiliary
/util
= \
214 GALLIUM_SOURCES.auxiliary
/vl
= \
220 vl_mpeg12_decoder.c \
221 vl_mpeg12_bitstream.c \
225 vl_vertex_buffers.c \
230 .PATH
: ${X11SRCDIR.MesaLib
}/..
/src
/gallium
/auxiliary
231 GALLIUM_SOURCES.auxiliary
= \
235 .for _f in
${GALLIUM_SOURCES.auxiliary
}
236 CPPFLAGS.
${_f} += -I
${X11SRCDIR.MesaLib
}/src
/gallium
/auxiliary
/util
239 GALLIUM_SOURCES.drivers
/galahad
= \
244 GALLIUM_SOURCES.drivers
/identity
= \
249 GALLIUM_SOURCES.drivers
/noop
= \
253 GALLIUM_SOURCES.drivers
/trace
= \
260 GALLIUM_SOURCES.drivers
/rbug
= \
262 DRIVERrbug_context.c \
265 # Conflicts with auxiliary/rbug/ files
266 BUILDSYMLINKS
+= ${X11SRCDIR.MesaLib
}/src
/gallium
/drivers
/rbug
/rbug_core.c DRIVERrbug_core.c
267 BUILDSYMLINKS
+= ${X11SRCDIR.MesaLib
}/src
/gallium
/drivers
/rbug
/rbug_context.c DRIVERrbug_context.c
268 CPPFLAGS.DRIVERrbug_core.c
+= -I
${X11SRCDIR.MesaLib
}/src
/gallium
/auxiliary
269 CPPFLAGS.DRIVERrbug_core.c
+= -I
${X11SRCDIR.MesaLib
}/src
/gallium
/drivers
/rbug
270 CPPFLAGS.DRIVERrbug_core.c
+= -I
${X11SRCDIR.MesaLib
}/src
/gallium
/drivers
271 CPPFLAGS.DRIVERrbug_context.c
+= -I
${X11SRCDIR.MesaLib
}/src
/gallium
/auxiliary
272 CPPFLAGS.DRIVERrbug_context.c
+= -I
${X11SRCDIR.MesaLib
}/src
/gallium
/drivers
/rbug
273 CPPFLAGS.DRIVERrbug_context.c
+= -I
${X11SRCDIR.MesaLib
}/src
/gallium
/drivers
275 GALLIUM_SOURCES.drivers
/radeon
= \
277 r600_buffer_common.c \
287 # radeon_elf_util.c \
288 # radeon_setup_tgsi_llvm.c \
289 # radeon_llvm_emit.c \
292 GALLIUM_SOURCES.drivers
/r600
= \
301 evergreen_hw_context.c \
304 r600_state_common.c \
305 evergreen_compute.c \
306 compute_memory_pool.c \
308 GALLIUM_SOURCES.drivers
/r600
/sb
= \
322 sb_if_conversion.
cpp \
335 #LLVM_C_SOURCES = r600_llvm.c
337 .for _f in
${GALLIUM_SOURCES.drivers
/r600
} ${GALLIUM_SOURCES.drivers
/r600
/sb
}
338 CPPFLAGS.
${_f} += -I
${X11SRCDIR.MesaLib
}/src
/gallium
/drivers
/r600
343 GALLIUM_SOURCES.winsys
/radeon
/drm
= \
346 radeon_drm_cs_dump.c \
349 GALLIUM_SOURCES.drivers
/softpipe
= \
360 sp_quad_depth_test.c \
371 sp_state_rasterizer.c \
376 sp_tex_tile_cache.c \
380 GALLIUM_SOURCES.winsys
/sw
/null
= \
383 GALLIUM_SOURCES.winsys
/sw
/dri
= \
386 GALLIUM_SOURCES.winsys
/sw
/kms-dri
= \
389 GALLIUM_SOURCES.state_trackers
/dri
= \
392 dri_query_renderer.c \
396 .for _f in
${GALLIUM_SOURCES.state_trackers
/dri
}
397 CPPFLAGS.
${_f} += -I
${X11SRCDIR.MesaLib
}/src
/gallium
/state_trackers
/dri
/common
403 -DGALLIUM_STATIC_TARGETS
=1 \
404 -DMESA_EGL_NO_X11_HEADERS \
406 .for _d in
${GALLIUM_SUBDIRS}
407 SRCS
+= ${GALLIUM_SOURCES.
${_d}}
408 .PATH
: ${X11SRCDIR.MesaLib
}/src
/gallium
/${_d}
411 #. if defined(${GALLIUM_SOURCES.${_d}})
412 #SRCS+= ${GALLIUM_SOURCES.${_d}}
415 .
include "../libloader.mk"
417 LIBDPLIBS
+= m
${.CURDIR
}/..
/..
/..
/..
/..
/lib
/libm
418 LIBDPLIBS
+= drm
${.CURDIR
}/..
/libdrm
419 LIBDPLIBS
+= drm_radeon
${.CURDIR
}/..
/libdrm_radeon
420 LIBDPLIBS
+= glapi
${.CURDIR
}/..
/libglapi
421 LIBDPLIBS
+= expat
${.CURDIR
}/..
/..
/..
/..
/..
/external
/mit
/expat
/lib
/libexpat
423 LDFLAGS
+= -Wl
,--version-script
=${X11SRCDIR.MesaLib
}/src
/gallium
/targets
/dri
/dri.sym
425 ## build mesagallium parts
426 MESA_SRC_MODULES
= main math vbo state_tracker program asm_s
427 .
include "../libmesa.mk"
428 .
include "../libglsl.mk"
430 # Special addition for just gallium; it misses the rest of asm_c files.
431 .PATH
: ${X11SRCDIR.MesaLib
}/src
/mesa
/x86
434 .if
${MACHINE} == "amd64" ||
${MACHINE} == "i386"
435 SRCS
+= streaming-load-memcpy.c
436 CFLAGS.streaming-load-memcpy.c
+= -msse4.1
439 .
include "../driver.mk"
442 .PATH
: ${X11SRCDIR.MesaLib
}/src
/gallium
/targets
/dri
446 -I
${X11SRCDIR.MesaLib
}/src
/gallium
/include \
447 -I
${X11SRCDIR.MesaLib
}/src
/gallium
/auxiliary \
448 -I
${X11SRCDIR.MesaLib
}/src
/gallium
/drivers \
449 -I
${X11SRCDIR.MesaLib
}/..
/src
/mesa
/drivers
/dri
/common
451 CPPFLAGS.target.c
+= \
460 -I
${X11SRCDIR.MesaLib
}/src
/gallium
/state_trackers
/dri \
461 -I
${X11SRCDIR.MesaLib
}/src
/loader \
462 -I
${X11SRCDIR.MesaLib
}/src
/gallium
/winsys
464 CWARNFLAGS.clang
+= -Wno-error
=constant-conversion \
465 -Wno-error
=tautological-constant-out-of-range-compare \
466 -Wno-error
=pointer-sign \
468 -Wno-error
=absolute-value \
469 -Wno-error
=tautological-compare \
470 -Wno-error
=static-in-inline
472 .
include <bsd.x11.mk
>
473 LIBDIR
= ${X11USRLIBDIR}/modules
/dri
475 .for _d in
${DRIVERS}
476 SYMLINKS
+= gallium_dri.so
${DRIDIR}/${_d}_dri.so
477 SYMLINKS
+= gallium_dri.so.
${SHLIB_MAJOR} ${DRIDIR}/${_d}_dri.so.
${SHLIB_MAJOR}
478 .if
${MKDEBUG} != "no"
479 SYMLINKS
+= gallium_dri.so.
${SHLIB_MAJOR}.debug
${DRIDEBUGDIR}/${_d}_dri.so.
${SHLIB_MAJOR}.debug
483 .
include <bsd.lib.mk
>
484 # Don't regenerate c files