Blame config/eu.am

Packit 032894
## Common automake fragments for elfutils subdirectory makefiles.
Packit 032894
##
Packit 032894
## Copyright (C) 2010, 2014, 2016 Red Hat, Inc.
Packit 032894
##
Packit 032894
## This file is part of elfutils.
Packit 032894
##
Packit 032894
## This file is free software; you can redistribute it and/or modify
Packit 032894
## it under the terms of either
Packit 032894
##
Packit 032894
##   * the GNU Lesser General Public License as published by the Free
Packit 032894
##     Software Foundation; either version 3 of the License, or (at
Packit 032894
##     your option) any later version
Packit 032894
##
Packit 032894
## or
Packit 032894
##
Packit 032894
##   * the GNU General Public License as published by the Free
Packit 032894
##     Software Foundation; either version 2 of the License, or (at
Packit 032894
##     your option) any later version
Packit 032894
##
Packit 032894
## or both in parallel, as here.
Packit 032894
##
Packit 032894
## elfutils is distributed in the hope that it will be useful, but
Packit 032894
## WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 032894
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 032894
## General Public License for more details.
Packit 032894
##
Packit 032894
## You should have received copies of the GNU General Public License and
Packit 032894
## the GNU Lesser General Public License along with this program.  If
Packit 032894
## not, see <http://www.gnu.org/licenses/>.
Packit 032894
##
Packit 032894
Packit 032894
DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DLOCALEDIR='"${localedir}"'
Packit 032894
AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_srcdir)/lib -I..
Packit 032894
Packit 032894
# Drop the 'u' flag that automake adds by default. It is incompatible
Packit 032894
# with deterministic archives.
Packit 032894
ARFLAGS = cr
Packit 032894
Packit 032894
# Warn about stack usage of more than 256K = 262144 bytes.
Packit 032894
if ADD_STACK_USAGE_WARNING
Packit 032894
STACK_USAGE_WARNING=-Wstack-usage=262144
Packit 032894
else
Packit 032894
STACK_USAGE_WARNING=
Packit 032894
endif
Packit 032894
Packit 032894
if SANE_LOGICAL_OP_WARNING
Packit 032894
LOGICAL_OP_WARNING=-Wlogical-op
Packit 032894
else
Packit 032894
LOGICAL_OP_WARNING=
Packit 032894
endif
Packit 032894
Packit 032894
if HAVE_DUPLICATED_COND_WARNING
Packit 032894
DUPLICATED_COND_WARNING=-Wduplicated-cond
Packit 032894
else
Packit 032894
DUPLICATED_COND_WARNING=
Packit 032894
endif
Packit 032894
Packit 032894
if HAVE_NULL_DEREFERENCE_WARNING
Packit 032894
NULL_DEREFERENCE_WARNING=-Wnull-dereference
Packit 032894
else
Packit 032894
NULL_DEREFERENCE_WARNING=
Packit 032894
endif
Packit 032894
Packit 032894
if HAVE_IMPLICIT_FALLTHROUGH_WARNING
Packit 032894
# Use strict fallthrough. Only __attribute__((fallthrough)) will prevent the
Packit 032894
# warning
Packit 032894
IMPLICIT_FALLTHROUGH_WARNING=-Wimplicit-fallthrough=5
Packit 032894
else
Packit 032894
IMPLICIT_FALLTHROUGH_WARNING=
Packit 032894
endif
Packit 032894
Packit 032894
AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \
Packit 032894
	    -Wold-style-definition -Wstrict-prototypes -Wtrampolines \
Packit 032894
	    $(LOGICAL_OP_WARNING) $(DUPLICATED_COND_WARNING) \
Packit 032894
	    $(NULL_DEREFERENCE_WARNING) $(IMPLICIT_FALLTHROUGH_WARNING) \
Packit 032894
	    $(if $($(*F)_no_Werror),,-Werror) \
Packit 032894
	    $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
Packit 032894
	    $(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \
Packit 032894
	    $(if $($(*F)_no_Wpacked_not_aligned),-Wno-packed-not-aligned,) \
Packit 032894
	    $($(*F)_CFLAGS)
Packit 032894
Packit 032894
AM_CXXFLAGS = -std=c++11 -Wall -Wshadow \
Packit 032894
	   -Wtrampolines \
Packit 032894
	   $(LOGICAL_OP_WARNING) $(DUPLICATED_COND_WARNING) \
Packit 032894
	   $(NULL_DEREFERENCE_WARNING) $(IMPLICIT_FALLTHROUGH_WARNING) \
Packit 032894
	   $(if $($(*F)_no_Werror),,-Werror) \
Packit 032894
	   $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
Packit 032894
	   $(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \
Packit 032894
	   $(if $($(*F)_no_Wpacked_not_aligned),-Wno-packed-not-aligned,) \
Packit 032894
	   $($(*F)_CXXFLAGS)
Packit 032894
Packit 032894
COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage, $(COMPILE))
Packit 032894
Packit 032894
DEFS.os = -DPIC -DSHARED
Packit 032894
if SYMBOL_VERSIONING
Packit 032894
DEFS.os += -DSYMBOL_VERSIONING
Packit 032894
else
Packit 032894
endif
Packit 032894
Packit 032894
%.os: %.c %.o
Packit 032894
if AMDEP
Packit 032894
	$(AM_V_CC)if $(COMPILE.os) -c -o $@ $(fpic_CFLAGS) $(DEFS.os) -MT $@ -MD -MP \
Packit 032894
	  -MF "$(DEPDIR)/$*.Tpo" `test -f '$<' || echo '$(srcdir)/'`$<; \
Packit 032894
	then cat "$(DEPDIR)/$*.Tpo" >> "$(DEPDIR)/$*.Po"; \
Packit 032894
	     rm -f "$(DEPDIR)/$*.Tpo"; \
Packit 032894
	else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
Packit 032894
	fi
Packit 032894
else
Packit 032894
	$(AM_V_CC)$(COMPILE.os) -c -o $@ $(fpic_CFLAGS) $(DEFS.os) $<
Packit 032894
endif
Packit 032894
Packit 032894
CLEANFILES = *.gcno *.gcda
Packit 032894
Packit 032894
textrel_msg = echo "WARNING: TEXTREL found in '$@'"
Packit 032894
if FATAL_TEXTREL
Packit 032894
textrel_found = $(textrel_msg); exit 1
Packit 032894
else
Packit 032894
textrel_found = $(textrel_msg)
Packit 032894
endif
Packit 032894
textrel_check = if $(READELF) -d $@ | fgrep -q TEXTREL; then $(textrel_found); fi
Packit 032894
Packit 032894
print-%:
Packit 032894
	@echo $*=$($*)