Skip to content

Commit

Permalink
installer: (re)build firmware, topologies and user space tools
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
marc-hb authored and lgirdwood committed Feb 26, 2021
1 parent f9545c8 commit 4798096
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 7 deletions.
45 changes: 38 additions & 7 deletions installer/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ endif
################################

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

STAGING_SOF ?= staging/sof
Expand All @@ -67,7 +67,7 @@ endif

COMMUNITY := ${STAGING_SOF_VERSION}/community
INTEL_SIGNED := ${STAGING_SOF_VERSION}/intel-signed
${COMMUNITY} ${INTEL_SIGNED}:
${COMMUNITY} ${INTEL_SIGNED} ${BUILDS_ROOT}:
mkdir -p $@


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

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

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

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


BUILD_SOF_RIS := \
${UNSIGNED_list:%=${BUILDS_ROOT}/build_%_${TOOLCHAIN}/sof.ri} \
${SIGNED_list:%=${BUILDS_ROOT}/build_%_${TOOLCHAIN}/sof.ri}

# The build is not deterministic; use this to reduce noise when testing
# this Makefile
ifneq (true,${BUILD_ONLY_ONCE})
.PHONY: ${BUILD_SOF_RIS}
endif

${BUILD_SOF_RIS}: ${BUILDS_ROOT}/build_%_${TOOLCHAIN}/sof.ri: | ${BUILDS_ROOT}
cd ${BUILDS_ROOT} && bdir="$$(dirname $@)" && \
if test -d $${bdir}; then cmake --build $${bdir} -- sof; else \
$(CURDIR)/../scripts/xtensa-build-all.sh $*; fi


########################################
### Stage *.ldc logger dictionaries ###
########################################
Expand All @@ -134,8 +151,8 @@ LDICTS := ${UNSIGNED_list:%=${STAGING_SOF_VERSION}/sof-%.ldc} \
# $(info LDICTS = ${LDICTS})
ldicts: ${LDICTS}
${LDICTS}: ${STAGING_SOF_VERSION}/sof-%.ldc: \
${BUILDS_ROOT}/build_%_${TOOLCHAIN}/sof.ldc
install ${INSTALL_OPTS} $< $@
${BUILDS_ROOT}/build_%_${TOOLCHAIN}/sof.ri
install ${INSTALL_OPTS} ${BUILDS_ROOT}/build_$*_${TOOLCHAIN}/sof.ldc $@


#######################################
Expand Down Expand Up @@ -164,8 +181,13 @@ ${SIGNED_ALIASES}: ${STAGING_SOF_VERSION}/sof-%.ri:
### Stage sof-tplg/ topologies ###
##################################

topologies:
# This requires ./scripts/build-tools.sh -T ...
# The build is not deterministic; use this to reduce noise when testing
# this Makefile
ifneq (true,${BUILD_ONLY_ONCE})
.PHONY: ${BUILD_TOOLS}
endif

topologies: ${BUILD_TOOLS}
install ${INSTALL_OPTS} -t ${STAGING_SOF_TPLG}${VERSION_SUFFIX}/ \
${BUILD_TOOLS}/topology/sof-*.tplg
ifneq (,${VERSION_SUFFIX})
Expand All @@ -176,6 +198,15 @@ endif
@tree ${TREE_OPTS} ${STAGING_SOF_TPLG}${VERSION_SUFFIX} | \
head -n 10; printf '├── ...\n..\n'

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


####################
### Self-Testing ###
Expand Down
7 changes: 7 additions & 0 deletions installer/sample-config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,10 @@
#
# SOF_VERSION := $(shell git describe --tags )
# SOF_VERSION := v1.6.14

# Uncomment this to have the build_*_?cc/ directories at the top-level
# BUILDS_ROOT := ${CURDIR}/..

# The build is not deterministic; use this to reduce noise when testing
# the installer/ itself
# BUILD_ONLY_ONCE := true

0 comments on commit 4798096

Please sign in to comment.