swr: [rasterizer core] minor cleanup to thread initialization
[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$(srcdir)/rasterizer \
39 -I$(srcdir)/rasterizer/core \
40 -I$(srcdir)/rasterizer/scripts \
41 -I$(srcdir)/rasterizer/jitter
42
43 COMMON_SOURCES = \
44 $(CXX_SOURCES) \
45 $(COMMON_CXX_SOURCES) \
46 $(CORE_CXX_SOURCES) \
47 $(JITTER_CXX_SOURCES) \
48 $(MEMORY_CXX_SOURCES) \
49 $(BUILT_SOURCES)
50
51 BUILT_SOURCES = \
52 swr_context_llvm.h \
53 rasterizer/scripts/gen_knobs.cpp \
54 rasterizer/scripts/gen_knobs.h \
55 rasterizer/jitter/state_llvm.h \
56 rasterizer/jitter/builder_x86.h \
57 rasterizer/jitter/builder_x86.cpp
58
59 MKDIR_GEN = $(AM_V_at)$(MKDIR_P) $(@D)
60 PYTHON_GEN = $(AM_V_GEN)$(PYTHON2) $(PYTHON_FLAGS)
61 swr_context_llvm.h: rasterizer/jitter/scripts/gen_llvm_types.py swr_context.h
62 $(PYTHON_GEN) \
63 $(srcdir)/rasterizer/jitter/scripts/gen_llvm_types.py \
64 --input $(srcdir)/swr_context.h \
65 --output swr_context_llvm.h
66
67 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
68 $(MKDIR_GEN)
69 $(PYTHON_GEN) \
70 $(srcdir)/rasterizer/scripts/gen_knobs.py \
71 rasterizer/scripts
72
73 rasterizer/jitter/state_llvm.h: rasterizer/jitter/scripts/gen_llvm_types.py rasterizer/core/state.h
74 $(MKDIR_GEN)
75 $(PYTHON_GEN) \
76 $(srcdir)/rasterizer/jitter/scripts/gen_llvm_types.py \
77 --input $(srcdir)/rasterizer/core/state.h \
78 --output rasterizer/jitter/state_llvm.h
79
80 rasterizer/jitter/builder_gen.h: rasterizer/jitter/scripts/gen_llvm_ir_macros.py
81 $(MKDIR_GEN)
82 $(PYTHON_GEN) \
83 $(srcdir)/rasterizer/jitter/scripts/gen_llvm_ir_macros.py \
84 --input $(LLVM_INCLUDEDIR)/llvm/IR/IRBuilder.h \
85 --output rasterizer/jitter/builder_gen.h \
86 --gen_h
87
88 rasterizer/jitter/builder_gen.cpp: rasterizer/jitter/scripts/gen_llvm_ir_macros.py
89 $(MKDIR_GEN)
90 $(PYTHON_GEN) \
91 $(srcdir)/rasterizer/jitter/scripts/gen_llvm_ir_macros.py \
92 --input $(LLVM_INCLUDEDIR)/llvm/IR/IRBuilder.h \
93 --output rasterizer/jitter/builder_gen.cpp \
94 --gen_cpp
95
96 rasterizer/jitter/builder_x86.h: rasterizer/jitter/scripts/gen_llvm_ir_macros.py
97 $(MKDIR_GEN)
98 $(PYTHON_GEN) \
99 $(srcdir)/rasterizer/jitter/scripts/gen_llvm_ir_macros.py \
100 --output rasterizer/jitter/builder_x86.h \
101 --gen_x86_h
102
103 rasterizer/jitter/builder_x86.cpp: rasterizer/jitter/scripts/gen_llvm_ir_macros.py
104 $(MKDIR_GEN)
105 $(PYTHON_GEN) \
106 $(srcdir)/rasterizer/jitter/scripts/gen_llvm_ir_macros.py \
107 --output rasterizer/jitter/builder_x86.cpp \
108 --gen_x86_cpp
109
110
111 COMMON_LIBADD = \
112 $(top_builddir)/src/gallium/auxiliary/libgallium.la \
113 $(top_builddir)/src/mesa/libmesagallium.la \
114 $(LLVM_LIBS)
115
116 COMMON_LDFLAGS = \
117 -shared \
118 -module \
119 -no-undefined \
120 $(GC_SECTIONS) \
121 $(NO_UNDEFINED) \
122 $(LLVM_LDFLAGS)
123
124
125 # XXX: As we cannot use BUILT_SOURCES (the files will end up in the dist
126 # tarball) just annotate the dependency directly.
127 # As the single direct user of builder_gen.h is a header (builder.h) trace all
128 # the translusive users (one that use the latter header).
129 rasterizer/jitter/blend_jit.cpp: rasterizer/jitter/builder_gen.h
130 rasterizer/jitter/builder.cpp: rasterizer/jitter/builder_gen.h
131 rasterizer/jitter/builder_gen.cpp: rasterizer/jitter/builder_gen.h
132 rasterizer/jitter/builder_x86.cpp: rasterizer/jitter/builder_gen.h
133 rasterizer/jitter/builder_misc.cpp: rasterizer/jitter/builder_gen.h
134 rasterizer/jitter/fetch_jit.cpp: rasterizer/jitter/builder_gen.h
135 rasterizer/jitter/streamout_jit.cpp: rasterizer/jitter/builder_gen.h
136 swr_shader.cpp: rasterizer/jitter/builder_gen.h
137
138 CLEANFILES = \
139 rasterizer/jitter/builder_gen.h \
140 rasterizer/jitter/builder_gen.cpp
141
142 # XXX: Due to the funky dependencies above, the builder_x86.cpp file gets
143 # generated (copied) into builddir when building from release tarball.
144 # Add a temporary workaround to remove it, until the above issue is resolved.
145 distclean-local:
146 ( test $(top_srcdir) != $(top_builddir) && \
147 rm $(builddir)/rasterizer/jitter/builder_x86.cpp ) || true
148
149 lib_LTLIBRARIES = libswrAVX.la libswrAVX2.la
150
151 libswrAVX_la_CXXFLAGS = \
152 $(SWR_AVX_CXXFLAGS) \
153 -DKNOB_ARCH=KNOB_ARCH_AVX \
154 $(COMMON_CXXFLAGS)
155
156 libswrAVX_la_SOURCES = \
157 $(COMMON_SOURCES)
158
159 # XXX: Don't ship these generated sources for now, since they are specific
160 # to the LLVM version they are generated from. Thus a release tarball
161 # containing the said files, generated against eg. LLVM 3.8 will fail to build
162 # on systems with other versions of LLVM eg. 3.7 or 3.6.
163 # Move these back to BUILT_SOURCES once that is resolved.
164 nodist_libswrAVX_la_SOURCES = \
165 rasterizer/jitter/builder_gen.h \
166 rasterizer/jitter/builder_gen.cpp
167
168 libswrAVX_la_LIBADD = \
169 $(COMMON_LIBADD)
170
171 libswrAVX_la_LDFLAGS = \
172 $(COMMON_LDFLAGS)
173
174 libswrAVX2_la_CXXFLAGS = \
175 $(SWR_AVX2_CXXFLAGS) \
176 -DKNOB_ARCH=KNOB_ARCH_AVX2 \
177 $(COMMON_CXXFLAGS)
178
179 libswrAVX2_la_SOURCES = \
180 $(COMMON_SOURCES)
181
182 # XXX: Don't ship these generated sources for now, since they are specific
183 # to the LLVM version they are generated from. Thus a release tarball
184 # containing the said files, generated against eg. LLVM 3.8 will fail to build
185 # on systems with other versions of LLVM eg. 3.7 or 3.6.
186 # Move these back to BUILT_SOURCES once that is resolved.
187 nodist_libswrAVX2_la_SOURCES = \
188 rasterizer/jitter/builder_gen.h \
189 rasterizer/jitter/builder_gen.cpp
190
191 libswrAVX2_la_LIBADD = \
192 $(COMMON_LIBADD)
193
194 libswrAVX2_la_LDFLAGS = \
195 $(COMMON_LDFLAGS)
196
197 include $(top_srcdir)/install-gallium-links.mk
198
199 EXTRA_DIST = \
200 rasterizer/jitter/scripts/gen_llvm_ir_macros.py \
201 rasterizer/jitter/scripts/gen_llvm_types.py \
202 rasterizer/scripts/gen_knobs.py \
203 rasterizer/scripts/knob_defs.py \
204 rasterizer/scripts/mako/ast.py \
205 rasterizer/scripts/mako/_ast_util.py \
206 rasterizer/scripts/mako/cache.py \
207 rasterizer/scripts/mako/cmd.py \
208 rasterizer/scripts/mako/codegen.py \
209 rasterizer/scripts/mako/compat.py \
210 rasterizer/scripts/mako/exceptions.py \
211 rasterizer/scripts/mako/filters.py \
212 rasterizer/scripts/mako/__init__.py \
213 rasterizer/scripts/mako/lexer.py \
214 rasterizer/scripts/mako/lookup.py \
215 rasterizer/scripts/mako/parsetree.py \
216 rasterizer/scripts/mako/pygen.py \
217 rasterizer/scripts/mako/pyparser.py \
218 rasterizer/scripts/mako/runtime.py \
219 rasterizer/scripts/mako/template.py \
220 rasterizer/scripts/mako/util.py \
221 rasterizer/scripts/templates/knobs.template