summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBikal Lem <gbikal+git@gmail.com>2021-11-15 13:09:30 +0000
committerBikal Lem <gbikal+git@gmail.com>2021-11-15 13:09:30 +0000
commitc0b43df28a982747e081343f23289357ab4615db (patch)
tree0b4ef14573b0842dd13791140a79390a3030c47e
parentb7159e46bc002c7a174e184d94cfa61552f92e69 (diff)
downloadliburing-c0b43df28a982747e081343f23289357ab4615db.tar.gz
liburing-c0b43df28a982747e081343f23289357ab4615db.tar.bz2
src/Makefile: use VERSION variable consistently
src/Makefile defines incorrect 'liburing.so' version, i.e 2.1 as opposed to 2.2. This commit makes src/Makefile use correct version defined in liburing.spec. Along the way we refactor the use of common variables into Makefile.common and include it into both src/Makefile and Makefile. Signed-off-by: Bikal Lem <gbikal+git@gmail.com>
-rw-r--r--Makefile6
-rw-r--r--Makefile.common5
-rw-r--r--liburing.spec2
-rw-r--r--src/Makefile8
4 files changed, 12 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 5d9c4dc..28c0fd8 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,5 @@
-NAME=liburing
-SPECFILE=$(NAME).spec
-VERSION=$(shell awk '/Version:/ { print $$2 }' $(SPECFILE))
-TAG = $(NAME)-$(VERSION)
+include Makefile.common
+
RPMBUILD=$(shell `which rpmbuild >&/dev/null` && echo "rpmbuild" || echo "rpm")
INSTALL=install
diff --git a/Makefile.common b/Makefile.common
new file mode 100644
index 0000000..e7c9412
--- /dev/null
+++ b/Makefile.common
@@ -0,0 +1,5 @@
+TOP := $(dir $(CURDIR)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))
+NAME=liburing
+SPECFILE=$(TOP)/$(NAME).spec
+VERSION=$(shell awk '/Version:/ { print $$2 }' $(SPECFILE))
+TAG = $(NAME)-$(VERSION)
diff --git a/liburing.spec b/liburing.spec
index 7eb5731..df62d2f 100644
--- a/liburing.spec
+++ b/liburing.spec
@@ -1,5 +1,5 @@
Name: liburing
-Version: 2.1
+Version: 2.2
Release: 1%{?dist}
Summary: Linux-native io_uring I/O access library
License: (GPLv2 with exceptions and LGPLv2+) or MIT
diff --git a/src/Makefile b/src/Makefile
index 09ff395..c29a80d 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,3 +1,5 @@
+include ../Makefile.common
+
prefix ?= /usr
includedir ?= $(prefix)/include
libdir ?= $(prefix)/lib
@@ -14,10 +16,8 @@ LINK_FLAGS=
LINK_FLAGS+=$(LDFLAGS)
ENABLE_SHARED ?= 1
-soname=liburing.so.2
-minor=1
-micro=0
-libname=$(soname).$(minor).$(micro)
+soname=liburing.so
+libname=$(soname).$(VERSION)
all_targets += liburing.a
ifeq ($(ENABLE_SHARED),1)