[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: $(srcdir) in man pages and other targets
From: |
Stefano Lattarini |
Subject: |
Re: $(srcdir) in man pages and other targets |
Date: |
Sat, 24 Nov 2012 12:12:03 +0100 |
Hi Patrice.
On 11/24/2012 10:15 AM, Patrice Dumas wrote:
> On Fri, Nov 23, 2012 at 09:39:21AM +0100, Stefano Lattarini wrote:
>>>
>>> Automake sort of checks it but not exactly. For instance, if you have
>>> the tool and it is rebuilt, the I don't think that automake can check
>>> that it is not rebuilt.
>>>
>> It does, *if* that file is not removed by "make distclean" (and
>> distributed files should never be). For a long-winded example, see:
>> http://www.gnu.org/software/automake/manual/automake.html#Errors-with-distclean
>
> You a re right, I didn't realize that correctly (though I have used make
> distcheck repeatedly...).
>
>>> Another point is that you may trick automake too, which I believe is
>>> what happens with adding $(srcdir) to the reules
>>>
>> No, you wouldn't fool it, because "make distcheck" runs a VPATH build
>> with the srcdir made *readonly*. So any attempt to modify or add a file
>> there will cause an error (unless your build rules use explicit calls to
>> "chmod u+w", but then you're asking for trouble).
>
> Right, that's one side of the check, but if you create something in the
> $(srcdir), but you also distribute it, then "make distcheck" won't lead
> to a rebuild of the file and therefore you will miss that you did
> something wrong (creating a file in $(srcdir) although you should have
> created it in builddir)..
>
I believe that, if you distribute a file, creating in $(srcdir) might
actually be the correct choice ... For more background, see:
<http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10852>
> It may not be wrong in every cases, for instance it seems to me that it
> makes sense to rebuild in $(srcdir) the Makefile fragments that are
> included by automake.
>
In that case, it is the *only* sane approach actually. Automake (and
the other autotools, like aclocal and autoconf) are re-run by the
automatic remake rules present in automake-generated Makefiles only
from the srcdir (since they can only work from there), so any included
file that is in the builddir would not be found.
Regards,
Stefano
- Re: $(srcdir) in man pages and other targets, (continued)
- Re: $(srcdir) in man pages and other targets, Patrice Dumas, 2012/11/21
- Re: $(srcdir) in man pages and other targets, Karl Berry, 2012/11/21
- Re: $(srcdir) in man pages and other targets, Patrice Dumas, 2012/11/22
- Re: $(srcdir) in man pages and other targets, Karl Berry, 2012/11/22
- Re: $(srcdir) in man pages and other targets, Patrice Dumas, 2012/11/22
- Re: $(srcdir) in man pages and other targets, Karl Berry, 2012/11/22
- Re: $(srcdir) in man pages and other targets, Patrice Dumas, 2012/11/22
- Re: $(srcdir) in man pages and other targets, Patrice Dumas, 2012/11/22
- Re: $(srcdir) in man pages and other targets, Stefano Lattarini, 2012/11/23
- Re: $(srcdir) in man pages and other targets, Patrice Dumas, 2012/11/24
- Re: $(srcdir) in man pages and other targets,
Stefano Lattarini <=
- Re: $(srcdir) in man pages and other targets, Patrice Dumas, 2012/11/24
- Re: $(srcdir) in man pages and other targets, Stefano Lattarini, 2012/11/24
Re: $(srcdir) in man pages and other targets, Patrice Dumas, 2012/11/22