-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (32 loc) · 775 Bytes
/
Makefile
File metadata and controls
43 lines (32 loc) · 775 Bytes
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
.PHONY: build run disassemble qemu release clean debug
all: build disassemble
NAME?=demo
TARGET?=thumbv7em-none-eabihf
ELF=target/$(TARGET)/debug/$(NAME)
c-samples:
@echo "Building C samples"
@make -C samples
build: c-samples
cargo build --target $(TARGET) --package $(NAME) -vvv
run: c-samples
cargo run --target $(TARGET)
disassemble:
./scripts/disassemble.sh $(ELF)
qemu: build disassemble
qemu-system-arm \
-cpu cortex-m4 \
-machine mps2-an386 \
-nographic \
-vga none \
-semihosting-config enable=on,target=native \
-device loader,file=$(ELF) \
-s -S
debug: qemu
release:
cargo build --release --target $(TARGET)
format:
cargo fmt
find samples -iname *.h -o -iname *.c | xargs clang-format -i
clean:
cargo clean
make -C samples clean