Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Jan 2014 15:43:08 +0100
From:      Dimitry Andric <dim@FreeBSD.org>
To:        Julio Merino <julio@meroh.net>
Cc:        freebsd-hackers <freebsd-hackers@freebsd.org>
Subject:   Re: Where to put common Makefile code
Message-ID:  <37F0C6E7-A2E4-4B86-A6D3-71FD451A471C@FreeBSD.org>
In-Reply-To: <CADyfeQUCzMjh%2BiRLP3n0vtRgYZZ45Z1H3nj-UKgYyAybxTi0_g@mail.gmail.com>
References:  <CADyfeQUCzMjh%2BiRLP3n0vtRgYZZ45Z1H3nj-UKgYyAybxTi0_g@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--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 <julio@meroh.net> 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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?37F0C6E7-A2E4-4B86-A6D3-71FD451A471C>