我在编译基本块矢量(BBV)中遇到了一些问题,由UCSD univ(http://cseweb.ucsd.edu/~calder/simpoint/simplescalar-bbv.htm)和Simplescalar开发。没有BBV,我成功编译了simplescalar。
解压缩BBVtracker后,总共有三个文件:修改过的sim-fast.c,bbtracker.h和bbtracker.c。我将所有三个文件复制到simplesim-3.o目录,然后make config-pisa&更新Makefile后生成:1,将bbtracker.h附加到HDRS,将bbtracker.c附加到SRCS,将bbv。$(OEXT)附加到$ OBJS
2,在Makefile末尾添加bbv.o标签。
SRCS = main.c sim-fast.c sim-safe.c sim-cache.c sim-profile.c \
sim-eio.c sim-bpred.c sim-cheetah.c sim-outorder.c \
memory.c regs.c cache.c bpred.c ptrace.c eventq.c \
resource.c endian.c dlite.c symbol.c eval.c options.c range.c \
eio.c stats.c endian.c misc.c bbtracker.c \
target-pisa/pisa.c target-pisa/loader.c target-pisa/syscall.c \
target-pisa/symbol.c \
target-alpha/alpha.c target-alpha/loader.c target-alpha/syscall.c \
target-alpha/symbol.c
HDRS = syscall.h memory.h regs.h sim.h loader.h cache.h bpred.h ptrace.h \
eventq.h resource.h endian.h dlite.h symbol.h eval.h bitmap.h \
eio.h range.h version.h endian.h misc.h bbtracker.h \
target-pisa/pisa.h target-pisa/pisabig.h target-pisa/pisalittle.h \
target-pisa/pisa.def target-pisa/ecoff.h \
target-alpha/alpha.h target-alpha/alpha.def target-alpha/ecoff.h
#
# common objects
#
OBJS = main.$(OEXT) syscall.$(OEXT) memory.$(OEXT) regs.$(OEXT) \
loader.$(OEXT) endian.$(OEXT) dlite.$(OEXT) symbol.$(OEXT) \
eval.$(OEXT) options.$(OEXT) stats.$(OEXT) eio.$(OEXT) \
range.$(OEXT) misc.$(OEXT) machine.$(OEXT) bbv.$(OEXT)
.c.$(OEXT): # I dnot understand this LABEL.
$(CC) $(CFLAGS) -c $*.c
bbv.$(OEXT): host.h misc.h machine.h machine.def endian.h version.h dlite.h bbtracker.h
main.$(OEXT): host.h misc.h machine.h machine.def endian.h version.h dlite.h
main.$(OEXT): regs.h memory.h options.h stats.h eval.h loader.h sim.h
运行make后,错误:
make[1]: Leaving directory `/opt/simplescalar/simplesim-3.0/libexo' gcc -o sim-fast `./sysprobe -flags` -DDEBUG -O0 -g -Wall sim-fast.o main.o syscall.o memory.o regs.o loader.o endian.o dlite.o symbol.o eval.o options.o stats.o eio.o range.o misc.o machine.o bbv.o libexo/libexo.a `./sysprobe -libs` -lm gcc: error: bbv.o: No such file or directory make: *** [sim-fast] Error 1
显然,没有生成bbv.o。似乎我添加bbv.o的方式与main.o,range.o等其他目标文件相同。
[UPDATE] 有样本Makefile。 https://svn.ece.gatech.edu/repos/Manifold/tags/0.4/code/models/processor/zesto/Makefile
google makedepend目标后,我更新了以下内容:
OBJS = main.$(OEXT) syscall.$(OEXT) memory.$(OEXT) regs.$(OEXT) \
loader.$(OEXT) endian.$(OEXT) dlite.$(OEXT) symbol.$(OEXT) \
eval.$(OEXT) options.$(OEXT) stats.$(OEXT) eio.$(OEXT) \
range.$(OEXT) misc.$(OEXT) machine.$(OEXT) bbtracker.$(OEXT)
bbtracker.$(OEXT): /usr/include/stdlib.h /usr/include/stdio.h /usr/include/malloc.h
bbtracker.$(OEXT): bbtracker.h
main.$(OEXT): host.h misc.h machine.h machine.def endian.h version.h dlite.h
main.$(OEXT): regs.h memory.h options.h stats.h eval.h loader.h sim.h
sim-fast.$(OEXT): bbtracker.h
汇编成功了。