From 6ed11d3cf3341fc8171ecca81703ce4f730dc368 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Mon, 9 Apr 2001 09:55:12 +0000 Subject: [PATCH] * automake.in (&make_paragraphs): Transform TOPDIR_P and TOPDIR. (&handle_dist): Don't. (&handle_clean): Don't handle config.status here, let... * clean.am: ... do it. * distdir.am: Adjust. --- ChangeLog | 8 ++++++++ Makefile.in | 2 -- automake.in | 15 +++------------ clean.am | 12 ++++++++++++ distdir.am | 22 ++++++++++++---------- lib/am/clean.am | 12 ++++++++++++ lib/am/distdir.am | 22 ++++++++++++---------- 7 files changed, 59 insertions(+), 34 deletions(-) diff --git a/ChangeLog b/ChangeLog index 078c985a1..05306fc07 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2001-04-09 Akim Demaille + + * automake.in (&make_paragraphs): Transform TOPDIR_P and TOPDIR. + (&handle_dist): Don't. + (&handle_clean): Don't handle config.status here, let... + * clean.am: ... do it. + * distdir.am: Adjust. + 2001-04-09 Akim Demaille * automake.in: Use strict vars and subs. diff --git a/Makefile.in b/Makefile.in index b29004ae9..de98e1572 100644 --- a/Makefile.in +++ b/Makefile.in @@ -519,7 +519,6 @@ dist-all: dist distclean: distclean-recursive -rm -f config.status - distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive @@ -566,7 +565,6 @@ installcheck-am: installcheck-local maintainer-clean: maintainer-clean-recursive -rm -f config.status - maintainer-clean-am: distclean-am maintainer-clean-aminfo \ maintainer-clean-generic maintainer-clean-vti diff --git a/automake.in b/automake.in index 3e53c0aaf..9d5c3213b 100755 --- a/automake.in +++ b/automake.in @@ -3054,8 +3054,7 @@ sub handle_dist } # Rule to check whether a distribution is viable. - my %transform = ('TOPDIR' => ($relative_dir eq '.'), - 'DISTCHECK-HOOK' => &target_defined ('distcheck-hook'), + my %transform = ('DISTCHECK-HOOK' => &target_defined ('distcheck-hook'), 'GETTEXT' => $seen_gettext); # Prepend $(distdir) to each directory given. @@ -3937,16 +3936,6 @@ sub handle_clean 'MFILES' # A space is required in the join here. => join (' ', @maintainer_clean_files))); - - # We special-case config.status here. If we do it as part of the - # normal clean processing for this directory, then it might be - # removed before some subdir is cleaned. However, that subdir's - # Makefile depends on config.status. - if ($relative_dir eq '.') - { - $actions{'distclean'} .= "\t-rm -f config.status\n"; - $actions{'maintainer-clean'} .= "\t-rm -f config.status\n"; - } } @@ -6711,6 +6700,8 @@ sub make_paragraphs ($%) 'CK-NEWS' => $options{'check-news'} || 0, 'SUBDIRS' => &variable_defined ('SUBDIRS'), + 'TOPDIR' => backname ($relative_dir), + 'TOPDIR_P' => $relative_dir eq '.', 'CONFIGURE-AC' => $configure_ac, 'LIBTOOL' => defined $configure_vars{'LIBTOOL'}) diff --git a/clean.am b/clean.am index 701d61e10..7e4b4161e 100644 --- a/clean.am +++ b/clean.am @@ -49,3 +49,15 @@ clean-generic mostlyclean-generic distclean-generic maintainer-clean-generic ?!SUBDIRS?distclean: distclean-am ?!SUBDIRS?mostlyclean: mostlyclean-am ?!SUBDIRS?maintainer-clean: maintainer-clean-am + +## We special-case config.status here. If we do it as part of the +## normal clean processing for this directory, then it might be +## removed before some subdir is cleaned. However, that subdir's +## Makefile depends on config.status. + +if %?TOPDIR_P% +distclean: + -rm -f config.status +maintainer-clean: + -rm -f config.status +endif %?TOPDIR_P% diff --git a/distdir.am b/distdir.am index 5c3b137f0..a8db873c7 100644 --- a/distdir.am +++ b/distdir.am @@ -29,7 +29,7 @@ distdir: $(DISTFILES) ## For Gnits users, this is pretty handy. Look at 15 lines ## in case some explanatory text is desirable. ## -if %?TOPDIR% +if %?TOPDIR_P% if %?CK-NEWS% @if sed 15q $(srcdir)/NEWS | fgrep -e "$(VERSION)" >/dev/null; then :; else \ @@ -37,12 +37,14 @@ if %?CK-NEWS% exit 1; \ fi endif %?CK-NEWS% -endif %?TOPDIR% +endif %?TOPDIR_P% ## ## Only for the top dir. ## -?TOPDIR? -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir) -?TOPDIR? mkdir $(distdir) +if %?TOPDIR_P% + -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir) + mkdir $(distdir) +endif %?TOPDIR_P% ## ## ?DISTDIRS? $(mkinstalldirs) %DISTDIRS% @@ -124,13 +126,13 @@ endif %?DIST-TARGETS% ## We use $(install_sh) because that is a known-portable way to modify ## the file in place in the source tree. ## -if %?TOPDIR% +if %?TOPDIR_P% -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) -endif %?TOPDIR% +endif %?TOPDIR_P% @@ -143,7 +145,7 @@ endif %?TOPDIR% ## the only reason) is that some versions of tar (e.g., OSF1) ## interpret `-z' differently. -if %?TOPDIR% +if %?TOPDIR_P% GZIP_ENV = --best .PHONY: dist-all dist @@ -184,7 +186,7 @@ dist-zip: distdir -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir) endif %?ZIP% -endif %?TOPDIR% +endif %?TOPDIR_P% ## ------------------------- ## @@ -192,7 +194,7 @@ endif %?TOPDIR% ## ------------------------- ## -if %?TOPDIR% +if %?TOPDIR_P% # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. @@ -233,4 +235,4 @@ distcheck: dist -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir) @echo "$(distdir).tar.gz is ready for distribution" | \ sed 'h;s/./=/g;p;x;p;x' -endif %?TOPDIR% +endif %?TOPDIR_P% diff --git a/lib/am/clean.am b/lib/am/clean.am index 701d61e10..7e4b4161e 100644 --- a/lib/am/clean.am +++ b/lib/am/clean.am @@ -49,3 +49,15 @@ clean-generic mostlyclean-generic distclean-generic maintainer-clean-generic ?!SUBDIRS?distclean: distclean-am ?!SUBDIRS?mostlyclean: mostlyclean-am ?!SUBDIRS?maintainer-clean: maintainer-clean-am + +## We special-case config.status here. If we do it as part of the +## normal clean processing for this directory, then it might be +## removed before some subdir is cleaned. However, that subdir's +## Makefile depends on config.status. + +if %?TOPDIR_P% +distclean: + -rm -f config.status +maintainer-clean: + -rm -f config.status +endif %?TOPDIR_P% diff --git a/lib/am/distdir.am b/lib/am/distdir.am index 5c3b137f0..a8db873c7 100644 --- a/lib/am/distdir.am +++ b/lib/am/distdir.am @@ -29,7 +29,7 @@ distdir: $(DISTFILES) ## For Gnits users, this is pretty handy. Look at 15 lines ## in case some explanatory text is desirable. ## -if %?TOPDIR% +if %?TOPDIR_P% if %?CK-NEWS% @if sed 15q $(srcdir)/NEWS | fgrep -e "$(VERSION)" >/dev/null; then :; else \ @@ -37,12 +37,14 @@ if %?CK-NEWS% exit 1; \ fi endif %?CK-NEWS% -endif %?TOPDIR% +endif %?TOPDIR_P% ## ## Only for the top dir. ## -?TOPDIR? -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir) -?TOPDIR? mkdir $(distdir) +if %?TOPDIR_P% + -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir) + mkdir $(distdir) +endif %?TOPDIR_P% ## ## ?DISTDIRS? $(mkinstalldirs) %DISTDIRS% @@ -124,13 +126,13 @@ endif %?DIST-TARGETS% ## We use $(install_sh) because that is a known-portable way to modify ## the file in place in the source tree. ## -if %?TOPDIR% +if %?TOPDIR_P% -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) -endif %?TOPDIR% +endif %?TOPDIR_P% @@ -143,7 +145,7 @@ endif %?TOPDIR% ## the only reason) is that some versions of tar (e.g., OSF1) ## interpret `-z' differently. -if %?TOPDIR% +if %?TOPDIR_P% GZIP_ENV = --best .PHONY: dist-all dist @@ -184,7 +186,7 @@ dist-zip: distdir -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir) endif %?ZIP% -endif %?TOPDIR% +endif %?TOPDIR_P% ## ------------------------- ## @@ -192,7 +194,7 @@ endif %?TOPDIR% ## ------------------------- ## -if %?TOPDIR% +if %?TOPDIR_P% # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. @@ -233,4 +235,4 @@ distcheck: dist -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir) @echo "$(distdir).tar.gz is ready for distribution" | \ sed 'h;s/./=/g;p;x;p;x' -endif %?TOPDIR% +endif %?TOPDIR_P% -- 2.47.2