~ubuntu-branches/ubuntu/jaunty/spim/jaunty

« back to all changes in this revision

Viewing changes to Makefile.std

  • Committer: Bazaar Package Importer
  • Author(s): Fernando Sanchez
  • Date: 2001-01-24 14:05:34 UTC
  • Revision ID: james.westby@ubuntu.com-20010124140534-3le9wmofforjjcd8
Tags: upstream-6.3
ImportĀ upstreamĀ versionĀ 6.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# SPIM S20 MIPS Simulator.
 
3
# Makefile for SPIM.
 
4
#
 
5
# Copyright (C) 1990-2000 by James Larus (larus@cs.wisc.edu).
 
6
# ALL RIGHTS RESERVED.
 
7
#
 
8
# SPIM is distributed under the following conditions:
 
9
#
 
10
#   You may make copies of SPIM for your own use and modify those copies.
 
11
#
 
12
#   All copies of SPIM must retain my name and copyright notice.
 
13
#
 
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.
 
16
#
 
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
 
20
# PURPOSE.
 
21
#
 
22
# $Header: $
 
23
 
 
24
 
 
25
#
 
26
# To make spim, type:
 
27
#
 
28
#   make spim
 
29
#
 
30
# To make xpsim, type:
 
31
#
 
32
#   make xspim
 
33
#
 
34
 
 
35
#
 
36
# To verify spim works, type:
 
37
#
 
38
#   make test
 
39
#
 
40
 
 
41
 
 
42
#
 
43
# The following parameters must be set for the target machine:
 
44
#
 
45
#
 
46
 
 
47
 
 
48
# Full path for directory containing X11 include files:
 
49
X_INCLUDE_DIR=/usr/X11/include
 
50
 
 
51
 
 
52
# Location of X11 root directory.
 
53
TOPDIR = /usr/X11
 
54
 
 
55
 
 
56
# Full path for directory that will hold the trap handler file:
 
57
TRAP_DIR = .
 
58
 
 
59
# Full path for the directory that will hold the executable files:
 
60
BIN_DIR = /usr/unsup/bin
 
61
 
 
62
# Full path for the directory that will hold the man files:
 
63
MAN_DIR = /usr/unsup/man
 
64
 
 
65
 
 
66
# Full path for the trap handler file:
 
67
TRAP_PATH = \"$(TRAP_DIR)/trap.handler\"
 
68
 
 
69
# If you have flex, use it instead of lex.  If you use flex, define this
 
70
# variable and set LEXFLAGS.
 
71
MYLEX = flex
 
72
 
 
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.
 
75
LEXFLAGS = -I -8
 
76
 
 
77
 
 
78
# If you use lex, set the variables this way:
 
79
#MYLEX = lex
 
80
#LEXFLAGS =
 
81
 
 
82
 
 
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
 
87
 
 
88
 
 
89
#
 
90
# End of parameters
 
91
#
 
92
 
 
93
 
 
94
DEFINES = $(ENDIAN) $(MEM_SIZES) -DDEFAULT_TRAP_HANDLER=$(TRAP_PATH) -DSPIM_VERSION="\"`cat VERSION`\""
 
95
 
 
96
CC = cc
 
97
CFLAGS = $(DEFINES)
 
98
IFLAGS = -I$(X_INCLUDE_DIR)
 
99
YFLAGS = -d
 
100
YCFLAGS =
 
101
LDFLAGS = -lm
 
102
XLDFLAGS = -L$(TOPDIR)/lib -lXaw -lXmu -lXt -lXext -lX11
 
103
CSH = csh
 
104
 
 
105
# lex.yy.c is usually compiled with -O to speed it up.
 
106
 
 
107
LEXCFLAGS = -O
 
108
 
 
109
 
 
110
 
 
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
 
113
 
 
114
 
 
115
XOBJS = windows.o buttons.o
 
116
 
 
117
 
 
118
ENDIAN=`cat configuration`
 
119
 
 
120
 
 
121
spim:   force
 
122
        @touch .spim-made
 
123
        make -f Makefile.std spim2
 
124
 
 
125
spim2:  $(OBJS) spim.o
 
126
        $(CC) -g $(OBJS) spim.o $(LDFLAGS) -o spim -lm
 
127
 
 
128
 
 
129
xspim:  force
 
130
        @touch .spim-made
 
131
        make -f Makefile.std xspim2
 
132
 
 
133
xspim2: $(OBJS) $(XOBJS) xspim.o
 
134
        $(CC) -g $(OBJS) $(XOBJS) xspim.o $(LDFLAGS) $(XLDFLAGS) -o xspim -lm
 
135
 
 
136
force:  configuration
 
137
 
 
138
configuration:
 
139
        Configure
 
140
 
 
141
#
 
142
 
 
143
#
 
144
# Test spim with a torture test:
 
145
#
 
146
 
 
147
test:   spim
 
148
        /bin/rm -f Tests/tt.out std_out new_out
 
149
        @echo
 
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:
 
154
        diff std_out new_out
 
155
        @echo
 
156
        @echo
 
157
        /bin/rm -f Tests/tt.out std_out new_out
 
158
 
 
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:
 
165
        diff std_out new_out
 
166
        @echo
 
167
        @echo
 
168
        /bin/rm -f Tests/tt.out std_out new_out
 
169
 
 
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.
 
172
 
 
173
test_bare:
 
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:
 
178
        diff std_out new_out
 
179
        @echo
 
180
        @echo
 
181
        /bin/rm -f Tests/tt.out std_out new_out
 
182
 
 
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:
 
187
        diff std_out new_out
 
188
        @echo
 
189
        /bin/rm -f Tests/tt.out std_out new_out
 
190
 
 
191
#
 
192
 
 
193
TAGS:   *.c *.h *.l *.y
 
194
        etags *.l *.y *.c *.h
 
195
 
 
196
 
 
197
clean:
 
198
        rm -f spim xspim *.o y.output core a.out TAGS \
 
199
          .spim-made  \
 
200
          spim.tar.* spim.aux spim.log spim.dvi spim.shar*
 
201
 
 
202
install: spim xspim
 
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)
 
208
 
 
209
very-clean: clean
 
210
        rm -f y.tab.h y.tab.c lex.yy.c spim.tar* Documentation/spim.ps
 
211
 
 
212
 
 
213
SRC = spim-utils.c run.c mem.c inst.c data.c sym-tbl.c y.tab.o lex.yy.o \
 
214
      mips-syscall.c
 
215
 
 
216
XSRC = windows.c buttons.c
 
217
 
 
218
 
 
219
#
 
220
# Dependences not handled well by makedepend:
 
221
#
 
222
 
 
223
 
 
224
y.tab.h: y.tab.c
 
225
 
 
226
y.tab.c: parser.y
 
227
        yacc $(YFLAGS) parser.y
 
228
 
 
229
y.tab.o: y.tab.c
 
230
        $(CC) $(IFLAGS) $(CFLAGS) $(YCFLAGS) -c y.tab.c
 
231
 
 
232
 
 
233
lex.yy.c: scanner.l
 
234
        $(MYLEX) $(LEXFLAGS) scanner.l
 
235
 
 
236
lex.yy.o: lex.yy.c
 
237
        $(CC) $(IFLAGS) $(LEXCFLAGS) -c lex.yy.c
 
238
 
 
239
 
 
240
#
 
241
# DO NOT DELETE THIS LINE -- make depend depends on it.
 
242
 
 
243
buttons.o: spim.h
 
244
buttons.o: spim-utils.h
 
245
buttons.o: xspim.h
 
246
buttons.o: inst.h
 
247
buttons.o: mem.h
 
248
buttons.o: reg.h
 
249
buttons.o: scanner.h
 
250
buttons.o: sym-tbl.h
 
251
buttons.o: buttons.h
 
252
data.o: spim.h
 
253
data.o: spim-utils.h
 
254
data.o: inst.h
 
255
data.o: mem.h
 
256
data.o: reg.h
 
257
data.o: sym-tbl.h
 
258
data.o: parser.h
 
259
data.o: run.h
 
260
data.o: data.h
 
261
inst.o: spim.h
 
262
inst.o: spim-utils.h
 
263
inst.o: inst.h
 
264
inst.o: mem.h
 
265
inst.o: reg.h
 
266
inst.o: sym-tbl.h
 
267
inst.o: y.tab.h
 
268
inst.o: parser.h
 
269
inst.o: scanner.h
 
270
inst.o: data.h
 
271
inst.o: op.h
 
272
lex.yy.o: spim.h
 
273
lex.yy.o: spim-utils.h
 
274
lex.yy.o: inst.h
 
275
lex.yy.o: sym-tbl.h
 
276
lex.yy.o: y.tab.h
 
277
lex.yy.o: parser.h
 
278
lex.yy.o: scanner.h
 
279
lex.yy.o: op.h
 
280
mem.o: spim.h
 
281
mem.o: spim-utils.h
 
282
mem.o: inst.h
 
283
mem.o: mem.h
 
284
mem.o: reg.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
 
292
run.o: spim.h
 
293
run.o: spim-utils.h
 
294
run.o: inst.h
 
295
run.o: mem.h
 
296
run.o: reg.h
 
297
run.o: sym-tbl.h
 
298
run.o: y.tab.h
 
299
run.o: mips-syscall.h
 
300
run.o: run.h
 
301
spim-utils.o: spim.h
 
302
spim-utils.o: spim-utils.h
 
303
spim-utils.o: inst.h
 
304
spim-utils.o: data.h
 
305
spim-utils.o: mem.h
 
306
spim-utils.o: reg.h
 
307
spim-utils.o: scanner.h
 
308
spim-utils.o: parser.h
 
309
spim-utils.o: y.tab.h
 
310
spim-utils.o: run.h
 
311
spim-utils.o: sym-tbl.h
 
312
spim.o: spim.h
 
313
spim.o: spim-utils.h
 
314
spim.o: inst.h
 
315
spim.o: mem.h
 
316
spim.o: reg.h
 
317
spim.o: parser.h
 
318
spim.o: sym-tbl.h
 
319
spim.o: scanner.h
 
320
spim.o: y.tab.h
 
321
sym-tbl.o: spim.h
 
322
sym-tbl.o: spim-utils.h
 
323
sym-tbl.o: inst.h
 
324
sym-tbl.o: mem.h
 
325
sym-tbl.o: data.h
 
326
sym-tbl.o: parser.h
 
327
sym-tbl.o: sym-tbl.h
 
328
windows.o: spim.h
 
329
windows.o: spim-utils.h
 
330
windows.o: buttons.h
 
331
windows.o: xspim.h
 
332
windows.o: windows.h
 
333
xspim.o: spim.h
 
334
xspim.o: spim-utils.h
 
335
xspim.o: inst.h
 
336
xspim.o: mem.h
 
337
xspim.o: reg.h
 
338
xspim.o: y.tab.h
 
339
xspim.o: buttons.h
 
340
xspim.o: windows.h
 
341
xspim.o: xspim.h
 
342
y.tab.o: spim.h
 
343
y.tab.o: spim-utils.h
 
344
y.tab.o: inst.h
 
345
y.tab.o: mem.h
 
346
y.tab.o: reg.h
 
347
y.tab.o: sym-tbl.h
 
348
y.tab.o: data.h
 
349
y.tab.o: scanner.h
 
350
y.tab.o: parser.h
 
351
parser.o: spim.h
 
352
parser.o: spim-utils.h
 
353
parser.o: inst.h
 
354
parser.o: mem.h
 
355
parser.o: reg.h
 
356
parser.o: sym-tbl.h
 
357
parser.o: data.h
 
358
parser.o: scanner.h
 
359
parser.o: parser.h
 
360
scanner.o: spim.h
 
361
scanner.o: spim-utils.h
 
362
scanner.o: inst.h
 
363
scanner.o: sym-tbl.h
 
364
scanner.o: y.tab.h
 
365
scanner.o: parser.h
 
366
scanner.o: scanner.h
 
367
scanner.o: op.h