From 00f886a2eb636a9e44eca0ab47d4125db3e9300a Mon Sep 17 00:00:00 2001 From: Maksym Telychko Date: Mon, 10 Jun 2019 15:02:59 +0300 Subject: [MTS-MTQ] refactoring: soname links --- Makefile | 11 ++++++----- 1 file 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: -- cgit v1.2.3