1#
2# Build targets for a risc-v based architecture
3#
4
5# Environment Checks ###########################################################
6
7ifeq ($(ANDROID_BUILD_TOP),)
8$(error "You should supply an ANDROID_BUILD_TOP environment variable \
9         containing a path to the Android source tree. This is typically \
10         provided by initializing the Android build environment.")
11endif
12
13ifeq ($(RISCV_TOOLCHAIN_PATH),)
14$(error "The risc-v toolchain directory needs to be exported as the \
15         RISCV_TOOLCHAIN_PATH environment variable")
16endif
17
18# Tools ########################################################################
19
20TARGET_AR = $(RISCV_TOOLCHAIN_PATH)/bin/llvm-ar
21TARGET_CC = $(RISCV_TOOLCHAIN_PATH)/bin/clang
22TARGET_LD = $(RISCV_TOOLCHAIN_PATH)/bin/ld.lld
23
24# Shared Object Linker Flags ###################################################
25
26TARGET_SO_LDFLAGS += --gc-sections
27TARGET_SO_LDFLAGS += -shared
28
29# Optimization Level ###########################################################
30
31TARGET_CFLAGS += -O$(OPT_LEVEL)
32