1*344aa361SAndroid Build Coastguard Worker# Copyright (c) 2020, Google, Inc. All rights reserved 2*344aa361SAndroid Build Coastguard Worker# 3*344aa361SAndroid Build Coastguard Worker# Permission is hereby granted, free of charge, to any person obtaining 4*344aa361SAndroid Build Coastguard Worker# a copy of this software and associated documentation files 5*344aa361SAndroid Build Coastguard Worker# (the "Software"), to deal in the Software without restriction, 6*344aa361SAndroid Build Coastguard Worker# including without limitation the rights to use, copy, modify, merge, 7*344aa361SAndroid Build Coastguard Worker# publish, distribute, sublicense, and/or sell copies of the Software, 8*344aa361SAndroid Build Coastguard Worker# and to permit persons to whom the Software is furnished to do so, 9*344aa361SAndroid Build Coastguard Worker# subject to the following conditions: 10*344aa361SAndroid Build Coastguard Worker# 11*344aa361SAndroid Build Coastguard Worker# The above copyright notice and this permission notice shall be 12*344aa361SAndroid Build Coastguard Worker# included in all copies or substantial portions of the Software. 13*344aa361SAndroid Build Coastguard Worker# 14*344aa361SAndroid Build Coastguard Worker# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15*344aa361SAndroid Build Coastguard Worker# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16*344aa361SAndroid Build Coastguard Worker# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17*344aa361SAndroid Build Coastguard Worker# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18*344aa361SAndroid Build Coastguard Worker# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19*344aa361SAndroid Build Coastguard Worker# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20*344aa361SAndroid Build Coastguard Worker# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21*344aa361SAndroid Build Coastguard Worker 22*344aa361SAndroid Build Coastguard WorkerLOCAL_DIR := $(GET_LOCAL_DIR) 23*344aa361SAndroid Build Coastguard Worker 24*344aa361SAndroid Build Coastguard WorkerLIB_BACKTRACE_ARCHS := \ 25*344aa361SAndroid Build Coastguard Worker arm \ 26*344aa361SAndroid Build Coastguard Worker arm64 \ 27*344aa361SAndroid Build Coastguard Worker 28*344aa361SAndroid Build Coastguard WorkerLIB_BACKTRACE_ARCH_SUPPORTED ?= \ 29*344aa361SAndroid Build Coastguard Worker $(if $(filter $(LIB_BACKTRACE_ARCHS),$(ARCH)),true,false) 30*344aa361SAndroid Build Coastguard Worker 31*344aa361SAndroid Build Coastguard WorkerLIB_BACKTRACE_ENABLE ?= $(LIB_BACKTRACE_ARCH_SUPPORTED) 32*344aa361SAndroid Build Coastguard Worker 33*344aa361SAndroid Build Coastguard Workerifeq (true,$(call TOBOOL,$(LIB_BACKTRACE_ENABLE))) 34*344aa361SAndroid Build Coastguard WorkerMODULE := $(LOCAL_DIR) 35*344aa361SAndroid Build Coastguard Worker 36*344aa361SAndroid Build Coastguard WorkerMODULE_DEPS := \ 37*344aa361SAndroid Build Coastguard Worker trusty/kernel/lib/libc-ext \ 38*344aa361SAndroid Build Coastguard Worker trusty/kernel/lib/trusty \ 39*344aa361SAndroid Build Coastguard Worker 40*344aa361SAndroid Build Coastguard WorkerMODULE_SRCS := \ 41*344aa361SAndroid Build Coastguard Worker $(LOCAL_DIR)/backtrace.c \ 42*344aa361SAndroid Build Coastguard Worker $(LOCAL_DIR)/symbolize.c \ 43*344aa361SAndroid Build Coastguard Worker 44*344aa361SAndroid Build Coastguard WorkerGLOBAL_DEFINES += LIB_BACKTRACE_ENABLE=1 45*344aa361SAndroid Build Coastguard Worker 46*344aa361SAndroid Build Coastguard Workerinclude $(LOCAL_DIR)/arch/$(ARCH)/rules.mk 47*344aa361SAndroid Build Coastguard Worker 48*344aa361SAndroid Build Coastguard Workerinclude make/module.mk 49*344aa361SAndroid Build Coastguard Workerelse 50*344aa361SAndroid Build Coastguard WorkerGLOBAL_INCLUDES += $(LOCAL_DIR)/include 51*344aa361SAndroid Build Coastguard Workerendif 52