[vox-tech] Make question: headers depending on other headers

Rod Roark vox-tech@lists.lugod.org
Wed, 31 Mar 2004 15:19:25 -0800


On Wednesday 31 March 2004 02:56 pm, Bill Kendrick wrote:
=2E..
> Should I make "bar.h" depend on "zzz.h"?  Or "foo.o" depend on it?  Or...?

No, bar.h is not a build target so you don't want to list it
as dependent on other stuff.  So do:

=A0 foo.o: foo.c foo.h bar.h zzz.h
    etc.

Or if lots of things depend on bar.h then you may want to do
something like this:

   BAR_DEPS =3D bar.h zzz.h
   foo.o: foo.c foo.h $(BAR_DEPS)
     etc.

=2D- Rod