1 # Copyright (C) 2015 Intel Corporation. All Rights Reserved.
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:
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
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
22 include Makefile.sources
23 include $(top_srcdir)/src/gallium/Automake.inc
25 AM_CXXFLAGS = $(GALLIUM_DRIVER_CFLAGS) $(SWR_CXX11_CXXFLAGS)
27 noinst_LTLIBRARIES = libmesaswr.la
29 libmesaswr_la_SOURCES = $(LOADER_SOURCES)
32 -fno-strict-aliasing \
33 $(GALLIUM_DRIVER_CFLAGS) \
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
47 $(ARCHRAST_CXX_SOURCES) \
48 $(COMMON_CXX_SOURCES) \
50 $(JITTER_CXX_SOURCES) \
51 $(MEMORY_CXX_SOURCES) \
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 rasterizer/archrast/gen_ar_eventhandlerfile.h
66 MKDIR_GEN = $(AM_V_at)$(MKDIR_P) $(@D)
67 PYTHON_GEN = $(AM_V_GEN)$(PYTHON2) $(PYTHON_FLAGS)
68 swr_context_llvm.h: rasterizer/jitter/scripts/gen_llvm_types.py swr_context.h
70 $(srcdir)/rasterizer/jitter/scripts/gen_llvm_types.py \
71 --input $(srcdir)/swr_context.h \
72 --output swr_context_llvm.h
74 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
77 $(srcdir)/rasterizer/scripts/gen_knobs.py \
80 rasterizer/jitter/state_llvm.h: rasterizer/jitter/scripts/gen_llvm_types.py rasterizer/core/state.h
83 $(srcdir)/rasterizer/jitter/scripts/gen_llvm_types.py \
84 --input $(srcdir)/rasterizer/core/state.h \
85 --output rasterizer/jitter/state_llvm.h
87 rasterizer/jitter/builder_gen.h: rasterizer/jitter/scripts/gen_llvm_ir_macros.py
90 $(srcdir)/rasterizer/jitter/scripts/gen_llvm_ir_macros.py \
91 --input $(LLVM_INCLUDEDIR)/llvm/IR/IRBuilder.h \
92 --output rasterizer/jitter/builder_gen.h \
95 rasterizer/jitter/builder_gen.cpp: rasterizer/jitter/scripts/gen_llvm_ir_macros.py
98 $(srcdir)/rasterizer/jitter/scripts/gen_llvm_ir_macros.py \
99 --input $(LLVM_INCLUDEDIR)/llvm/IR/IRBuilder.h \
100 --output rasterizer/jitter/builder_gen.cpp \
103 rasterizer/jitter/builder_x86.h: rasterizer/jitter/scripts/gen_llvm_ir_macros.py
106 $(srcdir)/rasterizer/jitter/scripts/gen_llvm_ir_macros.py \
107 --output rasterizer/jitter/builder_x86.h \
110 rasterizer/jitter/builder_x86.cpp: rasterizer/jitter/scripts/gen_llvm_ir_macros.py
113 $(srcdir)/rasterizer/jitter/scripts/gen_llvm_ir_macros.py \
114 --output rasterizer/jitter/builder_x86.cpp \
117 rasterizer/archrast/gen_ar_event.h: rasterizer/scripts/gen_archrast.py rasterizer/scripts/templates/ar_event_h.template rasterizer/archrast/events.proto
120 $(srcdir)/rasterizer/scripts/gen_archrast.py \
121 --proto $(srcdir)/rasterizer/archrast/events.proto \
122 --output rasterizer/archrast/gen_ar_event.h \
125 rasterizer/archrast/gen_ar_event.cpp: rasterizer/scripts/gen_archrast.py rasterizer/scripts/templates/ar_event_cpp.template rasterizer/archrast/events.proto
128 $(srcdir)/rasterizer/scripts/gen_archrast.py \
129 --proto $(srcdir)/rasterizer/archrast/events.proto \
130 --output rasterizer/archrast/gen_ar_event.cpp \
133 rasterizer/archrast/gen_ar_eventhandler.h: rasterizer/scripts/gen_archrast.py rasterizer/scripts/templates/ar_eventhandler_h.template rasterizer/archrast/events.proto
136 $(srcdir)/rasterizer/scripts/gen_archrast.py \
137 --proto $(srcdir)/rasterizer/archrast/events.proto \
138 --output rasterizer/archrast/gen_ar_eventhandler.h \
141 rasterizer/archrast/gen_ar_eventhandlerfile.h: rasterizer/scripts/gen_archrast.py rasterizer/scripts/templates/ar_eventhandlerfile_h.template rasterizer/archrast/events.proto
144 $(srcdir)/rasterizer/scripts/gen_archrast.py \
145 --proto $(srcdir)/rasterizer/archrast/events.proto \
146 --output rasterizer/archrast/gen_ar_eventhandlerfile.h \
147 --gen_eventhandlerfile_h
150 $(top_builddir)/src/gallium/auxiliary/libgallium.la \
151 $(top_builddir)/src/mesa/libmesagallium.la \
163 # XXX: As we cannot use BUILT_SOURCES (the files will end up in the dist
164 # tarball) just annotate the dependency directly.
165 # As the single direct user of builder_gen.h is a header (builder.h) trace all
166 # the translusive users (one that use the latter header).
167 rasterizer/jitter/blend_jit.cpp: rasterizer/jitter/builder_gen.h
168 rasterizer/jitter/builder.cpp: rasterizer/jitter/builder_gen.h
169 rasterizer/jitter/builder_gen.cpp: rasterizer/jitter/builder_gen.h
170 rasterizer/jitter/builder_x86.cpp: rasterizer/jitter/builder_gen.h
171 rasterizer/jitter/builder_misc.cpp: rasterizer/jitter/builder_gen.h
172 rasterizer/jitter/fetch_jit.cpp: rasterizer/jitter/builder_gen.h
173 rasterizer/jitter/streamout_jit.cpp: rasterizer/jitter/builder_gen.h
174 swr_shader.cpp: rasterizer/jitter/builder_gen.h
177 rasterizer/jitter/builder_gen.h \
178 rasterizer/jitter/builder_gen.cpp
180 # XXX: Due to the funky dependencies above, the builder_x86.cpp file gets
181 # generated (copied) into builddir when building from release tarball.
182 # Add a temporary workaround to remove it, until the above issue is resolved.
184 ( test $(top_srcdir) != $(top_builddir) && \
185 rm $(builddir)/rasterizer/jitter/builder_x86.cpp ) || true
187 lib_LTLIBRARIES = libswrAVX.la libswrAVX2.la
189 libswrAVX_la_CXXFLAGS = \
190 $(SWR_AVX_CXXFLAGS) \
191 -DKNOB_ARCH=KNOB_ARCH_AVX \
194 libswrAVX_la_SOURCES = \
197 # XXX: Don't ship these generated sources for now, since they are specific
198 # to the LLVM version they are generated from. Thus a release tarball
199 # containing the said files, generated against eg. LLVM 3.8 will fail to build
200 # on systems with other versions of LLVM eg. 3.7 or 3.6.
201 # Move these back to BUILT_SOURCES once that is resolved.
202 nodist_libswrAVX_la_SOURCES = \
203 rasterizer/jitter/builder_gen.h \
204 rasterizer/jitter/builder_gen.cpp
206 libswrAVX_la_LIBADD = \
209 libswrAVX_la_LDFLAGS = \
212 libswrAVX2_la_CXXFLAGS = \
213 $(SWR_AVX2_CXXFLAGS) \
214 -DKNOB_ARCH=KNOB_ARCH_AVX2 \
217 libswrAVX2_la_SOURCES = \
220 # XXX: Don't ship these generated sources for now, since they are specific
221 # to the LLVM version they are generated from. Thus a release tarball
222 # containing the said files, generated against eg. LLVM 3.8 will fail to build
223 # on systems with other versions of LLVM eg. 3.7 or 3.6.
224 # Move these back to BUILT_SOURCES once that is resolved.
225 nodist_libswrAVX2_la_SOURCES = \
226 rasterizer/jitter/builder_gen.h \
227 rasterizer/jitter/builder_gen.cpp
229 libswrAVX2_la_LIBADD = \
232 libswrAVX2_la_LDFLAGS = \
235 include $(top_srcdir)/install-gallium-links.mk
238 rasterizer/archrast/events.proto \
239 rasterizer/jitter/scripts/gen_llvm_ir_macros.py \
240 rasterizer/jitter/scripts/gen_llvm_types.py \
241 rasterizer/scripts/gen_archrast.py \
242 rasterizer/scripts/gen_knobs.py \
243 rasterizer/scripts/knob_defs.py \
244 rasterizer/scripts/mako/ast.py \
245 rasterizer/scripts/mako/_ast_util.py \
246 rasterizer/scripts/mako/cache.py \
247 rasterizer/scripts/mako/cmd.py \
248 rasterizer/scripts/mako/codegen.py \
249 rasterizer/scripts/mako/compat.py \
250 rasterizer/scripts/mako/exceptions.py \
251 rasterizer/scripts/mako/filters.py \
252 rasterizer/scripts/mako/__init__.py \
253 rasterizer/scripts/mako/lexer.py \
254 rasterizer/scripts/mako/lookup.py \
255 rasterizer/scripts/mako/parsetree.py \
256 rasterizer/scripts/mako/pygen.py \
257 rasterizer/scripts/mako/pyparser.py \
258 rasterizer/scripts/mako/runtime.py \
259 rasterizer/scripts/mako/template.py \
260 rasterizer/scripts/mako/util.py \
261 rasterizer/scripts/templates/knobs.template \
262 rasterizer/scripts/templates/ar_event_h.template \
263 rasterizer/scripts/templates/ar_event_cpp.template \
264 rasterizer/scripts/templates/ar_eventhandler_h.template