makes build more configurable by CLI

This commit is contained in:
Eyck Jentzsch 2023-11-27 10:13:22 +01:00
parent d20582d7aa
commit 1b8f78fe78

View File

@ -2,18 +2,19 @@
TARGET = hello TARGET = hello
C_SRCS = $(wildcard *.c) C_SRCS = $(wildcard *.c)
HEADERS = $(wildcard *.h) HEADERS = $(wildcard *.h)
CFLAGS += -O2 -g OPT ?= -O2
CFLAGS += $(OPT) -g
BOARD=iss BOARD=iss
LINK_TARGET=link LINK_TARGET=link
RISCV_ARCH:=rv32i RISCV_ARCH:=rv32e
RISCV_ABI:=ilp32 RISCV_ABI:=ilp32e
LDFLAGS += -g -Wl,--wrap=printf LDFLAGS += -g -Wl,--wrap=printf
compiler := $(shell which riscv32-unknown-elf-gcc) compiler := $(shell which riscv64-unknown-elf-gcc)
TOOL_DIR=$(dir $(compiler)) TOOL_DIR=$(dir $(compiler))
TRIPLET=riscv32-unknown-elf TRIPLET=riscv64-unknown-elf
BSP_BASE = ../bare-metal-bsp BSP_BASE = ../bare-metal-bsp
include $(BSP_BASE)/env/common-gcc.mk include $(BSP_BASE)/env/common-gcc.mk