]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
[ng] texi: simplify by always assuming generic rules
authorStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 15 Jun 2012 17:19:37 +0000 (19:19 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 17 Jun 2012 07:35:33 +0000 (09:35 +0200)
They are assured to work with GNU make even when the '.texi' source
lies in a subdirectory, because in that case also the corresponding
output files ('.pdf', '.ps', '.dvi' and '.html') lies in the same
subdirectory.

* automake.in (output_texinfo_build_rules): Don't define the Boolean
'$generic' anymore.  Related simplifications.  Drop the 'SOURCE' and
'GENERIC' transforms when processing the 'texibuild.am' file.  Remove
obsolete comments.
* lib/am/texibuild.am: Adjust by always assuming that '?GENERIC?'
is true.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
automake.in
lib/am/texibuild.am

index c3a9848da3948cb5715179fb1f2635aef0064d26..45f70ebcc8856a1a8939df67647f3f824b7f67f7 100644 (file)
@@ -2859,38 +2859,11 @@ sub output_texinfo_build_rules ($$$@)
   $ssfx ||= "";
   $dsfx ||= "";
 
-  # We can output two kinds of rules: the "generic" rules use pattern
-  # rules and are appropriate when $source and $dest do not lie in a
-  # sub-directory; the "specific" rules are needed in the other case.
-  #
-  # The former are output only once (this is not really apparent here,
-  # but just remember that some logic deeper in Automake will not
-  # output the same rule twice); while the later need to be output for
-  # each Texinfo source.
-  my $generic;
-  my $makeinfoflags;
   my $sdir = dirname $source;
-  if ($sdir eq '.' && dirname ($dest) eq '.')
-    {
-      $generic = 1;
-      $makeinfoflags = '-I $(srcdir)';
-    }
-  else
-    {
-      $generic = 0;
-      $makeinfoflags = "-I $sdir -I \$(srcdir)/$sdir";
-    }
-
-  # A directory can contain two kinds of info files: some built in the
-  # source tree, and some built in the build tree.  The rules are
-  # different in each case.  However we cannot output two different
-  # set of generic rules.  Because in-source builds are more usual, we
-  # use generic rules in this case and fall back to "specific" rules
-  # for build-dir builds.  (It should not be a problem to invert this
-  # if needed.)
-  $generic = 0 unless $insrc;
-
   my $dipfx = ($insrc ? '$(srcdir)/' : '') . $dpfx;
+  my $makeinfoflags = ($sdir eq '.' && dirname ($dest) eq '.')
+                      ? '-I $(srcdir)'
+                      : "-I $sdir -I \$(srcdir)/$sdir";
 
   $output_rules .= file_contents ('texibuild',
                                  new Automake::Location,
@@ -2901,11 +2874,8 @@ sub output_texinfo_build_rules ($$$@)
                                  DEST_PREFIX      => $dpfx,
                                  DEST_INFO_PREFIX => $dipfx,
                                  DEST_SUFFIX      => $dsfx,
-                                 GENERIC          => $generic,
                                  INSRC            => $insrc,
                                  MAKEINFOFLAGS    => $makeinfoflags,
-                                 SOURCE           => ($generic
-                                                      ? '$<' : $source),
                                  SOURCE_REAL      => $source,
                                  SOURCE_SUFFIX    => $ssfx,
                                   TEXIQUIET        => verbose_flag('texinfo'),
index 735b2d87fce2b6424cca1aeb464333d2b4efd70d..aef650a7fb0b63d0ac9354d697c0cdec214c931c 100644 (file)
@@ -49,8 +49,7 @@
 
 INFO_DEPS += %DEST_INFO_PREFIX%%DEST_SUFFIX%
 
-?GENERIC?%.dvi: %%SOURCE_SUFFIX%
-?!GENERIC?%DEST_PREFIX%.dvi: %SOURCE% %DEPS%
+%.dvi: %%SOURCE_SUFFIX%
        %AM_V_TEXI2DVI%$(am__ensure_target_dir_exists) && \
        TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
 ## Must set MAKEINFO like this so that version.texi will be found even
@@ -63,8 +62,7 @@ INFO_DEPS += %DEST_INFO_PREFIX%%DEST_SUFFIX%
 ## can assume Texinf 4.9 or later.
        $(TEXI2DVI) %TEXIQUIET% --clean -o $@ $< %TEXIDEVNULL%
 
-?GENERIC?%.pdf: %%SOURCE_SUFFIX%
-?!GENERIC?%DEST_PREFIX%.pdf: %SOURCE% %DEPS%
+%.pdf: %%SOURCE_SUFFIX%
        %AM_V_TEXI2PDF%$(am__ensure_target_dir_exists) && \
        TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
 ## Must set MAKEINFO like this so that version.texi will be found even
@@ -77,8 +75,7 @@ INFO_DEPS += %DEST_INFO_PREFIX%%DEST_SUFFIX%
 ## can assume Texinf 4.9 or later.
        $(TEXI2PDF) %TEXIQUIET% --clean -o $@ $< %TEXIDEVNULL%
 
-?GENERIC?%.html: %%SOURCE_SUFFIX%
-?!GENERIC?%DEST_PREFIX%.html: %SOURCE% %DEPS%
+%.html: %%SOURCE_SUFFIX%
        %SILENT%$(am__ensure_target_dir_exists)
 ## When --split (the default) is used, makeinfo will output a
 ## directory.  However it will not update the time stamp of a
@@ -101,10 +98,7 @@ INFO_DEPS += %DEST_INFO_PREFIX%%DEST_SUFFIX%
          exit 1; \
        fi
 
-## If we are using the generic rules, we need separate dependencies.
 %DEST_INFO_PREFIX%%DEST_SUFFIX%: %SOURCE_REAL% %DEPS%
-if %?GENERIC%
 %DEST_PREFIX%.dvi: %SOURCE_REAL% %DEPS%
 %DEST_PREFIX%.pdf: %SOURCE_REAL% %DEPS%
 %DEST_PREFIX%.html: %SOURCE_REAL% %DEPS%
-endif %?GENERIC%