49e133d5a05c9e038aea7dd20f7e62b70dede493
[platform/upstream/automake.git] / lib / am / data.am
1 ## automake - create Makefile.in from Makefile.am
2 ## Copyright 1994, 1995, 1996, 1998, 1999, 2001 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, write to the Free Software
16 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
17 ## 02111-1307, USA.
18
19 ## ------------ ##
20 ## Installing.  ##
21 ## ------------ ##
22
23 if %?INSTALL%
24 am__installdirs += $(DESTDIR)$(%NDIR%dir)
25 ?BASE?%DIR%%PRIMARY%_INSTALL = $(INSTALL_%ONE_PRIMARY%)
26 ?!BASE?%DIR%%PRIMARY%_INSTALL = $(install_sh_DATA)
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         $(mkinstalldirs) $(DESTDIR)$(%NDIR%dir)
32 ## Funny invocation because Makefile variable can be empty, leading to
33 ## a syntax error in sh.
34         @list='$(%DIR%_%PRIMARY%)'; for p in $$list; do \
35 ## A file can be in the source directory or the build directory.
36           if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
37 ## If the _%PRIMARY% variable has an entry like foo/bar, install it as
38 ## $(destdir)/bar, not $(destdir)/foo/bar.  The user can make a
39 ## new dir variable or use a nobase_ target for the latter case.
40 ?BASE?    f="`echo $$p | sed -e 's|^.*/||'`"; \
41 ?!BASE?   f="$$p"; \
42           echo " $(%DIR%%PRIMARY%_INSTALL) $$d$$p $(DESTDIR)$(%NDIR%dir)/$$f"; \
43           $(%DIR%%PRIMARY%_INSTALL) $$d$$p $(DESTDIR)$(%NDIR%dir)/$$f; \
44         done
45 endif %?INSTALL%
46
47
48 ## -------------- ##
49 ## Uninstalling.  ##
50 ## -------------- ##
51
52 if %?INSTALL%
53 .PHONY uninstall-am: uninstall-%DIR%%PRIMARY%
54 uninstall-%DIR%%PRIMARY%:
55         @$(NORMAL_UNINSTALL)
56         @list='$(%DIR%_%PRIMARY%)'; for p in $$list; do \
57 ?BASE?    f="`echo $$p | sed -e 's|^.*/||'`"; \
58 ?!BASE?   f="$$p"; \
59           echo " rm -f $(DESTDIR)$(%NDIR%dir)/$$f"; \
60           rm -f $(DESTDIR)$(%NDIR%dir)/$$f; \
61         done
62 endif %?INSTALL%
63
64
65 ## ---------- ##
66 ## Cleaning.  ##
67 ## ---------- ##
68
69 ## Nothing.
70
71
72 ## -------------- ##
73 ## Distributing.  ##
74 ## -------------- ##
75
76 if %?DIST%
77 DIST_COMMON += $(%DIR%_%PRIMARY%)
78 endif %?DIST%