-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmachine.mak
82 lines (77 loc) · 2.24 KB
/
machine.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
# Copyright (C) 2010 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.
define MACHINE_variables
ifneq ($(filter $($(1)_CPU),x86 X86 i386 i486 i586 i686),)
HOST_PLATFORM=PC
$(1)_FAMILY=X86
$(1)_ARCH=32
$(1)_ENDIAN=LITTLE
else ifneq ($(filter $($(1)_CPU),Intel64 amd64 X64),)
HOST_PLATFORM=PC
$(1)_FAMILY=X64
$(1)_ARCH=64
$(1)_ENDIAN=LITTLE
else ifeq ($($(1)__CPU),Power Macintosh)
HOST_PLATFORM=PC
$(1)_FAMILY=PPC
$(1)_ARCH=32
$(1)_ENDIAN=LITTLE
else ifeq ($($(1)_CPU),x86_64)
HOST_PLATFORM=PC
$(1)_FAMILY=x86_64
$(1)_ARCH=64
$(1)_ENDIAN=LITTLE
else ifneq ($(filter $($(1)_CPU),ARM M3 M4 A8 A8F A9 A9F A15 A15F armv7l),)
ifeq ($(HOST_CPU),$($(1)_CPU))
HOST_PLATFORM=DEVBOARD
else
HOST_PLATFORM=PC
endif
$(1)_FAMILY=ARM
$(1)_ARCH=32
$(1)_ENDIAN=LITTLE
else ifneq ($(filter $($(1)_CPU),ARM64 aarch64 A53 A54 A57),)
ifeq ($(HOST_CPU),$($(1)_CPU))
HOST_PLATFORM=DEVBOARD
else
HOST_PLATFORM=PC
endif
$(1)_FAMILY=ARM
$(1)_ARCH=64
$(1)_ENDIAN=LITTLE
else ifneq ($(filter $($(1)_CPU),C6XSIM C64T C64P C64 C66 C674 C67 C67P),)
HOST_PLATFORM=PC
$(1)_FAMILY=DSP
$(1)_ARCH=32
$(1)_ENDIAN=LITTLE
else ifeq ($($(1)_CPU),EVE)
HOST_PLATFORM=PC
$(1)_FAMILY=EVE
$(1)_ARCH=32
$(1)_ENDIAN=LITTLE
else ifeq ($($(1)_CPU),PRU)
HOST_PLATFORM=PC
$(1)_FAMILY=PRU
$(1)_ARCH=32
$(1)_ENDIAN=LITTLE
endif
endef
ifeq ($(HOST_OS),Windows_NT)
$(info Windows Processor Architecture $(PROCESSOR_ARCHITECTURE))
$(info Windows Processor Identification $(word 1, $(PROCESSOR_IDENTIFIER)))
HOST_CPU=$(word 1, $(PROCESSOR_IDENTIFIER))
else
HOST_CPU=$(shell uname -m)
endif
$(eval $(call MACHINE_variables,HOST))