From owner-freebsd-hackers@FreeBSD.ORG Sun Jan 12 23:44:34 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 14C15624 for ; Sun, 12 Jan 2014 23:44:34 +0000 (UTC) Received: from mail-we0-f177.google.com (mail-we0-f177.google.com [74.125.82.177]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9D2D71C8A for ; Sun, 12 Jan 2014 23:44:33 +0000 (UTC) Received: by mail-we0-f177.google.com with SMTP id x55so3654796wes.22 for ; Sun, 12 Jan 2014 15:44:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=tQqCw1tZy8/zNu9IZbufqd64R6b+q9fOvSxArSrTmGo=; b=HxJae5n33x6D4Dcyimg9isW61i1VD0N0Zr4Sjl3PqPTB7cu0g1O9kFTTsWqhU3fGck eevsCZvQvclpo0CkPthq/nXPBoGfp9KJ95/uDVL6/Lbe+C4lhJ5GqpQRqbt4SG+IqYul snHC6MUqdKXDqdB/2i2Lrd9eDjbiA76VNQcmfQ6FjbX1XYPEeRrlZ3r/F4wHhIOi6azV viRXgCnAbtIox4Sp40fQzIaCD9o2aHZH2hCW1NOZ360OY6oR+UEbkBJFJRRlLP6v4bF+ 4tqnrIm4yLcbZzPTrWByxfn6fI34CQ8yKnnw7wnalXbz2S2dH2GHMf1DFVrJr6B/NELi /o7w== X-Gm-Message-State: ALoCoQlpEBEYycJxDeR3QkKqVrGhn74quTLTagkWVk/925SBf+6IciyY5KInq2mR1NmMLqU430u7 X-Received: by 10.194.1.195 with SMTP id 3mr202581wjo.77.1389566501066; Sun, 12 Jan 2014 14:41:41 -0800 (PST) Received: from [192.168.1.118] (62.57.0.127.dyn.user.ono.com. [62.57.0.127]) by mx.google.com with ESMTPSA id x4sm14719804wif.0.2014.01.12.14.41.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 12 Jan 2014 14:41:40 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\)) Subject: Re: Where to put common Makefile code From: Julio Merino In-Reply-To: <37F0C6E7-A2E4-4B86-A6D3-71FD451A471C@FreeBSD.org> Date: Sun, 12 Jan 2014 23:41:33 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <2FA79428-C0DD-4B19-890B-D537F992D7F0@meroh.net> References: <37F0C6E7-A2E4-4B86-A6D3-71FD451A471C@FreeBSD.org> To: Dimitry Andric 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 23:44:34 -0000 On Jan 12, 2014, at 15:43, Dimitry Andric wrote: > On 12 Jan 2014, at 11:25, Julio Merino 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!=