aboutsummaryrefslogtreecommitdiff
path: root/sim/testsuite/d10v-elf/Makefile.in
blob: b29d3d12b8e0fa7e7e570e81d800f3811ddd6360 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# Makefile for regression testing the GNU debugger.
# Copyright (C) 1992, 1993, 1994, 1995, 2007, 2008, 2009, 2010
# Free Software Foundation, Inc.

# This file is part of GDB.

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# 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,
# 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.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

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 = /bin/sh
SUBDIRS = @subdirs@
RPATH_ENVVAR = @RPATH_ENVVAR@

TESTS = \
	exit47.ko \
	hello.hi \
	t-dbt.ok \
	t-ld-st.ok \
	t-mac.ok \
	t-mvtac.ok \
	t-mvtc.ok \
	t-msbu.ok \
	t-mulxu.ok \
	t-rac.ok \
	t-rachi.ok \
	t-rdt.ok \
	t-rep.ok \
	t-rte.ok \
	t-sac.ok \
	t-sachi.ok \
	t-sadd.ok \
	t-slae.ok \
	t-sp.ok \
	t-sub2w.ok \
	t-sub.ok \
	t-subi.ok \
	t-ae-ld-d.ok \
	t-ae-ld-i.ok \
	t-ae-ld-id.ok \
	t-ae-ld-im.ok \
	t-ae-ld-ip.ok \
	t-ae-ld2w-d.ok \
	t-ae-ld2w-i.ok \
	t-ae-ld2w-id.ok \
	t-ae-ld2w-im.ok \
	t-ae-ld2w-ip.ok \
	t-ae-st-d.ok \
	t-ae-st-i.ok \
	t-ae-st-id.ok \
	t-ae-st-im.ok \
	t-ae-st-ip.ok \
	t-ae-st-is.ok \
	t-ae-st2w-d.ok \
	t-ae-st2w-i.ok \
	t-ae-st2w-id.ok \
	t-ae-st2w-im.ok \
	t-ae-st2w-ip.ok \
	t-ae-st2w-is.ok \
	t-mod-ld-pre.ok \
	t-rie-xx.ok \
#

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/d10v/run ]; then \
    echo ../../../sim/d10v/run ; \
  else \
    echo $(target_alias)-run ; \
  fi`

# Force d10v into operating mode.
RUNFLAGS_FOR_TARGET=-o


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)

clean:
	rm -f $(TESTS)
	rm -f *.run *.o
	rm -f core *.core

# Rules for running the tests

.SUFFIXES: .ok .run .hi .ko .ti
.run.ok:
	rm -f tmp-$* $*.hi
	ulimit -t 5 ; \
	$(RUN_FOR_TARGET) $(RUNFLAGS_FOR_TARGET) $*.run > tmp-$*
	mv tmp-$* $*.ok
.run.hi:
	rm -f tmp-$* $*.hi diff-$*
	ulimit -t 5 ; \
	$(RUN_FOR_TARGET) $(RUNFLAGS_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) $(RUNFLAGS_FOR_TARGET) $*.run > tmp-$* ; \
	if [ $$? -eq 47 ] ; then \
	  exit 0 ; \
	else \
	  exit 1 ; \
	fi
	mv tmp-$* $*.ko
.run.ti:
	rm -f tmp-$* $*.ti
	set +e ; \
	ulimit -t 5 ; \
	$(RUN_FOR_TARGET) $(RUNFLAGS_FOR_TARGET) $(INTFLAGS_FOR_TARGET) $*.run > tmp-$*
	test `cat tmp-$* | wc -l` -eq 10 < /dev/null
	test `grep Tick tmp-$* | wc -l` -eq 10 < /dev/null
	mv tmp-$* $*.ti


# Rules for building the test
# Preference is for obtaining the executable (.run) from a prebuilt image

.SUFFIXES: .uue .s .S .run
.uue.run:
	head $* | grep $*.run > /dev/null
	uudecode $*.uue
.run.u:
	uuencode < $*.run $*.run > $*.u
.o.run:
	$(LD_FOR_TARGET) $(LDFLAGS_FOR_TARGET) -o $*.run $*.o
.s.o:
	$(AS_FOR_TARGET) $(ASFLAGS_FOR_TARGET) -I$(srcdir) $(srcdir)/$*.s -o $*.o
.S.o:
	$(AS_FOR_TARGET) $(ASFLAGS_FOR_TARGET) -I$(srcdir) $(srcdir)/$*.S -o $*.o


Makefile: Makefile.in config.status
	$(SHELL) ./config.status

config.status: configure
	$(SHELL) ./config.status --recheck