TGC-VP/fw/hello-world/Makefile

29 lines
524 B
Makefile
Raw Normal View History

2022-04-11 09:22:28 +02:00
TARGET = hello
2024-04-15 12:39:48 +02:00
ISA?=imc
2022-04-11 09:22:28 +02:00
C_SRCS = $(wildcard *.c)
HEADERS = $(wildcard *.h)
2024-04-15 12:39:48 +02:00
OPT ?= -O2
CFLAGS += $(OPT) -g
2022-04-11 09:22:28 +02:00
2024-04-15 12:39:48 +02:00
BOARD=tgc_vp
LINK_TARGET=link
RISCV_ARCH:=rv32$(ISA)
ifeq ($(ISA),e)
RISCV_ABI:=ilp32e
else
RISCV_ABI:=ilp32
endif
LDFLAGS += -g -Wl,--wrap=printf
2022-04-11 09:22:28 +02:00
2024-04-15 12:39:48 +02:00
compiler := $(shell which riscv64-unknown-elf-gcc)
2022-04-11 09:22:28 +02:00
TOOL_DIR=$(dir $(compiler))
2024-04-15 12:39:48 +02:00
TRIPLET=riscv64-unknown-elf
2022-04-11 09:22:28 +02:00
BSP_BASE = ../bsp
include $(BSP_BASE)/env/common-gcc.mk
2024-04-15 12:39:48 +02:00
$(TARGET).vlog:$(TARGET)
riscv32-unknown-elf-objcopy -O verilog $(TARGET) $(TARGET).vlog