Skip to content

Commit 4798096

Browse files
marc-hblgirdwood
authored andcommitted
installer: (re)build firmware, topologies and user space tools
One-touch "make -C installer rsync" combines fast incremental build, staging and deploy in one command. Signed-off-by: Marc Herbert <marc.herbert@intel.com>
1 parent f9545c8 commit 4798096

2 files changed

Lines changed: 45 additions & 7 deletions

File tree

installer/GNUmakefile

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ endif
4949
################################
5050

5151
# Our input: build_*_?cc/ directories
52-
BUILDS_ROOT ?= ../
52+
BUILDS_ROOT ?= ${CURDIR}/../installer-builds
5353
BUILD_TOOLS ?= ${BUILDS_ROOT}/build_tools
5454

5555
STAGING_SOF ?= staging/sof
@@ -67,7 +67,7 @@ endif
6767

6868
COMMUNITY := ${STAGING_SOF_VERSION}/community
6969
INTEL_SIGNED := ${STAGING_SOF_VERSION}/intel-signed
70-
${COMMUNITY} ${INTEL_SIGNED}:
70+
${COMMUNITY} ${INTEL_SIGNED} ${BUILDS_ROOT}:
7171
mkdir -p $@
7272

7373

@@ -85,13 +85,14 @@ rsync:
8585
ifneq (${USER_DESTDIR},)
8686
# TODO: add more user space binaries: sof-ctl, probes,...
8787
# absorbe scripts/sof-target-install.sh
88-
# Requires ./scripts/build-tools.sh -l ...
8988
rsync -a ${BUILD_TOOLS}/logger/sof-logger ${USER_DESTDIR}
9089
endif
9190

9291
clean:
9392
${RM} -r staging/sof*
9493

94+
cleanall: clean
95+
${RM} -r "${BUILD_TOOLS}/" "${BUILDS_ROOT}"/build_*_?cc/
9596

9697
##########################################################
9798
### Stage sof-*.ri firmware files and symbolic links ####
@@ -124,6 +125,22 @@ ${UNSIGNED_FWS}: ${STAGING_SOF_VERSION}/sof-%.ri: \
124125
install ${INSTALL_OPTS} $< $@
125126

126127

128+
BUILD_SOF_RIS := \
129+
${UNSIGNED_list:%=${BUILDS_ROOT}/build_%_${TOOLCHAIN}/sof.ri} \
130+
${SIGNED_list:%=${BUILDS_ROOT}/build_%_${TOOLCHAIN}/sof.ri}
131+
132+
# The build is not deterministic; use this to reduce noise when testing
133+
# this Makefile
134+
ifneq (true,${BUILD_ONLY_ONCE})
135+
.PHONY: ${BUILD_SOF_RIS}
136+
endif
137+
138+
${BUILD_SOF_RIS}: ${BUILDS_ROOT}/build_%_${TOOLCHAIN}/sof.ri: | ${BUILDS_ROOT}
139+
cd ${BUILDS_ROOT} && bdir="$$(dirname $@)" && \
140+
if test -d $${bdir}; then cmake --build $${bdir} -- sof; else \
141+
$(CURDIR)/../scripts/xtensa-build-all.sh $*; fi
142+
143+
127144
########################################
128145
### Stage *.ldc logger dictionaries ###
129146
########################################
@@ -134,8 +151,8 @@ LDICTS := ${UNSIGNED_list:%=${STAGING_SOF_VERSION}/sof-%.ldc} \
134151
# $(info LDICTS = ${LDICTS})
135152
ldicts: ${LDICTS}
136153
${LDICTS}: ${STAGING_SOF_VERSION}/sof-%.ldc: \
137-
${BUILDS_ROOT}/build_%_${TOOLCHAIN}/sof.ldc
138-
install ${INSTALL_OPTS} $< $@
154+
${BUILDS_ROOT}/build_%_${TOOLCHAIN}/sof.ri
155+
install ${INSTALL_OPTS} ${BUILDS_ROOT}/build_$*_${TOOLCHAIN}/sof.ldc $@
139156

140157

141158
#######################################
@@ -164,8 +181,13 @@ ${SIGNED_ALIASES}: ${STAGING_SOF_VERSION}/sof-%.ri:
164181
### Stage sof-tplg/ topologies ###
165182
##################################
166183

167-
topologies:
168-
# This requires ./scripts/build-tools.sh -T ...
184+
# The build is not deterministic; use this to reduce noise when testing
185+
# this Makefile
186+
ifneq (true,${BUILD_ONLY_ONCE})
187+
.PHONY: ${BUILD_TOOLS}
188+
endif
189+
190+
topologies: ${BUILD_TOOLS}
169191
install ${INSTALL_OPTS} -t ${STAGING_SOF_TPLG}${VERSION_SUFFIX}/ \
170192
${BUILD_TOOLS}/topology/sof-*.tplg
171193
ifneq (,${VERSION_SUFFIX})
@@ -176,6 +198,15 @@ endif
176198
@tree ${TREE_OPTS} ${STAGING_SOF_TPLG}${VERSION_SUFFIX} | \
177199
head -n 10; printf '├── ...\n..\n'
178200

201+
# We should use more targets rather than set -e and a multi-lines script
202+
# but that would be verbose.
203+
${BUILD_TOOLS}:
204+
set -e; if test -d ${BUILD_TOOLS}; then \
205+
for i in topologies sof-logger; do \
206+
cmake --build ${BUILD_TOOLS} -- $$i; done; else \
207+
BUILD_TOOLS_DIR=${BUILD_TOOLS} ../scripts/build-tools.sh -T -l ; \
208+
fi
209+
179210

180211
####################
181212
### Self-Testing ###

installer/sample-config.mk

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,10 @@
2121
#
2222
# SOF_VERSION := $(shell git describe --tags )
2323
# SOF_VERSION := v1.6.14
24+
25+
# Uncomment this to have the build_*_?cc/ directories at the top-level
26+
# BUILDS_ROOT := ${CURDIR}/..
27+
28+
# The build is not deterministic; use this to reduce noise when testing
29+
# the installer/ itself
30+
# BUILD_ONLY_ONCE := true

0 commit comments

Comments
 (0)