summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2019-01-08 06:51:07 -0700
committerJens Axboe <axboe@kernel.dk>2019-01-08 07:38:15 -0700
commitf93c84e1b07474a7d776403b3516feeff4f3c933 (patch)
tree4b71b6a4013c643d669398fdb8f33f74b6081cd2 /Makefile
Initial commit
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile32
1 files changed, 32 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..88e98c9
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,32 @@
+NAME=liburing
+SPECFILE=$(NAME).spec
+VERSION=$(shell awk '/Version:/ { print $$2 }' $(SPECFILE))
+TAG = $(NAME)-$(VERSION)
+RPMBUILD=$(shell `which rpmbuild >&/dev/null` && echo "rpmbuild" || echo "rpm")
+
+prefix=/usr
+includedir=$(prefix)/include
+libdir=$(prefix)/lib
+
+default: all
+
+all:
+ @$(MAKE) -C src
+
+install:
+ @$(MAKE) -C src install prefix=$(DESTDIR)$(prefix) includedir=$(DESTDIR)$(includedir) libdir=$(DESTDIR)$(libdir)
+
+clean:
+ @$(MAKE) -C src clean
+
+tag-archive:
+ @git tag $(TAG)
+
+create-archive:
+ @git archive --prefix=$(NAME)-$(VERSION)/ -o $(NAME)-$(VERSION).tar.gz $(TAG)
+ @echo "The final archive is ./$(NAME)-$(VERSION).tar.gz."
+
+archive: clean tag-archive create-archive
+
+srpm: create-archive
+ $(RPMBUILD) --define "_sourcedir `pwd`" --define "_srcrpmdir `pwd`" --nodeps -bs $(SPECFILE)