1 # Makefile for uClibc's math library
2 # Copyright (C) 2001 by Lineo, inc.
4 # This math library is derived primarily from the Cephes Math Library,
5 # copyright by Stephen L. Moshier <moshier@world.std.com>
7 # This program is free software; you can redistribute it and/or modify it under
8 # the terms of the GNU Library General Public License as published by the Free
9 # Software Foundation; either version 2 of the License, or (at your option) any
12 # This program is distributed in the hope that it will be useful, but WITHOUT
13 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 # FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
17 # You should have received a copy of the GNU Library General Public License
18 # along with this program; if not, write to the Free Software Foundation, Inc.,
19 # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 include $(TOPDIR)Rules.mak
27 LIBM_SHARED_FULLNAME=libm-$(MAJOR_VERSION).$(MINOR_VERSION).so
30 ifeq ($(strip $(HAS_LIBM_FLOAT)),true)
33 ifeq ($(strip $(HAS_LIBM_DOUBLE)),true)
36 ifeq ($(strip $(HAS_LIBM_LONG_DOUBLE)),true)
39 ALL_SUBDIRS = float double ldouble
44 @if [ -f $(LIBM) ] ; then \
45 install -d $(TOPDIR)lib; \
46 rm -f $(TOPDIR)lib/$(LIBM); \
47 install -m 644 $(LIBM) $(TOPDIR)lib; \
54 if [ -f $(LIBM) ] ; then \
55 $(TARGET_CC) $(TARGET_LDFLAGS) -nostdlib -shared -o $(LIBM_SHARED_FULLNAME) \
56 -Wl,-soname,$(LIBM_SHARED).$(MAJOR_VERSION) -Wl,--whole-archive $(LIBM) -lc; \
57 install -d $(TOPDIR)lib; \
58 rm -f $(TOPDIR)lib/$(LIBM_SHARED_FULLNAME) $(TOPDIR)lib/$(LIBM_SHARED).$(MAJOR_VERSION); \
59 install -m 644 $(LIBM_SHARED_FULLNAME) $(TOPDIR)lib; \
60 (cd $(TOPDIR)lib; ln -sf $(LIBM_SHARED_FULLNAME) $(LIBM_SHARED)); \
61 (cd $(TOPDIR)lib; ln -sf $(LIBM_SHARED_FULLNAME) $(LIBM_SHARED).$(MAJOR_VERSION)); \
64 subdirs: $(patsubst %, _dir_%, $(DIRS))
65 subdirs_clean: $(patsubst %, _dirclean_%, $(ALL_SUBDIRS))
67 $(patsubst %, _dir_%, $(DIRS)) : dummy
68 $(MAKE) -C $(patsubst _dir_%, %, $@)
70 $(patsubst %, _dirclean_%, $(ALL_SUBDIRS)) : dummy
71 $(MAKE) -C $(patsubst _dirclean_%, %, $@) clean
74 rm -f *.[oa] *~ core $(LIBM_SHARED)* $(LIBM_SHARED_FULLNAME)*