android: anv: libmesa_vulkan_common: add libmesa_util static dependency
[mesa.git] / src / intel / Android.vulkan.mk
1 # Copyright © 2017 Intel Corporation
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 shall be included
11 # in all copies or substantial portions of the Software.
12 #
13 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
16 # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 # DEALINGS IN THE SOFTWARE.
20
21 LOCAL_PATH := $(call my-dir)
22
23 include $(CLEAR_VARS)
24 include $(LOCAL_PATH)/Makefile.sources
25
26 ANV_ENTRYPOINTS_GEN_SCRIPT := $(LOCAL_PATH)/vulkan/anv_entrypoints_gen.py
27 ANV_EXTENSIONS_GEN_SCRIPT := $(LOCAL_PATH)/vulkan/anv_extensions_gen.py
28 ANV_EXTENSIONS_SCRIPT := $(LOCAL_PATH)/vulkan/anv_extensions.py
29 VULKAN_API_XML := $(MESA_TOP)/src/vulkan/registry/vk.xml
30
31 VULKAN_COMMON_INCLUDES := \
32 $(MESA_TOP)/include \
33 $(MESA_TOP)/src/mapi \
34 $(MESA_TOP)/src/gallium/auxiliary \
35 $(MESA_TOP)/src/gallium/include \
36 $(MESA_TOP)/src/mesa \
37 $(MESA_TOP)/src/vulkan/wsi \
38 $(MESA_TOP)/src/vulkan/util \
39 $(MESA_TOP)/src/intel \
40 $(MESA_TOP)/src/intel/vulkan \
41 frameworks/native/vulkan/include
42
43 ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 27; echo $$?), 0)
44 VULKAN_COMMON_INCLUDES += \
45 frameworks/native/vulkan/include \
46 frameworks/native/libs/nativebase/include \
47 frameworks/native/libs/nativewindow/include \
48 frameworks/native/libs/arect/include
49
50 VULKAN_COMMON_HEADER_LIBRARIES := \
51 libcutils_headers \
52 libhardware_headers
53 endif
54
55 ANV_STATIC_LIBRARIES := \
56 libmesa_vulkan_common \
57 libmesa_genxml \
58 libmesa_nir
59
60 ANV_SHARED_LIBRARIES := libdrm
61
62 ifeq ($(filter $(MESA_ANDROID_MAJOR_VERSION), 4 5 6 7),)
63 ANV_SHARED_LIBRARIES += libnativewindow
64 endif
65
66 #
67 # libanv for gen7
68 #
69
70 include $(CLEAR_VARS)
71 LOCAL_MODULE := libmesa_anv_gen7
72 LOCAL_MODULE_CLASS := STATIC_LIBRARIES
73
74 LOCAL_SRC_FILES := $(VULKAN_GEN7_FILES)
75 LOCAL_CFLAGS := -DGEN_VERSIONx10=70
76
77 LOCAL_C_INCLUDES := $(VULKAN_COMMON_INCLUDES)
78
79 LOCAL_STATIC_LIBRARIES := $(ANV_STATIC_LIBRARIES)
80
81 LOCAL_SHARED_LIBRARIES := $(ANV_SHARED_LIBRARIES)
82 LOCAL_HEADER_LIBRARIES += $(VULKAN_COMMON_HEADER_LIBRARIES)
83
84 include $(MESA_COMMON_MK)
85 include $(BUILD_STATIC_LIBRARY)
86
87 #
88 # libanv for gen75
89 #
90
91 include $(CLEAR_VARS)
92 LOCAL_MODULE := libmesa_anv_gen75
93 LOCAL_MODULE_CLASS := STATIC_LIBRARIES
94
95 LOCAL_SRC_FILES := $(VULKAN_GEN75_FILES)
96 LOCAL_CFLAGS := -DGEN_VERSIONx10=75
97
98 LOCAL_C_INCLUDES := $(VULKAN_COMMON_INCLUDES)
99
100 LOCAL_STATIC_LIBRARIES := $(ANV_STATIC_LIBRARIES)
101
102 LOCAL_SHARED_LIBRARIES := $(ANV_SHARED_LIBRARIES)
103 LOCAL_HEADER_LIBRARIES += $(VULKAN_COMMON_HEADER_LIBRARIES)
104
105 include $(MESA_COMMON_MK)
106 include $(BUILD_STATIC_LIBRARY)
107
108 #
109 # libanv for gen8
110 #
111
112 include $(CLEAR_VARS)
113 LOCAL_MODULE := libmesa_anv_gen8
114 LOCAL_MODULE_CLASS := STATIC_LIBRARIES
115
116 LOCAL_SRC_FILES := $(VULKAN_GEN8_FILES)
117 LOCAL_CFLAGS := -DGEN_VERSIONx10=80
118
119 LOCAL_C_INCLUDES := $(VULKAN_COMMON_INCLUDES)
120
121 LOCAL_STATIC_LIBRARIES := $(ANV_STATIC_LIBRARIES)
122
123 LOCAL_SHARED_LIBRARIES := $(ANV_SHARED_LIBRARIES)
124 LOCAL_HEADER_LIBRARIES += $(VULKAN_COMMON_HEADER_LIBRARIES)
125
126 include $(MESA_COMMON_MK)
127 include $(BUILD_STATIC_LIBRARY)
128
129 #
130 # libanv for gen9
131 #
132
133 include $(CLEAR_VARS)
134 LOCAL_MODULE := libmesa_anv_gen9
135 LOCAL_MODULE_CLASS := STATIC_LIBRARIES
136
137 LOCAL_SRC_FILES := $(VULKAN_GEN9_FILES)
138 LOCAL_CFLAGS := -DGEN_VERSIONx10=90
139
140 LOCAL_C_INCLUDES := $(VULKAN_COMMON_INCLUDES)
141
142 LOCAL_STATIC_LIBRARIES := $(ANV_STATIC_LIBRARIES)
143
144 LOCAL_SHARED_LIBRARIES := $(ANV_SHARED_LIBRARIES)
145 LOCAL_HEADER_LIBRARIES += $(VULKAN_COMMON_HEADER_LIBRARIES)
146
147 include $(MESA_COMMON_MK)
148 include $(BUILD_STATIC_LIBRARY)
149
150 #
151 # libanv for gen10
152 #
153
154 include $(CLEAR_VARS)
155 LOCAL_MODULE := libmesa_anv_gen10
156 LOCAL_MODULE_CLASS := STATIC_LIBRARIES
157
158 LOCAL_SRC_FILES := $(VULKAN_GEN10_FILES)
159 LOCAL_CFLAGS := -DGEN_VERSIONx10=100
160
161 LOCAL_C_INCLUDES := $(VULKAN_COMMON_INCLUDES)
162
163 LOCAL_STATIC_LIBRARIES := $(ANV_STATIC_LIBRARIES)
164
165 LOCAL_SHARED_LIBRARIES := $(ANV_SHARED_LIBRARIES)
166 LOCAL_HEADER_LIBRARIES += $(VULKAN_COMMON_HEADER_LIBRARIES)
167
168 include $(MESA_COMMON_MK)
169 include $(BUILD_STATIC_LIBRARY)
170
171 #
172 # libanv for gen11
173 #
174
175 include $(CLEAR_VARS)
176 LOCAL_MODULE := libmesa_anv_gen11
177 LOCAL_MODULE_CLASS := STATIC_LIBRARIES
178
179 LOCAL_SRC_FILES := $(VULKAN_GEN11_FILES)
180 LOCAL_CFLAGS := -DGEN_VERSIONx10=110
181
182 LOCAL_C_INCLUDES := $(VULKAN_COMMON_INCLUDES)
183
184 LOCAL_STATIC_LIBRARIES := $(ANV_STATIC_LIBRARIES)
185
186 LOCAL_SHARED_LIBRARIES := $(ANV_SHARED_LIBRARIES)
187 LOCAL_HEADER_LIBRARIES += $(VULKAN_COMMON_HEADER_LIBRARIES)
188
189 include $(MESA_COMMON_MK)
190 include $(BUILD_STATIC_LIBRARY)
191
192 #
193 # libanv for gen12
194 #
195
196 include $(CLEAR_VARS)
197 LOCAL_MODULE := libmesa_anv_gen12
198 LOCAL_MODULE_CLASS := STATIC_LIBRARIES
199
200 LOCAL_SRC_FILES := $(VULKAN_GEN12_FILES)
201 LOCAL_CFLAGS := -DGEN_VERSIONx10=120
202
203 LOCAL_C_INCLUDES := $(VULKAN_COMMON_INCLUDES)
204
205 LOCAL_STATIC_LIBRARIES := $(ANV_STATIC_LIBRARIES)
206
207 LOCAL_SHARED_LIBRARIES := $(ANV_SHARED_LIBRARIES)
208 LOCAL_HEADER_LIBRARIES += $(VULKAN_COMMON_HEADER_LIBRARIES)
209
210 include $(MESA_COMMON_MK)
211 include $(BUILD_STATIC_LIBRARY)
212
213
214 #
215 # libmesa_vulkan_common
216 #
217
218 include $(CLEAR_VARS)
219 LOCAL_MODULE := libmesa_vulkan_common
220 LOCAL_MODULE_CLASS := STATIC_LIBRARIES
221
222 intermediates := $(call local-generated-sources-dir)
223
224 LOCAL_SRC_FILES := $(VULKAN_FILES)
225
226 LOCAL_EXPORT_C_INCLUDE_DIRS := $(intermediates)/vulkan
227
228 LOCAL_C_INCLUDES := \
229 $(LOCAL_EXPORT_C_INCLUDE_DIRS) \
230 $(VULKAN_COMMON_INCLUDES)
231
232 LOCAL_STATIC_LIBRARIES := \
233 libmesa_nir \
234 libmesa_genxml \
235 libmesa_git_sha1 \
236 libmesa_vulkan_util \
237 libmesa_util
238
239 # The rule generates both C and H files, but due to some strange
240 # reason generating the files once leads to link-time issues.
241 # Work around create them here as well - we're safe from race
242 # conditions since they are stored in another location.
243
244 LOCAL_GENERATED_SOURCES := $(addprefix $(intermediates)/,$(VULKAN_GENERATED_FILES))
245
246 $(intermediates)/vulkan/anv_entrypoints.c: $(ANV_ENTRYPOINTS_GEN_SCRIPT) \
247 $(ANV_EXTENSIONS_SCRIPT) \
248 $(VULKAN_API_XML)
249 @mkdir -p $(dir $@)
250 $(MESA_PYTHON2) $(ANV_ENTRYPOINTS_GEN_SCRIPT) \
251 --xml $(VULKAN_API_XML) \
252 --outdir $(dir $@)
253
254 $(intermediates)/vulkan/anv_entrypoints.h: $(intermediates)/vulkan/anv_entrypoints.c
255
256 $(intermediates)/vulkan/anv_extensions.c: $(ANV_EXTENSIONS_GEN_SCRIPT) \
257 $(ANV_EXTENSIONS_SCRIPT) \
258 $(VULKAN_API_XML)
259 @mkdir -p $(dir $@)
260 $(MESA_PYTHON2) $(ANV_EXTENSIONS_GEN_SCRIPT) \
261 --xml $(VULKAN_API_XML) \
262 --out-c $@
263
264 $(intermediates)/vulkan/anv_extensions.h: $(ANV_EXTENSIONS_GEN_SCRIPT) \
265 $(ANV_EXTENSIONS_SCRIPT) \
266 $(VULKAN_API_XML)
267 @mkdir -p $(dir $@)
268 $(MESA_PYTHON2) $(ANV_EXTENSIONS_GEN_SCRIPT) \
269 --xml $(VULKAN_API_XML) \
270 --out-h $@
271
272 LOCAL_SHARED_LIBRARIES := $(ANV_SHARED_LIBRARIES)
273 LOCAL_HEADER_LIBRARIES += $(VULKAN_COMMON_HEADER_LIBRARIES)
274
275 include $(MESA_COMMON_MK)
276 include $(BUILD_STATIC_LIBRARY)
277
278
279 #
280 # libvulkan_intel
281 #
282
283 include $(CLEAR_VARS)
284
285 LOCAL_MODULE := vulkan.$(TARGET_BOARD_PLATFORM)
286 LOCAL_MODULE_CLASS := SHARED_LIBRARIES
287 LOCAL_PROPRIETARY_MODULE := true
288 LOCAL_MODULE_RELATIVE_PATH := hw
289
290 LOCAL_LDFLAGS += -Wl,--build-id=sha1
291
292 LOCAL_SRC_FILES := \
293 $(VULKAN_GEM_FILES) \
294 $(VULKAN_ANDROID_FILES)
295
296 LOCAL_C_INCLUDES := \
297 $(VULKAN_COMMON_INCLUDES) \
298
299 LOCAL_WHOLE_STATIC_LIBRARIES := \
300 libmesa_nir \
301 libmesa_isl \
302 libmesa_glsl \
303 libmesa_util \
304 libmesa_blorp \
305 libmesa_compiler \
306 libmesa_intel_common \
307 libmesa_intel_dev \
308 libmesa_vulkan_common \
309 libmesa_vulkan_util \
310 libmesa_anv_gen7 \
311 libmesa_anv_gen75 \
312 libmesa_anv_gen8 \
313 libmesa_anv_gen9 \
314 libmesa_anv_gen10 \
315 libmesa_anv_gen11 \
316 libmesa_anv_gen12 \
317 libmesa_intel_compiler
318
319 LOCAL_SHARED_LIBRARIES := $(ANV_SHARED_LIBRARIES) libz libsync liblog
320 LOCAL_HEADER_LIBRARIES += $(VULKAN_COMMON_HEADER_LIBRARIES)
321
322 # If Android version >=8 MESA should static link libexpat else should dynamic link
323 ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 27; echo $$?), 0)
324 LOCAL_STATIC_LIBRARIES := \
325 libexpat
326 else
327 LOCAL_SHARED_LIBRARIES += \
328 libexpat
329 endif
330
331 ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 27; echo $$?), 0)
332 LOCAL_STATIC_LIBRARIES += libgrallocusage
333 endif
334
335 include $(MESA_COMMON_MK)
336 include $(BUILD_SHARED_LIBRARY)