Subject: subdir-objects with source from sibling directory breaks distcheck
From: Hans-Bernhard Bröker <[email-masked]>
To: [email-masked]
Date: Sat, 30 May 2015 14:12:38 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello everyone,

I'm just about to turn on option subdir-objects in project gnuplot, but 
ran in to a snag.  Make distcheck now fails in the distclean phase 
because distclean in one subdirectory removes dependency files that 
make, in another one, still needs.

The trigger was this in docs/Makefile.am:

doc2wxhtml_SOURCES = windows/doc2html.c ../src/version.c
doc2wxhtml_CPPFLAGS = -DALL_TERM_DOC -DWXHELP -I../src $(AM_CPPFLAGS)

The reference to windows/doc2html.c was what had me turn on 
subdir-objects.  The reference to a source file from a neighboring 
../src directory triggers the breakage.  All is well in typical 
day-to-day operation, but since the distclean phase of a make distcheck 
kills src/.deps before visiting docs, make in docs now dies:

Making distclean in docs
Makefile:592: ../src/.deps/doc2wxhtml-version.Po: No such file or directory

Tool versions: automake-1.14.1 and 1.15, autoconf-2.69, on current Cygwin.

I've attached a copy of amhello modified to trigger the bug.