blob: 8f4eae083b8c5494a563d7022394135ddbbbc87f [file] [log] [blame]
Tomasz Figad703abf2014-09-27 16:19:59 +02001# 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 := \
Nicolai Hähnle601093f2017-06-30 11:57:06 +020034 $(MESA_UTIL_FILES) \
35 $(XMLCONFIG_FILES)
Tomasz Figad703abf2014-09-27 16:19:59 +020036
Mauro Rossibe281832020-09-05 18:49:19 +020037LOCAL_MODULE := libmesa_util
Amit Pundir06247ea2021-02-25 13:41:17 +053038LOCAL_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
Mauro Rossibe281832020-09-05 18:49:19 +020041
42LOCAL_MODULE_CLASS := STATIC_LIBRARIES
43
Amit Pundir06247ea2021-02-25 13:41:17 +053044prebuilt_intermediates := $(MESA_TOP)/prebuilt-intermediates
Mauro Rossibe281832020-09-05 18:49:19 +020045intermediates := $(call local-generated-sources-dir)
46
Tomasz Figad703abf2014-09-27 16:19:59 +020047LOCAL_C_INCLUDES := \
Chih-Wei Huangbfc0c232017-05-17 13:10:02 +080048 external/zlib \
Tomasz Figad703abf2014-09-27 16:19:59 +020049 $(MESA_TOP)/src/mesa \
Emil Velikov94cab352015-03-28 01:10:52 +000050 $(MESA_TOP)/src/mapi \
51 $(MESA_TOP)/src/gallium/include \
Mauro Rossi09ab2972019-11-15 23:54:52 +010052 $(MESA_TOP)/src/gallium/auxiliary \
Mauro Rossibe281832020-09-05 18:49:19 +020053 $(MESA_TOP)/src/util/format \
54 $(intermediates)/format
Tomasz Figad703abf2014-09-27 16:19:59 +020055
Kishore Kadiyalae1d80572019-03-11 11:23:03 +020056# 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
Rob Herringd0540d52017-07-31 10:42:10 -050061LOCAL_SHARED_LIBRARIES := \
62 libexpat
Sumit Semwal444cc9e2019-02-18 20:46:30 +053063endif
Rob Herringd0540d52017-07-31 10:42:10 -050064
Mauro Rossicc161132020-10-30 01:24:08 +010065LOCAL_SHARED_LIBRARIES += liblog libsync
Tomasz Figad703abf2014-09-27 16:19:59 +020066
67# Generated sources
68
Tapani Pällif444ac52017-08-01 14:23:00 +030069LOCAL_EXPORT_C_INCLUDE_DIRS := $(intermediates)
70
Nicolai Hähnle601093f2017-06-30 11:57:06 +020071UTIL_GENERATED_SOURCES := $(addprefix $(intermediates)/,$(MESA_UTIL_GENERATED_FILES))
72LOCAL_GENERATED_SOURCES := $(UTIL_GENERATED_SOURCES)
73
Mauro Rossiaa866112020-08-14 14:04:54 +020074format_srgb_gen := $(LOCAL_PATH)/format_srgb.py
Nicolai Hähnle601093f2017-06-30 11:57:06 +020075
Mauro Rossiaa866112020-08-14 14:04:54 +020076$(intermediates)/format_srgb.c: $(format_srgb_gen)
Alistair Strachan5e073822018-09-19 15:33:29 -070077 @mkdir -p $(dir $@)
Mauro Rossiaa866112020-08-14 14:04:54 +020078 $(hide) $(MESA_PYTHON2) $(format_srgb_gen) $< > $@
Alistair Strachan5e073822018-09-19 15:33:29 -070079
Mauro Rossiaa866112020-08-14 14:04:54 +020080u_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
Nicolai Hähnle601093f2017-06-30 11:57:06 +020084
Mauro Rossiaa866112020-08-14 14:04:54 +020085$(intermediates)/format/u_format_pack.h: $(u_format_deps)
86 @mkdir -p $(dir $@)
87 $(hide) $(MESA_PYTHON2) $(u_format_gen) --header $< > $@
Sumit Semwal092675f2018-10-11 15:27:51 +053088
Mauro Rossiaa866112020-08-14 14:04:54 +020089$(intermediates)/format/u_format_table.c: $(u_format_deps)
90 @mkdir -p $(dir $@)
91 $(hide) $(MESA_PYTHON2) $(u_format_gen) $< > $@
Sumit Semwal092675f2018-10-11 15:27:51 +053092
Tomasz Figad703abf2014-09-27 16:19:59 +020093include $(MESA_COMMON_MK)
94include $(BUILD_STATIC_LIBRARY)