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

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

automake 1.8.5

File size: 5.2 KB
Line 
1## automake - create Makefile.in from Makefile.am
2## Copyright (C) 1994, 1995, 1996, 1997, 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%
26am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
27?BASE?%DIR%PROGRAMS_INSTALL = $(INSTALL_PROGRAM)
28?!BASE?%DIR%PROGRAMS_INSTALL = $(install_sh_PROGRAM)
29?EXEC?.PHONY install-exec-am: install-%DIR%PROGRAMS
30?!EXEC?.PHONY install-data-am: install-%DIR%PROGRAMS
31install-%DIR%PROGRAMS: $(%DIR%_PROGRAMS)
32 @$(NORMAL_INSTALL)
33 test -z "$(%NDIR%dir)" || $(mkdir_p) "$(DESTDIR)$(%NDIR%dir)"
34## Funny invocation because Makefile variable can be empty, leading to
35## a syntax error in sh.
36 @list='$(%DIR%_PROGRAMS)'; for p in $$list; do \
37## On Cygwin with libtool test won't see `foo.exe' but instead `foo'.
38## So we check for both.
39 p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
40 if test -f $$p \
41?LIBTOOL? || test -f $$p1 \
42 ; then \
43## Compute basename of source file. Unless this is a nobase_ target, we
44## want to install 'python/foo.py' as '$(DESTDIR)$(%NDIR%dir)/foo.yo',
45## not '$(DESTDIR)$(%NDIR%dir)/python/foo.yo'.
46## However in all cases $(transform) applies only to the basename,
47## so we have to strip the directory part.
48 f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
49## Prepend the directory part if nobase_ is used.
50?!BASE? f=`echo "$$p1" | sed 's|[^/]*$$||'`"$$f"; \
51## Note that we explicitly set the libtool mode. This avoids any
52## lossage if the install program doesn't have a name that libtool
53## expects.
54?LIBTOOL? echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(%DIR%PROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(%NDIR%dir)/$$f'"; \
55?LIBTOOL? $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(%DIR%PROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(%NDIR%dir)/$$f" || exit 1; \
56?!LIBTOOL? echo " $(INSTALL_PROGRAM_ENV) $(%DIR%PROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(%NDIR%dir)/$$f'"; \
57?!LIBTOOL? $(INSTALL_PROGRAM_ENV) $(%DIR%PROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(%NDIR%dir)/$$f" || exit 1; \
58 else :; fi; \
59 done
60endif %?INSTALL%
61
62
63## -------------- ##
64## Uninstalling. ##
65## -------------- ##
66
67if %?INSTALL%
68.PHONY uninstall-am: uninstall-%DIR%PROGRAMS
69uninstall-%DIR%PROGRAMS:
70 @$(NORMAL_UNINSTALL)
71 @list='$(%DIR%_PROGRAMS)'; for p in $$list; do \
72## Remove any leading directory before applying $(transform).
73 f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
74## Prepend the directory part if nobase_ is used.
75?!BASE? f=`echo "$$p" | sed 's|[^/]*$$||'`"$$f"; \
76 echo " rm -f '$(DESTDIR)$(%NDIR%dir)/$$f'"; \
77 rm -f "$(DESTDIR)$(%NDIR%dir)/$$f"; \
78 done
79endif %?INSTALL%
80
81
82## ---------- ##
83## Cleaning. ##
84## ---------- ##
85
86.PHONY clean-am: clean-%DIR%PROGRAMS
87clean-%DIR%PROGRAMS:
88?!LIBTOOL? -test -z "$(%DIR%_PROGRAMS)" || rm -f $(%DIR%_PROGRAMS)
89## Under Cygwin, we build `program$(EXEEXT)'. However, if this
90## program uses a Libtool library, Libtool will move it in
91## `_libs/program$(EXEEXT)' and create a `program' wrapper (without
92## `$(EXEEXT)'). Therefore, if Libtool is used, we must try to erase
93## both `program$(EXEEXT)' and `program'.
94## Cleaning the `_libs/' or `.libs/' directory is done from clean-libtool.
95## FIXME: In the future (i.e., when it works) it would be nice to delegate
96## this task to `libtool --mode=clean'.
97?LIBTOOL? @list='$(%DIR%_PROGRAMS)'; for p in $$list; do \
98?LIBTOOL? f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
99?LIBTOOL? echo " rm -f $$p $$f"; \
100?LIBTOOL? rm -f $$p $$f ; \
101?LIBTOOL? done
102
103
104## ---------- ##
105## Checking. ##
106## ---------- ##
107
108if %?CK-OPTS%
109.PHONY installcheck-am: installcheck-%DIR%PROGRAMS
110installcheck-%DIR%PROGRAMS: $(%DIR%_PROGRAMS)
111 bad=0; pid=$$$$; list="$(%DIR%_PROGRAMS)"; for p in $$list; do \
112 case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \
113## Match $(srcdir)/$$p in addition to $$p because Sun make might rewrite
114## filenames in AM_INSTALLCHECK_STD_OPTIONS_EXEMPT during VPATH builds.
115 *" $$p "* | *" $(srcdir)/$$p "*) continue;; \
116 esac; \
117## Strip the directory and $(EXEEXT) before applying $(transform).
118 f=`echo "$$p" | \
119 sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
120## Insert the directory back if nobase_ is used.
121?!BASE? f=`echo "$$p" | sed 's|[^/]*$$||'`"$$f"; \
122 for opt in --help --version; do \
123 if "$(DESTDIR)$(%NDIR%dir)/$$f" $$opt > c$${pid}_.out 2> c$${pid}_.err \
124 && test -n "`cat c$${pid}_.out`" \
125 && test -z "`cat c$${pid}_.err`"; then :; \
126 else echo "$$f does not support $$opt" 1>&2; bad=1; fi; \
127 done; \
128 done; rm -f c$${pid}_.???; exit $$bad
129endif %?CK-OPTS%
Note: See TracBrowser for help on using the repository browser.