Firmwares/hello-world/Makefile

29 lines
532 B
Makefile
Raw Permalink Normal View History

2018-09-25 18:31:29 +02:00
2018-09-25 20:32:56 +02:00
TARGET = hello
ISA?=imc
2018-09-25 20:32:56 +02:00
C_SRCS = $(wildcard *.c)
2023-08-20 15:00:51 +02:00
HEADERS = $(wildcard *.h)
2023-11-27 10:13:22 +01:00
OPT ?= -O2
CFLAGS += $(OPT) -g
2018-09-25 18:31:29 +02:00
2023-08-20 15:00:51 +02:00
BOARD=iss
LINK_TARGET=link
RISCV_ARCH:=rv32$(ISA)
ifeq ($(ISA),e)
RISCV_ABI:=ilp32e
else
RISCV_ABI:=ilp32
endif
2023-08-20 15:00:51 +02:00
LDFLAGS += -g -Wl,--wrap=printf
2021-04-09 11:19:05 +02:00
2023-11-27 10:13:22 +01:00
compiler := $(shell which riscv64-unknown-elf-gcc)
2023-08-20 15:00:51 +02:00
TOOL_DIR=$(dir $(compiler))
2018-09-25 18:31:29 +02:00
2023-11-27 10:13:22 +01:00
TRIPLET=riscv64-unknown-elf
2023-08-20 15:00:51 +02:00
BSP_BASE = ../bare-metal-bsp
include $(BSP_BASE)/env/common-gcc.mk
2021-04-09 11:19:05 +02:00
2023-08-20 15:00:51 +02:00
$(TARGET).vlog:$(TARGET)
riscv32-unknown-elf-objcopy -O verilog $(TARGET) $(TARGET).vlog