automake-ng
[Top][All Lists]
Advanced

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

Re: [Automake-NG] [PATCH 06/26] [ng] texi: be sure to only emit generic


From: Akim Demaille
Subject: Re: [Automake-NG] [PATCH 06/26] [ng] texi: be sure to only emit generic pattern rules once
Date: Sun, 17 Jun 2012 08:48:31 +0200

Le 16 juin 2012 à 23:29, Stefano Lattarini a écrit :

> @@ -3183,6 +3177,20 @@ sub handle_texinfo ()
>   if ($info_texinfos)
>     {
>       define_verbose_texinfo;
> +      # Keep this list in sync with the $infobase transform done
> +      # in &handle_texinfo_helper.
> +      foreach my $valid_texinfo_suf (qw/texi texinfo txi/)

Wow.

> +        {
> +          $output_rules .= file_contents (
> +              'texibuild', new Automake::Location,
> +              AM_V_MAKEINFO    => verbose_flag('MAKEINFO'),
> +              AM_V_TEXI2DVI    => verbose_flag('TEXI2DVI'),
> +              AM_V_TEXI2PDF    => verbose_flag('TEXI2PDF'),
> +              TEXIQUIET        => verbose_flag('texinfo'),
> +              TEXIDEVNULL      => verbose_flag('texidevnull'),

These guys look like potential $(call am_v_gen,MAKEINFO) etc.

> +              'TEXI-SUFFIX'    => $valid_texinfo_suf
> +            );
> +        }
>       ($mostlyclean, $clean, $maintclean) = handle_texinfo_helper 
> ($info_texinfos);
>       chomp $mostlyclean;
>       chomp $clean;
> diff --git a/lib/am/texi-spec.am b/lib/am/texi-spec.am
> new file mode 100644
> index 0000000..de7a1ec
> --- /dev/null
> +++ b/lib/am/texi-spec.am
> @@ -0,0 +1,30 @@
> +## automake - create Makefile.in from Makefile.am
> +## Copyright (C) 2012 Free Software Foundation, Inc.
> +
> +## This program is free software; you can redistribute it and/or modify
> +## it under the terms of the GNU General Public License as published by
> +## the Free Software Foundation; either version 2, or (at your option)
> +## any later version.
> +
> +## This program is distributed in the hope that it will be useful,
> +## but WITHOUT ANY WARRANTY; without even the implied warranty of
> +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +## GNU General Public License for more details.
> +
> +## You should have received a copy of the GNU General Public License
> +## along with this program.  If not, see <http://www.gnu.org/licenses/>.
> +
> +INFO_DEPS += %DEST_INFO_PREFIX%.info
> +
> +%DEST_INFO_PREFIX%%DEST_SUFFIX%: %SOURCE_REAL% %DEPS%
> +?INSRC?%DEST_INFO_PREFIX%%DEST_SUFFIX%: am__info_insrc=yes
> +
> +%DEST_PREFIX%.dvi: %SOURCE_REAL% %DEPS%
> +%DEST_PREFIX%.pdf: %SOURCE_REAL% %DEPS%
> +%DEST_PREFIX%.html: %SOURCE_REAL% %DEPS%
> +
> +%DEST_INFO_PREFIX%%DEST_SUFFIX% \
> +%DEST_PREFIX%.dvi \
> +%DEST_PREFIX%.pdf \
> +%DEST_PREFIX%.html \
> +: am__makeinfoflags = %MAKEINFOFLAGS%
> diff --git a/lib/am/texibuild.am b/lib/am/texibuild.am
> index dad84f3..b4b6091 100644
> --- a/lib/am/texibuild.am
> +++ b/lib/am/texibuild.am
> @@ -14,7 +14,7 @@
> ## You should have received a copy of the GNU General Public License
> ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
> 
> -%.info: %%SOURCE_SUFFIX%
> +%.info: %.%TEXI-SUFFIX%
>       $(if $(am__info_insrc),,@$(am__ensure_target_dir_exists))
> ## Back up the info files before running makeinfo. This is the cheapest
> ## way to ensure that
> @@ -48,9 +48,7 @@
>       fi; \
>       rm -rf $$backupdir; exit $$rc
> 
> -INFO_DEPS += %DEST_INFO_PREFIX%.info
> -
> -%.dvi: %%SOURCE_SUFFIX%
> +%.dvi: %.%TEXI-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,7 +61,7 @@ INFO_DEPS += %DEST_INFO_PREFIX%.info
> ## can assume Texinf 4.9 or later.
>       $(TEXI2DVI) %TEXIQUIET% --clean -o $@ $< %TEXIDEVNULL%
> 
> -%.pdf: %%SOURCE_SUFFIX%
> +%.pdf: %.%TEXI-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
> @@ -76,7 +74,7 @@ INFO_DEPS += %DEST_INFO_PREFIX%.info
> ## can assume Texinf 4.9 or later.
>       $(TEXI2PDF) %TEXIQUIET% --clean -o $@ $< %TEXIDEVNULL%
> 
> -%.html: %%SOURCE_SUFFIX%
> +%.html: %.%TEXI-SUFFIX%
>       %AM_V_MAKEINFO%$(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
> @@ -99,16 +97,3 @@ INFO_DEPS += %DEST_INFO_PREFIX%.info
>           rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \
>         exit 1; \
>       fi
> -
> -%DEST_INFO_PREFIX%.info: %SOURCE_REAL% %DEPS%
> -?INSRC?%DEST_INFO_PREFIX%.info: am__info_insrc=yes
> -
> -%DEST_PREFIX%.dvi: %SOURCE_REAL% %DEPS%
> -%DEST_PREFIX%.pdf: %SOURCE_REAL% %DEPS%
> -%DEST_PREFIX%.html: %SOURCE_REAL% %DEPS%
> -
> -%DEST_INFO_PREFIX%.info \
> -%DEST_PREFIX%.dvi \
> -%DEST_PREFIX%.pdf \
> -%DEST_PREFIX%.html \
> -: am__makeinfoflags = %MAKEINFOFLAGS%
> diff --git a/t/txinfo-rules-once.sh b/t/txinfo-rules-once.sh
> new file mode 100755
> index 0000000..d15ecbc
> --- /dev/null
> +++ b/t/txinfo-rules-once.sh
> @@ -0,0 +1,36 @@
> +#! /bin/sh
> +# Copyright (C) 2003-2012 Free Software Foundation, Inc.
> +#
> +# This program is free software; you can redistribute it and/or modify
> +# it under the terms of the GNU General Public License as published by
> +# the Free Software Foundation; either version 2, or (at your option)
> +# any later version.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program.  If not, see <http://www.gnu.org/licenses/>.
> +
> +# Some grepping checks on Texinfo support.
> +
> +. ./defs || Exit 1
> +
> +echo AC_OUTPUT >> configure.ac
> +
> +$ACLOCAL
> +
> +: > texinfo.tex
> +
> +echo info_TEXINFOS = main.texi other.texi sub/x.texi > Makefile.am
> +mkdir sub
> +echo @setfilename main.info > main.texi
> +echo @setfilename other.info > other.texi
> +echo @setfilename sub/x.info > sub/x.texi
> +$AUTOMAKE
> +$EGREP '\.(info|texi)' Makefile.in # For debugging.
> +test $(grep -c '^%\.info: %\.texi$' Makefile.in) -eq 1
> +
> +:
> -- 
> 1.7.9.5
> 
> 




reply via email to

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