3
# SPIM S20 MIPS Simulator.
7
# Copyright (C) 1990-2000 by James Larus (larus@cs.wisc.edu).
13
# DOS Makefile derived from Makefile.std by David A. Carley
17
# SPIM is distributed under the following conditions:
21
# You may make copies of SPIM for your own use and modify those copies.
25
# All copies of SPIM must retain my name and copyright notice.
29
# You may not sell SPIM or distributed SPIM in conjunction with a commerical
31
# product or service without the expressed written consent of James Larus.
35
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
37
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
39
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
65
# To build a version of spim that doesn't need an external
67
# DPMI host (Windows, QEMM, Desqview, etc) type:
75
# See the directions below regarding $(PMODESTUB)
81
# The following parameters must be set for the target machine:
87
# Full path for the trap handler file:
89
TRAP_PATH = \"trap.han\"
93
# If you have flex, use it instead of lex. If you use flex, define this
95
# variable and set LEXFLAGS.
101
# SPIM needs flex's -I flag since the scanner is used interactively.
103
# You can set the -8 flag so that funny characters do not hang the scanner.
109
# SPIM needs a DPMI server when compiled with DJGPP.
111
# PMODE/DJ can be found at:
113
# ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2misc/pmode11b.zip
115
PMODESTUB = e:\djgpp\bin\pmodstub.exe
119
# If you use lex, set the variables this way:
129
# Size of the segments when spim starts up (data segment must be >= 64K).
131
# (These sizes are fine for most users since SPIM dynamically expands
133
# the memory as necessary.)
135
MEM_SIZES = -DTEXT_SIZE=65536 -DDATA_SIZE=131072 -DK_TEXT_SIZE=65536
139
# DOS and Windows platforms are little endian exclusively
141
ENDIAN=-DLITTLEENDIAN
161
CFLAGS = -g $(IFLAGS) $(ENDIAN) $(MEM_SIZES) $(EXTRA_C_FLAGS) $(CL_FLAG)
173
# lex.yy.c is usually compiled with -O to speed it up.
183
OBJS = spim-utils.o run.o mem.o inst.o data.o sym-tbl.o y.tab.o lex.yy.o \
191
$(CC) -g $(OBJS) spim.o $(LDFLAGS) -o spim -lm
203
copy /b $(PMODESTUB) + spim spim.exe
209
rm -f spim.exe spim *.o y.output
215
rm -f y.tab.h y.tab.c lex.yy.c
219
SRC = spim-utils.c run.c mem.c inst.c data.c sym-tbl.c y.tab.o lex.yy.o \
229
# Dependences not handled well by makedepend:
235
spim-utils.o: spim-utils.c spim.h inst.h mem.h reg.h y.tab.h VERSION
237
$(CC) $(CFLAGS) -DDEFAULT_TRAP_HANDLER=$(TRAP_PATH) \
239
-DSPIM_VERSION="\"$(shell cat VERSION)\"" -c spim-utils.c
245
$(CC) $(CFLAGS) -DDEFAULT_TRAP_HANDLER=$(TRAP_PATH) -c spim.c
255
bison --yacc $(YFLAGS) parser.y --output=y.tab.c
261
$(CC) $(IFLAGS) $(CFLAGS) $(YCFLAGS) -c y.tab.c
269
$(MYLEX) -olex.yy.c $(LEXFLAGS) scanner.l
275
$(CC) $(IFLAGS) $(LEXCFLAGS) -c lex.yy.c
283
# DO NOT DELETE THIS LINE -- make depend depends on it.
329
lex.yy.o: spim-utils.h
353
mips-syscall.o: spim.h
355
mips-syscall.o: inst.h
357
mips-syscall.o: mem.h
359
mips-syscall.o: reg.h
361
mips-syscall.o: sym-tbl.h
363
mips-syscall.o: spim-syscall.h
365
mips-syscall.o: mips-syscall.h
381
run.o: mips-syscall.h
387
spim-utils.o: spim-utils.h
397
spim-utils.o: scanner.h
399
spim-utils.o: parser.h
401
spim-utils.o: y.tab.h
405
spim-utils.o: sym-tbl.h
427
sym-tbl.o: spim-utils.h
441
y.tab.o: spim-utils.h
459
parser.o: spim-utils.h
477
scanner.o: spim-utils.h