From 249cb00d9f655778aa8a4519ee3e610a904d694d Mon Sep 17 00:00:00 2001 From: Eric Andersen 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 --- libcrypt/Makefile | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) (limited to 'libcrypt') diff --git a/libcrypt/Makefile b/libcrypt/Makefile index f4280a4e7..a3cff4fc6 100644 --- a/libcrypt/Makefile +++ b/libcrypt/Makefile @@ -25,13 +25,11 @@ include $(TOPDIR)Rules.mak LIBCRYPT=libcrypt.a LIBCRYPT_SHARED=libcrypt.so +LIBCRYPT_SHARED_FULLNAME=libcrypt-$(MAJOR_VERSION).$(MINOR_VERSION).so TARGET_CC= $(TOPDIR)extra/gcc-uClibc/$(TARGET_ARCH)-uclibc-gcc CSRC = crypt.c des.c md5.c -COBJS=$(patsubst %.c,%.o, $(CSRC)) - - -OBJS=$(COBJS) +OBJS=$(patsubst %.c,%.o, $(CSRC)) all: $(OBJS) $(LIBCRYPT) @@ -39,28 +37,24 @@ $(LIBCRYPT): ar-target ar-target: $(OBJS) $(AR) $(ARFLAGS) $(LIBCRYPT) $(OBJS) + install -d $(TOPDIR)lib + rm -f $(TOPDIR)lib/$(LIBCRYPT) + install -m 644 $(LIBCRYPT) $(TOPDIR)lib/ -$(COBJS): %.o : %.c +$(OBJS): %.o : %.c $(TARGET_CC) $(CFLAGS) -c $< -o $@ $(STRIPTOOL) -x -R .note -R .comment $*.o $(OBJ): Makefile -shared: $(LIBCRYPT) - $(TARGET_CC) $(LDFLAGS) -shared -o $(LIBCRYPT_SHARED).$(MAJOR_VERSION) \ - -Wl,-soname,$(LIBCRYPT_SHARED).$(MAJOR_VERSION) $(COBJS) $(TOPDIR)$(SHARED_FULLNAME) - -install: all - install -d $(INSTALL_DIR)/lib - install -m 644 $(LIBCRYPT) $(INSTALL_DIR)/lib/ - @if [ -f $(LIBCRYPT_SHARED).$(MAJOR_VERSION) ] ; then \ - install -m 644 $(LIBCRYPT_SHARED).$(MAJOR_VERSION) $(INSTALL_DIR)/lib/; \ - (cd $(INSTALL_DIR)/lib/;ln -sf $(LIBCRYPT_SHARED).$(MAJOR_VERSION) $(LIBCRYPT_SHARED)); \ - fi; +shared: all + $(TARGET_CC) $(LDFLAGS) -shared -o $(LIBCRYPT_SHARED_FULLNAME) \ + -Wl,-soname,$(LIBCRYPT_SHARED).$(MAJOR_VERSION) $(OBJS) $(TOPDIR)$(SHARED_FULLNAME) + install -d $(TOPDIR)lib + rm -f $(TOPDIR)lib/$(LIBCRYPT_SHARED_FULLNAME) $(TOPDIR)lib/$(LIBCRYPT_SHARED).$(MAJOR_VERSION) + install -m 644 $(LIBCRYPT_SHARED_FULLNAME) $(TOPDIR)lib/; + (cd $(TOPDIR)lib; ln -sf $(LIBCRYPT_SHARED_FULLNAME) $(LIBCRYPT_SHARED).$(MAJOR_VERSION)); clean: - rm -f *.[oa] *~ core $(LIBCRYPT_SHARED)* - -.PHONY: dummy - + rm -f *.[oa] *~ core $(LIBCRYPT_SHARED)* $(LIBCRYPT_SHARED_FULLNAME)* -- cgit v1.2.3