1 ## automake - create Makefile.in from Makefile.am
2 ## Copyright (C) 1998, 2001, 2003, 2004, 2006, 2008, 2009 Free Software
5 ## This program is free software; you can redistribute it and/or modify
6 ## it under the terms of the GNU General Public License as published by
7 ## the Free Software Foundation; either version 2, or (at your option)
10 ## This program is distributed in the hope that it will be useful,
11 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ## GNU General Public License for more details.
15 ## You should have received a copy of the GNU General Public License
16 ## along with this program. If not, see <http://www.gnu.org/licenses/>.
19 man%SECTION%dir = $(mandir)/man%SECTION%
25 ## MANS primary are always installed in mandir, hence install-data
29 ?INSTALL-MAN?install-data-am: install-man
30 ?INSTALL-MAN?am__installdirs += "$(DESTDIR)$(man%SECTION%dir)"
31 .PHONY install-man: install-man%SECTION%
32 install-man%SECTION%: %DEPS%
34 test -z "$(man%SECTION%dir)" || $(MKDIR_P) "$(DESTDIR)$(man%SECTION%dir)"
36 ## Handle MANS with notrans_ prefix
37 @list='%NOTRANS_SECT_LIST%'; test -n "$(man%SECTION%dir)" || exit 0; \
38 { for i in $$list; do echo "$$i"; done; \
39 ## Extract all items from notrans_man_MANS that should go in this section.
40 ## This must be done dynamically to support conditionals.
41 ?HAVE_NOTRANS? l2='%NOTRANS_LIST%'; for i in $$l2; do echo "$$i"; done | \
42 ## Accept for `man1' files like `foo.1c' but not `sub.1/foo.2' or `foo-2.1.4'.
43 ?HAVE_NOTRANS? sed -n '/\.%SECTION%[a-z]*$$/p'; \
44 ## Extract basename of manpage, change the extension if needed.
45 } | while read p; do \
47 if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
48 echo "$$d$$p"; echo "$$p"; \
50 ## Extract the basename of the man page and change the extension if needed.
51 sed 'n;s,.*/,,;p;s,\.[^%SECTION%][0-9a-z]*$$,.%SECTION%,' | \
52 sed 'N;N;s,\n, ,g' | { \
53 ## We now have a list "sourcefile basename installed-name".
54 list=; while read file base inst; do \
55 if test "$$base" = "$$inst"; then list="$$list $$file"; else \
56 echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man%SECTION%dir)/$$inst'"; \
57 $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man%SECTION%dir)/$$inst" || exit $$?; \
60 for i in $$list; do echo "$$i"; done | $(am__base_list) | \
61 while read files; do \
62 test -z "$$files" || { \
63 echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man%SECTION%dir)'"; \
64 $(INSTALL_DATA) $$files "$(DESTDIR)$(man%SECTION%dir)" || exit $$?; }; \
68 ## Handle MANS without notrans_ prefix
69 @list='%TRANS_SECT_LIST%'; test -n "$(man%SECTION%dir)" || exit 0; \
70 { for i in $$list; do echo "$$i"; done; \
71 ## Extract all items from notrans_man_MANS that should go in this section.
72 ## This must be done dynamically to support conditionals.
73 ?HAVE_TRANS? l2='%TRANS_LIST%'; for i in $$l2; do echo "$$i"; done | \
74 ## Accept for `man1' files like `foo.1c' but not `sub.1/foo.2' or `foo-2.1.4'.
75 ?HAVE_TRANS? sed -n '/\.%SECTION%[a-z]*$$/p'; \
76 ## Extract basename of manpage, change the extension if needed.
77 } | while read p; do \
79 if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
80 echo "$$d$$p"; echo "$$p"; \
82 ## Extract the basename of the man page and change the extension if needed.
83 sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^%SECTION%][0-9a-z]*$$,%SECTION%,;x' \
84 -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
85 sed 'N;N;s,\n, ,g' | { \
86 ## We now have a list "sourcefile basename installed-name".
87 list=; while read file base inst; do \
88 if test "$$base" = "$$inst"; then list="$$list $$file"; else \
89 echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man%SECTION%dir)/$$inst'"; \
90 $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man%SECTION%dir)/$$inst" || exit $$?; \
93 for i in $$list; do echo "$$i"; done | $(am__base_list) | \
94 while read files; do \
95 test -z "$$files" || { \
96 echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man%SECTION%dir)'"; \
97 $(INSTALL_DATA) $$files "$(DESTDIR)$(man%SECTION%dir)" || exit $$?; }; \
106 .PHONY: uninstall-man
107 ?INSTALL-MAN?uninstall-am: uninstall-man
108 .PHONY uninstall-man: uninstall-man%SECTION%
109 uninstall-man%SECTION%:
112 ## Handle MANS with notrans_ prefix
113 @list='%NOTRANS_SECT_LIST%'; test -n "$(man%SECTION%dir)" || exit 0; \
114 files=`{ for i in $$list; do echo "$$i"; done; \
115 ## Extract all items from notrans_man_MANS that should go in this section.
116 ## This must be done dynamically to support conditionals.
117 ?HAVE_NOTRANS? l2='%NOTRANS_LIST%'; for i in $$l2; do echo "$$i"; done | \
118 ## Accept for `man1' files like `foo.1c' but not `sub.1/foo.2' or `foo-2.1.4'.
119 ?HAVE_NOTRANS? sed -n '/\.%SECTION%[a-z]*$$/p'; \
120 ## Extract basename of manpage, change the extension if needed.
121 } | sed 's,.*/,,;s,\.[^%SECTION%][0-9a-z]*$$,.%SECTION%,'`; \
122 test -z "$$files" || { \
123 echo " ( cd '$(DESTDIR)$(man%SECTION%dir)' && rm -f" $$files ")"; \
124 cd "$(DESTDIR)$(man%SECTION%dir)" && rm -f $$files; }
125 endif %?NOTRANS_MANS%
127 ## Handle MANS without notrans_ prefix
128 @list='%TRANS_SECT_LIST%'; test -n "$(man%SECTION%dir)" || exit 0; \
129 files=`{ for i in $$list; do echo "$$i"; done; \
130 ## Extract all items from man_MANS that should go in this section.
131 ## This must be done dynamically to support conditionals.
132 ?HAVE_TRANS? l2='%TRANS_LIST%'; for i in $$l2; do echo "$$i"; done | \
133 ## Accept for `man1' files like `foo.1c' but not `sub.1/foo.2' or `foo-2.1.4'.
134 ?HAVE_TRANS? sed -n '/\.%SECTION%[a-z]*$$/p'; \
135 ## Extract basename of manpage, run it through the program rename
136 ## transform, and change the extension if needed.
137 } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^%SECTION%][0-9a-z]*$$,%SECTION%,;x' \
138 -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
139 test -z "$$files" || { \
140 echo " ( cd '$(DESTDIR)$(man%SECTION%dir)' && rm -f" $$files ")"; \
141 cd "$(DESTDIR)$(man%SECTION%dir)" && rm -f $$files; }