1 # Based on original makefile included with the source.
2 # The source for libgdtoa imported from FreeBSD 7.0
3 # in /usr/src/contrib/gdtoa.
5 -include ..
/..
/config.mk
7 # Respect the environment
14 MARCH
=$(shell uname
-m
)
15 OSVER
=$(shell uname
-r
)
20 CFLAGS
= $(WARNINGS
) $(DEBUG
)
27 COMP
=@echo CC
$@
;$(CC
)
28 LINKER
=@echo LINK
$@
;$(CC
) $(LDOPT
)
33 ifeq ($(UNAME
),Darwin
)
34 SINGLE_MODULE
=-Wl
,-single_module
36 export MACOSX_DEPLOYMENT_TARGET
=10.5
38 export MACOSX_DEPLOYMENT_TARGET
=10.4
45 CFLAGS
+=-D__C99FEATURES__
48 ifeq ($(UNAME
),OpenBSD
)
56 OPTIMIZATIONS
=-O2
-funroll-loops
-finline-functions
$(INLINE_OPTS
)
59 ifeq ($(CPU
), powerpc
)
60 OPTIMIZATIONS
+=-falign-loops
=16
63 CFLAGS
+= -fPIC
$(CPPFLAGS
)
65 DEPS
= dmisc.c dtoa.c g_Qfmt.c g__fmt.c g_ddfmt.c g_dfmt.c g_ffmt.c\
66 g_xLfmt.c g_xfmt.c gdtoa.c gethex.c gmisc.c hd_init.c hexnan.c\
67 misc.c smisc.c strtoIQ.c strtoId.c strtoIdd.c strtoIf.c strtoIg.c\
68 strtoIx.c strtoIxL.c strtod.c strtodI.c strtodg.c strtof.c strtopQ.c\
69 strtopd.c strtopdd.c strtopf.c strtopx.c strtopxL.c strtorQ.c\
70 strtord.c strtordd.c strtorf.c strtorx.c strtorxL.c sum.c ulp.c
71 OBJS
= dmisc.o dtoa.o g_Qfmt.o g__fmt.o g_ddfmt.o g_dfmt.o g_ffmt.o\
72 g_xLfmt.o g_xfmt.o gdtoa.o gethex.o gmisc.o hd_init.o hexnan.o\
73 misc.o smisc.o strtoIQ.o strtoId.o strtoIdd.o strtoIf.o strtoIg.o\
74 strtoIx.o strtoIxL.o strtod.o strtodI.o strtodg.o strtof.o strtopQ.o\
75 strtopd.o strtopdd.o strtopf.o strtopx.o strtopxL.o strtorQ.o\
76 strtord.o strtordd.o strtorf.o strtorx.o strtorxL.o sum.o ulp.o
78 all: arith.h gd_qnan.h library
81 $(CC
) $(CFLAGS
) arithchk.c ||
$(CC
) -DNO_LONG_LONG
$(CFLAGS
) arithchk.c
83 rm -f a.out arithchk.o
85 gd_qnan.h
: arith.h qnan.c
86 $(CC
) $(CFLAGS
) qnan.c
91 $(COMP
) $(CFLAGS
) $(OPTIMIZATIONS
) -c
$< -o
$@
94 $(COMP
) $(CFLAGS
) $(OPTIMIZATIONS
) -c
$< -o
$@
99 $(CC
) -MM
$(CPPFLAGS
) $< > $@.
$$$$; \
100 sed
's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.
$$$$ > $@
; \
105 $(OUTPUT_A
): $(DEPS
) $(OBJS
)
106 $(AR
) cru
$(OUTPUT_A
) $(OBJS
)
107 $(RANLIB
) $(OUTPUT_A
)
117 rm -f
*.o
*.lo
*.la
*.so
*.a
118 -cd
test; $(MAKE
) clean
122 ifneq ($(MAKECMDGOALS
),clean)
123 -include $(SOURCES
:%.c
=.
%.d
)