"Fossies" - the Fresh Open Source Software Archive

Member "automake-1.16.3/t/txinfo-no-clutter.sh" (19 Nov 2020, 3299 Bytes) of package /linux/misc/automake-1.16.3.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "txinfo-no-clutter.sh": 1.16.2_vs_1.16.3.

    1 #! /bin/sh
    2 # Copyright (C) 2012-2020 Free Software Foundation, Inc.
    3 #
    4 # This program is free software; you can redistribute it and/or modify
    5 # it under the terms of the GNU General Public License as published by
    6 # the Free Software Foundation; either version 2, or (at your option)
    7 # any later version.
    8 #
    9 # This program is distributed in the hope that it will be useful,
   10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
   11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   12 # GNU General Public License for more details.
   13 #
   14 # You should have received a copy of the GNU General Public License
   15 # along with this program.  If not, see <https://www.gnu.org/licenses/>.
   16 
   17 # The info, html, pdf, ps and dvi targets shouldn't let clutter in the
   18 # build directory.  Related to automake bug#11146.
   19 
   20 required='makeinfo tex texi2dvi dvips'
   21 . test-init.sh
   22 
   23 cat >> configure.ac <<'END'
   24 AC_CONFIG_FILES([sub/Makefile])
   25 AC_OUTPUT
   26 END
   27 
   28 cat > Makefile.am << 'END'
   29 all-local: ps pdf dvi html # For "make distcheck".
   30 info_TEXINFOS = foo.texi doc/bar.texi baz.texi
   31 SUBDIRS = sub
   32 
   33 # Tell GNU make not to parallelize these, because they
   34 # have overlap between explicit and intermediate .dvi files.
   35 .NOTPARALLEL:
   36 END
   37 
   38 mkdir sub doc
   39 
   40 cat > sub/Makefile.am << 'END'
   41 all-local: ps pdf dvi html # For "make distcheck".
   42 info_TEXINFOS = baz.texi
   43 END
   44 
   45 cat > foo.texi << 'END'
   46 \input texinfo
   47 @setfilename foo.info
   48 @settitle foo
   49 @node Top
   50 Hello walls.
   51 @include version.texi
   52 @bye
   53 END
   54 
   55 cat > doc/bar.texi << 'END'
   56 \input texinfo
   57 @setfilename bar.info
   58 @settitle bar
   59 @node Top
   60 Hello walls.
   61 @include version2.texi
   62 @bye
   63 END
   64 
   65 cat > baz.texi << 'END'
   66 \input texinfo
   67 @setfilename baz.info
   68 @settitle baz
   69 @defindex au
   70 @defindex sa
   71 @defindex sb
   72 @node Top
   73 Hello walls.
   74 @cindex foo
   75 foo
   76 @pindex bar
   77 bar
   78 @auindex baz
   79 baz
   80 @saindex sa
   81 sa
   82 @sbindex sb
   83 sb
   84 @bye
   85 END
   86 
   87 cp baz.texi sub
   88 
   89 $ACLOCAL
   90 $AUTOMAKE --add-missing
   91 $AUTOCONF
   92 
   93 ./configure
   94 
   95 # Try one by one, to ensure later targets don't involuntarily
   96 # clean up potential cruft left by earlier ones.
   97 for fmt in info pdf ps dvi html all; do
   98   $MAKE $fmt
   99   # For debugging.
  100   ls -l . doc sub
  101   # Sanity check.
  102   case $fmt in
  103     html)
  104       test -e foo.html
  105       test -e doc/bar.html
  106       test -e baz.html
  107       test -e sub/baz.html
  108       ;;
  109     all)
  110       for x in info pdf ps dvi; do
  111         test -f foo.$x
  112         test -f doc/bar.$x
  113         test -f baz.$x
  114         test -f sub/baz.$x
  115       done
  116       test -e foo.html
  117       test -e doc/bar.html
  118       test -e baz.html
  119       test -e sub/baz.html
  120       ;;
  121     *)
  122       test -f foo.$fmt
  123       test -f doc/bar.$fmt
  124       test -f baz.$fmt
  125       test -f sub/baz.$fmt
  126       ;;
  127   esac
  128   # Real test.
  129   ls -d foo* baz* sub/baz* doc/bar* > lst
  130   basename_rx='(foo|doc/bar|baz|sub/baz)'
  131   case $fmt in
  132     pdf) extension_rx="(texi|pdf|t2p)";;
  133     dvi) extension_rx="(texi|dvi|t2d)";;
  134      ps) extension_rx="(texi|ps|dvi|t2d)";;
  135    info) extension_rx="(texi|info)";;
  136    html) extension_rx="(texi|html)";;
  137     all) extension_rx="(texi|html|info|pdf|ps|dvi|t2[pd])";;
  138       *) fatal_ "unreachable code reached";;
  139   esac
  140   $EGREP -v "^$basename_rx\.$extension_rx$" lst && exit 1
  141   # Cleanup for checks on the next format.
  142   case $fmt in
  143     info) rm -f *.info doc/*.info sub/*.info;;
  144        *) $MAKE clean;;
  145   esac
  146 done
  147 
  148 $MAKE distcheck
  149 
  150 :