2 ms·
Adding to this, in cases where I needed to use non-portable Make features for projects that I would build for both Linux and FreeBSD, I always name the Makefile
by codetrotter 7y ago
Adding to this, in cases where I needed to use non-portable Make features for projects that I would build for both Linux and FreeBSD, I always name the Makefile for GNU Make as GNUmakefile, and if I create a separate Makefile for the Make that FreeBSD ships with then I name that as BSDmakefile, which the Make that FreeBSD ships with will pick up by default when you run `make` just as GNU Make does for GNUmakefile.
Unhappily though, I think there are further portability issues, namely that when I create my BSDmakefile I am not sure that all the features I use would work with the versions of Make that come with OpenBSD, NetBSD, etc.
I mean, largely I don't do anything too crazy or fancy but the feeling is always there and I don't really have time/inclination to test every change with OpenBSD, NetBSD, etc since I don't normally use any of those other operating systems in the BSD family aside from FreeBSD which I do use.
For the last few years I've been using C less though, as I prefer Rust anyway. And for the times when I do end up creating a makefile I now usually create only a GNUmakefile. Supporting only GNU Make feels a little bad but I think in most cases people will have it installed even on FreeBSD, and at least naming it as GNUmakefile like is being suggested and as I am doing, does not waste peoples time trying to run other implementations of Make with those projects even if it might annoy them to install GNU Make.