Makefile
4.86 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
#!gmake
#
# DO NOT "make solo", or it will not update the dependency info!
#
ifndef SIMTOOLS
SIMTOOLS = ../..
endif
SOLO = yes
NON_SHARED = -non_shared
include $(SIMTOOLS)/makedefs
################################################################
# Include Files
################################################################
ifdef FLASHPOINT
INCS = -I$(SIMTOOLS)/cpus/simos -I$(SIMTOOLS)/cpus/mipsy \
-I$(SIMTOOLS)/cpus/shared -I$(SIMTOOLS)/caches/2Level -I$(SIMDIR) \
-I$(SIMTOOLS)/memsystems/flashlite -I$(MEMSPY_DIR) $(GLOBAL_INCS)
else
INCS = -I$(SIMTOOLS)/cpus/simos -I$(SIMTOOLS)/cpus/mipsy \
-I$(SIMTOOLS)/cpus/shared -I$(SIMTOOLS)/caches/2Level -I$(SIMDIR) \
-I$(SIMTOOLS)/memsystems/flashlite $(GLOBAL_INCS)
endif
################################################################
# Defines
################################################################
# These start points work fine, but don't allow enough space for big runs
#TEXT_START = 50004000
#DATA_START = 51000000
# These start points leave an additional 256MB of space for address-hungry
# flashlite runs of 64 procs and up..
TEXT_START = 40004000
DATA_START = 41000000
DEFS = -DSOLO -DSOLO_TEXT_START=0x$(TEXT_START)
ifdef FLASHPOINT
DEFS += -DFLASHPOINT
INCS += -I$(MEMSPY_DIR)
endif
GLOBAL_DEFS += -DSIM_MIPS32
ASFLAGS = $(GLOBAL_ASFLAGS) $(GLOBAL_DEFS)
CFLAGS = $(GLOBAL_CFLAGS) $(GLOBAL_DEFS) $(SOLOCFLAGS) -Xcpluscomm
ifdef USE_FLASHLITE
CFLAGS += -DUSE_FLASHLITE
endif
CC_OPTS = $(CFLAGS) $(INCS) $(DEFS)
AS_OPTS = $(ASFLAGS) $(INCS) $(DEFS)
################################################################
# Source files needed during compilation
################################################################
C_TARGETS = solo_main.o solo_anl.o solo_cp0.o solo_extras.o \
syscall.o page.o solo_stubs.o
ASM_TARGETS = sqrt.o solo_asms.o
TARGETS = $(C_TARGETS) $(ASM_TARGETS)
################################################################
# Things that must be linked with solo mipsy
################################################################
MIPSYLIB = $(SIMTOOLS)/cpus/mipsy/SOLO/mipsylib.a
CACHELIBS = $(SIMTOOLS)/caches/2Level/SOLO/2levellib.a
MEMSYSLIBS = $(SIMTOOLS)/memsystems/flashlite/SOLO/flashlitelib.a
MEMSYSLIBS += $(SIMTOOLS)/memsystems/misc/SOLO/memsysmisc.a
SHAREDLIBS = $(SIMTOOLS)/common/misc/SOLO/misc.a
SHAREDLIBS += $(SIMTOOLS)/common/tcl/SOLO/tcl.a
SHAREDLIBS += $(SIMTOOLS)/common/symbols/SOLO/symbols.a
SHAREDLIBS += $(SIMTOOLS)/common/stats/SOLO/stats.a
ifdef FLASHPOINT
FPLIBS = $(MEMSPY_DIR)/memspy_simulator.a
endif
ifdef NON_SHARED
LIB_DIR = /sim/s4/SimOS/build-files/lib/sgi-non-shared
else
LIB_DIR = /sim/s4/SimOS/build-files/lib/sgi-shared
endif
LIBTCL = $(LIB_DIR)/libtcl7.6.a
#ifdef USE_FLASHLITE
MEMSYSLIBS += $(SIMDIR)/SGI/flashlite.a
MEMSYSLIBS += $(SIMDIR)/protocols/dyn_ptr/SGI/protocolLib.a
LIBGCC = /morse/m1/simos/lib/libgcc2.7.2.a
#endif
LDFLAGS = $(GLOBAL_LDFLAGS) -T $(TEXT_START) -D $(DATA_START)
LIBS = $(MIPSYLIB) $(CACHELIBS) $(MEMSYSLIBS) $(SHAREDLIBS) $(LIBTCL) $(LIBGCC) $(FPLIBS)
ifdef PROFILING
LIBS += -lprof
endif
.PHONY: warn deps
default: warn
@$(MAKE) deps
@$(MAKE) INCLUDE_DEPS=1 all
all: solo solo.a supportlib.a
# DO NOT "make solo", or it will not spew the neat debug output
solo: $(TARGETS) $(LIBS) solo.a supportlib.a
@echo "Linking solo..."
$(LD) $(LDFLAGS) -o $@ $(TARGETS) $(LIBS) -lmld -lm
@echo "done."
solo.a: $(TARGETS)
@echo "Building solo library (solo.a) for golden copies..."
@$(AR) cru solo.a $(TARGETS)
warn:
@echo ""
@echo "Making SOLO"
@echo "***********"
@echo "NONSHARED : $(NON_SHARED)"
@echo " DEFS : `$(FORMAT) $(DEFS)`"
@echo " CFLAGS : `$(FORMAT) $(CFLAGS)`"
@echo " LDFLAGS : `$(FORMAT) $(LDFLAGS)`"
@echo " LIBS : `$(FORMAT) $(LIBS)`"
@echo ""
$(C_TARGETS): %.o: %.c %.d
@echo "Compiling $(<F)"
$(CC) $(CC_OPTS) -c $*.c
$(ASM_TARGETS): %.o: %.s
echo "Assembling $(<F)"
$(AS) $(AS_OPTS) -c $< -o $@
# NOTE: Supportlib MUST be created with asm_support.o last, so that
# the libcStart symbol is the last thing in the library!
supportlib.a: asm_support.s c_support.c c.m4.mipsy solo_interface.h
@echo "Making application supportlib.a..."
$(AS) -O2 -non_shared -mips2 -32 -o asm_support.o asm_support.s
$(CC) -O2 -non_shared $(DEFS) -c c_support.c
@\rm -f supportlib.a
ld -r -o supportlib.a c_support.o asm_support.o
clean:
@echo "Making solo clean..."
rm -rf core $(TARGETS) solo solo.a *.d asm_support.o c_support.o supportlib.a
clobber:
@echo "Making solo clobbered..."
rm -rf core $(TARGETS) solo solo.a *.d asm_support.o c_support.o supportlib.a
deps: ${TARGETS:.o=.d}
%.d: %.c
@echo "Finding dependencies of $(<F)"
@$(CC) -M $(CC_OPTS) $< > $@
%.d: %.s
@echo "Finding dependencies of $(<F)"
@$(CC) -M $(CC_OPTS) $< > $@
ifdef INCLUDE_DEPS
include ${TARGETS:.o=.d}
endif