Skip to content

Commit adb12bb

Browse files
committed
nits
1 parent 3c10b36 commit adb12bb

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

test/zephyr/Makefile

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,32 @@ REVNO ?= --mr v3.7-branch
66
YQ ?= $(DOCKER) --user="root" mikefarah/yq
77

88
all: zephyr $(PROJECTS)
9-
rm -rf build
9+
echo
1010

1111
$(PROJECTS): FORCE
1212
$(DOCKER) -e ZEPHYR_BASE=$(ZEPHYR_DIR)/zephyr $(IMAGE) west build -b $(ZBNAME) -p auto $(realpath $@)
13+
rm -rf build
1314

1415
FORCE:
1516

16-
zephyr: init minify update
17+
zephyr: $(ZEPHYR_DIR)/modules/hal/cmsis
1718

18-
init: FORCE
19-
test -d $(ZEPHYR_DIR) || ( mkdir -p $(ZEPHYR_DIR) ; \
20-
$(DOCKER) $(IMAGE) west init $(REVNO) $(ZEPHYR_DIR))
21-
22-
update: FORCE
19+
$(ZEPHYR_DIR)/modules/hal/cmsis: $(ZEPHYR_DIR)/zephyr/west.yml
2320
$(DOCKER) $(IMAGE) /bin/sh -c 'cd $(ZEPHYR_DIR) && west update'
21+
touch $(ZEPHYR_DIR)/modules/hal/cmsis
22+
23+
# use '(YQ) -i eval' for in-place minify; this allows proper dependency processing and update. ALWAYS include "cmsis"...
24+
$(ZEPHYR_DIR)/zephyr/west.yml: $(ZEPHYR_DIR)/zephyr/west.yml.orig
25+
$(YQ) eval '(.manifest.defaults, .manifest.remotes, .manifest.projects[] | select(.name == "cmsis" or .name == "hal_stm32" or .name == "hal_nxp" or .name == "hal_espressif" or .name == "hal_rpi_pico" or .name == "segger" or .name == "mbedtls" or .name == "mcuboot" or .name == "picolibc" | del(.null) ), .manifest.self) as $$i ireduce({};setpath($$i | path; $$i)) | del(.manifest.projects.[].null) | del(..|select(length==0))' $(ZEPHYR_DIR)/zephyr/west.yml.orig > $(ZEPHYR_DIR)/zephyr/west.yml
2426

25-
minify: FORCE
26-
$(YQ) -i eval '(.manifest.defaults, .manifest.remotes, .manifest.projects[] | select(.name == "cmsis" or .name == "hal_stm32" or .name == "hal_nxp" or .name == "hal_espressif" or .name == "hal_rpi_pico" or .name == "segger" or .name == "mbedtls" or .name == "mcuboot" or .name == "picolibc" | del(.null) ), .manifest.self) as $$i ireduce({};setpath($$i | path; $$i)) | del(.manifest.projects.[].null) | del(..|select(length==0))' $(ZEPHYR_DIR)/zephyr/west.yml
27+
$(ZEPHYR_DIR)/zephyr/west.yml.orig: FORCE
28+
test -d $(ZEPHYR_DIR) || \
29+
( mkdir -p $(ZEPHYR_DIR) && \
30+
$(DOCKER) $(IMAGE) west init $(REVNO) $(ZEPHYR_DIR) && \
31+
mv $(ZEPHYR_DIR)/zephyr/west.yml $(ZEPHYR_DIR)/zephyr/west.yml.orig )
2732

2833

34+
# Wizard-style board name --> Zephyr board name; ZBNAME = table[BOARD]
2935
Z_f207 := nucleo_f207zg
3036
Z_f429 := nucleo_f429zi
3137
Z_f746 := nucleo_f746zg

0 commit comments

Comments
 (0)