Skip to content

Commit 08842e7

Browse files
committed
SWPROT-8953: build: Add hints in helper script
This part is not yet documented in docs, it will be done after the deduplication of UnifySDK For the record the whole zpc code can be built using this oneliner: time docker build https://github.com/SiliconLabsSoftware/z-wave-protocol-controller.git#main # 17min Origin: #35 Signed-off-by: Philippe Coval <philippe.coval@silabs.com>
1 parent a24a4d3 commit 08842e7

File tree

1 file changed

+27
-6
lines changed

1 file changed

+27
-6
lines changed

helper.mk

+27-6
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ default: help all/default
1010
SELF?=${CURDIR}/helper.mk
1111

1212
project?=z-wave-protocol-controller
13+
url?=https://github.com/SiliconLabsSoftware/z-wave-protocol-controller
14+
1315
# Temporary workaround for:
1416
# https://gitlab.kitware.com/cmake/cmake/-/issues/22813#note_1620373
1517
project_test_dir?=applications
@@ -91,17 +93,31 @@ export CMAKE_TARGET_TRIPLE
9193
endif
9294

9395

94-
help: README.md
95-
@cat $<
96+
help: ./helper.mk
97+
@echo "# ${project}: ${url}"
98+
@echo "#"
99+
@echo "# Usage:"
100+
@echo "# ${<D}/${<F} setup # To setup developer system (once)"
101+
@echo "# ${<D}/${<F} VERBOSE=1 # Default build tasks verbosely (depends on setup)"
102+
@echo "# ${<D}/${<F} # For more info"
103+
@echo "#"
104+
105+
help/all: README.md NEWS.md
106+
@echo "# ${project}: ${url}"
96107
@echo ""
97-
@echo "# Available rules at your own risk:"
108+
@head $^
109+
@echo ""
110+
@echo "# Available helper.mk rules at your own risk:"
98111
@grep -o '^[^ ]*:' ${SELF} \
99112
| grep -v '\$$' | grep -v '^#' | grep -v '^\.' \
100113
| grep -v '=' | grep -v '%'
101-
@echo ""
114+
@echo "#"
102115
@echo "# Environment:"
103-
@echo "# PATH=${PATH}"
116+
@echo "# PATH=${PATH}"
117+
@echo "# version=${version}"
104118
@echo ""
119+
@echo ""
120+
105121

106122
setup/debian: ${CURDIR}/docker/target_dependencies.apt ${CURDIR}/docker/host_dependencies.apt
107123
cat /etc/debian_version
@@ -168,7 +184,7 @@ ${PLANTUML_JAR_PATH}:
168184
${sudo} install -d ${plantuml_dir}
169185
${sudo} install ${plantuml_filename} ${plantuml_dir}/
170186
rm -v ${plantuml_filename}
171-
@echo "# %@: Please adapt env to:"
187+
@echo "# $@: Please adapt env to use:"
172188
@echo "# export PLANTUML_JAR_PATH=${plantuml_dir}/${plantuml_filename}"
173189

174190
setup/plantuml: ${PLANTUML_JAR_PATH}
@@ -290,13 +306,18 @@ prepare/docker: Dockerfile prepare
290306
@echo "# ${project}: log: $@: done: $^"
291307

292308
docker_workdir?=/usr/local/opt/${project}
309+
docker_branch?=main
310+
docker_url?=${url}.git\#${docker_branch}
293311

294312
docker/%: Dockerfile
295313
time docker run "${project}:latest" -C "${docker_workdir}" "${@F}"
296314

297315
test/docker: distclean prepare/docker docker/help docker/test
298316
@echo "# ${project}: log: $@: done: $^"
299317

318+
test/docker/build:
319+
time docker build -t "${project}:${docker_branch}" ${docker_url}
320+
300321
docs: ./scripts/build/build_documentation.py doc ${PLANTUML_JAR_PATH} configure
301322
@echo "# export PLANTUML_JAR_PATH=${plantuml_dir}/${plantuml_filename}"
302323
@echo "$@: PLANTUML_JAR_PATH=${PLANTUML_JAR_PATH}"

0 commit comments

Comments
 (0)