📄 makefile
字号:
## SPIM S20 MIPS Simulator.# Makefile for SPIM.## Copyright (C) 1990-2005 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: $## To make spim, type:## make spim## Cannot make xpsim under windows. Use PCSpim instead.## To verify spim works, type:## make test#.SUFFIXES:.SUFFIXES: .c .o## The following parameters must be set for the target machine:### Path for directory that contains the source of the CPU code:CPU_DIR = ../CPUVPATH = src:$(CPU_DIR)# Path of directory that contains SPIM tests:TEST_DIR = ../Tests# Path of directory that contains documentation:DOC_DIR = ../Documentation# Full path for the directory that will hold the executable files:BIN_DIR = /usr/local/bin# Full path for the directory that will hold the exception handler:EXCEPTION_DIR = /usr/local/lib# Full path for the directory that will hold the man files:MAN_DIR = /usr/man/mann# 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# 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## End of parameters#ENDIAN=`cat configuration`DEFINES = $(ENDIAN) $(MEM_SIZES) -DDEFAULT_EXCEPTION_HANDLER="\"$(EXCEPTION_DIR)/exceptions.s\"" -DSPIM_VERSION="\"`cat ../VERSION`\""CC = gccCFLAGS = -I. -I$(CPU_DIR) $(DEFINES) -g -WallYFLAGS = -d --file-prefix=yYCFLAGS =LDFLAGS = -lmCSH = bash# lex.yy.c is usually compiled with -O to speed it up.LEXCFLAGS = -O $(CFLAGS)OBJS = spim-utils.o run.o mem.o inst.o data.o sym-tbl.o y.tab.o lex.yy.o \ syscall.o display-utils.o string-stream.ospim: force make -f Makefile spim2spim2: $(OBJS) spim.o $(CC) -g $(OBJS) spim.o $(LDFLAGS) -o spim -lmforce: configurationconfiguration: ./Configure### Test spim with a torture test:#test: spim @echo @echo "Testing tt.bare.s:" $(CSH) -c "./spim -delayed_branches -delayed_loads -noexception -file $(TEST_DIR)/tt.bare.s >& test.out" @tail -2 test.out @echo @if [ ! -f $(EXCEPTION_DIR)/exceptions.s ]; then echo "Exception Handler not installed; do make install"; exit 1; else true; fi @if diff $(CPU_DIR)/exceptions.s $(EXCEPTION_DIR)/exceptions.s > /dev/null ; then true ; else echo "Old exception_handler installed. Type: make install" ; exit 1; fi @echo @echo "Testing tt.core.s:" $(CSH) -c "./spim -file $(TEST_DIR)/tt.core.s < $(TEST_DIR)/tt.in >& test.out" @tail -2 test.out @echo @echo @echo "Testing tt.endian.s:" $(CSH) -c "./spim -file $(TEST_DIR)/tt.endian.s >& test.out" @tail -2 test.out @echo @echo# 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: spim @echo @echo "Testing tt.alu.bare.s:" $(CSH) -c "./spim -bare -noexception -file $(TEST_DIR)/tt.alu.bare.s >& test.out" @tail -2 test.out @echo @echo @echo "Testing tt.fpt.bare.s:" $(CSH) -c "./spim -bare -noexception -file $(TEST_DIR)/tt.fpu.bare.s >& test.out" @tail -2 test.out @echo @echo#TAGS: *.c *.h *.l *.y etags *.l *.y *.c *.hclean: rm -f spim spim.exe *.o TAGS test.out lex.yy.c y.tab.c y.tab.h y.outputinstall: spim install -c -s spim $(BIN_DIR) install -c -m 0444 $(CPU_DIR)/exceptions.s $(EXCEPTION_DIR)install-man: install -c -m 0444 $(DOC_DIR)/spim.man $(MAN_DIR)very-clean: clean rm -f configurationsplint: spim splint -weak -preproc -warnposix +matchanyintegral spim.c y.tab.c lex.yy.c## Dependences not handled well by makedepend:#y.tab.h: y.tab.cy.tab.c: $(CPU_DIR)/parser.y bison $(YFLAGS) $(CPU_DIR)/parser.yy.tab.o: y.tab.c $(CC) $(CFLAGS) $(YCFLAGS) -c y.tab.clex.yy.c: $(CPU_DIR)/scanner.l $(MYLEX) $(LEXFLAGS) $(CPU_DIR)/scanner.llex.yy.o: lex.yy.c $(CC) $(LEXCFLAGS) -c lex.yy.c## DO NOT DELETE THIS LINE -- make depend depends on it.data.o: $(CPU_DIR)/spim.hdata.o: $(CPU_DIR)/string-stream.hdata.o: $(CPU_DIR)/spim-utils.hdata.o: $(CPU_DIR)/inst.hdata.o: $(CPU_DIR)/reg.hdata.o: $(CPU_DIR)/mem.hdata.o: $(CPU_DIR)/sym-tbl.hdata.o: $(CPU_DIR)/parser.hdata.o: $(CPU_DIR)/run.hdata.o: $(CPU_DIR)/data.hdisplay-utils.o: $(CPU_DIR)/spim.hdisplay-utils.o: $(CPU_DIR)/string-stream.hdisplay-utils.o: $(CPU_DIR)/spim-utils.hdisplay-utils.o: $(CPU_DIR)/inst.hdisplay-utils.o: $(CPU_DIR)/data.hdisplay-utils.o: $(CPU_DIR)/reg.hdisplay-utils.o: $(CPU_DIR)/mem.hdisplay-utils.o: $(CPU_DIR)/run.hdisplay-utils.o: $(CPU_DIR)/sym-tbl.hdump_ops.o: $(CPU_DIR)/op.hinst.o: $(CPU_DIR)/spim.hinst.o: $(CPU_DIR)/string-stream.hinst.o: $(CPU_DIR)/spim-utils.hinst.o: $(CPU_DIR)/inst.hinst.o: $(CPU_DIR)/reg.hinst.o: $(CPU_DIR)/mem.hinst.o: $(CPU_DIR)/sym-tbl.hinst.o: $(CPU_DIR)/parser.hinst.o: $(CPU_DIR)/scanner.hinst.o: y.tab.hinst.o: $(CPU_DIR)/data.hinst.o: $(CPU_DIR)/op.hmem.o: $(CPU_DIR)/spim.hmem.o: $(CPU_DIR)/string-stream.hmem.o: $(CPU_DIR)/spim-utils.hmem.o: $(CPU_DIR)/inst.hmem.o: $(CPU_DIR)/reg.hmem.o: $(CPU_DIR)/mem.hrun.o: $(CPU_DIR)/spim.hrun.o: $(CPU_DIR)/string-stream.hrun.o: $(CPU_DIR)/spim-utils.hrun.o: $(CPU_DIR)/inst.hrun.o: $(CPU_DIR)/reg.hrun.o: $(CPU_DIR)/mem.hrun.o: $(CPU_DIR)/sym-tbl.hrun.o: y.tab.hrun.o: $(CPU_DIR)/syscall.hrun.o: $(CPU_DIR)/run.hspim-utils.o: $(CPU_DIR)/spim.hspim-utils.o: $(CPU_DIR)/string-stream.hspim-utils.o: $(CPU_DIR)/spim-utils.hspim-utils.o: $(CPU_DIR)/inst.hspim-utils.o: $(CPU_DIR)/data.hspim-utils.o: $(CPU_DIR)/reg.hspim-utils.o: $(CPU_DIR)/mem.hspim-utils.o: $(CPU_DIR)/scanner.hspim-utils.o: $(CPU_DIR)/parser.hspim-utils.o: y.tab.hspim-utils.o: $(CPU_DIR)/run.hspim-utils.o: $(CPU_DIR)/sym-tbl.hstring-stream.o: $(CPU_DIR)/spim.hstring-stream.o: $(CPU_DIR)/string-stream.hsym-tbl.o: $(CPU_DIR)/spim.hsym-tbl.o: $(CPU_DIR)/string-stream.hsym-tbl.o: $(CPU_DIR)/spim-utils.hsym-tbl.o: $(CPU_DIR)/inst.hsym-tbl.o: $(CPU_DIR)/reg.hsym-tbl.o: $(CPU_DIR)/mem.hsym-tbl.o: $(CPU_DIR)/data.hsym-tbl.o: $(CPU_DIR)/parser.hsym-tbl.o: $(CPU_DIR)/sym-tbl.hsym-tbl.o: y.tab.hsyscall.o: $(CPU_DIR)/spim.hsyscall.o: $(CPU_DIR)/string-stream.hsyscall.o: $(CPU_DIR)/inst.hsyscall.o: $(CPU_DIR)/reg.hsyscall.o: $(CPU_DIR)/mem.hsyscall.o: $(CPU_DIR)/sym-tbl.hsyscall.o: $(CPU_DIR)/syscall.hlex.yy.o: $(CPU_DIR)/spim.hlex.yy.o: $(CPU_DIR)/string-stream.hlex.yy.o: $(CPU_DIR)/spim-utils.hlex.yy.o: $(CPU_DIR)/inst.hlex.yy.o: $(CPU_DIR)/reg.hlex.yy.o: $(CPU_DIR)/sym-tbl.hlex.yy.o: $(CPU_DIR)/parser.hlex.yy.o: $(CPU_DIR)/scanner.hlex.yy.o: y.tab.hlex.yy.o: $(CPU_DIR)/op.hspim.o: $(CPU_DIR)/spim.hspim.o: $(CPU_DIR)/string-stream.hspim.o: $(CPU_DIR)/spim-utils.hspim.o: $(CPU_DIR)/inst.hspim.o: $(CPU_DIR)/reg.hspim.o: $(CPU_DIR)/mem.hspim.o: $(CPU_DIR)/parser.hspim.o: $(CPU_DIR)/sym-tbl.hspim.o: $(CPU_DIR)/scanner.hspim.o: y.tab.hy.tab.o: $(CPU_DIR)/spim.hy.tab.o: $(CPU_DIR)/string-stream.hy.tab.o: $(CPU_DIR)/spim-utils.hy.tab.o: $(CPU_DIR)/inst.hy.tab.o: $(CPU_DIR)/reg.hy.tab.o: $(CPU_DIR)/mem.hy.tab.o: $(CPU_DIR)/sym-tbl.hy.tab.o: $(CPU_DIR)/data.hy.tab.o: $(CPU_DIR)/scanner.hy.tab.o: $(CPU_DIR)/parser.h
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -