f259c5bbf80357742263f92ced2edd7bb8187e7c
[platform/upstream/elfutils.git] / config / eu.am
1 ## Common automake fragments for elfutils subdirectory makefiles.
2 ##
3 ## Copyright (C) 2010 Red Hat, Inc.
4 ## This file is part of Red Hat elfutils.
5 ##
6 ## Red Hat elfutils is free software; you can redistribute it and/or modify
7 ## it under the terms of the GNU General Public License as published by the
8 ## Free Software Foundation; version 2 of the License.
9 ##
10 ## Red Hat elfutils is distributed in the hope that it will be useful, but
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 ## General Public License for more details.
14 ##
15 ## You should have received a copy of the GNU General Public License along
16 ## with Red Hat elfutils; if not, write to the Free Software Foundation,
17 ## Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
18 ##
19 ## Red Hat elfutils is an included package of the Open Invention Network.
20 ## An included package of the Open Invention Network is a package for which
21 ## Open Invention Network licensees cross-license their patents.  No patent
22 ## license is granted, either expressly or impliedly, by designation as an
23 ## included package.  Should you wish to participate in the Open Invention
24 ## Network licensing program, please visit www.openinventionnetwork.com
25 ## <http://www.openinventionnetwork.com>.
26 ##
27
28 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DLOCALEDIR='"${localedir}"'
29 INCLUDES = -I. -I$(srcdir) -I$(top_srcdir)/lib -I..
30 AM_CFLAGS = -std=gnu99 -Wall -Wshadow \
31             $(if $($(*F)_no_Werror),,-Werror) \
32             $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
33             $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2) \
34             $($(*F)_CFLAGS)
35
36 if MUDFLAP
37 AM_CFLAGS += -fmudflap
38 libmudflap = -lmudflap
39 else
40 libmudflap =
41 endif
42
43 COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage $(no_mudflap.os),\
44                           $(COMPILE))
45
46 %.os: %.c %.o
47 if AMDEP
48         if $(COMPILE.os) -c -o $@ -fpic -DPIC -DSHARED -MT $@ -MD -MP \
49           -MF "$(DEPDIR)/$*.Tpo" `test -f '$<' || echo '$(srcdir)/'`$<; \
50         then cat "$(DEPDIR)/$*.Tpo" >> "$(DEPDIR)/$*.Po"; \
51              rm -f "$(DEPDIR)/$*.Tpo"; \
52         else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
53         fi
54 else
55         $(COMPILE.os) -c -o $@ -fpic -DPIC -DSHARED $<
56 endif
57
58 CLEANFILES = *.gcno *.gcda
59
60 textrel_check = if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi