From owner-freebsd-questions@FreeBSD.ORG Tue Dec 22 14:06:25 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DFB31065670 for ; Tue, 22 Dec 2009 14:06:25 +0000 (UTC) (envelope-from rsmith@xs4all.nl) Received: from smtp-vbr3.xs4all.nl (smtp-vbr3.xs4all.nl [194.109.24.23]) by mx1.freebsd.org (Postfix) with ESMTP id F1A9C8FC0C for ; Tue, 22 Dec 2009 14:06:24 +0000 (UTC) Received: from slackbox.xs4all.nl (slackbox.xs4all.nl [213.84.242.160]) by smtp-vbr3.xs4all.nl (8.13.8/8.13.8) with ESMTP id nBME6Mri045743; Tue, 22 Dec 2009 15:06:22 +0100 (CET) (envelope-from rsmith@xs4all.nl) Received: by slackbox.xs4all.nl (Postfix, from userid 1001) id 2A950BA9E; Tue, 22 Dec 2009 15:06:22 +0100 (CET) Date: Tue, 22 Dec 2009 15:06:22 +0100 From: Roland Smith To: Matthew Fleming Message-ID: <20091222140622.GA50797@slackbox.xs4all.nl> References: <06D5F9F6F655AD4C92E28B662F7F853E035236DA@seaxch09.desktop.isilon.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="u3/rZRmxL6MmkK24" Content-Disposition: inline In-Reply-To: <06D5F9F6F655AD4C92E28B662F7F853E035236DA@seaxch09.desktop.isilon.com> X-GPG-Fingerprint: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 X-GPG-Key: http://www.xs4all.nl/~rsmith/pubkey.txt X-GPG-Notice: If this message is not signed, don't assume I sent it! User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Scanned: by XS4ALL Virus Scanner Cc: freebsd-questions@freebsd.org Subject: Re: Compiling only shared libraries? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2009 14:06:25 -0000 --u3/rZRmxL6MmkK24 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Dec 21, 2009 at 03:00:27PM -0800, Matthew Fleming wrote: > We have a bunch of libraries to support our product and as far as I know > we only link to the shared library version. I'd like to skip the build > of the static version of our libraries to speed up our builds and save > on disk space, but I don't see any way to do that via directives in the > Makefiles. I didn't see anything in bsd.lib.mk which would indicate > this can be done. >=20 > Is this even possible? Just write your own Makefile. See the snippets below; BASENAME =3D foo VERSION_MAJOR =3D 1 VERSION_MINOR =3D 0 =2E.. OBJS =3D bar.o baz.o ... =2E.. SHARED =3D lib$(BASENAME).so.$(VERSION_MAJOR).$(VERSION_MINOR) =2E.. # build the shared library $(SHARED): $(OBJS) cc -shared -Wl,-soname,lib$(BASENAME).so.$(VERSION_MAJOR) \ -o $(SHARED) $(OBJS) $(LIBS) strip -g --strip-unneeded $(SHARED) Roland --=20 R.F.Smith http://www.xs4all.nl/~rsmith/ [plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated] pgp: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 (KeyID: C321A725) --u3/rZRmxL6MmkK24 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.13 (FreeBSD) iEYEARECAAYFAksw0l0ACgkQEnfvsMMhpyXSigCfY4uzMXpgbERwl1QsLE8xZylh XGcAoKcc3MW9Ecs7NshmQxCD+WEi4Y2n =4f76 -----END PGP SIGNATURE----- --u3/rZRmxL6MmkK24--