summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile11
1 files changed, 6 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 2fdaf04..e49f5cc 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,7 @@
include version
APPNAME = libmts-io
+SONAME = $(APPNAME).so.$(VERSION)
libdir ?= /usr/lib
OBJS += \
@@ -47,12 +48,12 @@ LDFLAGS += -s -shared -Wl,-soname,$(APPNAME).so.0
.PHONY: all clean install
-all: $(APPNAME).a $(APPNAME).so
+all: $(APPNAME).a $(SONAME)
$(APPNAME).a: $(OBJS)
$(AR) -r $@ $?
-$(APPNAME).so: $(OBJS)
+$(SONAME): $(OBJS)
$(CC) $(LDFLAGS) -o $@ $? $(LDLIBS)
# Handle header dependencies
@@ -63,9 +64,9 @@ CPPFLAGS += -MMD
install:
mkdir -p $(DESTDIR)$(libdir)
mkdir -p $(DESTDIR)$(includedir)/mts
- install -m 0644 $(APPNAME).a $(APPNAME).so $(DESTDIR)$(libdir)/
- ln -sf $(APPNAME).so $(DESTDIR)$(libdir)/$(APPNAME).so.0
- ln -sf $(APPNAME).so.0 $(DESTDIR)$(libdir)/$(APPNAME).so
+ install -m 0644 $(APPNAME).a $(SONAME) $(DESTDIR)$(libdir)/
+ ln -sf $(SONAME) $(DESTDIR)$(libdir)/$(APPNAME).so.0
+ ln -sf $(SONAME) $(DESTDIR)$(libdir)/$(APPNAME).so
install -m 0644 include/mts/* $(DESTDIR)$(includedir)/mts/
clean: