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 21LOCAL_PATH := $(call my-dir) 22 23include $(CLEAR_VARS) 24include $(LOCAL_PATH)/Makefile.sources 25 26ANV_ENTRYPOINTS_GEN_SCRIPT := $(LOCAL_PATH)/vulkan/anv_entrypoints_gen.py 27ANV_EXTENSIONS_GEN_SCRIPT := $(LOCAL_PATH)/vulkan/anv_extensions_gen.py 28ANV_EXTENSIONS_SCRIPT := $(LOCAL_PATH)/vulkan/anv_extensions.py 29VULKAN_API_XML := $(MESA_TOP)/src/vulkan/registry/vk.xml 30 31VULKAN_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 43ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 27; echo $$?), 0) 44VULKAN_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 50VULKAN_COMMON_HEADER_LIBRARIES := \ 51 libcutils_headers \ 52 libhardware_headers 53endif 54 55ANV_STATIC_LIBRARIES := \ 56 libmesa_vulkan_common \ 57 libmesa_genxml \ 58 libmesa_nir 59 60ANV_SHARED_LIBRARIES := libdrm 61 62ifeq ($(filter $(MESA_ANDROID_MAJOR_VERSION), 4 5 6 7),) 63ANV_SHARED_LIBRARIES += libnativewindow 64endif 65 66# 67# libanv for gen7 68# 69 70include $(CLEAR_VARS) 71LOCAL_MODULE := libmesa_anv_gen7 72LOCAL_LICENSE_KINDS := SPDX-license-identifier-ISC SPDX-license-identifier-MIT 73LOCAL_LICENSE_CONDITIONS := notice 74LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../../LICENSE 75LOCAL_MODULE_CLASS := STATIC_LIBRARIES 76 77LOCAL_SRC_FILES := $(VULKAN_GEN7_FILES) 78LOCAL_CFLAGS := -DGEN_VERSIONx10=70 79 80LOCAL_C_INCLUDES := $(VULKAN_COMMON_INCLUDES) 81 82LOCAL_STATIC_LIBRARIES := $(ANV_STATIC_LIBRARIES) 83 84LOCAL_SHARED_LIBRARIES := $(ANV_SHARED_LIBRARIES) 85LOCAL_HEADER_LIBRARIES += $(VULKAN_COMMON_HEADER_LIBRARIES) 86 87include $(MESA_COMMON_MK) 88include $(BUILD_STATIC_LIBRARY) 89 90# 91# libanv for gen75 92# 93 94include $(CLEAR_VARS) 95LOCAL_MODULE := libmesa_anv_gen75 96LOCAL_LICENSE_KINDS := SPDX-license-identifier-ISC SPDX-license-identifier-MIT 97LOCAL_LICENSE_CONDITIONS := notice 98LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../../LICENSE 99LOCAL_MODULE_CLASS := STATIC_LIBRARIES 100 101LOCAL_SRC_FILES := $(VULKAN_GEN75_FILES) 102LOCAL_CFLAGS := -DGEN_VERSIONx10=75 103 104LOCAL_C_INCLUDES := $(VULKAN_COMMON_INCLUDES) 105 106LOCAL_STATIC_LIBRARIES := $(ANV_STATIC_LIBRARIES) 107 108LOCAL_SHARED_LIBRARIES := $(ANV_SHARED_LIBRARIES) 109LOCAL_HEADER_LIBRARIES += $(VULKAN_COMMON_HEADER_LIBRARIES) 110 111include $(MESA_COMMON_MK) 112include $(BUILD_STATIC_LIBRARY) 113 114# 115# libanv for gen8 116# 117 118include $(CLEAR_VARS) 119LOCAL_MODULE := libmesa_anv_gen8 120LOCAL_LICENSE_KINDS := SPDX-license-identifier-ISC SPDX-license-identifier-MIT 121LOCAL_LICENSE_CONDITIONS := notice 122LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../../LICENSE 123LOCAL_MODULE_CLASS := STATIC_LIBRARIES 124 125LOCAL_SRC_FILES := $(VULKAN_GEN8_FILES) 126LOCAL_CFLAGS := -DGEN_VERSIONx10=80 127 128LOCAL_C_INCLUDES := $(VULKAN_COMMON_INCLUDES) 129 130LOCAL_STATIC_LIBRARIES := $(ANV_STATIC_LIBRARIES) 131 132LOCAL_SHARED_LIBRARIES := $(ANV_SHARED_LIBRARIES) 133LOCAL_HEADER_LIBRARIES += $(VULKAN_COMMON_HEADER_LIBRARIES) 134 135include $(MESA_COMMON_MK) 136include $(BUILD_STATIC_LIBRARY) 137 138# 139# libanv for gen9 140# 141 142include $(CLEAR_VARS) 143LOCAL_MODULE := libmesa_anv_gen9 144LOCAL_LICENSE_KINDS := SPDX-license-identifier-ISC SPDX-license-identifier-MIT 145LOCAL_LICENSE_CONDITIONS := notice 146LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../../LICENSE 147LOCAL_MODULE_CLASS := STATIC_LIBRARIES 148 149LOCAL_SRC_FILES := $(VULKAN_GEN9_FILES) 150LOCAL_CFLAGS := -DGEN_VERSIONx10=90 151 152LOCAL_C_INCLUDES := $(VULKAN_COMMON_INCLUDES) 153 154LOCAL_STATIC_LIBRARIES := $(ANV_STATIC_LIBRARIES) 155 156LOCAL_SHARED_LIBRARIES := $(ANV_SHARED_LIBRARIES) 157LOCAL_HEADER_LIBRARIES += $(VULKAN_COMMON_HEADER_LIBRARIES) 158 159include $(MESA_COMMON_MK) 160include $(BUILD_STATIC_LIBRARY) 161 162# 163# libanv for gen11 164# 165 166include $(CLEAR_VARS) 167LOCAL_MODULE := libmesa_anv_gen11 168LOCAL_LICENSE_KINDS := SPDX-license-identifier-ISC SPDX-license-identifier-MIT 169LOCAL_LICENSE_CONDITIONS := notice 170LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../../LICENSE 171LOCAL_MODULE_CLASS := STATIC_LIBRARIES 172 173LOCAL_SRC_FILES := $(VULKAN_GEN11_FILES) 174LOCAL_CFLAGS := -DGEN_VERSIONx10=110 175 176LOCAL_C_INCLUDES := $(VULKAN_COMMON_INCLUDES) 177 178LOCAL_STATIC_LIBRARIES := $(ANV_STATIC_LIBRARIES) 179 180LOCAL_SHARED_LIBRARIES := $(ANV_SHARED_LIBRARIES) 181LOCAL_HEADER_LIBRARIES += $(VULKAN_COMMON_HEADER_LIBRARIES) 182 183include $(MESA_COMMON_MK) 184include $(BUILD_STATIC_LIBRARY) 185 186# 187# libanv for gen12 188# 189 190include $(CLEAR_VARS) 191LOCAL_MODULE := libmesa_anv_gen12 192LOCAL_LICENSE_KINDS := SPDX-license-identifier-ISC SPDX-license-identifier-MIT 193LOCAL_LICENSE_CONDITIONS := notice 194LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../../LICENSE 195LOCAL_MODULE_CLASS := STATIC_LIBRARIES 196 197LOCAL_SRC_FILES := $(VULKAN_GEN12_FILES) 198LOCAL_CFLAGS := -DGEN_VERSIONx10=120 199 200LOCAL_C_INCLUDES := $(VULKAN_COMMON_INCLUDES) 201 202LOCAL_STATIC_LIBRARIES := $(ANV_STATIC_LIBRARIES) 203 204LOCAL_SHARED_LIBRARIES := $(ANV_SHARED_LIBRARIES) 205LOCAL_HEADER_LIBRARIES += $(VULKAN_COMMON_HEADER_LIBRARIES) 206 207include $(MESA_COMMON_MK) 208include $(BUILD_STATIC_LIBRARY) 209 210 211# 212# libmesa_vulkan_common 213# 214 215include $(CLEAR_VARS) 216LOCAL_MODULE := libmesa_vulkan_common 217LOCAL_LICENSE_KINDS := SPDX-license-identifier-ISC SPDX-license-identifier-MIT 218LOCAL_LICENSE_CONDITIONS := notice 219LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../../LICENSE 220LOCAL_MODULE_CLASS := STATIC_LIBRARIES 221 222intermediates := $(call local-generated-sources-dir) 223prebuilt_intermediates := $(MESA_TOP)/prebuilt-intermediates 224 225LOCAL_SRC_FILES := $(VULKAN_FILES) 226 227LOCAL_EXPORT_C_INCLUDE_DIRS := $(intermediates)/vulkan 228 229LOCAL_C_INCLUDES := \ 230 $(LOCAL_EXPORT_C_INCLUDE_DIRS) \ 231 $(VULKAN_COMMON_INCLUDES) 232 233LOCAL_STATIC_LIBRARIES := \ 234 libmesa_nir \ 235 libmesa_genxml \ 236 libmesa_git_sha1 \ 237 libmesa_vulkan_util \ 238 libmesa_util 239 240# The rule generates both C and H files, but due to some strange 241# reason generating the files once leads to link-time issues. 242# Work around create them here as well - we're safe from race 243# conditions since they are stored in another location. 244 245LOCAL_GENERATED_SOURCES := $(addprefix $(intermediates)/,$(VULKAN_GENERATED_FILES)) 246 247$(intermediates)/vulkan/anv_entrypoints.c: $(prebuilt_intermediates)/vulkan/anv_entrypoints.c 248 @mkdir -p $(dir $@) 249 @cp -f $< $@ 250 251$(intermediates)/vulkan/anv_entrypoints.h: $(prebuilt_intermediates)/vulkan/anv_entrypoints.h 252 @mkdir -p $(dir $@) 253 @cp -f $< $@ 254 255$(intermediates)/vulkan/anv_extensions.c: $(prebuilt_intermediates)/vulkan/anv_extensions.c 256 @mkdir -p $(dir $@) 257 @cp -f $< $@ 258 259$(intermediates)/vulkan/anv_extensions.h: $(prebuilt_intermediates)/vulkan/anv_extensions.h 260 @mkdir -p $(dir $@) 261 @cp -f $< $@ 262 263LOCAL_SHARED_LIBRARIES := $(ANV_SHARED_LIBRARIES) 264LOCAL_HEADER_LIBRARIES += $(VULKAN_COMMON_HEADER_LIBRARIES) 265 266include $(MESA_COMMON_MK) 267include $(BUILD_STATIC_LIBRARY) 268 269 270# 271# libvulkan_intel 272# 273 274include $(CLEAR_VARS) 275 276LOCAL_MODULE := vulkan.$(TARGET_BOARD_PLATFORM) 277LOCAL_LICENSE_KINDS := SPDX-license-identifier-ISC SPDX-license-identifier-MIT 278LOCAL_LICENSE_CONDITIONS := notice 279LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../../LICENSE 280LOCAL_MODULE_CLASS := SHARED_LIBRARIES 281LOCAL_PROPRIETARY_MODULE := true 282LOCAL_MODULE_RELATIVE_PATH := hw 283 284LOCAL_LDFLAGS += -Wl,--build-id=sha1 285 286LOCAL_SRC_FILES := \ 287 $(VULKAN_GEM_FILES) \ 288 $(VULKAN_ANDROID_FILES) 289 290LOCAL_C_INCLUDES := \ 291 $(VULKAN_COMMON_INCLUDES) \ 292 293LOCAL_WHOLE_STATIC_LIBRARIES := \ 294 libmesa_nir \ 295 libmesa_isl \ 296 libmesa_glsl \ 297 libmesa_util \ 298 libmesa_blorp \ 299 libmesa_compiler \ 300 libmesa_intel_common \ 301 libmesa_intel_dev \ 302 libmesa_intel_perf \ 303 libmesa_vulkan_common \ 304 libmesa_vulkan_util \ 305 libmesa_anv_gen7 \ 306 libmesa_anv_gen75 \ 307 libmesa_anv_gen8 \ 308 libmesa_anv_gen9 \ 309 libmesa_anv_gen11 \ 310 libmesa_anv_gen12 \ 311 libmesa_intel_compiler 312 313LOCAL_SHARED_LIBRARIES := $(ANV_SHARED_LIBRARIES) libz libsync liblog 314LOCAL_HEADER_LIBRARIES += $(VULKAN_COMMON_HEADER_LIBRARIES) 315 316# If Android version >=8 MESA should static link libexpat else should dynamic link 317ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 27; echo $$?), 0) 318LOCAL_STATIC_LIBRARIES := \ 319 libexpat 320else 321 LOCAL_SHARED_LIBRARIES += \ 322 libexpat 323endif 324 325include $(MESA_COMMON_MK) 326include $(BUILD_SHARED_LIBRARY) 327