install: makefile target to install libraries

As we don't install the libraries by default, provide a make target,
"install-library" to install the libsuricata library files.

If shared library support exists, both the static and shared
libraries will be installed, otherwise only the static libraries
will be installed.
pull/5866/head
Jason Ish 4 years ago
parent e227d97e5e
commit dbae17dbc0

@ -54,3 +54,7 @@ endif
@echo "For more information please see:"
@echo " https://suricata.readthedocs.io/en/latest/rule-management/index.html"
@echo ""
install-library:
cd src && $(MAKE) $@
cd rust && $(MAKE) $@

@ -2680,6 +2680,7 @@ AC_SUBST(CONFIGURE_DATAROOTDIR)
AC_SUBST(PACKAGE_VERSION)
AC_SUBST(RUST_FEATURES)
AC_SUBST(RUST_SURICATA_LIBDIR)
AC_SUBST(RUST_SURICATA_LIBNAME)
AM_CONDITIONAL([BUILD_SHARED_LIBRARY], [test "x$enable_shared" = "xyes"] && [test "x$can_build_shared_library" = "xyes"])

@ -51,6 +51,13 @@ endif
fi
$(MAKE) gen/rust-bindings.h
install-library:
$(MKDIR_P) "$(DESTDIR)$(libdir)"
$(INSTALL_DATA) $(RUST_SURICATA_LIB) "$(DESTDIR)$(libdir)"
uninstall-local:
rm -f "$(DESTDIR)$(libdir)/$(RUST_SURICATA_LIBNAME)"
clean-local:
rm -rf target
if HAVE_CBINDGEN

@ -608,6 +608,23 @@ libsuricata.so:
@exit 1
endif
if BUILD_SHARED_LIBRARY
install-library: libsuricata.so.$(VERSION)
else
install-library:
endif
$(MKDIR_P) "$(DESTDIR)$(libdir)"
$(INSTALL_DATA) libsuricata_c.a "$(DESTDIR)$(libdir)"
if BUILD_SHARED_LIBRARY
$(INSTALL) libsuricata.so.$(VERSION) "$(DESTDIR)$(libdir)"
ln -sf libsuricata.so.$(VERSION) "$(DESTDIR)$(libdir)/libsuricata.so"
endif
uninstall-local:
rm -f "$(DESTDIR)$(libdir)/libsuricata_c.a"
rm -f "$(DESTDIR)$(libdir)/libsuricata.so"
rm -f "$(DESTDIR)$(libdir)/libsuricata.$(VERSION)"
if BUILD_FUZZTARGETS
LDFLAGS_FUZZ = $(all_libraries) $(SECLDFLAGS)

Loading…
Cancel
Save