From owner-freebsd-hackers@FreeBSD.ORG Sun Jan 12 14:43:32 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0AF99624 for ; Sun, 12 Jan 2014 14:43:32 +0000 (UTC) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B9D961689 for ; Sun, 12 Jan 2014 14:43:31 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::45d8:cd15:7900:2480] (unknown [IPv6:2001:7b8:3a7:0:45d8:cd15:7900:2480]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 67C585C43; Sun, 12 Jan 2014 15:43:22 +0100 (CET) Subject: Re: Where to put common Makefile code Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\)) Content-Type: multipart/signed; boundary="Apple-Mail=_1512ECB6-0AEB-474C-AD7F-E2C597DA5163"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.1 (6062eb4) From: Dimitry Andric In-Reply-To: Date: Sun, 12 Jan 2014 15:43:08 +0100 Message-Id: <37F0C6E7-A2E4-4B86-A6D3-71FD451A471C@FreeBSD.org> References: To: Julio Merino X-Mailer: Apple Mail (2.1827) Cc: freebsd-hackers X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jan 2014 14:43:32 -0000 --Apple-Mail=_1512ECB6-0AEB-474C-AD7F-E2C597DA5163 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On 12 Jan 2014, at 11:25, Julio Merino wrote: > > I have some common Makefile boilerplate code for both lib/atf/ and > usr.bin/atf/ that I'm unsure about where to best put it. > > The code in question is the definition of a set of useful variables > and target rules that can be depended on where necessary to, e.g. > obtain atf's version number from the files in contrib/atf/ > > The fragment is not "long enough" to be a big deal if it were > duplicated in 3 different Makefiles, but obviously I'd prefer to avoid > the copy/paste. > > So where would you put this? For an example (admittedly not the most elegant, but it works), have a look at lib/clang/clang.build.mk, which contains the common make-related bits for clang and llvm. This is included by the clang and llvm libraries (which live under lib/clang) via lib/clang/clang.lib.mk, and by the clang and llvm programs (which live under usr.bin/clang) via usr.bin/clang/clang.prog.mk. -Dimitry --Apple-Mail=_1512ECB6-0AEB-474C-AD7F-E2C597DA5163 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iEYEARECAAYFAlLSqgYACgkQsF6jCi4glqNPjQCg2QiZoOpSeOzXOfLOJV7FWNNg 5Y0AoIxUSog2PBd/HCO/eR1Qu0+9n8V1 =LPG2 -----END PGP SIGNATURE----- --Apple-Mail=_1512ECB6-0AEB-474C-AD7F-E2C597DA5163--