summaryrefslogtreecommitdiff
path: root/lib/Automake/SilentRules.pm
diff options
context:
space:
mode:
authorMatthias Paulmier <matthias.paulmier@etu.u-bordeaux.fr>2018-06-20 16:57:02 +0200
committerMatthias Paulmier <matthias.paulmier@etu.u-bordeaux.fr>2018-06-22 14:20:37 +0200
commitfb62d77e15dabcc9faa5db14007191bd9bb9059f (patch)
tree9ae486a68de1175a47629e0e1fbb3462da6f64bd /lib/Automake/SilentRules.pm
parentdc79cd192751c0022a21c1d8b4fc57afa845ee3e (diff)
downloadautomake-fb62d77e15dabcc9faa5db14007191bd9bb9059f.tar.gz
lib: Add new modules
In an effort to move out as much as possible from the main script, we create these modules to host the methods. * LangHandling: This module host all the functions for handling languages (functions that define obj directories of the language, rewrite the file extention...). * SilentRules: Declares functions for handling silent rules. * Requires: Functions for requiring configuration files.
Diffstat (limited to 'lib/Automake/SilentRules.pm')
-rw-r--r--lib/Automake/SilentRules.pm73
1 files changed, 73 insertions, 0 deletions
diff --git a/lib/Automake/SilentRules.pm b/lib/Automake/SilentRules.pm
new file mode 100644
index 000000000..70729160d
--- /dev/null
+++ b/lib/Automake/SilentRules.pm
@@ -0,0 +1,73 @@
+package Automake::SilentRules;
+
+use Automake::Utils;
+use Automake::Variable;
+use Exporter;
+
+use vars '@ISA', '@EXPORT';
+
+@ISA = qw (Exporter);
+
+@EXPORT = qw (verbose_flag verbose_nodep_flag silent_flag
+ define_verbose_texinfo define_verbose_libtool
+ handle_silent);
+
+# Silent rules handling functions.
+
+# verbose_flag (NAME)
+# -------------------
+# Contents of '%VERBOSE%' variable to expand before rule command.
+sub verbose_flag
+{
+ my ($name) = @_;
+ return '$(' . verbose_var ($name) . ')';
+}
+
+sub verbose_nodep_flag
+{
+ my ($name) = @_;
+ return '$(' . verbose_var ($name) . subst ('am__nodep') . ')';
+}
+
+# silent_flag
+# -----------
+# Contents of %SILENT%: variable to expand to '@' when silent.
+sub silent_flag ()
+{
+ return verbose_flag ('at');
+}
+
+# Engage the needed silent rules machinery for assorted texinfo commands.
+sub define_verbose_texinfo ()
+{
+ my @tagvars = ('DVIPS', 'MAKEINFO', 'INFOHTML', 'TEXI2DVI', 'TEXI2PDF');
+ foreach my $tag (@tagvars)
+ {
+ define_verbose_tagvar($tag);
+ }
+ define_verbose_var('texinfo', '-q');
+ define_verbose_var('texidevnull', '> /dev/null');
+}
+
+# Engage the needed silent rules machinery for 'libtool --silent'.
+sub define_verbose_libtool ()
+{
+ define_verbose_var ('lt', '--silent');
+ return verbose_flag ('lt');
+}
+
+sub handle_silent ()
+{
+ # Define "$(AM_V_P)", expanding to a shell conditional that can be
+ # used in make recipes to determine whether we are being run in
+ # silent mode or not. The choice of the name derives from the LISP
+ # convention of appending the letter 'P' to denote a predicate (see
+ # also "the '-P' convention" in the Jargon File); we do so for lack
+ # of a better convention.
+ define_verbose_var ('P', 'false', ':');
+ # *Always* provide the user with '$(AM_V_GEN)', unconditionally.
+ define_verbose_tagvar ('GEN');
+ define_verbose_var ('at', '@');
+}
+
+1;