From 1b8f78fe781773a8cbf9839c1fb026b9399183f9 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Mon, 27 Nov 2023 10:13:22 +0100 Subject: [PATCH] makes build more configurable by CLI --- hello-world/Makefile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/hello-world/Makefile b/hello-world/Makefile index de5743d..17feac9 100644 --- a/hello-world/Makefile +++ b/hello-world/Makefile @@ -2,18 +2,19 @@ TARGET = hello C_SRCS = $(wildcard *.c) HEADERS = $(wildcard *.h) -CFLAGS += -O2 -g +OPT ?= -O2 +CFLAGS += $(OPT) -g BOARD=iss LINK_TARGET=link -RISCV_ARCH:=rv32i -RISCV_ABI:=ilp32 +RISCV_ARCH:=rv32e +RISCV_ABI:=ilp32e LDFLAGS += -g -Wl,--wrap=printf -compiler := $(shell which riscv32-unknown-elf-gcc) +compiler := $(shell which riscv64-unknown-elf-gcc) TOOL_DIR=$(dir $(compiler)) -TRIPLET=riscv32-unknown-elf +TRIPLET=riscv64-unknown-elf BSP_BASE = ../bare-metal-bsp include $(BSP_BASE)/env/common-gcc.mk