Make GNU Make behave like BSD Make?

Dan Nelson dnelson at allantgroup.com
Wed Jul 13 21:01:40 GMT 2005


In the last episode (Jul 13), David Kelly said:
> On Wed, Jul 13, 2005 at 02:08:07PM -0500, Dan Nelson wrote:
> > I believe "-include .depend" will tell gmake to try to include the
> > file but not complain if it's not there.
> 
> Yes! That does work!
> 
> OTOH it breaks in BSD Make.  :-(

Automake's method of handling dependencies is interesting; it generates
a dependency file for each object file as part of the .c.o rule.  It
includes them all at the bottom of the Makefile and generates dummy
entries during the ./configure stage to placate gmake.  You could do
something similar with the one-big-depend style by including a dummy
.depend file in your tarball with a date in the past.  The first Make
run will include the dummy .depend and force a rebuild because it's out
of date.  Since the dependency file isn't needed the first time you
generate object files, that's okay.

-- 
	Dan Nelson
	dnelson at allantgroup.com


More information about the freebsd-questions mailing list