-
Notifications
You must be signed in to change notification settings - Fork 1
/
flags.mk
125 lines (112 loc) · 2.8 KB
/
flags.mk
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# Architecture flags
# ------------------
arch_tgts :=
arch_tgts_u := ppc-rtems-rce405 ppc-rtems-ml405 i386-linux x86_64-linux x86_64-rhel6 x86_64-rhel7 sparc-solaris
arch_opts := opt dbg
src_arch := $(shell uname -r)
ifneq ($(findstring el7,$(src_arch)),)
arch_tgts_q := $(filter-out i386-linux x86_64-linux x86_64-rhel6,$(arch_tgts_u))
else
ifneq ($(findstring el6,$(src_arch)),)
arch_tgts_q := $(filter-out i386-linux x86_64-linux x86_64-rhel7,$(arch_tgts_u))
else
ifneq ($(findstring el5,$(src_arch)),)
arch_tgts_q := $(filter-out x86_64-rhel6 x86_64-rhel7,$(arch_tgts_u))
else
arch_tgts_q := $(arch_tgts_u)
endif
endif
endif
define arch_opt_template
arch_tgts += $$(addsuffix -$(1),$$(arch_tgts_q))
endef
$(foreach opt,$(arch_opts),$(eval $(call arch_opt_template,$(opt))))
# i386 Linux specific flags
ifneq ($(findstring i386-linux,$(tgt_arch)),)
AS := as
CPP := gcc -E
CC := gcc
CXX := g++
LD := g++
LX := g++
LIBEXTNS := so
DEPFLAGS := -MM
DEFINES := -fPIC -D_REENTRANT -D__pentium__ -Wall
CPPFLAGS :=
CFLAGS := -m32
CXXFLAGS := $(CFLAGS)
CASFLAGS := -x assembler-with-cpp -P $(CFLAGS)
LDFLAGS := -m32 -shared
LXFLAGS := -m32
USRLIBDIR := /usr/lib
else
ifneq ($(findstring x86_64,$(tgt_arch)),)
AS := as
CPP := gcc -E
CC := gcc
CXX := g++
LD := g++
LX := g++
LIBEXTNS := so
DEPFLAGS := -MM
DEFINES := -fPIC -D_REENTRANT -D__pentium__ -Wall
CPPFLAGS :=
CFLAGS := -m64
CXXFLAGS := $(CFLAGS)
CASFLAGS := -x assembler-with-cpp -P $(CFLAGS)
LDFLAGS := -m64 -shared
LXFLAGS := -m64
USRLIBDIR := /usr/lib64
else
# Sparc Solaris specific flags
ifneq ($(findstring sparc-solaris,$(tgt_arch)),)
AS := as
CPP := gcc -E
CC := gcc
CXX := g++
LD := g++
LX := g++
LIBEXTNS := so
DEPFLAGS := -MM
DEFINES := -fPIC -D_REENTRANT -Wall
CPPFLAGS :=
CFLAGS :=
CXXFLAGS := $(CFLAGS)
CASFLAGS := -x assembler-with-cpp -P $(CFLAGS)
LDFLAGS := -shared
LXFLAGS :=
else
# PowerPC RTEMS specific flags
ifneq ($(findstring ppc-rtems,$(tgt_arch)),)
AS := powerpc-rtems-as
CPP := powerpc-rtems-cpp
CC := powerpc-rtems-gcc
CXX := powerpc-rtems-g++
LD := powerpc-rtems-ld
LX := powerpc-rtems-g++
ifneq ($(findstring ppc-rtems-rce405,$(tgt_arch)),)
RTEMSDIR := $(RELEASE_DIR)/build/rtems/target/powerpc-rtems/rce405/lib
endif
ifneq ($(findstring ppc-rtems-ml405,$(tgt_arch)),)
RTEMSDIR := $(RELEASE_DIR)/build/rtems/target/powerpc-rtems/ml405/lib
endif
LIBEXTNS := a
DEPFLAGS := -B$(RTEMSDIR) -MM
DEFINES := -Dppc405 -mcpu=403 -Wall
CPPFLAGS :=
CFLAGS := -B$(RTEMSDIR) -specs bsp_specs -qrtems
CXXFLAGS := $(CFLAGS)
CASFLAGS := -x assembler-with-cpp -P $(CFLAGS)
LDFLAGS := -r
LXFLAGS := -B$(RTEMSDIR) -specs bsp_specs -qrtems
MANAGERS := timer sem msg event signal part region dpmem io rtmon ext mp
endif
endif
endif
endif
ifneq ($(findstring -opt,$(tgt_arch)),)
DEFINES += -O4
endif
ifneq ($(findstring -dbg,$(tgt_arch)),)
DEFINES += -g
endif