## SPIM S20 MIPS Simulator.# Makefile for SPIM.# Copyright (C) 1990-2000 by James Larus (larus@cs.wisc.edu).# ALL RIGHTS RESERVED.## DOS Makefile derived from Makefile.std by David A. Carley## 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: $## To make spim, type:## make spim### To build a version of spim that doesn't need an external# DPMI host (Windows, QEMM, Desqview, etc) type:## make pmode## See the directions below regarding $(PMODESTUB)## The following parameters must be set for the target machine:## Full path for the trap handler file:TRAP_PATH = \"trap.han\"# If you have flex, use it instead of lex. If you use flex, define this# variable and set LEXFLAGS.MYLEX = 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# SPIM needs a DPMI server when compiled with DJGPP.# PMODE/DJ can be found at:# ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2misc/pmode11b.zipPMODESTUB = e:\djgpp\bin\pmodstub.exe# If you use lex, set the variables this way:#MYLEX = 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# DOS and Windows platforms are little endian exclusivelyENDIAN=-DLITTLEENDIAN## End of parameters#CC = gccIFLAGS =CL_FLAG =CFLAGS = -g $(IFLAGS) $(ENDIAN) $(MEM_SIZES) $(EXTRA_C_FLAGS) $(CL_FLAG)YFLAGS = -dYCFLAGS =LDFLAGS = -lm# lex.yy.c is usually compiled with -O to speed it up.LEXCFLAGS = -OOBJS = spim-utils.o run.o mem.o inst.o data.o sym-tbl.o y.tab.o lex.yy.o \ mips-syscall.ospim: $(OBJS) spim.o $(CC) -g $(OBJS) spim.o $(LDFLAGS) -o spim -lm strip spim djp spimpmode: spim strip spim copy /b $(PMODESTUB) + spim spim.execlean: rm -f spim.exe spim *.o y.outputvery-clean: clean rm -f y.tab.h y.tab.c lex.yy.cSRC = spim-utils.c run.c mem.c inst.c data.c sym-tbl.c y.tab.o lex.yy.o \ mips-syscall.c## Dependences not handled well by makedepend:#spim-utils.o: spim-utils.c spim.h inst.h mem.h reg.h y.tab.h VERSION $(CC) $(CFLAGS) -DDEFAULT_TRAP_HANDLER=$(TRAP_PATH) \ -DSPIM_VERSION="\"$(shell cat VERSION)\"" -c spim-utils.cspim.o: $(CC) $(CFLAGS) -DDEFAULT_TRAP_HANDLER=$(TRAP_PATH) -c spim.cy.tab.h: y.tab.cy.tab.c: parser.y bison --yacc $(YFLAGS) parser.y --output=y.tab.cy.tab.o: y.tab.c $(CC) $(IFLAGS) $(CFLAGS) $(YCFLAGS) -c y.tab.clex.yy.c: scanner.l $(MYLEX) -olex.yy.c $(LEXFLAGS) scanner.llex.yy.o: lex.yy.c $(CC) $(IFLAGS) $(LEXCFLAGS) -c lex.yy.c## DO NOT DELETE THIS LINE -- make depend depends on it.data.o: spim.hdata.o: spim-utils.hdata.o: inst.hdata.o: mem.hdata.o: reg.hdata.o: sym-tbl.hdata.o: parser.hdata.o: run.hdata.o: data.hinst.o: spim.hinst.o: spim-utils.hinst.o: inst.hinst.o: mem.hinst.o: reg.hinst.o: sym-tbl.hinst.o: y.tab.hinst.o: parser.hinst.o: scanner.hinst.o: data.hinst.o: op.hlex.yy.o: spim.hlex.yy.o: spim-utils.hlex.yy.o: inst.hlex.yy.o: sym-tbl.hlex.yy.o: y.tab.hlex.yy.o: parser.hlex.yy.o: scanner.hlex.yy.o: op.hmem.o: spim.hmem.o: spim-utils.hmem.o: inst.hmem.o: mem.hmem.o: reg.hmips-syscall.o: spim.hmips-syscall.o: inst.hmips-syscall.o: mem.hmips-syscall.o: reg.hmips-syscall.o: sym-tbl.hmips-syscall.o: spim-syscall.hmips-syscall.o: mips-syscall.hrun.o: spim.hrun.o: spim-utils.hrun.o: inst.hrun.o: mem.hrun.o: reg.hrun.o: sym-tbl.hrun.o: y.tab.hrun.o: mips-syscall.hrun.o: run.hspim-utils.o: spim.hspim-utils.o: spim-utils.hspim-utils.o: inst.hspim-utils.o: data.hspim-utils.o: mem.hspim-utils.o: reg.hspim-utils.o: scanner.hspim-utils.o: parser.hspim-utils.o: y.tab.hspim-utils.o: run.hspim-utils.o: sym-tbl.hspim.o: spim.hspim.o: spim-utils.hspim.o: inst.hspim.o: mem.hspim.o: reg.hspim.o: parser.hspim.o: sym-tbl.hspim.o: scanner.hspim.o: y.tab.hsym-tbl.o: spim.hsym-tbl.o: spim-utils.hsym-tbl.o: inst.hsym-tbl.o: mem.hsym-tbl.o: data.hsym-tbl.o: parser.hsym-tbl.o: sym-tbl.hy.tab.o: spim.hy.tab.o: spim-utils.hy.tab.o: inst.hy.tab.o: mem.hy.tab.o: reg.hy.tab.o: sym-tbl.hy.tab.o: data.hy.tab.o: scanner.hy.tab.o: parser.hparser.o: spim.hparser.o: spim-utils.hparser.o: inst.hparser.o: mem.hparser.o: reg.hparser.o: sym-tbl.hparser.o: data.hparser.o: scanner.hparser.o: parser.hscanner.o: spim.hscanner.o: spim-utils.hscanner.o: inst.hscanner.o: sym-tbl.hscanner.o: y.tab.hscanner.o: parser.hscanner.o: scanner.hscanner.o: op.h