--- a/src/Makefile +++ b/src/Makefile @@ -19,11 +19,12 @@ LINK_FLAGS=-Wl,-z,defs LINK_FLAGS+=$(LDFLAGS) ENABLE_SHARED ?= 1 +DESTDIR ?= /usr soname=liburing.so.$(VERSION_MAJOR) -libname=liburing.so.$(VERSION) +libname=liburing.so ffi_soname=liburing-ffi.so.$(VERSION_MAJOR) -ffi_libname=liburing-ffi.so.$(VERSION) +ffi_libname=liburing-ffi.so all_targets += liburing.a all_targets += liburing-ffi.a @@ -85,20 +86,16 @@ $(QUIET_CC)$(CC) $(SO_CFLAGS) -shared -Wl,--version-script=liburing-ffi.map -Wl,-soname=$(ffi_soname) -o $@ $(liburing_sobjs) $(liburing_ffi_sobjs) $(LINK_FLAGS) install: $(all_targets) - install -D -m 644 include/liburing/io_uring.h $(includedir)/liburing/io_uring.h - install -D -m 644 include/liburing.h $(includedir)/liburing.h - install -D -m 644 include/liburing/compat.h $(includedir)/liburing/compat.h - install -D -m 644 include/liburing/barrier.h $(includedir)/liburing/barrier.h - install -D -m 644 include/liburing/io_uring_version.h $(includedir)/liburing/io_uring_version.h - install -D -m 644 liburing.a $(libdevdir)/liburing.a - install -D -m 644 liburing-ffi.a $(libdevdir)/liburing-ffi.a + install -D -m 644 include/liburing/io_uring.h $(DESTDIR)$(includedir)/liburing/io_uring.h + install -D -m 644 include/liburing.h $(DESTDIR)$(includedir)/liburing.h + install -D -m 644 include/liburing/compat.h $(DESTDIR)$(includedir)/liburing/compat.h + install -D -m 644 include/liburing/barrier.h $(DESTDIR)$(includedir)/liburing/barrier.h + install -D -m 644 include/liburing/io_uring_version.h $(DESTDIR)$(includedir)/liburing/io_uring_version.h + install -D -m 644 liburing.a $(DESTDIR)$(libdevdir)/liburing.a + install -D -m 644 liburing-ffi.a $(DESTDIR)$(libdevdir)/liburing-ffi.a ifeq ($(ENABLE_SHARED),1) - install -D -m 755 $(libname) $(libdir)/$(libname) - install -D -m 755 $(ffi_libname) $(libdir)/$(ffi_libname) - ln -sf $(libname) $(libdir)/$(soname) - ln -sf $(relativelibdir)$(libname) $(libdevdir)/liburing.so - ln -sf $(ffi_libname) $(libdir)/$(ffi_soname) - ln -sf $(relativelibdir)$(ffi_libname) $(libdevdir)/liburing-ffi.so + install -D -m 755 $(libname) $(DESTDIR)$(libdir)/$(libname) + install -D -m 755 $(ffi_libname) $(DESTDIR)$(libdir)/$(ffi_libname) endif clean: