2446
|
1 |
#
|
|
2 |
#
|
|
3 |
|
|
4 |
USEMINGW32=1
|
|
5 |
|
|
6 |
!include ..\..\..\rules\stdHeader_bc
|
|
7 |
|
|
8 |
#
|
|
9 |
# There are two options in making libm at fdlibm compile time:
|
|
10 |
# _IEEE_LIBM --- IEEE libm; smaller, and somewhat faster
|
|
11 |
# _MULTI_LIBM --- Support multi-standard at runtime by
|
|
12 |
# imposing wrapper functions defined in
|
|
13 |
# fdlibm.h:
|
|
14 |
# _IEEE_MODE -- IEEE
|
|
15 |
# _XOPEN_MODE -- X/OPEN
|
|
16 |
# _POSIX_MODE -- POSIX/ANSI
|
|
17 |
# _SVID3_MODE -- SVID
|
|
18 |
#
|
|
19 |
# Here is how to set up CFLAGS to create the desired libm at
|
|
20 |
# compile time:
|
|
21 |
#
|
|
22 |
# CFLAGS = -D_IEEE_LIBM ... IEEE libm (recommended)
|
|
23 |
# CFLAGS = -D_SVID3_MODE ... Multi-standard supported
|
|
24 |
# libm with SVID as the
|
|
25 |
# default standard
|
|
26 |
# CFLAGS = -D_XOPEN_MODE ... Multi-standard supported
|
|
27 |
# libm with XOPEN as the
|
|
28 |
# default standard
|
|
29 |
# CFLAGS = -D_POSIX_MODE ... Multi-standard supported
|
|
30 |
# libm with POSIX as the
|
|
31 |
# default standard
|
|
32 |
# CFLAGS = ... Multi-standard supported
|
|
33 |
# libm with IEEE as the
|
|
34 |
# default standard
|
|
35 |
#
|
|
36 |
# NOTE: if scalb's second arguement is an int, then one must
|
|
37 |
# define _SCALB_INT in CFLAGS. The default prototype of scalb
|
|
38 |
# is double scalb(double, double)
|
|
39 |
#
|
|
40 |
OUTDIR=
|
|
41 |
|
|
42 |
INCL=
|
|
43 |
|
|
44 |
AR = ar
|
|
45 |
|
|
46 |
# CC = gcc
|
|
47 |
|
|
48 |
#
|
|
49 |
# Default IEEE libm
|
|
50 |
#
|
|
51 |
# CFLAGS = -O $(INCL)
|
|
52 |
|
|
53 |
CHMOD = chmod
|
|
54 |
|
|
55 |
CP = cp
|
|
56 |
|
|
57 |
INCFILES = fdlibm.h
|
|
58 |
|
|
59 |
LDFLAGS =
|
|
60 |
|
|
61 |
LIB = libfdm.lib
|
|
62 |
|
|
63 |
LIBS =
|
|
64 |
|
|
65 |
RANLIB = ranlib
|
|
66 |
|
|
67 |
RM = del
|
|
68 |
|
|
69 |
|
|
70 |
|
|
71 |
src = k_standard.c k_rem_pio2.c \
|
|
72 |
k_cos.c k_sin.c k_tan.c \
|
|
73 |
e_acos.c e_acosh.c e_asin.c e_atan2.c \
|
|
74 |
e_atanh.c e_cosh.c e_exp.c e_fmod.c \
|
|
75 |
e_gamma.c e_gamma_r.c e_hypot.c e_j0.c \
|
|
76 |
e_j1.c e_jn.c e_lgamma.c e_lgamma_r.c \
|
|
77 |
e_log.c e_log10.c e_pow.c e_rem_pio2.c e_remainder.c \
|
|
78 |
e_scalb.c e_sinh.c e_sqrt.c \
|
|
79 |
w_acos.c w_acosh.c w_asin.c w_atan2.c \
|
|
80 |
w_atanh.c w_cosh.c w_exp.c w_fmod.c \
|
|
81 |
w_gamma.c w_gamma_r.c w_hypot.c w_j0.c \
|
|
82 |
w_j1.c w_jn.c w_lgamma.c w_lgamma_r.c \
|
|
83 |
w_log.c w_log10.c w_pow.c w_remainder.c \
|
|
84 |
w_scalb.c w_sinh.c w_sqrt.c \
|
|
85 |
s_asinh.c s_atan.c s_cbrt.c s_ceil.c s_copysign.c \
|
|
86 |
s_cos.c s_erf.c s_expm1.c s_fabs.c s_finite.c s_floor.c \
|
|
87 |
s_frexp.c s_ilogb.c s_isnan.c s_ldexp.c s_lib_version.c \
|
|
88 |
s_log1p.c s_logb.c s_matherr.c s_modf.c s_nextafter.c \
|
|
89 |
s_rint.c s_scalbn.c s_signgam.c s_significand.c s_sin.c \
|
|
90 |
s_tan.c s_tanh.c
|
|
91 |
|
|
92 |
obj = $(OUTDIR)k_standard.$(O) $(OUTDIR)k_rem_pio2.$(O) \
|
|
93 |
$(OUTDIR)k_cos.$(O) $(OUTDIR)k_sin.$(O) $(OUTDIR)k_tan.$(O) \
|
|
94 |
$(OUTDIR)e_acos.$(O) $(OUTDIR)e_acosh.$(O) $(OUTDIR)e_asin.$(O) $(OUTDIR)e_atan2.$(O) \
|
|
95 |
$(OUTDIR)e_atanh.$(O) $(OUTDIR)e_cosh.$(O) $(OUTDIR)e_exp.$(O) $(OUTDIR)e_fmod.$(O) \
|
|
96 |
$(OUTDIR)e_gamma.$(O) $(OUTDIR)e_gamma_r.$(O) $(OUTDIR)e_hypot.$(O) $(OUTDIR)e_j0.$(O) \
|
|
97 |
$(OUTDIR)e_j1.$(O) $(OUTDIR)e_jn.$(O) $(OUTDIR)e_lgamma.$(O) $(OUTDIR)e_lgamma_r.$(O) \
|
|
98 |
$(OUTDIR)e_log.$(O) $(OUTDIR)e_log10.$(O) $(OUTDIR)e_pow.$(O) $(OUTDIR)e_rem_pio2.$(O) $(OUTDIR)e_remainder.$(O) \
|
|
99 |
$(OUTDIR)e_scalb.$(O) $(OUTDIR)e_sinh.$(O) $(OUTDIR)e_sqrt.$(O) \
|
|
100 |
$(OUTDIR)w_acos.$(O) $(OUTDIR)w_acosh.$(O) $(OUTDIR)w_asin.$(O) $(OUTDIR)w_atan2.$(O) \
|
|
101 |
$(OUTDIR)w_atanh.$(O) $(OUTDIR)w_cosh.$(O) $(OUTDIR)w_exp.$(O) $(OUTDIR)w_fmod.$(O) \
|
|
102 |
$(OUTDIR)w_gamma.$(O) $(OUTDIR)w_gamma_r.$(O) $(OUTDIR)w_hypot.$(O) $(OUTDIR)w_j0.$(O) \
|
|
103 |
$(OUTDIR)w_j1.$(O) $(OUTDIR)w_jn.$(O) $(OUTDIR)w_lgamma.$(O) $(OUTDIR)w_lgamma_r.$(O) \
|
|
104 |
$(OUTDIR)w_log.$(O) $(OUTDIR)w_log10.$(O) $(OUTDIR)w_pow.$(O) $(OUTDIR)w_remainder.$(O) \
|
|
105 |
$(OUTDIR)w_scalb.$(O) $(OUTDIR)w_sinh.$(O) $(OUTDIR)w_sqrt.$(O) \
|
|
106 |
$(OUTDIR)s_asinh.$(O) $(OUTDIR)s_atan.$(O) $(OUTDIR)s_cbrt.$(O) $(OUTDIR)s_ceil.$(O) $(OUTDIR)s_copysign.$(O) \
|
|
107 |
$(OUTDIR)s_cos.$(O) $(OUTDIR)s_erf.$(O) $(OUTDIR)s_expm1.$(O) $(OUTDIR)s_fabs.$(O) $(OUTDIR)s_finite.$(O) $(OUTDIR)s_floor.$(O) \
|
|
108 |
$(OUTDIR)s_frexp.$(O) $(OUTDIR)s_ilogb.$(O) $(OUTDIR)s_isnan.$(O) $(OUTDIR)s_ldexp.$(O) $(OUTDIR)s_lib_version.$(O) \
|
|
109 |
$(OUTDIR)s_log1p.$(O) $(OUTDIR)s_logb.$(O) $(OUTDIR)s_matherr.$(O) $(OUTDIR)s_modf.$(O) $(OUTDIR)s_nextafter.$(O) \
|
|
110 |
$(OUTDIR)s_rint.$(O) $(OUTDIR)s_scalbn.$(O) $(OUTDIR)s_signgam.$(O) $(OUTDIR)s_significand.$(O) $(OUTDIR)s_sin.$(O) \
|
|
111 |
$(OUTDIR)s_tan.$(O) $(OUTDIR)s_tanh.$(O)
|
|
112 |
|
|
113 |
all: $(LIB)
|
|
114 |
|
|
115 |
check:
|
|
116 |
@echo This package does not have a validation suite.
|
|
117 |
|
|
118 |
clean:
|
|
119 |
-$(RM) *.$(O) $(LIB)
|
|
120 |
|
|
121 |
distclean: mostlyclean
|
|
122 |
-$(RM) $(LIB)
|
|
123 |
-$(RM) -r autom4te.cache/
|
|
124 |
-$(RM) config.cache config.log config.status Makefile
|
|
125 |
|
|
126 |
install: $(LIB) uninstall
|
|
127 |
$(CP) $(LIB) $(prefix)/lib/$(LIB)
|
|
128 |
$(CHMOD) 664 $(prefix)/lib/$(LIB)
|
|
129 |
$(RANLIB) $(prefix)/lib/$(LIB) || true
|
|
130 |
|
|
131 |
$(LIB) : $(obj)
|
|
132 |
-del $(LIB)
|
|
133 |
$(AR) r $(LIB) $(obj)
|
|
134 |
|
|
135 |
maintainer-clean: distclean
|
|
136 |
@echo "This command is intended for maintainers to use;"
|
|
137 |
@echo "it deletes files that may require special tools to rebuild."
|
|
138 |
-$(RM) configure
|
|
139 |
|
|
140 |
mostlyclean: clean
|
|
141 |
-$(RM) $(obj)
|
|
142 |
|
|
143 |
source: $(src) README
|
|
144 |
|
|
145 |
uninstall:
|
|
146 |
-$(RM) $(prefix)/lib/$(LIB)
|
|
147 |
|
|
148 |
.c.$(O):
|
|
149 |
$(CC) $(CFLAGS) -c{ $<}
|