From eec6cbb66e755c09d3280aa6a8ca931057c8c5c0 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 28 Oct 1998 00:47:31 +0000 Subject: [PATCH] * Makefile.am (maintainer-check): Changed code to be acceptable to bash 2.01.1. * automake.in (do_one_clean_target): Special-case config.status. Report from Jeff Garzik. --- ChangeLog | 6 ++++++ Makefile.am | 3 ++- Makefile.in | 2 +- TODO | 8 ++++++++ automake.in | 28 +++++++++++++++++++--------- lib/am/Makefile.am | 3 ++- 6 files changed, 38 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3d75a2ae..b4635944 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 1998-10-28 Tom Tromey + * Makefile.am (maintainer-check): Changed code to be acceptable to + bash 2.01.1. + + * automake.in (do_one_clean_target): Special-case config.status. + Report from Jeff Garzik. + * m4/Makefile.am (m4data_DATA): Don't mention f77.m4. * m4/f77.m4: Removed; macro now in autoconf proper. diff --git a/Makefile.am b/Makefile.am index 954ee739..e0414c69 100644 --- a/Makefile.am +++ b/Makefile.am @@ -66,7 +66,8 @@ maintainer-check: automake aclocal $(PERL) -c -w aclocal ## expect no instances of '${...}'. However, $${...} is ok, since that ## is a shell construct, not a Makefile construct. - @if test `fgrep '$${' $(srcdir)/[a-z]*.am | fgrep -v '$$$$' | wc -l` -ne 0; then \ +## The backslash in `$${' is needed for some versions of bash. + @if test `fgrep '\$${' $(srcdir)/[a-z]*.am | fgrep -v '$$$$' | wc -l` -ne 0; then \ echo "found too many uses of '\$${'" 1>&2; \ exit 1; \ else :; fi diff --git a/Makefile.in b/Makefile.in index 6719a631..5b22f371 100644 --- a/Makefile.in +++ b/Makefile.in @@ -593,7 +593,7 @@ maintainer-check: automake aclocal fi $(PERL) -c -w automake $(PERL) -c -w aclocal - @if test `fgrep '$${' $(srcdir)/[a-z]*.am | fgrep -v '$$$$' | wc -l` -ne 0; then \ + @if test `fgrep '\$${' $(srcdir)/[a-z]*.am | fgrep -v '$$$$' | wc -l` -ne 0; then \ echo "found too many uses of '\$${'" 1>&2; \ exit 1; \ else :; fi diff --git a/TODO b/TODO index 53aeb35b..0dae1702 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,11 @@ +* distclean must remove config.status + can't this cause problems for maintainer-clean? + shouldn't maintainer-clean print the message before running + any part of the make? (just to slow things down long enough + for the user to stop it) + (maybe doesn't matter since people who even know about + maintainer-clean already have a clue) + * There are probably more bugs in variable_conditions_sub along the lines of the one that caused cond4.test to fail. diff --git a/automake.in b/automake.in index f8d6e0e7..de651fa3 100755 --- a/automake.in +++ b/automake.in @@ -339,14 +339,14 @@ die "automake: no \`Makefile.am' found or specified\n" if ($generate_deps) { die "automake: Must specify --include-deps (or -i) when generating\n" - if ($use_dependencies); + if $use_dependencies; die "automake: Must provide --build-dir when generating\n" - if (!$build_directory); + if ! $build_directory; die "automake: Must provide --srcdir-name when generating\n" - if (!$srcdir_name); + if ! $srcdir_name; open (GDEP, ">$output_directory/.dep_segment") - || die "automake: Could not open `$output_directory/.dep_segment': $!\n"; + || die "automake: Could not open `$output_directory/.dep_segment': $!\n"; &handle_dependencies; print GDEP $output_rules; @@ -3598,19 +3598,29 @@ sub do_one_clean_target ("\t\@echo \"This command is intended for maintainers to use;\"\n" . "\t\@echo \"it deletes files that may require special " . "tools to rebuild.\"\n"); - - $output_rules .= "\t-rm -f config.status\n" - if $relative_dir eq '.'; } elsif ($name . $target eq 'distclean') { - $output_rules .= "\t-rm -f config.status\n"; $output_rules .= "\t-rm -f libtool\n" if $seen_libtool; } $output_rules .= "\n"; + + # Now generate the actual clean target. $output_rules .= ($name . $target . ": " . $name . $target . ($recursive_install ? '-recursive' : '-am') - . "\n\n"); + . "\n"); + + # 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 (($name . $target eq 'maintainer-clean' + || $name . $target eq 'distclean') + && $relative_dir eq '.') + { + $output_rules .= "\t-rm -f config.status\n"; + } + $output_rules .= "\n"; } # Handle .PHONY target. diff --git a/lib/am/Makefile.am b/lib/am/Makefile.am index 954ee739..e0414c69 100644 --- a/lib/am/Makefile.am +++ b/lib/am/Makefile.am @@ -66,7 +66,8 @@ maintainer-check: automake aclocal $(PERL) -c -w aclocal ## expect no instances of '${...}'. However, $${...} is ok, since that ## is a shell construct, not a Makefile construct. - @if test `fgrep '$${' $(srcdir)/[a-z]*.am | fgrep -v '$$$$' | wc -l` -ne 0; then \ +## The backslash in `$${' is needed for some versions of bash. + @if test `fgrep '\$${' $(srcdir)/[a-z]*.am | fgrep -v '$$$$' | wc -l` -ne 0; then \ echo "found too many uses of '\$${'" 1>&2; \ exit 1; \ else :; fi -- 2.43.5