This is the mail archive of the automake@gnu.org mailing list for the automake project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

distclean target is not depth-first


A Debian user has reported a problem with automake-1.4 when using
subdirectories.

The info pages state, under "Top level":

   By default, Automake generates `Makefiles' which work depth-first
   (`postfix').

However, in a distclean-recursive, as well as other recursive cleans,
the top-level directory is handled first.

In the example which caused problems, in a package called timidity,
common.makefile.in is in the top-level directory.  When configure is
run, common.makefile is created in the top-level directory.  This file
is included in each Makefile.am (and the corresponding Makefile).

When "make distclean" is run, it first cleans the top-level directory,
when removes common.makefile.  Then make enters the subdirectories.
However, each Makefile in a subdirectory requires common.makefile
which has already been removed.  "make distclean" fails.

Included below is a fix for this problem, provided by Martin Mitchell
<martin@debian.org>.  This fix forces distclean to be depth-first, as
the documentation describes.


--- subdirs.am.orig	Sat Jun 12 11:38:33 1999
+++ subdirs.am	Sat Jun 12 11:38:51 1999
@@ -62,7 +62,7 @@
 	  test "$$subdir" = "." && dot_seen=yes; \
 	done; \
 ## If we haven't seen `.', then add it at the beginning.
-	test "$$dot_seen" = "no" && rev=". $$rev"; \
+	test "$$dot_seen" = "no" && rev="$$rev ."; \
 	target=`echo $@ | sed s/-recursive//`; \
 	for subdir in $$rev; do \
 	  echo "Making $$target in $$subdir"; \


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]