makedefs
6.21 KB
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
ifndef CPU
CPU = X86
endif
################################################################
# Tool definitions
################################################################
AR = ar
# Change the "CC" variables as needed for your platform. We
# currently choose "cc" if you are on an SGI machine and "gcc"
# otherwise.
CC = gcc
ifeq ($(CPU),SGI)
CC = cc
endif
ifeq ($(CPU),SGIN32)
CC = cc
endif
ifeq ($(CPU),SGIM4)
CC = cc
endif
INSTALL = install
LD = $(CC)
SHELL = /bin/sh
FORMAT = echo
#FORMAT = $(SIMTOOLS)/apps/scripts/format.prl
JOBS = 4
#MAKE = gmake -j $(JOBS)
# Comment this out to get the normal make output
.SILENT:
################################################################
# Flags to be used by all
################################################################
#USE_FLASHLITE = Yes
#
# Do we wish to use the Simos External Symbol Library, instead
# of Simos's internal symbols (is sometimes faster and supports
# more targets, but adds 2-3Mb to the executable)
#USE_SESL = Yes
#
# Do we need only to support 32bit mips apps?
# Currently is only the default on 64bit machines like ALPHA
ifdef SOLO
USE_FLASHLITE = Yes
NO_EMBRA = True
SOLOCFLAGS = -DSOLO -DMIPSY_DEBUG -DDATA_HANDLING
SOLOCFLAGS += -DDEBUG_SYSCALL -DANL_DEBUG -Xcpluscomm
#SOLOCFLAGS += -DDEBUG_DATA -DDEBUG_DATA_VERBOSE
#SOLOFLAGS += -DDEBUG_DATA_CHECK -DDEBUG_SYSCALL
endif
ifdef FLASHPOINT
SOLOCFLAGS += -DFLASHPOINT
endif
# Compile time switches for simos. Currently we support:
# CPUSIM = (mipsy|mxs) - Compile time selection between mipsy and mxs.
# USE_FLASHLITE = Yes - Linked with the flashlite memsys simulator.
# USE_TCL8 = TRUE - Use tcl8.0 with bytecode compiler
# (default is tcl7.6, interpreted)
ifndef CPUSIM
# Default for CPUSIM is mipsy. Although it is possible to run in mipsy
# with (CPUSIM = mxs) it is slower.
#CPUSIM = mxs
CPUSIM = mipsy
endif
#
# Use tcl8.0 instead of 7.6
#
#USE_TCL8 = TRUE
# NOTE: On the SGIs, profiling only works with non-shared versions
ifeq ($(CPU),SGI)
#PROFILING = TRUE
#NON_SHARED = -non_shared
else
NON_SHARED =
endif
# on the SGIs, flashlite only works with nonshared compilation.
# on the SUNs, it works only with shared compilation.
# shared is the default, so we change to nonshared on SGIs.
ifdef USE_FLASHLITE
ifeq ($(CPU),SGI)
NON_SHARED = -non_shared
endif
endif
#################################################################
# Set up the directory where libraries will be linked from
#################################################################
ifndef LIBDIRBASE
#LIBDIRBASE = $(SIMOS_DIR)/build-files/lib
LIBDIRBASE = $(SIMOS_DIR)/BUILD
endif
ifdef NON_SHARED
DIRSUFFIX = non-shared
else
DIRSUFFIX = shared
endif
ifeq ($(CPU),SUN)
LIBDIR = $(LIBDIRBASE)/sparc-$(DIRSUFFIX)
endif
ifeq ($(CPU),SGI)
LIBDIR = $(LIBDIRBASE)/sgi-$(DIRSUFFIX)
endif
ifeq ($(CPU),SGIN32)
LIBDIR = $(LIBDIRBASE)/sgin32-$(DIRSUFFIX)
endif
ifeq ($(CPU),SGIM4)
# Note: use the same libraries as n32
LIBDIR = $(LIBDIRBASE)/sgin32-$(DIRSUFFIX)
endif
ifeq ($(CPU),ALPHA)
LIBDIR = $(LIBDIRBASE)/alpha-$(DIRSUFFIX)
endif
ifeq ($(CPU),X86)
LIBDIR = $(LIBDIRBASE)/x86-$(DIRSUFFIX)
endif
################################################################
# Defines
################################################################
ifdef PROFILING
D1 = -DPROFILING -G 0
endif
ifeq ($(CPU),SUN)
NO_EMBRA = True
NO_DCG = True
endif
ifeq ($(CPU),ALPHA)
NO_EMBRA = True
endif
ifeq ($(CPU),X86)
NO_EMBRA = True
endif
ifeq ($(CPU),SGI)
#MISC_DEFINES += -DPRINT_INSTRUCTIONS
endif
ifdef NO_EMBRA
MISC_DEFINES += -DNO_EMBRA
endif
ifdef TCLCOMPILER
MISC_DEFINES += -DTCLCOMPILER
endif
ifdef USE_FLASHLITE
MISC_DEFINES += -DDATA_HANDLING
endif
ifdef USE_VISTA_SDF
MISC_DEFINES += -DUSE_VISTA_SDF=1
endif
ifdef TRACING
MISC_DEFINES += -DTRACING=1
endif
#EJS for linux
#MISC_DEFINES += -DBOOT_LINUX
#BENW - and for NT
#MISC_DEFINES += -DBOOT_NT
ifdef DIGITAL_TRACE
MISC_DEFINES += -DDIGITAL_TRACE=1
endif
################################################################
# Figure out which architecture we want to simulate
################################################################
ifeq ($(SIM_ARCH),X86)
ARCH_DEFINE = -DSIM_X86
MISC_DEFINES += -DDATA_HANDLING
# Some linux platforms don't define this!
MISC_DEFINES += -DLITTLE_ENDIAN
endif
ifeq ($(SIM_ARCH),MIPS32)
ARCH_DEFINE = -DSIM_MIPS32
endif
ifeq ($(SIM_ARCH),MIPS64)
ARCH_DEFINE = -DSIM_MIPS64
endif
ifeq ($(SIM_ARCH),ALPHA)
ARCH_DEFINE = -DSIM_ALPHA
endif
MISC_DEFINES += $(ARCH_DEFINE)
ifeq ($(SIM_ARCH),MIPS64)
#MISC_DEFINES += -DIRIX6_4
#MISC_DEFINES += -DSIM_ORIGIN
endif
#MISC_DEFINES += -DDEBUG_INTR
GLOBAL_DEFS = $(D1) $(D2) $(D3) $(D4) $(MISC_DEFINES)
GLOBAL_INCS = -I$(SIMTOOLS)/common/misc -I$(SIMTOOLS)/common/stats \
-I$(SIMTOOLS)/common/machine \
-I$(SIMTOOLS)/common/tcl \
-I$(SIMTOOLS)/devices/controllers
ifdef DIGITAL_TRACE
GLOBAL_INCS += -I$(DIGITAL_TRACE_DIR)
endif
BINARY_TYPE = $(NON_SHARED)
OPTIMIZATION = -g3 -O2
GCC_OPTIMIZATION = -g3 -O2
GCC_WARNINGS = -Wall
WARNINGS = -W -Wimplicit -Wreturn-type -Wunused -Wswitch -Wcomment \
-Wuninitialized -Wparentheses
#DWARF2 = yes
ifdef DWARF2
GLOBAL_DEFS += -DDWARF2
endif
ifeq ($(CPU),SGIN32)
# 1172="Parameter not used", 1209="while(1)"
CC_WARNINGS = -fullwarn -woff 1174,1209,1048
#OPTIMIZATION = -g3 -O2
OPTIMIZATION = -g
CC_FLAGS = $(CC_WARNINGS) $(OPTIMIZATION) $(BINARY_TYPE) -n32 -mips3
GLOBAL_ASFLAGS = $(OPTIMIZATION) $(BINARY_TYPE) -n32 -mips3
else
ifeq ($(CPU),SGIM4)
OPTIMIZATION = -O3
#OPTIMIZATION = -g
CC_WARNINGS = -fullwarn -woff 1174,1209,1048
CC_FLAGS = $(CC_WARNINGS) $(OPTIMIZATION) $(BINARY_TYPE) -n32 -mips4
GLOBAL_ASFLAGS = $(OPTIMIZATION) $(BINARY_TYPE) -64 -mips4
else
CC_WARNINGS = -wlint,-vf -woff 813,814,820,821,822,826,827,847
CC_FLAGS = $(CC_WARNINGS) $(OPTIMIZATION) $(BINARY_TYPE) -mips2
GLOBAL_ASFLAGS = $(OPTIMIZATION) $(BINARY_TYPE) -acpp -mips2
endif
endif
GCC_FLAGS = $(GCC_WARNINGS) $(GCC_OPTIMIZATION) $(BINARY_TYPE)
ifeq ($(CC),cc)
GLOBAL_CFLAGS = $(CC_FLAGS)
else
GLOBAL_CFLAGS = $(GCC_FLAGS)
endif
GLOBAL_LDFLAGS = $(NON_SHARED)
ifdef PROFILING
GLOBAL_LDFLAGS += -p
endif