Merge branch 'minor'
[automake.git] / lib / am / data.am
blob34b582f4618f2278eb905387cb20b810e497aafc
1 ## automake - create Makefile.in from Makefile.am
2 ## Copyright (C) 1994-2017 Free Software Foundation, Inc.
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.
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.
14 ## You should have received a copy of the GNU General Public License
15 ## along with this program.  If not, see <https://www.gnu.org/licenses/>.
17 if %?INSTALL%
18 include inst-vars.am
19 endif %?INSTALL%
21 ## ------------ ##
22 ## Installing.  ##
23 ## ------------ ##
25 if %?INSTALL%
26 am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
27 ?EXEC?.PHONY install-exec-am: install-%DIR%%PRIMARY%
28 ?!EXEC?.PHONY install-data-am: install-%DIR%%PRIMARY%
29 install-%DIR%%PRIMARY%: $(%DIR%_%PRIMARY%)
30         @$(NORMAL_INSTALL)
31 if %?BASE%
32 ## Funny invocation because Makefile variable can be empty, leading to
33 ## a syntax error in sh.
34         @list='$(%DIR%_%PRIMARY%)'; test -n "$(%NDIR%dir)" || list=; \
35         if test -n "$$list"; then \
36           echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \
37           $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)" || exit 1; \
38         fi; \
39         for p in $$list; do \
40 ## A file can be in the source directory or the build directory.
41           if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
42 ## If the _%PRIMARY% variable has an entry like foo/bar, install it as
43 ## $(destdir)/bar, not $(destdir)/foo/bar.  The user can make a
44 ## new dir variable or use a nobase_ target for the latter case.
45           echo "$$d$$p"; \
46         done | $(am__base_list) | \
47         while read files; do \
48           echo " $(INSTALL_%ONE_PRIMARY%) $$files '$(DESTDIR)$(%NDIR%dir)'"; \
49           $(INSTALL_%ONE_PRIMARY%) $$files "$(DESTDIR)$(%NDIR%dir)" || exit $$?; \
50         done
51 else !%?BASE%
52         @list='$(%DIR%_%PRIMARY%)'; test -n "$(%NDIR%dir)" || list=; \
53         if test -n "$$list"; then \
54           echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \
55           $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)" || exit 1; \
56         fi; \
57         $(am__nobase_list) | while read dir files; do \
58           xfiles=; for file in $$files; do \
59             if test -f "$$file"; then xfiles="$$xfiles $$file"; \
60             else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \
61           test -z "$$xfiles" || { \
62             test "x$$dir" = x. || { \
63               echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \
64               $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)/$$dir"; }; \
65             echo " $(INSTALL_%ONE_PRIMARY%) $$xfiles '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \
66             $(INSTALL_%ONE_PRIMARY%) $$xfiles "$(DESTDIR)$(%NDIR%dir)/$$dir" || exit $$?; }; \
67         done
68 endif !%?BASE%
69 endif %?INSTALL%
72 ## -------------- ##
73 ## Uninstalling.  ##
74 ## -------------- ##
76 if %?INSTALL%
77 .PHONY uninstall-am: uninstall-%DIR%%PRIMARY%
78 uninstall-%DIR%%PRIMARY%:
79         @$(NORMAL_UNINSTALL)
80         @list='$(%DIR%_%PRIMARY%)'; test -n "$(%NDIR%dir)" || list=; \
81 ?BASE?  files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
82 ?!BASE? $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \
83         dir='$(DESTDIR)$(%NDIR%dir)'; $(am__uninstall_files_from_dir)
84 endif %?INSTALL%
87 ## ---------- ##
88 ## Cleaning.  ##
89 ## ---------- ##
91 ## Nothing.
94 ## -------------- ##
95 ## Distributing.  ##
96 ## -------------- ##
98 if %?DIST%
99 DIST_COMMON += %DISTVAR%
100 endif %?DIST%