gallium/freedreno: add automake target 'template'
[mesa.git] / src / gallium / targets / dri / Makefile.am
1 include $(top_srcdir)/src/gallium/Automake.inc
2
3 AM_CFLAGS = \
4 -I$(top_srcdir)/src/mapi \
5 -I$(top_srcdir)/src/mesa \
6 -I$(top_srcdir)/src/mesa/drivers/dri/common \
7 -I$(top_srcdir)/src/gallium/state_trackers/dri \
8 $(GALLIUM_TARGET_CFLAGS)
9
10 AM_CPPFLAGS = \
11 $(DEFINES) \
12 -DDRI_TARGET \
13 -DGALLIUM_GALAHAD \
14 -DGALLIUM_NOOP \
15 -DGALLIUM_RBUG \
16 -DGALLIUM_TRACE
17
18 dridir = $(DRI_DRIVER_INSTALL_DIR)
19 dri_LTLIBRARIES = gallium_dri.la
20
21 nodist_EXTRA_gallium_dri_la_SOURCES = dummy.cpp
22 gallium_dri_la_SOURCES =
23
24 gallium_dri_la_LDFLAGS = \
25 -shared \
26 -shrext .so \
27 -module \
28 -avoid-version \
29 $(GC_SECTIONS)
30
31 if HAVE_LD_VERSION_SCRIPT
32 gallium_dri_la_LDFLAGS += \
33 -Wl,--version-script=$(top_srcdir)/src/gallium/targets/dri/dri.sym
34 endif # HAVE_LD_VERSION_SCRIPT
35
36 if HAVE_LD_DYNAMIC_LIST
37 gallium_dri_la_LDFLAGS += \
38 -Wl,--dynamic-list=$(top_srcdir)/src/gallium/targets/dri-vdpau.dyn
39 endif # HAVE_LD_DYNAMIC_LIST
40
41 gallium_dri_la_LIBADD = \
42 $(top_builddir)/src/mesa/libmesagallium.la \
43 $(top_builddir)/src/mesa/drivers/dri/common/libdricommon.la \
44 $(top_builddir)/src/mesa/drivers/dri/common/libmegadriver_stub.la \
45 $(top_builddir)/src/gallium/state_trackers/dri/libdri.la \
46 $(top_builddir)/src/gallium/auxiliary/libgallium.la \
47 $(top_builddir)/src/gallium/drivers/galahad/libgalahad.la \
48 $(top_builddir)/src/gallium/drivers/noop/libnoop.la \
49 $(top_builddir)/src/gallium/drivers/rbug/librbug.la \
50 $(top_builddir)/src/gallium/drivers/trace/libtrace.la \
51 $(SELINUX_LIBS) \
52 $(EXPAT_LIBS) \
53 $(LIBDRM_LIBS) \
54 $(GALLIUM_COMMON_LIB_DEPS)
55
56 # XXX: Temporary allow duplicated symbols, as the loader pulls in xmlconfig.c
57 # which already provides driParse* and driQuery* amongst others.
58 # Remove this hack as we come up with a cleaner solution.
59 gallium_dri_la_LDFLAGS += \
60 -Wl,--allow-multiple-definition
61
62 MEGADRIVERS =
63 STATIC_TARGET_CPPFLAGS =
64 STATIC_TARGET_LIB_DEPS = \
65 $(top_builddir)/src/loader/libloader.la
66
67 TARGET_DRIVERS =
68 TARGET_CPPFLAGS =
69 TARGET_LIB_DEPS =
70
71 if HAVE_GALLIUM_I915
72 MEGADRIVERS += i915
73 STATIC_TARGET_CPPFLAGS += -DGALLIUM_I915
74 STATIC_TARGET_LIB_DEPS += \
75 $(top_builddir)/src/gallium/winsys/i915/drm/libi915drm.la \
76 $(top_builddir)/src/gallium/drivers/i915/libi915.la \
77 $(INTEL_LIBS)
78 endif
79
80 if HAVE_GALLIUM_ILO
81 MEGADRIVERS += ilo
82 STATIC_TARGET_CPPFLAGS += -DGALLIUM_ILO
83 STATIC_TARGET_LIB_DEPS += \
84 $(top_builddir)/src/gallium/winsys/intel/drm/libintelwinsys.la \
85 $(top_builddir)/src/gallium/drivers/ilo/libilo.la \
86 $(INTEL_LIBS)
87 endif
88
89 include $(top_srcdir)/src/gallium/drivers/nouveau/Automake.inc
90
91 if NEED_RADEON_DRM_WINSYS
92 STATIC_TARGET_LIB_DEPS += \
93 $(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la
94 endif
95
96 if HAVE_GALLIUM_RADEON_COMMON
97 STATIC_TARGET_LIB_DEPS += \
98 $(top_builddir)/src/gallium/drivers/radeon/libradeon.la
99 endif
100
101 if HAVE_GALLIUM_R300
102 MEGADRIVERS += r300
103 STATIC_TARGET_CPPFLAGS += -DGALLIUM_R300
104 STATIC_TARGET_LIB_DEPS += \
105 $(top_builddir)/src/gallium/drivers/r300/libr300.la \
106 $(RADEON_LIBS)
107 endif
108
109 if HAVE_GALLIUM_R600
110 MEGADRIVERS += r600
111 STATIC_TARGET_CPPFLAGS += -DGALLIUM_R600
112 STATIC_TARGET_LIB_DEPS += \
113 $(top_builddir)/src/gallium/drivers/r600/libr600.la \
114 $(RADEON_LIBS)
115 endif
116
117 if HAVE_GALLIUM_RADEONSI
118 MEGADRIVERS += radeonsi
119 STATIC_TARGET_CPPFLAGS += -DGALLIUM_RADEONSI
120 STATIC_TARGET_LIB_DEPS += \
121 $(top_builddir)/src/gallium/drivers/radeonsi/libradeonsi.la \
122 $(RADEON_LIBS)
123 endif
124
125 if HAVE_GALLIUM_SVGA
126 MEGADRIVERS += vmwgfx
127 STATIC_TARGET_CPPFLAGS += -DGALLIUM_VMWGFX
128 STATIC_TARGET_LIB_DEPS += \
129 $(top_builddir)/src/gallium/winsys/svga/drm/libsvgadrm.la \
130 $(top_builddir)/src/gallium/drivers/svga/libsvga.la
131 endif
132
133 include $(top_srcdir)/src/gallium/drivers/freedreno/Automake.inc
134
135 if HAVE_GALLIUM_VC4
136 MEGADRIVERS += vc4
137 STATIC_TARGET_CPPFLAGS += -DGALLIUM_VC4
138 STATIC_TARGET_LIB_DEPS += \
139 $(top_builddir)/src/gallium/winsys/vc4/drm/libvc4drm.la \
140 $(top_builddir)/src/gallium/drivers/vc4/libvc4.la
141
142 if USE_VC4_SIMULATOR
143 STATIC_TARGET_CPPFLAGS += -DUSE_VC4_SIMULATOR
144 endif
145 endif
146
147 if HAVE_GALLIUM_SOFTPIPE
148 MEGADRIVERS += swrast
149 STATIC_TARGET_CPPFLAGS += -DGALLIUM_SOFTPIPE
150 STATIC_TARGET_LIB_DEPS += \
151 $(top_builddir)/src/gallium/winsys/sw/dri/libswdri.la \
152 $(top_builddir)/src/gallium/drivers/softpipe/libsoftpipe.la
153
154 if HAVE_DRI2
155 MEGADRIVERS += kms_swrast
156 STATIC_TARGET_LIB_DEPS += \
157 $(top_builddir)/src/gallium/winsys/sw/kms-dri/libswkmsdri.la
158 endif
159 endif
160
161 if NEED_GALLIUM_LLVMPIPE_DRIVER
162 STATIC_TARGET_CPPFLAGS += -DGALLIUM_LLVMPIPE
163 STATIC_TARGET_LIB_DEPS += \
164 $(top_builddir)/src/gallium/drivers/llvmpipe/libllvmpipe.la
165 endif
166
167 if HAVE_GALLIUM_STATIC_TARGETS
168
169 gallium_dri_la_SOURCES += target.c
170 AM_CPPFLAGS += $(STATIC_TARGET_CPPFLAGS) $(TARGET_CPPFLAGS)
171 gallium_dri_la_LIBADD += $(STATIC_TARGET_LIB_DEPS) $(TARGET_LIB_DEPS)
172
173 else # HAVE_GALLIUM_STATIC_TARGETS
174
175 gallium_dri_la_LIBADD += \
176 $(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader.la \
177 $(GALLIUM_PIPE_LOADER_WINSYS_LIBS) \
178 $(GALLIUM_PIPE_LOADER_LIBS)
179
180 endif # HAVE_GALLIUM_STATIC_TARGETS
181
182 if HAVE_MESA_LLVM
183 gallium_dri_la_LIBADD += $(LLVM_LIBS)
184 gallium_dri_la_LDFLAGS += $(LLVM_LDFLAGS)
185 endif
186
187 if HAVE_COMPAT_SYMLINKS
188 # Add a link to allow setting LIBGL_DRIVERS_PATH to /lib/gallium of the build tree.
189 all-local: $(dri_LTLIBRARIES)
190 $(AM_V_GEN)link_dir=$(top_builddir)/$(LIB_DIR)/gallium; \
191 $(MKDIR_P) $${link_dir}; \
192 for i in $(MEGADRIVERS) $(TARGET_DRIVERS); do \
193 j=gallium_dri.so; \
194 k=$${i}_dri.so; \
195 ln -f .libs/$${j} \
196 $${link_dir}/$${k}; \
197 done
198 endif
199
200 # hardlink each megadriver instance, but don't actually have
201 # gallium_dri.so in the set of final installed files.
202 install-data-hook:
203 $(AM_V_GEN)dest_dir=$(DESTDIR)/$(dridir); \
204 for i in $(MEGADRIVERS) $(TARGET_DRIVERS); do \
205 j=gallium_dri.so; \
206 k=$${i}_dri.so; \
207 ln -f $${dest_dir}/$${j} \
208 $${dest_dir}/$${k}; \
209 done; \
210 $(RM) -f $$dest_dir/gallium_dri.*