Page MenuHomeFreeBSD

style.Makefile: document the style for lists
ClosedPublic

Authored by obrien on Wed, Oct 29, 8:03 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 1, 9:04 PM
Unknown Object (File)
Fri, Oct 31, 6:07 AM
Unknown Object (File)
Fri, Oct 31, 3:46 AM
Unknown Object (File)
Fri, Oct 31, 12:47 AM
Unknown Object (File)
Fri, Oct 31, 12:47 AM
Unknown Object (File)
Fri, Oct 31, 12:47 AM
Unknown Object (File)
Fri, Oct 31, 12:47 AM
Unknown Object (File)
Thu, Oct 30, 7:51 PM
Subscribers

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sjg added inline comments.
share/man/man5/style.Makefile.5
262

probably worth calling out that a list of libs that represent link-order is a well known exception.

Also do you want to specify a trigger for the above format?
Ie a single line list of up to N elements is ok, but beyond that switch to one per line format.

share/man/man5/style.Makefile.5
262

Based on 0e1e341b486cdf it would seem not even libs need to be an exception. I have added a "trigger".

This revision is now accepted and ready to land.Thu, Oct 30, 3:13 AM
This revision was automatically updated to reflect the committed changes.

Eh, I'm not sure this is actually the style we want? Lots of places in the tree fix the diff problem by just using multiple += statements, e.g.:

FOO= foo
FOO+= bar
FOO+= baz

The solution advocated here is only in limited use in the tree and it might be better to recommend something already in use.

In D53429#1221417, @jhb wrote:

Eh, I'm not sure this is actually the style we want? Lots of places in the tree fix the diff problem by just using multiple += statements, e.g.:

FOO= foo
FOO+= bar
FOO+= baz

Good comment/question.
The += approach certainly works and can achieve the same goal.
There's cost though in terms of memory churn in make.

The solution advocated here is only in limited use in the tree and it might be better to recommend something already in use.

Readability and maintainability of makefiles is important and changing style for change sake is bad.

There seem to be enough people who care about build performance though to perhaps give some weight to makefile efficiency?

For small makefiles it makes little difference, but for large makefiles the difference is measurable.