[Top][All Lists]

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

Re: Mixing BUILT_SOURCES, double quote include and separation of source

From: Simon Perreault
Subject: Re: Mixing BUILT_SOURCES, double quote include and separation of source and binary directory
Date: Wed, 30 Mar 2005 11:13:19 -0500
User-agent: KMail/1.8

On March 30, 2005 10:44, Ralf Wildenhues wrote:
> > #include "../include/inc.h"
> which is not portable, by the way (but I can see if you don't care about
> that part of the world).

Why do you say that? That code is being ported from Microsoft's compiler, and 
I guess that if it works there and here then it ought to be portable.

> >     mkdir -p $(@D)
> which is not portable, by the way.  Use $(mkdir_p).  If you want to
> support borked `make's on weird systems, look at how AS_DIRNAME works.
> Or just spell out the directory name.

Thanks for the tip!

> If you put this rule in several directories, it might lead to race
> conditions with parallel make.  (Your example suggests you might be
> doing this.)

Do you mean that if many make jobs try to make the same directory at the same 
time it will fail? I don't think so, since creating a directory is atomic and 
mkdir -p shouldn't fail if the directory is already created. But if mkdir is 
broken and fails because the directory was created between the time it 
checked for its existence and the time it tried to create it, then mkdir is 
broken and should be fixed. Anyway, that's off topic.

> Now does this mean you have hundreds of built headers which also live in
> different directories each?

Yes. ;-(

> This strikes me as suboptimal design, but 
> then again it might just be natural for your problem.

As you might have guessed, I'm not in a position to fix this.

> - put all build headers in one (or few) directories (you already knew
>   that, I guess).


> - change the rule above to create a symlink to the current directory
>   or a central directory, for that matter
>   (be sure to look at $(LN_S) semantics in the Autoconf docs!).
>   Have `make clean' remove the links.

Sorry, I don't understand your solution. Does that mean I should modify all 
the files including the built headers so that they point to the central 
directory? If so, then I can't do that since the code I'm working on has to 
keep working on another build system. If not, then can you explain a bit 

Thanks for taking the time to ponder my case.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]