xref: /openbmc/u-boot/arch/riscv/Makefile (revision 7e40d0a3)
183d290c5STom Rini# SPDX-License-Identifier: GPL-2.0+
2f94c44e5SRick Chen#
3f94c44e5SRick Chen# Copyright (C) 2017 Andes Technology Corporation.
4f94c44e5SRick Chen# Rick Chen, Andes Technology Corporation <rick@andestech.com>
5f94c44e5SRick Chen
60c074845SLukas Auerifeq ($(CONFIG_ARCH_RV64I),y)
70c074845SLukas Auer	ARCH_BASE = rv64im
80c074845SLukas Auer	ABI = lp64
90c074845SLukas Auerendif
100c074845SLukas Auerifeq ($(CONFIG_ARCH_RV32I),y)
110c074845SLukas Auer	ARCH_BASE = rv32im
120c074845SLukas Auer	ABI = ilp32
130c074845SLukas Auerendif
140c074845SLukas Auerifeq ($(CONFIG_RISCV_ISA_A),y)
150c074845SLukas Auer	ARCH_A = a
160c074845SLukas Auerendif
170c074845SLukas Auerifeq ($(CONFIG_RISCV_ISA_C),y)
180c074845SLukas Auer	ARCH_C = c
190c074845SLukas Auerendif
20*8176ea4dSLukas Auerifeq ($(CONFIG_CMODEL_MEDLOW),y)
21*8176ea4dSLukas Auer	CMODEL = medlow
22*8176ea4dSLukas Auerendif
23*8176ea4dSLukas Auerifeq ($(CONFIG_CMODEL_MEDANY),y)
24*8176ea4dSLukas Auer	CMODEL = medany
25*8176ea4dSLukas Auerendif
260c074845SLukas Auer
27*8176ea4dSLukas AuerARCH_FLAGS = -march=$(ARCH_BASE)$(ARCH_A)$(ARCH_C) -mabi=$(ABI) \
28*8176ea4dSLukas Auer	     -mcmodel=$(CMODEL)
290c074845SLukas Auer
300c074845SLukas AuerPLATFORM_CPPFLAGS	+= $(ARCH_FLAGS)
310c074845SLukas AuerCFLAGS_EFI		+= $(ARCH_FLAGS)
320c074845SLukas Auer
33b5369c58SBin Menghead-y := arch/riscv/cpu/start.o
34f94c44e5SRick Chen
352fab2e9cSBin Menglibs-y += arch/riscv/cpu/
36f94c44e5SRick Chenlibs-y += arch/riscv/cpu/$(CPU)/
37f94c44e5SRick Chenlibs-y += arch/riscv/lib/
38