Deal with comments more sensibly.
Other minor cleanups
+Tue Dec 12 10:06:28 1995 Tom Tromey <tromey@cambric.colorado.edu>
+
+ * Makefile.am (pkgdata_DATA): Removed libprograms.am.
+
+ * automake.in (do_one_merge_target): Never generate trailing
+ whitespace.
+ (pretty_print): New function.
+ (handle_footer): Prettyprint definitions.
+ (am_install_var): Ditto.
+ (handle_source_transform): Ditto.
+ (handle_dist): Ditto.
+ (handle_libraries): Ditto.
+ (read_am_file): Put comments nearer appropriate code.
+
+ * texi-clean.am (mostlyclean-info): Use continued lines, not
+ multiple rm's. From Jim Meyering.
+
Sun Dec 10 11:59:33 1995 Tom Tromey <tromey@cambric.colorado.edu>
* Makefile.am (pkgdata_DATA): Cause INSTALL, install-sh, mdate-sh,
* automake.in (handle_tags): Generate TAGS rule for every
directory.
-
+
* subdirs.am (RECURSIVE): Include installcheck-recursive.
* automake.in (installcheck): New variable.
(generate_makefile): Initialize it.
* automake.in: Special-case when amdir=.
* Makefile.am (DIST_OTHER): Removed auto-detected files.
-
+
* automake.in:
Search for commonly-used files and auto-include them in distribution
pkgdata_DATA = clean-kr.am clean.am compile-kr.am compile-vars.am \
compile.am data.am depend.am dist-subd-top.am \
dist-subd.am dist-vars.am dist.am footer.am header-vars.am \
-kr-vars.am libprograms.am libraries-vars.am \
+kr-vars.am libraries-vars.am \
libraries.am library.am mans-vars.am \
program.am programs.am remake-hdr.am \
remake-subd.am remake.am scripts.am subdirs.am tags.am tags-subd.am \
bin_SCRIPTS = automake
TEXINFOS = automake.texi
+# SUBDIRS = intl po
+# CONFIG_HEADER = config.h
pkgdata_DATA = clean-kr.am clean.am compile-kr.am compile-vars.am \
compile.am data.am depend.am dist-subd-top.am \
dist-subd.am dist-vars.am dist.am footer.am header-vars.am \
-kr-vars.am libprograms.am libraries-vars.am \
+kr-vars.am libraries-vars.am \
libraries.am library.am mans-vars.am \
program.am programs.am remake-hdr.am \
remake-subd.am remake.am scripts.am subdirs.am tags.am tags-subd.am \
DIST_OTHER = automake.in
+# Gross.
DIST_SUBDIRS = samples/cpio/*Makefile.am
+# The following requires a fixed version of the Emacs 19.30 etags.
ETAGS_ARGS = automake.in --lang=none \
--regex='/^@node[ \t]+\([^,]+\)/\1/' automake.texi
-SCRIPTS = $(bin_SCRIPTS)
+SCRIPTS= $(bin_SCRIPTS)
MAKEINFO = makeinfo
TEXI2DVI = texi2dvi
INFO_DEPS = automake.info
DVIS = automake.dvi
-DATA = $(pkgdata_DATA)
+DATA= $(pkgdata_DATA)
ACLOCAL = aclocal.m4
-DIST_COMMON = mkinstalldirs configure Makefile.in stamp-vti configure.in ChangeLog THANKS README version.texi mdate-sh TODO INSTALL Makefile.am NEWS aclocal.m4 install-sh
+DIST_COMMON = mkinstalldirs configure Makefile.in stamp-vti configure.in \
+ChangeLog THANKS README version.texi mdate-sh TODO INSTALL Makefile.am \
+texinfo.tex NEWS aclocal.m4 install-sh
PACKAGE = @PACKAGE@
VERSION = @VERSION@
done
mostlyclean-info:
- rm -f automake.aux automake.cp automake.cps automake.dvi
- rm -f automake.fn automake.fns automake.ky automake.log
- rm -f automake.pg automake.toc automake.tp automake.vr automake.op
+ rm -f automake.aux automake.cp automake.cps automake.dvi \
+ automake.fn automake.fns automake.ky automake.log \
+ automake.pg automake.toc automake.tp automake.vr automake.op
clean-info:
dvi: $(DVIS)
-check:
+check:
-installcheck:
+installcheck:
install-exec: install-binSCRIPTS
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
-# SUBDIRS = intl po
-# CONFIG_HEADER = config.h
-# Gross.
-# The following requires a fixed version of the Emacs 19.30 etags.
# Some simple checks:
# * syntax check with perl4 and perl5.
# * make sure the scripts don't use 'true'
New in 0.26:
* Added --install-missing option.
+* Pretty-prints generated macros
\f
New in 0.25:
* Bug fixes.
* Ensure every line has a purpose. Omit unused stuff
* Eliminate extraneous rules when possible (eg 'install-am' stuff)
* Make sure vertical spacing is correct
-* pretty-print targets, rules, etc.
+* pretty-print targets
Need OTHER_SOURCES to hold sources whose objects end up in eg LIBOBJS.
Dependency tracking should work here. Maybe if it doesn't exist it
Consider automatic support for ".y" files. At the very least arrange
to have the corresponding ".c" file be distributed. [last half is done]
-Implement better rule for copying through comments. Rule should be
-that if comment immediately precedes rule or variable definition, then
-comment should be put there. Else what happens now is ok.
-
install-info doesn't have to look in build directory for info files;
just don't support this mode.
automatically add its input file to the distribution.
Don't hardcode the name of the configuration header. Get it from
-configure.in (AC_CONFIG_HEADER).
+configure.in (AC_CONFIG_HEADER).
Get the list of Makefiles to create from configure.in AC_OUTPUT
if none are given.
push (@result, $_);
}
- $output_vars .= ($one_file . "_OBJECTS = " . join (' ', @result)
- . "\n");
+ &pretty_print ($one_file . "_OBJECTS =", '', @result);
}
else
{
{
push (@outlist, 'lib' . $onelib . '.a');
}
- $output_vars .= ($onedir . '_LIBFILES = '
- . join (' ', @outlist) . "\n");
+ &pretty_print ($onedir . '_LIBFILES =', '', @outlist);
}
}
push (@all, '$(LIBFILES)');
if (! defined $contents{'LIBFILES'})
{
- $output_vars .= 'LIBFILES = ' . join (' ', @liblist) . "\n";
+ &pretty_print ('LIBFILES = ', '', @liblist);
}
$output_vars .= &file_contents ('libraries-vars');
}
}
# Some boilerplate.
- $output_vars = $output_vars . &file_contents ('texinfos-vars');
- $output_rules = $output_rules . &file_contents ('texinfos');
+ $output_vars .= &file_contents ('texinfos-vars');
+ $output_rules .= &file_contents ('texinfos');
# How to clean.
local ($crules) = &file_contents ('texi-clean');
}
}
- $output_vars .= ("DIST_COMMON = " . join (' ', keys (%dist_common))
- . "\n\n");
+ &pretty_print ("DIST_COMMON =", '', keys (%dist_common));
+ $output_vars .= "\n";
# Some boilerplate.
$output_vars .= &file_contents ('dist-vars');
{
if ($contents{'SOURCES'})
{
- $output_vars .= "SOURCES = " . $contents{'SOURCES'} . "\n";
+ &pretty_print ('SOURCES =', '', split (/\s+/, $contents{'SOURCES'}));
}
if ($contents{'OBJECTS'})
{
- $output_vars .= "OBJECTS = " . $contents{'OBJECTS'} . "\n";
+ &pretty_print ('OBJECTS =', '', split (/\s+/, $contents{'OBJECTS'}));
}
if ($contents{'SOURCES'} || $contents{'OBJECTS'})
{
push (@values, $name . '-local');
}
- $output_rules .= $name . ": " . join (' ', @values) . "\n\n";
+ $output_rules .= $name . ":";
+ if ($#values >= 0)
+ {
+ $output_rules .= ' ' . join (' ', @values);
+ }
+ $output_rules .= "\n\n";
}
# Handle all 'clean' targets.
{
}
+################################################################
+
+# Pretty-print something. HEAD is what should be printed at the
+# beginning of the first line, FILL is what should be printed at the
+# beginning of every subsequent line.
+sub pretty_print
+{
+ local ($head, $fill, @values) = @_;
+
+ local ($column) = length ($head);
+ $output_vars .= $head;
+
+ local ($bol) = 0;
+ foreach (@values)
+ {
+ # "71" because we also print a space.
+ if ($column + length ($_) > 71)
+ {
+ $output_vars .= " \\\n" . $fill;
+ $column = length ($fill);
+ $bol = 1;
+ }
+
+ $output_vars .= ' ' unless ($bol);
+ $output_vars .= $_;
+ $column += length ($_) + 1;
+ $bol = 0;
+ }
+
+ $output_vars .= "\n";
+}
+
+
################################################################
# Read Makefile.am and set up %contents. Simultaneously copy lines
local ($saw_bk) = 0;
local ($was_rule) = 0;
local ($last_var_name) = '';
+ local ($saved_comments) = '';
while (<AMFILE>)
{
}
}
}
+ elsif (/^\#/)
+ {
+ # Got a comment. We save comments until we get a
+ # non-comment, and then we add the last comments.
+ $saved_comments .= $_ . "\n";
+ }
elsif ($_ eq '@kr@')
{
# Special case: this means we want automatic
# Value here doesn't matter; for targets we only note
# existence.
$contents{$1} = 1;
- $output_trailer .= $_ . "\n";
+ $output_trailer .= $saved_comments . $_ . "\n";
+ $saved_comments = '';
}
elsif (m/^ *([A-Za-z][A-Za-z0-9_]*)[ \t]*=[ \t]*(.*)$/)
{
{
$contents{$1} = $2;
}
- $output_vars .= $_ . "\n";
+ $output_vars .= $saved_comments . $_ . "\n";
+ $saved_comments = '';
}
elsif (m/^$/)
{
# whatever we saw last.
if ($was_rule)
{
- $output_trailer .= "\n";
+ $output_trailer .= $saved_comments . "\n";
}
else
{
- $output_vars .= "\n";
+ $output_vars .= $saved_comments . "\n";
}
+ $saved_comments = '';
}
else
{
$saw_bk = (substr ($_, -1) eq "\\");
}
+ # Include trailing comments with variables for now.
+ $output_vars .= $saved_comments;
+
# Include some space after user code.
$output_vars .= "\n";
$output_trailer .= "\n";
if (! defined $contents{$primary} && $#used >= 0)
{
# Define it.
- $output_vars .= $primary . " = " . join (' ', @used) . "\n\n";
+ &pretty_print ($primary . '=', '', @used);
+ $output_vars .= "\n";
}
# Push here because PRIMARY might be configure time determined.
AC_TRY_COMPILE(
[#if !defined(__STDC__) || __STDC__ != 1
choke me
-#endif
+#endif
], [int test (int i, double x);
struct s1 @{int (*f) (int a);@};
struct s2 @{int (*f) (double a);@};],
are not covered in the automatic rules. These files should be listed in
the @samp{DIST_OTHER} variable.
-For instance, in the @code{automake} distribution,
+For instance, in the @code{automake} distribution,
@file{automake.in} (the source to
@code{automake}) is not found automatically. So in the
@file{Makefile.am}, we have:
pkgdata_DATA = clean-kr.am clean.am compile-kr.am compile-vars.am \
compile.am data.am depend.am dist-subd-top.am \
dist-subd.am dist-vars.am dist.am footer.am header-vars.am \
-kr-vars.am libprograms.am libraries-vars.am \
+kr-vars.am libraries-vars.am \
libraries.am library.am mans-vars.am \
program.am programs.am remake-hdr.am \
remake-subd.am remake.am scripts.am subdirs.am tags.am tags-subd.am \
+++ /dev/null
-install-libprograms: $(LIBPROGRAMS)
- $(top_srcdir)/mkinstalldirs $(libexecdir)
- for p in $(LIBPROGRAMS); do \
- $(INSTALL_PROGRAM) $$p $(libexecdir)/`echo $$p|sed '$(transform)'`; \
- done
-
-uninstall-libprograms:
- for p in $(LIBPROGRAMS); do \
- rm -f $(libexecdir)/`echo $$p|sed '$(transform)'`; \
- done
-
-mostlyclean-libprograms:
-
-clean-libprograms:
- rm -f $(LIBPROGRAMS)
-
-distclean-libprograms:
-
-maintainer-clean-libprograms:
-
## too many things could be removed. In particular the ".log"
## extension might be used in other contexts by the user
mostlyclean-info:
- rm -f @TEXI@.aux @TEXI@.cp @TEXI@.cps @TEXI@.dvi
- rm -f @TEXI@.fn @TEXI@.fns @TEXI@.ky @TEXI@.log
- rm -f @TEXI@.pg @TEXI@.toc @TEXI@.tp @TEXI@.vr @TEXI@.op
+ rm -f @TEXI@.aux @TEXI@.cp @TEXI@.cps @TEXI@.dvi \
+ @TEXI@.fn @TEXI@.fns @TEXI@.ky @TEXI@.log \
+ @TEXI@.pg @TEXI@.toc @TEXI@.tp @TEXI@.vr @TEXI@.op
clean-info:
-@set UPDATED 9 December
+@set UPDATED 12 December
@set EDITION 0.26
@set VERSION 0.26