Makefiles compatible with both BSD and GNU make?

David Kelly dkelly at hiwaay.net
Wed Mar 16 12:32:52 PST 2005


I got the silly idea that I want one Makefile to work with both BSD and
GNU makes. Silly me. Fairly simple Makefiles work but when expanding my
Makefile to include .depend generation I get tripped.

BSD make automagically uses .depend if one is found. GNU make requires
the file be named in an include, but the syntax of GNU include is
different than BSD. As is the syntax of conditional statements.

Yes, I could simply use gmake on FreeBSD and make under cygwin, but
where is the fun in that? Not only no fun but nothing to be learned.

Is there a way I can write the include of .depend that GNU make will use
and at the same time BSD make will either ignore or do the same as GNU?

Meanwhile I'm just accepting the fact on cygwin the only sure way to
update is "make clean" before "make".

-- 
David Kelly N4HHE, dkelly at HiWAAY.net
========================================================================
Whom computers would destroy, they must first drive mad.


More information about the freebsd-questions mailing list