1 ## Common automake fragments for elfutils subdirectory makefiles.
3 ## Copyright (C) 2010 Red Hat, Inc.
4 ## This file is part of Red Hat elfutils.
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.
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.
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.
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>.
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) \
37 AM_CFLAGS += -fmudflap
38 libmudflap = -lmudflap
43 COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage $(no_mudflap.os),\
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; \
55 $(COMPILE.os) -c -o $@ -fpic -DPIC -DSHARED $<
58 CLEANFILES = *.gcno *.gcda
60 textrel_check = if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi