1# Mesa 3-D graphics library 2# 3# Copyright (C) 2014 Tomasz Figa <tomasz.figa@gmail.com> 4# 5# Permission is hereby granted, free of charge, to any person obtaining a 6# copy of this software and associated documentation files (the "Software"), 7# to deal in the Software without restriction, including without limitation 8# the rights to use, copy, modify, merge, publish, distribute, sublicense, 9# and/or sell copies of the Software, and to permit persons to whom the 10# Software is furnished to do so, subject to the following conditions: 11# 12# The above copyright notice and this permission notice shall be included 13# in all copies or substantial portions of the Software. 14# 15# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21# DEALINGS IN THE SOFTWARE. 22 23LOCAL_PATH := $(call my-dir) 24 25include $(LOCAL_PATH)/Makefile.sources 26 27# --------------------------------------- 28# Build libmesa_util 29# --------------------------------------- 30 31include $(CLEAR_VARS) 32 33LOCAL_SRC_FILES := \ 34 $(MESA_UTIL_FILES) \ 35 $(XMLCONFIG_FILES) 36 37LOCAL_MODULE := libmesa_util 38LOCAL_LICENSE_KINDS := SPDX-license-identifier-BSD SPDX-license-identifier-MIT legacy_by_exception_only legacy_notice legacy_unencumbered 39LOCAL_LICENSE_CONDITIONS := by_exception_only notice unencumbered 40LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../../LICENSE 41 42LOCAL_MODULE_CLASS := STATIC_LIBRARIES 43 44prebuilt_intermediates := $(MESA_TOP)/prebuilt-intermediates 45intermediates := $(call local-generated-sources-dir) 46 47LOCAL_C_INCLUDES := \ 48 external/zlib \ 49 $(MESA_TOP)/src/mesa \ 50 $(MESA_TOP)/src/mapi \ 51 $(MESA_TOP)/src/gallium/include \ 52 $(MESA_TOP)/src/gallium/auxiliary \ 53 $(MESA_TOP)/src/util/format \ 54 $(intermediates)/format 55 56# If Android version >=8 MESA should static link libexpat else should dynamic link 57ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 27; echo $$?), 0) 58LOCAL_STATIC_LIBRARIES := \ 59 libexpat 60else 61LOCAL_SHARED_LIBRARIES := \ 62 libexpat 63endif 64 65LOCAL_SHARED_LIBRARIES += liblog libsync 66 67# Generated sources 68 69LOCAL_EXPORT_C_INCLUDE_DIRS := $(intermediates) 70 71UTIL_GENERATED_SOURCES := $(addprefix $(intermediates)/,$(MESA_UTIL_GENERATED_FILES)) 72LOCAL_GENERATED_SOURCES := $(UTIL_GENERATED_SOURCES) 73 74format_srgb_gen := $(LOCAL_PATH)/format_srgb.py 75 76$(intermediates)/format_srgb.c: $(format_srgb_gen) 77 @mkdir -p $(dir $@) 78 $(hide) $(MESA_PYTHON2) $(format_srgb_gen) $< > $@ 79 80u_format_gen := $(LOCAL_PATH)/format/u_format_table.py 81u_format_deps := $(LOCAL_PATH)/format/u_format.csv \ 82 $(LOCAL_PATH)/format/u_format_pack.py \ 83 $(LOCAL_PATH)/format/u_format_parse.py 84 85$(intermediates)/format/u_format_pack.h: $(u_format_deps) 86 @mkdir -p $(dir $@) 87 $(hide) $(MESA_PYTHON2) $(u_format_gen) --header $< > $@ 88 89$(intermediates)/format/u_format_table.c: $(u_format_deps) 90 @mkdir -p $(dir $@) 91 $(hide) $(MESA_PYTHON2) $(u_format_gen) $< > $@ 92 93include $(MESA_COMMON_MK) 94include $(BUILD_STATIC_LIBRARY) 95