* automake.in (lang_yacc_finish): $hname must not contain a `.'.
[automake.git] / mans.am
blob6c2401b0328ce3789fe5b9b437c8b737ad87763b
1 ## automake - create Makefile.in from Makefile.am
2 ## Copyright (C) 1998 Free Software Foundation, Inc.
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.
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.
14 ## You should have received a copy of the GNU General Public License
15 ## along with this program; if not, write to the Free Software
16 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
17 ## 02111-1307, USA.
18 install-man@SECTION@:
19         $(mkinstalldirs) $(DESTDIR)$(man@SECTION@dir)
20         @list='$(man@SECTION@_MANS)'; \
21 ## Extract all items from man_MANS that should go in this section.
22 ## This must be done dynamically to support conditionals.
23         l2='$(man_MANS)'; for i in $$l2; do \
24           case "$$i" in \
25 ## Have to accept files like `foo.1c'.
26             *.@SECTION@*) list="$$list $$i" ;; \
27           esac; \
28         done; \
29         for i in $$list; do \
30 ## Find the file.
31           if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
32           else file=$$i; fi; \
33 ## Extract basename of man page and run it through the program rename
34 ## transform.
35           ext=`echo $$i | sed -e 's/^.*\\.//'`; \
36           inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
37           inst=`echo $$inst | sed '$(transform)'`.$$ext; \
38           echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man@SECTION@dir)/$$inst"; \
39           $(INSTALL_DATA) $$file $(DESTDIR)$(man@SECTION@dir)/$$inst; \
40         done
42 ## This is just completely gross.
43 uninstall-man@SECTION@:
44         @list='$(man@SECTION@_MANS)'; \
45 ## Extract all items from man_MANS that should go in this section.
46 ## This must be done dynamically to support conditionals.
47         l2='$(man_MANS)'; for i in $$l2; do \
48           case "$$i" in \
49 ## Have to accept files like `foo.1c'.
50             *.@SECTION@*) list="$$list $$i" ;; \
51           esac; \
52         done; \
53         for i in $$list; do \
54 ## Extract basename of man page and run it through the program rename
55 ## transform.
56           ext=`echo $$i | sed -e 's/^.*\\.//'`; \
57           inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
58           inst=`echo $$inst | sed '$(transform)'`.$$ext; \
59           echo " rm -f $(DESTDIR)$(man@SECTION@dir)/$$inst"; \
60           rm -f $(DESTDIR)$(man@SECTION@dir)/$$inst; \
61         done