From 249cb00d9f655778aa8a4519ee3e610a904d694d Mon Sep 17 00:00:00 2001
From: Eric Andersen <andersen@codepoet.org>
Date: Fri, 11 May 2001 21:26:43 +0000
Subject: Rework where libraries get installed to.  Now thew will be compiled
 and dropped into a uClibc/lib dir when compiling, which will make life a bit
 easier when installing and cleaning up.  Preface uClibc with 'lib' so
 ldconfig will recognize it as a library.  Make all libraries have the uClibc
 version number attached, making upgrades possible by using the traditional
 symlink to the .so name plan.  -Erik

---
 libm/Makefile | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

(limited to 'libm')

diff --git a/libm/Makefile b/libm/Makefile
index 6beb52b0a..7227e664f 100644
--- a/libm/Makefile
+++ b/libm/Makefile
@@ -25,6 +25,7 @@ include $(TOPDIR)Rules.mak
 
 LIBM=libm.a
 LIBM_SHARED=libm.so
+LIBM_SHARED_FULLNAME=libm-$(MAJOR_VERSION).$(MINOR_VERSION).so
 TARGET_CC= $(TOPDIR)extra/gcc-uClibc/$(TARGET_ARCH)-uclibc-gcc
 
 DIRS=
@@ -42,20 +43,23 @@ ALL_SUBDIRS = float double ldouble
 all: $(LIBM)
 
 $(LIBM): subdirs
+	@if [ -f $(LIBM) ] ; then \
+		install -d $(TOPDIR)lib; \
+		rm -f $(TOPDIR)lib/$(LIBM); \
+		install -m 644 $(LIBM) $(TOPDIR)lib; \
+	fi;
 
 tags:
 	ctags -R
 	
-shared: $(LIBM)
-	$(TARGET_CC) $(LDFLAGS) -shared -o $(LIBM_SHARED).$(MAJOR_VERSION) \
-	    -Wl,-soname,$(LIBM_SHARED).$(MAJOR_VERSION) -Wl,--whole-archive $(LIBM) $(TOPDIR)$(SHARED_FULLNAME)
-
-install: all
-	install -d $(INSTALL_DIR)/lib
-	install -m 644 $(LIBM) $(INSTALL_DIR)/lib/
-	@if [ -f $(LIBM_SHARED).$(MAJOR_VERSION) ] ; then \
-	    install -m 644 $(LIBM_SHARED).$(MAJOR_VERSION) $(INSTALL_DIR)/lib/; \
-	    (cd $(INSTALL_DIR)/lib/;ln -sf $(LIBM_SHARED).$(MAJOR_VERSION) $(LIBM_SHARED)); \
+shared: all
+	@if [ -f $(LIBM) ] ; then \
+		$(TARGET_CC) $(LDFLAGS) -shared -o $(LIBM_SHARED_FULLNAME) \
+		    -Wl,-soname,$(LIBM_SHARED).$(MAJOR_VERSION) $(OBJS) $(TOPDIR)$(SHARED_FULLNAME); \
+		install -d $(TOPDIR)lib; \
+		rm -f $(TOPDIR)lib/$(LIBM_SHARED_FULLNAME) $(TOPDIR)lib/$(LIBM_SHARED).$(MAJOR_VERSION); \
+		install -m 644 $(LIBM_SHARED_FULLNAME) $(TOPDIR)lib; \
+		(cd $(TOPDIR)lib; ln -sf $(LIBM_SHARED_FULLNAME) $(LIBM_SHARED).$(MAJOR_VERSION)); \
 	fi;
 
 subdirs: $(patsubst %, _dir_%, $(DIRS))
@@ -68,7 +72,7 @@ $(patsubst %, _dirclean_%, $(ALL_SUBDIRS)) : dummy
 	$(MAKE) -C $(patsubst _dirclean_%, %, $@) clean
 
 clean: subdirs_clean
-	rm -f *.[oa] *~ core $(LIBM_SHARED)* $(LIBM)
+	rm -f *.[oa] *~ core $(LIBM_SHARED)* $(LIBM_SHARED_FULLNAME)*
 
 .PHONY: dummy
 
-- 
cgit v1.2.3