Re: some minor errors in stow's Makefile.am

Adam Spiers <[email protected]> Tue, 6 Dec 2011 20:43:46 +0000
Newsgroups gmane.comp.gnu.stow.bugs
Message-ID <CAOkDyE_g2PASL872Bb1U7qB4ObPNa8jTabcOgDHgZerywAB8gA@mail.gmail.com>
On Tue, Dec 6, 2011 at 7:34 PM, Stefano Lattarini
<[email protected]> wrote:
> Hi Adam, hope you don't mind another minor nitpick ...

Not at all, your expertise is very welcome!

> On Tuesday 06 December 2011, Adam Spiers wrote:
>> On Tue, Dec 6, 2011 at 12:30 PM, Stefano Lattarini
>> <[email protected]> wrote:
>> > Hi!
>> >
>> > While looking in stow's Makefile.am, I've noticed few minor errors
>> > and blunders, and I think you might want to know about them.
>>
>> Many thanks for this review Stefano, it's hugely helpful! =A0I will fix
>> these and make a new release.
>>
> I still see this in stow's Makefile.am:
>
> =A0CLEANFILES =3D $(bin_SCRIPTS) $(pm_DATA) $(dist_man_MANS) $(HTML) $(PD=
F) ChangeLog
>
> which means that the distributed files $(dist_man_MANS), $(HTML), $(PDF)
> and ChangeLog will still be removed by "make clean". =A0IMHO the following
> would be better:
>
> =A0CLEANFILES =3D $(bin_SCRIPTS) $(pm_DATA)
> =A0MAINTAINERCLEANFILES =3D $(dist_man_MANS) $(HTML) $(PDF) ChangeLog

Yes, I actually made that change a few hours ago after a user
discovered that `make distclean' broke `make install' for them.

> Also, the dependencies:
>
> =A0dist-hook: $(dist_man_MANS) ChangeLog
> =A0ChangeLog: doc/ChangeLog.OLD
>
> will not ensuere that the ChangeLog will be remade at "make dist"
> time, even if it is out-of-date w.r.t. the current git repository.

Yep, but at least it ensures it's there :-) I did add a note to
doc/HOWTO-RELEASE reminding me to `rm ChangeLog' before `make
distcheck' but on second thoughts, automating it would be better ...

> The following should offer a workaround, by forcing ChangeLog to
> be rebuilt unconditionally upon creation of distribution tarballs
> (untested!):
>
> =A0dist-hook: $(dist_man_MANS)
> ## If we are creating a distribution from a git checkout, ensure
> ## the ChangeLog file is in sync the git repository.
> =A0 =A0 =A0 =A0if test -d $(top_srcdir)/.git; then \
> =A0 =A0 =A0 =A0 =A0rm -f ChangeLog \
> =A0 =A0 =A0 =A0 =A0 =A0&& $(MAKE) $(AM_MAKEFLAGS) ChangeLog \
> =A0 =A0 =A0 =A0 =A0 =A0&& cp -f ChangeLog $(distdir)/ChangeLog; \
> =A0 =A0 =A0 =A0else :; fi;

I did consider the recursive make, but it felt kinda ugly.  Having
said that it's probably better than nothing.

Thanks a lot!
Adam

P.S. any idea on this?
http://thread.gmane.org/gmane.comp.sysutils.automake.general/13183/focus=3D=
13192