RISC-V/V203/ch32v203/gcc.mk

19 lines
604 B
Makefile
Raw Normal View History

2024-03-11 15:05:36 +01:00
# Use gcc / binutils toolchain
PREFIX = riscv64-unknown-elf-
CC = $(PREFIX)gcc
CXX = $(PREFIX)g++
LD = $(PREFIX)gcc
SIZE = $(PREFIX)size
DUMP = $(PREFIX)objdump
COPY = $(PREFIX)objcopy
OBJS += startup.o system.o
2024-05-07 11:46:49 +02:00
CFLAGS+= -Os -flto
CCPU = -march=rv32imac -mabi=ilp32
2024-03-11 15:05:36 +01:00
MCPU = $(CCPU)
2024-05-07 11:46:49 +02:00
CFLAGS+= $(MCPU) -msmall-data-limit=8 -mno-save-restore -fmessage-length=0 -fsigned-char -I/usr/include/newlib
2024-03-11 15:05:36 +01:00
LFLAGS+= -Wl,--Map=$(@:%.elf=%.map),--gc-sections
#LFLAGS+= -Wl,--print-sysroot -- chyba ld ?
2024-05-07 11:46:49 +02:00
LFLAGS+= -flto -O3 $(MCPU) -nostartfiles -nostdlib
LDLIBS+= -lgcc -L./$(TARGET) -T generated_CH32V203F8P6.ld