automake
[Top][All Lists]
Advanced

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

Re: files left in build directory after distclean


From: Adam Mercer
Subject: Re: files left in build directory after distclean
Date: Tue, 22 May 2012 13:05:12 -0500

On Tue, May 22, 2012 at 12:06 PM, Nick Bowler <address@hidden> wrote:

> Probably all you need to do is add these generated files to CLEANFILES,
> e.g.,
>
>  CLEANFILES = git_version.py git_version.sed
>
> so that "make clean" deletes them.

I'd thought of that, but what puzzles me (and the reason I didn't use
it) is that it is only complaining about git_version.py and
git_version.sed and not LALAppsVCSInfo.h which is generated in the
same way? Why is LALAppsVCSInfo.h OK, but the others aren't?

> One unrelated comment.  Makefile rules like what you have above, one of
> which is reproduced here:
>
>> git_version.py: git_version.py.in git_version.sed
>>       $(AM_V_GEN)sed -f git_version.sed $(srcdir)/git_version.py.in > 
>> git_version.py
>
> can be problematic because it creates the target file before running the
> command to update it.  If the command fails for any reason, you will be
> left with the target in your tree, and a subsequent "make" will not
> attempt to recreate it (and will nevertheless proceed to use the bogus
> file).  This is especially bad if "make clean" doesn't delete the file,
> which distcheck is helpfully warning you about.  Therefore, such rules
> are generally better written using a pattern similar to the following
> (untested):
>
>  git_version.py: git_version.py.in git_version.sed
>        $(AM_V_GEN)sed -f git_version.sed $(srcdir)/git_version.py.in > 
> address@hidden
>        $(AM_V_at)mv -f address@hidden $@
>
> which avoids updating the target file unless the first command succeeded.
>
> Hope that helps

Thanks, that's helpful.

Cheers

Adam



reply via email to

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