From owner-freebsd-hackers Sat Jan 4 23:21:14 2003 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9126337B401 for ; Sat, 4 Jan 2003 23:21:12 -0800 (PST) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id D52FD43EC2 for ; Sat, 4 Jan 2003 23:21:11 -0800 (PST) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.6/8.12.3) with ESMTP id h057L71e051360; Sun, 5 Jan 2003 00:21:08 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sun, 05 Jan 2003 00:20:12 -0700 (MST) Message-Id: <20030105.002012.128162202.imp@bsdimp.com> To: kientzle@acm.org Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Makefile Style Questions From: "M. Warner Losh" In-Reply-To: <3E1781B2.6090005@acm.org> References: <3E1781B2.6090005@acm.org> X-Mailer: Mew version 2.1 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message: <3E1781B2.6090005@acm.org> Tim Kientzle writes: : Is there any documentation similar to style(9) : that specifically addresses Makefile style issues? There's one in the process of being written. : 1) Is there an accepted use for 'COPTS'? : : My current draft adds COPTS support to : bsd.lib.mk. I can then use COPTS to : add flags when I re-compile portions : of the source tree for /rescue. : : I could instead create a new Makefile : variable and add it to bsd.prog.mk and : bsd.lib.mk if there is an existing : convention for use of COPTS. IIRC, COPTS is there only for users to use, not for system Makefiles. Bruce will know for sure. There's only one use of COPTS that I could find in the tree, and that was commented out. There's also a DEBUG_FLAGS that's added at the same time as COPTS. It would be better, I think, to create a special purpose variable if you need it to do the /rescue stuff (which is a dynamically linked /bin and /sbin with a /resuce/* crunchgen'd binary iirc). : 2) I notice that some existing preprocessor and : Makefile variables use leading underscores, some : don't. Is there a specific style convention : on this? A leading underscore is used for things that are internal to the .mk files (not visable or settable outside the .mk files, in general). Also, I think that two leading _ are used for sys.mk, which is included in all Makefiles, even those that don't use foo.mk, so extra care must be taken there not to pollute things. Also, be sure to post a diff for review prior to commit. This is a big change and many people will be interested in it. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message