-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
38 lines (26 loc) · 903 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
APP = d21x
OSDIR = mdepx
OBJDIR = obj
CROSS_COMPILE ?= riscv64-linux-gnu-
OBJCOPY = ${CROSS_COMPILE}objcopy
PYTHON = python3 -B
export CROSS_COMPILE
export CFLAGS = -march=rv64imafdc_xtheadc -mabi=lp64 -mcmodel=medlow \
-nostdinc -fno-builtin-printf -ffreestanding -Wall \
-Wredundant-decls -Wnested-externs -Wstrict-prototypes \
-Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \
-Wundef -Wmissing-include-dirs -Werror -std=c99 -fPIC
export AFLAGS = ${CFLAGS}
BUILD_CMD = ${PYTHON} ${OSDIR}/tools/emitter.py
all:
@${BUILD_CMD} -j mdepx.conf
${CROSS_COMPILE}objcopy -O binary ${OBJDIR}/${APP}.elf \
${OBJDIR}/${APP}.bin
${PYTHON} ./aic/mk_image.py --config aic/d21x_aic.json -s --verbose
clean:
@rm -rf obj/*
objdump:
${CROSS_COMPILE}objdump -d ${OBJDIR}/${APP}.elf | less
readelf:
${CROSS_COMPILE}readelf -a ${OBJDIR}/${APP}.elf | less
include ${OSDIR}/mk/user.mk