Skip to content

Commit

Permalink
Fix non-docker build (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
IvoBCD committed Dec 26, 2019
1 parent 3413f54 commit 4db9139
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
@@ -1,3 +1,6 @@
# 'dist' folder
/dist
.git
/build
/app/build
/zephyrproject
2 changes: 1 addition & 1 deletion GIT-VERSION-GEN
Expand Up @@ -19,6 +19,6 @@ else
VC=unset
fi
test "$VN" = "$VC" || {
echo >&2 "GIT_DESC = $VN"
#echo >&2 "GIT_DESC = $VN"
echo "GIT_DESC = $VN" >$GVF
}
13 changes: 8 additions & 5 deletions Makefile
Expand Up @@ -12,6 +12,9 @@ SHELL := /bin/bash
BASE_PATH := $(realpath .)
DIST := $(BASE_PATH)/dist

.PHONY: default
default: build

.PHONY: GIT-VERSION-FILE
GIT-VERSION-FILE:
@sh ./GIT-VERSION-GEN
Expand All @@ -29,16 +32,16 @@ DOCKER_RUN_ARGS += --network=none
ZEPHYR_BOARD := ly10demo
ZEPHYR_BOARD_ROOT := $(BASE_PATH)

default: build

.PHONY: versions
versions:
@echo "GIT_DESC: $(GIT_DESC)"
@echo "VERSION_TAG: $(VERSION_TAG)"

.PHONY: build
build:
source /usr/src/zephyrproject/zephyr/zephyr-env.sh && \
if [ -d zephyrproject/zephyr ]; then source zephyrproject/zephyr/zephyr-env.sh ; \
elif [ -d /usr/src/zephyrproject/zephyr ]; then source /usr/src/zephyrproject/zephyr/zephyr-env.sh ; \
else echo "No Zephyr"; fi && \
cd app && \
west build --pristine auto --board "$(ZEPHYR_BOARD)" -- -DBOARD_ROOT="$(ZEPHYR_BOARD_ROOT)"

Expand All @@ -50,7 +53,7 @@ clean:
prereq:
pip3 install -r requirements.txt
install -d zephyrproject
cd zephyrproject && west init
cd zephyrproject && west init --mr v1.14.1
cd zephyrproject && west update
pip3 install -r zephyrproject/zephyr/scripts/requirements.txt

Expand All @@ -77,7 +80,7 @@ deploy:
.PHONY: docker
docker: dist-prep
docker build $(DOCKER_BUILD_ARGS) -t "bcdevices/$(PRJTAG)" .
-docker rm -f "$(PRJTAG)-$(VERSION_TAG)"
-@docker rm -f "$(PRJTAG)-$(VERSION_TAG)" 2>/dev/null
docker run $(DOCKER_RUN_ARGS) --name "$(PRJTAG)-$(VERSION_TAG)" -t "bcdevices/$(PRJTAG)" \
/bin/bash -c "make build dist"
docker cp "$(PRJTAG)-$(VERSION_TAG):/usr/src/dist" $(BASE_PATH)

0 comments on commit 4db9139

Please sign in to comment.