tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: make: existence-only prerequisites



> Date: Tue, 14 Feb 2017 14:10:53 +0100
> From: Edgar Fuß <ef%math.uni-bonn.de@localhost>
> 
> TRC> Traditionally make(1) doesn't handle dependencies on directories very
> TRC> well for various reasons
> The reasons being?

Sorry, I don't remember them all, other than the one you already
cited, that adding things to the directory changes its mtime!

> TRC> and the traditional approach is to use a dummy file in the directory:
> TRC> 
> TRC> foo/.stamp:
> TRC> 	touch foo/.stamp
> Which a) creates a file you may have to ignore afterwards and b) updates the 
> directory's time stamp causing gratuitous command execution later.

Right, so you write dependencies on foo/.stamp instead of foo.

bar: foo/.stamp
	...do something involving the foo/ directory...


Home | Main Index | Thread Index | Old Index