diff options
author | Eric Andersen <andersen@codepoet.org> | 2001-05-11 21:26:43 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2001-05-11 21:26:43 +0000 |
commit | 249cb00d9f655778aa8a4519ee3e610a904d694d (patch) | |
tree | 44586e79f5b7c82c46252192638b36b99cf66dad /libutil/Makefile | |
parent | bebf39c4932f6b89ccbf6cc63c32b8d51a2dd11a (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 'libutil/Makefile')
-rw-r--r-- | libutil/Makefile | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/libutil/Makefile b/libutil/Makefile index 364e82538..f98a4c46d 100644 --- a/libutil/Makefile +++ b/libutil/Makefile @@ -26,12 +26,11 @@ LIBC=$(TOPDIR)libc.a LIBUTIL=libutil.a LIBUTIL_SHARED=libutil.so +LIBUTIL_SHARED_FULLNAME=libutil-$(MAJOR_VERSION).$(MINOR_VERSION).so TARGET_CC= $(TOPDIR)extra/gcc-uClibc/$(TARGET_ARCH)-uclibc-gcc CSRC=forkpty.c login.c login_tty.c logout.c logwtmp.c openpty.c -COBJS=$(patsubst %.c,%.o, $(CSRC)) - -OBJS=$(COBJS) +OBJS=$(patsubst %.c,%.o, $(CSRC)) all: $(OBJS) $(LIBC) @@ -39,23 +38,22 @@ $(LIBC): ar-target ar-target: $(OBJS) $(AR) $(ARFLAGS) $(LIBUTIL) $(OBJS) + install -d $(TOPDIR)lib + rm -f $(TOPDIR)lib/$(LIBUTIL) + install -m 644 $(LIBUTIL) $(TOPDIR)lib/ -$(COBJS): %.o : %.c +$(OBJS): %.o : %.c $(TARGET_CC) $(CFLAGS) -c $< -o $@ $(STRIPTOOL) -x -R .note -R .comment $*.o -shared: $(LIBUTIL) - $(TARGET_CC) $(LDFLAGS) -shared -o $(LIBUTIL_SHARED).$(MAJOR_VERSION) \ - -Wl,-soname,$(LIBUTIL_SHARED).$(MAJOR_VERSION) $(COBJS) $(TOPDIR)$(SHARED_FULLNAME) - -install: all - install -d $(INSTALL_DIR)/lib - install -m 644 $(LIBUTIL) $(INSTALL_DIR)/lib/ - @if [ -f $(LIBUTIL_SHARED).$(MAJOR_VERSION) ] ; then \ - install -m 644 $(LIBUTIL_SHARED).$(MAJOR_VERSION) $(INSTALL_DIR)/lib/; \ - (cd $(INSTALL_DIR)/lib/;ln -sf $(LIBUTIL_SHARED).$(MAJOR_VERSION) $(LIBUTIL_SHARED)); \ - fi; +shared: all + $(TARGET_CC) $(LDFLAGS) -shared -o $(LIBUTIL_SHARED_FULLNAME) \ + -Wl,-soname,$(LIBUTIL_SHARED).$(MAJOR_VERSION) $(OBJS) $(TOPDIR)$(SHARED_FULLNAME) + install -d $(TOPDIR)lib + rm -f $(TOPDIR)lib/$(LIBUTIL_SHARED_FULLNAME) $(TOPDIR)lib/$(LIBUTIL_SHARED).$(MAJOR_VERSION) + install -m 644 $(LIBUTIL_SHARED_FULLNAME) $(TOPDIR)lib/; + (cd $(TOPDIR)lib; ln -sf $(LIBUTIL_SHARED_FULLNAME) $(LIBUTIL_SHARED).$(MAJOR_VERSION)); clean: - rm -f *.[oa] *~ core $(LIBUTIL_SHARED).$(MAJOR_VERSION) + rm -f *.[oa] *~ core $(LIBUTIL_SHARED)* $(LIBUTIL_SHARED_FULLNAME)* |