[dev] Reasonable Makefiles

From: Nick <suckless-dev_AT_njw.me.uk>
Date: Tue, 11 Feb 2014 12:19:59 +0000

I was reading the opengroup specifications for make(1) recently[0],
and found that even our standard makefile practise of using 'include'
for config variables is nonstandard, as far as they're concerned.
Needless to say I think 'include' is a perfectly reasonable feature
to use, and it evidently works everywhere that people care about.

But it got me thinking about what other features of make are worth
using. Basically because I'm replacing a autotools horrorshow with
plain make, but am not sure what the nicest way of allowing compile-
time feature disabling is. Can 'ifdef' be relied upon, and does it
tend to produce unreadable and buggy makefiles in anyone's
experience? Are there other options, beyond asking people to comment
out certain lines in a config.mk, to e.g. disable some LDFLAGS?

I know switching to mk would solve all of my problems and give me
something standard and portable, but it would also be a dependency
which isn't as widely installed as make, which I'm not overly keen on.

And also I generally agree that compile-time options are a bad plan,
but one fight at a time, eh?


0. http://pubs.opengroup.org/onlinepubs/009695399/utilities/make.html
Received on Tue Feb 11 2014 - 13:19:59 CET

This archive was generated by hypermail 2.3.0 : Tue Feb 11 2014 - 13:24:06 CET