From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-b.sr.ht (mail-b.sr.ht [173.195.146.151]) by sourceware.org (Postfix) with ESMTPS id 86762385AE5E for ; Thu, 9 Jun 2022 05:50:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 86762385AE5E Received: from git.sr.ht (unknown [173.195.146.142]) by mail-b.sr.ht (Postfix) with ESMTPSA id 2A59D11EF48; Thu, 9 Jun 2022 05:50:49 +0000 (UTC) From: ~eschwartz Date: Thu, 09 Jun 2022 00:50:19 -0400 Subject: [PATCH bzip2 3/6] shared Makefile: add install rule Message-ID: <165475384722.17277.18269615533597437835-2@git.sr.ht> X-Mailer: git.sr.ht Reply-to: ~eschwartz In-Reply-To: <165475384722.17277.18269615533597437835-0@git.sr.ht> To: bzip2-devel@sourceware.org Cc: eschwartz93@gmail.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: bzip2-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Bzip2-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2022 05:50:53 -0000 From: Eli Schwartz This will install the shared components (possibly overwriting these components installed by the static Makefile). As a prerequisite, the build rules must be refactored to use file-based targets. --- Makefile-libbz2_so.in | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/Makefile-libbz2_so.in b/Makefile-libbz2_so.in index 0d2cf8d..21fbe7c 100644 --- a/Makefile-libbz2_so.in +++ b/Makefile-libbz2_so.in @@ -26,6 +26,11 @@ CC=3D@CC@ BIGFILES=3D-D_FILE_OFFSET_BITS=3D64 CFLAGS=3D-fpic -fPIC -Wall -Winline @CFLAGS@ $(BIGFILES) =20 +prefix =3D @prefix@ +exec_prefix =3D @exec_prefix@ +bindir =3D @bindir@ +libdir =3D @libdir@ + OBJS=3D blocksort.o \ huffman.o \ crctable.o \ @@ -34,12 +39,23 @@ OBJS=3D blocksort.o \ decompress.o \ bzlib.o =20 -all: $(OBJS) +all: libbz2.so.@PACKAGE_VERSION@ bzip2-shared + +libbz2.so.@PACKAGE_VERSION@: $(OBJS) $(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.@PACKAGE_VERSION@ = $(OBJS) - $(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.@PACKAGE_VERSION@ rm -f libbz2.so.1.0 ln -s libbz2.so.@PACKAGE_VERSION@ libbz2.so.1.0 =20 +bzip2-shared: libbz2.so.@PACKAGE_VERSION@ + $(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.@PACKAGE_VERSION@ + +install: all + if ( test ! -d $(DESTDIR)$(bindir) ) ; then mkdir -p $(DESTDIR)$(bindir) ; = fi + if ( test ! -d $(DESTDIR)$(libdir) ) ; then mkdir -p $(DESTDIR)$(libdir) ; = fi + cp -f bzip2-shared $(DESTDIR)$(bindir)/bzip2 + cp -f libbz2.so.@PACKAGE_VERSION@ $(DESTDIR)$(libdir) + ln -s -f libbz2.so.@PACKAGE_VERSION@ $(DESTDIR)$(libdir)/libbz2.so.1.0 + clean: rm -f $(OBJS) bzip2.o libbz2.so.@PACKAGE_VERSION@ libbz2.so.1.0 bzip2-shared =20 --=20 2.34.2