-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
41 lines (31 loc) · 883 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
NAME := f3_eva
target := $(shell grep "target =" .cargo/config | awk '{ print $$3 }' | tr -d '"')
release :=
MODE := $(if $(release),release,debug)
RELEASE_FLAG := $(if $(release),--release,)
usart := 1
log := info
fea :=
FEATURES := "--features=$(log)log,usart$(usart),$(fea)"
TARGET_PATH := ./target/$(target)/$(MODE)
BIN := $(TARGET_PATH)/$(NAME)
UNAME := $(shell uname)
ifeq ($(UNAME), Linux)
TTY := /dev/ttyUSB0
endif
ifeq ($(UNAME), Darwin)
TTY := /dev/tty.wchusbserial1420
endif
$(BIN): build
$(BIN).bin: $(BIN)
arm-none-eabi-objcopy -S -O binary $(BIN) $(BIN).bin
build:
cargo -v build $(RELEASE_FLAG) --bin $(NAME) --no-default-features $(FEATURES)
flash: $(BIN).bin
python2 ./loader/stm32loader.py -b 115200 -p $(TTY) -f F3 -e -w $(BIN).bin
load: flash
boad: build
bobbin -v load $(RELEASE_FLAG) --bin $(NAME) $(FEATURES)
clean:
cargo -v clean
.PHONY: build