1 ## automake - create Makefile.in from Makefile.am
2 ## Copyright (C) 1994, 1995, 1996, 1998, 1999, 2001, 2003, 2004, 2006, 2007,
3 ## 2008, 2009 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 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/>.
27 ## if doesn't work properly for Automake variables yet.
28 am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
29 .PHONY install-%EXEC?exec:data%-am: install-%DIR%SCRIPTS
30 install-%DIR%SCRIPTS: $(%DIR%_SCRIPTS)
32 test -z "$(%NDIR%dir)" || $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)"
33 ## Funny invocation because Makefile variable can be empty, leading to
34 ## a syntax error in sh.
35 @list='$(%DIR%_SCRIPTS)'; test -n "$(%NDIR%dir)" || list=; \
36 ?!BASE? $(am__nobase_strip_setup); \
38 ## A file can be in the source directory or the build directory.
39 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
40 ## A script may or may not exist.
41 if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
43 ## We now have a list of "sourcefile newline (nobase-)target" pairs.
44 ## Turn that into "sourcefile source_base target_dir xformed_target_base",
45 ## with newlines being turned into spaces in a second step.
46 sed -e 'p;s,.*/,,;n' \
47 ?BASE? -e 'h;s|.*|.|' \
48 ?!BASE? -e "s|$$srcdirstrip/||" -e 'h;s|[^/]*$$||; s|^$$|.|' \
49 -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
50 $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
51 { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
52 if ($$2 == $$4) { files[d] = files[d] " " $$1; \
53 if (++n[d] == $(am__install_max)) { \
54 print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
55 else { print "f", d "/" $$4, $$1 } } \
56 END { for (d in files) print "f", d, files[d] }' | \
57 while read type dir files; do \
58 ?!BASE? case $$type in \
59 ?!BASE? d) echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \
60 ?!BASE? $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)/$$dir" || exit $$?;; \
62 if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
63 test -z "$$files" || { \
64 echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(%NDIR%dir)$$dir'"; \
65 $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(%NDIR%dir)$$dir" || exit $$?; \
77 .PHONY uninstall-am: uninstall-%DIR%SCRIPTS
78 uninstall-%DIR%SCRIPTS:
80 @list='$(%DIR%_SCRIPTS)'; test -n "$(%NDIR%dir)" || exit 0; \
81 ?BASE? files=`for p in $$list; do echo "$$p"; done | \
82 ?BASE? sed -e 's,.*/,,;$(transform)'`; \
83 ?!BASE? $(am__nobase_strip_setup); \
84 ?!BASE? files=`$(am__nobase_strip) \
85 ?!BASE? -e 'h;s,.*/,,;$(transform);x;s|[^/]*$$||;G;s,\n,,'`; \
86 test -n "$$list" || exit 0; \
87 echo " ( cd '$(DESTDIR)$(%NDIR%dir)' && rm -f" $$files ")"; \
88 cd "$(DESTDIR)$(%NDIR%dir)" && rm -f $$files
97 DIST_COMMON += %DISTVAR%
106 .PHONY installcheck-am: installcheck-%DIR%SCRIPTS
107 installcheck-%DIR%SCRIPTS: $(%DIR%_SCRIPTS)
108 bad=0; pid=$$$$; list="$(%DIR%_SCRIPTS)"; for p in $$list; do \
109 case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \
110 ## Match $(srcdir)/$$p in addition to $$p because Sun make might rewrite
111 ## filenames in AM_INSTALLCHECK_STD_OPTIONS_EXEMPT during VPATH builds.
112 *" $$p "* | *" $(srcdir)/$$p "*) continue;; \
114 ## Strip any leading directory before applying $(transform).
115 f=`echo "$$p" | sed 's,^.*/,,;$(transform)'`; \
116 ## Insert the directory back if nobase_ is used.
117 ?!BASE? f=`echo "$$p" | sed 's|[^/]*$$||'`"$$f"; \
118 for opt in --help --version; do \
119 if "$(DESTDIR)$(%NDIR%dir)/$$f" $$opt >c$${pid}_.out \
120 2>c$${pid}_.err </dev/null \
121 && test -n "`cat c$${pid}_.out`" \
122 && test -z "`cat c$${pid}_.err`"; then :; \
123 else echo "$$f does not support $$opt" 1>&2; bad=1; fi; \
125 done; rm -f c$${pid}_.???; exit $$bad