nir: Add options to nir_lower_compute_system_values to control compute ID base lowering
[mesa.git] / src / amd / Android.compiler.mk
1 # Copyright © 2018 Valve Corporation
2 # Copyright © 2019 Mauro Rossi issor.oruam@gmail.com
3
4 # Permission is hereby granted, free of charge, to any person obtaining a
5 # copy of this software and associated documentation files (the "Software"),
6 # to deal in the Software without restriction, including without limitation
7 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 # and/or sell copies of the Software, and to permit persons to whom the
9 # Software is furnished to do so, subject to the following conditions:
10 #
11 # The above copyright notice and this permission notice (including the next
12 # paragraph) shall be included in all copies or substantial portions of the
13 # 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 DEALINGS
21 # IN THE SOFTWARE.
22
23 LOCAL_PATH := $(call my-dir)
24
25 include $(LOCAL_PATH)/Makefile.sources
26
27 # ---------------------------------------
28 # Build libmesa_aco
29 # ---------------------------------------
30
31 include $(CLEAR_VARS)
32
33 LOCAL_MODULE := libmesa_aco
34
35 # filter-out compiler/aco_instruction_selection_setup.cpp because
36 # it's already included by compiler/aco_instruction_selection.cpp
37 LOCAL_SRC_FILES := \
38 $(filter-out compiler/aco_instruction_selection_setup.cpp, $(ACO_FILES))
39
40 LOCAL_CFLAGS += -DFORCE_BUILD_AMDGPU # instructs LLVM to declare LLVMInitializeAMDGPU* functions
41
42 LOCAL_CPPFLAGS += -Wall -std=c++14
43
44 # generate sources
45 LOCAL_MODULE_CLASS := STATIC_LIBRARIES
46 intermediates := $(call local-generated-sources-dir)
47 LOCAL_GENERATED_SOURCES += $(addprefix $(intermediates)/, $(ACO_GENERATED_FILES))
48
49 ACO_OPCODES_H_SCRIPT := $(MESA_TOP)/src/amd/compiler/aco_opcodes_h.py
50 ACO_OPCODES_CPP_SCRIPT := $(MESA_TOP)/src/amd/compiler/aco_opcodes_cpp.py
51 ACO_BUILDER_H_SCRIPT := $(MESA_TOP)/src/amd/compiler/aco_builder_h.py
52
53 ACO_DEPS := $(MESA_TOP)/src/amd/compiler/aco_opcodes.py
54
55 $(intermediates)/compiler/aco_opcodes.h: $(ACO_OPCODES_H_SCRIPT) $(ACO_DEPS)
56 @mkdir -p $(dir $@)
57 @echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))"
58 $(hide) $(MESA_PYTHON2) $(ACO_OPCODES_H_SCRIPT) > $@ || ($(RM) $@; false)
59
60 $(intermediates)/compiler/aco_opcodes.cpp: $(ACO_OPCODES_CPP_SCRIPT) $(ACO_DEPS)
61 @mkdir -p $(dir $@)
62 @echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))"
63 $(hide) $(MESA_PYTHON2) $(ACO_OPCODES_CPP_SCRIPT) > $@ || ($(RM) $@; false)
64
65 $(intermediates)/compiler/aco_builder.h: $(ACO_BUILDER_H_SCRIPT) $(ACO_DEPS)
66 @mkdir -p $(dir $@)
67 @echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))"
68 $(hide) $(MESA_PYTHON2) $(ACO_BUILDER_H_SCRIPT) > $@ || ($(RM) $@; false)
69
70 LOCAL_C_INCLUDES := \
71 $(MESA_TOP)/src/amd \
72 $(MESA_TOP)/src/amd/common \
73 $(MESA_TOP)/src/amd/compiler \
74 $(MESA_TOP)/src/compiler/nir \
75 $(MESA_TOP)/src/gallium/include \
76 $(MESA_TOP)/src/mapi \
77 $(MESA_TOP)/src/mesa \
78 $(intermediates)/compiler
79
80 LOCAL_EXPORT_C_INCLUDE_DIRS := \
81 $(MESA_TOP)/src/amd/compiler \
82 $(intermediates)/compiler
83
84 LOCAL_SHARED_LIBRARIES := \
85 libdrm_amdgpu
86
87 LOCAL_STATIC_LIBRARIES := \
88 libmesa_amd_common \
89 libmesa_nir
90
91 $(call mesa-build-with-llvm)
92
93 include $(MESA_COMMON_MK)
94 include $(BUILD_STATIC_LIBRARY)