summaryrefslogtreecommitdiff
path: root/libm/Makefile
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-05-11 21:26:43 +0000
committerEric Andersen <andersen@codepoet.org>2001-05-11 21:26:43 +0000
commit249cb00d9f655778aa8a4519ee3e610a904d694d (patch)
tree44586e79f5b7c82c46252192638b36b99cf66dad /libm/Makefile
parentbebf39c4932f6b89ccbf6cc63c32b8d51a2dd11a (diff)
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
Diffstat (limited to 'libm/Makefile')
-rw-r--r--libm/Makefile26
1 files changed, 15 insertions, 11 deletions
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