e4d9a7e9794cc55c13eb13ad099a0ed8c535f183
[mesa.git] / src / gallium / targets / dri / Makefile.am
1 include $(top_srcdir)/src/gallium/Automake.inc
2
3 AM_CFLAGS = \
4 $(GALLIUM_TARGET_CFLAGS)
5
6 AM_CPPFLAGS = \
7 -DGALLIUM_GALAHAD \
8 -DGALLIUM_NOOP \
9 -DGALLIUM_RBUG \
10 -DGALLIUM_TRACE
11
12 dridir = $(DRI_DRIVER_INSTALL_DIR)
13 dri_LTLIBRARIES = gallium_dri.la
14
15 nodist_EXTRA_gallium_dri_la_SOURCES = dummy.cpp
16 gallium_dri_la_SOURCES =
17
18 gallium_dri_la_LDFLAGS = \
19 -shared \
20 -shrext .so \
21 -module \
22 -avoid-version \
23 -Wl,--dynamic-list=$(top_srcdir)/src/gallium/targets/dri-vdpau.dyn \
24 $(GC_SECTIONS)
25
26 if HAVE_LD_VERSION_SCRIPT
27 gallium_dri_la_LDFLAGS += \
28 -Wl,--version-script=$(top_srcdir)/src/gallium/targets/dri/dri.sym
29 endif # HAVE_LD_VERSION_SCRIPT
30
31 # XXX: Fold libdridrm/libdrisw as drivers become megadriver (__dri*DriverExtension) aware
32 gallium_dri_la_LIBADD = \
33 $(top_builddir)/src/mesa/libmesagallium.la \
34 $(top_builddir)/src/mesa/drivers/dri/common/libdricommon.la \
35 $(top_builddir)/src/gallium/state_trackers/dri/drm/libdridrm_s.la \
36 $(top_builddir)/src/gallium/auxiliary/libgallium.la \
37 $(top_builddir)/src/gallium/drivers/galahad/libgalahad.la \
38 $(top_builddir)/src/gallium/drivers/noop/libnoop.la \
39 $(top_builddir)/src/gallium/drivers/rbug/librbug.la \
40 $(top_builddir)/src/gallium/drivers/trace/libtrace.la \
41 $(SELINUX_LIBS) \
42 $(EXPAT_LIBS) \
43 $(LIBDRM_LIBS) \
44 $(GALLIUM_COMMON_LIB_DEPS)
45
46 if HAVE_GALLIUM_STATIC_TARGETS
47
48 MEGADRIVERS =
49 STATIC_TARGET_CPPFLAGS =
50 STATIC_TARGET_LIB_DEPS = \
51 $(top_builddir)/src/loader/libloader.la
52
53 if HAVE_GALLIUM_NOUVEAU
54 MEGADRIVERS += nouveau
55 STATIC_TARGET_CPPFLAGS += -DGALLIUM_NOUVEAU
56 STATIC_TARGET_LIB_DEPS += \
57 $(top_builddir)/src/gallium/winsys/nouveau/drm/libnouveaudrm.la \
58 $(top_builddir)/src/gallium/drivers/nouveau/libnouveau.la \
59 $(NOUVEAU_LIBS)
60 endif
61
62 if NEED_RADEON_DRM_WINSYS
63 STATIC_TARGET_LIB_DEPS += \
64 $(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la
65 endif
66
67 if HAVE_GALLIUM_RADEON_COMMON
68 STATIC_TARGET_LIB_DEPS += \
69 $(top_builddir)/src/gallium/drivers/radeon/libradeon.la
70 endif
71
72 if HAVE_GALLIUM_R300
73 MEGADRIVERS += r300
74 STATIC_TARGET_CPPFLAGS += -DGALLIUM_R300
75 STATIC_TARGET_LIB_DEPS += \
76 $(top_builddir)/src/gallium/drivers/r300/libr300.la \
77 $(RADEON_LIBS)
78 endif
79
80 if HAVE_GALLIUM_R600
81 MEGADRIVERS += r600
82 STATIC_TARGET_CPPFLAGS += -DGALLIUM_R600
83 STATIC_TARGET_LIB_DEPS += \
84 $(top_builddir)/src/gallium/drivers/r600/libr600.la \
85 $(RADEON_LIBS)
86 endif
87
88 if HAVE_GALLIUM_RADEONSI
89 MEGADRIVERS += radeonsi
90 STATIC_TARGET_CPPFLAGS += -DGALLIUM_RADEONSI
91 STATIC_TARGET_LIB_DEPS += \
92 $(top_builddir)/src/gallium/drivers/radeonsi/libradeonsi.la \
93 $(RADEON_LIBS)
94 endif
95
96 if HAVE_GALLIUM_FREEDRENO
97 MEGADRIVERS += freedreno
98 STATIC_TARGET_CPPFLAGS += -DGALLIUM_FREEDRENO
99 STATIC_TARGET_LIB_DEPS += \
100 $(top_builddir)/src/gallium/winsys/freedreno/drm/libfreedrenodrm.la \
101 $(top_builddir)/src/gallium/drivers/freedreno/libfreedreno.la \
102 $(FREEDRENO_LIBS)
103
104 endif
105
106 gallium_dri_la_SOURCES += target.c
107 AM_CPPFLAGS += $(STATIC_TARGET_CPPFLAGS)
108 gallium_dri_la_LIBADD += $(STATIC_TARGET_LIB_DEPS)
109
110 else # HAVE_GALLIUM_STATIC_TARGETS
111
112 gallium_dri_la_LIBADD += \
113 $(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader.la \
114 $(GALLIUM_PIPE_LOADER_WINSYS_LIBS) \
115 $(GALLIUM_PIPE_LOADER_LIBS)
116
117 endif # HAVE_GALLIUM_STATIC_TARGETS
118
119 if HAVE_MESA_LLVM
120 gallium_dri_la_LIBADD += $(LLVM_LIBS)
121 gallium_dri_la_LDFLAGS += $(LLVM_LDFLAGS)
122 endif
123
124 if HAVE_COMPAT_SYMLINKS
125 # Add a link to allow setting LIBGL_DRIVERS_PATH to /lib/gallium of the build tree.
126 all-local: $(dri_LTLIBRARIES)
127 $(AM_V_GEN)link_dir=$(top_builddir)/$(LIB_DIR)/gallium; \
128 $(MKDIR_P) $${link_dir}; \
129 for i in $(MEGADRIVERS); do \
130 j=gallium_dri.so; \
131 k=$${i}_dri.so; \
132 ln -f .libs/$${j} \
133 $${link_dir}/$${k}; \
134 done
135 endif
136
137 # hardlink each megadriver instance, but don't actually have
138 # gallium_dri.so in the set of final installed files.
139 install-data-hook:
140 $(AM_V_GEN)dest_dir=$(DESTDIR)/$(dridir); \
141 for i in $(MEGADRIVERS); do \
142 j=gallium_dri.so; \
143 k=$${i}_dri.so; \
144 ln -f $${dest_dir}/$${j} \
145 $${dest_dir}/$${k}; \
146 done; \
147 $(RM) -f $$dest_dir/gallium_dri.*