(&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 <akim@epita.fr>
+
+ * 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 <akim@epita.fr>
* automake.in: Use strict vars and subs.
distclean: distclean-recursive
-rm -f config.status
-
distclean-am: clean-am distclean-generic distclean-tags
dvi: dvi-recursive
maintainer-clean: maintainer-clean-recursive
-rm -f config.status
-
maintainer-clean-am: distclean-am maintainer-clean-aminfo \
maintainer-clean-generic maintainer-clean-vti
}
# 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.
'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";
- }
}
'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'})
?!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%
## 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 \
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%
## 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%
## 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
-chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir)
endif %?ZIP%
-endif %?TOPDIR%
+endif %?TOPDIR_P%
## ------------------------- ##
## ------------------------- ##
-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.
-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%
?!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%
## 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 \
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%
## 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%
## 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
-chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir)
endif %?ZIP%
-endif %?TOPDIR%
+endif %?TOPDIR_P%
## ------------------------- ##
## ------------------------- ##
-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.
-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%