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