1 # Copyright © 2018 Valve Corporation
2 # Copyright © 2019 Mauro Rossi issor.oruam@gmail.com
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:
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
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
23 LOCAL_PATH
:= $(call my-dir
)
25 include $(LOCAL_PATH
)/Makefile.sources
27 # ---------------------------------------
29 # ---------------------------------------
33 LOCAL_MODULE
:= libmesa_aco
35 # filter-out compiler/aco_instruction_selection_setup.cpp because
36 # it's already included by compiler/aco_instruction_selection.cpp
38 $(filter-out compiler
/aco_instruction_selection_setup.
cpp, $(ACO_FILES
))
40 LOCAL_CFLAGS
+= -DFORCE_BUILD_AMDGPU
# instructs LLVM to declare LLVMInitializeAMDGPU* functions
42 LOCAL_CPPFLAGS
+= -Wall
-std
=c
++14
45 LOCAL_MODULE_CLASS
:= STATIC_LIBRARIES
46 intermediates
:= $(call local-generated-sources-dir
)
47 LOCAL_GENERATED_SOURCES
+= $(addprefix $(intermediates
)/, $(ACO_GENERATED_FILES
))
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
53 ACO_DEPS
:= $(MESA_TOP
)/src
/amd
/compiler
/aco_opcodes.py
55 $(intermediates
)/compiler
/aco_opcodes.h
: $(ACO_OPCODES_H_SCRIPT
) $(ACO_DEPS
)
57 @echo
"Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))"
58 $(hide
) $(MESA_PYTHON2
) $(ACO_OPCODES_H_SCRIPT
) > $@ ||
($(RM
) $@
; false
)
60 $(intermediates
)/compiler
/aco_opcodes.
cpp: $(ACO_OPCODES_CPP_SCRIPT
) $(ACO_DEPS
)
62 @echo
"Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))"
63 $(hide
) $(MESA_PYTHON2
) $(ACO_OPCODES_CPP_SCRIPT
) > $@ ||
($(RM
) $@
; false
)
65 $(intermediates
)/compiler
/aco_builder.h
: $(ACO_BUILDER_H_SCRIPT
) $(ACO_DEPS
)
67 @echo
"Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))"
68 $(hide
) $(MESA_PYTHON2
) $(ACO_BUILDER_H_SCRIPT
) > $@ ||
($(RM
) $@
; false
)
72 $(MESA_TOP
)/src
/amd
/common \
73 $(MESA_TOP
)/src
/amd
/compiler \
74 $(MESA_TOP
)/src
/compiler
/nir \
75 $(MESA_TOP
)/src
/mapi \
76 $(MESA_TOP
)/src
/mesa \
77 $(intermediates
)/compiler
79 LOCAL_EXPORT_C_INCLUDE_DIRS
:= \
80 $(MESA_TOP
)/src
/amd
/compiler \
81 $(intermediates
)/compiler
83 LOCAL_SHARED_LIBRARIES
:= \
86 LOCAL_STATIC_LIBRARIES
:= \
90 $(call mesa-build-with-llvm
)
92 include $(MESA_COMMON_MK
)
93 include $(BUILD_STATIC_LIBRARY
)