summaryrefslogtreecommitdiffstats
path: root/contrib/gdtoa/test/makefile
blob: 7e48915316fd2ee63dfcbd41dadb6ce43f9cb401 (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
# /****************************************************************
# Copyright (C) 1998, 2000 by Lucent Technologies
# All Rights Reserved
#
# Permission to use, copy, modify, and distribute this software and
# its documentation for any purpose and without fee is hereby
# granted, provided that the above copyright notice appear in all
# copies and that both that the copyright notice and this
# permission notice and warranty disclaimer appear in supporting
# documentation, and that the name of Lucent or any of its entities
# not be used in advertising or publicity pertaining to
# distribution of the software without specific, written prior
# permission.
#
# LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
# IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY
# SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
# IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
# ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
# THIS SOFTWARE.
#
# ****************************************************************/

.SUFFIXES: .c .o
CC = cc
CFLAGS = -g -I..
A = ../gdtoa.a

.c.o:
	$(CC) -c $(CFLAGS) $*.c

all: dt dItest ddtest dtest ftest Qtest xLtest xtest ddtestsi dItestsi tests

dt = dt.o $A
dt: $(dt)
	$(CC) -o dt $(dt)

dItest = dItest.o getround.o $A
dItest: $(dItest)
	$(CC) -o dItest $(dItest)

ddtest = ddtest.o getround.o $A
ddtest: $(ddtest)
	$(CC) -o ddtest $(ddtest)

dtest = dtest.o getround.o $A
dtest: $(dtest)
	$(CC) -o dtest $(dtest)

ftest = ftest.o getround.o $A
ftest: $(ftest)
	$(CC) -o ftest $(ftest)

Qtest = Qtest.o getround.o $A
Qtest: $(Qtest)
	$(CC) -o Qtest $(Qtest)

xtest = xtest.o getround.o $A
xtest: $(xtest)
	$(CC) -o xtest $(xtest)

xLtest = xLtest.o getround.o $A
xLtest: $(xLtest)
	$(CC) -o xLtest $(xLtest)

strtopddSI.o: strtopddSI.c ../strtopdd.c

strtorddSI.o: strtorddSI.c ../strtordd.c

strtodISI.o: strtodISI.c ../strtodI.c

strtoIddSI.o: strtoIddSI.c ../strtoIdd.c

strtoIdSI.o: strtoIdSI.c ../strtoId.c

ddtestsi = ddtest.o strtopddSI.o strtorddSI.o strtoIddSI.o getround.o $A
ddtestsi: $(ddtestsi)
	$(CC) -o ddtestsi $(ddtestsi)

dItestsi = dItest.o strtodISI.o strtoIdSI.o getround.o $A
dItestsi: $(dItestsi)
	$(CC) -o dItestsi $(dItestsi)

strtodt = strtodt.o $A
strtodt: $(strtodt)
	$(CC) -o strtodt $(strtodt)

# xQtest generates cp commands that depend on sizeof(long double).
# See the source for details.  If you know better, create Q.out,
# x.out and xL.out by copying the relevant *.ou0 or *.ou1 files
# to the corresponding .out files.  In short, the *.ou0 files are
# for long double == double; x.ou1 and xL.ou1 are for
# long double == extended (a la 80x87 and MC680x0), and Q.ou1 is
# for long double == quad.

Q.out x.out xL.out:
	$(CC) -o xQtest xQtest.c
	./xQtest | sh
	rm -f xQtest xQtest.o

## The rmdir below will fail if any test results differ.

tests: Q.out x.out xL.out dt dItest ddtest dtest ftest Qtest xLtest xtest ddtestsi dItestsi strtodt
	mkdir bad
	cat testnos testnos1 | ./dt >zap 2>&1
	cmp dtst.out zap || mv zap bad/dtst.out
	./dItest <testnos >zap 2>&1
	cmp dI.out zap || mv zap bad/dI.out
	./dItestsi <testnos >zap 2>&1
	cmp dIsi.out zap || mv zap bad/dIsi.out
	./ddtestsi <testnos >zap 2>&1
	cmp ddsi.out zap || mv zap bad/ddsi.out
	for i in dd d f x xL Q; do cat testnos rtestnos | \
	 ./"$$i"test >zap 2>&1;\
	cmp $$i.out zap || mv zap bad/$$i.out; done
	./strtodt testnos3 >bad/strtodt.out && rm bad/strtodt.out || \
		cat bad/strtodt.out
	rmdir bad
	touch tests

xs0 = README Qtest.c dItest.c ddtest.c dtest.c dt.c ftest.c getround.c \
	strtoIdSI.c strtoIddSI.c strtodISI.c strtodt.c strtopddSI.c \
	strtorddSI.c xLtest.c xQtest.c xtest.c rtestnos testnos testnos1 \
	testnos3 dI.out dIsi.out ddsi.out dd.out dtst.out d.out f.out \
	x.ou0 xL.ou0 x.ou1 xL.ou1 Q.ou0 Q.ou1 makefile

xsum.out: xsum0.out $(xs0)
	xsum $(xs0) >xsum1.out
	cmp xsum0.out xsum1.out && mv xsum1.out xsum.out || diff xsum[01].out

clean:
	rm -f *.[ao] dt *test *testsi strtodt xsum.out xsum1.out tests zap x.out xL.out Q.out
	rm -rf bad
OpenPOWER on IntegriCloud