1 # -*- Mode: makefile -*-
3 # ***** BEGIN LICENSE BLOCK *****
4 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 # The contents of this file are subject to the Mozilla Public License Version
7 # 1.1 (the "License"); you may not use this file except in compliance with
8 # the License. You may obtain a copy of the License at
9 # http://www.mozilla.org/MPL/
11 # Software distributed under the License is distributed on an "AS IS" basis,
12 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 # for the specific language governing rights and limitations under the
16 # The Original Code is Mozilla Communicator client code, released
19 # The Initial Developer of the Original Code is
20 # Sun Microsystems, Inc.
21 # Portions created by the Initial Developer are Copyright (C) 1998
22 # the Initial Developer. All Rights Reserved.
26 # Alternatively, the contents of this file may be used under the terms of
27 # either of the GNU General Public License Version 2 or later (the "GPL"),
28 # or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29 # in which case the provisions of the GPL or the LGPL are applicable instead
30 # of those above. If you wish to allow use of your version of this file only
31 # under the terms of either the GPL or the LGPL, and not to allow others to
32 # use your version of this file under the terms of the MPL, indicate your
33 # decision by deleting the provisions above and replace them with the notice
34 # and other provisions required by the GPL or the LGPL. If you do not delete
35 # the provisions above, a recipient may use your version of this file under
36 # the terms of any one of the MPL, the GPL or the LGPL.
38 # ***** END LICENSE BLOCK *****
41 # @(#)Makefile 1.4 95/01/18
43 # ====================================================
44 # Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
46 # Developed at SunSoft, a Sun Microsystems, Inc. business.
47 # Permission to use, copy, modify, and distribute this
48 # software is freely granted, provided that this notice
50 # ====================================================
55 # There are two options in making libm at fdlibm compile time:
56 # _IEEE_LIBM --- IEEE libm; smaller, and somewhat faster
57 # _MULTI_LIBM --- Support multi-standard at runtime by
58 # imposing wrapper functions defined in
61 # _XOPEN_MODE -- X/OPEN
62 # _POSIX_MODE -- POSIX/ANSI
65 # Here is how to set up CFLAGS to create the desired libm at
68 # CFLAGS = -D_IEEE_LIBM ... IEEE libm (recommended)
69 # CFLAGS = -D_SVID3_MODE ... Multi-standard supported
70 # libm with SVID as the
72 # CFLAGS = -D_XOPEN_MODE ... Multi-standard supported
73 # libm with XOPEN as the
75 # CFLAGS = -D_POSIX_MODE ... Multi-standard supported
76 # libm with POSIX as the
78 # CFLAGS = ... Multi-standard supported
79 # libm with IEEE as the
82 # NOTE: if scalb's second arguement is an int, then one must
83 # define _SCALB_INT in CFLAGS. The default prototype of scalb
84 # is double scalb(double, double)
89 include $(DEPTH)/config.mk
94 CFLAGS += -DXP_UNIX $(OPTIMIZER) $(OS_CFLAGS) $(DEFINES) $(INCLUDES) \
95 -DJSFILE $(XCFLAGS) -D_IEEE_LIBM
97 # Need for jstypes.h and friends
99 INCLUDES += -I../$(OBJDIR)
107 k_standard.c k_rem_pio2.c \
108 k_cos.c k_sin.c k_tan.c \
109 e_acos.c e_acosh.c e_asin.c e_atan2.c \
110 e_atanh.c e_cosh.c e_exp.c e_fmod.c \
111 e_gamma.c e_gamma_r.c e_hypot.c e_j0.c \
112 e_j1.c e_jn.c e_lgamma.c e_lgamma_r.c \
113 e_log.c e_log10.c e_pow.c e_rem_pio2.c e_remainder.c \
114 e_scalb.c e_sinh.c e_sqrt.c \
115 w_acos.c w_acosh.c w_asin.c w_atan2.c \
116 w_atanh.c w_cosh.c w_exp.c w_fmod.c \
117 w_gamma.c w_gamma_r.c w_hypot.c w_j0.c \
118 w_j1.c w_jn.c w_lgamma.c w_lgamma_r.c \
119 w_log.c w_log10.c w_pow.c w_remainder.c \
120 w_scalb.c w_sinh.c w_sqrt.c \
121 s_asinh.c s_atan.c s_cbrt.c s_ceil.c s_copysign.c \
122 s_cos.c s_erf.c s_expm1.c s_fabs.c s_finite.c s_floor.c \
123 s_frexp.c s_ilogb.c s_isnan.c s_ldexp.c s_lib_version.c \
124 s_log1p.c s_logb.c s_matherr.c s_modf.c s_nextafter.c \
125 s_rint.c s_scalbn.c s_signgam.c s_significand.c s_sin.c \
129 FDLIBM_OBJS = $(addprefix $(OBJDIR)/, $(FDLIBM_CFILES:.c=.obj))
131 FDLIBM_OBJS = $(addprefix $(OBJDIR)/, $(FDLIBM_CFILES:.c=.o))
135 LIBRARY = $(OBJDIR)/fdlibm.lib
137 LIBRARY = $(OBJDIR)/libfdm.a
141 if test ! -d $(@D); then rm -rf $(@D); mkdir -p $(@D); fi
150 $(CC) -o $@ $(CFLAGS) $*.c $(LDFLAGS)
154 $(CC) -o $@ -c $(CFLAGS) $*.c
158 $(AS) -o $@ $(ASFLAGS) $*.s
163 $(CC) -Fo$(OBJDIR)/ -c $(CFLAGS) $*.c
165 ifeq ($(OS_ARCH),OS2)
166 $(LIBRARY): $(FDLIBM_OBJS)
167 $(AR) $@ $? $(AR_OS2_SUFFIX)
171 $(LIBRARY): $(FDLIBM_OBJS)
174 $(LIBRARY): $(FDLIBM_OBJS)
180 libfdm.a : $(FDLIBM_OBJS)
181 $(AR) cru $(OBJDIR)/libfdm.a $(FDLIBM_OBJS)
182 $(RANLIB) $(OBJDIR)/libfdm.a
185 rm -rf $(FDLIBM_OBJS)
188 rm -rf $(FDLIBM_OBJS) $(LIBRARY) $(DEPENDENCIES)
192 $(CC) -C -E $(CFLAGS) $< > $*.i