RISC-V/V003/ch32v003/gcc.mk

18 lines
514 B
Makefile
Raw Normal View History

2024-02-29 12:22:16 +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-04-08 20:55:20 +02:00
CFLAGS+= -Os -I/usr/include/newlib
2024-02-29 12:22:16 +01:00
CCPU = -march=rv32ec -mabi=ilp32e
MCPU = $(CCPU)
CFLAGS+= $(MCPU)
LFLAGS+= -Wl,--Map=$(@:%.elf=%.map),--gc-sections
#LFLAGS+= -Wl,--print-sysroot -- chyba ld ?
2024-03-10 17:40:00 +01:00
LFLAGS+= -O3 $(MCPU) -nostartfiles -nostdlib
2024-02-29 12:22:16 +01:00
LDLIBS+= -lgcc -L./$(TARGET) -T generated_ch32v003.ld