[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
distclean should walk subdirs in reverse order
From: |
Sam Varshavchik |
Subject: |
distclean should walk subdirs in reverse order |
Date: |
Sat, 09 Mar 2013 10:09:59 -0500 |
Consider automake being used together with GNU make and autoconf.
Top level directory 'main'. Two subdirectories, 'a' and 'b'.
main/configure.ac
AC_CONFIGFILES([
...
a/somefile.inc
...
])
main/Makefile.am:
SUBDIRS=a b
main/a/Makefile.am:
data_DATA=somefile.inc
DISTCLEAN=somefile.inc
main/b/Makefile.am
include $(shell pwd)/../a/somefile.inc
main's configure creates a/somefile.inc frome somefile.inc.in, and
main/b/Makefile will include it, since automake will refuse to parse such an
include file, and leave it up to make to deal with. somefile.inc also gets
installed (yes, I'm installing a makefile fragment, this is a development
tool); and it also needs to be DISTCLEANed, for make distcheck to pass.
However, what's going to happen here is that distclean-recursive ends up
recursing into main/a first, and remove somefile.inc, and failing when it
subsequently recurses into main/b, since the included file isn't there any
more.
I think that distclean-recursive should handle SUBDIRS or DIST_SUBDIRS in
reverse order from what they're listed. Or, default to SUBDIRS in reverse
order, or the explicit order given in DIST_SUBDIRS. In the meantime, off I
go writing another convoluted gmake macro to set DIST_SUBDIRS by reversing
SUBDIRS…
pgptkk0NfvFs0.pgp
Description: PGP signature
- distclean should walk subdirs in reverse order,
Sam Varshavchik <=