aboutsummaryrefslogtreecommitdiff
path: root/src/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/Makefile b/src/Makefile
index d33c9f1..fde31e4 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -18,6 +18,9 @@ override CFLAGS := $(WARNINGS) $(INCLUDE_DIRS) -fPIC $(CFLAGS)
VPATH = ../include/tinyalsa
OBJECTS = limits.o mixer.o pcm.o
+LIBVERSION_MAJOR = $(TINYALSA_VERSION_MAJOR)
+LIBVERSION = $(TINYALSA_VERSION)
+
.PHONY: all
all: libtinyalsa.a libtinyalsa.so
@@ -30,28 +33,28 @@ mixer.o: mixer.c mixer.h
libtinyalsa.a: $(OBJECTS)
$(AR) $(ARFLAGS) $@ $^
-libtinyalsa.so: libtinyalsa.so.1
+libtinyalsa.so: libtinyalsa.so.$(LIBVERSION_MAJOR)
ln -sf $< $@
-libtinyalsa.so.1: libtinyalsa.so.1.1.1
+libtinyalsa.so.$(LIBVERSION_MAJOR): libtinyalsa.so.$(LIBVERSION)
ln -sf $< $@
-libtinyalsa.so.1.1.1: $(OBJECTS)
- $(LD) $(LDFLAGS) -shared -Wl,-soname,libtinyalsa.so.1 $^ -o $@
+libtinyalsa.so.$(LIBVERSION): $(OBJECTS)
+ $(LD) $(LDFLAGS) -shared -Wl,-soname,libtinyalsa.so.$(LIBVERSION_MAJOR) $^ -o $@
.PHONY: clean
clean:
rm -f libtinyalsa.a
rm -f libtinyalsa.so
- rm -f libtinyalsa.so.1
- rm -f libtinyalsa.so.1.1.1
+ rm -f libtinyalsa.so.$(LIBVERSION_MAJOR)
+ rm -f libtinyalsa.so.$(LIBVERSION)
rm -f $(OBJECTS)
.PHONY: install
-install: libtinyalsa.a libtinyalsa.so.1
+install: libtinyalsa.a libtinyalsa.so.$(LIBVERSION_MAJOR)
install -d $(DESTDIR)$(LIBDIR)/
install libtinyalsa.a $(DESTDIR)$(LIBDIR)/
- install libtinyalsa.so.1.1.1 $(DESTDIR)$(LIBDIR)/
- ln -sf libtinyalsa.so.1.1.1 $(DESTDIR)$(LIBDIR)/libtinyalsa.so.1
- ln -sf libtinyalsa.so.1 $(DESTDIR)$(LIBDIR)/libtinyalsa.so
+ install libtinyalsa.so.$(LIBVERSION) $(DESTDIR)$(LIBDIR)/
+ ln -sf libtinyalsa.so.$(LIBVERSION) $(DESTDIR)$(LIBDIR)/libtinyalsa.so.$(LIBVERSION_MAJOR)
+ ln -sf libtinyalsa.so.$(LIBVERSION_MAJOR) $(DESTDIR)$(LIBDIR)/libtinyalsa.so