From 9cd73c76cae8e9d8241907765eb630133f2f6c52 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 23 Sep 1996 06:30:17 +0000 Subject: [PATCH] added dist-all. bug fix with internal _DEPENDENCIES vars --- ChangeLog | 11 +++++++ Makefile.in | 4 +++ NEWS | 1 + TODO | 16 +++++----- automake.in | 74 +++++++++++++++++++++++++++-------------------- m4/Makefile.in | 2 +- tests/ChangeLog | 4 +++ tests/Makefile.am | 2 +- tests/Makefile.in | 2 +- tests/spell3.test | 14 +++++++++ 10 files changed, 89 insertions(+), 41 deletions(-) create mode 100755 tests/spell3.test diff --git a/ChangeLog b/ChangeLog index 622075a5..41a90f54 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +Mon Sep 23 00:04:48 1996 Tom Tromey + + * automake.in (initialize_global_constants): Define %dist, + dist_header, dist_trailer. + (handle_dist): Make dist-all target. + (generate_makefile): Run check_typos later. + (examine_variable): New sub. + (handle_tags): Examine TAGS_DEPENDENCIES. Test spell3.test. + Error if TAGS_DEPENDENCIES but no sources used. + (handle_configure): Examine CONFIGURE_DEPENDENCIES. + Sat Sep 21 13:59:15 1996 Tom Tromey * automake.in (am_install_var): More error checking. diff --git a/Makefile.in b/Makefile.in index b67ccd19..a4a14743 100644 --- a/Makefile.in +++ b/Makefile.in @@ -307,6 +307,10 @@ dist: distdir -chmod -R a+r $(distdir) $(TAR) chozf $(distdir).tar.gz $(distdir) rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + $(TAR) chozf $(distdir).tar.gz $(distdir) + rm -rf $(distdir) distdir: $(DEP_DISTFILES) @if sed 15q $(srcdir)/NEWS | fgrep -e "$(VERSION)" > /dev/null; then :; else \ echo "NEWS not updated; not releasing" 1>&2; \ diff --git a/NEWS b/NEWS index 799567e6..13995f55 100644 --- a/NEWS +++ b/NEWS @@ -15,6 +15,7 @@ New in 1.1e: handling generally rewritten * DATA and BUILT_SOURCES no longer included in distribution * can now put config.h into a subdir +* Added dist-all target New in 1.0: * Bug fixes diff --git a/TODO b/TODO index dc38bad7..9f716ec6 100644 --- a/TODO +++ b/TODO @@ -1,5 +1,12 @@ Priorities for release: - [ none ] +- Jim's macro updates +- yacc -vs- .h +- documentation + +Further: +- texinfo/info changes +- Per's suggestion +- man page fixes must move CONFIG_HEADER from tags.am... allow it to work in subdir. @@ -122,8 +129,6 @@ Consider: "cvs" option adds some cvs-specific rules? * always generate `info' and `install-info' targets * Allow `texinfo.tex' to be missing -Automake: should EXTRA_DIST files be statically findable? - Automake: devo/inet/Makefile.am has "all-local". "install" depends on "all", but the local installs get run before the stuff in "all". Gross. @@ -221,8 +226,7 @@ Multi-language support: * must get compile rules for various languages; FORTRAN probably most important unimplemented language -'maintainer-clean' should "rm -rf .deps". Ditto distclean -Should look for clean-local targets in Makefile.am. +Should 'distclean' "rm -rf .deps"? It might be cool to generate .texi dependencies by grepping for @include. (If done, it should be done the same way C dependencies are @@ -291,8 +295,6 @@ These can both be handled via dist-hook: . Consider allowing eg "foo/bar" to appear in EXTRA_DIST, and generating code to make directory foo at dist time -consider having no-gzip option that turns off gzip/GNU tar. - djm says: David> To avoid comments like the one about subdirs getting buried in David> the middle of a Makefile.in, how about pushing comments that diff --git a/automake.in b/automake.in index 35535431..c434eaa9 100755 --- a/automake.in +++ b/automake.in @@ -435,7 +435,6 @@ sub generate_makefile &handle_gettext; &handle_libraries; &handle_programs; - &check_typos; &handle_scripts; # This must be run after all the sources are scanned. @@ -462,6 +461,8 @@ sub generate_makefile &handle_clean; &handle_phony; + &check_typos; + if (! -d ($output_directory . '/' . $relative_dir)) { mkdir ($output_directory . '/' . $relative_dir, 0755); @@ -1458,12 +1459,18 @@ sub handle_tags $output_rules .= &file_contents ('tags-subd'); $tagging = 1; } + elsif (&variable_defined ('TAGS_DEPENDENCIES')) + { + &am_line_error ('TAGS_DEPENDENCIES', + "doesn't make sense to define \`TAGS_DEPENDENCIES' without sources or \`ETAGS_ARGS'"); + } if ($tagging) { $output_rules .= &file_contents ('tags-clean'); push (@clean, 'tags'); &push_phony_cleaners ('tags'); + &examine_variable ('TAGS_DEPENDENCIES'); } else { @@ -1673,38 +1680,22 @@ distcheck: dist echo "========================" '); - $output_rules .= 'dist: distdir' . "\n\t"; - # Ignore return result from chmod, because it might give an - # error if we chmod a symlink. - $output_rules .= '-chmod -R a+r $(distdir)' . "\n\t"; - $output_rules .= '$(TAR) chozf $(distdir).tar.gz $(distdir)'; - $output_rules .= "\n\t" . 'rm -rf $(distdir)' . "\n"; - - if (defined $options{'dist-shar'}) + local ($dist_all) = ('dist-all: distdir' . "\n" + . $dist_header + . $dist_tar); + local ($curs); + foreach $curs ('dist', 'dist-shar', 'dist-zip', 'dist-tarZ') { - $output_rules .= 'dist-shar: distdir' . "\n\t"; - # Ignore return result from chmod, because it might give - # an error if we chmod a symlink. - $output_rules .= '-chmod -R a+r $(distdir)' . "\n\t"; - $output_rules .= 'shar $(distdir) | gzip > $(distdir).shar.gz'; - $output_rules .= "\n\t" . 'rm -rf $(distdir)' . "\n"; - } - - if (defined $options{'dist-zip'}) - { - $output_rules .= 'dist-zip: distdir' . "\n\t"; - $output_rules .= '-chmod -R a+r $(distdir)' . "\n\t"; - $output_rules .= 'zip -rq $(distdir).zip $(distdir)'; - $output_rules .= "\n\t" . 'rm -rf $(distdir)' . "\n"; - } - - if (defined $options{'dist-tarZ'}) - { - $output_rules .= 'dist-tarZ: distdir' . "\n\t"; - $output_rules .= '-chmod -R a+r $(distdir)' . "\n\t"; - $output_rules .= '$(TAR) chf - $(distdir) | compress -c > $(distdir).tar.Z'; - $output_rules .= "\n\t" . 'rm -rf $(distdir)' . "\n"; + if (defined $options{$curs} || $curs eq 'dist') + { + $output_rules .= ($curs . ': distdir' . "\n" + . $dist_header + . $dist{$curs} + . $dist_trailer); + $dist_all .= $dist{$curs}; + } } + $output_rules .= $dist_all . $dist_trailer; } # Generate distdir target. @@ -1984,6 +1975,7 @@ sub handle_configure . $strictness_name . '/g', 'remake'); + &examine_variable ('CONFIGURE_DEPENDENCIES'); $top_reldir = ''; } @@ -2995,6 +2987,13 @@ sub variable_defined return 0; } +# Mark a variable as examined. +sub examine_variable +{ + local ($var) = @_; + &variable_defined ($var); +} + # Return contents of variable as list, split as whitespace. This will # recursively follow $(...) and ${...} inclusions. It preserves @...@ # substitutions. If PARENT is specified, it is the name of the @@ -3334,6 +3333,19 @@ sub initialize_global_constants # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. "; + + # Ignore return result from chmod, because it might give an error + # if we chmod a symlink. + $dist_header = "\t" . '-chmod -R a+r $(distdir)' . "\n"; + $dist{'tarZ'} = ("\t" + . '$(TAR) chf - $(distdir) | compress -c > $(distdir).tar.Z' + . "\n"); + $dist{'shar'} = ("\t" + . 'shar $(distdir) | gzip > $(distdir).shar.gz' + . "\n"); + $dist{'zip'} = "\t" . 'zip -rq $(distdir).zip $(distdir)' . "\n"; + $dist{'dist'} = "\t" . '$(TAR) chozf $(distdir).tar.gz $(distdir)' . "\n"; + $dist_trailer = "\t" . 'rm -rf $(distdir)' . "\n"; } # (Re)-Initialize per-Makefile.am variables. diff --git a/m4/Makefile.in b/m4/Makefile.in index e01abda5..7383738c 100644 --- a/m4/Makefile.in +++ b/m4/Makefile.in @@ -132,11 +132,11 @@ mostlyclean-generic: clean-generic: test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) - test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) distclean-generic: rm -f Makefile $(DISTCLEANFILES) rm -f config.cache config.log $(CONFIG_HEADER) stamp-h + test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) diff --git a/tests/ChangeLog b/tests/ChangeLog index ca3b493a..d76d2dab 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,7 @@ +Mon Sep 23 00:23:34 1996 Tom Tromey + + * spell3.test: New file. + Sun Sep 22 14:42:09 1996 Tom Tromey * depend2.test: New file. diff --git a/tests/Makefile.am b/tests/Makefile.am index ad660886..d0b8a30d 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -15,6 +15,6 @@ man.test info.test obsolete.test lex.test scripts.test subdir2.test \ exsource.test canon4.test dup.test defun.test cxxlink.test cxxnoc.test \ order.test libobj2.test interp.test alllib.test block.test libobj3.test \ gnits.test interp2.test colneq.test implicit.test spell.test spell2.test \ -confsub.test primary.test primary2.test depend2.test +confsub.test primary.test primary2.test depend2.test spell3.test EXTRA_DIST = defs $(TESTS) diff --git a/tests/Makefile.in b/tests/Makefile.in index 64f91d4a..1f492bb4 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -53,7 +53,7 @@ man.test info.test obsolete.test lex.test scripts.test subdir2.test \ exsource.test canon4.test dup.test defun.test cxxlink.test cxxnoc.test \ order.test libobj2.test interp.test alllib.test block.test libobj3.test \ gnits.test interp2.test colneq.test implicit.test spell.test spell2.test \ -confsub.test primary.test primary2.test depend2.test +confsub.test primary.test primary2.test depend2.test spell3.test EXTRA_DIST = defs $(TESTS) mkinstalldirs = $(top_srcdir)/mkinstalldirs diff --git a/tests/spell3.test b/tests/spell3.test new file mode 100755 index 00000000..0f3571e4 --- /dev/null +++ b/tests/spell3.test @@ -0,0 +1,14 @@ +#! /bin/sh + +# Test to make sure some internal _DEPENDENCIES variables don't cause +# errors. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +TAGS_DEPENDENCIES = joe +## Required to avoid error. +ETAGS_ARGS = joe +END + +$AUTOMAKE -- 2.43.5