automake-ng
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Automake-NG] [FYI 2/2] [ng] automake: can copy makefile fragments reall


From: Stefano Lattarini
Subject: [Automake-NG] [FYI 2/2] [ng] automake: can copy makefile fragments really verbatim
Date: Mon, 30 Jul 2012 18:45:23 +0200

This will allow us to actually put such fragments in distributed
files, and then include them *at make runtime*, instead of copying
their contents in every single makefile (as is done now, a legacy
from mainline Automake).

* automake.in (verbatim): New function, will copy the given file
"verbatim" (excluding removal of '##' comments) in the output
Makefile.
(handle_tests): Use 'verbatim', not 'almost_verbatim', to include
files 'color-tests.am', 'serial-tests.am' and 'parallel-tests.am'.
(handle_texinfo): Likewise, for 'texibuild.am'.
(generate_makefile): Likewise, for 'common-targets.am' and
'am-dir.am'.

Signed-off-by: Stefano Lattarini <address@hidden>
---
 automake.in | 24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/automake.in b/automake.in
index 5ed904b..4e6f02c 100644
--- a/automake.in
+++ b/automake.in
@@ -3013,7 +3013,7 @@ sub handle_texinfo ()
   if ($info_texinfos)
     {
       define_verbose_texinfo;
-      almost_verbatim ('texibuild');
+      verbatim ('texibuild');
       ($mostlyclean, $clean, $maintclean) = handle_texinfo_helper 
($info_texinfos);
       chomp $mostlyclean;
       chomp $clean;
@@ -4065,15 +4065,15 @@ sub handle_tests
 
   if (var ('TESTS'))
     {
-      almost_verbatim ('color-tests');
+      verbatim ('color-tests');
       if (option 'serial-tests')
         {
-          almost_verbatim ('serial-tests');
+          verbatim ('serial-tests');
         }
       else
         {
           require_conf_file ("parallel-tests", FOREIGN, 'test-driver');
-          almost_verbatim ('parallel-tests');
+          verbatim ('parallel-tests');
        }
     }
 }
@@ -5821,6 +5821,18 @@ sub almost_verbatim ($%)
   $output_verbatim .= preprocess_file ("$libdir/am/$name.am", @_);
 }
 
+# verbatim ($NAME)
+# ----------------
+# Load a "$libdir/am/$NAME.am", strip any '##'-style comment, and append
+# the result to the '$output_verbatim' variable.  No extra parsing or
+# post-processing is done (i.e., recognition of rules declaration or of
+# make variables definitions).
+sub verbatim ($)
+{
+  my $name = shift;
+  $output_verbatim .= slurp_makefile_fragment ("$libdir/am/$name.am");
+}
+
 # @PARAGRAPHS
 # &make_paragraphs ($MAKEFILE, [%TRANSFORM])
 # ------------------------------------------
@@ -6848,7 +6860,7 @@ sub generate_makefile ($$)
   check_gnu_standards;
   check_gnits_standards;
 
-  almost_verbatim ('am-dir');
+  verbatim ('am-dir');
 
   handle_config_headers;
   handle_configure ($makefile_am, $makefile_in, $makefile, @inputs);
@@ -6903,7 +6915,7 @@ sub generate_makefile ($$)
   handle_footer;
   # Special targets 'all', 'check' and 'install', handling of
   # $(BUILT_SOURCES), and related stuff.
-  almost_verbatim ('common-targets');
+  verbatim ('common-targets');
 
   handle_clean ($makefile);
   handle_factored_dependencies;
-- 
1.7.12.rc0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]