GNU bug report logs - #20699
subdir-objects with source from sibling directory breaks distcheck

Previous Next

Package: automake;

Reported by: Hans-Bernhard Bröker <HBBroeker <at> t-online.de>

Date: Sat, 30 May 2015 18:10:04 UTC

Severity: normal

Done: Karl Berry <karl <at> freefriends.org>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 20699 <at> debbugs.gnu.org (full text, mbox):

From: Peter Rosin <peda <at> lysator.liu.se>
To: Hans-Bernhard Bröker <HBBroeker <at> t-online.de>, 
 20699 <at> debbugs.gnu.org
Subject: Re: bug#20699: Acknowledgement (subdir-objects with source from
 sibling directory breaks distcheck)
Date: Tue, 23 Jun 2015 00:05:18 +0200
On 2015-06-21 23:14, Hans-Bernhard Bröker wrote:
> It's actually even a little worse:
> 
> Any dependency on sources in another directory causes a simple "make clean" in one directory to erase _all_ object files on that other one, i.e. if docs/Makefile.am has
> 
> noinst_PROGRAMS = a
> 
> a_SOURCES = sub/a.c ../src/main.c
> a_CPPFLAGS = -DFOO=BAR $(AM_CPPFLAGS)
> 
> then "make -C docs clean" does the following:
> 
> make: Entering directory '/cygdrive/c/prg/gp/am_bug/amhello-1.0/docs'
> test -z "a.exe" || rm -f a.exe
> rm -f *.o
> rm -f ../src/*.o
> rm -f sub/*.o
> make: Leaving directory '/cygdrive/c/prg/gp/am_bug/amhello-1.0/docs'
> 
> But what logic would a "clean" in one sub project erase all the work done in another?
> 
> With consequences like that, I think the (all but forced, now) option "subdir-objects" needs to be reconsidered.

I think that in Automake it is implicit that a makefile controls the
directory of the makefile itself and possibly subdirectories of that
directory. Sibling directories of this main directory are supposed to be
controlled by a makefile in that sibling directory (or by a makefile in
a parent directory). Notice how the option is named *subdir*-objects
(and not *sibling*-objects or something such) and ../foo is hardly a
subdir.

You are perhaps better off converting the project to use a single
top level makefile instead of using a recursive build.

Cheers,
Peter





This bug report was last modified 4 years and 173 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.