xref: /openbmc/u-boot/arch/riscv/Makefile (revision 7e2ae620)
1# SPDX-License-Identifier: GPL-2.0+
2#
3# Copyright (C) 2017 Andes Technology Corporation.
4# Rick Chen, Andes Technology Corporation <rick@andestech.com>
5
6ifeq ($(CONFIG_ARCH_RV64I),y)
7	ARCH_BASE = rv64im
8	ABI = lp64
9endif
10ifeq ($(CONFIG_ARCH_RV32I),y)
11	ARCH_BASE = rv32im
12	ABI = ilp32
13endif
14ifeq ($(CONFIG_RISCV_ISA_A),y)
15	ARCH_A = a
16endif
17ifeq ($(CONFIG_RISCV_ISA_C),y)
18	ARCH_C = c
19endif
20ifeq ($(CONFIG_CMODEL_MEDLOW),y)
21	CMODEL = medlow
22endif
23ifeq ($(CONFIG_CMODEL_MEDANY),y)
24	CMODEL = medany
25endif
26
27ARCH_FLAGS = -march=$(ARCH_BASE)$(ARCH_A)$(ARCH_C) -mabi=$(ABI) \
28	     -mcmodel=$(CMODEL)
29
30PLATFORM_CPPFLAGS	+= $(ARCH_FLAGS)
31CFLAGS_EFI		+= $(ARCH_FLAGS)
32
33head-y := arch/riscv/cpu/start.o
34
35libs-y += arch/riscv/cpu/
36libs-y += arch/riscv/cpu/$(CPU)/
37libs-y += arch/riscv/lib/
38