1# Copyright © 2016 Intel Corporation
2# Copyright © 2016 Mauro Rossi <issor.oruam@gmail.com>
3#
4# Permission is hereby granted, free of charge, to any person obtaining a
5# copy of this software and associated documentation files (the "Software"),
6# to deal in the Software without restriction, including without limitation
7# the rights to use, copy, modify, merge, publish, distribute, sublicense,
8# and/or sell copies of the Software, and to permit persons to whom the
9# Software is furnished to do so, subject to the following conditions:
10#
11# The above copyright notice and this permission notice shall be included
12# in all copies or substantial portions of the 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
20# DEALINGS IN THE SOFTWARE.
21#
22
23# ---------------------------------------
24# libmesa_isl_gen* common variables
25# ---------------------------------------
26
27LIBISL_GENX_COMMON_INCLUDES := \
28	$(MESA_TOP)/src/
29
30# ---------------------------------------
31# Build libmesa_isl_gen4
32# ---------------------------------------
33
34include $(CLEAR_VARS)
35
36LOCAL_MODULE := libmesa_isl_gen4
37
38LOCAL_SRC_FILES := $(ISL_GEN4_FILES)
39
40LOCAL_CFLAGS := -DGEN_VERSIONx10=40
41
42LOCAL_C_INCLUDES := $(LIBISL_GENX_COMMON_INCLUDES)
43
44LOCAL_WHOLE_STATIC_LIBRARIES := libmesa_genxml
45
46include $(MESA_COMMON_MK)
47include $(BUILD_STATIC_LIBRARY)
48
49# ---------------------------------------
50# Build libmesa_isl_gen5
51# ---------------------------------------
52
53include $(CLEAR_VARS)
54
55LOCAL_MODULE := libmesa_isl_gen5
56
57LOCAL_SRC_FILES := $(ISL_GEN5_FILES)
58
59LOCAL_CFLAGS := -DGEN_VERSIONx10=50
60
61LOCAL_C_INCLUDES := $(LIBISL_GENX_COMMON_INCLUDES)
62
63LOCAL_WHOLE_STATIC_LIBRARIES := libmesa_genxml
64
65include $(MESA_COMMON_MK)
66include $(BUILD_STATIC_LIBRARY)
67
68# ---------------------------------------
69# Build libmesa_isl_gen6
70# ---------------------------------------
71
72include $(CLEAR_VARS)
73
74LOCAL_MODULE := libmesa_isl_gen6
75
76LOCAL_SRC_FILES := $(ISL_GEN6_FILES)
77
78LOCAL_CFLAGS := -DGEN_VERSIONx10=60
79
80LOCAL_C_INCLUDES := $(LIBISL_GENX_COMMON_INCLUDES)
81
82LOCAL_WHOLE_STATIC_LIBRARIES := libmesa_genxml
83
84include $(MESA_COMMON_MK)
85include $(BUILD_STATIC_LIBRARY)
86
87# ---------------------------------------
88# Build libmesa_isl_gen7
89# ---------------------------------------
90
91include $(CLEAR_VARS)
92
93LOCAL_MODULE := libmesa_isl_gen7
94
95LOCAL_SRC_FILES := $(ISL_GEN7_FILES)
96
97LOCAL_CFLAGS := -DGEN_VERSIONx10=70
98
99LOCAL_C_INCLUDES := $(LIBISL_GENX_COMMON_INCLUDES)
100
101LOCAL_WHOLE_STATIC_LIBRARIES := libmesa_genxml
102
103include $(MESA_COMMON_MK)
104include $(BUILD_STATIC_LIBRARY)
105
106# ---------------------------------------
107# Build libmesa_isl_gen75
108# ---------------------------------------
109
110include $(CLEAR_VARS)
111
112LOCAL_MODULE := libmesa_isl_gen75
113
114LOCAL_SRC_FILES := $(ISL_GEN75_FILES)
115
116LOCAL_CFLAGS := -DGEN_VERSIONx10=75
117
118LOCAL_C_INCLUDES := $(LIBISL_GENX_COMMON_INCLUDES)
119
120LOCAL_WHOLE_STATIC_LIBRARIES := libmesa_genxml
121
122include $(MESA_COMMON_MK)
123include $(BUILD_STATIC_LIBRARY)
124
125# ---------------------------------------
126# Build libmesa_isl_gen8
127# ---------------------------------------
128
129include $(CLEAR_VARS)
130
131LOCAL_MODULE := libmesa_isl_gen8
132
133LOCAL_SRC_FILES := $(ISL_GEN8_FILES)
134
135LOCAL_CFLAGS := -DGEN_VERSIONx10=80
136
137LOCAL_C_INCLUDES := $(LIBISL_GENX_COMMON_INCLUDES)
138
139LOCAL_WHOLE_STATIC_LIBRARIES := libmesa_genxml
140
141include $(MESA_COMMON_MK)
142include $(BUILD_STATIC_LIBRARY)
143
144# ---------------------------------------
145# Build libmesa_isl_gen9
146# ---------------------------------------
147
148include $(CLEAR_VARS)
149
150LOCAL_MODULE := libmesa_isl_gen9
151
152LOCAL_SRC_FILES := $(ISL_GEN9_FILES)
153
154LOCAL_CFLAGS := -DGEN_VERSIONx10=90
155
156LOCAL_C_INCLUDES := $(LIBISL_GENX_COMMON_INCLUDES)
157
158LOCAL_WHOLE_STATIC_LIBRARIES := libmesa_genxml
159
160include $(MESA_COMMON_MK)
161include $(BUILD_STATIC_LIBRARY)
162
163# ---------------------------------------
164# Build libmesa_isl_gen10
165# ---------------------------------------
166
167include $(CLEAR_VARS)
168
169LOCAL_MODULE := libmesa_isl_gen10
170
171LOCAL_SRC_FILES := $(ISL_GEN10_FILES)
172
173LOCAL_CFLAGS := -DGEN_VERSIONx10=100
174
175LOCAL_C_INCLUDES := $(LIBISL_GENX_COMMON_INCLUDES)
176
177LOCAL_WHOLE_STATIC_LIBRARIES := libmesa_genxml
178
179include $(MESA_COMMON_MK)
180include $(BUILD_STATIC_LIBRARY)
181
182# ---------------------------------------
183# Build libmesa_isl_gen11
184# ---------------------------------------
185
186include $(CLEAR_VARS)
187
188LOCAL_MODULE := libmesa_isl_gen11
189
190LOCAL_SRC_FILES := $(ISL_GEN11_FILES)
191
192LOCAL_CFLAGS := -DGEN_VERSIONx10=110
193
194LOCAL_C_INCLUDES := $(LIBISL_GENX_COMMON_INCLUDES)
195
196LOCAL_WHOLE_STATIC_LIBRARIES := libmesa_genxml
197
198include $(MESA_COMMON_MK)
199include $(BUILD_STATIC_LIBRARY)
200
201# ---------------------------------------
202# Build libmesa_isl_tiled_memcpy
203# ---------------------------------------
204
205include $(CLEAR_VARS)
206
207LOCAL_MODULE := libmesa_isl_tiled_memcpy
208
209LOCAL_C_INCLUDES := \
210	$(MESA_TOP)/src/gallium/include \
211	$(MESA_TOP)/src/mapi \
212	$(MESA_TOP)/src/mesa
213
214LOCAL_SRC_FILES := $(ISL_TILED_MEMCPY_FILES)
215
216include $(MESA_COMMON_MK)
217include $(BUILD_STATIC_LIBRARY)
218
219# ---------------------------------------
220# Build libmesa_isl_tiled_memcpy_sse41
221# ---------------------------------------
222
223ifeq ($(ARCH_X86_HAVE_SSE4_1),true)
224include $(CLEAR_VARS)
225
226LOCAL_MODULE := libmesa_isl_tiled_memcpy_sse41
227
228LOCAL_C_INCLUDES := \
229	$(MESA_TOP)/src/gallium/include \
230	$(MESA_TOP)/src/mapi \
231	$(MESA_TOP)/src/mesa
232
233LOCAL_SRC_FILES := $(ISL_TILED_MEMCPY_SSE41_FILES)
234
235LOCAL_CFLAGS += \
236        -DUSE_SSE41 -msse4.1 -mstackrealign
237
238include $(MESA_COMMON_MK)
239include $(BUILD_STATIC_LIBRARY)
240endif
241
242# ---------------------------------------
243# Build libmesa_isl
244# ---------------------------------------
245
246include $(CLEAR_VARS)
247
248LOCAL_MODULE := libmesa_isl
249
250LOCAL_SRC_FILES := $(ISL_FILES)
251
252LOCAL_C_INCLUDES := \
253	$(MESA_TOP)/src/gallium/include \
254	$(MESA_TOP)/src/gallium/auxiliary \
255	$(MESA_TOP)/src/mapi \
256	$(MESA_TOP)/src/mesa \
257	$(MESA_TOP)/src/intel
258
259LOCAL_EXPORT_C_INCLUDE_DIRS := $(MESA_TOP)/src/intel
260
261LOCAL_WHOLE_STATIC_LIBRARIES := \
262	libmesa_isl_gen4 \
263	libmesa_isl_gen5 \
264	libmesa_isl_gen6 \
265	libmesa_isl_gen7 \
266	libmesa_isl_gen75 \
267	libmesa_isl_gen8 \
268	libmesa_isl_gen9 \
269	libmesa_isl_gen10 \
270	libmesa_isl_gen11 \
271	libmesa_genxml \
272	libmesa_isl_tiled_memcpy
273
274ifeq ($(ARCH_X86_HAVE_SSE4_1),true)
275LOCAL_CFLAGS += \
276        -DUSE_SSE41
277LOCAL_WHOLE_STATIC_LIBRARIES += \
278        libmesa_isl_tiled_memcpy_sse41
279endif
280
281# Autogenerated sources
282
283LOCAL_MODULE_CLASS := STATIC_LIBRARIES
284
285intermediates := $(call local-generated-sources-dir)
286
287LOCAL_GENERATED_SOURCES += $(addprefix $(intermediates)/, $(ISL_GENERATED_FILES))
288
289define bash-gen
290	@mkdir -p $(dir $@)
291	@echo "Gen Bash: $(PRIVATE_MODULE) <= $(notdir $(@))"
292	$(hide) $(PRIVATE_SCRIPT) --csv $(PRIVATE_CSV) --out $@
293endef
294
295isl_format_layout_deps := \
296	$(LOCAL_PATH)/isl/gen_format_layout.py \
297	$(LOCAL_PATH)/isl/isl_format_layout.csv
298
299$(intermediates)/isl/isl_format_layout.c: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(LOCAL_PATH)/isl/gen_format_layout.py
300$(intermediates)/isl/isl_format_layout.c: PRIVATE_CSV := $(LOCAL_PATH)/isl/isl_format_layout.csv
301$(intermediates)/isl/isl_format_layout.c: $(isl_format_layout_deps)
302	$(call bash-gen)
303
304include $(MESA_COMMON_MK)
305include $(BUILD_STATIC_LIBRARY)
306