Description of problem: When using automake to generate a non-recursive Makefile for a package that has multiple subdirectories, 'make clean' does not delete all generate files. This causes 'make distcheck' to fail. I am attaching a complete example package that shows this failure; the simple Makefile.am in the top level is: INCLUDES = -I$(srcdir)/include AM_CFLAGS = -g -Wall -D_GNU_SOURCE lib_LTLIBRARIES = src/libbug.la src_libbug_la_SOURCES = src/bug.c src_libbug_la_LDFLAGS = -version-info 1 -export-dynamic bin_PROGRAMS = example/ex example_ex_SOURCES = example/ex.c example_ex_LDADD = $(top_builddir)/src/libbug.la include_HEADERS = include/bug.h EXTRA_DIST = include/bug.h if I unpack this package and do ./autogen.sh && ./configure && make distcheck then the build ends with: rm -f example/ex example/ex test -z "src/libbug.la" || rm -f src/libbug.la rm -f "src/so_locations" rm -rf .libs _libs rm -rf src/.libs src/_libs rm -f *.o rm -f *.lo rm -f *.tab.c test -z "" || rm -f rm -f example/.dirstamp rm -f src/.dirstamp rm -f config.h stamp-h1 rm -f libtool rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags rm -f config.status config.cache config.log configure.lineno config.status.lineno rm -rf ./.deps rm -f Makefile ERROR: files left in build directory after distclean: ./example/.libs/ex make[1]: *** [distcleancheck] Error 1 make[1]: Leaving directory `/users/rdreier/automake-bug/automake-bug-1.0/_build' make: *** [distcheck] Error 2 and indeed the same thing can be verified with 'make && make clean' -- the example/.libs directory is not deleted. Version-Release number of selected component (if applicable): $ automake --version automake (GNU automake) 1.10 How reproducible: fails every time!
Created attachment 277311 [details] example project that shows bug
This is similar to bug #249839 which I've reported upstream. This is the answer I got: > It's an Automake bug. For now > it's easiest to work around it with adding something like > # Work around an Automake bug: > clean-local: > rm -rf bar/.libs bar/_libs > > in Makefile.am. Automake should be fixed though. > > Hope that helps. > > Cheers, > Ralf So upstream is aware of this and hopefully will fix this in the next version.