[Top][All Lists]

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

distclean vs. clean order dependency

From: Eric Blake
Subject: distclean vs. clean order dependency
Date: Sat, 05 Apr 2008 06:56:43 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20080213 Thunderbird/ Mnenhy/

Hash: SHA1

I was trying to silence warnings during 'automake -Wall' for autoconf.
However, I can't figure out what to do for this last warning, that
autoconf is overriding automake's definition of distclean-generic.  It
turns out that autoconf has this comment in tests/

# Avoid a race condition that would make parallel "distclean" fail.
# The rule in clean-local tests for existence of $(TESTSUITE), and
# if found, attempts to run it.  But the distclean-generic rule may
# be running in parallel, and it removes $(DISTCLEANFILES) which
# includes $(TESTSUITE).

The comment is valid.  The only way to solve this is to make sure that
distclean-generic cannot be started until the actions for clean-local have
completed.  But if we attempt:

| distclean-local: clean-local

automake generates this:

| distclean: distclean-am
|       -rm -f Makefile
| distclean-am: clean-am distclean-generic distclean-local
| distclean-generic:
|       ...

which still doesn't have the necessary dependency.  Therefore, autoconf
resorted to copying automake's rules for distclean-generic, and putting
this in

| distclean-generic: clean-local
|       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|       -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)

which solves the ordering constraint, but causes the automake warning.

It seems like this is a bug in automake - shouldn't it output something like:

| distclean: clean-am distclean-am

or, conditional on clean-local being defined,

| distclean: clean-local distclean-am

so that distclean rules don't start until clean rules have completed?  Or
is there some other way, using automake 1.10.1, to add the needed
serialization between clean-local and distclean-generic without triggering
the automake warning about overriding an Automake target?

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at
Comment: Using GnuPG with Mozilla -


reply via email to

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