File: Imakefile

package info (click to toggle)
spim 6.1-3
  • links: PTS
  • area: non-free
  • in suites: hamm, slink
  • size: 1,944 kB
  • ctags: 2,839
  • sloc: asm: 10,339; ansic: 9,404; yacc: 1,867; makefile: 713; lex: 583; sh: 95
file content (385 lines) | stat: -rw-r--r-- 8,339 bytes parent folder | download
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
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
# SPIM S20 MIPS Simulator.
# Imakefile for SPIM.
#
# Copyright (C) 1992-1996 by James Larus (larus@cs.wisc.edu).
# ALL RIGHTS RESERVED.
#
# SPIM is distributed under the following conditions:
#
#   You may make copies of SPIM for your own use and modify those copies.
#
#   All copies of SPIM must retain my name and copyright notice.
#
#   You may not sell SPIM or distributed SPIM in conjunction with a commerical
#   product or service without the expressed written consent of James Larus.
#
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE.
#
# $Header: /u/l/a/larus/Software/SPIM/RCS/Imakefile,v 1.31 1997/12/30 21:49:27 larus Exp $


#
# To make spim, type:
#
#   make spim
#
# To make xpsim, type:
#
#   make xspim
#

#
# To verify spim works, type:
#
#   make test
#


#
# The following parameters must be set for the target machine on which SPIM
# or XSPIM is compiled:
#

# Full path for directory that will hold the trap handler file:
TRAP_DIR = /usr/lib/spim

# Full path for the directory that will hold the executable files:
BIN_DIR = /usr/bin

# Full path for the directory that will hold the man files:
MAN_DIR = /usr/man


# If you have flex, use it instead of lex.  If you use flex, define this
# variable and set LEXFLAGS.
LEX = flex

# SPIM needs flex's -I flag since the scanner is used interactively.
# You can set the -8 flag so that funny characters do not hang the scanner.
LEXFLAGS = -I -8

# If you use lex, set the variables this way:
#LEX = lex
#LEXFLAGS =


# Size of the segments when spim starts up (data segment must be >= 64K).
# (These sizes are fine for most users since SPIM dynamically expands
# the memory as necessary.)
MEM_SIZES = -DTEXT_SIZE=65536 -DDATA_SIZE=131072 -DK_TEXT_SIZE=65536


#
# END OF PARAMETERS
#


BASE_OBJS = spim-utils.o run.o mem.o inst.o data.o sym-tbl.o y.tab.o lex.yy.o \
       mips-syscall.o

OBJS = spim.o $(BASE_OBJS)

BASE_XOBJS = xspim.o windows.o buttons.o

XOBJS = $(BASE_OBJS) $(BASE_XOBJS)

TRAP_PATH = \"$(TRAP_DIR)/trap.handler\"

ENDIAN=`cat configuration`

# lex.yy.c is usually compiled with -O to speed it up.
LEXCFLAGS = -O

YFLAGS = -d


DEPLIBS = XawClientDepLibs
LOCALLIBS = XawClientLibs
CDEBUGFLAGS = -g
DEFINES = $(ENDIAN) $(MEM_SIZES) -DDEFAULT_TRAP_HANDLER=$(TRAP_PATH) -DSPIM_VERSION="\"`cat VERSION`\""

SYS_LIBRARIES = -lm

#

#
#  Program dependencies:
#

AllTarget(spim)

spim:	force
	@touch .spim-made
	@make spim_sub
	mv spim_sub spim

xspim:	force
	@touch .spim-made
	@make xspim_sub
	mv xspim_sub xspim

force:  configuration

configuration:
	Configure

NormalProgramTarget(spim_sub,$(OBJS),,,)
NormalProgramTarget(xspim_sub,$(XOBJS),$(DEPLIBS),$(LOCALLIBS),$(SYSLIBS))

InstallProgram(spim,$(BIN_DIR))
InstallProgram(xspim,$(BIN_DIR))
InstallManPage(spim,$(MAN_DIR))
InstallManPage(xspim,$(MAN_DIR))
InstallNonExec(trap.handler,$(TRAP_DIR))


y.tab.h: y.tab.c

y.tab.c: parser.y
	$(YACC) $(YFLAGS) parser.y

y.tab.o: y.tab.c
	$(CC) $(IFLAGS) $(CFLAGS) $(YCFLAGS) -c y.tab.c


lex.yy.o:	scanner.l

lex.yy.c:	scanner.l
	$(LEX) $(LEXFLAGS) scanner.l

lex.yy.o: lex.yy.c
	$(CC) $(IFLAGS) $(CFLAGS) $(LEXCFLAGS) -c lex.yy.c

#

#
# Test spim with a torture test:
#

test:	spim
	/bin/rm -f Tests/tt.out std_out new_out
	@echo
	csh -c "./spim -bare -notrap -file Tests/tt.bare.s >& Tests/tt.out"
	tail +6 Tests/tt.bare.OK > std_out
	tail +6 Tests/tt.out > new_out
	@echo The next command should not produce any output:
	diff std_out new_out
	@echo
	@echo
	/bin/rm -f Tests/tt.out std_out new_out

	@if [ ! -f $(TRAP_DIR)/trap.handler ]; then echo "trap_handler not installed. Type: make install"; exit 1; else true; fi
	@if diff trap.handler $(TRAP_DIR)/trap.handler > /dev/null ; then true ; else echo "Old trap_handler installed.  Type: make install" ; exit 1; fi
	csh -c "./spim -file Tests/tt.s < Tests/tt.in >& Tests/tt.out"
	tail +6 Tests/tt.OK > std_out
	tail +6 Tests/tt.out > new_out
	@echo The next command should not produce any output:
	diff std_out new_out
	@echo
	@echo
	/bin/rm -f Tests/tt.out std_out new_out


# This test currently only works for little-endian machines.  The file
# tt.alu.bare.s needs to be converted in places for big-endian machines.

test_bare:
	csh -c "./spim -bare -notrap -file Tests/tt.alu.bare.s >& Tests/tt.out"
	tail +6 Tests/tt.alu.bare.OK > std_out
	tail +6 Tests/tt.out > new_out
	@echo The next command should not produce any output:
	diff std_out new_out
	@echo
	@echo
	/bin/rm -f Tests/tt.out std_out new_out

	csh -c "./spim -bare -notrap -file Tests/tt.fpu.bare.s >& Tests/tt.out"
	tail +6 Tests/tt.fpu.bare.OK > std_out
	tail +6 Tests/tt.out > new_out
	@echo The next command should not produce any output:
	diff std_out new_out
	@echo
	/bin/rm -f Tests/tt.out std_out new_out

#

TAGS:	*.c *.h *.l *.y
	etags *.l *.y *.c *.h


clean::
	rm -f spim xspim *.o y.output core a.out TAGS \
	  .spim-made spim.tar.*


very-clean: clean
	rm -f y.tab.h y.tab.c lex.yy.c spim.tar* spim.shar* \
	Documentation/spim.ps, Documentation/spim.aux Documentation/spim.log \
	Documentation/spim.dvi Tests/tt.s Tests/tt.OK configuration

#

TAR_FILES = Configure BLURB README Imakefile Makefile.std *.c *.h *.y *.l \
	    trap.handler Tests/tt.* VERSION Documentation spim.man xspim.man


Documentation/spim.ps: Documentation/spim.tex
	cd Documentation; latex spim.tex; latex spim.tex; dvips -D 300 spim.dvi; \
	rm -f spim.aux spim.log spim.dvi


tar:	Documentation/spim.ps
	mkdir Hide
	mv Tests/tt.s Tests/tt.OK configuration Hide
	chmod 644 Imakefile Makefile.std
	tar cvf spim.tar $(TAR_FILES)
	mv Hide/tt.* Tests
	mv Hide/configuration .
	rm -fr Hide

tar.Z:	tar
	compress spim.tar


shar:
	mv -f y.tab.c y.tab.c.xx
	mv -f lex.yy.c lex.yy.c.xx
	rm -f spim.shar spim.shar0?
	makekit -n spim.shar $(FILES)
	mv -f y.tab.c.xx y.tab.c
	mv -f lex.yy.c.xx lex.yy.c

depend::
	makedepend -w10 *.c

#
# DO NOT DELETE THIS LINE -- make depend depends on it.

buttons.o: spim.h
buttons.o: spim-utils.h
buttons.o: xspim.h
buttons.o: inst.h
buttons.o: mem.h
buttons.o: reg.h
buttons.o: scanner.h
buttons.o: sym-tbl.h
buttons.o: buttons.h
data.o: spim.h
data.o: spim-utils.h
data.o: inst.h
data.o: mem.h
data.o: reg.h
data.o: sym-tbl.h
data.o: parser.h
data.o: run.h
data.o: data.h
inst.o: spim.h
inst.o: spim-utils.h
inst.o: inst.h
inst.o: mem.h
inst.o: reg.h
inst.o: sym-tbl.h
inst.o: y.tab.h
inst.o: parser.h
inst.o: scanner.h
inst.o: data.h
inst.o: op.h
lex.yy.o: spim.h
lex.yy.o: spim-utils.h
lex.yy.o: inst.h
lex.yy.o: sym-tbl.h
lex.yy.o: y.tab.h
lex.yy.o: parser.h
lex.yy.o: scanner.h
lex.yy.o: op.h
mem.o: spim.h
mem.o: spim-utils.h
mem.o: inst.h
mem.o: mem.h
mem.o: reg.h
mips-syscall.o: spim.h
mips-syscall.o: inst.h
mips-syscall.o: mem.h
mips-syscall.o: reg.h
mips-syscall.o: sym-tbl.h
mips-syscall.o: spim-syscall.h
mips-syscall.o: mips-syscall.h
run.o: spim.h
run.o: spim-utils.h
run.o: inst.h
run.o: mem.h
run.o: reg.h
run.o: sym-tbl.h
run.o: y.tab.h
run.o: mips-syscall.h
run.o: run.h
spim-utils.o: spim.h
spim-utils.o: spim-utils.h
spim-utils.o: inst.h
spim-utils.o: data.h
spim-utils.o: mem.h
spim-utils.o: reg.h
spim-utils.o: scanner.h
spim-utils.o: parser.h
spim-utils.o: y.tab.h
spim-utils.o: run.h
spim-utils.o: sym-tbl.h
spim.o: spim.h
spim.o: spim-utils.h
spim.o: inst.h
spim.o: mem.h
spim.o: reg.h
spim.o: parser.h
spim.o: sym-tbl.h
spim.o: scanner.h
spim.o: y.tab.h
sym-tbl.o: spim.h
sym-tbl.o: spim-utils.h
sym-tbl.o: inst.h
sym-tbl.o: mem.h
sym-tbl.o: data.h
sym-tbl.o: parser.h
sym-tbl.o: sym-tbl.h
windows.o: spim.h
windows.o: spim-utils.h
windows.o: buttons.h
windows.o: xspim.h
windows.o: windows.h
xspim.o: spim.h
xspim.o: spim-utils.h
xspim.o: inst.h
xspim.o: mem.h
xspim.o: reg.h
xspim.o: y.tab.h
xspim.o: buttons.h
xspim.o: windows.h
xspim.o: xspim.h
y.tab.o: spim.h
y.tab.o: spim-utils.h
y.tab.o: inst.h
y.tab.o: mem.h
y.tab.o: reg.h
y.tab.o: sym-tbl.h
y.tab.o: data.h
y.tab.o: scanner.h
y.tab.o: parser.h
parser.o: spim.h
parser.o: spim-utils.h
parser.o: inst.h
parser.o: mem.h
parser.o: reg.h
parser.o: sym-tbl.h
parser.o: data.h
parser.o: scanner.h
parser.o: parser.h
scanner.o: spim.h
scanner.o: spim-utils.h
scanner.o: inst.h
scanner.o: sym-tbl.h
scanner.o: y.tab.h
scanner.o: parser.h
scanner.o: scanner.h
scanner.o: op.h