1 # /****************************************************************
2 # Copyright (C) 1998, 2000 by Lucent Technologies
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
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
24 # ****************************************************************/
32 #use "L1=-lm" when compiled with -DHonor_FLTP_ROUNDS or -DUSE_LOCALE
33 INFFIX = | sed 's/[Ii][Nn][Ff][intyINTY]*/Infinity/g'
36 $(CC) -c $(CFLAGS) $*.c
38 all: dt dItest ddtest dtest ftest Qtest xLtest xtest ddtestsi dItestsi tests
44 dItest = dItest.o getround.o $A
46 $(CC) -o dItest $(dItest) $(L1)
48 ddtest = ddtest.o getround.o $A
50 $(CC) -o ddtest $(ddtest) $L
52 dtest = dtest.o getround.o $A
54 $(CC) -o dtest $(dtest) $L
56 ftest = ftest.o getround.o $A
58 $(CC) -o ftest $(ftest) $(L1)
60 Qtest = Qtest.o getround.o $A
62 $(CC) -o Qtest $(Qtest) $(L1)
64 xtest = xtest.o getround.o $A
66 $(CC) -o xtest $(xtest) $(L1)
68 xLtest = xLtest.o getround.o $A
70 $(CC) -o xLtest $(xLtest) $(L1)
72 strtopddSI.o: strtopddSI.c ../strtopdd.c
74 strtorddSI.o: strtorddSI.c ../strtordd.c
76 strtodISI.o: strtodISI.c ../strtodI.c
78 strtoIddSI.o: strtoIddSI.c ../strtoIdd.c
80 strtoIdSI.o: strtoIdSI.c ../strtoId.c
82 ddtestsi = ddtest.o strtopddSI.o strtorddSI.o strtoIddSI.o getround.o $A
84 $(CC) -o ddtestsi $(ddtestsi) $L
86 dItestsi = dItest.o strtodISI.o strtoIdSI.o getround.o $A
88 $(CC) -o dItestsi $(dItestsi) $(L1)
90 strtodt = strtodt.o $A
92 $(CC) -o strtodt $(strtodt) $L
94 ## On Intel (and Intel-like) systems using extended-precision registers
95 ## for double-precision (C type double) computations that sometimes suffer
96 ## double rounding errors, the test below involving strtodt generally shows
97 ## five lines of unexpected results. Variant strtodtnrp uses ../strtodrnp.c
98 ## (which does all computations in integer arithmetic) and should show no
99 ## unexpected results.
101 strtodtnrp = strtodt.o ../strtodnrp.c $A
102 strtodtnrp: $(strtodtnrp)
103 $(CC) -o strtodtnrp $(strtodtnrp)
105 # xQtest generates cp commands that depend on sizeof(long double).
106 # See the source for details. If you know better, create Q.out,
107 # x.out and xL.out by copying the relevant *.ou0 or *.ou1 files
108 # to the corresponding .out files. In short, the *.ou0 files are
109 # for long double == double; x.ou1 and xL.ou1 are for
110 # long double == extended (a la 80x87 and MC680x0), and Q.ou1 is
111 # for long double == quad.
114 $(CC) -o xQtest xQtest.c
116 rm -f xQtest xQtest.o
118 ## The rmdir below will fail if any test results differ.
120 tests: Q.out x.out xL.out dt dItest ddtest dtest ftest Qtest xLtest xtest ddtestsi dItestsi strtodt strtodtnrp
122 cat testnos testnos1 | ./dt $(INFFIX) >zap 2>&1
123 cmp dtst.out zap || mv zap bad/dtst.out
124 ./dItest <testnos $(INFFIX) >zap 2>&1
125 cmp dI.out zap || mv zap bad/dI.out
126 ./dItestsi <testnos $(INFFIX) >zap 2>&1
127 cmp dIsi.out zap || mv zap bad/dIsi.out
128 ./ddtestsi <testnos $(INFFIX) >zap 2>&1
129 cmp ddsi.out zap || mv zap bad/ddsi.out
130 for i in dd d f x xL Q; do cat testnos rtestnos | \
131 ./"$$i"test $(INFFIX) >zap 2>&1;\
132 cmp $$i.out zap || mv zap bad/$$i.out; done
133 ./strtodt testnos3 >bad/strtodt.out && rm bad/strtodt.out || \
135 ./strtodtnrp testnos3 >bad/strtodtnrp.out && rm bad/strtodtnrp.out || \
136 cat bad/strtodtnrp.out
137 rmdir bad 2>/dev/null || \
138 (cd bad; for i in *; do cmp -s $$i ../obad/$$i && rm $$i;done; cd ..; rmdir bad)
141 xs0 = README Qtest.c dItest.c ddtest.c dtest.c dt.c ftest.c getround.c \
142 strtoIdSI.c strtoIddSI.c strtodISI.c strtodt.c strtopddSI.c \
143 strtorddSI.c xLtest.c xQtest.c xtest.c rtestnos testnos testnos1 \
144 testnos3 dI.out dIsi.out ddsi.out dd.out dtst.out d.out f.out \
145 x.ou0 xL.ou0 x.ou1 xL.ou1 Q.ou0 Q.ou1 makefile
147 xsum.out: xsum0.out $(xs0)
148 xsum $(xs0) >xsum1.out
149 cmp xsum0.out xsum1.out && mv xsum1.out xsum.out || diff xsum[01].out
152 rm -f *.[ao] dt *test *testsi strtodt strtodtnrp xsum.out xsum1.out tests zap x.out xL.out Q.out