make dependency rules inadequate - (nf)

utzoo!decvax!pur-ee!uiucdcs!essick utzoo!decvax!pur-ee!uiucdcs!essick
Wed Jul 21 15:26:16 AEST 1982


#N:uiucdcs:8000001:000:1352
uiucdcs!essick    Jul 21 15:12:00 1982

	I had a segment of a makefile that looked like:

all:	a.o ....
a.o:	a.c		(not actually there, this is a default rule)
a.c:	a.h

the desired effect is for a.o to be regenerated when a.h is modified.
What happens is that nothing gets done.

	Examining the code for "make" yields a recursive procedure
that looks like:

	recurse on all dependent files
	if default rule says build, set flag
	if any of dependents show a more recent date, set flag
	if flag
	   follow the instructions to build this part

(the two if's that set the "flag" might be coded better than shown)

Anyway, in the above example, the a.c file never gets touched (rightly
so in my opinion).  My suggestion is that the determination of whether
to build the current thing should be expanaded to include
something to the effect of "if any of the dependencies were just built".

Note that "one of the dependencies was just built" does not mean that
the file was modified, the case in point being the one above.
Maybe the recursion should pass back a flag (it might but just ignores it)
that says "hey, something was done down here, so you need to do something
up there".  

I'd love to poke around with the source and see what I can do, but I 
don't have the time to fathom it all and then decide where the 
right places to modify are.

	Ray Essick	University of Illinois
	uiudcs!essick




More information about the Net.bugs mailing list