author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Tue, 11 Jun 2019 22:03:11 +0100 | |
changeset 3914 | 35aa88fa58c1 |
parent 3487 | 6673aec2f718 |
permissions | -rw-r--r-- |
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 |
||
3487
6673aec2f718
Fix for MINGW32: correctly build libfdm.lib
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2446
diff
changeset
|
69 |
O = o |
2446 | 70 |
|
71 |
||
72 |
src = k_standard.c k_rem_pio2.c \ |
|
73 |
k_cos.c k_sin.c k_tan.c \ |
|
74 |
e_acos.c e_acosh.c e_asin.c e_atan2.c \ |
|
75 |
e_atanh.c e_cosh.c e_exp.c e_fmod.c \ |
|
76 |
e_gamma.c e_gamma_r.c e_hypot.c e_j0.c \ |
|
77 |
e_j1.c e_jn.c e_lgamma.c e_lgamma_r.c \ |
|
78 |
e_log.c e_log10.c e_pow.c e_rem_pio2.c e_remainder.c \ |
|
79 |
e_scalb.c e_sinh.c e_sqrt.c \ |
|
80 |
w_acos.c w_acosh.c w_asin.c w_atan2.c \ |
|
81 |
w_atanh.c w_cosh.c w_exp.c w_fmod.c \ |
|
82 |
w_gamma.c w_gamma_r.c w_hypot.c w_j0.c \ |
|
83 |
w_j1.c w_jn.c w_lgamma.c w_lgamma_r.c \ |
|
84 |
w_log.c w_log10.c w_pow.c w_remainder.c \ |
|
85 |
w_scalb.c w_sinh.c w_sqrt.c \ |
|
86 |
s_asinh.c s_atan.c s_cbrt.c s_ceil.c s_copysign.c \ |
|
87 |
s_cos.c s_erf.c s_expm1.c s_fabs.c s_finite.c s_floor.c \ |
|
88 |
s_frexp.c s_ilogb.c s_isnan.c s_ldexp.c s_lib_version.c \ |
|
89 |
s_log1p.c s_logb.c s_matherr.c s_modf.c s_nextafter.c \ |
|
90 |
s_rint.c s_scalbn.c s_signgam.c s_significand.c s_sin.c \ |
|
91 |
s_tan.c s_tanh.c |
|
92 |
||
93 |
obj = $(OUTDIR)k_standard.$(O) $(OUTDIR)k_rem_pio2.$(O) \ |
|
94 |
$(OUTDIR)k_cos.$(O) $(OUTDIR)k_sin.$(O) $(OUTDIR)k_tan.$(O) \ |
|
95 |
$(OUTDIR)e_acos.$(O) $(OUTDIR)e_acosh.$(O) $(OUTDIR)e_asin.$(O) $(OUTDIR)e_atan2.$(O) \ |
|
96 |
$(OUTDIR)e_atanh.$(O) $(OUTDIR)e_cosh.$(O) $(OUTDIR)e_exp.$(O) $(OUTDIR)e_fmod.$(O) \ |
|
97 |
$(OUTDIR)e_gamma.$(O) $(OUTDIR)e_gamma_r.$(O) $(OUTDIR)e_hypot.$(O) $(OUTDIR)e_j0.$(O) \ |
|
98 |
$(OUTDIR)e_j1.$(O) $(OUTDIR)e_jn.$(O) $(OUTDIR)e_lgamma.$(O) $(OUTDIR)e_lgamma_r.$(O) \ |
|
99 |
$(OUTDIR)e_log.$(O) $(OUTDIR)e_log10.$(O) $(OUTDIR)e_pow.$(O) $(OUTDIR)e_rem_pio2.$(O) $(OUTDIR)e_remainder.$(O) \ |
|
100 |
$(OUTDIR)e_scalb.$(O) $(OUTDIR)e_sinh.$(O) $(OUTDIR)e_sqrt.$(O) \ |
|
101 |
$(OUTDIR)w_acos.$(O) $(OUTDIR)w_acosh.$(O) $(OUTDIR)w_asin.$(O) $(OUTDIR)w_atan2.$(O) \ |
|
102 |
$(OUTDIR)w_atanh.$(O) $(OUTDIR)w_cosh.$(O) $(OUTDIR)w_exp.$(O) $(OUTDIR)w_fmod.$(O) \ |
|
103 |
$(OUTDIR)w_gamma.$(O) $(OUTDIR)w_gamma_r.$(O) $(OUTDIR)w_hypot.$(O) $(OUTDIR)w_j0.$(O) \ |
|
104 |
$(OUTDIR)w_j1.$(O) $(OUTDIR)w_jn.$(O) $(OUTDIR)w_lgamma.$(O) $(OUTDIR)w_lgamma_r.$(O) \ |
|
105 |
$(OUTDIR)w_log.$(O) $(OUTDIR)w_log10.$(O) $(OUTDIR)w_pow.$(O) $(OUTDIR)w_remainder.$(O) \ |
|
106 |
$(OUTDIR)w_scalb.$(O) $(OUTDIR)w_sinh.$(O) $(OUTDIR)w_sqrt.$(O) \ |
|
107 |
$(OUTDIR)s_asinh.$(O) $(OUTDIR)s_atan.$(O) $(OUTDIR)s_cbrt.$(O) $(OUTDIR)s_ceil.$(O) $(OUTDIR)s_copysign.$(O) \ |
|
108 |
$(OUTDIR)s_cos.$(O) $(OUTDIR)s_erf.$(O) $(OUTDIR)s_expm1.$(O) $(OUTDIR)s_fabs.$(O) $(OUTDIR)s_finite.$(O) $(OUTDIR)s_floor.$(O) \ |
|
109 |
$(OUTDIR)s_frexp.$(O) $(OUTDIR)s_ilogb.$(O) $(OUTDIR)s_isnan.$(O) $(OUTDIR)s_ldexp.$(O) $(OUTDIR)s_lib_version.$(O) \ |
|
110 |
$(OUTDIR)s_log1p.$(O) $(OUTDIR)s_logb.$(O) $(OUTDIR)s_matherr.$(O) $(OUTDIR)s_modf.$(O) $(OUTDIR)s_nextafter.$(O) \ |
|
111 |
$(OUTDIR)s_rint.$(O) $(OUTDIR)s_scalbn.$(O) $(OUTDIR)s_signgam.$(O) $(OUTDIR)s_significand.$(O) $(OUTDIR)s_sin.$(O) \ |
|
112 |
$(OUTDIR)s_tan.$(O) $(OUTDIR)s_tanh.$(O) |
|
113 |
||
114 |
all: $(LIB) |
|
115 |
||
116 |
check: |
|
117 |
@echo This package does not have a validation suite. |
|
118 |
||
119 |
clean: |
|
120 |
-$(RM) *.$(O) $(LIB) |
|
121 |
||
122 |
distclean: mostlyclean |
|
123 |
-$(RM) $(LIB) |
|
124 |
-$(RM) -r autom4te.cache/ |
|
125 |
-$(RM) config.cache config.log config.status Makefile |
|
126 |
||
127 |
install: $(LIB) uninstall |
|
128 |
$(CP) $(LIB) $(prefix)/lib/$(LIB) |
|
129 |
$(CHMOD) 664 $(prefix)/lib/$(LIB) |
|
130 |
$(RANLIB) $(prefix)/lib/$(LIB) || true |
|
131 |
||
132 |
$(LIB) : $(obj) |
|
133 |
-del $(LIB) |
|
134 |
$(AR) r $(LIB) $(obj) |
|
135 |
||
136 |
maintainer-clean: distclean |
|
137 |
@echo "This command is intended for maintainers to use;" |
|
138 |
@echo "it deletes files that may require special tools to rebuild." |
|
139 |
-$(RM) configure |
|
140 |
||
141 |
mostlyclean: clean |
|
142 |
-$(RM) $(obj) |
|
143 |
||
144 |
source: $(src) README |
|
145 |
||
146 |
uninstall: |
|
147 |
-$(RM) $(prefix)/lib/$(LIB) |
|
148 |
||
149 |
.c.$(O): |
|
150 |
$(CC) $(CFLAGS) -c{ $<} |