Make dependencies and nested include files

corbin at maxzilla.Encore.COM corbin at maxzilla.Encore.COM
Thu Oct 12 14:33:15 AEST 1989


Does anyone have an idea of how to handle nexted include file
dependencies in make?  Given that test includes test.h, test.h
include test1.h and test1.h include test2.h.  When test2.h is
touched test.c will not get rebuilt given the follow make dependencies:

test.c:	    test.h
test.h:	    test1.h
test1.h:    test2.h

Can this be done in make or is

test.c:	    test.h test1.h test2.h

the only way it will work.

The problem with the second example is that I'm working on a product
with hundreds of files and maintaining dependencies manuallly is tedious
and error prone.  I would like to do automatic dependency generation.

I have a grep/sed/awk script that will generate the first example by
scanning all the sources (.s .c .h).  I'm just learning sed/awk and it
would probably take me weeks to figure out how to generate the second case.

Does anyone have such a tool/script that would take a list of files
and generate dependencies or any ideas on how to solve the problem?


Stephen Corbin
{bu-cs,decvax,necntc,talcott}!encore!corbin             corbin at encore.COM
Stephen Corbin
{bu-cs,decvax,necntc,talcott}!encore!corbin             corbin at encore.COM



More information about the Comp.unix.questions mailing list