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

next in thread | previous in thread | raw e-mail | index | archive | help
On Jan 12, 2014, at 15:43, Dimitry Andric <dim@FreeBSD.org> wrote:

> On 12 Jan 2014, at 11:25, Julio Merino <julio@meroh.net> wrote:
>>=20
>> 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.
>>=20
>> 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/
>>=20
>> 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.
>>=20
>> So where would you put this?
>=20
> 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.

OK, so because there was prior art in just adding a file to the =
corresponding lib/ subdirectory and using it outside of lib/, I went =
ahead and did it.

Thanks!=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2FA79428-C0DD-4B19-890B-D537F992D7F0>