From f26640e6f15964c6cdd12f5f3669c9eb42fe6db9 Mon Sep 17 00:00:00 2001 From: Helmut Buchsbaum Date: Fri, 21 Oct 2022 08:52:28 +0200 Subject: [PATCH] debian: fixup board and scenario detection Using e.g. debuild -eACRN_BOARDLIST= -eACRN_SCENARIOLIST= -eCONFIGDIRS= -- binary builds all board/scenario combinations provided in . Tracked-On: #8246 Signed-off-by: Helmut Buchsbaum --- debian/rules | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/debian/rules b/debian/rules index c3fb2d21c..68583f467 100755 --- a/debian/rules +++ b/debian/rules @@ -44,10 +44,6 @@ export RELEASE ?= 0 debian/configs/configurations.mk: @: -ifeq ($(ACRN_SCENARIOLIST),) -$(error No scenarios defined. Please set ACRN_SCENARIOLIST) -endif - # misc/config_tools/data: contains ACRN supported configuration # debian/configs: add additional, unsupported configurations here! CONFIGDIRS ?= misc/config_tools/data debian/configs @@ -81,13 +77,22 @@ endef # get all XML data $(foreach xml,$(CONFIGXMLS),$(call get-xml-data,$(xml))) -# honor variable ACRN_BOARDLIST +# honor variable ACRN_BOARDLIST by filtering the discovered board configurations accordingly ifneq ($(ACRN_BOARDLIST),) -boardlist := $(sort $(ACRN_BOARDLIST)) +boardlist := $(sort $(filter $(boardlist),$(ACRN_BOARDLIST))) endif -# honor variable ACRN_SCENARIOLIST +# honor variable ACRN_SCENARIOLIST by filtering the discovered scenario configurations +ifneq ($(ACRN_SCENARIOLIST),) $(foreach b,$(boardlist),$(eval scenariolist_$(b) := $(filter $(scenariolist_$(b)),$(ACRN_SCENARIOLIST)))) +endif + +# only keep boards with at least one valid scenario configuration +boardlist := $(foreach b,$(boardlist),$(if $(scenariolist_$(b)),$b)) +# assert nonempty boardlist +ifeq ($(boardlist),) +$(error No valid board/scenario configurations specified/found) +endif # board config name -> board config file bfile = $(abspath $(config_$1))