Makefile.ALL
5.92 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
#!gmake
ifndef SIMTOOLS
SIMTOOLS = ../../..
endif
include $(SIMTOOLS)/makedefs
VPATH = ..
################################################################
# INCLUDE DIRECTORIES
################################################################
INCS = -I.. -I$(SIMTOOLS)/devices/controllers -I$(SIMTOOLS)/cpus/shared $(GLOBAL_INCS) -I$(ROOT)/host_include
################################################################
# DEFINES
################################################################
ifeq ($(CPUSIM),mxs)
DEF1 = -DMIPSY_MXS
endif
DEFS = $(DEF1) $(GLOBAL_DEFS)
ASFLAGS = $(GLOBAL_ASFLAGS)
CFLAGS = $(GLOBAL_CFLAGS)
LDFLAGS = $(GLOBAL_LDFLAGS)
AS_OPTS = $(ASFLAGS) $(DEFS) $(INCS)
CC_OPTS = $(CFLAGS) $(DEFS) $(INCS)
################################################################
# TARGETS
################################################################
C_TARGETS = simmagic.o simmisc.o startup.o faults.o rcp.o nand.o
TARGETS = $(C_TARGETS)
#################################################################
# Archives that are linked in
#################################################################
SUBDIR_PREFIX = SIMOS
ifdef SIMOS64
SUBDIR_PREFIX = SIMOS64
endif
SUBDIR = $(SUBDIR_PREFIX)-$(CPU)
ifeq ($(CPUSIM),mxs)
MIPSYLIB = $(SIMTOOLS)/cpus/mxs/$(SUBDIR)/mxslib.a
else
MIPSYLIB = $(SIMTOOLS)/cpus/mipsy/$(SUBDIR)/mipsylib.a
endif
ifndef NO_EMBRA
EMBRALIB = $(SIMTOOLS)/cpus/embra/$(SUBDIR)/embralib.a \
$(LIBDIR)/vcode.lib.a
EMBRALIB += $(SIMTOOLS)/common/dcg_support/$(SUBDIR)/dcg_support.a
endif
CPULIBS = $(MIPSYLIB) $(EMBRALIB)
CACHELIBS = $(SIMTOOLS)/caches/2Level/$(SUBDIR)/2levellib.a
MEMSYSLIBS = $(SIMTOOLS)/memsystems/flashlite/$(SUBDIR)/flashlitelib.a
MEMSYSLIBS += $(SIMTOOLS)/memsystems/misc/$(SUBDIR)/memsysmisc.a
COMMONLIBS = $(SIMTOOLS)/common/tcl/$(SUBDIR)/tcl.a
COMMONLIBS += $(SIMTOOLS)/common/misc/$(SUBDIR)/misc.a
COMMONLIBS += $(SIMTOOLS)/common/stats/$(SUBDIR)/stats.a
COMMONLIBS += $(SIMTOOLS)/common/symbols/$(SUBDIR)/symbols.a
D_DIR = $(SIMTOOLS)/devices
DEVICES = $(D_DIR)/disk/$(SUBDIR)/disklib.a \
$(D_DIR)/controllers/$(SUBDIR)/controllerlib.a \
$(D_DIR)/network/$(SUBDIR)/networklib.a
ifdef USE_FLASHLITE
MEMSYSLIBS += $(SIMDIR)/$(CPU)/flashlite.a
MEMSYSLIBS += $(SIMDIR)/protocols/dyn_ptr/$(CPU)/protocolLib.a
ifeq ($(CPU), SGI)
MEMSYSLIBS += $(LIBDIR)/libgcc2.7.2.a
endif
endif
ifdef USE_TCL8
LIBTCL = $(LIBDIR)/libtcl8.0.a
else
#LIBTCL = $(LIBDIR)/libtcl7.6.a
LIBTCL = -ltcl
endif
ifdef USE_SESL
LIBSESL = $(LIBDIR)/libsesl.a -lbfd -liberty
else
LIBSESL =
endif
ifdef USE_TRACING
LIBTRACE = $(LIBDIR)/libtrace.a $(LIBDIR)/globals.a $(LIBDIR)/libMipsR.a
else
LIBTRACE =
endif
LIBS = $(CPULIBS) $(CACHELIBS) $(MEMSYSLIBS) $(COMMONLIBS) $(DEVICES) $(LIBTCL) $(LIBSESL) $(LIBTRACE)
ifdef DWARF2
LIBS += $(LIBDIR)/libdwarf.a -lelf
endif
#################################################################
# In order to compile IRIX for the simport, we need to export the
# interface headers to a place where the kernel can read them.
# We assume the ROOT environment variable is set properly.
#
# In the 5.2 based kernels the headers need to go to $ROOT/kern/sys/SIMOS.
# In the 5.3 based kernels they need to got to $ROOT/usr/include/sys/SIMOS.
# Luckily /usr/include/sys/SIMOS does not exist in the 5.2 kernels, so
# try it first and fail over to EXPORTDIR2.
#################################################################
#EXPORTDIR1 = /usr/include/sys/SIMOS
EXPORTDIR1 = $(ROOT)/kern/sys/SIMOS
EXPORTDIR2 = /kern/sys/SIMOS
PPHEADERS = sw_services.h iec.h ospcdefs.h
EXPORTHEADERS = os_interface.h simcp0.h simether.h simhd.h simmp.h \
syslimits.h simdetail.h simfirewall.h simmagic.h \
hw_bcopy.h flashhw.h simprom.h $(PPHEADERS)
COMMONHEADERS = simtypes.h
TARGET = simbb-$(CPU)
.PHONY: warn deps
default: warn
@$(MAKE) -f ../Makefile.ALL deps
@$(MAKE) -f ../Makefile.ALL INCLUDE_DEPS=1 $(TARGET)
simos-SGI: $(TARGETS) $(LIBS) Makefile LinkOutput
$(LD) $(LDFLAGS) -32 -o $(SIMTOOLS)/cpus/simos/$(SUBDIR)/simos $(TARGETS) $(LIBS) -lm -lelfutil
@echo "done."
simos-SGIN32: $(TARGETS) $(LIBS) Makefile LinkOutput
$(LD) $(LDFLAGS) -Wl,-full_got_pages -n32 -o $(SIMTOOLS)/cpus/simos/$(SUBDIR)/simos $(TARGETS) $(LIBS) -lm -lelfutil
@echo "done."
simos64-SGIN32:$(TARGETS) $(LIBS) Makefile LinkOutput
$(LD) $(LDFLAGS) -Wl,-full_got_pages -n32 -o $(SIMTOOLS)/cpus/simos/$(SUBDIR)/simos $(TARGETS) $(LIBS) -lm -lelfutil
@echo "done."
simos-SGIM4: $(TARGETS) $(LIBS) Makefile LinkOutput
$(LD) $(LDFLAGS) -Wl,-full_got_pages -n32 -mips4 -o $(SIMTOOLS)/cpus/simos/$(SUBDIR)/simos $(TARGETS) $(LIBS) -lm
@echo "done."
simos-SUN: $(TARGETS) $(LIBS) Makefile LinkOutput
$(LD) $(LDFLAGS) -o $(SIMTOOLS)/cpus/simos/$(SUBDIR)/simos $(TARGETS) $(LIBS) -lm -lsocket -lnsl -ldl
@echo "done."
simos-ALPHA: $(TARGETS) $(LIBS) Makefile LinkOutput
$(LD) $(LDFLAGS) -o $(SIMTOOLS)/cpus/simos/$(SUBDIR)/simos $(TARGETS) $(LIBS) -lm
@echo "done."
simos-X86: $(TARGETS) $(LIBS) Makefile LinkOutput
$(LD) $(LDFLAGS) -o $(SIMTOOLS)/cpus/simos/$(SUBDIR)/simos $(TARGETS) $(LIBS) -lm -ldl
@echo "done."
simbb-X86: $(TARGETS) $(LIBS) Makefile LinkOutput
$(LD) $(LDFLAGS) -o $(SIMTOOLS)/cpus/simbb/$(SUBDIR)/simos $(TARGETS) $(LIBS) -lm -ldl -L$(ROOT)/host_lib -lecc -lcryptoX86
@echo "done."
simos-X86-solaris: $(TARGETS) $(LIBS) Makefile LinkOutput
$(LD) $(LDFLAGS) -o $(SIMTOOLS)/cpus/simos/$(SUBDIR)/simos $(TARGETS) $(LIBS) -lm -ldl -lsocket -lnsl
@echo "done."
warn:
@echo ""
@echo "Making $(CPU) SIMOS"
@echo " DEFS : `$(FORMAT) $(DEFS)`"
@echo " CFLAGS : `$(FORMAT) $(CFLAGS)`"
@echo ""
LinkOutput:
@echo ""
@echo "Linking $(CPU) SIMOS"
@echo " LDFLAGS : `$(FORMAT) $(LDFLAGS)`"
@echo " LIBS : `$(FORMAT) $(LIBS)`"
$(C_TARGETS): %.o: %.c
@echo "Compiling $(<F)"
$(CC) $(CC_OPTS) -c $<
deps: ${TARGETS:.o=.d}
%.d: %.c
@$(CC) -M $(CC_OPTS) $< > $@
ifdef INCLUDE_DEPS
include ${TARGETS:.o=.d}
endif