From: Tom Tromey Date: Tue, 24 Feb 1998 19:37:14 +0000 (+0000) Subject: reimplemented man pages X-Git-Tag: Release-1-2g~12 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=d8425d370dc0535f5435e69ef11cee0f36d35d67;p=automake.git reimplemented man pages --- diff --git a/ChangeLog b/ChangeLog index cb698488..f0aef290 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +Tue Feb 24 12:10:44 1998 Tom Tromey + + * Makefile.am (pkgdata_DATA): Added mans.am. + * automake.in (handle_man_pages): Rewrote for new man page + handling. + (initialize_global_constants): Removed install_man_format, + uninstall_man_format. + * mans.am: New file. + + * data.am, header.am, libs.am, lisp.am, ltlib.am, progs.am, + scripts.am, texinfos.am: Put `@' before NORMAL_UNINSTALL + invocation. + Mon Feb 23 13:38:56 1998 Tom Tromey * automake.in (get_object_extension): Remove .c.lo rule from diff --git a/Makefile.am b/Makefile.am index b0203864..b54f88f9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -15,7 +15,7 @@ libtool.am ltlib.am ltlibrary.am mans-vars.am program.am progs.am \ remake-hdr.am remake.am scripts.am subdirs.am tags.am tags-clean.am \ texi-vers.am texinfos.am libs-clean.am ltlib-clean.am progs-clean.am \ data-clean.am COPYING INSTALL texinfo.tex ansi2knr.c ansi2knr.1 \ -lisp.am lisp-clean.am +lisp.am lisp-clean.am mans.am ## These must all be executable when installed. pkgdata_SCRIPTS = config.guess config.sub install-sh mdate-sh missing \ diff --git a/Makefile.in b/Makefile.in index f3a76159..a206dd1a 100644 --- a/Makefile.in +++ b/Makefile.in @@ -76,7 +76,7 @@ libtool.am ltlib.am ltlibrary.am mans-vars.am program.am progs.am \ remake-hdr.am remake.am scripts.am subdirs.am tags.am tags-clean.am \ texi-vers.am texinfos.am libs-clean.am ltlib-clean.am progs-clean.am \ data-clean.am COPYING INSTALL texinfo.tex ansi2knr.c ansi2knr.1 \ -lisp.am lisp-clean.am +lisp.am lisp-clean.am mans.am pkgdata_SCRIPTS = config.guess config.sub install-sh mdate-sh missing \ mkinstalldirs elisp-comp ylwrap acinstall @@ -112,7 +112,7 @@ GZIP = --best default: all .SUFFIXES: -.SUFFIXES: .dvi .info .ps .texi .texinfo +.SUFFIXES: .dvi .info .ps .texi .texinfo .txi $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnits Makefile @@ -226,6 +226,20 @@ DVIPS = dvips .texinfo.dvi: TEXINPUTS=$(srcdir):$$TEXINPUTS \ MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< + +.txi.info: + @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] + cd $(srcdir) \ + && $(MAKEINFO) `echo $< | sed 's,.*/,,'` + +.txi.dvi: + TEXINPUTS=$(srcdir):$$TEXINPUTS \ + MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< + +.txi: + @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] + cd $(srcdir) \ + && $(MAKEINFO) `echo $< | sed 's,.*/,,'` .dvi.ps: $(DVIPS) $< -o $@ @@ -362,7 +376,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) done; \ list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ - awk ' { files[$$0] = 1; } \ + $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) diff --git a/automake.in b/automake.in index 0a557d79..49ad8726 100755 --- a/automake.in +++ b/automake.in @@ -2195,64 +2195,62 @@ sub handle_man_pages if &variable_defined ('MANS'); return if ! &variable_defined ('man_MANS'); - # We generate the manpage install code by hand to avoid the use of - # basename in the generated Makefile. - local (@mans) = &variable_value_as_list ('man_MANS', 'all'); - local (%sections, %inames, %mbases, %secmap, %fullsecmap); - local ($i) = 1; - foreach (@mans) - { - # FIXME: statement without effect: - /^(.*)\.([0-9])([a-z]*)$/; - $sections{$2} = 1; - $inames{$i} = $_; - $mbases{$i} = $1; - $secmap{$i} = $2; - $fullsecmap{$i} = $2 . $3; - $i++; - } - - # We don't really need this, but we use it in case we ever want to - # support noinst_MANS. - &define_variable ("MANS", &variable_value ('man_MANS')); - - # Generate list of install dirs. - $output_rules .= "install-man: \$(MANS)\n"; - $output_rules .= "\t\$(NORMAL_INSTALL)\n"; - # Sort keys so that output is deterministic. - foreach (sort keys %sections) + # Find all the sections in use. We do this by first looking for + # "standard" sections, and then looking for any additional + # sections used in man_MANS. + local ($sect, %sections, %vlist); + # Add more sections as needed. + foreach $sect ('0'..'9', 'n', 'l') { - push (@installdirs, '$(mandir)/man' . $_) - unless defined $options{'no-installman'}; - $output_rules .= ("\t" . '$(mkinstalldirs) $(mandir)/man' - . $_ . "\n"); + if (&variable_defined ('man' . $sect . '_MANS')) + { + $sections{$sect} = 1; + $vlist{'$(man' . $sect . '_MANS)'} = 1; + } } - push (@phony, 'install-man'); - # Generate install target. - local ($key); - foreach $key (sort keys %inames) + if (&variable_defined ('man_MANS')) { - $_ = $install_man_format; - s/\@SECTION\@/$secmap{$key}/g; - s/\@MAN\@/$inames{$key}/g; - s/\@FULLSECT\@/$fullsecmap{$key}/g; - s/\@MANBASE\@/$mbases{$key}/g; - $output_rules .= $_; + $vlist{'$(man_MANS)'} = 1; + foreach (&variable_value_as_list ('man_MANS', 'all')) + { + # A page like `foo.1c' goes into man1dir. + if (/\.([0-9a-z])([a-z]*)$/) + { + $sections{$1} = 1; + } + } } - $output_rules .= "\n"; - $output_rules .= "uninstall-man:\n\t\$(NORMAL_UNINSTALL)\n"; - foreach $key (sort keys %inames) + + # Now for each section, generate an install and unintall rule. + # Sort sections so output is deterministic. + local (@namelist); + foreach $sect (sort keys %sections) { - $_ = $uninstall_man_format; - s/\@SECTION\@/$secmap{$key}/g; - s/\@MAN\@/$inames{$key}/g; - s/\@FULLSECT\@/$fullsecmap{$key}/g; - s/\@MANBASE\@/$mbases{$key}/g; - $output_rules .= $_; + &define_variable ('man' . $sect . 'dir', '$(mandir)/man' . $sect); + push (@installdirs, '$(mandir)/man' . $sect) + unless defined $options{'no-installman'}; + $output_rules .= &file_contents_with_transform ('s/\@SECTION\@/' + . $sect . '/g;', + 'mans'); + push (@phony, 'install-man' . $sect, 'uninstall-man' . $sect); + push (@namelist, 'install-man' . $sect); } - $output_rules .= "\n"; + + # We don't really need this, but we use it in case we ever want to + # support noinst_MANS. + &define_variable ("MANS", join (' ', sort keys %vlist)); + + # Generate list of install dirs. + $output_rules .= ("install-man: \$(MANS)\n" + . "\t\@\$(NORMAL_INSTALL)\n"); + &pretty_print_rule ("\t\$(MAKE)", "\t ", @namelist); + push (@phony, 'install-man'); + + $output_rules .= "uninstall-man:\n\t\@\$(NORMAL_UNINSTALL)\n"; + grep ($_ = 'un' . $_, @namelist); + &pretty_print_rule ("\t\$(MAKE)", "\t ", @namelist); push (@phony, 'uninstall-man'); $output_vars .= &file_contents ('mans-vars'); @@ -5346,21 +5344,6 @@ sub initialize_global_constants 'pkginclude', 0 ); - # Helper text for dealing with man pages. - $install_man_format = - ' @sect=@SECTION@; \\ - inst=`echo "@MANBASE@" | sed \'$(transform)\'`.@FULLSECT@; \\ - if test -f $(srcdir)/@MAN@; then file=$(srcdir)/@MAN@; \\ - else file=@MAN@; fi; \\ - echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \\ - $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst -'; - - $uninstall_man_format = - ' -inst=`echo "@MANBASE@" | sed \'$(transform)\'`.@FULLSECT@; \\ - rm -f $(mandir)/man@SECTION@/$$inst -'; - # Commonly found files we look for and automatically include in # DISTFILES. @common_files = diff --git a/data.am b/data.am index 942b1547..6a88c846 100644 --- a/data.am +++ b/data.am @@ -1,5 +1,5 @@ ## automake - create Makefile.in from Makefile.am -## Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. +## Copyright (C) 1994, 1995, 1996, 1998 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 @@ -31,7 +31,7 @@ install-@DIR@DATA: $(@DIR@_DATA) done uninstall-@DIR@DATA: - $(NORMAL_UNINSTALL) + @$(NORMAL_UNINSTALL) list='$(@DIR@_DATA)'; for p in $$list; do \ rm -f $(@DIR@dir)/$$p; \ done diff --git a/header.am b/header.am index f5e971c6..80a50f0c 100644 --- a/header.am +++ b/header.am @@ -1,5 +1,5 @@ ## automake - create Makefile.in from Makefile.am -## Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. +## Copyright (C) 1994, 1995, 1996, 1998 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 @@ -26,7 +26,7 @@ install-@DIR@HEADERS: $(@DIR@_HEADERS) done uninstall-@DIR@HEADERS: - $(NORMAL_UNINSTALL) + @$(NORMAL_UNINSTALL) list='$(@DIR@_HEADERS)'; for p in $$list; do \ rm -f $(@DIR@dir)/$$p; \ done diff --git a/lib/am/Makefile.am b/lib/am/Makefile.am index b0203864..b54f88f9 100644 --- a/lib/am/Makefile.am +++ b/lib/am/Makefile.am @@ -15,7 +15,7 @@ libtool.am ltlib.am ltlibrary.am mans-vars.am program.am progs.am \ remake-hdr.am remake.am scripts.am subdirs.am tags.am tags-clean.am \ texi-vers.am texinfos.am libs-clean.am ltlib-clean.am progs-clean.am \ data-clean.am COPYING INSTALL texinfo.tex ansi2knr.c ansi2knr.1 \ -lisp.am lisp-clean.am +lisp.am lisp-clean.am mans.am ## These must all be executable when installed. pkgdata_SCRIPTS = config.guess config.sub install-sh mdate-sh missing \ diff --git a/lib/am/data.am b/lib/am/data.am index 942b1547..6a88c846 100644 --- a/lib/am/data.am +++ b/lib/am/data.am @@ -1,5 +1,5 @@ ## automake - create Makefile.in from Makefile.am -## Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. +## Copyright (C) 1994, 1995, 1996, 1998 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 @@ -31,7 +31,7 @@ install-@DIR@DATA: $(@DIR@_DATA) done uninstall-@DIR@DATA: - $(NORMAL_UNINSTALL) + @$(NORMAL_UNINSTALL) list='$(@DIR@_DATA)'; for p in $$list; do \ rm -f $(@DIR@dir)/$$p; \ done diff --git a/lib/am/header.am b/lib/am/header.am index f5e971c6..80a50f0c 100644 --- a/lib/am/header.am +++ b/lib/am/header.am @@ -1,5 +1,5 @@ ## automake - create Makefile.in from Makefile.am -## Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. +## Copyright (C) 1994, 1995, 1996, 1998 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 @@ -26,7 +26,7 @@ install-@DIR@HEADERS: $(@DIR@_HEADERS) done uninstall-@DIR@HEADERS: - $(NORMAL_UNINSTALL) + @$(NORMAL_UNINSTALL) list='$(@DIR@_HEADERS)'; for p in $$list; do \ rm -f $(@DIR@dir)/$$p; \ done diff --git a/lib/am/libs.am b/lib/am/libs.am index 4f1de658..cfb8e553 100644 --- a/lib/am/libs.am +++ b/lib/am/libs.am @@ -1,5 +1,5 @@ ## automake - create Makefile.in from Makefile.am -## Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. +## Copyright (C) 1994, 1995, 1996, 1998 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 @@ -41,7 +41,7 @@ install-@DIR@LIBRARIES: $(@DIR@_LIBRARIES) done uninstall-@DIR@LIBRARIES: - $(NORMAL_UNINSTALL) + @$(NORMAL_UNINSTALL) list='$(@DIR@_LIBRARIES)'; for p in $$list; do \ rm -f $(@DIR@dir)/$$p; \ done diff --git a/lib/am/lisp.am b/lib/am/lisp.am index a431a032..44e0b854 100644 --- a/lib/am/lisp.am +++ b/lib/am/lisp.am @@ -1,5 +1,5 @@ ## automake - create Makefile.in from Makefile.am -## Copyright (C) 1996 Free Software Foundation, Inc. +## Copyright (C) 1996, 1998 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 @@ -31,7 +31,7 @@ install-@DIR@LISP: $(@DIR@_LISP) $(ELCFILES) done uninstall-@DIR@LISP: - $(NORMAL_UNINSTALL) + @$(NORMAL_UNINSTALL) list='$(@DIR@_LISP)'; for p in $$list; do \ rm -f $(@DIR@dir)/$$p $(@DIR@dir)/$${p}c; \ done diff --git a/lib/am/ltlib.am b/lib/am/ltlib.am index fd3f7991..23ae30e4 100644 --- a/lib/am/ltlib.am +++ b/lib/am/ltlib.am @@ -1,5 +1,5 @@ ## automake - create Makefile.in from Makefile.am -## Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc. +## Copyright (C) 1994, 1995, 1996, 1997, 1998 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 @@ -30,7 +30,7 @@ install-@DIR@LTLIBRARIES: $(@DIR@_LTLIBRARIES) done uninstall-@DIR@LTLIBRARIES: - $(NORMAL_UNINSTALL) + @$(NORMAL_UNINSTALL) list='$(@DIR@_LTLIBRARIES)'; for p in $$list; do \ @LIBTOOL --mode=uninstall@ rm -f $(@DIR@dir)/$$p; \ done diff --git a/lib/am/mans.am b/lib/am/mans.am new file mode 100644 index 00000000..7970ef06 --- /dev/null +++ b/lib/am/mans.am @@ -0,0 +1,61 @@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 1998 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, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. +install-man@SECTION@: + $(mkinstalldirs) $(man@SECTION@dir) + @list='$(man@SECTION@_MANS)'; \ +## Extract all items from man_MANS that should go in this section. +## This must be done dynamically to support conditionals. + l2='$(man_MANS)'; for i in $$l2; do \ + case "$$i" in \ +## Have to accept files like `foo.1c'. + *.@SECTION@*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ +## Find the file. + if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ + else file=$$i; fi; \ +## Extract basename of man page and run it through the program rename +## transform. + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$//'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " $(INSTALL_DATA) $$file $(man@SECTION@dir)/$$inst"; \ + $(INSTALL_DATA) $$file $(man@SECTION@dir)/$$inst; \ + done + +## This is just completely gross. +uninstall-man@SECTION@: + @list='$(man@SECTION@_MANS)'; \ +## Extract all items from man_MANS that should go in this section. +## This must be done dynamically to support conditionals. + l2='$(man_MANS)'; for i in $$l2; do \ + case "$$i" in \ +## Have to accept files like `foo.1c'. + *.@SECTION@*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ +## Extract basename of man page and run it through the program rename +## transform. + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$//'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " rm -f $(man@SECTION@dir)/$$inst"; \ + rm -f $(man@SECTION@dir)/$$inst; \ + done diff --git a/lib/am/progs.am b/lib/am/progs.am index 51ede2c3..418cee5f 100644 --- a/lib/am/progs.am +++ b/lib/am/progs.am @@ -1,5 +1,5 @@ ## automake - create Makefile.in from Makefile.am -## Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc. +## Copyright (C) 1994, 1995, 1996, 1997, 1998 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 @@ -31,7 +31,7 @@ install-@DIR@PROGRAMS: $(@DIR@_PROGRAMS) done uninstall-@DIR@PROGRAMS: - $(NORMAL_UNINSTALL) + @$(NORMAL_UNINSTALL) list='$(@DIR@_PROGRAMS)'; for p in $$list; do \ rm -f $(@DIR@dir)/`echo $$p|sed '$(transform)'`; \ done diff --git a/lib/am/scripts.am b/lib/am/scripts.am index 083a944e..dc41c3ba 100644 --- a/lib/am/scripts.am +++ b/lib/am/scripts.am @@ -1,5 +1,5 @@ ## automake - create Makefile.in from Makefile.am -## Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. +## Copyright (C) 1994, 1995, 1996, 1998 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 @@ -31,7 +31,7 @@ install-@DIR@SCRIPTS: $(@DIR@_SCRIPTS) done uninstall-@DIR@SCRIPTS: - $(NORMAL_UNINSTALL) + @$(NORMAL_UNINSTALL) list='$(@DIR@_SCRIPTS)'; for p in $$list; do \ rm -f $(@DIR@dir)/`echo $$p|sed '$(transform)'`; \ done diff --git a/lib/am/texinfos.am b/lib/am/texinfos.am index f61b7dcb..8979d9a1 100644 --- a/lib/am/texinfos.am +++ b/lib/am/texinfos.am @@ -181,7 +181,7 @@ uninstall-info: test -z "$ii" \ || install-info --info-dir=$(infodir) --remove $$file; \ done - $(NORMAL_UNINSTALL) + @$(NORMAL_UNINSTALL) for file in $(INFO_DEPS); do \ (cd $(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \ done diff --git a/libs.am b/libs.am index 4f1de658..cfb8e553 100644 --- a/libs.am +++ b/libs.am @@ -1,5 +1,5 @@ ## automake - create Makefile.in from Makefile.am -## Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. +## Copyright (C) 1994, 1995, 1996, 1998 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 @@ -41,7 +41,7 @@ install-@DIR@LIBRARIES: $(@DIR@_LIBRARIES) done uninstall-@DIR@LIBRARIES: - $(NORMAL_UNINSTALL) + @$(NORMAL_UNINSTALL) list='$(@DIR@_LIBRARIES)'; for p in $$list; do \ rm -f $(@DIR@dir)/$$p; \ done diff --git a/lisp.am b/lisp.am index a431a032..44e0b854 100644 --- a/lisp.am +++ b/lisp.am @@ -1,5 +1,5 @@ ## automake - create Makefile.in from Makefile.am -## Copyright (C) 1996 Free Software Foundation, Inc. +## Copyright (C) 1996, 1998 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 @@ -31,7 +31,7 @@ install-@DIR@LISP: $(@DIR@_LISP) $(ELCFILES) done uninstall-@DIR@LISP: - $(NORMAL_UNINSTALL) + @$(NORMAL_UNINSTALL) list='$(@DIR@_LISP)'; for p in $$list; do \ rm -f $(@DIR@dir)/$$p $(@DIR@dir)/$${p}c; \ done diff --git a/ltlib.am b/ltlib.am index fd3f7991..23ae30e4 100644 --- a/ltlib.am +++ b/ltlib.am @@ -1,5 +1,5 @@ ## automake - create Makefile.in from Makefile.am -## Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc. +## Copyright (C) 1994, 1995, 1996, 1997, 1998 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 @@ -30,7 +30,7 @@ install-@DIR@LTLIBRARIES: $(@DIR@_LTLIBRARIES) done uninstall-@DIR@LTLIBRARIES: - $(NORMAL_UNINSTALL) + @$(NORMAL_UNINSTALL) list='$(@DIR@_LTLIBRARIES)'; for p in $$list; do \ @LIBTOOL --mode=uninstall@ rm -f $(@DIR@dir)/$$p; \ done diff --git a/mans.am b/mans.am new file mode 100644 index 00000000..7970ef06 --- /dev/null +++ b/mans.am @@ -0,0 +1,61 @@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 1998 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, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. +install-man@SECTION@: + $(mkinstalldirs) $(man@SECTION@dir) + @list='$(man@SECTION@_MANS)'; \ +## Extract all items from man_MANS that should go in this section. +## This must be done dynamically to support conditionals. + l2='$(man_MANS)'; for i in $$l2; do \ + case "$$i" in \ +## Have to accept files like `foo.1c'. + *.@SECTION@*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ +## Find the file. + if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ + else file=$$i; fi; \ +## Extract basename of man page and run it through the program rename +## transform. + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$//'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " $(INSTALL_DATA) $$file $(man@SECTION@dir)/$$inst"; \ + $(INSTALL_DATA) $$file $(man@SECTION@dir)/$$inst; \ + done + +## This is just completely gross. +uninstall-man@SECTION@: + @list='$(man@SECTION@_MANS)'; \ +## Extract all items from man_MANS that should go in this section. +## This must be done dynamically to support conditionals. + l2='$(man_MANS)'; for i in $$l2; do \ + case "$$i" in \ +## Have to accept files like `foo.1c'. + *.@SECTION@*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ +## Extract basename of man page and run it through the program rename +## transform. + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$//'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " rm -f $(man@SECTION@dir)/$$inst"; \ + rm -f $(man@SECTION@dir)/$$inst; \ + done diff --git a/progs.am b/progs.am index 51ede2c3..418cee5f 100644 --- a/progs.am +++ b/progs.am @@ -1,5 +1,5 @@ ## automake - create Makefile.in from Makefile.am -## Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc. +## Copyright (C) 1994, 1995, 1996, 1997, 1998 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 @@ -31,7 +31,7 @@ install-@DIR@PROGRAMS: $(@DIR@_PROGRAMS) done uninstall-@DIR@PROGRAMS: - $(NORMAL_UNINSTALL) + @$(NORMAL_UNINSTALL) list='$(@DIR@_PROGRAMS)'; for p in $$list; do \ rm -f $(@DIR@dir)/`echo $$p|sed '$(transform)'`; \ done diff --git a/scripts.am b/scripts.am index 083a944e..dc41c3ba 100644 --- a/scripts.am +++ b/scripts.am @@ -1,5 +1,5 @@ ## automake - create Makefile.in from Makefile.am -## Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. +## Copyright (C) 1994, 1995, 1996, 1998 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 @@ -31,7 +31,7 @@ install-@DIR@SCRIPTS: $(@DIR@_SCRIPTS) done uninstall-@DIR@SCRIPTS: - $(NORMAL_UNINSTALL) + @$(NORMAL_UNINSTALL) list='$(@DIR@_SCRIPTS)'; for p in $$list; do \ rm -f $(@DIR@dir)/`echo $$p|sed '$(transform)'`; \ done diff --git a/tests/ChangeLog b/tests/ChangeLog index ba0e47e0..c365294a 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,9 @@ +Tue Feb 24 12:29:05 1998 Tom Tromey + + * man.test: Removed. + + * condman2.test: New file. + Mon Feb 23 16:20:49 1998 Tom Tromey * texinfo6.test: New file. diff --git a/tests/Makefile.am b/tests/Makefile.am index 2d7e285b..97e18a6d 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -12,24 +12,23 @@ subdir.test backsl.test package.test number.test insh2.test \ outdir.test fpinstall.test fpinst2.test texinfo.test dejagnu.test \ yacc.test mkinst2.test texinfo2.test ansi.test depacl.test \ depacl2.test error.test colon.test vtexi2.test tags.test comment.test \ -ansi2.test man.test info.test obsolete.test lex.test scripts.test \ -subdir2.test exsource.test canon4.test dup.test defun.test \ -cxxlink.test cxxnoc.test order.test libobj2.test interp.test \ -block.test libobj3.test dup2.test gnits.test interp2.test colneq.test \ -implicit.test spell.test spell2.test confsub.test primary.test \ -primary2.test depend2.test spell3.test comment2.test vpath.test \ -symlink.test discover.test acinclude.test req.test acsilent.test \ -distdir.test libobj4.test libobj5.test version.test ranlib.test \ -confvar.test confvar2.test stdlib.test cxxo.test colon2.test \ -colon3.test remake.test output.test output2.test remake2.test \ -output3.test output4.test colneq2.test subst.test defun2.test \ -yaccpp.test texinfo3.test texinfo4.test tagsub.test cxxlibobj.test \ -seenc.test cygwin32.test lisp.test stamph.test ldadd.test \ -version2.test conf2.test cond.test cond2.test xsource.test \ -libobj6.test depend3.test output5.test ammissing.test install.test \ -libobj7.test objc.test cond3.test cxxcpp.test aclocal.test alpha.test \ -whoami.test unused.test condman.test texinfo5.test aclocali.test \ -texinfo6.test +ansi2.test info.test obsolete.test lex.test scripts.test subdir2.test \ +exsource.test canon4.test dup.test defun.test cxxlink.test cxxnoc.test \ +order.test libobj2.test interp.test block.test libobj3.test dup2.test \ +gnits.test interp2.test colneq.test implicit.test spell.test \ +spell2.test confsub.test primary.test primary2.test depend2.test \ +spell3.test comment2.test vpath.test symlink.test discover.test \ +acinclude.test req.test acsilent.test distdir.test libobj4.test \ +libobj5.test version.test ranlib.test confvar.test confvar2.test \ +stdlib.test cxxo.test colon2.test colon3.test remake.test output.test \ +output2.test remake2.test output3.test output4.test colneq2.test \ +subst.test defun2.test yaccpp.test texinfo3.test texinfo4.test \ +tagsub.test cxxlibobj.test seenc.test cygwin32.test lisp.test \ +stamph.test ldadd.test version2.test conf2.test cond.test cond2.test \ +xsource.test libobj6.test depend3.test output5.test ammissing.test \ +install.test libobj7.test objc.test cond3.test cxxcpp.test \ +aclocal.test alpha.test whoami.test unused.test condman.test \ +texinfo5.test aclocali.test texinfo6.test condman2.test EXTRA_DIST = defs $(TESTS) diff --git a/tests/Makefile.in b/tests/Makefile.in index befd52ff..8a81633f 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -73,24 +73,23 @@ subdir.test backsl.test package.test number.test insh2.test \ outdir.test fpinstall.test fpinst2.test texinfo.test dejagnu.test \ yacc.test mkinst2.test texinfo2.test ansi.test depacl.test \ depacl2.test error.test colon.test vtexi2.test tags.test comment.test \ -ansi2.test man.test info.test obsolete.test lex.test scripts.test \ -subdir2.test exsource.test canon4.test dup.test defun.test \ -cxxlink.test cxxnoc.test order.test libobj2.test interp.test \ -block.test libobj3.test dup2.test gnits.test interp2.test colneq.test \ -implicit.test spell.test spell2.test confsub.test primary.test \ -primary2.test depend2.test spell3.test comment2.test vpath.test \ -symlink.test discover.test acinclude.test req.test acsilent.test \ -distdir.test libobj4.test libobj5.test version.test ranlib.test \ -confvar.test confvar2.test stdlib.test cxxo.test colon2.test \ -colon3.test remake.test output.test output2.test remake2.test \ -output3.test output4.test colneq2.test subst.test defun2.test \ -yaccpp.test texinfo3.test texinfo4.test tagsub.test cxxlibobj.test \ -seenc.test cygwin32.test lisp.test stamph.test ldadd.test \ -version2.test conf2.test cond.test cond2.test xsource.test \ -libobj6.test depend3.test output5.test ammissing.test install.test \ -libobj7.test objc.test cond3.test cxxcpp.test aclocal.test alpha.test \ -whoami.test unused.test condman.test texinfo5.test aclocali.test \ -texinfo6.test +ansi2.test info.test obsolete.test lex.test scripts.test subdir2.test \ +exsource.test canon4.test dup.test defun.test cxxlink.test cxxnoc.test \ +order.test libobj2.test interp.test block.test libobj3.test dup2.test \ +gnits.test interp2.test colneq.test implicit.test spell.test \ +spell2.test confsub.test primary.test primary2.test depend2.test \ +spell3.test comment2.test vpath.test symlink.test discover.test \ +acinclude.test req.test acsilent.test distdir.test libobj4.test \ +libobj5.test version.test ranlib.test confvar.test confvar2.test \ +stdlib.test cxxo.test colon2.test colon3.test remake.test output.test \ +output2.test remake2.test output3.test output4.test colneq2.test \ +subst.test defun2.test yaccpp.test texinfo3.test texinfo4.test \ +tagsub.test cxxlibobj.test seenc.test cygwin32.test lisp.test \ +stamph.test ldadd.test version2.test conf2.test cond.test cond2.test \ +xsource.test libobj6.test depend3.test output5.test ammissing.test \ +install.test libobj7.test objc.test cond3.test cxxcpp.test \ +aclocal.test alpha.test whoami.test unused.test condman.test \ +texinfo5.test aclocali.test texinfo6.test condman2.test EXTRA_DIST = defs $(TESTS) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs diff --git a/tests/condman.test b/tests/condman.test index 446184a0..4559c94d 100755 --- a/tests/condman.test +++ b/tests/condman.test @@ -1,5 +1,6 @@ #! /bin/sh +# Make sure conditionals work with man pages. . $srcdir/defs || exit 1 cat >> configure.in << 'END' diff --git a/tests/condman2.test b/tests/condman2.test new file mode 100755 index 00000000..941b24e2 --- /dev/null +++ b/tests/condman2.test @@ -0,0 +1,15 @@ +#! /bin/sh + +# Make sure appropriate man install targets generated in all cases. +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +man_MANS = foo.1 foo.2 +man5_MANS = foo.5 +END + +$AUTOMAKE || exit 1 + +grep '^install-man1:' Makefile.in || exit 1 +grep '^install-man2:' Makefile.in || exit 1 +grep '^install-man5:' Makefile.in || exit 1 diff --git a/tests/man.test b/tests/man.test deleted file mode 100755 index 2dd46538..00000000 --- a/tests/man.test +++ /dev/null @@ -1,31 +0,0 @@ -#! /bin/sh - -# Test for bug reported by Janos Farkas. -# Multiple man pages with the same basename don't all get installed. - -. $srcdir/defs || exit 1 - -cat > Makefile.am << 'END' -man_MANS = shadow.3 shadow.5 passwd.1 passwd.5 -END - -: > shadow.3 -: > shadow.5 -: > passwd.1 -: > passwd.5 - -$AUTOMAKE || exit 1 - -: > install -chmod +x install - -mkdir man1 man3 man5 - -$MAKE -f Makefile.in mkinstalldirs=: INSTALL_DATA=cp mandir=`pwd` \ - srcdir=`pwd` transform='' install-man \ - || exit 1 - -test -f man3/shadow.3 || exit 1 -test -f man5/shadow.5 || exit 1 -test -f man1/passwd.1 || exit 1 -test -f man5/passwd.5 || exit 1 diff --git a/texinfos.am b/texinfos.am index f61b7dcb..8979d9a1 100644 --- a/texinfos.am +++ b/texinfos.am @@ -181,7 +181,7 @@ uninstall-info: test -z "$ii" \ || install-info --info-dir=$(infodir) --remove $$file; \ done - $(NORMAL_UNINSTALL) + @$(NORMAL_UNINSTALL) for file in $(INFO_DEPS); do \ (cd $(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \ done