Merge branch 'micro' into maint
[platform/upstream/automake.git] / lib / am / depend2.am
1 ## automake - create Makefile.in from Makefile.am
2 ## Copyright (C) 1994-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 ## This file is read several times:
18 ## - once per *extension* (not per language) for generic compilation rules
19 ## - once for each file which requires specific flags.
20
21 ## Note it is on purpose we wrote "if %AMDEP%", since:
22 ##
23 ## - if deps are turned off, %AMDEP% is mapped onto FALSE, and therefore
24 ##   the "if FALSE" chunk is removed (automake-time conditionals).
25 ##
26 ## - if deps are on, %AMDEP% is mapped onto AMDEP,  and therefore
27 ##   the "if AMDEP" chunk is prefix with @AMDEP_TRUE@ just like for any
28 ##   other configure-time conditional.
29 ##
30 ## We do likewise for %FASTDEP%; this expands to an ordinary configure-time
31 ## conditional.  %FASTDEP% is used to speed up the common case of building
32 ## a package with gcc 3.x or later.  In this case we can skip the use of
33 ## depcomp and easily inline the dependency tracking.
34
35 if %?NONLIBTOOL%
36 ?GENERIC?%EXT%.o:
37 ?!GENERIC?%OBJ%: %SOURCE%
38 if %FASTDEP%
39 ## In fast-dep mode, we can always use -o.
40 ## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
41 ?!GENERIC?      %VERBOSE%%COMPILE% -MT %OBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o %OBJ% %SOURCEFLAG%`test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
42 ?!GENERIC?      %SILENT%$(am__mv) %DEPBASE%.Tpo %DEPBASE%.Po
43 ?GENERIC??!SUBDIROBJ?   %VERBOSE%%COMPILE% -MT %OBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o %OBJ% %SOURCEFLAG%%SOURCE%
44 ?GENERIC??!SUBDIROBJ?   %SILENT%$(am__mv) %DEPBASE%.Tpo %DEPBASE%.Po
45 ?GENERIC??SUBDIROBJ?    %VERBOSE%depbase=`echo %OBJ% | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
46 ?GENERIC??SUBDIROBJ?    %COMPILE% -MT %OBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o %OBJ% %SOURCEFLAG%%SOURCE% &&\
47 ?GENERIC??SUBDIROBJ?    $(am__mv) %DEPBASE%.Tpo %DEPBASE%.Po
48 else !%FASTDEP%
49 if %AMDEP%
50         %VERBOSE%source='%SOURCE%' object='%OBJ%' libtool=no @AMDEPBACKSLASH@
51         DEPDIR=$(DEPDIR) $(%FPFX%DEPMODE) $(depcomp) @AMDEPBACKSLASH@
52 endif %AMDEP%
53 if %?GENERIC%
54 ?-o?    %VERBOSE-NODEP%%COMPILE% %-c% %-o% %OBJ% %SOURCEFLAG%%SOURCE%
55 ?!-o?   %VERBOSE-NODEP%%COMPILE% %-c% %SOURCEFLAG%%SOURCE%
56 else !%?GENERIC%
57 ## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
58 ?-o?    %VERBOSE-NODEP%%COMPILE% %-c% %-o% %OBJ% %SOURCEFLAG%`test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
59 ?!-o?   %VERBOSE-NODEP%%COMPILE% %-c% %SOURCEFLAG%`test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
60 endif !%?GENERIC%
61 endif !%FASTDEP%
62
63 ?GENERIC?%EXT%.obj:
64 ?!GENERIC?%OBJOBJ%: %SOURCE%
65 if %FASTDEP%
66 ## In fast-dep mode, we can always use -o.
67 ## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
68 ?!GENERIC?      %VERBOSE%%COMPILE% -MT %OBJOBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o %OBJOBJ% %SOURCEFLAG%`if test -f '%SOURCE%'; then $(CYGPATH_W) '%SOURCE%'; else $(CYGPATH_W) '$(srcdir)/%SOURCE%'; fi`
69 ?!GENERIC?      %SILENT%$(am__mv) %DEPBASE%.Tpo %DEPBASE%.Po
70 ?GENERIC??!SUBDIROBJ?   %VERBOSE%%COMPILE% -MT %OBJOBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o %OBJOBJ% %SOURCEFLAG%`$(CYGPATH_W) '%SOURCE%'`
71 ?GENERIC??!SUBDIROBJ?   %SILENT%$(am__mv) %DEPBASE%.Tpo %DEPBASE%.Po
72 ?GENERIC??SUBDIROBJ?    %VERBOSE%depbase=`echo %OBJ% | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
73 ?GENERIC??SUBDIROBJ?    %COMPILE% -MT %OBJOBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o %OBJOBJ% %SOURCEFLAG%`$(CYGPATH_W) '%SOURCE%'` &&\
74 ?GENERIC??SUBDIROBJ?    $(am__mv) %DEPBASE%.Tpo %DEPBASE%.Po
75 else !%FASTDEP%
76 if %AMDEP%
77         %VERBOSE%source='%SOURCE%' object='%OBJOBJ%' libtool=no @AMDEPBACKSLASH@
78         DEPDIR=$(DEPDIR) $(%FPFX%DEPMODE) $(depcomp) @AMDEPBACKSLASH@
79 endif %AMDEP%
80 if %?GENERIC%
81 ?-o?    %VERBOSE-NODEP%%COMPILE% %-c% %-o% %OBJOBJ% %SOURCEFLAG%`$(CYGPATH_W) '%SOURCE%'`
82 ?!-o?   %VERBOSE-NODEP%%COMPILE% %-c% `$(CYGPATH_W) %SOURCEFLAG%'%SOURCE%'`
83 else !%?GENERIC%
84 ## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
85 ?-o?    %VERBOSE-NODEP%%COMPILE% %-c% %-o% %OBJOBJ% %SOURCEFLAG%`if test -f '%SOURCE%'; then $(CYGPATH_W) '%SOURCE%'; else $(CYGPATH_W) '$(srcdir)/%SOURCE%'; fi`
86 ?!-o?   %VERBOSE-NODEP%%COMPILE% %-c% %SOURCEFLAG%`if test -f '%SOURCE%'; then $(CYGPATH_W) '%SOURCE%'; else $(CYGPATH_W) '$(srcdir)/%SOURCE%'; fi`
87 endif !%?GENERIC%
88 endif !%FASTDEP%
89 endif %?NONLIBTOOL%
90
91 if %?LIBTOOL%
92 ?GENERIC?%EXT%.lo:
93 ?!GENERIC?%LTOBJ%: %SOURCE%
94 if %FASTDEP%
95 ## In fast-dep mode, we can always use -o.
96 ## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
97 ?!GENERIC?      %VERBOSE%%LTCOMPILE% -MT %LTOBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o %LTOBJ% %SOURCEFLAG%`test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
98 ?!GENERIC?      %SILENT%$(am__mv) %DEPBASE%.Tpo %DEPBASE%.Plo
99 ?GENERIC??!SUBDIROBJ?   %VERBOSE%%LTCOMPILE% -MT %LTOBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o %LTOBJ% %SOURCEFLAG%%SOURCE%
100 ?GENERIC??!SUBDIROBJ?   %SILENT%$(am__mv) %DEPBASE%.Tpo %DEPBASE%.Plo
101 ?GENERIC??SUBDIROBJ?    %VERBOSE%depbase=`echo %OBJ% | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
102 ?GENERIC??SUBDIROBJ?    %LTCOMPILE% -MT %LTOBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o %LTOBJ% %SOURCEFLAG%%SOURCE% &&\
103 ?GENERIC??SUBDIROBJ?    $(am__mv) %DEPBASE%.Tpo %DEPBASE%.Plo
104 else !%FASTDEP%
105 if %AMDEP%
106         %VERBOSE%source='%SOURCE%' object='%LTOBJ%' libtool=yes @AMDEPBACKSLASH@
107         DEPDIR=$(DEPDIR) $(%FPFX%DEPMODE) $(depcomp) @AMDEPBACKSLASH@
108 endif %AMDEP%
109 ## We can always use '-o' with Libtool.
110 ?GENERIC?       %VERBOSE-NODEP%%LTCOMPILE% %-c% -o %LTOBJ% %SOURCEFLAG%%SOURCE%
111 ## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
112 ?!GENERIC?      %VERBOSE-NODEP%%LTCOMPILE% %-c% -o %LTOBJ% %SOURCEFLAG%`test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
113 endif !%FASTDEP%
114 endif %?LIBTOOL%