mirror of
https://github.com/cesanta/mongoose.git
synced 2024-12-27 15:01:03 +08:00
fix paths in Makefile
This commit is contained in:
parent
250dfc1377
commit
6edcc72364
@ -1,7 +1,13 @@
|
|||||||
PROJECT_DIR ?= /workdir
|
MONGOOSE_ROOT ?= $(realpath $(CURDIR)/../../..)
|
||||||
|
DOCKER_PROJECT_DIR ?= /workdir
|
||||||
ZEPHYR_DIR ?= zephyrproject
|
ZEPHYR_DIR ?= zephyrproject
|
||||||
BOARD ?= qemu_x86
|
PROJECT_NAME = $(notdir $(CURDIR))
|
||||||
|
PROJECT_PATH = $(realpath $(CURDIR))
|
||||||
|
ZEPHYR_PATH = $(realpath $(CURDIR)/..)/$(ZEPHYR_DIR)
|
||||||
|
DOCKER_PROJECT_PATH = $(DOCKER_PROJECT_DIR)/$(PROJECT_NAME)
|
||||||
|
DOCKER_ZEPHYR_PATH = $(DOCKER_PROJECT_DIR)/$(ZEPHYR_DIR)
|
||||||
|
|
||||||
|
BOARD ?= qemu_x86
|
||||||
ifeq "$(BOARD)" "qemu_x86"
|
ifeq "$(BOARD)" "qemu_x86"
|
||||||
OVERLAY ?= -DOVERLAY_CONFIG=overlay-e1000.conf
|
OVERLAY ?= -DOVERLAY_CONFIG=overlay-e1000.conf
|
||||||
else
|
else
|
||||||
@ -10,7 +16,7 @@ endif
|
|||||||
|
|
||||||
SHAREUSB ?= --privileged -v /dev/bus/usb/:/dev/bus/usb
|
SHAREUSB ?= --privileged -v /dev/bus/usb/:/dev/bus/usb
|
||||||
SHARETUN ?= --cap-add=NET_ADMIN --device /dev/net/tun --net=host
|
SHARETUN ?= --cap-add=NET_ADMIN --device /dev/net/tun --net=host
|
||||||
DOCKER ?= docker run --rm -v $(realpath $(CURDIR)):$(PROJECT_DIR)
|
DOCKER ?= docker run --rm -v $(PROJECT_PATH):$(DOCKER_PROJECT_PATH) -v $(ZEPHYR_PATH):$(DOCKER_ZEPHYR_PATH)
|
||||||
REPO ?= zephyrprojectrtos/ci
|
REPO ?= zephyrprojectrtos/ci
|
||||||
|
|
||||||
|
|
||||||
@ -18,35 +24,36 @@ example:
|
|||||||
true
|
true
|
||||||
|
|
||||||
build:
|
build:
|
||||||
cp ../../../mongoose.[c,h] src/
|
cp $(MONGOOSE_ROOT)/mongoose.[c,h] src/
|
||||||
$(DOCKER) $(REPO) /bin/sh -c 'cd $(PROJECT_DIR)/$(ZEPHYR_DIR)/zephyr && \
|
$(DOCKER) $(REPO) /bin/sh -c 'cd $(DOCKER_ZEPHYR_PATH)/zephyr && \
|
||||||
west build -b $(BOARD) -p auto $(PROJECT_DIR) $(OVERLAY) --build-dir $(PROJECT_DIR)/build'
|
west build -b $(BOARD) -p auto $(DOCKER_PROJECT_PATH) $(OVERLAY) --build-dir $(DOCKER_PROJECT_PATH)/build'
|
||||||
|
|
||||||
run:
|
run:
|
||||||
$(DOCKER) -it $(SHARETUN) $(REPO) /bin/sh -c 'cd $(PROJECT_DIR)/$(ZEPHYR_DIR) && \
|
$(DOCKER) -it $(SHARETUN) $(REPO) /bin/sh -c 'cd $(DOCKER_ZEPHYR_PATH) && \
|
||||||
west build -t run --build-dir $(PROJECT_DIR)/build'
|
west build -t run --build-dir $(DOCKER_PROJECT_PATH)/build'
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(DOCKER) $(REPO) /bin/sh -c 'cd $(PROJECT_DIR)/$(ZEPHYR_DIR) && \
|
$(DOCKER) $(REPO) /bin/sh -c 'cd $(DOCKER_ZEPHYR_PATH) && \
|
||||||
west build -t clean --build-dir $(PROJECT_DIR)/build'
|
west build -t clean --build-dir $(DOCKER_PROJECT_PATH)/build'
|
||||||
|
|
||||||
pristine:
|
pristine:
|
||||||
$(DOCKER) $(REPO) /bin/sh -c 'cd $(PROJECT_DIR)/$(ZEPHYR_DIR) && \
|
$(DOCKER) $(REPO) /bin/sh -c 'cd $(DOCKER_ZEPHYR_PATH) && \
|
||||||
west build -t pristine --build-dir $(PROJECT_DIR)/build'
|
west build -t pristine --build-dir $(DOCKER_PROJECT_PATH)/build'
|
||||||
|
|
||||||
|
|
||||||
flash:
|
flash:
|
||||||
$(DOCKER) $(SHAREUSB) $(REPO) /bin/sh -c 'cd $(PROJECT_DIR)/$(ZEPHYR_DIR) && \
|
$(DOCKER) $(SHAREUSB) $(REPO) /bin/sh -c 'cd $(DOCKER_ZEPHYR_PATH) && \
|
||||||
west flash --build-dir $(PROJECT_DIR)/build'
|
west flash --build-dir $(DOCKER_PROJECT_PATH)/build'
|
||||||
|
|
||||||
debug:
|
debug:
|
||||||
$(DOCKER) -it $(SHAREUSB) $(REPO) /bin/sh -c 'cd $(PROJECT_DIR)/$(ZEPHYR_DIR) && \
|
$(DOCKER) -it $(SHAREUSB) $(REPO) /bin/sh -c 'cd $(DOCKER_ZEPHYR_PATH) && \
|
||||||
west debug --build-dir $(PROJECT_DIR)/build'
|
west debug --build-dir $(DOCKER_PROJECT_PATH)/build'
|
||||||
|
|
||||||
.PHONY: build flash zephyr clean pristine run
|
.PHONY: build flash zephyr clean pristine run
|
||||||
|
|
||||||
zephyr:
|
zephyr:
|
||||||
ifeq ($(wildcard $(ZEPHYR_DIR)/.*),)
|
ifeq ($(wildcard $(ZEPHYR_PATH)/.*),)
|
||||||
$(DOCKER) $(REPO) /bin/sh -c 'cd $(PROJECT_DIR) && west init ./$(ZEPHYR_DIR)'
|
mkdir $(ZEPHYR_PATH)
|
||||||
|
$(DOCKER) $(REPO) /bin/sh -c 'cd $(DOCKER_PROJECT_DIR) && west init ./$(ZEPHYR_DIR)'
|
||||||
endif
|
endif
|
||||||
$(DOCKER) $(REPO) /bin/sh -c 'cd $(PROJECT_DIR)/$(ZEPHYR_DIR) && west update'
|
$(DOCKER) $(REPO) /bin/sh -c 'cd $(DOCKER_ZEPHYR_PATH) && west update'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user