automake
[Top][All Lists]
Advanced

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

Re: false positive result with 'make distcheck'


From: Ralf Wildenhues
Subject: Re: false positive result with 'make distcheck'
Date: Tue, 5 Sep 2006 14:03:57 +0200
User-agent: Mutt/1.5.13 (2006-09-01)

Hello Guillaume,

* Guillaume Rousse wrote on Tue, Sep 05, 2006 at 01:33:06PM CEST:
> Using the following Makefile.am, make distcheck report everything's OK.
> 
> However, the main files, rpmbuildupdate.in rand pmbuildupdate.comp.in
> are obviously missing, as I forgot to list them in EXTRA_DIST.
> 
> Is this a bug, or am I missing something ?

Well, listing them in EXTRA_DIST is the right thing to do, but IMHO
the distcheck should have caught the error: the `all' target should
try to update $(bin_SCRIPTS), and that should have failed.  For example,
this fails:

cat >configure.ac <<EOF
AC_INIT(a,1,b)
AM_INIT_AUTOMAKE(foreign)
AC_CONFIG_FILES(Makefile)
AC_OUTPUT
EOF
cat >Makefile.am <<EOF
bin_SCRIPTS = foo
foo: foo.in
        cat $(srcdir)/foo.in >$@
EOF
autoreconf -vi
./configure
make distcheck

| [...]
| make[1]: *** No rule to make target `foo.in', needed by `foo'.  Stop.

Could you make a tarball exposing the bug you see available?

Some minor nits:

> rpmbuildupdate: $(srcdir)/rpmbuildupdate.in
>       perl -pi -e s'|address@hidden@|$(sysconfdir)|' < $< > $@
> 
> rpmbuildupdate.comp: $(srcdir)/rpmbuildupdate.comp.in
>       perl -pi -e s'|address@hidden@|$(sysconfdir)|' < $< > $@

BSD make does not support '$<' except in inference rules.  If you
care about portability to MinGW, you should use a backup suffix
for perl (e.g., "-pi~"), as files can't be replaced in-place there.
If you list rpmbuildupdate.in and rpmbuildupdate.comp.in as
prerequisites including the "$(srcdir)/", then you need to do so
everywhere you mention it, otherwise some make implementations
won't know "file" and "./file" are the same; OTOH if you omit the
"$(srcdir)/" in the prerequisite list, then you should know that
Solaris make will rewrite your rule to add the $(srcdir)/ auto-
matically in a VPATH build, while other make implementations
won't.  (Usual rule is to not support VPATH setups with Solaris
make, or to add the $(srcdir)/ in every place, also in EXTRA_DIST.)

All this and more in
http://www.gnu.org/software/autoconf/manual/html_node/Portable-Make.html

> install-data-hook:
>       mv $(DESTDIR)/$(completiondir)/rpmbuildupdate.comp \
>               $(DESTDIR)/$(completiondir)/rpmbuildupdate

You should not put a '/' after $(DESTDIR): For example, if you care
about portability to w32 systems such as MinGW, people there like to
do
  ./configure --prefix=C:/some/path

(they typically don't mind if DESTDIR support does not work in that
case).

Cheers,
Ralf




reply via email to

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