Merge branch 'sanity-sleep-fix-master'
[platform/upstream/automake.git] / lib / am / install.am
1 ## automake - create Makefile.in from Makefile.am
2 ## Copyright (C) 2001, 2002, 2003, 2004, 2006, 2008, 2009, 2010 Free Software
3 ## 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, see <http://www.gnu.org/licenses/>.
17
18 ## ----------------------------------------- ##
19 ## installdirs -- Creating the installdirs.  ##
20 ## ----------------------------------------- ##
21
22 ## The reason we loop over %am__installdirs% (instead of simply running
23 ## `$(MKDIR_P) %am__installdirs%') is that directories variable such as
24 ## `"$(DESTDIR)$(mydir)"' can potentially expand to `""' if `$(mydir)'
25 ## is conditionally defined.  BTW, those directories are quoted in
26 ## order to support installation paths with spaces.
27
28 if %?SUBDIRS%
29 .PHONY: installdirs installdirs-am
30 RECURSIVE_TARGETS += installdirs-recursive
31 installdirs: installdirs-recursive
32 installdirs-am:%installdirs-local%
33 ?am__installdirs?       for dir in %am__installdirs%; do \
34 ?am__installdirs?         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
35 ?am__installdirs?       done
36 else !%?SUBDIRS%
37 .PHONY: installdirs
38 installdirs:%installdirs-local%
39 ?am__installdirs?       for dir in %am__installdirs%; do \
40 ?am__installdirs?         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
41 ?am__installdirs?       done
42 endif !%?SUBDIRS%
43
44
45 ## ----------------- ##
46 ## Install targets.  ##
47 ## ----------------- ##
48
49 .PHONY: install install-exec install-data uninstall
50 .PHONY: install-exec-am install-data-am uninstall-am
51
52 if %?SUBDIRS%
53 RECURSIVE_TARGETS += install-data-recursive install-exec-recursive \
54                      install-recursive uninstall-recursive
55 install:%maybe_BUILT_SOURCES% install-recursive
56 install-exec: install-exec-recursive
57 install-data: install-data-recursive
58 uninstall: uninstall-recursive
59 else !%?SUBDIRS%
60 install:%maybe_BUILT_SOURCES% install-am
61 install-exec: install-exec-am
62 install-data: install-data-am
63 uninstall: uninstall-am
64 endif !%?SUBDIRS%
65
66 if %?maybe_BUILT_SOURCES%
67 .MAKE: install
68 endif %?maybe_BUILT_SOURCES%
69
70 .MAKE .PHONY: install-am
71 install-am: all-am
72         @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
73
74
75 .PHONY: installcheck
76 ?SUBDIRS?installcheck: installcheck-recursive
77 ?!SUBDIRS?installcheck: installcheck-am
78 ?!SUBDIRS?.PHONY: installcheck-am
79 ?!SUBDIRS?installcheck-am:
80
81 ## If you ever modify this, keep in mind that INSTALL_PROGRAM is used
82 ## in subdirectories, so never set it to a value relative to the top
83 ## directory.
84 .MAKE .PHONY: install-strip
85 install-strip:
86 ## Beware that there are two variables used to install programs:
87 ##   INSTALL_PROGRAM is used for ordinary *_PROGRAMS
88 ##   install_sh_PROGRAM is used for nobase_*_PROGRAMS (because install-sh
89 ##                                                     creates directories)
90 ## It's OK to override both with INSTALL_STRIP_PROGRAM, because
91 ## INSTALL_STRIP_PROGRAM uses install-sh (see m4/strip.m4 for a rationale).
92 ##
93 ## Use double quotes for the *_PROGRAM settings because we might need to
94 ## interpolate some backquotes at runtime.
95 ##
96 ## The case for empty $(STRIP) is separate so that it is quoted correctly for
97 ## multiple words, but does not expand to an empty words if STRIP is empty.
98         if test -z '$(STRIP)'; then \
99           $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
100             install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
101               install; \
102         else \
103           $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
104             install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
105             "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
106         fi