-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makerules.env
108 lines (100 loc) · 3.18 KB
/
Makerules.env
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#*******************************************************************************
# $Id: Makerules.env,v 2.34 2009-04-10 04:27:33 $
# Top-level Makerules for defining environment variables
# can be included by anyone doing software at Epigram
#*******************************************************************************
# HOSTOS is either unix or Windows_NT.
# HOSTENV differentiates HOSTOS and is either freebsd, sun4, or Windows_NT.
# This refers to the *BUILD* environment. All environments use "GNU C"
# except Windows_NT which may use "GNU C" or "Microsoft C".
ifndef HOSTENV
# Figure what type of host we are in.
UNAME = $(shell uname)
HOSTENV = android
HOSTOS = unix
endif
# In case we just defined them, make sure they are known
export HOSTENV
export HOSTOS
# TARGETENV is one of freebsd, sun4, linux, linuxarm, android, linuxmips, linuxmips_be, cygwin32, win32, or macos
# TARGETENV defaults to HOSTENV unless HOSTENV is Windows_NT, in
# which case it defaults to win32.
ifndef TARGETENV
ifeq ($(HOSTENV), Windows_NT)
TARGETENV = win32
else
TARGETENV = $(HOSTENV)
endif
endif
export TARGETENV
# TARGETOS defaults to HOSTOS in most cases
ifneq ($(findstring "$(TARGETENV)", "freebsd" "linux" "linuxarm" "linuxarm_le" "android" "linuxmips" "linux26mips" "linuxmips_be" "sun4" "cygwin32" "win32" "macos"), )
TARGETOS = $(HOSTOS)
endif
ifeq ($(TARGETENV), bcmmips)
TARGETOS = bcmmips
endif
ifeq ($(TARGETENV), klsi)
TARGETOS = klsi
endif
ifeq ($(TARGETENV), nucleusarm)
TARGETOS = nucleus
endif
ifndef TARGETOS
TARGETOS = unknown
endif
export TARGETOS
# TARGETARCH is the target processor architecture
# Currently valid values are: x86, x86_mmx, sparc, unknown, or a list of any
# of the valid values.
# For the x86* family, a generic x86 is assuemd if not otherwise specified
# Order is important since "linux" matches both linuxmips and linux.
ifndef TARGETARCH
ifneq ($(findstring "$(TARGETENV)", "android"), )
TARGETARCH = arm_android
endif
ifneq ($(findstring "$(TARGETENV)", "linuxarm_le"), )
TARGETARCH = arm_le
endif
ifneq ($(findstring "$(TARGETENV)", "linuxarm nucleusarm"), )
TARGETARCH = arm
endif
ifneq ($(findstring "$(TARGETENV)", "bcmmips" "linuxmips" "linuxmips_be" "linux26mips"), )
TARGETARCH = mips
endif
ifneq ($(findstring "$(TARGETENV)", "sun4"), )
TARGETARCH = sparc
endif
ifneq ($(findstring "$(TARGETENV)", "freebsd" "linux" "cygwin32" "win32"), )
TARGETCPU = $(shell uname -m)
ifneq ($(findstring "$(TARGETCPU)", "sparc" "sparc64"), )
TARGETARCH = $(TARGETCPU)
else
TARGETARCH = x86_mmx
endif
endif
ifeq ($(TARGETENV), macos)
TARGETCPU = $(shell uname -p)
ifneq ($(findstring "$(TARGETCPU)", "powerpc"), )
TARGETARCH = PPC
else
TARGETARCH = x86
endif
endif
ifeq ($(TARGETENV), klsi)
TARGETARCH = klsi
endif
ifndef TARGETARCH
TARGETARCH = unknown
endif
endif
export TARGETARCH
# TARGET_TYPE is either "all" or one or more of: float64, float32, int16
# default is int16. "all" will get expanded into a list of all possible types
ifndef TARGET_TYPE
TARGET_TYPE = int16
endif
ifeq ($(TARGET_TYPE), all)
TARGET_TYPE = int16 float32 float64
endif
export TARGET_TYPE