-
Notifications
You must be signed in to change notification settings - Fork 5
/
combo_filters.mak
88 lines (74 loc) · 3.11 KB
/
combo_filters.mak
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# Copyright (C) 2013 Erik Rainey
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Any OS can build itself and maybe some secondary OS's
ifeq ($(SHOW_MAKEDEBUG),1)
$(info Starting COMBOS:)
$(foreach combo,$(TARGET_COMBOS),$(info TARGET_COMBOS+=$(combo)))
endif
ifeq ($(HOST_PLATFORM),PC)
ifneq ($(HOST_CPU),ARM)
# DEVBOARD ARM is self-hosting
TARGET_COMBOS := $(call FILTER_OUT_COMBO,DEVBOARD)
endif
ifeq ($(HOST_FAMILY),X86)
TARGET_COMBOS := $(call FILTER_OUT_COMBO,x86_64)
endif
ifeq ($(HOST_OS),LINUX)
TARGET_COMBOS := $(call FILTER_COMBO,LINUX SYSBIOS __QNX__ NO_OS)
else ifneq ($(filter $(HOST_OS),CYGWIN DARWIN),)
TARGET_COMBOS := $(call FILTER_COMBO,$(HOST_OS))
else ifeq ($(HOST_OS),Windows_NT)
TARGET_COMBOS := $(call FILTER_COMBO,$(HOST_OS) SYSBIOS NO_OS)
endif
else ifeq ($(HOST_PLATFORM),DEVBOARD)
TARGET_COMBOS := $(call FILTER_COMBO,$(HOST_PLATFORM))
endif
# If the platform is set, remove others which are not on that platform.
ifneq ($(filter $(origin TARGET_PLATFORM),environment command),)
$(info Keep only $(TARGET_PLATFORM) platform in TARGET_COMBOS)
TARGET_COMBOS := $(call FILTER_COMBO,$(TARGET_PLATFORM))
endif
# If the OS is set, remove others which are not on that OS.
ifneq ($(filter $(origin TARGET_OS),environment command),)
$(info Keep only $(TARGET_OS) OS in TARGET_COMBOS)
TARGET_COMBOS := $(call FILTER_COMBO,$(TARGET_OS))
endif
# If the CPU is set, remove others which are not on that CPU.
ifneq ($(filter $(origin TARGET_CPU),environment command),)
$(info Keep only $(TARGET_CPU) CPU in TARGET_COMBOS)
TARGET_COMBOS := $(call FILTER_COMBO,$(TARGET_CPU))
endif
# If the BUILD is set, remove others which are not on that BUILD
ifneq ($(filter $(origin TARGET_BUILD),environment command),)
$(info Keep only $(TARGET_BUILD) BUILDS in TARGET_COMBOS)
TARGET_COMBOS := $(call FILTER_COMBO,$(TARGET_BUILD))
endif
# The compilers which must have roots set.
COMPILER_ROOTS := TIARMCGT_ROOT TMS470_ROOT CGT6X_ROOT CGTPRU_ROOT
ifeq ($(HOST_OS),Windows_NT)
COMPILER_ROOTS += GCC_ROOT
endif
ifeq ($(SHOW_MAKEDEBUG),1)
$(foreach root,$(COMPILER_ROOTS),$(info $(origin $(root)) $(root)=$(value $(root))))
endif
# The compiler which do not have roots set.
REMOVE_ROOTS := $(foreach root,$(COMPILER_ROOTS),$(if $(filter $(origin $(root)),undefined),$(root)))
# Remove the list of combos which can not be built
TARGET_COMBOS := $(call FILTER_OUT_COMBO,$(foreach root,$(REMOVE_ROOTS),$(subst _ROOT,,$(root))))
TARGET_COMBOS := $(strip $(TARGET_COMBOS))
ifeq ($(SHOW_MAKEDEBUG),1)
$(info Remaining COMBOS:)
$(foreach combo,$(TARGET_COMBOS),$(info TARGET_COMBOS+=$(combo)))
endif
$(if $(strip $(TARGET_COMBOS)),,$(error No TARGET_COMBOS remain! Nothing to make))