forked from ucb-bar/Baremetal-IDE
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
53 lines (42 loc) · 1.3 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
PREFIX = riscv64-unknown-elf-
CC = $(PREFIX)gcc
CXX = $(PREFIX)g++
CP = $(PREFIX)objcopy
OD = $(PREFIX)objdump
DG = $(PREFIX)gdb
SIZE = $(PREFIX)size
# Can be used to change HART for gdb debugging
PORT = 3333
.PHONY: build
dsp24:
cmake -S ./ -B ./build/ -D CMAKE_TOOLCHAIN_FILE=./riscv-gcc.cmake -DCHIP=dsp24
cmake --build ./build/ --target app
bearly24:
cmake -S ./ -B ./build/ -D CMAKE_TOOLCHAIN_FILE=./riscv-gcc.cmake -DCHIP=bearly24
cmake --build ./build/ --target app
# Example: make build TARGET=borai CHIP=bearly24
.PHONY: build
build:
cmake -S ./ -B ./build/ -D CMAKE_TOOLCHAIN_FILE=./riscv-gcc.cmake -DCHIP=$(CHIP)
cmake --build ./build/ --target $(TARGET)
# Example: make ocd CHIP=bearly24
.PHONY: ocd
ocd:
openocd -f ./platform/$(CHIP)/$(CHIP).cfg
# Example: make gdb BINARY=build/borai/boraiq.elf
.PHONY: gdb
gdb:
$(DG) $(BINARY) --eval-command="target extended-remote localhost:$(PORT)" --eval-command="monitor reset"
# Example: make dump BINARY=build/borai/boraiq.elf
.PHONY: dump
dump:
$(OD) -D $(BINARY) > $(BINARY).dump
.PHONY: clean
clean:
rm -rf build
.PHONY: checktsi
checktsi:
uart_tsi +tty=$(TTY) +baudrate=921600 +no_hart0_msip +init_write=0x80001000:0xb0bacafe +init_read=0x80001000 none
.PHONY: tsi
tsi:
uart_tsi +tty=$(TTY) +baudrate=921600 $(BINARY)