-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.mk
49 lines (44 loc) · 1013 Bytes
/
build.mk
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
# SPDX-License-Identifier: Apache-2.0
TARGETS = \
FRDM-K22F \
FRDM-K64F \
FRDM-K82F \
FRDM-KW41Z \
KL25Z \
LPCXpresso54114 \
LPCXpresso55S69 \
Microbit \
Microbitv2 \
MIMXRT1020 \
MIMXRT1050 \
MIMXRT1060 \
MIMXRT1170 \
Nordic-nRF51-DK \
Nordic-nRF52-DK \
Nordic-nRF52840-DK \
ST-Nucleo-F207ZG \
DIST = dist
DEPS = \
zdv/CMakeLists.txt \
zdv/aliases.cmake \
zdv/build.mk \
zdv/prj.conf \
zdv/src/main.c \
$(wildcard zdv/boards/*.conf)
OBJCOPY = arm-none-eabi-objcopy
BUILD_OPTIONS = -p auto
.PHONY:
all: $(patsubst %, $(DIST)/%.hex, $(TARGETS))
.SECONDARY:
$(DIST)/%.hex: builds/%/zephyr/zephyr.hex $(DEPS)
@mkdir -p $(DIST)
cp $< $@
$(OBJCOPY) -O binary --gap-fill=0xff builds/$*/zephyr/zephyr.elf $(DIST)/$*.bin
if [ -f builds/$*/zephyr/zephyr.uf2 ] ; then \
cp builds/$*/zephyr/zephyr.uf2 $(DIST)/$*.uf2 ; \
fi
.SECONDARY:
builds/%/zephyr/zephyr.hex: $(DEPS)
ZEPHYR_BOARD_ALIASES=$(abspath zdv/aliases.cmake) \
west build -b $* -d builds/$* $(BUILD_OPTIONS) zdv
@touch $@