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 \
87 # Legacy targets are targets that have been replaced by Unified Target configurations
88 LEGACY_TARGETS
:= MATEKF405 \
204 # Temporarily excluded to get CI coverage for USE_SPI_TRANSACTION
207 CI_TARGETS
:= $(filter-out $(LEGACY_TARGETS
) $(UNSUPPORTED_TARGETS
), $(VALID_TARGETS
))
209 TARGETS_TOTAL
:= $(words $(CI_TARGETS
))
211 TARGETS_PER_GROUP
:= $(shell expr
$(TARGETS_TOTAL
) / $(TARGET_GROUPS
) )
214 ET
:= $(shell expr
$(ST
) + $(TARGETS_PER_GROUP
))
215 GROUP_1_TARGETS
:= $(wordlist
$(ST
), $(ET
), $(CI_TARGETS
))
217 ST
:= $(shell expr
$(ET
) + 1)
218 ET
:= $(shell expr
$(ST
) + $(TARGETS_PER_GROUP
))
219 GROUP_2_TARGETS
:= $(wordlist
$(ST
), $(ET
), $(CI_TARGETS
))
221 GROUP_OTHER_TARGETS
:= $(filter-out $(GROUP_1_TARGETS
) $(GROUP_2_TARGETS
), $(CI_TARGETS
))