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