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

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

automake 1.9.6

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