21 lines
701 B
Makefile
21 lines
701 B
Makefile
# 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
|
|
CCPU = -march=rv32imac -mabi=ilp32
|
|
MCPU = $(CCPU)
|
|
|
|
CFLAGS+= $(MCPU) -fmessage-length=0 -I/usr/include/newlib
|
|
LFLAGS+= -Wl,--Map=$(@:%.elf=%.map),--gc-sections
|
|
#LFLAGS+= -Wl,--print-sysroot -- chyba ld ?
|
|
LFLAGS+= -O3 $(MCPU) -nostartfiles -nostdlib
|
|
#LFLAGS+= -L${HOME}/Downloads/MRS_Toolchain_Linux_x64_V1.91/RISC-V_Embedded_GCC/riscv-none-embed/lib/rv32imac/ilp32 -lprintf -lc
|
|
#LDLIBS+= -L$(SRCDIR)/Ld -T Link.ld
|
|
LDLIBS+= -L./ch32v203 -T script.ld
|