Firmwares/hello-world/Makefile

28 lines
531 B
Makefile
Raw Normal View History

2018-09-25 20:32:56 +02:00
TARGET = hello
2023-12-06 10:00:33 +01:00
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
2023-12-06 10:00:33 +01:00
RISCV_ARCH:=rv32$(ISA)
ifeq ($(ISA),e)
2023-12-06 10:00:33 +01:00
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