makefile revision 1.1
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 27CC = cc 28CFLAGS = -g -I.. 29A = ../gdtoa.a 30L = -lm 31L1 = 32#use "L1=-lm" when compiled with -DHonor_FLTP_ROUNDS or -DUSE_LOCALE 33INFFIX = | sed 's/[Ii][Nn][Ff][intyINTY]*/Infinity/g' 34 35.c.o: 36 $(CC) -c $(CFLAGS) $*.c 37 38all: dt dItest ddtest dtest ftest Qtest xLtest xtest ddtestsi dItestsi tests 39 40dt = dt.o $A 41dt: $(dt) 42 $(CC) -o dt $(dt) $L 43 44dItest = dItest.o getround.o $A 45dItest: $(dItest) 46 $(CC) -o dItest $(dItest) $(L1) 47 48ddtest = ddtest.o getround.o $A 49ddtest: $(ddtest) 50 $(CC) -o ddtest $(ddtest) $L 51 52dtest = dtest.o getround.o $A 53dtest: $(dtest) 54 $(CC) -o dtest $(dtest) $L 55 56ftest = ftest.o getround.o $A 57ftest: $(ftest) 58 $(CC) -o ftest $(ftest) $(L1) 59 60Qtest = Qtest.o getround.o $A 61Qtest: $(Qtest) 62 $(CC) -o Qtest $(Qtest) $(L1) 63 64xtest = xtest.o getround.o $A 65xtest: $(xtest) 66 $(CC) -o xtest $(xtest) $(L1) 67 68xLtest = xLtest.o getround.o $A 69xLtest: $(xLtest) 70 $(CC) -o xLtest $(xLtest) $(L1) 71 72strtopddSI.o: strtopddSI.c ../strtopdd.c 73 74strtorddSI.o: strtorddSI.c ../strtordd.c 75 76strtodISI.o: strtodISI.c ../strtodI.c 77 78strtoIddSI.o: strtoIddSI.c ../strtoIdd.c 79 80strtoIdSI.o: strtoIdSI.c ../strtoId.c 81 82ddtestsi = ddtest.o strtopddSI.o strtorddSI.o strtoIddSI.o getround.o $A 83ddtestsi: $(ddtestsi) 84 $(CC) -o ddtestsi $(ddtestsi) $L 85 86dItestsi = dItest.o strtodISI.o strtoIdSI.o getround.o $A 87dItestsi: $(dItestsi) 88 $(CC) -o dItestsi $(dItestsi) $(L1) 89 90strtodt = strtodt.o $A 91strtodt: $(strtodt) 92 $(CC) -o strtodt $(strtodt) $L 93 94pftest = pftest.o $A 95pftest: ../Printf $(pftest) 96 $(CC) -o pftest $(pftest) $L 97 98## On Intel (and Intel-like) systems using extended-precision registers 99## for double-precision (C type double) computations that sometimes suffer 100## double rounding errors, the test below involving strtodt generally shows 101## five lines of unexpected results. Variant strtodtnrp uses ../strtodrnp.c 102## (which does all computations in integer arithmetic) and should show no 103## unexpected results. 104 105strtodtnrp = strtodt.o ../strtodnrp.c $A 106strtodtnrp: $(strtodtnrp) 107 $(CC) -o strtodtnrp $(strtodtnrp) 108 109# xQtest generates cp commands that depend on sizeof(long double). 110# See the source for details. If you know better, create Q.out, 111# x.out and xL.out by copying the relevant *.ou0 or *.ou1 files 112# to the corresponding .out files. In short, the *.ou0 files are 113# for long double == double; x.ou1 and xL.ou1 are for 114# long double == extended (a la 80x87 and MC680x0), and Q.ou1 is 115# for long double == quad. 116 117Q.out x.out xL.out: 118 $(CC) -o xQtest xQtest.c 119 ./xQtest | sh 120 rm -f xQtest xQtest.o 121 122## The rmdir below will fail if any test results differ. 123 124tests: Q.out x.out xL.out dt dItest ddtest dtest ftest Qtest xLtest xtest ddtestsi dItestsi strtodt strtodtnrp 125 mkdir bad 126 cat testnos testnos1 | ./dt $(INFFIX) >zap 2>&1 127 cmp dtst.out zap || mv zap bad/dtst.out 128 ./dItest <testnos $(INFFIX) >zap 2>&1 129 cmp dI.out zap || mv zap bad/dI.out 130 ./dItestsi <testnos $(INFFIX) >zap 2>&1 131 cmp dIsi.out zap || mv zap bad/dIsi.out 132 ./ddtestsi <testnos $(INFFIX) >zap 2>&1 133 cmp ddsi.out zap || mv zap bad/ddsi.out 134 for i in dd d f x xL Q; do cat testnos rtestnos | \ 135 ./"$$i"test $(INFFIX) >zap 2>&1;\ 136 cmp $$i.out zap || mv zap bad/$$i.out; done 137 ./strtodt testnos3 >bad/strtodt.out && rm bad/strtodt.out || \ 138 cat bad/strtodt.out 139 ./strtodtnrp testnos3 >bad/strtodtnrp.out && rm bad/strtodtnrp.out || \ 140 cat bad/strtodtnrp.out 141 rmdir bad 2>/dev/null || \ 142 (cd bad; for i in *; do cmp -s $$i ../obad/$$i && rm $$i;done; cd ..; rmdir bad) 143 touch tests 144 145# To test Printf in ../gdtoa.a, "make pf_test" and perhaps "make pf_testLq" 146# (if both long double and quad are desired and available). 147 148pf_test: pftest 149 ./pftest <pftestnos >zap 150 cmp pftest.out zap && rm zap 151 152pf_testLq: pftest 153 ./pftest <pfLqtestnos >zap 154 cmp pftestLq.out zap && rm zap 155 156xs0 = README Q.ou0 Q.ou1 Qtest.c d.out dI.out dIsi.out dItest.c dd.out\ 157 ddsi.out ddtest.c dt.c dtest.c dtst.out f.out ftest.c\ 158 getround.c makefile pfLqtestnos pftest.c pftestQ.out\ 159 pftestx.out pftestLq.out pftestnos rtestnos strtoIdSI.c\ 160 strtoIddSI.c strtodISI.c strtodt.c strtopddSI.c strtorddSI.c\ 161 testnos testnos1 testnos3 x.ou0 x.ou1 xL.ou0 xL.ou1 xLtest.c\ 162 xQtest.c xtest.c 163 164# invoke "make -r xsum.out" 165xsum.out: xsum0.out $(xs0) 166 xsum $(xs0) >xsum1.out 167 cmp xsum0.out xsum1.out && mv xsum1.out xsum.out || diff xsum[01].out 168 169clean: 170 rm -f *.[ao] dt *test *testsi pftest.out strtodt strtodtnrp xsum.out\ 171 xsum1.out tests zap x.out xL.out Q.out 172 rm -rf bad 173