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 VALID_TARGETS
= $(sort $(filter-out $(NOBUILD_TARGETS
),$(BASE_TARGETS
) $(ALT_TARGETS
)))
11 # For alt targets, returns their base target name.
12 # For base targets, returns the (same) target name.
13 # param $1 = target name
14 find_target_pair
= $(filter %/$(1),$(BASE_ALT_PAIRS
))
15 get_base_target
= $(if
$(call find_target_pair
,$(1)),$(patsubst %/,%,$(dir $(call find_target_pair
,$(1)))),$(1))
17 UNSUPPORTED_TARGETS
:= \
46 UNIFIED_TARGETS
:= STM32F405 \
54 # Legacy targets are targets that have been replaced by Unified Target configurations
55 LEGACY_TARGETS
:= MATEKF405 \
171 # Temporarily excluded to get CI coverage for USE_SPI_TRANSACTION
174 CI_TARGETS
:= $(UNIFIED_TARGETS
) SITL
176 TARGETS_TOTAL
:= $(words $(CI_TARGETS
))
178 TARGETS_PER_GROUP
:= $(shell expr
$(TARGETS_TOTAL
) / $(TARGET_GROUPS
) )
181 ET
:= $(shell expr
$(ST
) + $(TARGETS_PER_GROUP
))
182 GROUP_1_TARGETS
:= $(wordlist
$(ST
), $(ET
), $(CI_TARGETS
))
184 ST
:= $(shell expr
$(ET
) + 1)
185 ET
:= $(shell expr
$(ST
) + $(TARGETS_PER_GROUP
))
186 GROUP_2_TARGETS
:= $(wordlist
$(ST
), $(ET
), $(CI_TARGETS
))
188 GROUP_OTHER_TARGETS
:= $(filter-out $(GROUP_1_TARGETS
) $(GROUP_2_TARGETS
), $(CI_TARGETS
))