Imported Upstream version 0.155
[platform/upstream/elfutils.git] / config / eu.am
1 ## Common automake fragments for elfutils subdirectory makefiles.
2 ##
3 ## Copyright (C) 2010 Red Hat, Inc.
4 ##
5 ## This file is part of elfutils.
6 ##
7 ## This file is free software; you can redistribute it and/or modify
8 ## it under the terms of either
9 ##
10 ##   * the GNU Lesser General Public License as published by the Free
11 ##     Software Foundation; either version 3 of the License, or (at
12 ##     your option) any later version
13 ##
14 ## or
15 ##
16 ##   * the GNU General Public License as published by the Free
17 ##     Software Foundation; either version 2 of the License, or (at
18 ##     your option) any later version
19 ##
20 ## or both in parallel, as here.
21 ##
22 ## elfutils is distributed in the hope that it will be useful, but
23 ## WITHOUT ANY WARRANTY; without even the implied warranty of
24 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
25 ## General Public License for more details.
26 ##
27 ## You should have received copies of the GNU General Public License and
28 ## the GNU Lesser General Public License along with this program.  If
29 ## not, see <http://www.gnu.org/licenses/>.
30 ##
31
32 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DLOCALEDIR='"${localedir}"'
33 INCLUDES = -I. -I$(srcdir) -I$(top_srcdir)/lib -I..
34 AM_CFLAGS = -std=gnu99 -Wall -Wshadow \
35             $(if $($(*F)_no_Werror),,-Werror) \
36             $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
37             $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2) \
38             $($(*F)_CFLAGS)
39
40 if MUDFLAP
41 AM_CFLAGS += -fmudflap
42 libmudflap = -lmudflap
43 else
44 libmudflap =
45 endif
46
47 COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage $(no_mudflap.os),\
48                           $(COMPILE))
49
50 %.os: %.c %.o
51 if AMDEP
52         if $(COMPILE.os) -c -o $@ -fpic -DPIC -DSHARED -MT $@ -MD -MP \
53           -MF "$(DEPDIR)/$*.Tpo" `test -f '$<' || echo '$(srcdir)/'`$<; \
54         then cat "$(DEPDIR)/$*.Tpo" >> "$(DEPDIR)/$*.Po"; \
55              rm -f "$(DEPDIR)/$*.Tpo"; \
56         else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
57         fi
58 else
59         $(COMPILE.os) -c -o $@ -fpic -DPIC -DSHARED $<
60 endif
61
62 CLEANFILES = *.gcno *.gcda
63
64 textrel_check = if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi