1 ## automake - create Makefile.in from Makefile.am
2 ## Copyright (C) 1994, 1995, 1996, 1997, 1998 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)
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, write to the Free Software
16 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
19 @echo '$(@PFX@COMPILE) -c $<'; \
20 ## There are various ways to get dependency output from gcc. Here's
21 ## why we pick this rather obscure method:
22 ## - Don't want to use -MD because we'd like the dependencies to end
23 ## up in a subdir. Having to rename by hand is ugly.
24 ## (We might end up doing this anyway to support other compilers.)
25 ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
26 ## -MM, not -M (despite what the docs say).
27 ## - Using -M directly means running the compiler twice (even worse
29 $(@PFX@COMPILE) -Wp,-MD,.deps/$(*F).p -c $<
30 ## This next piece of magic avoids the `deleted header file' problem.
31 ## The problem is that when a header file which appears in a .P file
32 ## is deleted, the dependency causes make to die (because there is
33 ## typically no way to rebuild the header). We avoid this by adding
34 ## dummy dependencies for each header file. Too bad gcc doesn't do
35 ## this for us directly.
36 @-cp .deps/$(*F).p .deps/$(*F).P; \
37 tr '\\ ' '\n\n' < .deps/$(*F).p \
38 ## Some versions of gcc put a space before the `:'. On the theory
39 ## that the space means something, we add a space to the output as
41 | sed -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
46 @echo '$(LT@PFX@COMPILE) -c $<'; \
47 ## See above to understand implementation weirdness.
48 $(LT@PFX@COMPILE) -Wp,-MD,.deps/$(*F).p -c $<
49 ## Account for versions of gcc that put a space before the `:'.
50 @-sed -e 's/^\([^:]*\)\.o[ ]:/\1.lo \1.o :/' \
51 < .deps/$(*F).p > .deps/$(*F).P; \
52 ## See above to understand deleted header file trick.
53 tr '\\ ' '\n\n' < .deps/$(*F).p \
54 ## Some versions of gcc put a space before the `:'. On the theory
55 ## that the space means something, we add a space to the output as
57 | sed -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \