]> CyberLeo.Net >> Repos - FreeBSD/releng/7.2.git/blob - contrib/gdtoa/test/makefile
Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.
[FreeBSD/releng/7.2.git] / contrib / gdtoa / test / makefile
1 # /****************************************************************
2 # Copyright (C) 1998, 2000 by Lucent Technologies
3 # All Rights Reserved
4 #
5 # Permission to use, copy, modify, and distribute this software and
6 # its documentation for any purpose and without fee is hereby
7 # granted, provided that the above copyright notice appear in all
8 # copies and that both that the copyright notice and this
9 # permission notice and warranty disclaimer appear in supporting
10 # documentation, and that the name of Lucent or any of its entities
11 # not be used in advertising or publicity pertaining to
12 # distribution of the software without specific, written prior
13 # permission.
14 #
15 # LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16 # INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
17 # IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY
18 # SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
20 # IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
21 # ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
22 # THIS SOFTWARE.
23 #
24 # ****************************************************************/
25
26 .SUFFIXES: .c .o
27 CC = cc
28 CFLAGS = -g -I..
29 A = ../gdtoa.a
30 L = -lm
31 INFFIX = | sed 's/[Ii][Nn][Ff][intyINTY]*/Infinity/g'
32
33 .c.o:
34         $(CC) -c $(CFLAGS) $*.c
35
36 all: dt dItest ddtest dtest ftest Qtest xLtest xtest ddtestsi dItestsi tests
37
38 dt = dt.o $A
39 dt: $(dt)
40         $(CC) -o dt $(dt) $L
41
42 dItest = dItest.o getround.o $A
43 dItest: $(dItest)
44         $(CC) -o dItest $(dItest)
45
46 ddtest = ddtest.o getround.o $A
47 ddtest: $(ddtest)
48         $(CC) -o ddtest $(ddtest) $L
49
50 dtest = dtest.o getround.o $A
51 dtest: $(dtest)
52         $(CC) -o dtest $(dtest) $L
53
54 ftest = ftest.o getround.o $A
55 ftest: $(ftest)
56         $(CC) -o ftest $(ftest)
57
58 Qtest = Qtest.o getround.o $A
59 Qtest: $(Qtest)
60         $(CC) -o Qtest $(Qtest)
61
62 xtest = xtest.o getround.o $A
63 xtest: $(xtest)
64         $(CC) -o xtest $(xtest)
65
66 xLtest = xLtest.o getround.o $A
67 xLtest: $(xLtest)
68         $(CC) -o xLtest $(xLtest)
69
70 strtopddSI.o: strtopddSI.c ../strtopdd.c
71
72 strtorddSI.o: strtorddSI.c ../strtordd.c
73
74 strtodISI.o: strtodISI.c ../strtodI.c
75
76 strtoIddSI.o: strtoIddSI.c ../strtoIdd.c
77
78 strtoIdSI.o: strtoIdSI.c ../strtoId.c
79
80 ddtestsi = ddtest.o strtopddSI.o strtorddSI.o strtoIddSI.o getround.o $A
81 ddtestsi: $(ddtestsi)
82         $(CC) -o ddtestsi $(ddtestsi) $L
83
84 dItestsi = dItest.o strtodISI.o strtoIdSI.o getround.o $A
85 dItestsi: $(dItestsi)
86         $(CC) -o dItestsi $(dItestsi)
87
88 strtodt = strtodt.o $A
89 strtodt: $(strtodt)
90         $(CC) -o strtodt $(strtodt) $L
91
92 ## On Intel (and Intel-like) systems using extended-precision registers
93 ## for double-precision (C type double) computations that sometimes suffer
94 ## double rounding errors, the test below involving strtodt generally shows
95 ## five lines of unexpected results.  Variant strtodtnrp uses ../strtodrnp.c
96 ## (which does all computations in integer arithmetic) and should show no
97 ## unexpected results.
98
99 strtodtnrp = strtodt.o ../strtodnrp.c $A
100 strtodtnrp: $(strtodtnrp)
101         $(CC) -o strtodtnrp $(strtodtnrp)
102
103 # xQtest generates cp commands that depend on sizeof(long double).
104 # See the source for details.  If you know better, create Q.out,
105 # x.out and xL.out by copying the relevant *.ou0 or *.ou1 files
106 # to the corresponding .out files.  In short, the *.ou0 files are
107 # for long double == double; x.ou1 and xL.ou1 are for
108 # long double == extended (a la 80x87 and MC680x0), and Q.ou1 is
109 # for long double == quad.
110
111 Q.out x.out xL.out:
112         $(CC) -o xQtest xQtest.c
113         ./xQtest | sh
114         rm -f xQtest xQtest.o
115
116 ## The rmdir below will fail if any test results differ.
117
118 tests: Q.out x.out xL.out dt dItest ddtest dtest ftest Qtest xLtest xtest ddtestsi dItestsi strtodt strtodtnrp
119         mkdir bad
120         cat testnos testnos1 | ./dt $(INFFIX) >zap 2>&1
121         cmp dtst.out zap || mv zap bad/dtst.out
122         ./dItest <testnos $(INFFIX) >zap 2>&1
123         cmp dI.out zap || mv zap bad/dI.out
124         ./dItestsi <testnos $(INFFIX) >zap 2>&1
125         cmp dIsi.out zap || mv zap bad/dIsi.out
126         ./ddtestsi <testnos $(INFFIX) >zap 2>&1
127         cmp ddsi.out zap || mv zap bad/ddsi.out
128         for i in dd d f x xL Q; do cat testnos rtestnos | \
129          ./"$$i"test $(INFFIX) >zap 2>&1;\
130         cmp $$i.out zap || mv zap bad/$$i.out; done
131         ./strtodt testnos3 >bad/strtodt.out && rm bad/strtodt.out || \
132                 cat bad/strtodt.out
133         ./strtodtnrp testnos3 >bad/strtodtnrp.out && rm bad/strtodtnrp.out || \
134                 cat bad/strtodtnrp.out
135         rmdir bad
136         touch tests
137
138 xs0 = README Qtest.c dItest.c ddtest.c dtest.c dt.c ftest.c getround.c \
139         strtoIdSI.c strtoIddSI.c strtodISI.c strtodt.c strtopddSI.c \
140         strtorddSI.c xLtest.c xQtest.c xtest.c rtestnos testnos testnos1 \
141         testnos3 dI.out dIsi.out ddsi.out dd.out dtst.out d.out f.out \
142         x.ou0 xL.ou0 x.ou1 xL.ou1 Q.ou0 Q.ou1 makefile
143
144 xsum.out: xsum0.out $(xs0)
145         xsum $(xs0) >xsum1.out
146         cmp xsum0.out xsum1.out && mv xsum1.out xsum.out || diff xsum[01].out
147
148 clean:
149         rm -f *.[ao] dt *test *testsi strtodt strtodtnrp xsum.out xsum1.out tests zap x.out xL.out Q.out
150         rm -rf bad