2003-08-29 16:41:31 +00:00
|
|
|
# Makefile for regression testing the frv simulator.
|
2012-01-04 08:28:28 +00:00
|
|
|
# Copyright (C) 1998, 2007-2012 Free Software Foundation, Inc.
|
2003-08-29 16:41:31 +00:00
|
|
|
|
|
|
|
# This file is part of GDB.
|
|
|
|
|
2007-08-24 14:30:15 +00:00
|
|
|
# This program is free software; you can redistribute it and/or modify
|
2003-08-29 16:41:31 +00:00
|
|
|
# it under the terms of the GNU General Public License as published by
|
2007-08-24 14:30:15 +00:00
|
|
|
# the Free Software Foundation; either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
2003-08-29 16:41:31 +00:00
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
2007-08-24 14:30:15 +00:00
|
|
|
#
|
2003-08-29 16:41:31 +00:00
|
|
|
# You should have received a copy of the GNU General Public License
|
2007-08-24 14:30:15 +00:00
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2003-08-29 16:41:31 +00:00
|
|
|
|
|
|
|
VPATH = @srcdir@
|
|
|
|
srcdir = @srcdir@
|
|
|
|
srcroot = $(srcdir)/../../..
|
|
|
|
|
|
|
|
prefix = @prefix@
|
|
|
|
exec_prefix = @exec_prefix@
|
|
|
|
|
|
|
|
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 = @SHELL@
|
|
|
|
SUBDIRS = @subdirs@
|
|
|
|
RPATH_ENVVAR = @RPATH_ENVVAR@
|
|
|
|
|
|
|
|
EXPECT = `if [ -f ../../../expect/expect ] ; then \
|
|
|
|
echo ../../../expect/expect ; \
|
|
|
|
else echo expect ; fi`
|
|
|
|
|
|
|
|
RUNTEST = $(RUNTEST_FOR_TARGET)
|
|
|
|
|
|
|
|
RUNTESTFLAGS =
|
|
|
|
|
|
|
|
RUNTEST_FOR_TARGET = `\
|
|
|
|
if [ -f $${srcroot}/dejagnu/runtest ]; then \
|
|
|
|
echo $${srcroot}/dejagnu/runtest; \
|
|
|
|
else \
|
|
|
|
if [ "$(host_canonical)" = "$(target_canonical)" ]; then \
|
|
|
|
echo runtest; \
|
|
|
|
else \
|
|
|
|
t='$(program_transform_name)'; echo runtest | sed -e '' $$t; \
|
|
|
|
fi; \
|
|
|
|
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`
|
|
|
|
|
|
|
|
RUN_FOR_TARGET = `\
|
|
|
|
if [ -x ../../../sim/${target_cpu}/run ]; then \
|
|
|
|
echo ../../../sim/${target_cpu}/run ; \
|
|
|
|
else \
|
|
|
|
echo $(target_alias)-run ; \
|
|
|
|
fi`
|
|
|
|
|
|
|
|
TESTS = \
|
|
|
|
exit47.ko \
|
|
|
|
grloop.ok \
|
|
|
|
hello.ok
|
|
|
|
|
|
|
|
|
|
|
|
check: sanity $(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)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Rules for running all the tests, put into three types
|
|
|
|
# exit success, exit fail, print "Hello World"
|
|
|
|
|
|
|
|
.u.log:
|
|
|
|
uudecode $*.u
|
|
|
|
$(RUN_FOR_TARGET) $* > $*.log
|
|
|
|
|
|
|
|
|
|
|
|
# Rules for running the tests
|
|
|
|
|
|
|
|
.SUFFIXES: .u .ok .run .hi .ko
|
|
|
|
.run.ok:
|
|
|
|
rm -f tmp-$* $*.hi
|
|
|
|
ulimit -t 5 ; $(RUN_FOR_TARGET) $*.run > tmp-$*
|
|
|
|
mv tmp-$* $*.ok
|
|
|
|
.run.hi:
|
|
|
|
rm -f tmp-$* $*.hi diff-$*
|
|
|
|
ulimit -t 5 ; $(RUN_FOR_TARGET) $*.run > tmp-$*
|
|
|
|
echo "Hello World" | diff - tmp-$* > diff-$*
|
|
|
|
cat tmp-$* diff-$* > $*.hi
|
|
|
|
.run.ko:
|
|
|
|
rm -f tmp-$* $*.ko
|
|
|
|
set +e ; \
|
|
|
|
ulimit -t 5 ; $(RUN_FOR_TARGET) $*.run > tmp-$* ; \
|
|
|
|
if [ $$? -eq 47 ] ; then \
|
|
|
|
exit 0 ; \
|
|
|
|
else \
|
|
|
|
exit 1 ; \
|
|
|
|
fi
|
|
|
|
mv tmp-$* $*.ko
|
|
|
|
|
|
|
|
|
|
|
|
# Rules for building all the tests and packing them into
|
|
|
|
# uuencoded files.
|
|
|
|
|
|
|
|
uuencode: em-pstr.u em-e0.u em-e47.u em-pchr.u
|
|
|
|
|
|
|
|
.SUFFIXES: .u .s .run
|
|
|
|
.s.u:
|
|
|
|
rm -f $*.o $*.run
|
|
|
|
$(AS_FOR_TARGET) $(srcdir)/$*.s -o $*.o
|
|
|
|
$(LD_FOR_TARGET) -o $* $*.o
|
|
|
|
uuencode < $* $* > $*.u
|
|
|
|
rm -f $*.o $*
|
|
|
|
.s.run:
|
|
|
|
rm -f $*.o $*.run
|
|
|
|
$(AS_FOR_TARGET) $(srcdir)/$*.s -o $*.o
|
|
|
|
$(LD_FOR_TARGET) -o $*.run $*.o
|
|
|
|
rm -f $*.o $*
|
|
|
|
|
|
|
|
|
|
|
|
clean mostlyclean:
|
|
|
|
rm -f *~ core *.o a.out
|
|
|
|
rm -f $(TESTS)
|
|
|
|
|
|
|
|
distclean maintainer-clean realclean: clean
|
|
|
|
rm -f *~ core
|
|
|
|
rm -f Makefile config.status *-init.exp
|
|
|
|
rm -fr *.log summary detail *.plog *.sum *.psum site.*
|
|
|
|
|
|
|
|
Makefile : Makefile.in config.status
|
|
|
|
$(SHELL) config.status
|
|
|
|
|
|
|
|
config.status: configure
|
|
|
|
$(SHELL) config.status --recheck
|