Beginnings of switch to uniform naming scheme
authorTom Tromey <tromey@redhat.com>
Sun, 3 Dec 1995 08:53:31 +0000 (08:53 +0000)
committerTom Tromey <tromey@redhat.com>
Sun, 3 Dec 1995 08:53:31 +0000 (08:53 +0000)
17 files changed:
ChangeLog
Makefile.am
Makefile.in
TODO
automake.in
automake.texi
data.am
dist-vars.am
header-vars.am
lib/am/Makefile.am
lib/am/data.am
lib/am/header-vars.am
lib/am/scripts.am
libscripts.am [deleted file]
packagedata.am [deleted file]
scripts.am
version.texi

index c311c8a..cf9c110 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,45 @@
+Sun Dec  3 00:24:08 1995  Tom Tromey  <tromey@cambric.colorado.edu>
+
+       * dist-vars.am (DIST_FILES): Removed PACKAGEDATA.
+
+       * automake.in (handle_scripts): Use am_install_var.
+
+       * scripts.am: Rewrote for new uniform naming scheme.
+
+       * Makefile.am (pkgdata_DATA): Removed libscripts.am.
+
+       * libscripts.am: Removed.
+
+       * packagedata.am: Removed.
+
+       * Makefile.am (PACKAGEDATA): Removed packagedata.am.
+       (pkgdata_DATA): Renamed from PACKAGEDATA.
+
+       * automake.in (handle_data): Use am_install_var.
+       (init_globals): Init %exec_dir_p.
+
+       * data.am: Rewrote for new uniform naming scheme.
+
+       * automake.in (get_object_extension): New function.
+       (handle_programs): Use it.
+       (dir_holds_sources): Changed interpretation.
+       (handle_headers): New function.
+       (am_install_var): New function.
+       (generate_makefile): Call handle_headers.
+
+       * header-vars.am (pkgdatadir): New macro.
+       (pkglibdir): Ditto.
+       (pkgincludedir): Ditto.
+
+       * automake.in (handle_source_transform): New function.
+       (am_error): New function.
+       (generate_makefile): Use it.
+       (handle_source_transform): Ditto.
+       (handle_texinfo): Ditto.
+       (handle_dependencies): Ditto.
+       (handle_merge_targets): Ditto.
+       (require_file): Ditto.
+
 Sat Dec  2 21:39:56 1995  Tom Tromey  <tromey@cambric.colorado.edu>
 
        * automake.in: Updated FSF address.  From Jim Meyering.
index 54ffb04..905447d 100644 (file)
@@ -1,22 +1,18 @@
-# SUBDIRS = intl po
-
 SCRIPTS = automake
-
 TEXINFOS = automake.texi
+# SUBDIRS = intl po
+# CONFIG_HEADER = config.h
 
-PACKAGEDATA = clean-kr.am clean.am compile-kr.am compile-vars.am \
+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 libscripts.am libprograms.am libraries-vars.am \
-libraries.am library.am mans-vars.am packagedata.am \
+kr-vars.am libprograms.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 \
 tags-clean.am texi-version.am texinfos-vars.am texinfos.am
 
-# CONFIG_HEADER = config.h
-
 DIST_OTHER = automake.in
-DIST_SUBDIRS = RCS samples
 
 automake: automake.in
        CONFIG_FILES=$@ CONFIG_HEADERS= ./config.status
index c0d24cf..8713f97 100644 (file)
@@ -37,6 +37,10 @@ mandir = @mandir@
 includedir = @includedir@
 oldincludedir = /usr/include
 
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
 INSTALL = @INSTALL@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_DATA = @INSTALL_DATA@
@@ -48,11 +52,11 @@ SCRIPTS = automake
 
 TEXINFOS = automake.texi
 
-PACKAGEDATA = clean-kr.am clean.am compile-kr.am compile-vars.am \
+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 libscripts.am libprograms.am libraries-vars.am \
-libraries.am library.am mans-vars.am packagedata.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 \
 tags-clean.am texi-version.am texinfos-vars.am texinfos.am
@@ -71,6 +75,8 @@ INFOS = automake.info*
 INFO_DEPS = automake.info
 DVIS = automake.dvi
 
+DATA = ${pkgdata_DATA}
+
 ACLOCAL = aclocal.m4
 DIST_COMMON = Makefile.in Makefile.am version.texi stamp-vti mdate-sh texinfo.tex aclocal.m4 install-sh mkinstalldirs THANKS TODO README NEWS INSTALL ChangeLog configure configure.in
 
@@ -167,17 +173,15 @@ distclean-info:
 maintainer-clean-info:
        rm -f $(INFOS)
 
-install-pdata: $(PACKAGEDATA)
-       dir=$(datadir)/$(PACKAGE);              \
-       $(top_srcdir)/mkinstalldirs $$dir;      \
-       for p in $(PACKAGEDATA); do             \
-         $(INSTALL_DATA) $(srcdir)/$$p $$dir/$$p; \
+install-pkgdataDATA: $(pkgdata_DATA)
+       $(top_srcdir)/mkinstalldirs $(pkgdatadir)
+       for p in $(pkgdata_DATA); do            \
+         $(INSTALL_DATA) $(srcdir)/$$p $(pkgdatadir)/$$p; \
        done
 
-uninstall-pdata:
-       dir=$(datadir)/$(PACKAGE);              \
-       for p in $(PACKAGEDATA); do             \
-         rm -f $$dir/$$p;                      \
+uninstall-pkgdataDATA:
+       for p in $(pkgdata_DATA); do            \
+         rm -f $(pkgdatadir)/$$p;              \
        done
 
 $(srcdir)/Makefile.in: Makefile.am
@@ -230,14 +234,14 @@ installcheck:
 
 install-exec: install-scripts
 
-install-data: install-info install-pdata
+install-data: install-info install-pkgdataDATA
 
 install: install-exec install-data
 
-uninstall: uninstall-scripts uninstall-info uninstall-pdata
+uninstall: uninstall-scripts uninstall-info uninstall-pkgdataDATA
 
 installdirs:
-       $(top_srcdir)/mkinstalldirs $(bindir) $(infodir) $(datadir)/$(PACKAGE)
+       $(top_srcdir)/mkinstalldirs $(bindir) $(infodir) ${pkgdatadir}
 
 
 
diff --git a/TODO b/TODO
index 912a9db..7b738c4 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,6 +1,6 @@
 Top priorities:
-* Implement new `where_HOW' scheme.
-* Handle installable libraries and headers
+* FINISH new `where_HOW' scheme!
+* Update docs!
 
 Some known problems:
 * clean targets not very well tested
@@ -43,7 +43,8 @@ seem right, but maybe it is so names can be rewritten uniformly?  Must
 check
 
 look in configure.in's AC_OUTPUT command and include those files in
-distribution.
+distribution.  Or consider new CONFIGURED_FILES macro that lists files
+generated by config.status.
 
 Auto-distribute "ChangeLog.[0-9]+"?
 
@@ -120,19 +121,12 @@ DIST_SUBDIRS   directories which are copied verbatim into the
                only example code (which don't have their own
                makefile).  This variable might be a bad idea.
 
-MOSTLYCLEANFILES
-CLEANFILES
-DISTCLEANFILES
-MAINTAINERCLEANFILES
-
 lib_LIBADD     code conditionally included in a library
                This probably needs to be redone anyway.
 
 AM_TEXINFOS    override form
 SUFFIXES       additional suffixes
 
-Document the AC_PROG_MAKE_SET requirement when SUBDIRS is set.
-
 ================================================================
 
 Libraries:
@@ -146,6 +140,7 @@ Libraries:
   It would be really interesting to be able to easily (as the end-user)
   make many different versions of the library: shared, static, profiling,
   debug, optimized...
+* Must ranlib libraries after installing
 
 Some examples to keep in mind while doing this:
 * readline
index 4ffdb14..758dbc7 100755 (executable)
@@ -78,8 +78,10 @@ $output_directory = '.';
 @installcheck = ();
 @clean = ();
 
-# TRUE if current directory holds any C source files.
-$dir_holds_sources = 0;
+# TRUE if current directory holds any C source files.  (Actually holds
+# object extension, but this information is encapsulated in the
+# function get_object_extension).
+$dir_holds_sources = '';
 
 # TRUE if install targets should work recursively.
 $recursive_install = 0;
@@ -96,8 +98,7 @@ foreach $am_file (@input_files)
 {
     if (! -f ($am_file . '.am'))
     {
-       print STDERR "automake: $am_file" . ".am: no such file\n";
-       $exit_status = 1;
+       &am_error ('no such file');
     }
     else
     {
@@ -229,7 +230,7 @@ sub generate_makefile
     @install_exec = ();
     @uninstall = ();
     @installdirs = ();
-    $dir_holds_sources = 0;
+    $dir_holds_sources = '';
     $recursive_install = 0;
     @info = ();
     @dvi = ();
@@ -263,6 +264,7 @@ sub generate_makefile
     &handle_texinfo;
     &handle_man_pages;
     &handle_data;
+    &handle_headers;
     &handle_subdirs;
     &handle_configure;
     &handle_tags;
@@ -279,8 +281,7 @@ sub generate_makefile
     }
     if (! open (GM_FILE, "> " . $output_directory . '/' . $makefile . ".in"))
     {
-       print STDERR "automake: cannot open ", $makefile, ".in: ", $!, "\n";
-       $exit_status = 1;
+       &am_error ("cannot open:", $!);
        return;
     }
 
@@ -305,88 +306,115 @@ sub generate_header
     $output_vars = $output_vars . &file_contents ('header-vars');
 }
 
-# Handle C programs and libraries.
-sub handle_programs
+# Return object extension.  Just once, put some code into the output.
+sub get_object_extension
 {
-    local ($programs, $libprograms, $libraries) = @_;
-
-    if (!$programs && !$libprograms && !$libraries)
+    if (! $dir_holds_sources)
     {
-       # None exist.
-       return;
-    }
-    $dir_holds_sources = 1;
 
-    # Boilerplate.
-    $output_vars .= &file_contents ('compile-vars');
-    $output_rules .= &file_contents ('compile');
+       # Boilerplate.
+       $output_vars .= &file_contents ('compile-vars');
+       $output_rules .= &file_contents ('compile');
 
-    # Check for automatic de-ANSI-fication.
-    local ($obj) = '.o';
-    push (@suffixes, '.c', '.o');
-    push (@clean, 'compile');
+       # Check for automatic de-ANSI-fication.
+       $dir_holds_sources = '.o';
+       push (@suffixes, '.c', '.o');
+       push (@clean, 'compile');
 
-    if (defined $contents{'@kr@'})
-    {
-       $obj = '.${kr}o';
-       push (@suffixes, '._c', '._o');
+       if (defined $contents{'@kr@'})
+       {
+           $dir_holds_sources = '.${kr}o';
+           push (@suffixes, '._c', '._o');
 
-       &require_file ('ansi2knr.c');
-       &require_file ('ansi2knr.1');
+           &require_file ('ansi2knr.c');
+           &require_file ('ansi2knr.1');
 
-       $output_vars .= &file_contents ('kr-vars');
-       $output_rules .= &file_contents ('compile-kr');
-       $output_rules .= &file_contents ('clean-kr');
+           $output_vars .= &file_contents ('kr-vars');
+           $output_rules .= &file_contents ('compile-kr');
+           $output_rules .= &file_contents ('clean-kr');
 
-       push (@clean, 'kr');
+           push (@clean, 'kr');
+       }
     }
+    return $dir_holds_sources;
+}
 
-    local (@sources, @objects);
-    push (@sources, '${SOURCES}') if (defined $contents{'SOURCES'});
-    push (@objects, '${OBJECTS}') if (defined $contents{'OBJECTS'});
+# Handle SOURCE->OBJECT transform for one program or library.
+sub handle_source_transform
+{
+    local ($one_file, $obj) = @_;
 
-    local ($one_file);
-    foreach $one_file (split (' ', ($programs . ' '
-                                   . $libprograms . ' '
-                                   . $libraries)))
+    # Look for file_SOURCES and file_OBJECTS.
+    local (@result) = ();
+    if (defined $contents{$one_file . "_SOURCES"})
     {
-       # Look for file_SOURCES and file_OBJECTS.  FIXME file_OBJECTS
-       # should probably not be used(?)
-       if (defined $contents{$one_file . "_SOURCES"})
+       if (! defined $contents{$one_file . "_OBJECTS"})
        {
-           if (! defined $contents{$one_file . "_OBJECTS"})
-           {
-               # Turn sources into objects.
-               $_ = $contents{$one_file . "_SOURCES"};
-
-               # Ugh: Perl syntax vs Emacs.
-               local ($krc1, $krc2) = ('\.\$\{kr\}c', '\.\$\(kr\)c');
+           # Turn sources into objects.
+           $_ = $contents{$one_file . "_SOURCES"};
 
-               s/\.cc/$obj/g;
-               s/$krc1/$obj/g;
-               s/$krc2/$obj/g;
-               s/\.[cCmylfs]/$obj/g;
+           # Ugh: Perl syntax vs Emacs.
+           local ($krc1, $krc2) = ('\.\$\{kr\}c', '\.\$\(kr\)c');
 
-               $output_vars .= $one_file . "_OBJECTS = " . $_ . "\n";
-           }
+           s/\.cc/$obj/g;
+           s/$krc1/$obj/g;
+           s/$krc2/$obj/g;
+           s/\.[cCmylfs]/$obj/g;
 
-           push (@sources, '${' . $one_file . "_SOURCES}");
-           push (@objects, '${' . $one_file . "_OBJECTS}");
+           $output_vars .= $one_file . "_OBJECTS = " . $_ . "\n";
        }
        else
        {
-           $output_vars .= ($one_file . "_SOURCES = " . $one_file . ".c\n"
-                            . $one_file . "_OBJECTS = ". $one_file
-                            . $obj . "\n");
-           push (@sources, $one_file . '.c');
-           push (@objects, $one_file . $obj);
+           &am_error ($one_file . '_OBJECTS', 'should not be defined');
        }
 
-       if (defined $contents{'CONFIG_HEADER'})
-       {
-           $output_rules .= ('$(' . $one_file . "_OBJECTS): "
-                             . $contents{'CONFIG_HEADER'} . "\n");
-       }
+       @result = ('${' . $one_file . "_SOURCES}",
+                  '${' . $one_file . "_OBJECTS}");
+    }
+    else
+    {
+       $output_vars .= ($one_file . "_SOURCES = " . $one_file . ".c\n"
+                        . $one_file . "_OBJECTS = ". $one_file
+                        . $obj . "\n");
+       @result = ($one_file . '.c',
+                  $one_file . $obj);
+    }
+
+    if (defined $contents{'CONFIG_HEADER'})
+    {
+       $output_rules .= ('$(' . $one_file . "_OBJECTS): "
+                         . $contents{'CONFIG_HEADER'} . "\n");
+    }
+
+    return @result;
+}
+
+# Handle C programs.
+sub handle_programs
+{
+    local ($programs, $libprograms, $libraries) = @_;
+
+    if (!$programs && !$libprograms && !$libraries)
+    {
+       # None exist.
+       return;
+    }
+
+    local ($obj) = &get_object_extension;
+
+    local (@sources, @objects);
+    push (@sources, '${SOURCES}') if (defined $contents{'SOURCES'});
+    push (@objects, '${OBJECTS}') if (defined $contents{'OBJECTS'});
+
+    local ($one_file);
+    local ($sadd, $oadd);
+    foreach $one_file (split (' ', ($programs . ' '
+                                   . $libprograms . ' '
+                                   . $libraries)))
+    {
+       ($sadd, $oadd) = &handle_source_transform ($one_file, $obj);
+       push (@sources, $sadd);
+       push (@objects, $oadd);
     }
 
     $output_vars .= "\n";
@@ -451,7 +479,7 @@ sub handle_libraries
     {
        if (! defined $contents{$onelib . '_LIBADD'})
        {
-           # Generate support for conditional objection inclusion in
+           # Generate support for conditional object inclusion in
            # libraries.
            $output_vars .= $onelib . "_LIBADD =\n";
        }
@@ -474,27 +502,8 @@ sub handle_libraries
 # Handle scripts.
 sub handle_scripts
 {
-    local ($scripts, $libscripts) = @_;
-
-    if ($scripts)
-    {
-       $output_rules .= &file_contents ('scripts');
-       push (@install_exec, 'install-scripts');
-       push (@uninstall, 'uninstall-scripts');
-       push (@clean, 'scripts');
-       push (@installdirs, '$(bindir)');
-       push (@all, '$(SCRIPTS)');
-    }
-
-    if ($libscripts)
-    {
-       $output_rules .= &file_contents ('libscripts');
-       push (@install_exec, 'install-libscripts');
-       push (@uninstall, 'uninstall-libscripts');
-       push (@clean, 'libscripts');
-       push (@installdirs, '$(libexecdir');
-       push (@all, '$(LIBSCRIPTS)');
-    }
+    &am_install_var ('scripts', 'SCRIPTS', 'bin', 'sbin', 'libexec',
+                    'noinst');
 }
 
 # Handle all Texinfo source.
@@ -506,8 +515,7 @@ sub handle_texinfo
     local (@texis) = split (' ', $texis);
     if ($#texis > 0)
     {
-       print STDERR "automake: sorry, only one file allowed in \`TEXINFOS'\n";
-       $exit_status = 1;
+       &am_error ('sorry, only one file allowed in `TEXINFOS\'');
        return;
     }
 
@@ -627,24 +635,12 @@ sub handle_man_pages
     push (@all, '$(MANS)');
 }
 
-# Handle DATA and PACKAGEDATA.
+# Handle DATA variables.
 sub handle_data
 {
-    if (defined $contents{'DATA'})
-    {
-       $output_rules .= &file_contents ('data');
-       push (@install_data, 'install-ddata');
-       push (@uninstall, 'uninstall-ddata');
-       push (@installdirs, '$(datadir)');
-    }
-
-    if (defined $contents{'PACKAGEDATA'})
-    {
-       $output_rules .= &file_contents ('packagedata');
-       push (@install_data, 'install-pdata');
-       push (@uninstall, 'uninstall-pdata');
-       push (@installdirs, '$(datadir)/$(PACKAGE)');
-    }
+    &am_install_var ('data', 'DATA', 'data', 'sysconf',
+                    'sharedstate', 'localstate', 'pkgdata',
+                    'noinst');
 }
 
 # Handle TAGS.
@@ -731,7 +727,7 @@ sub handle_dependencies
            {
                if (! open (DEP_FILE, $depfile))
                {
-                   print STDERR "automake: couldn't open $depfile: $!\n";
+                   &am_error ("couldn't open $depfile", $!);
                    next;
                }
 
@@ -810,6 +806,14 @@ sub handle_configure
     }
 }
 
+# Handle C headers.
+sub handle_headers
+{
+    &am_install_var ('data', 'HEADERS', 'include',
+                    'oldinclude', 'pkginclude',
+                    'noinst');
+}
+
 # Handle footer elements.
 sub handle_footer
 {
@@ -888,7 +892,7 @@ sub handle_merge_targets
 
     if (defined $contents{'install-local'})
     {
-       print STDERR "automake: use \`install-data' or \`install-exec', not \`install'\n";
+       &am_error ("use \`install-data' or \`install-exec', not \`install'");
     }
 
     # Step two: if we are doing recursive makes, write out the
@@ -1132,6 +1136,26 @@ sub read_am_file
 # Initialize global variables.
 sub init_globals
 {
+    # Associative array of standard directory names.  Entry is TRUE if
+    # corresponding directory should be installed during
+    # 'install-exec' phase.
+    %exec_dir_p =
+       ('bin' => 1,
+        'sbin' => 1,
+        'libexec' => 1,
+        'data' => 0,
+        'sysconf' => 1,
+        'localstate' => 1,
+        'lib' => 1,
+        'info' => 0,
+        'man' => 0,
+        'include' => 0,
+        'oldinclude' => 0,
+        'pkgdata' => 0,
+        'pkglib' => 1,
+        'pkginclude' => 0
+        );
+
     # Helper text for dealing with man pages.
     $install_man_format =
     '  sect=@SECTION@;                         \\
@@ -1213,6 +1237,58 @@ sub am_variable
            : $contents{$varname});
 }
 
+# Handle `where_HOW' variable magic.  Does all lookups, generates
+# install code,and possibly generates code to define the primary
+# variable.  The first argument is the name of the .am file to munge,
+# the second argument is the primary variable (eg HEADERS), and all
+# subsequent arguments are possible installation locations.  FIXME
+# should scan all defined variables and do some error checking to
+# avoid typos (eg 'bnidir_PROGRAMS' should give error).  Returns TRUE
+# if any items were found, FALSE otherwise.
+sub am_install_var
+{
+    local ($file, $primary, @prefixes) = @_;
+    local (@used) = ();
+
+    local ($contents) = &file_contents ($file);
+    local ($munge);
+    foreach (@prefixes)
+    {
+       if (defined $contents{$_ . '_' . $primary})
+       {
+           push (@used, '${' . $_ . '_' . $primary . '}');
+           if ($_ eq 'noinst')
+           {
+               # Objects in noinst_FOO never get installed.
+               next;
+           }
+
+           ($munge = $contents) =~ s/\@DIR\@/$_/g;
+           $output_rules .= $munge;
+
+           push (@uninstall, 'uninstall-' . $_ . $primary);
+           push (@installdirs, '${' . $_ . 'dir}');
+           if ($exec_dir_p{$_})
+           {
+               push (@install_exec, 'install-' . $_ . $primary);
+           }
+           else
+           {
+               push (@install_data, 'install-' . $_ . $primary);
+           }
+       }
+    }
+
+    if (! defined $contents{$primary} && $#used >= 0)
+    {
+       # Define it.
+       $output_vars .= $primary . " = " . join (' ', @used) . "\n\n";
+    }
+
+    return ($#used >= 0);
+}
+
+
 ################################################################
 
 # Verify that the file must exist in the current directory.
@@ -1223,8 +1299,7 @@ sub require_file
 
     if (! -f $fullfile)
     {
-       print STDERR "automake: required file \"$fullfile\" not found\n";
-       $exit_status = 1;
+       &am_error ("required file \"$fullfile\" not found");
     }
     else
     {
@@ -1259,6 +1334,13 @@ sub mkdir
 
 ################################################################
 
+# Print an error message and set exit status.
+sub am_error
+{
+    print STDERR "automake: ${am_file}.am: ", join (' ', @_), "\n";
+    $exit_status = 1;
+}
+
 # Print usage information.
 sub usage
 {
index 6d5f349..dc80dde 100644 (file)
@@ -119,6 +119,7 @@ AutoMake's convenience.
 * Docs::                        Specifying documentation files
 * ANSI::                        Automatic de-ANSI-fication
 * Install::                     What gets installed
+* Clean::                       What gets cleaned
 * Distribution::                What gets distributed
 * Tags::                        TAGS files
 * Dependencies::                Automatic dependency tracking
@@ -219,6 +220,9 @@ not expected to contain @file{Makefile.am}s; only @file{Makefile}s
 (after configuration).  This allows inclusion of libraries from packages
 which do not use @code{automake} (such as gettext).
 
+If @samp{SUBDIRS} is defined, then your @file{configure.in} must include
+@code{AC_PROG_MAKE_SET}.
+
 FIXME supply complete list of recursive targets?
 
 
@@ -567,12 +571,21 @@ FIXME xref to Extending node here; sometimes you need to install more.
 multiple machines which share directory structure -- these targets allow
 the machine-independent parts to be installed only once.
 
-@code{automake} also generates an @samp{uninstall} target.
-
-In the future @code{automake} will be extended to generate an
+@code{automake} also generates an @samp{uninstall} target, and an
 @samp{installdirs} target.
 
 
+@node Clean
+@section Clean targets
+
+The GNU Makefile Standards specify a number of different clean rules.
+Generally the files that can cleaned are determined automatically by
+@code{automake}.  Of course, @code{automake} also recognizes some
+variables that can be defined to specify additional files to clean.
+These variables are @samp{MOSTLYCLEANFILES}, @samp{CLEANFILES},
+@samp{DISTCLEANFILES}, and @samp{MAINTAINERCLEANFILES}.
+
+
 @node Distribution
 @section Building a Release
 
@@ -712,4 +725,5 @@ Better error checking would be good.
 NOTES:
 
 * Need section on operation of automake: it reads Makefile.am and COPIES
-the contents...
+the contents.  This section should include info on SUFFIXES, because
+that is usually only needed when copying in additional targets (?)
diff --git a/data.am b/data.am
index 2266c1f..f07b81e 100644 (file)
--- a/data.am
+++ b/data.am
@@ -1,11 +1,11 @@
-install-ddata: $(DATA)
-       $(top_srcdir)/mkinstalldirs $(datadir)
-       for p in $(DATA); do                    \
-         $(INSTALL_DATA) $(srcdir)/$$p $(datadir)/$$p; \
+install-@DIR@DATA: $(@DIR@_DATA)
+       $(top_srcdir)/mkinstalldirs $(@DIR@dir)
+       for p in $(@DIR@_DATA); do              \
+         $(INSTALL_DATA) $(srcdir)/$$p $(@DIR@dir)/$$p; \
        done
 
-uninstall-ddata:
-       for p in $(DATA); do                    \
-         rm -f $(datadir)/$$p;                 \
+uninstall-@DIR@DATA:
+       for p in $(@DIR@_DATA); do              \
+         rm -f $(@DIR@dir)/$$p;                \
        done
 
index a63be09..13c75e5 100644 (file)
@@ -2,5 +2,5 @@ PACKAGE = @PACKAGE@
 VERSION = @VERSION@
 
 DIST_FILES = $(SOURCES) $(HEADERS) $(TEXINFOS) $(INFOS) $(MANS) \
-       $(DIST_OTHER) $(DIST_COMMON) $(DATA) $(PACKAGEDATA)
+       $(DIST_OTHER) $(DIST_COMMON) $(DATA)
 
index 6823e7f..df4831d 100644 (file)
@@ -39,6 +39,7 @@ oldincludedir = /usr/include
 ## Some derived variables that have been found to be useful.
 pkgdatadir = $(datadir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
 
 INSTALL = @INSTALL@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
index 54ffb04..905447d 100644 (file)
@@ -1,22 +1,18 @@
-# SUBDIRS = intl po
-
 SCRIPTS = automake
-
 TEXINFOS = automake.texi
+# SUBDIRS = intl po
+# CONFIG_HEADER = config.h
 
-PACKAGEDATA = clean-kr.am clean.am compile-kr.am compile-vars.am \
+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 libscripts.am libprograms.am libraries-vars.am \
-libraries.am library.am mans-vars.am packagedata.am \
+kr-vars.am libprograms.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 \
 tags-clean.am texi-version.am texinfos-vars.am texinfos.am
 
-# CONFIG_HEADER = config.h
-
 DIST_OTHER = automake.in
-DIST_SUBDIRS = RCS samples
 
 automake: automake.in
        CONFIG_FILES=$@ CONFIG_HEADERS= ./config.status
index 2266c1f..f07b81e 100644 (file)
@@ -1,11 +1,11 @@
-install-ddata: $(DATA)
-       $(top_srcdir)/mkinstalldirs $(datadir)
-       for p in $(DATA); do                    \
-         $(INSTALL_DATA) $(srcdir)/$$p $(datadir)/$$p; \
+install-@DIR@DATA: $(@DIR@_DATA)
+       $(top_srcdir)/mkinstalldirs $(@DIR@dir)
+       for p in $(@DIR@_DATA); do              \
+         $(INSTALL_DATA) $(srcdir)/$$p $(@DIR@dir)/$$p; \
        done
 
-uninstall-ddata:
-       for p in $(DATA); do                    \
-         rm -f $(datadir)/$$p;                 \
+uninstall-@DIR@DATA:
+       for p in $(@DIR@_DATA); do              \
+         rm -f $(@DIR@dir)/$$p;                \
        done
 
index 6823e7f..df4831d 100644 (file)
@@ -39,6 +39,7 @@ oldincludedir = /usr/include
 ## Some derived variables that have been found to be useful.
 pkgdatadir = $(datadir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
 
 INSTALL = @INSTALL@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
index e7c6163..30ef3ac 100644 (file)
@@ -1,18 +1,18 @@
-install-scripts: $(SCRIPTS)
-       $(top_srcdir)/mkinstalldirs $(bindir)
-       for p in $(SCRIPTS); do                 \
-         $(INSTALL_SCRIPT) $$p $(bindir)/`echo $$p|sed '$(transform)'`; \
+install-@DIR@SCRIPTS: $(@DIR@_SCRIPTS)
+       $(top_srcdir)/mkinstalldirs $(@DIR@dir)
+       for p in $(@DIR@_SCRIPTS); do           \
+         $(INSTALL_SCRIPT) $$p $(@DIR@dir)/`echo $$p|sed '$(transform)'`; \
        done
 
-uninstall-scripts:
-       for p in $(SCRIPTS); do                 \
-         rm -f $(bindir)/`echo $$p|sed '$(transform)'`; \
+uninstall-@DIR@SCRIPTS:
+       for p in $(@DIR@_SCRIPTS); do           \
+         rm -f $(@DIR@dir)/`echo $$p|sed '$(transform)'`; \
        done
 
 mostlyclean-scripts:
 
 clean-scripts:
-       rm -f $(SCRIPTS)
+       rm -f $(@DIR@_SCRIPTS)
 
 distclean-scripts:
 
diff --git a/libscripts.am b/libscripts.am
deleted file mode 100644 (file)
index e6f03aa..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-install-libscripts: $(LIBSCRIPTS)
-       $(top_srcdir)/mkinstalldirs $(libexecdir)
-       for p in $(LIBSCRIPTS); do
-         $(INSTALL_SCRIPT) $$p $(libexecdir)/`echo $$p|sed '$(transform)'`;
-       done
-
-uninstall-libscripts:
-       for p in $(LIBSCRIPTS); do \
-         rm -f $(libexecdir)/`echo $$p|sed '$(transform)'`; \
-       done
-
-mostlyclean-libscripts:
-
-clean-libscripts:
-       rm -f $(LIBSCRIPTS)
-
-distclean-libscripts:
-
-maintainer-clean-libscripts:
-
diff --git a/packagedata.am b/packagedata.am
deleted file mode 100644 (file)
index 7c61649..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-install-pdata: $(PACKAGEDATA)
-       dir=$(datadir)/$(PACKAGE);              \
-       $(top_srcdir)/mkinstalldirs $$dir;      \
-       for p in $(PACKAGEDATA); do             \
-         $(INSTALL_DATA) $(srcdir)/$$p $$dir/$$p; \
-       done
-
-uninstall-pdata:
-       dir=$(datadir)/$(PACKAGE);              \
-       for p in $(PACKAGEDATA); do             \
-         rm -f $$dir/$$p;                      \
-       done
-
index e7c6163..30ef3ac 100644 (file)
@@ -1,18 +1,18 @@
-install-scripts: $(SCRIPTS)
-       $(top_srcdir)/mkinstalldirs $(bindir)
-       for p in $(SCRIPTS); do                 \
-         $(INSTALL_SCRIPT) $$p $(bindir)/`echo $$p|sed '$(transform)'`; \
+install-@DIR@SCRIPTS: $(@DIR@_SCRIPTS)
+       $(top_srcdir)/mkinstalldirs $(@DIR@dir)
+       for p in $(@DIR@_SCRIPTS); do           \
+         $(INSTALL_SCRIPT) $$p $(@DIR@dir)/`echo $$p|sed '$(transform)'`; \
        done
 
-uninstall-scripts:
-       for p in $(SCRIPTS); do                 \
-         rm -f $(bindir)/`echo $$p|sed '$(transform)'`; \
+uninstall-@DIR@SCRIPTS:
+       for p in $(@DIR@_SCRIPTS); do           \
+         rm -f $(@DIR@dir)/`echo $$p|sed '$(transform)'`; \
        done
 
 mostlyclean-scripts:
 
 clean-scripts:
-       rm -f $(SCRIPTS)
+       rm -f $(@DIR@_SCRIPTS)
 
 distclean-scripts:
 
index 3c90af6..62d1eab 100644 (file)
@@ -1,3 +1,3 @@
-@set UPDATED 29 November
+@set UPDATED 3 December
 @set EDITION 0.24
 @set VERSION 0.24