11.4Schristos# $NetBSD: makefile,v 1.4 2011/03/20 23:15:35 christos Exp $
21.1Skleink
31.1Skleink# /****************************************************************
41.1Skleink# Copyright (C) 1998 by Lucent Technologies
51.1Skleink# All Rights Reserved
61.1Skleink#
71.1Skleink# Permission to use, copy, modify, and distribute this software and
81.1Skleink# its documentation for any purpose and without fee is hereby
91.1Skleink# granted, provided that the above copyright notice appear in all
101.1Skleink# copies and that both that the copyright notice and this
111.1Skleink# permission notice and warranty disclaimer appear in supporting
121.1Skleink# documentation, and that the name of Lucent or any of its entities
131.1Skleink# not be used in advertising or publicity pertaining to
141.1Skleink# distribution of the software without specific, written prior
151.1Skleink# permission.
161.1Skleink#
171.1Skleink# LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
181.1Skleink# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
191.1Skleink# IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY
201.1Skleink# SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
211.1Skleink# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
221.1Skleink# IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
231.1Skleink# ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
241.1Skleink# THIS SOFTWARE.
251.1Skleink#
261.1Skleink# ****************************************************************/
271.1Skleink
281.1Skleink.SUFFIXES: .c .o
291.1SkleinkCC = cc
301.4SchristosCFLAGS = -g
311.3Skleink
321.1Skleink.c.o:
331.1Skleink	$(CC) -c $(CFLAGS) $*.c
341.1Skleink
351.4Schristos# invoke "make Printf" to add printf.o to gdtoa.a (if desired)
361.4Schristos
371.1Skleinkall: arith.h gd_qnan.h gdtoa.a
381.1Skleink
391.1Skleinkarith.h: arithchk.c
401.1Skleink	$(CC) $(CFLAGS) arithchk.c || $(CC) -DNO_LONG_LONG $(CFLAGS) arithchk.c
411.1Skleink	./a.out >arith.h
421.1Skleink	rm -f a.out arithchk.o
431.1Skleink
441.1Skleinkgd_qnan.h: arith.h qnan.c
451.1Skleink	$(CC) $(CFLAGS) qnan.c
461.1Skleink	./a.out >gd_qnan.h
471.1Skleink	rm -f a.out qnan.o
481.1Skleink
491.4Schristosgdtoa.a:  dmisc.c dtoa.c g_Qfmt.c g__fmt.c g_ddfmt.c g_dfmt.c\
501.4Schristos	 g_ffmt.c g_xLfmt.c g_xfmt.c gdtoa.c gethex.c gmisc.c hd_init.c\
511.4Schristos	 hexnan.c misc.c smisc.c strtoIQ.c strtoId.c strtoIdd.c\
521.4Schristos	 strtoIf.c strtoIg.c strtoIx.c strtoIxL.c strtod.c strtodI.c\
531.4Schristos	 strtodg.c strtof.c strtopQ.c strtopd.c strtopdd.c strtopf.c\
541.4Schristos	 strtopx.c strtopxL.c strtorQ.c strtord.c strtordd.c strtorf.c\
551.4Schristos	 strtorx.c strtorxL.c sum.c ulp.c
561.1Skleink	$(CC) -c $(CFLAGS) $?
571.1Skleink	x=`echo $? | sed 's/\.c/.o/g'` && ar ruv gdtoa.a $$x && rm $$x
581.1Skleink	ranlib gdtoa.a || true
591.1Skleink
601.4SchristosPrintf: all printf.c
611.4Schristos	$(CC) -c $(CFLAGS) printf.c
621.4Schristos	ar ruv gdtoa.a printf.o
631.4Schristos	rm printf.o
641.4Schristos	touch Printf
651.4Schristos
661.1Skleink# If your system lacks ranlib, you do not need it.
671.1Skleink
681.4Schristosxs0 = README arithchk.c dmisc.c dtoa.c g_Qfmt.c g__fmt.c g_ddfmt.c\
691.4Schristos	 g_dfmt.c g_ffmt.c g_xLfmt.c g_xfmt.c gdtoa.c gdtoa.h\
701.4Schristos	 gdtoa_fltrnds.h gdtoaimp.h gethex.c gmisc.c hd_init.c hexnan.c\
711.4Schristos	 makefile misc.c printf.c printf.c0 qnan.c smisc.c stdio1.h\
721.4Schristos	 strtoIQ.c strtoId.c strtoIdd.c strtoIf.c strtoIg.c strtoIx.c\
731.4Schristos	 strtoIxL.c strtod.c strtodI.c strtodg.c strtodnrp.c strtof.c\
741.4Schristos	 strtopQ.c strtopd.c strtopdd.c strtopf.c strtopx.c strtopxL.c\
751.4Schristos	 strtorQ.c strtord.c strtordd.c strtorf.c strtorx.c strtorxL.c\
761.4Schristos	 sum.c ulp.c
771.1Skleink
781.4Schristos# "make -r xsum.out" to check for transmission errors; source for xsum is
791.1Skleink# netlib's "xsum.c from f2c", e.g.,
801.1Skleink# ftp://netlib.bell-labs.com/netlib/f2c/xsum.c.gz
811.1Skleink
821.1Skleinkxsum.out: xsum0.out $(xs0)
831.1Skleink	xsum $(xs0) >xsum1.out
841.1Skleink	cmp xsum0.out xsum1.out && mv xsum1.out xsum.out || diff xsum[01].out
851.1Skleink
861.1Skleinkclean:
871.4Schristos	rm -f arith.h gd_qnan.h *.[ao] Printf xsum.out xsum1.out
88