source: trunk/essentials/sys-devel/automake-1.8/lib/am/scripts.am

Last change on this file was 3118, checked in by bird, 18 years ago

automake 1.8.5

File size: 4.3 KB
Line 
1## automake - create Makefile.in from Makefile.am
2## Copyright (C) 1994, 1995, 1996, 1998, 1999, 2001, 2003, 2004
3## Free Software Foundation, Inc.
4
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)
8## any later version.
9
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.
14
15## You should have received a copy of the GNU General Public License
16## along with this program; if not, write to the Free Software
17## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
18## 02111-1307, USA.
19
20
21## ------------ ##
22## Installing. ##
23## ------------ ##
24
25if %?INSTALL%
26## if doesn't work properly for Automake variables yet.
27am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
28?BASE?%DIR%SCRIPT_INSTALL = $(INSTALL_SCRIPT)
29?!BASE?%DIR%SCRIPT_INSTALL = $(install_sh_SCRIPT)
30?EXEC?.PHONY install-exec-am: install-%DIR%SCRIPTS
31?!EXEC?.PHONY install-data-am: install-%DIR%SCRIPTS
32install-%DIR%SCRIPTS: $(%DIR%_SCRIPTS)
33 @$(NORMAL_INSTALL)
34 test -z "$(%NDIR%dir)" || $(mkdir_p) "$(DESTDIR)$(%NDIR%dir)"
35?!BASE? @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
36## Funny invocation because Makefile variable can be empty, leading to
37## a syntax error in sh.
38?!BASE? list='$(%DIR%_SCRIPTS)'; for p in $$list; do \
39?BASE? @list='$(%DIR%_SCRIPTS)'; for p in $$list; do \
40?!BASE? case $$p in \
41?!BASE? $(srcdir)/*) p=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
42?!BASE? esac; \
43## A file can be in the source directory or the build directory.
44 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
45 if test -f $$d$$p; then \
46## If the _SCRIPTS variable has an entry like foo/bar, install it as
47## $(destdir)/bar, not $(destdir)/foo/bar. The user can make a
48## new dir variable or use a nobase_ target for the latter case.
49## However in all cases $(transform) applies only to the basename,
50## so we have to strip the directory part.
51 f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
52## Prepend the directory part if nobase_ is used.
53?!BASE? f=`echo "$$p" | sed 's|[^/]*$$||'`"$$f"; \
54 echo " $(%DIR%SCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(%NDIR%dir)/$$f'"; \
55 $(%DIR%SCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(%NDIR%dir)/$$f"; \
56 else :; fi; \
57 done
58endif %?INSTALL%
59
60
61## -------------- ##
62## Uninstalling. ##
63## -------------- ##
64
65if %?INSTALL%
66.PHONY uninstall-am: uninstall-%DIR%SCRIPTS
67uninstall-%DIR%SCRIPTS:
68 @$(NORMAL_UNINSTALL)
69?!BASE? @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
70?!BASE? list='$(%DIR%_SCRIPTS)'; for p in $$list; do \
71?BASE? @list='$(%DIR%_SCRIPTS)'; for p in $$list; do \
72?!BASE? case $$p in \
73?!BASE? $(srcdir)/*) p=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
74?!BASE? esac; \
75## Remove any leading directory before applying $(transform).
76 f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
77## Prepend the directory part if nobase_ is used.
78?!BASE? f=`echo "$$p" | sed 's|[^/]*$$||'`"$$f"; \
79 echo " rm -f '$(DESTDIR)$(%NDIR%dir)/$$f'"; \
80 rm -f "$(DESTDIR)$(%NDIR%dir)/$$f"; \
81 done
82endif %?INSTALL%
83
84
85## -------------- ##
86## Distributing. ##
87## -------------- ##
88
89if %?DIST%
90DIST_COMMON += %DISTVAR%
91endif %?DIST%
92
93
94## ---------- ##
95## Checking. ##
96## ---------- ##
97
98if %?CK-OPTS%
99.PHONY installcheck-am: installcheck-%DIR%SCRIPTS
100installcheck-%DIR%SCRIPTS: $(%DIR%_SCRIPTS)
101 bad=0; pid=$$$$; list="$(%DIR%_SCRIPTS)"; for p in $$list; do \
102 case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \
103## Match $(srcdir)/$$p in addition to $$p because Sun make might rewrite
104## filenames in AM_INSTALLCHECK_STD_OPTIONS_EXEMPT during VPATH builds.
105 *" $$p "* | *" $(srcdir)/$$p "*) continue;; \
106 esac; \
107## Strip any leading directory before applying $(transform).
108 f=`echo "$$p" | sed 's,^.*/,,;$(transform)'`; \
109## Insert the directory back if nobase_ is used.
110?!BASE? f=`echo "$$p" | sed 's|[^/]*$$||'`"$$f"; \
111 for opt in --help --version; do \
112 if "$(DESTDIR)$(%NDIR%dir)/$$f" $$opt > c$${pid}_.out 2> c$${pid}_.err \
113 && test -n "`cat c$${pid}_.out`" \
114 && test -z "`cat c$${pid}_.err`"; then :; \
115 else echo "$$f does not support $$opt" 1>&2; bad=1; fi; \
116 done; \
117 done; rm -f c$${pid}_.???; exit $$bad
118endif %?CK-OPTS%
Note: See TracBrowser for help on using the repository browser.