summaryrefslogtreecommitdiff
path: root/libutil/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'libutil/Makefile')
-rw-r--r--libutil/Makefile30
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)*