maint: update copyright year for 2013 (in branch maint)
[platform/upstream/automake.git] / lib / am / install.am
1 ## automake - create Makefile.in from Makefile.am
2 ## Copyright (C) 2001-2013 Free Software Foundation, Inc.
3
4 ## This program is free software; you can redistribute it and/or modify
5 ## it under the terms of the GNU General Public License as published by
6 ## the Free Software Foundation; either version 2, or (at your option)
7 ## any later version.
8
9 ## This program is distributed in the hope that it will be useful,
10 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 ## GNU General Public License for more details.
13
14 ## You should have received a copy of the GNU General Public License
15 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
17 ## ----------------------------------------- ##
18 ## installdirs -- Creating the installdirs.  ##
19 ## ----------------------------------------- ##
20
21 ## The reason we loop over %am__installdirs% (instead of simply running
22 ## $(MKDIR_P) %am__installdirs%) is that directories variable such as
23 ## "$(DESTDIR)$(mydir)" can potentially expand to "" if $(mydir) is
24 ## conditionally defined.  BTW, those directories are quoted in order
25 ## to support installation paths with spaces.
26
27 if %?SUBDIRS%
28 .PHONY: installdirs installdirs-am
29 RECURSIVE_TARGETS += installdirs-recursive
30 installdirs: installdirs-recursive
31 installdirs-am:%installdirs-local%
32 ?am__installdirs?       for dir in %am__installdirs%; do \
33 ?am__installdirs?         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
34 ?am__installdirs?       done
35 else !%?SUBDIRS%
36 .PHONY: installdirs
37 installdirs:%installdirs-local%
38 ?am__installdirs?       for dir in %am__installdirs%; do \
39 ?am__installdirs?         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
40 ?am__installdirs?       done
41 endif !%?SUBDIRS%
42
43
44 ## ----------------- ##
45 ## Install targets.  ##
46 ## ----------------- ##
47
48 .PHONY: install install-exec install-data uninstall
49 .PHONY: install-exec-am install-data-am uninstall-am
50
51 if %?SUBDIRS%
52 RECURSIVE_TARGETS += install-data-recursive install-exec-recursive \
53                      install-recursive uninstall-recursive
54 install:%maybe_BUILT_SOURCES% install-recursive
55 install-exec: install-exec-recursive
56 install-data: install-data-recursive
57 uninstall: uninstall-recursive
58 else !%?SUBDIRS%
59 install:%maybe_BUILT_SOURCES% install-am
60 install-exec: install-exec-am
61 install-data: install-data-am
62 uninstall: uninstall-am
63 endif !%?SUBDIRS%
64
65 if %?maybe_BUILT_SOURCES%
66 .MAKE: install
67 endif %?maybe_BUILT_SOURCES%
68
69 .MAKE .PHONY: install-am
70 install-am: all-am
71         @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
72
73
74 .PHONY: installcheck
75 ?SUBDIRS?installcheck: installcheck-recursive
76 ?!SUBDIRS?installcheck: installcheck-am
77 ?!SUBDIRS?.PHONY: installcheck-am
78 ?!SUBDIRS?installcheck-am:
79
80 ## If you ever modify this, keep in mind that INSTALL_PROGRAM is used
81 ## in subdirectories, so never set it to a value relative to the top
82 ## directory.
83 .MAKE .PHONY: install-strip
84 install-strip:
85 ## Beware that there are two variables used to install programs:
86 ##   INSTALL_PROGRAM is used for ordinary *_PROGRAMS
87 ##   install_sh_PROGRAM is used for nobase_*_PROGRAMS (because install-sh
88 ##                                                     creates directories)
89 ## It's OK to override both with INSTALL_STRIP_PROGRAM, because
90 ## INSTALL_STRIP_PROGRAM uses install-sh (see m4/strip.m4 for a rationale).
91 ##
92 ## Use double quotes for the *_PROGRAM settings because we might need to
93 ## interpolate some backquotes at runtime.
94 ##
95 ## The case for empty $(STRIP) is separate so that it is quoted correctly for
96 ## multiple words, but does not expand to an empty words if STRIP is empty.
97         if test -z '$(STRIP)'; then \
98           $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
99             install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
100               install; \
101         else \
102           $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
103             install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
104             "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
105         fi