]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
(am_variable): New function.
authorTom Tromey <tromey@redhat.com>
Thu, 30 Nov 1995 00:32:56 +0000 (00:32 +0000)
committerTom Tromey <tromey@redhat.com>
Thu, 30 Nov 1995 00:32:56 +0000 (00:32 +0000)
(handle_texinfo): Use it.
(generate_makefile): Use it.

automake.in

index bdf78d56418d41a50ce5b596a4760b9e3b979034..dee0c40235c833eb75380c1722545161bffc85f6 100755 (executable)
@@ -248,21 +248,11 @@ sub generate_makefile
     &read_am_file ($makefile . '.am');
 
     # Program stuff.
-    local ($programs) = (defined ($contents{'AM_PROGRAMS'})
-                        ? $contents{'AM_PROGRAMS'}
-                        : $contents{'PROGRAMS'});
-    local ($libprograms) = (defined ($contents{'AM_LIBPROGRAMS'})
-                           ? $contents{'AM_LIBPROGRAMS'}
-                           : $contents{'LIBPROGRAMS'});
-    local ($libraries) = (defined ($contents{'AM_LIBRARIES'})
-                         ? $contents{'AM_LIBRARIES'}
-                         : $contents{'LIBRARIES'});
-    local ($scripts) = (defined ($contents{'AM_SCRIPTS'})
-                       ? $contents{'AM_SCRIPTS'}
-                       : $contents{'SCRIPTS'});
-    local ($libscripts) = (defined ($contents{'AM_LIBSCRIPTS'})
-                          ? $contents{'AM_LIBSCRIPTS'}
-                          : $contents{'LIBSCRIPTS'});
+    local ($programs) = &am_variable ('PROGRAMS');
+    local ($libprograms) = &am_variable ('AM_LIBPROGRAMS');
+    local ($libraries) = &am_variable ('AM_LIBRARIES');
+    local ($scripts) = &am_variable ('AM_SCRIPTS');
+    local ($libscripts) = &am_variable ('AM_LIBSCRIPTS');
 
     &handle_programs ($programs, $libprograms, $libraries);
     &handle_scripts ($scripts, $libscripts);
@@ -503,9 +493,10 @@ sub handle_scripts
 # Handle all Texinfo source.
 sub handle_texinfo
 {
-    return if (! defined $contents{TEXINFOS});
+    local ($texis) = &am_variable ('TEXINFOS');
+    return if (!$texis);
 
-    local (@texis) = split (' ', $contents{TEXINFOS});
+    local (@texis) = split (' ', $texis);
     if ($#texis > 0)
     {
        print STDERR "automake: sorry, only one file allowed in \`TEXINFOS'\n";
@@ -1187,6 +1178,17 @@ sub file_contents
     return $results;
 }
 
+# Return contents of some Makefile.am variable.  Allow for AM_ style
+# overrides.
+sub am_variable
+{
+    local ($varname) = @_;
+
+    return (defined ($contents{'AM_' . $varname})
+           ? $contents{'AM_' . $varname}
+           : $contents{$varname});
+}
+
 ################################################################
 
 # Verify that the file must exist in the current directory.