makefile revision 1.1
11.1Schristos# /****************************************************************
21.1Schristos# Copyright (C) 1998, 2000 by Lucent Technologies
31.1Schristos# All Rights Reserved
41.1Schristos#
51.1Schristos# Permission to use, copy, modify, and distribute this software and
61.1Schristos# its documentation for any purpose and without fee is hereby
71.1Schristos# granted, provided that the above copyright notice appear in all
81.1Schristos# copies and that both that the copyright notice and this
91.1Schristos# permission notice and warranty disclaimer appear in supporting
101.1Schristos# documentation, and that the name of Lucent or any of its entities
111.1Schristos# not be used in advertising or publicity pertaining to
121.1Schristos# distribution of the software without specific, written prior
131.1Schristos# permission.
141.1Schristos#
151.1Schristos# LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
161.1Schristos# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
171.1Schristos# IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY
181.1Schristos# SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
191.1Schristos# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
201.1Schristos# IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
211.1Schristos# ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
221.1Schristos# THIS SOFTWARE.
231.1Schristos#
241.1Schristos# ****************************************************************/
251.1Schristos
261.1Schristos.SUFFIXES: .c .o
271.1SchristosCC = cc
281.1SchristosCFLAGS = -g -I..
291.1SchristosA = ../gdtoa.a
301.1SchristosL = -lm
311.1SchristosL1 =
321.1Schristos#use "L1=-lm" when compiled with -DHonor_FLTP_ROUNDS or -DUSE_LOCALE
331.1SchristosINFFIX = | sed 's/[Ii][Nn][Ff][intyINTY]*/Infinity/g'
341.1Schristos
351.1Schristos.c.o:
361.1Schristos	$(CC) -c $(CFLAGS) $*.c
371.1Schristos
381.1Schristosall: dt dItest ddtest dtest ftest Qtest xLtest xtest ddtestsi dItestsi tests
391.1Schristos
401.1Schristosdt = dt.o $A
411.1Schristosdt: $(dt)
421.1Schristos	$(CC) -o dt $(dt) $L
431.1Schristos
441.1SchristosdItest = dItest.o getround.o $A
451.1SchristosdItest: $(dItest)
461.1Schristos	$(CC) -o dItest $(dItest) $(L1)
471.1Schristos
481.1Schristosddtest = ddtest.o getround.o $A
491.1Schristosddtest: $(ddtest)
501.1Schristos	$(CC) -o ddtest $(ddtest) $L
511.1Schristos
521.1Schristosdtest = dtest.o getround.o $A
531.1Schristosdtest: $(dtest)
541.1Schristos	$(CC) -o dtest $(dtest) $L
551.1Schristos
561.1Schristosftest = ftest.o getround.o $A
571.1Schristosftest: $(ftest)
581.1Schristos	$(CC) -o ftest $(ftest) $(L1)
591.1Schristos
601.1SchristosQtest = Qtest.o getround.o $A
611.1SchristosQtest: $(Qtest)
621.1Schristos	$(CC) -o Qtest $(Qtest) $(L1)
631.1Schristos
641.1Schristosxtest = xtest.o getround.o $A
651.1Schristosxtest: $(xtest)
661.1Schristos	$(CC) -o xtest $(xtest) $(L1)
671.1Schristos
681.1SchristosxLtest = xLtest.o getround.o $A
691.1SchristosxLtest: $(xLtest)
701.1Schristos	$(CC) -o xLtest $(xLtest) $(L1)
711.1Schristos
721.1SchristosstrtopddSI.o: strtopddSI.c ../strtopdd.c
731.1Schristos
741.1SchristosstrtorddSI.o: strtorddSI.c ../strtordd.c
751.1Schristos
761.1SchristosstrtodISI.o: strtodISI.c ../strtodI.c
771.1Schristos
781.1SchristosstrtoIddSI.o: strtoIddSI.c ../strtoIdd.c
791.1Schristos
801.1SchristosstrtoIdSI.o: strtoIdSI.c ../strtoId.c
811.1Schristos
821.1Schristosddtestsi = ddtest.o strtopddSI.o strtorddSI.o strtoIddSI.o getround.o $A
831.1Schristosddtestsi: $(ddtestsi)
841.1Schristos	$(CC) -o ddtestsi $(ddtestsi) $L
851.1Schristos
861.1SchristosdItestsi = dItest.o strtodISI.o strtoIdSI.o getround.o $A
871.1SchristosdItestsi: $(dItestsi)
881.1Schristos	$(CC) -o dItestsi $(dItestsi) $(L1)
891.1Schristos
901.1Schristosstrtodt = strtodt.o $A
911.1Schristosstrtodt: $(strtodt)
921.1Schristos	$(CC) -o strtodt $(strtodt) $L
931.1Schristos
941.1Schristospftest = pftest.o $A
951.1Schristospftest: ../Printf  $(pftest)
961.1Schristos	$(CC) -o pftest $(pftest) $L
971.1Schristos
981.1Schristos## On Intel (and Intel-like) systems using extended-precision registers
991.1Schristos## for double-precision (C type double) computations that sometimes suffer
1001.1Schristos## double rounding errors, the test below involving strtodt generally shows
1011.1Schristos## five lines of unexpected results.  Variant strtodtnrp uses ../strtodrnp.c
1021.1Schristos## (which does all computations in integer arithmetic) and should show no
1031.1Schristos## unexpected results.
1041.1Schristos
1051.1Schristosstrtodtnrp = strtodt.o ../strtodnrp.c $A
1061.1Schristosstrtodtnrp: $(strtodtnrp)
1071.1Schristos	$(CC) -o strtodtnrp $(strtodtnrp)
1081.1Schristos
1091.1Schristos# xQtest generates cp commands that depend on sizeof(long double).
1101.1Schristos# See the source for details.  If you know better, create Q.out,
1111.1Schristos# x.out and xL.out by copying the relevant *.ou0 or *.ou1 files
1121.1Schristos# to the corresponding .out files.  In short, the *.ou0 files are
1131.1Schristos# for long double == double; x.ou1 and xL.ou1 are for
1141.1Schristos# long double == extended (a la 80x87 and MC680x0), and Q.ou1 is
1151.1Schristos# for long double == quad.
1161.1Schristos
1171.1SchristosQ.out x.out xL.out:
1181.1Schristos	$(CC) -o xQtest xQtest.c
1191.1Schristos	./xQtest | sh
1201.1Schristos	rm -f xQtest xQtest.o
1211.1Schristos
1221.1Schristos## The rmdir below will fail if any test results differ.
1231.1Schristos
1241.1Schristostests: Q.out x.out xL.out dt dItest ddtest dtest ftest Qtest xLtest xtest ddtestsi dItestsi strtodt strtodtnrp
1251.1Schristos	mkdir bad
1261.1Schristos	cat testnos testnos1 | ./dt $(INFFIX) >zap 2>&1
1271.1Schristos	cmp dtst.out zap || mv zap bad/dtst.out
1281.1Schristos	./dItest <testnos $(INFFIX) >zap 2>&1
1291.1Schristos	cmp dI.out zap || mv zap bad/dI.out
1301.1Schristos	./dItestsi <testnos $(INFFIX) >zap 2>&1
1311.1Schristos	cmp dIsi.out zap || mv zap bad/dIsi.out
1321.1Schristos	./ddtestsi <testnos $(INFFIX) >zap 2>&1
1331.1Schristos	cmp ddsi.out zap || mv zap bad/ddsi.out
1341.1Schristos	for i in dd d f x xL Q; do cat testnos rtestnos | \
1351.1Schristos	 ./"$$i"test $(INFFIX) >zap 2>&1;\
1361.1Schristos	cmp $$i.out zap || mv zap bad/$$i.out; done
1371.1Schristos	./strtodt testnos3 >bad/strtodt.out && rm bad/strtodt.out || \
1381.1Schristos		cat bad/strtodt.out
1391.1Schristos	./strtodtnrp testnos3 >bad/strtodtnrp.out && rm bad/strtodtnrp.out || \
1401.1Schristos		cat bad/strtodtnrp.out
1411.1Schristos	rmdir bad 2>/dev/null || \
1421.1Schristos	(cd bad; for i in *; do cmp -s $$i ../obad/$$i && rm $$i;done; cd ..; rmdir bad)
1431.1Schristos	touch tests
1441.1Schristos
1451.1Schristos# To test Printf in ../gdtoa.a, "make pf_test" and perhaps "make pf_testLq"
1461.1Schristos# (if both long double and quad are desired and available).
1471.1Schristos
1481.1Schristospf_test: pftest
1491.1Schristos	./pftest <pftestnos >zap
1501.1Schristos	cmp pftest.out zap && rm zap
1511.1Schristos
1521.1Schristospf_testLq: pftest
1531.1Schristos	./pftest <pfLqtestnos >zap
1541.1Schristos	cmp pftestLq.out zap && rm zap
1551.1Schristos
1561.1Schristosxs0 = README Q.ou0 Q.ou1 Qtest.c d.out dI.out dIsi.out dItest.c dd.out\
1571.1Schristos	 ddsi.out ddtest.c dt.c dtest.c dtst.out f.out ftest.c\
1581.1Schristos	 getround.c makefile pfLqtestnos pftest.c pftestQ.out\
1591.1Schristos	 pftestx.out pftestLq.out pftestnos rtestnos strtoIdSI.c\
1601.1Schristos	 strtoIddSI.c strtodISI.c strtodt.c strtopddSI.c strtorddSI.c\
1611.1Schristos	 testnos testnos1 testnos3 x.ou0 x.ou1 xL.ou0 xL.ou1 xLtest.c\
1621.1Schristos	 xQtest.c xtest.c
1631.1Schristos
1641.1Schristos# invoke "make -r xsum.out"
1651.1Schristosxsum.out: xsum0.out $(xs0)
1661.1Schristos	xsum $(xs0) >xsum1.out
1671.1Schristos	cmp xsum0.out xsum1.out && mv xsum1.out xsum.out || diff xsum[01].out
1681.1Schristos
1691.1Schristosclean:
1701.1Schristos	rm -f *.[ao] dt *test *testsi pftest.out strtodt strtodtnrp xsum.out\
1711.1Schristos	 xsum1.out tests zap x.out xL.out Q.out
1721.1Schristos	rm -rf bad
173