[LLVMdev] avoid creating .dir files

Mike Stump mrs at apple.com
Mon Jan 19 15:04:09 PST 2009


On Jan 19, 2009, at 1:58 PM, Chris Lattner wrote:
> On Jan 19, 2009, at 10:02 AM, Mike Stump wrote:
>
>> There isn't a good reason to create files called .dir in the
>> installation directory.  This patch fixes that.
>
> If we don't have this line, every build with do the makedir.

And?

$ time mkdir -p /bin

real	0m0.002s
user	0m0.000s
sys	0m0.002s

an extra mkdir takes around 2ms per build.  An up-to-date inc build  
takes 2231ms for me.  If you want some of the extra 2231ms back, I'd  
recommend avoiding recursion in the makefiles.  This will yield a  
larger benefit than worrying about the extra mkdir.

If we have it, then .dir files are created in the installation  
directories.

Trivially one can do:

/dir:
	mkdir /dir

/dir/prog: /dir
	gcc hi.c -o /dir/prog

and avoid the extra mkdir, if one wanted.  Any down side to doing that?



More information about the llvm-dev mailing list