summaryrefslogtreecommitdiffstats
path: root/dwarflint/Makefile.am
blob: 7c0a9b2f93cbec17268634e24cbfc0ae9ac0543e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
## Process this file with automake to create Makefile.in
##
## Copyright (C) 1996-2011 Red Hat, Inc.
## This file is part of Red Hat elfutils.
##
## Red Hat elfutils is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by the
## Free Software Foundation; version 2 of the License.
##
## Red Hat elfutils is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License along
## with Red Hat elfutils; if not, write to the Free Software Foundation,
## Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
##
## Red Hat elfutils is an included package of the Open Invention Network.
## An included package of the Open Invention Network is a package for which
## Open Invention Network licensees cross-license their patents.  No patent
## license is granted, either expressly or impliedly, by designation as an
## included package.  Should you wish to participate in the Open Invention
## Network licensing program, please visit www.openinventionnetwork.com
## <http://www.openinventionnetwork.com>.
##
include $(top_srcdir)/config/eu.am
DEFS += $(YYDEBUG) -DDEBUGPRED=@DEBUGPRED@ \
	-DSRCDIR=\"$(shell cd $(srcdir);pwd)\" -DOBJDIR=\"$(shell pwd)\"
INCLUDES += -I$(srcdir)/../libelf -I$(srcdir)/../libebl \
	    -I$(srcdir)/../libdw -I$(srcdir)/../libdwfl \
	    -I$(srcdir)/../libasm

AM_LDFLAGS = -Wl,-rpath-link,../libelf:../libdw

no_mudflap.os = -fmudflap

bin_PROGRAMS = dwarflint
noinst_PROGRAMS = tests/test-coverage tests/test-wrap tests/test-all-dies-it

dwarflint_SOURCES = \
	addr-record.cc addr-record.hh \
	all-dies-it.hh \
	checkdescriptor.cc checkdescriptor.hh checkdescriptor.ii \
	checked_read.cc checked_read.hh \
	checkrule.cc checkrule.hh \
	checks.cc checks.hh checks.ii \
	coverage.cc coverage.hh \
	cu_coverage.cc cu_coverage.hh cu_coverage.ii \
	dwarf_2.cc dwarf_2.hh \
	dwarf_3.cc dwarf_3.hh \
	dwarf_4.cc dwarf_4.hh \
	dwarf_gnu.cc dwarf_gnu.hh \
	dwarf_mips.cc dwarf_mips.hh \
	dwarf_version-imp.cc dwarf_version-imp.hh \
	dwarf_version.cc dwarf_version.hh dwarf_version.ii \
	dwarflint.cc dwarflint.hh dwarflint.ii \
	elf_file.hh elf_file.ii \
	expected-at.cc expected.hh \
	highlevel_check.cc highlevel_check.hh \
	main.cc \
	messages.cc messages.hh \
	misc.cc misc.hh \
	option.cc option.hh option.ii \
	pri.cc pri.hh \
	readctx.cc readctx.hh \
	reloc.cc reloc.hh \
	section_id.cc section_id.hh \
	sections.cc sections.hh sections.ii \
	where.c where.h \
	wrap.cc wrap.hh \
	\
	check_debug_abbrev.cc check_debug_abbrev.hh check_debug_abbrev.ii \
	check_debug_aranges.cc check_debug_aranges.hh check_debug_aranges.ii \
	check_debug_info.cc check_debug_info.hh check_debug_info.ii \
	check_debug_line.cc check_debug_line.hh check_debug_line.ii \
	check_debug_loc_range.cc check_debug_loc_range.hh check_debug_loc_range.ii \
	check_debug_pub.cc check_debug_pub.hh \
	check_duplicate_DW_tag_variable.cc \
	check_dups_abstract_origin.cc \
	check_expected_trees.cc \
	check_matching_ranges.cc \
	check_nodebug.cc \
	check_range_out_of_scope.cc \
	locstats.cc \
	lowlevel_checks.cc lowlevel_checks.hh \
	\
	../src/dwarfstrings.c

tests_test_coverage_SOURCES = tests/test-coverage.cc coverage.cc pri.cc \
	../src/dwarfstrings.c

tests_test_wrap_SOURCES = tests/test-wrap.cc wrap.cc
tests_test_all_dies_it_SOURCES = tests/test-all-dies-it.cc

EXTRA_TESTS = tests/run-debug_abbrev-duplicate-attribute.sh \
	tests/run-check_duplicate_DW_tag_variable.sh \
	tests/run-location-leaks.sh \
	tests/run-nodebug.sh \
	tests/run-check_range_out_of_scope.sh \
	tests/run-check_debug_info_refs.sh \
	tests/run-aranges_terminate_early.sh \
	tests/run-libdl-2.12.so.debug.sh \
	tests/run-test-all-dies-it.sh \
	tests/run-bad.sh

TESTS = $(EXTRA_TESTS) \
	tests/test-coverage \
	tests/test-wrap

EXTRA_DIST = $(EXTRA_TESTS) \
	tests/debug_abbrev-duplicate-attribute.bz2 \
	tests/crc7.ko.debug.bz2 \
	tests/location-leaks.bz2 \
	tests/nodebug.bz2 \
	tests/check_range_out_of_scope-1.bz2 \
	tests/check_debug_info_refs-1.bz2 \
	tests/aranges_terminate_early.bz2
	tests/libdl-2.12.so.debug.bz2 \
	tests/hello.bad-1.bz2 \
	tests/hello.bad-3.bz2 \
	tests/empty-1.bz2 \
	tests/garbage-1.bz2 \
	tests/garbage-2.bz2 \
	tests/garbage-3.bz2 \
	tests/garbage-4.bz2 \
	tests/garbage-5.bz2 \
	tests/garbage-6.bz2 \
	tests/garbage-7.bz2 \
	tests/garbage-8.bz2 \
	tests/garbage-9.bz2 \
	tests/garbage-10.bz2 \
	tests/garbage-11.bz2

installed_TESTS_ENVIRONMENT = libdir=$(DESTDIR)$(libdir) \
			      bindir=$(DESTDIR)$(bindir) \
			      $(top_srcdir)/tests/test-wrapper.sh \
			      installed $(tests_rpath) \
			      $(program_transform_name)
if STANDALONE
TESTS_ENVIRONMENT = $(installed_TESTS_ENVIRONMENT)
else !STANDALONE
TESTS_ENVIRONMENT = $(top_srcdir)/tests/test-wrapper.sh \
		    ../libdw:../backends:../libelf:../libasm

installcheck-local:
	$(MAKE) $(AM_MAKEFLAGS) \
		TESTS_ENVIRONMENT='$(installed_TESTS_ENVIRONMENT)' check-TESTS
endif !STANDALONE

if BUILD_STATIC
libasm = ../libasm/libasm.a
libdw = ../libdw/libdw.a $(zip_LIBS) $(libelf) $(libebl) -ldl
libelf = ../libelf/libelf.a
else
libasm = ../libasm/libasm.so
libdw = ../libdw/libdw.so
libelf = ../libelf/libelf.so
endif
libebl = ../libebl/libebl.a
libeu = ../lib/libeu.a

# XXX later the C++ stuff will be in libdw.so directly
libdwpp = ../libdw/libdwpp.a $(libdw)

dwarflint_LDADD  = $(libebl) $(libelf) $(libdwpp) $(libeu) $(libmudflap) -ldl
tests_test_coverage_LDADD  = $(libebl) $(libelf) $(libdwpp) $(libeu) $(libmudflap) -ldl
tests_test_all_dies_it_LDADD = $(libdwpp)

installcheck-binPROGRAMS: $(bin_PROGRAMS)
	bad=0; pid=$$$$; list="$(bin_PROGRAMS)"; for p in $$list; do \
	  case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \
	   *" $$p "* | *" $(srcdir)/$$p "*) continue;; \
	  esac; \
	  f=`echo "$$p" | \
	     sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
	  for opt in --help --version; do \
	    if LD_LIBRARY_PATH=$(DESTDIR)$(libdir) \
	       $(DESTDIR)$(bindir)/$$f $$opt > c$${pid}_.out 2> c$${pid}_.err \
	         && test -n "`cat c$${pid}_.out`" \
	         && test -z "`cat c$${pid}_.err`"; then :; \
	    else echo "$$f does not support $$opt" 1>&2; bad=1; fi; \
	  done; \
	done; rm -f c$${pid}_.???; exit $$bad

CLEANFILES += *.gconv

MAINTAINERCLEANFILES =