* automake.in (handle_ltlibraries): Allow _LDFLAGS to be
[automake.git] / mans.am
blobfb9bafbef6dfd83125005f0f39016e0e1393a9bf
1 ## automake - create Makefile.in from Makefile.am
2 ## Copyright 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 -e 's/^.*\///'`; \
38           inst=`echo $$inst | sed '$(transform)'`.$$ext; \
39           echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man@SECTION@dir)/$$inst"; \
40           $(INSTALL_DATA) $$file $(DESTDIR)$(man@SECTION@dir)/$$inst; \
41         done
43 ## This is just completely gross.
44 uninstall-man@SECTION@:
45         @list='$(man@SECTION@_MANS)'; \
46 ## Extract all items from man_MANS that should go in this section.
47 ## This must be done dynamically to support conditionals.
48         l2='$(man_MANS)'; for i in $$l2; do \
49           case "$$i" in \
50 ## Have to accept files like `foo.1c'.
51             *.@SECTION@*) list="$$list $$i" ;; \
52           esac; \
53         done; \
54         for i in $$list; do \
55 ## Extract basename of man page and run it through the program rename
56 ## transform.
57           ext=`echo $$i | sed -e 's/^.*\\.//'`; \
58           inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
59           inst=`echo $$inst | sed -e 's/^.*\///'`; \
60           inst=`echo $$inst | sed '$(transform)'`.$$ext; \
61           echo " rm -f $(DESTDIR)$(man@SECTION@dir)/$$inst"; \
62           rm -f $(DESTDIR)$(man@SECTION@dir)/$$inst; \
63         done