From a07a0e5e5f5f9ad8c3533202b6a7cd3a8036f5f4 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Sun, 6 May 2018 00:10:38 -0400 Subject: [PATCH] Add recipe to install the library only (GH #653) Some distros don't want to install cryptest.exe. For folks who don't want to install the test program, they can issue 'make install-lib'. install-lib is a non-standard target, but the GNU Coding Standard does not have a standard target for the task. --- GNUmakefile | 25 +++++++++++++++---------- GNUmakefile-cross | 15 ++++++++++----- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index b21ffd27..3963fdd1 100755 --- a/GNUmakefile +++ b/GNUmakefile @@ -845,23 +845,28 @@ distclean: clean @-$(RM) cryptopp$(LIB_VER)\.* @-$(RM) CryptoPPRef.zip -# Some users already have a libcryptopp.pc. We install it if the file -# is present. If you want one, then issue 'make libcryptopp.pc'. +# Install cryptest.exe, libcryptopp.a, libcryptopp.so and libcryptopp.pc. +# The library install was broken-out into its own recipe at GH #653. .PHONY: install -install: - @-$(MKDIR) $(DESTDIR)$(INCLUDEDIR)/cryptopp - $(INSTALL_DATA) *.h $(DESTDIR)$(INCLUDEDIR)/cryptopp -ifneq ($(wildcard libcryptopp.a),) - @-$(MKDIR) $(DESTDIR)$(LIBDIR) - $(INSTALL_DATA) libcryptopp.a $(DESTDIR)$(LIBDIR) -endif -ifneq ($(wildcard cryptest.exe),) +install: cryptest.exe install-lib @-$(MKDIR) $(DESTDIR)$(BINDIR) $(INSTALL_PROGRAM) cryptest.exe $(DESTDIR)$(BINDIR) @-$(MKDIR) $(DESTDIR)$(DATADIR)/cryptopp/TestData @-$(MKDIR) $(DESTDIR)$(DATADIR)/cryptopp/TestVectors $(INSTALL_DATA) TestData/*.dat $(DESTDIR)$(DATADIR)/cryptopp/TestData $(INSTALL_DATA) TestVectors/*.txt $(DESTDIR)$(DATADIR)/cryptopp/TestVectors + +# A recipe to install only the library, and not cryptest.exe. Also +# see https://github.com/weidai11/cryptopp/issues/653. Some users +# already have a libcryptopp.pc. Install the *.pc file if the file +# is present. If you want one, then issue 'make libcryptopp.pc'. +.PHONY: install-lib +install-lib: + @-$(MKDIR) $(DESTDIR)$(INCLUDEDIR)/cryptopp + $(INSTALL_DATA) *.h $(DESTDIR)$(INCLUDEDIR)/cryptopp +ifneq ($(wildcard libcryptopp.a),) + @-$(MKDIR) $(DESTDIR)$(LIBDIR) + $(INSTALL_DATA) libcryptopp.a $(DESTDIR)$(LIBDIR) endif ifneq ($(wildcard libcryptopp.dylib),) @-$(MKDIR) $(DESTDIR)$(LIBDIR) diff --git a/GNUmakefile-cross b/GNUmakefile-cross index daf11105..a74df747 100755 --- a/GNUmakefile-cross +++ b/GNUmakefile-cross @@ -387,18 +387,23 @@ distclean: clean @-$(RM) cryptopp$(LIB_VER)\.* @-$(RM) CryptoPPRef.zip +# Install cryptest.exe, libcryptopp.a and libcryptopp.so. +# The library install was broken-out into its own recipe at GH #653. .PHONY: install -install: - @-$(MKDIR) $(DESTDIR)$(INCLUDEDIR)/cryptopp - $(INSTALL_DATA) *.h $(DESTDIR)$(INCLUDEDIR)/cryptopp -ifneq ($(wildcard cryptest.exe),) +install: cryptest.exe install-lib @-$(MKDIR) $(DESTDIR)$(BINDIR) $(INSTALL_PROGRAM) cryptest.exe $(DESTDIR)$(BINDIR) @-$(MKDIR) $(DESTDIR)$(DATADIR)/cryptopp/TestData @-$(MKDIR) $(DESTDIR)$(DATADIR)/cryptopp/TestVectors $(INSTALL_DATA) TestData/*.dat $(DESTDIR)$(DATADIR)/cryptopp/TestData $(INSTALL_DATA) TestVectors/*.txt $(DESTDIR)$(DATADIR)/cryptopp/TestVectors -endif + +# A recipe to install only the library, and not cryptest.exe. Also +# see https://github.com/weidai11/cryptopp/issues/653. +.PHONY: install-lib +install-lib: + @-$(MKDIR) $(DESTDIR)$(INCLUDEDIR)/cryptopp + $(INSTALL_DATA) *.h $(DESTDIR)$(INCLUDEDIR)/cryptopp ifneq ($(wildcard libcryptopp.a),) @-$(MKDIR) $(DESTDIR)$(LIBDIR) $(INSTALL_DATA) libcryptopp.a $(DESTDIR)$(LIBDIR)