1 # Makefile for regression testing the frv simulator.
2 # Copyright (C) 1998, 2007, 2008, 2009, 2010, 2011
3 # Free Software Foundation, Inc.
5 # This file is part of GDB.
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
22 srcroot = $(srcdir)/../../..
25 exec_prefix = @exec_prefix@
27 host_alias = @host_alias@
28 target_alias = @target_alias@
29 program_transform_name = @program_transform_name@
30 build_canonical = @build@
31 host_canonical = @host@
32 target_canonical = @target@
33 target_cpu = @target_cpu@
38 RPATH_ENVVAR = @RPATH_ENVVAR@
40 EXPECT = `if [ -f ../../../expect/expect ] ; then \
41 echo ../../../expect/expect ; \
42 else echo expect ; fi`
44 RUNTEST = $(RUNTEST_FOR_TARGET)
48 RUNTEST_FOR_TARGET = `\
49 if [ -f $${srcroot}/dejagnu/runtest ]; then \
50 echo $${srcroot}/dejagnu/runtest; \
52 if [ "$(host_canonical)" = "$(target_canonical)" ]; then \
55 t='$(program_transform_name)'; echo runtest | sed -e '' $$t; \
61 if [ -x ../../../gas/as-new ]; then \
62 echo ../../../gas/as-new ; \
64 echo $(target_alias)-as ; \
68 if [ -x ../../../ld/ld-new ]; then \
69 echo ../../../ld/ld-new ; \
71 echo $(target_alias)-ld ; \
75 if [ -x ../../../sim/${target_cpu}/run ]; then \
76 echo ../../../sim/${target_cpu}/run ; \
78 echo $(target_alias)-run ; \
87 check: sanity $(TESTS)
89 @eval echo AS_FOR_TARGET = $(AS_FOR_TARGET)
90 @eval echo LD_FOR_TARGET = $(LD_FOR_TARGET)
91 @eval echo RUN_FOR_TARGET = $(RUN_FOR_TARGET)
95 # Rules for running all the tests, put into three types
96 # exit success, exit fail, print "Hello World"
100 $(RUN_FOR_TARGET) $* > $*.log
103 # Rules for running the tests
105 .SUFFIXES: .u .ok .run .hi .ko
108 ulimit -t 5 ; $(RUN_FOR_TARGET) $*.run > tmp-$*
111 rm -f tmp-$* $*.hi diff-$*
112 ulimit -t 5 ; $(RUN_FOR_TARGET) $*.run > tmp-$*
113 echo "Hello World" | diff - tmp-$* > diff-$*
114 cat tmp-$* diff-$* > $*.hi
118 ulimit -t 5 ; $(RUN_FOR_TARGET) $*.run > tmp-$* ; \
119 if [ $$? -eq 47 ] ; then \
127 # Rules for building all the tests and packing them into
130 uuencode: em-pstr.u em-e0.u em-e47.u em-pchr.u
132 .SUFFIXES: .u .s .run
135 $(AS_FOR_TARGET) $(srcdir)/$*.s -o $*.o
136 $(LD_FOR_TARGET) -o $* $*.o
137 uuencode < $* $* > $*.u
141 $(AS_FOR_TARGET) $(srcdir)/$*.s -o $*.o
142 $(LD_FOR_TARGET) -o $*.run $*.o
147 rm -f *~ core *.o a.out
150 distclean maintainer-clean realclean: clean
152 rm -f Makefile config.status *-init.exp
153 rm -fr *.log summary detail *.plog *.sum *.psum site.*
155 Makefile : Makefile.in config.status
156 $(SHELL) config.status
158 config.status: configure
159 $(SHELL) config.status --recheck