1# $NetBSD: makefile,v 1.3 2006/01/25 16:40:57 kleink Exp $ 2 3# /**************************************************************** 4# Copyright (C) 1998 by Lucent Technologies 5# All Rights Reserved 6# 7# Permission to use, copy, modify, and distribute this software and 8# its documentation for any purpose and without fee is hereby 9# granted, provided that the above copyright notice appear in all 10# copies and that both that the copyright notice and this 11# permission notice and warranty disclaimer appear in supporting 12# documentation, and that the name of Lucent or any of its entities 13# not be used in advertising or publicity pertaining to 14# distribution of the software without specific, written prior 15# permission. 16# 17# LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 18# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. 19# IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY 20# SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 21# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER 22# IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 23# ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF 24# THIS SOFTWARE. 25# 26# ****************************************************************/ 27 28.SUFFIXES: .c .o 29CC = cc 30CFLAGS = -g -DINFNAN_CHECK 31 32.c.o: 33 $(CC) -c $(CFLAGS) $*.c 34 35all: arith.h gd_qnan.h gdtoa.a 36 37arith.h: arithchk.c 38 $(CC) $(CFLAGS) arithchk.c || $(CC) -DNO_LONG_LONG $(CFLAGS) arithchk.c 39 ./a.out >arith.h 40 rm -f a.out arithchk.o 41 42gd_qnan.h: arith.h qnan.c 43 $(CC) $(CFLAGS) qnan.c 44 ./a.out >gd_qnan.h 45 rm -f a.out qnan.o 46 47gdtoa.a: dmisc.c dtoa.c g_Qfmt.c g__fmt.c g_ddfmt.c g_dfmt.c g_ffmt.c\ 48 g_xLfmt.c g_xfmt.c gdtoa.c gethex.c gmisc.c hd_init.c hexnan.c\ 49 misc.c smisc.c strtoIQ.c strtoId.c strtoIdd.c strtoIf.c strtoIg.c\ 50 strtoIx.c strtoIxL.c strtod.c strtodI.c strtodg.c strtof.c strtopQ.c\ 51 strtopd.c strtopdd.c strtopf.c strtopx.c strtopxL.c strtorQ.c\ 52 strtord.c strtordd.c strtorf.c strtorx.c strtorxL.c sum.c ulp.c 53 $(CC) -c $(CFLAGS) $? 54 x=`echo $? | sed 's/\.c/.o/g'` && ar ruv gdtoa.a $$x && rm $$x 55 ranlib gdtoa.a || true 56 57# If your system lacks ranlib, you do not need it. 58 59xs0 = README arithchk.c dmisc.c dtoa.c g_Qfmt.c g__fmt.c g_ddfmt.c g_dfmt.c\ 60 g_ffmt.c g_xLfmt.c g_xfmt.c gdtoa.c gdtoa.h gdtoaimp.h gethex.c\ 61 gmisc.c hd_init.c hexnan.c makefile misc.c qnan.c smisc.c strtoIQ.c\ 62 strtoId.c strtoIdd.c strtoIf.c strtoIg.c strtoIx.c strtoIxL.c\ 63 strtod.c strtodI.c strtodg.c strtodnrp.c strtof.c strtopQ.c strtopd.c\ 64 strtopdd.c strtopf.c strtopx.c strtopxL.c strtorQ.c strtord.c strtordd.c\ 65 strtorf.c strtorx.c strtorxL.c sum.c ulp.c 66 67# "make xsum.out" to check for transmission errors; source for xsum is 68# netlib's "xsum.c from f2c", e.g., 69# ftp://netlib.bell-labs.com/netlib/f2c/xsum.c.gz 70 71xsum.out: xsum0.out $(xs0) 72 xsum $(xs0) >xsum1.out 73 cmp xsum0.out xsum1.out && mv xsum1.out xsum.out || diff xsum[01].out 74 75clean: 76 rm -f arith.h gd_qnan.h *.[ao] xsum.out xsum1.out 77