Firmwares/benchmarks/coremark/Makefile
2024-03-24 19:16:24 +01:00

37 lines
1.8 KiB
Makefile

TARGET := coremark
ISA?=imc
ITERATIONS?=0
ASM_SRCS :=
C_SRCS := core_list_join.c core_main.c core_matrix.c core_state.c core_util.c core_portme.c ee_printf.c
HEADERS := cm/coremark.h
vpath %.c cm
BOARD?=iss
LINK_TARGET=link
RISCV_ARCH:=rv32$(ISA)
ifeq ($(ISA),e)
RISCV_ABI:=ilp32e
else
RISCV_ABI:=ilp32
endif
PORT_CFLAGS = -DPERFORMANCE_RUN=1 -DCLOCKS_PER_SEC=10000000 -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast
PORT_CFLAGS+= -g -O3 -fno-common -funroll-loops -finline-functions -falign-functions=16 -falign-jumps=4 -falign-loops=4 -finline-limit=1000 -fno-if-conversion2 -fselective-scheduling -fno-crossjumping -freorder-blocks-and-partition
FLAGS_STR = "$(PORT_CFLAGS) $(XCFLAGS) $(XLFLAGS) $(LFLAGS_END)"
CFLAGS = $(PORT_CFLAGS) -I. -Icm -DFLAGS_STR=\"$(FLAGS_STR)\"
CFLAGS += -DITERATIONS=$(ITERATIONS)
LDFLAGS := -g -Wl,--wrap=scanf -Wl,--wrap=printf -Wl,--wrap=exit -lgcc -lm
TOOL_DIR=$(dir $(compiler))
BSP_BASE = ../../bare-metal-bsp
include $(BSP_BASE)/env/common-gcc.mk
#riscv64-unknown-elf-gcc -march=rv32imc_zicsr_zifencei -mabi=ilp32 -O3 -DCLOCKS_PER_SEC=10000000 -nostdlib -nostartfiles -nodefaultlibs -funroll-loops -fpeel-loops -fgcse-sm -fgcse-las -flto -g -DBOARD_TGCP -I../tgc -I. -DFLAGS_STR=\""-march=rv32imc_zicsr_zifencei -mabi=ilp32 -O3 -DCLOCKS_PER_SEC=10000000 -nostdlib -nostartfiles -nodefaultlibs -funroll-loops -fpeel-loops -fgcse-sm -fgcse-las -flto -g -DBOARD_TGCP -DPERFORMANCE_RUN=1 -T ../../../bare-metal-bsp/env/TGCP/link.lds"\" -I../../../bare-metal-bsp/env/TGCP -DITERATIONS=0 -DPERFORMANCE_RUN=1 -c ../tgc/ee_printf.c -o ee_printf.o
#riscv64-unknown-elf-gcc -march=rv32imc_zicsr_zifencei -mabi=ilp32 -g ./core_list_join.o ./core_main.o ./core_matrix.o ./core_state.o ./core_util.o ./core_portme.o ./ee_printf.o -o ./coremark.elf -T ../../../bare-metal-bsp/env/TGCP/link.lds