summaryrefslogtreecommitdiffstats
path: root/src/liburing/Makefile
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:54:28 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:54:28 +0000
commite6918187568dbd01842d8d1d2c808ce16a894239 (patch)
tree64f88b554b444a49f656b6c656111a145cbbaa28 /src/liburing/Makefile
parentInitial commit. (diff)
downloadceph-upstream/18.2.2.tar.xz
ceph-upstream/18.2.2.zip
Adding upstream version 18.2.2.upstream/18.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--src/liburing/Makefile77
-rw-r--r--src/liburing/Makefile.quiet10
2 files changed, 87 insertions, 0 deletions
diff --git a/src/liburing/Makefile b/src/liburing/Makefile
new file mode 100644
index 000000000..948e00494
--- /dev/null
+++ b/src/liburing/Makefile
@@ -0,0 +1,77 @@
+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")
+
+INSTALL=install
+
+default: all
+
+all:
+ @$(MAKE) -C src
+ @$(MAKE) -C test
+ @$(MAKE) -C examples
+
+partcheck: all
+ @echo "make partcheck => TODO add tests with out kernel support"
+
+runtests: all
+ @$(MAKE) -C test runtests
+runtests-loop:
+ @$(MAKE) -C test runtests-loop
+
+config-host.mak: configure
+ @if [ ! -e "$@" ]; then \
+ echo "Running configure ..."; \
+ ./configure; \
+ else \
+ echo "$@ is out-of-date, running configure"; \
+ sed -n "/.*Configured with/s/[^:]*: //p" "$@" | sh; \
+ fi
+
+ifneq ($(MAKECMDGOALS),clean)
+include config-host.mak
+endif
+
+%.pc: %.pc.in config-host.mak $(SPECFILE)
+ sed -e "s%@prefix@%$(prefix)%g" \
+ -e "s%@libdir@%$(libdir)%g" \
+ -e "s%@includedir@%$(includedir)%g" \
+ -e "s%@NAME@%$(NAME)%g" \
+ -e "s%@VERSION@%$(VERSION)%g" \
+ $< >$@
+
+install: $(NAME).pc
+ @$(MAKE) -C src install prefix=$(DESTDIR)$(prefix) \
+ includedir=$(DESTDIR)$(includedir) \
+ libdir=$(DESTDIR)$(libdir) \
+ libdevdir=$(DESTDIR)$(libdevdir) \
+ relativelibdir=$(relativelibdir)
+ $(INSTALL) -D -m 644 $(NAME).pc $(DESTDIR)$(libdevdir)/pkgconfig/$(NAME).pc
+ $(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man2
+ $(INSTALL) -m 644 man/*.2 $(DESTDIR)$(mandir)/man2
+
+install-tests:
+ @$(MAKE) -C test install prefix=$(DESTDIR)$(prefix) datadir=$(DESTDIR)$(datadir)
+
+clean:
+ @rm -f config-host.mak config-host.h cscope.out $(NAME).pc test/*.dmesg
+ @$(MAKE) -C src clean
+ @$(MAKE) -C test clean
+ @$(MAKE) -C examples clean
+
+cscope:
+ @cscope -b -R
+
+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)
diff --git a/src/liburing/Makefile.quiet b/src/liburing/Makefile.quiet
new file mode 100644
index 000000000..8eac349a8
--- /dev/null
+++ b/src/liburing/Makefile.quiet
@@ -0,0 +1,10 @@
+ifneq ($(findstring $(MAKEFLAGS),s),s)
+ifndef V
+ QUIET_CC = @echo ' ' CC $@;
+ QUIET_LINK = @echo ' ' LINK $@;
+ QUIET_AR = @echo ' ' AR $@;
+ QUIET_RANLIB = @echo '' RANLIB $@;
+endif
+endif
+
+