swr: [rasterizer] add archrast instrumentation
[mesa.git] / src / gallium / drivers / swr / Makefile.am
1 # Copyright (C) 2015 Intel Corporation. All Rights Reserved.
2 #
3 # Permission is hereby granted, free of charge, to any person obtaining a
4 # copy of this software and associated documentation files (the "Software"),
5 # to deal in the Software without restriction, including without limitation
6 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 # and/or sell copies of the Software, and to permit persons to whom the
8 # Software is furnished to do so, subject to the following conditions:
9 #
10 # The above copyright notice and this permission notice (including the next
11 # paragraph) shall be included in all copies or substantial portions of the
12 # Software.
13 #
14 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20 # IN THE SOFTWARE.
21
22 include Makefile.sources
23 include $(top_srcdir)/src/gallium/Automake.inc
24
25 AM_CXXFLAGS = $(GALLIUM_DRIVER_CFLAGS) $(SWR_CXX11_CXXFLAGS)
26
27 noinst_LTLIBRARIES = libmesaswr.la
28
29 libmesaswr_la_SOURCES = $(LOADER_SOURCES)
30
31 COMMON_CXXFLAGS = \
32 -fno-strict-aliasing \
33 $(GALLIUM_DRIVER_CFLAGS) \
34 $(LLVM_CXXFLAGS) \
35 $(SWR_CXX11_CXXFLAGS) \
36 -I$(builddir)/rasterizer/scripts \
37 -I$(builddir)/rasterizer/jitter \
38 -I$(builddir)/rasterizer/archrast \
39 -I$(srcdir)/rasterizer \
40 -I$(srcdir)/rasterizer/core \
41 -I$(srcdir)/rasterizer/scripts \
42 -I$(srcdir)/rasterizer/jitter \
43 -I$(srcdir)/rasterizer/archrast
44
45 COMMON_SOURCES = \
46 $(CXX_SOURCES) \
47 $(ARCHRAST_CXX_SOURCES) \
48 $(COMMON_CXX_SOURCES) \
49 $(CORE_CXX_SOURCES) \
50 $(JITTER_CXX_SOURCES) \
51 $(MEMORY_CXX_SOURCES) \
52 $(BUILT_SOURCES)
53
54 BUILT_SOURCES = \
55 swr_context_llvm.h \
56 rasterizer/scripts/gen_knobs.cpp \
57 rasterizer/scripts/gen_knobs.h \
58 rasterizer/jitter/state_llvm.h \
59 rasterizer/jitter/builder_x86.h \
60 rasterizer/jitter/builder_x86.cpp \
61 rasterizer/archrast/gen_ar_event.h \
62 rasterizer/archrast/gen_ar_event.cpp \
63 rasterizer/archrast/gen_ar_eventhandler.h
64
65 MKDIR_GEN = $(AM_V_at)$(MKDIR_P) $(@D)
66 PYTHON_GEN = $(AM_V_GEN)$(PYTHON2) $(PYTHON_FLAGS)
67 swr_context_llvm.h: rasterizer/jitter/scripts/gen_llvm_types.py swr_context.h
68 $(PYTHON_GEN) \
69 $(srcdir)/rasterizer/jitter/scripts/gen_llvm_types.py \
70 --input $(srcdir)/swr_context.h \
71 --output swr_context_llvm.h
72
73 rasterizer/scripts/gen_knobs.cpp rasterizer/scripts/gen_knobs.h: rasterizer/scripts/gen_knobs.py rasterizer/scripts/knob_defs.py rasterizer/scripts/templates/knobs.template
74 $(MKDIR_GEN)
75 $(PYTHON_GEN) \
76 $(srcdir)/rasterizer/scripts/gen_knobs.py \
77 rasterizer/scripts
78
79 rasterizer/jitter/state_llvm.h: rasterizer/jitter/scripts/gen_llvm_types.py rasterizer/core/state.h
80 $(MKDIR_GEN)
81 $(PYTHON_GEN) \
82 $(srcdir)/rasterizer/jitter/scripts/gen_llvm_types.py \
83 --input $(srcdir)/rasterizer/core/state.h \
84 --output rasterizer/jitter/state_llvm.h
85
86 rasterizer/jitter/builder_gen.h: rasterizer/jitter/scripts/gen_llvm_ir_macros.py
87 $(MKDIR_GEN)
88 $(PYTHON_GEN) \
89 $(srcdir)/rasterizer/jitter/scripts/gen_llvm_ir_macros.py \
90 --input $(LLVM_INCLUDEDIR)/llvm/IR/IRBuilder.h \
91 --output rasterizer/jitter/builder_gen.h \
92 --gen_h
93
94 rasterizer/jitter/builder_gen.cpp: rasterizer/jitter/scripts/gen_llvm_ir_macros.py
95 $(MKDIR_GEN)
96 $(PYTHON_GEN) \
97 $(srcdir)/rasterizer/jitter/scripts/gen_llvm_ir_macros.py \
98 --input $(LLVM_INCLUDEDIR)/llvm/IR/IRBuilder.h \
99 --output rasterizer/jitter/builder_gen.cpp \
100 --gen_cpp
101
102 rasterizer/jitter/builder_x86.h: rasterizer/jitter/scripts/gen_llvm_ir_macros.py
103 $(MKDIR_GEN)
104 $(PYTHON_GEN) \
105 $(srcdir)/rasterizer/jitter/scripts/gen_llvm_ir_macros.py \
106 --output rasterizer/jitter/builder_x86.h \
107 --gen_x86_h
108
109 rasterizer/jitter/builder_x86.cpp: rasterizer/jitter/scripts/gen_llvm_ir_macros.py
110 $(MKDIR_GEN)
111 $(PYTHON_GEN) \
112 $(srcdir)/rasterizer/jitter/scripts/gen_llvm_ir_macros.py \
113 --output rasterizer/jitter/builder_x86.cpp \
114 --gen_x86_cpp
115
116 rasterizer/archrast/gen_ar_event.h: rasterizer/scripts/gen_archrast.py rasterizer/scripts/templates/ar_event_h.template rasterizer/archrast/events.proto
117 $(MKDIR_GEN)
118 $(PYTHON_GEN) \
119 $(srcdir)/rasterizer/scripts/gen_archrast.py \
120 --proto $(srcdir)/rasterizer/archrast/events.proto \
121 --output rasterizer/archrast/gen_ar_event.h \
122 --gen_event_h
123
124 rasterizer/archrast/gen_ar_event.cpp: rasterizer/scripts/gen_archrast.py rasterizer/scripts/templates/ar_event_cpp.template rasterizer/archrast/events.proto
125 $(MKDIR_GEN)
126 $(PYTHON_GEN) \
127 $(srcdir)/rasterizer/scripts/gen_archrast.py \
128 --proto $(srcdir)/rasterizer/archrast/events.proto \
129 --output rasterizer/archrast/gen_ar_event.cpp \
130 --gen_event_cpp
131
132 rasterizer/archrast/gen_ar_eventhandler.h: rasterizer/scripts/gen_archrast.py rasterizer/scripts/templates/ar_eventhandler_h.template rasterizer/archrast/events.proto
133 $(MKDIR_GEN)
134 $(PYTHON_GEN) \
135 $(srcdir)/rasterizer/scripts/gen_archrast.py \
136 --proto $(srcdir)/rasterizer/archrast/events.proto \
137 --output rasterizer/archrast/gen_ar_eventhandler.h \
138 --gen_eventhandler_h
139
140 COMMON_LIBADD = \
141 $(top_builddir)/src/gallium/auxiliary/libgallium.la \
142 $(top_builddir)/src/mesa/libmesagallium.la \
143 $(LLVM_LIBS)
144
145 COMMON_LDFLAGS = \
146 -shared \
147 -module \
148 -no-undefined \
149 $(GC_SECTIONS) \
150 $(NO_UNDEFINED) \
151 $(LLVM_LDFLAGS)
152
153
154 # XXX: As we cannot use BUILT_SOURCES (the files will end up in the dist
155 # tarball) just annotate the dependency directly.
156 # As the single direct user of builder_gen.h is a header (builder.h) trace all
157 # the translusive users (one that use the latter header).
158 rasterizer/jitter/blend_jit.cpp: rasterizer/jitter/builder_gen.h
159 rasterizer/jitter/builder.cpp: rasterizer/jitter/builder_gen.h
160 rasterizer/jitter/builder_gen.cpp: rasterizer/jitter/builder_gen.h
161 rasterizer/jitter/builder_x86.cpp: rasterizer/jitter/builder_gen.h
162 rasterizer/jitter/builder_misc.cpp: rasterizer/jitter/builder_gen.h
163 rasterizer/jitter/fetch_jit.cpp: rasterizer/jitter/builder_gen.h
164 rasterizer/jitter/streamout_jit.cpp: rasterizer/jitter/builder_gen.h
165 swr_shader.cpp: rasterizer/jitter/builder_gen.h
166
167 CLEANFILES = \
168 rasterizer/jitter/builder_gen.h \
169 rasterizer/jitter/builder_gen.cpp
170
171 # XXX: Due to the funky dependencies above, the builder_x86.cpp file gets
172 # generated (copied) into builddir when building from release tarball.
173 # Add a temporary workaround to remove it, until the above issue is resolved.
174 distclean-local:
175 ( test $(top_srcdir) != $(top_builddir) && \
176 rm $(builddir)/rasterizer/jitter/builder_x86.cpp ) || true
177
178 lib_LTLIBRARIES = libswrAVX.la libswrAVX2.la
179
180 libswrAVX_la_CXXFLAGS = \
181 $(SWR_AVX_CXXFLAGS) \
182 -DKNOB_ARCH=KNOB_ARCH_AVX \
183 $(COMMON_CXXFLAGS)
184
185 libswrAVX_la_SOURCES = \
186 $(COMMON_SOURCES)
187
188 # XXX: Don't ship these generated sources for now, since they are specific
189 # to the LLVM version they are generated from. Thus a release tarball
190 # containing the said files, generated against eg. LLVM 3.8 will fail to build
191 # on systems with other versions of LLVM eg. 3.7 or 3.6.
192 # Move these back to BUILT_SOURCES once that is resolved.
193 nodist_libswrAVX_la_SOURCES = \
194 rasterizer/jitter/builder_gen.h \
195 rasterizer/jitter/builder_gen.cpp
196
197 libswrAVX_la_LIBADD = \
198 $(COMMON_LIBADD)
199
200 libswrAVX_la_LDFLAGS = \
201 $(COMMON_LDFLAGS)
202
203 libswrAVX2_la_CXXFLAGS = \
204 $(SWR_AVX2_CXXFLAGS) \
205 -DKNOB_ARCH=KNOB_ARCH_AVX2 \
206 $(COMMON_CXXFLAGS)
207
208 libswrAVX2_la_SOURCES = \
209 $(COMMON_SOURCES)
210
211 # XXX: Don't ship these generated sources for now, since they are specific
212 # to the LLVM version they are generated from. Thus a release tarball
213 # containing the said files, generated against eg. LLVM 3.8 will fail to build
214 # on systems with other versions of LLVM eg. 3.7 or 3.6.
215 # Move these back to BUILT_SOURCES once that is resolved.
216 nodist_libswrAVX2_la_SOURCES = \
217 rasterizer/jitter/builder_gen.h \
218 rasterizer/jitter/builder_gen.cpp
219
220 libswrAVX2_la_LIBADD = \
221 $(COMMON_LIBADD)
222
223 libswrAVX2_la_LDFLAGS = \
224 $(COMMON_LDFLAGS)
225
226 include $(top_srcdir)/install-gallium-links.mk
227
228 EXTRA_DIST = \
229 rasterizer/archrast/events.proto \
230 rasterizer/jitter/scripts/gen_llvm_ir_macros.py \
231 rasterizer/jitter/scripts/gen_llvm_types.py \
232 rasterizer/scripts/gen_archrast.py \
233 rasterizer/scripts/gen_knobs.py \
234 rasterizer/scripts/knob_defs.py \
235 rasterizer/scripts/mako/ast.py \
236 rasterizer/scripts/mako/_ast_util.py \
237 rasterizer/scripts/mako/cache.py \
238 rasterizer/scripts/mako/cmd.py \
239 rasterizer/scripts/mako/codegen.py \
240 rasterizer/scripts/mako/compat.py \
241 rasterizer/scripts/mako/exceptions.py \
242 rasterizer/scripts/mako/filters.py \
243 rasterizer/scripts/mako/__init__.py \
244 rasterizer/scripts/mako/lexer.py \
245 rasterizer/scripts/mako/lookup.py \
246 rasterizer/scripts/mako/parsetree.py \
247 rasterizer/scripts/mako/pygen.py \
248 rasterizer/scripts/mako/pyparser.py \
249 rasterizer/scripts/mako/runtime.py \
250 rasterizer/scripts/mako/template.py \
251 rasterizer/scripts/mako/util.py \
252 rasterizer/scripts/templates/knobs.template \
253 rasterizer/scripts/templates/ar_event_h.template \
254 rasterizer/scripts/templates/ar_event_cpp.template \
255 rasterizer/scripts/templates/ar_eventhandler_h.template