2
# SPIM S20 MIPS Simulator.
5
# Copyright (C) 1990-2000 by James Larus (larus@cs.wisc.edu).
8
# SPIM is distributed under the following conditions:
10
# You may make copies of SPIM for your own use and modify those copies.
12
# All copies of SPIM must retain my name and copyright notice.
14
# You may not sell SPIM or distributed SPIM in conjunction with a commerical
15
# product or service without the expressed written consent of James Larus.
17
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
18
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
19
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
30
# To make xpsim, type:
36
# To verify spim works, type:
43
# The following parameters must be set for the target machine:
48
# Full path for directory containing X11 include files:
49
X_INCLUDE_DIR=/usr/X11/include
52
# Location of X11 root directory.
56
# Full path for directory that will hold the trap handler file:
59
# Full path for the directory that will hold the executable files:
60
BIN_DIR = /usr/unsup/bin
62
# Full path for the directory that will hold the man files:
63
MAN_DIR = /usr/unsup/man
66
# Full path for the trap handler file:
67
TRAP_PATH = \"$(TRAP_DIR)/trap.handler\"
69
# If you have flex, use it instead of lex. If you use flex, define this
70
# variable and set LEXFLAGS.
73
# SPIM needs flex's -I flag since the scanner is used interactively.
74
# You can set the -8 flag so that funny characters do not hang the scanner.
78
# If you use lex, set the variables this way:
83
# Size of the segments when spim starts up (data segment must be >= 64K).
84
# (These sizes are fine for most users since SPIM dynamically expands
85
# the memory as necessary.)
86
MEM_SIZES = -DTEXT_SIZE=65536 -DDATA_SIZE=131072 -DK_TEXT_SIZE=65536
94
DEFINES = $(ENDIAN) $(MEM_SIZES) -DDEFAULT_TRAP_HANDLER=$(TRAP_PATH) -DSPIM_VERSION="\"`cat VERSION`\""
98
IFLAGS = -I$(X_INCLUDE_DIR)
102
XLDFLAGS = -L$(TOPDIR)/lib -lXaw -lXmu -lXt -lXext -lX11
105
# lex.yy.c is usually compiled with -O to speed it up.
111
OBJS = spim-utils.o run.o mem.o inst.o data.o sym-tbl.o y.tab.o lex.yy.o \
112
mips-syscall.o display-utils.o
115
XOBJS = windows.o buttons.o
118
ENDIAN=`cat configuration`
123
make -f Makefile.std spim2
125
spim2: $(OBJS) spim.o
126
$(CC) -g $(OBJS) spim.o $(LDFLAGS) -o spim -lm
131
make -f Makefile.std xspim2
133
xspim2: $(OBJS) $(XOBJS) xspim.o
134
$(CC) -g $(OBJS) $(XOBJS) xspim.o $(LDFLAGS) $(XLDFLAGS) -o xspim -lm
144
# Test spim with a torture test:
148
/bin/rm -f Tests/tt.out std_out new_out
150
$(CSH) -c "./spim -bare -notrap -file Tests/tt.bare.s >& Tests/tt.out"
151
tail +6 Tests/tt.bare.OK > std_out
152
tail +6 Tests/tt.out > new_out
153
@echo The next command should not produce any output:
157
/bin/rm -f Tests/tt.out std_out new_out
159
@if [ ! -f $(TRAP_DIR)/trap.handler ]; then echo "Trap Handler not installed; do make install"; exit 1; else true; fi
160
@if diff trap.handler $(TRAP_DIR)/trap.handler > /dev/null ; then true ; else echo "Old trap_handler installed. Type: make install" ; exit 1; fi
161
$(CSH) -c "./spim -file Tests/tt.s < Tests/tt.in >& Tests/tt.out"
162
tail +6 Tests/tt.OK > std_out
163
tail +6 Tests/tt.out > new_out
164
@echo The next command should not produce any output:
168
/bin/rm -f Tests/tt.out std_out new_out
170
# This test currently only works for little-endian machines. The file
171
# tt.alu.bare.s needs to be converted in places for big-endian machines.
174
$(CSH) -c "./spim -bare -notrap -file Tests/tt.alu.bare.s >& Tests/tt.out"
175
tail +6 Tests/tt.alu.bare.OK > std_out
176
tail +6 Tests/tt.out > new_out
177
@echo The next command should not produce any output:
181
/bin/rm -f Tests/tt.out std_out new_out
183
$(CSH) -c "./spim -bare -notrap -file Tests/tt.fpu.bare.s >& Tests/tt.out"
184
tail +6 Tests/tt.fpu.bare.OK > std_out
185
tail +6 Tests/tt.out > new_out
186
@echo The next command should not produce any output:
189
/bin/rm -f Tests/tt.out std_out new_out
193
TAGS: *.c *.h *.l *.y
194
etags *.l *.y *.c *.h
198
rm -f spim xspim *.o y.output core a.out TAGS \
200
spim.tar.* spim.aux spim.log spim.dvi spim.shar*
203
install -c -s spim $(BIN_DIR)
204
install -c -s xspim $(BIN_DIR)
205
install -c -m 0444 trap.handler $(TRAP_DIR)
206
install -c -m 0444 spim.man $(MAN_DIR)
207
install -c -m 0444 xspim.man $(MAN_DIR)
210
rm -f y.tab.h y.tab.c lex.yy.c spim.tar* Documentation/spim.ps
213
SRC = spim-utils.c run.c mem.c inst.c data.c sym-tbl.c y.tab.o lex.yy.o \
216
XSRC = windows.c buttons.c
220
# Dependences not handled well by makedepend:
227
yacc $(YFLAGS) parser.y
230
$(CC) $(IFLAGS) $(CFLAGS) $(YCFLAGS) -c y.tab.c
234
$(MYLEX) $(LEXFLAGS) scanner.l
237
$(CC) $(IFLAGS) $(LEXCFLAGS) -c lex.yy.c
241
# DO NOT DELETE THIS LINE -- make depend depends on it.
244
buttons.o: spim-utils.h
273
lex.yy.o: spim-utils.h
285
mips-syscall.o: spim.h
286
mips-syscall.o: inst.h
287
mips-syscall.o: mem.h
288
mips-syscall.o: reg.h
289
mips-syscall.o: sym-tbl.h
290
mips-syscall.o: spim-syscall.h
291
mips-syscall.o: mips-syscall.h
299
run.o: mips-syscall.h
302
spim-utils.o: spim-utils.h
307
spim-utils.o: scanner.h
308
spim-utils.o: parser.h
309
spim-utils.o: y.tab.h
311
spim-utils.o: sym-tbl.h
322
sym-tbl.o: spim-utils.h
329
windows.o: spim-utils.h
334
xspim.o: spim-utils.h
343
y.tab.o: spim-utils.h
352
parser.o: spim-utils.h
361
scanner.o: spim-utils.h