c92eff7558650e783e3371bb5f84bb4844bf8aca
[platform/upstream/automake.git] / lib / am / libs.am
1 ## automake - create Makefile.in from Makefile.am
2 ## Copyright (C) 1994, 1995, 1996, 1998, 1999, 2001, 2002, 2003, 2004, 2006,
3 ## 2007, 2008, 2009  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 3, 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, see <http://www.gnu.org/licenses/>.
17
18 if %?INSTALL%
19 include inst-vars.am
20 endif %?INSTALL%
21
22 ## ------------ ##
23 ## Installing.  ##
24 ## ------------ ##
25
26 if %?INSTALL%
27 am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
28 .PHONY install-%EXEC?exec:data%-am: install-%DIR%LIBRARIES
29 install-%DIR%LIBRARIES: $(%DIR%_LIBRARIES)
30         @$(NORMAL_INSTALL)
31         test -z "$(%NDIR%dir)" || $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)"
32 if %?BASE%
33 ## Funny invocation because Makefile variable can be empty, leading to
34 ## a syntax error in sh.
35         @list='$(%DIR%_LIBRARIES)'; test -n "$(%NDIR%dir)" || list=; \
36         list2=; for p in $$list; do \
37           if test -f $$p; then \
38             list2="$$list2 $$p"; \
39           else :; fi; \
40         done; \
41         test -z "$$list2" || { \
42           echo " $(INSTALL_DATA) $$list2 '$(DESTDIR)$(%NDIR%dir)'"; \
43           $(INSTALL_DATA) $$list2 "$(DESTDIR)$(%NDIR%dir)" || exit $$?; }
44 else !%?BASE%
45 ## Funny invocation because Makefile variable can be empty, leading to
46 ## a syntax error in sh.
47         @list='$(%DIR%_LIBRARIES)'; test -n "$(%NDIR%dir)" || list=; \
48         $(am__nobase_list) | while read dir files; do \
49           xfiles=; for p in $$files; do \
50             if test -f "$$p"; then xfiles="$$xfiles $$p"; else :; fi; done; \
51           test -z "$$xfiles" || { \
52             test "x$$dir" = x. || { \
53               echo "$(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \
54               $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)/$$dir"; }; \
55             echo " $(INSTALL_DATA) $$xfiles '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \
56             $(INSTALL_DATA) $$xfiles "$(DESTDIR)$(%NDIR%dir)/$$dir" || exit $$?; }; \
57         done
58 endif !%?BASE%
59 ## We do two loops here so that $(POST_INSTALL) can be empty.  If we
60 ## merge the two loops, we get a syntax error from sh.  Anyway, having
61 ## $(POST_INSTALL) in the middle of the loop essentially renders it
62 ## useless; sh never actually executes this command.  Read the GNU
63 ## Standards for a little enlightenment on this.
64         @$(POST_INSTALL)
65         @list='$(%DIR%_LIBRARIES)'; test -n "$(%NDIR%dir)" || list=; \
66         for p in $$list; do \
67           if test -f $$p; then \
68             %BASE?$(am__strip_dir):f=$$p;% \
69 ## Must ranlib after installing because mod time changes.
70 ## cd to target directory because AIX ranlib messes up with whitespace
71 ## in the argument.
72             echo " ( cd '$(DESTDIR)$(%NDIR%dir)' && $(RANLIB) $$f )"; \
73             ( cd "$(DESTDIR)$(%NDIR%dir)" && $(RANLIB) $$f ) || exit $$?; \
74           else :; fi; \
75         done
76 endif %?INSTALL%
77
78
79 ## -------------- ##
80 ## Uninstalling.  ##
81 ## -------------- ##
82
83 if %?INSTALL%
84 .PHONY uninstall-am: uninstall-%DIR%LIBRARIES
85 uninstall-%DIR%LIBRARIES:
86         @$(NORMAL_UNINSTALL)
87         @list='$(%DIR%_LIBRARIES)'; test -n "$(%NDIR%dir)" || list=; \
88 ?BASE?  files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
89 ?!BASE? $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \
90         test -n "$$files" || exit 0; \
91         echo " ( cd '$(DESTDIR)$(%NDIR%dir)' && rm -f "$$files" )"; \
92         cd "$(DESTDIR)$(%NDIR%dir)" && rm -f $$files
93 endif %?INSTALL%
94
95
96 ## ---------- ##
97 ## Cleaning.  ##
98 ## ---------- ##
99
100 .PHONY clean-am: clean-%DIR%LIBRARIES
101 clean-%DIR%LIBRARIES:
102         -test -z "$(%DIR%_LIBRARIES)" || rm -f $(%DIR%_LIBRARIES)