18 lines
504 B
Makefile
18 lines
504 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 -flto
|
||
|
CCPU = -march=rv32ec -mabi=ilp32e
|
||
|
MCPU = $(CCPU)
|
||
|
CFLAGS+= $(MCPU)
|
||
|
LFLAGS+= -Wl,--Map=$(@:%.elf=%.map),--gc-sections
|
||
|
#LFLAGS+= -Wl,--print-sysroot -- chyba ld ?
|
||
|
LFLAGS+= -flto -O3 $(MCPU) -nostartfiles -nostdlib
|
||
|
LDLIBS+= -lgcc -L./$(TARGET) -T generated_ch32v003.ld
|