-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
44 lines (34 loc) · 990 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
39
40
41
42
43
44
bin := fcfs-rtfm
NAME := $(bin)
release :=
MODE := $(if $(release),release,debug)
RELEASE_FLAG := $(if $(release),--release,)
target :=
TARGET := $(if $(target),"$(target)",thumbv7em-none-eabihf)
TARGET_PATH := ./target/$(TARGET)/$(MODE)
BIN := $(TARGET_PATH)/$(NAME)
fea :=
log := semihosting
level := info
configuration := dev
motors := quad
FEATURES := "--features=log_$(log),level_$(level),configuration_$(configuration),motors_$(motors),$(fea)"
$(BIN): build
memory:
cp memory.$(configuration) memory.x
build: memory
cargo -v build $(RELEASE_FLAG) --target $(TARGET) --bin $(NAME) --no-default-features $(FEATURES)
check:
cargo -v check $(RELEASE_FLAG) --target $(TARGET) --bin $(NAME) --no-default-features $(FEATURES)
load: build
sh -c "openocd & arm-none-eabi-gdb -q $(BIN) & wait"
gdb: build
arm-none-eabi-gdb -q $(BIN)
clean:
rm memory.x
cargo -v clean
bloat:
cargo -v bloat $(RELEASE_FLAG) --crates
details:
cargo -v bloat $(RELEASE_FLAG) -n 100
.PHONY: build