Save all modification
[mozilla-1.9/m8.git] / js / src / fdlibm / Makefile.ref
blobde378025c70888bdfb5ff6f9b8d82a148ef8cd74
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
14 # License.
16 # The Original Code is Mozilla Communicator client code, released
17 # March 31, 1998.
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.
24 # Contributor(s):
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 
42
43 #  ====================================================
44 #  Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
45
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 
49 #  is preserved.
50 #  ====================================================
51
52
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 
59 #                           fdlibm.h:
60 #                               _IEEE_MODE      -- IEEE
61 #                               _XOPEN_MODE     -- X/OPEN
62 #                               _POSIX_MODE     -- POSIX/ANSI
63 #                               _SVID3_MODE     -- SVID
65 # Here is how to set up CFLAGS to create the desired libm at 
66 # compile time:
68 #       CFLAGS = -D_IEEE_LIBM           ... IEEE libm (recommended)
69 #       CFLAGS = -D_SVID3_MODE  ... Multi-standard supported
70 #                                           libm with SVID as the 
71 #                                           default standard
72 #       CFLAGS = -D_XOPEN_MODE  ... Multi-standard supported
73 #                                           libm with XOPEN as the 
74 #                                           default standard
75 #       CFLAGS = -D_POSIX_MODE  ... Multi-standard supported
76 #                                           libm with POSIX as the 
77 #                                           default standard
78 #       CFLAGS =                        ... Multi-standard supported
79 #                                           libm with IEEE as the 
80 #                                           default standard
81
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)
87 DEPTH           = ..
89 include $(DEPTH)/config.mk
92 # Default IEEE libm
94 CFLAGS          += -DXP_UNIX $(OPTIMIZER) $(OS_CFLAGS) $(DEFINES) $(INCLUDES) \
95                   -DJSFILE $(XCFLAGS) -D_IEEE_LIBM
97 # Need for jstypes.h and friends
98 INCLUDES += -I..
99 INCLUDES += -I../$(OBJDIR)
101 #CC = cc
103 INCFILES = fdlibm.h
104 .INIT: $(INCFILES)
105 .KEEP_STATE:
106 FDLIBM_CFILES =         \
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 \
126         s_tan.c s_tanh.c
128 ifdef USE_MSVC
129 FDLIBM_OBJS = $(addprefix $(OBJDIR)/, $(FDLIBM_CFILES:.c=.obj))
130 else
131 FDLIBM_OBJS = $(addprefix $(OBJDIR)/, $(FDLIBM_CFILES:.c=.o))
132 endif
134 ifdef USE_MSVC
135 LIBRARY = $(OBJDIR)/fdlibm.lib
136 else
137 LIBRARY = $(OBJDIR)/libfdm.a
138 endif
140 define MAKE_OBJDIR
141 if test ! -d $(@D); then rm -rf $(@D); mkdir -p $(@D); fi
142 endef
144 all: $(LIBRARY) 
146 export:
148 $(OBJDIR)/%: %.c
149         @$(MAKE_OBJDIR)
150         $(CC) -o $@ $(CFLAGS) $*.c $(LDFLAGS)
152 $(OBJDIR)/%.o: %.c
153         @$(MAKE_OBJDIR)
154         $(CC) -o $@ -c $(CFLAGS) $*.c
156 $(OBJDIR)/%.o: %.s
157         @$(MAKE_OBJDIR)
158         $(AS) -o $@ $(ASFLAGS) $*.s
160 # windows only
161 $(OBJDIR)/%.obj: %.c
162         @$(MAKE_OBJDIR)
163         $(CC) -Fo$(OBJDIR)/ -c $(CFLAGS) $*.c
165 ifeq ($(OS_ARCH),OS2)
166 $(LIBRARY): $(FDLIBM_OBJS)
167         $(AR) $@ $? $(AR_OS2_SUFFIX)
168         $(RANLIB) $@
169 else
170 ifdef USE_MSVC
171 $(LIBRARY): $(FDLIBM_OBJS)
172         lib.exe /out:"$@" $?
173 else
174 $(LIBRARY): $(FDLIBM_OBJS)
175         $(AR) rv $@ $?
176         $(RANLIB) $@
177 endif
178 endif
180 libfdm.a : $(FDLIBM_OBJS) 
181         $(AR) cru $(OBJDIR)/libfdm.a $(FDLIBM_OBJS)
182         $(RANLIB) $(OBJDIR)/libfdm.a
184 clean:
185         rm -rf $(FDLIBM_OBJS)
187 clobber:
188         rm -rf $(FDLIBM_OBJS) $(LIBRARY) $(DEPENDENCIES)
190 SUFFIXES: .i
191 %.i: %.c
192         $(CC) -C -E $(CFLAGS) $< > $*.i