BSD make vs. GNU make
kruptos at mlinux.org
Thu Apr 19 03:33:40 UTC 2007
On Tuesday 17 April 2007 13:15:08 Bill Campbell wrote:
> The gmake program has many extensions which tend to be used in
> the gnu automake, autoconf, libtools system.
> I suspect that gmake will work with most non-gnu Makefiles, but
> the reverse is not true.
This suspicion is not necessarily true. That is something I learned the hard
way back when I was in college. I was doing all my development on FreeBSD in
my dorm room but the target machine was Linux. Because I was naive, I didn't
concern myself with "which" make I was using. And I hand created a Makefile
for my project. I did this in my room and I was referencing the
documentation for PMake (/usr/share/doc/psd/12.make) as recommended by the
The time of the week comes to move to the lab environment... and I copied my
files there and saw a bug. So I started fixing it and ended up on a roll
where I wrote a large portion of code. I saved the code, exited vi, and ran
make. Well, some syntax in my Makefile and gmake did not agree. And rather
than just erroring nicely, it zeroed out my source file and then errored out.
I'd lost well over an hour of work which I never really did recreate to my
recollection of it. Even though I have saved religiously while working, I
have never bothered to commit the changed to the repository so it was all
lost. Had I stayed in vi and run make in a subshell or committed my
changes... well, can't go back and make better choices now.
I've since moved on and that project collects digital dust somewhere... along
with the circuit board it was meant to control. I wish I had kept the
original Makefile so I know exactly what I did. But at the time I was so
panicked that I rewrote it to work with gmake and just remembered to use
gmake in my room as well.
Anyway, I am rambling. We can't make the assumption that gmake is "backwards"
compatible with any other form of make. Actually, we can demonstrate that
it's not the case by trying to use gmake with ports... you will find that it
fails with an error. At least with ports it's nondestructive. :)
More information about the freebsd-questions