3 ms·
> 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 s
by beefhash 9y ago
> 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?
- Tomte 9y agoWhy 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!
- beefhash 9y agoBecause "-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/make.html http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ma... [2] https://man.openbsd.org/make https://man.openbsd.org/make [3] https://www.freebsd.org/cgi/man.cgi?make https://www.freebsd.org/cgi/man.cgi?make
- pja 9y agoFrankly 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.