Przeglądaj źródła

Modify libm's Makefile not needing any recursion

Peter S. Mazinger 18 lat temu
rodzic
commit
5632685c25
2 zmienionych plików z 15 dodań i 92 usunięć
  1. 15 27
      libm/Makefile
  2. 0 65
      libm/powerpc/Makefile

+ 15 - 27
libm/Makefile

@@ -38,15 +38,6 @@ CFLAGS+=$(SSP_ALL_CFLAGS)
 
 CFLAGS+=-D_IEEE_LIBM -D_ISOC99_SOURCE -D_SVID_SOURCE
 
-ALL_SUBDIRS = powerpc
-
-DIRS =
-ifeq ($(strip $(HAS_FPU)),y)
-ifeq ($(TARGET_ARCH),$(wildcard $(TARGET_ARCH)))
-DIRS = $(TARGET_ARCH)
-endif
-endif
-
 LIB_NAME=libm
 AR_LIB_NAME=$(TOPDIR)lib/$(LIB_NAME).a
 SO_LIB_NAME=$(TOPDIR)lib/$(LIB_NAME).so
@@ -92,21 +83,29 @@ CSRC+=   s_expm1.c s_scalbn.c s_copysign.c e_acos.c e_asin.c e_atan2.c \
 FL_MOBJ = sqrtf.o
 endif
 
+ifeq ($(strip $(HAS_FPU)),y)
+ifeq ($(strip $(DO_C99_MATH)),y)
+ARCH_CSRC=$(wildcard $(TARGET_ARCH)/*.c)
+ARCH_OBJS=$(patsubst %.c,%.o, $(ARCH_CSRC))
+endif
+endif
+
 COBJS=$(patsubst %.c,%.o, $(CSRC))
 OBJS=$(COBJS) $(FL_MOBJ)
 
 ifeq ($(strip $(HAVE_SHARED)),y)
 all: $(SO_LIB_NAME)
 else
-all: $(AR_LIB_NAME) subdirs
+all: $(AR_LIB_NAME)
 endif
 
-$(AR_LIB_NAME): $(OBJS)
+$(AR_LIB_NAME): $(OBJS) $(ARCH_OBJS)
 	$(INSTALL) -d $(TOPDIR)lib
 	$(RM) $(AR_LIB_NAME)
-	$(AR) $(ARFLAGS) $(AR_LIB_NAME) $(OBJS)
+	$(AR) $(ARFLAGS) $(AR_LIB_NAME) $(OBJS) && \
+		$(AR) $(ARFLAGS) $(AR_LIB_NAME) $(ARCH_OBJS)
 
-$(SO_LIB_NAME): $(AR_LIB_NAME) subdirs
+$(SO_LIB_NAME): $(AR_LIB_NAME)
 	$(RM) $(TOPDIR)lib/$(SO_FULL_NAME) $(SO_LIB_NAME).$(MAJOR_VERSION) $(SO_LIB_NAME)
 	$(LD) $(LDFLAGS) -soname=$(LIB_NAME).so.$(MAJOR_VERSION) \
 		-o $(TOPDIR)lib/$(SO_FULL_NAME) --whole-archive $(AR_LIB_NAME) \
@@ -115,7 +114,7 @@ $(SO_LIB_NAME): $(AR_LIB_NAME) subdirs
 	$(LN) -sf $(SO_FULL_NAME) $(SO_LIB_NAME).$(MAJOR_VERSION)
 	$(LN) -sf $(SO_FULL_NAME) $(SO_LIB_NAME)
 
-$(COBJS): %.o : %.c
+$(COBJS) $(ARCH_OBJS): %.o : %.c
 	$(CC) $(CFLAGS) -c $< -o $@
 	$(STRIPTOOL) -x -R .note -R .comment $*.o
 
@@ -126,16 +125,5 @@ $(FL_MOBJ): $(FL_MSRC)
 tags:
 	ctags -R
 
-clean: subdirs_clean
-	$(RM) *.o *~ core
-
-subdirs: $(patsubst %, _dir_%, $(DIRS))
-subdirs_clean: $(patsubst %, _dirclean_%, $(ALL_SUBDIRS))
-
-$(patsubst %, _dir_%, $(DIRS)): $(AR_LIB_NAME)
-	$(MAKE) -C $(patsubst _dir_%, %, $@)
-
-$(patsubst %, _dirclean_%, $(ALL_SUBDIRS)): dummy
-	$(MAKE) -C $(patsubst _dirclean_%, %, $@) clean
-
-.PHONY: dummy
+clean:
+	$(RM) *.o */*.o *~ core

+ 0 - 65
libm/powerpc/Makefile

@@ -1,65 +0,0 @@
-# Makefile for uClibc's math library
-#
-# Copyright (C) 2000,2001 Erik Andersen <andersen@uclibc.org>
-#
-# The routines included in this math library are derived from the
-# math library for Apple's MacOS X/Darwin math library, which was
-# itself swiped from FreeBSD.  The original copyright information
-# is as follows:
-#
-#     Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
-#
-#     Developed at SunPro, a Sun Microsystems, Inc. business.
-#     Permission to use, copy, modify, and distribute this
-#     software is freely granted, provided that this notice
-#     is preserved.
-#
-# It has been ported to work with uClibc and generally behave
-# by Erik Andersen <andersen@codepoet.org>
-#
-# This program is free software; you can redistribute it and/or modify it under
-# the terms of the GNU Library General Public License as published by the Free
-# Software Foundation; either version 2 of the License, or (at your option) any
-# later version.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
-# details.
-#
-# You should have received a copy of the GNU Library General Public License
-# along with this program; if not, write to the Free Software Foundation, Inc.,
-# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-TOPDIR=../../
-include $(TOPDIR)Rules.mak
-
-CFLAGS+=$(SSP_ALL_CFLAGS)
-
-CFLAGS+=-D_IEEE_LIBM -D_ISOC99_SOURCE -D_SVID_SOURCE
-
-LIB_NAME=libm
-AR_LIB_NAME=$(TOPDIR)lib/$(LIB_NAME).a
-
-ifeq ($(strip $(DO_C99_MATH)),y)
-CSRC = $(wildcard *.c)
-else
-CSRC =
-endif
-
-OBJS=$(patsubst %.c,%.o, $(CSRC))
-
-all: add_to_archive
-
-add_to_archive: $(OBJS)
-	$(AR) $(ARFLAGS) $(AR_LIB_NAME) $(OBJS)
-
-$(OBJS): %.o : %.c
-	$(CC) $(CFLAGS) -c $< -o $@
-	$(STRIPTOOL) -x -R .note -R .comment $*.o
-
-tags:
-	ctags -R
-
-clean:
-	$(RM) *.o *~ core