1#
2# Copyright (C) 2011 Intel Corporation
3# Copyright (C) 2010-2011 Chia-I Wu <olvaffe@gmail.com>
4# Copyright (C) 2010-2011 LunarG
5# Copyright (C) 2016 Linaro, Ltd., Rob Herring <robh@kernel.org>
6#
7# Permission is hereby granted, free of charge, to any person obtaining a
8# copy of this software and associated documentation files (the "Software"),
9# to deal in the Software without restriction, including without limitation
10# the rights to use, copy, modify, merge, publish, distribute, sublicense,
11# and/or sell copies of the Software, and to permit persons to whom the
12# Software is furnished to do so, subject to the following conditions:
13#
14# The above copyright notice and this permission notice shall be included
15# in all copies or substantial portions of the Software.
16#
17# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
20# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23# DEALINGS IN THE SOFTWARE.
24#
25
26# ---------------------------------------
27# Build libmesa_intel_compiler
28# ---------------------------------------
29
30include $(CLEAR_VARS)
31
32LOCAL_MODULE := libmesa_intel_compiler
33LOCAL_MODULE_CLASS := STATIC_LIBRARIES
34
35LOCAL_SRC_FILES := \
36	$(COMPILER_FILES)
37
38LOCAL_C_INCLUDES := \
39	$(MESA_TOP)/src/intel \
40	$(MESA_TOP)/src/mapi \
41	$(MESA_TOP)/src/mesa \
42	$(MESA_TOP)/src/gallium/auxiliary \
43	$(MESA_TOP)/src/gallium/include \
44	$(call generated-sources-dir-for,STATIC_LIBRARIES,libmesa_glsl,,)/glsl \
45	$(call generated-sources-dir-for,STATIC_LIBRARIES,libmesa_nir,,)/nir \
46	$(MESA_TOP)/src/intel/compiler \
47	$(MESA_TOP)/src/compiler/nir
48
49brw_nir_trig_workarounds_deps := \
50	$(LOCAL_PATH)/compiler/brw_nir_trig_workarounds.py \
51	$(MESA_TOP)/src/compiler/nir/nir_algebraic.py
52
53intermediates := $(call local-generated-sources-dir)
54
55$(intermediates)/compiler/brw_nir_trig_workarounds.c: $(brw_nir_trig_workarounds_deps)
56	@mkdir -p $(dir $@)
57	$(hide) $(MESA_PYTHON2) $< -p $(MESA_TOP)/src/compiler/nir > $@
58
59LOCAL_STATIC_LIBRARIES = libmesa_genxml
60
61LOCAL_GENERATED_SOURCES += $(addprefix $(intermediates)/, \
62	$(COMPILER_GENERATED_FILES))
63
64LOCAL_GENERATED_SOURCES += $(MESA_GEN_GLSL_H)
65
66include $(MESA_COMMON_MK)
67include $(BUILD_STATIC_LIBRARY)
68