News for hackers. Stuff that matters.
Re:A simple makefile is a unicorn by beefhash on Thursday January 11, 2018 @04:45AM (#16122573)
> Clang, gcc and many other C compilers support it. Add that and a "-include *.d" line in the Makefile and you'll have great dependency support.

Doesn't that sacrifice portability, though? Is this method portable between GNU make and FreeBSD make and OpenBSD make?

Re:A simple makefile is a unicorn by Tomte on Thursday January 11, 2018 @05:21AM (#16122712)
Why wouldn't it? the *.d files are file snippets in regular make syntax.

The special handling is in the compilers: they emit make file parts!

Re:A simple makefile is a unicorn by beefhash on Thursday January 11, 2018 @06:07AM (#16122902)
Because "-include" is a non-standard[1,2] extension. "include" is standard POSIX behavior[1] but (1) does not seem to support wildcards and (2) errors if the file does not exist, which it never will on initial build. From a glance at the man pages, OpenBSD make does support -include[2], but FreeBSD make does not[3].

[1] cf. http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ma...

[2] https://man.openbsd.org/make

[3] https://www.freebsd.org/cgi/man.cgi?make

Re:A simple makefile is a unicorn by pja on Thursday January 11, 2018 @06:16AM (#16122929)
Frankly at this point in time, when people say "Make" they mean GNU Make. Unix distributions that wish to remain stuck in the 1980s with their original BSD Make are welcome to do so, but no sane developer is going to use BSD Make for a build system written any time in the last 25 years unless they have to.