1 ALT_TARGET_PATHS
= $(filter-out %/target
,$(basename $(wildcard $(ROOT
)/src
/main
/target
/*/*.mk
)))
2 ALT_TARGET_NAMES
= $(notdir $(ALT_TARGET_PATHS
))
3 BASE_TARGET_NAMES
= $(notdir $(patsubst %/,%,$(dir $(ALT_TARGET_PATHS
))))
4 BASE_ALT_PAIRS
= $(join $(BASE_TARGET_NAMES
:=/),$(ALT_TARGET_NAMES
))
6 ALT_TARGETS
= $(sort $(notdir $(BASE_ALT_PAIRS
)))
7 BASE_TARGETS
= $(sort $(notdir $(patsubst %/,%,$(dir $(wildcard $(ROOT
)/src
/main
/target
/*/target.mk
)))))
8 NOBUILD_TARGETS
= $(sort $(filter-out target
,$(basename $(notdir $(wildcard $(ROOT
)/src
/main
/target
/*/*.nomk
)))))
9 OPBL_TARGETS
= $(sort $(filter %_OPBL
,$(ALT_TARGETS
)))
10 VALID_TARGETS
= $(sort $(filter-out $(NOBUILD_TARGETS
),$(BASE_TARGETS
) $(ALT_TARGETS
)))
12 # For alt targets, returns their base target name.
13 # For base targets, returns the (same) target name.
14 # param $1 = target name
15 find_target_pair
= $(filter %/$(1),$(BASE_ALT_PAIRS
))
16 get_base_target
= $(if
$(call find_target_pair
,$(1)),$(patsubst %/,%,$(dir $(call find_target_pair
,$(1)))),$(1))
18 UNSUPPORTED_TARGETS
:= \
82 UNIFIED_TARGETS
:= STM32F405 \
89 # Legacy targets are targets that have been replaced by Unified Target configurations
90 LEGACY_TARGETS
:= MATEKF405 \
206 # Temporarily excluded to get CI coverage for USE_SPI_TRANSACTION
209 CI_TARGETS
:= $(filter-out $(LEGACY_TARGETS
) $(UNSUPPORTED_TARGETS
), $(VALID_TARGETS
))
211 TARGETS_TOTAL
:= $(words $(CI_TARGETS
))
213 TARGETS_PER_GROUP
:= $(shell expr
$(TARGETS_TOTAL
) / $(TARGET_GROUPS
) )
216 ET
:= $(shell expr
$(ST
) + $(TARGETS_PER_GROUP
))
217 GROUP_1_TARGETS
:= $(wordlist
$(ST
), $(ET
), $(CI_TARGETS
))
219 ST
:= $(shell expr
$(ET
) + 1)
220 ET
:= $(shell expr
$(ST
) + $(TARGETS_PER_GROUP
))
221 GROUP_2_TARGETS
:= $(wordlist
$(ST
), $(ET
), $(CI_TARGETS
))
223 GROUP_OTHER_TARGETS
:= $(filter-out $(GROUP_1_TARGETS
) $(GROUP_2_TARGETS
), $(CI_TARGETS
))