avoid creating .dir files

There isn't a good reason to create files called .dir in the installation directory. This patch fixes that.

Ok?

clang-1.patch (495 Bytes)

If we don't have this line, every build with do the makedir.

-Chris

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?

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.

Not that it really matters, but do note that the LLVM build system uses ‘$(LLVM_SRC_ROOT)/autoconf/mkinstalldirs’ for MKDIR, rather than just ‘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?

Yes, ‘prog’ will be remade every time a file as added to or removed from the directory. (I haven't checked just now, but I'm fairly certain that's what will happen.) One way to solve this is by using an order-only dependancy:

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

This will cause GNU Make to ensure that /dir is made _before_ /dir/prog, but without invalidating the /dir/prog target when /dir is updated/invalidated.

Is it possible that I could get you to wait a bit with these changes? I just obtained commit access and set up a way to move over my changes from Mercurial to Subversion. I hope to have most of my changes to the build system integrated, and plan to post a proposal of how to get it done within the next few days or so.

Apart from a general overhaul of the Makefiles, I integrated Clang into much of the LLVM build system, for instance ‘llvm-config’.

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

Ok! You win, :slight_smile:

-Chris

One way to solve this is by using an order-only dependancy:

Cool. That's a good solution, with this, we can avoid the mkdir as well.

Is it possible that I could get you to wait a bit with these changes?

No time like the present. I've used that incantation, feel free to suggest/make improvements. Also, I only did this for the installation directories, as those were the critical ones.