mongoose/examples/zephyr/Makefile

32 lines
1.1 KiB
Makefile
Raw Normal View History

2022-11-15 03:35:24 +08:00
DOCKER_PROJECT_DIR ?= /workdir
ZEPHYR_DIR ?= zephyrproject
PROJECT_PATH = $(realpath $(CURDIR))
ZEPHYR_PATH = $(realpath $(CURDIR))/$(ZEPHYR_DIR)
DOCKER_PROJECT_PATH = $(DOCKER_PROJECT_DIR)
DOCKER_ZEPHYR_PATH = $(DOCKER_PROJECT_DIR)/$(ZEPHYR_DIR)
DOCKER ?= docker run --rm -v $(PROJECT_PATH):$(DOCKER_PROJECT_PATH) -v $(ZEPHYR_PATH):$(DOCKER_ZEPHYR_PATH)
REPO ?= zephyrprojectrtos/ci
2024-10-11 02:49:53 +08:00
REVNO ?= --mr v3.7-branch
2022-11-15 03:35:24 +08:00
YQ ?= yq
example:
true
2022-12-28 07:27:56 +08:00
clean:
true
2022-11-15 03:35:24 +08:00
init:
ifeq ($(wildcard $(ZEPHYR_PATH)/.*),)
mkdir $(ZEPHYR_PATH)
2024-10-11 02:49:53 +08:00
$(DOCKER) $(REPO) /bin/sh -c 'cd $(DOCKER_PROJECT_DIR) && west init $(REVNO) ./$(ZEPHYR_DIR)'
2022-11-15 03:35:24 +08:00
endif
update:
$(DOCKER) $(REPO) /bin/sh -c 'cd $(DOCKER_ZEPHYR_PATH) && west update'
minify:
$(YQ) -i eval '(.manifest.defaults, .manifest.remotes, .manifest.projects[] | select(.name == "cmsis" or .name == "hal_stm32" 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))' zephyrproject/zephyr/west.yml
zephyr: init minify update