-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
27 lines (19 loc) · 694 Bytes
/
Copy pathMakefile
File metadata and controls
27 lines (19 loc) · 694 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
SHELL := /usr/bin/env bash
EXAMPLE_DIR := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
CORE_DIR := $(abspath $(EXAMPLE_DIR)/../..)
TARGET_TRIPLE ?= thumbv7m-none-eabi
PROFILE ?= debug
FIRMWARE_PKG ?= firmware-h563-io-demo
CORE_ELF := $(CORE_DIR)/target/$(TARGET_TRIPLE)/$(PROFILE)/$(FIRMWARE_PKG)
LOCAL_TARGET_DIR := $(EXAMPLE_DIR)/target
LOCAL_ELF := $(LOCAL_TARGET_DIR)/firmware
.PHONY: all clean FORCE
all: $(LOCAL_ELF)
$(LOCAL_ELF): FORCE
cd "$(CORE_DIR)" && \
cargo build -p "$(FIRMWARE_PKG)" --target "$(TARGET_TRIPLE)" $(if $(filter $(PROFILE),release),--release,)
mkdir -p "$(LOCAL_TARGET_DIR)"
cp "$(CORE_ELF)" "$(LOCAL_ELF)"
FORCE:
clean:
rm -rf "$(LOCAL_TARGET_DIR)"