# Makefile for regression testing the sky simulator. VPATH = @srcdir@ srcdir = @srcdir@ srcroot = $(srcdir)/.. prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = $(exec_prefix)/bin host_alias = @host_alias@ target_alias = @target_alias@ program_transform_name = @program_transform_name@ build_canonical = @build@ host_canonical = @host@ target_canonical = @target@ target_cpu = @target_cpu@ SHELL = /bin/sh SUBDIRS = @subdirs@ RPATH_ENVVAR = @RPATH_ENVVAR@ EXPECT = `if [ -f $${rootme}/../../expect/expect ] ; then \ echo $${rootme}/../../expect/expect ; \ else echo expect ; fi` RUNTEST = $(RUNTEST_FOR_TARGET) RUNTESTFLAGS = RUNTEST_FOR_TARGET = `\ if [ -f $${srcdir}/../../../dejagnu/runtest ]; then \ echo $${srcdir}/../../../dejagnu/runtest; \ else \ if [ "$(host_canonical)" = "$(target_canonical)" ]; then \ echo runtest; \ else \ t='$(program_transform_name)'; echo runtest | sed -e '' $$t; \ fi; \ fi` DVPAS_FOR_TARGET := `\ if [ -x ${bindir}/dvp-elf-as ]; then \ echo ${bindir}/dvp-elf-as ; \ else \ echo $(target_alias)-as ; \ fi` DVPOBJCP_FOR_TARGET := `\ if [ -x ${bindir}/dvp-elf-objcopy ]; then \ echo ${bindir}/dvp-elf-objcopy ; \ else \ echo $(target_alias)-objcopy ; \ fi` AS_FOR_TARGET := `\ if [ -x ../../../gas/as-new ]; then \ echo ../../../gas/as-new ; \ else \ echo $(target_alias)-as ; \ fi` LD_FOR_TARGET := `\ if [ -x ../../../ld/ld-new ]; then \ echo ../../../ld/ld-new ; \ else \ echo $(target_alias)-ld ; \ fi` RUNOPTS = RUN_FOR_TARGET := `\ if [ -x ../../../sim/mips/run ]; then \ echo ../../../sim/mips/run ; \ else \ echo $(target_alias)-run ; \ fi` $(RUNOPTS) # ??? This definition a hack. # This should be named CC_FOR_TARGET but the top level Makefile doesn't # specify -B.../libgloss/mips/. But then again we should be using # dejagnu anyway [which handles this, among other things]. GCC_FOR_TARGET := `\ b=../../.. ; s=$(srcdir)/../../.. ; \ if [ -x $$b/gcc/xgcc ]; then \ echo "$$b/gcc/xgcc -B$$b/gcc/ -B$$b/$(target_alias)/libgloss/mips/ -B$$b/$(target_alias)/newlib/ -idirafter $$b/$(target_alias)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc" ; \ else \ echo $(target_alias)-gcc ; \ fi` C_GEN = perl $(srcdir)/c_gen.pl # cpu time limit (in seconds) ULIMIT = 60 .SUFFIXES: .trc .c .run .ok \ .vif0out .vif0ok .vif0expect \ .vif1out .vif1ok .vif1expect \ .vuout .vuok .vuexpect \ .uu \ .dvpasm .vuasm TESTS = \ t-dma.ok \ t-pke2.vif1ok t-pke3.ok t-pke4.vif0ok \ tss08_0.ok tss08_1.ok \ tss16_0.ok tss16_1.ok \ tss32_0.ok tss32_1.ok \ tsv208_0.ok tsv208_1.ok \ tsv216_0.ok tsv216_1.ok \ tsv232_0.ok tsv232_1.ok \ tsv308_0.ok tsv308_1.ok \ tsv316_0.ok tsv316_1.ok \ tsv332_0.ok tsv332_1.ok \ tsv408_0.ok tsv408_1.ok \ tsv416_0.ok tsv416_1.ok \ tsv432_0.ok tsv432_1.ok \ t-cop2.vuok t-cop2b.ok #SCE_TESTS := $(patsubst %.dvpasm, %.ok, $(wildcard sce*.dvpasm)) SCE_TESTS = \ sce_test1.ok sce_test2.ok sce_test3.ok sce_test4.ok \ sce_test5.ok sce_test6.ok sce_test7.ok sce_test8.ok \ sce_test9.ok sce_test10.ok sce2_test11.ok sce2_test12.ok \ sce_test13.ok sce_test14.ok sce_test15.ok sce_test16.ok \ sce_test17.ok sce_test18.ok sce_test19.ok sce_test20.ok \ sce_test21.ok sce_test22.ok sce2_test23.ok sce_test24.ok \ sce_test25.ok sce_test26.ok sce_test27.ok sce_test28.ok \ sce_test29.ok sce_test30.ok sce_test31.ok sce_test32.ok \ sce_test33.ok sce_test34.ok sce_test35.ok sce_test36.ok \ sce_test37.ok sce_test38.ok sce_test39.ok sce_test40.ok \ sce_test41.ok sce_test42.ok sce_test43.ok sce_test44.ok \ sce_test45.ok sce_test46.ok sce_test47.ok sce_test48.ok \ sce_test49.ok sce_test50.ok sce_test51.ok sce_test52.ok \ sce_test53.ok sce_test54.ok sce_test55.ok sce_test56.ok \ sce_test57.ok sce_test58.ok sce_test59.ok check: sanity $(TESTS) $(SCE_TESTS) check_sce: sanity $(SCE_TESTS) sanity: @eval echo AS_FOR_TARGET = $(AS_FOR_TARGET) @eval echo LD_FOR_TARGET = $(LD_FOR_TARGET) @eval echo RUN_FOR_TARGET = $(RUN_FOR_TARGET) @eval echo GCC_FOR_TARGET = $(GCC_FOR_TARGET) @eval echo DVPAS_FOR_TARGET = $(DVPAS_FOR_TARGET) @eval echo DVPOBJCP_FOR_TARGET = $(DVPOBJCP_FOR_TARGET) #------------------------------------ # Rules for building and running the SCE tests : #------------------------------------ LDFLAGS=-T$(srcdir)/sky.ld CFLAGS += -g -I$(srcdir) ASFLAGS = -I$(srcdir) sce%.exe: sce%.o sce_main.o refresh.o $(GCC_FOR_TARGET) $(CFLAGS) $(LDFLAGS) sce_main.o refresh.o -o $@ $< sce_main.o: sce_main.c $(GCC_FOR_TARGET) -c $(CFLAGS) -o $@ $< refresh.o: refresh.s $(DVPAS_FOR_TARGET) $(ASFLAGS) -o $@ $< sce_%.o: sce_%.dvpasm sce_%.vuasm $(DVPAS_FOR_TARGET) $(ASFLAGS) -o $@ $< sce2_%.o: sce2_%.dvpasm sce2_%.vubin $(DVPAS_FOR_TARGET) $(ASFLAGS) -o $@ $< sce2_%.vubin: sce2_%.vu.o $(DVPOBJCP_FOR_TARGET) -O binary $< $@ sce2_%.vu.o: sce2_%.vuasm $(DVPAS_FOR_TARGET) $(ASFLAGS) -o $@ $< sce%.ok: sce%.exe rm -f sce$*.ok sce$*_our_gif.dat GIF_TRACE=sce$*_our_gif.dat ; export GIF_TRACE; \ ulimit -t $(ULIMIT) ; $(RUN_FOR_TARGET) $< ; \ if [ $$? -ne 0 ]; then \ diff -bitw $(srcdir)/sce$*_out_gif.dat sce$*_our_gif.dat > sce$*.ok; \ touch sce$*.ok; \ else \ echo Running sce$*.exe returns $$? > sce$*.ok ;\ fi #------------------------ # Rules for running tests #------------------------ .run.ok: rm -f tmp-$* $*.hi ulimit -t $(ULIMIT) ; $(RUN_FOR_TARGET) $< > tmp-$* mv tmp-$* $*.ok .run.ko: rm -f tmp-$* $*.ko set +e ; \ ulimit -t $(ULIMIT) ; $(RUN_FOR_TARGET) $< > tmp-$* ; \ if [ $$? -ne 0 ] ; then \ exit 0 ; \ else \ exit 1 ; \ fi mv tmp-$* $*.ko .vif0out.vif0ok: diff $(srcdir)/$*.vif0expect $< touch $@ .vif1out.vif1ok: diff $(srcdir)/$*.vif1expect $< touch $@ .vuout.vuok: diff $(srcdir)/$*.vuexpect $< #------------------------------------ # Rules for building the TESTS #------------------------------------ .trc.c: $(C_GEN) $< $@ .c.run: $(GCC_FOR_TARGET) $(CFLAGS) $(LDFLAGS) -o $@ $< .uu.run: uudecode $< > $@ .run.vif0out: rm -f $@ -env VIF0_TRACE_FILE=$@ $(RUN_FOR_TARGET) $< .run.vif1out: rm -f $@ -env VIF1_TRACE_FILE=$@ $(RUN_FOR_TARGET) $< .run.vuout: rm -f $@ -env SKY_DEBUG=inst_trace $(RUN_FOR_TARGET) $< > $@ .s.run: rm -f $@ $(AS_FOR_TARGET) -mcpu=r5900 -o $@ $< .c.s: $(GCC_FOR_TARGET) -S -o $@ $< # # Standard # clean mostlyclean: -rm -f *~ core *.o a.out *.x *.grt -rm -f *.vif*out *.ok tmp-* rm -f $(TESTS) rm -f $(SCE_TESTS) sce*our_gif.dat sce*.exe *.vubin a.raw # if [ x"${SUBDIRS}" != x ] ; then \ # for dir in ${SUBDIRS}; \ # do \ # echo "$$dir:"; \ # if [ -d $$dir ]; then \ # (cd $$dir; $(MAKE) clean); \ # fi; \ # done ; \ # else true; fi distclean maintainer-clean realclean: clean -rm -f *~ core -rm -f Makefile config.status *-init.exp -rm -fr *.log summary detail *.plog *.sum *.psum site.* -rm -f a.raw # if [ x"${SUBDIRS}" != x ] ; then \ # for dir in ${SUBDIRS}; \ # do \ # echo "$$dir:"; \ # if [ -d $$dir ]; then \ # (cd $$dir; $(MAKE) distclean); \ # fi; \ # done ; \ # else true; fi Makefile : Makefile.in config.status $(SHELL) config.status config.status: configure $(SHELL) config.status --recheck