19 lines
602 B
Makefile
19 lines
602 B
Makefile
# 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
|
|
CFLAGS+= -Os
|
|
CCPU = -march=rv32imac -mabi=ilp32
|
|
MCPU = $(CCPU)
|
|
|
|
CFLAGS+= $(MCPU) -I/usr/include/newlib -fmessage-length=0
|
|
#CFLAGS+= -msmall-data-limit=8 -mno-save-restore -fsigned-char
|
|
LFLAGS+= -Wl,--Map=$(@:%.elf=%.map),--gc-sections
|
|
#LFLAGS+= -Wl,--print-sysroot -- chyba ld ?
|
|
LFLAGS+= -O3 $(MCPU) -nostartfiles -nostdlib
|
|
LDLIBS+= -lgcc -L./$(TARGET) -T generated_CH32V203F8P6.ld
|