Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 05 Jan 2003 00:20:12 -0700 (MST)
From:      "M. Warner Losh" <imp@bsdimp.com>
To:        kientzle@acm.org
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: Makefile Style Questions
Message-ID:  <20030105.002012.128162202.imp@bsdimp.com>
In-Reply-To: <3E1781B2.6090005@acm.org>
References:  <3E1781B2.6090005@acm.org>

next in thread | previous in thread | raw e-mail | index | archive | help
In message: <3E1781B2.6090005@acm.org>
            Tim Kientzle <kientzle@acm.org> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030105.002012.128162202.imp>