Imported Upstream version 0.153
[platform/upstream/elfutils.git] / tests / Makefile.am
1 ## Process this file with automake to create Makefile.in
2 ##
3 ## Copyright (C) 1996-2011 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 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 include $(top_srcdir)/config/eu.am
28 if MUDFLAP
29 BUILD_RPATH = \$$ORIGIN/../backends
30 else
31 BUILD_RPATH = \$$ORIGIN/../libasm:\$$ORIGIN/../libdw:\$$ORIGIN/../backends:\$$ORIGIN/../libelf
32 endif
33
34 AM_LDFLAGS =
35
36 if !STANDALONE
37 INCLUDES += -I$(top_srcdir)/libasm -I$(top_srcdir)/libdw \
38             -I$(top_srcdir)/libdwfl \
39             -I$(top_srcdir)/libebl -I$(top_srcdir)/libelf \
40             -I$(top_srcdir)/lib -I..
41 AM_LDFLAGS += -Wl,-rpath-link,../libasm:../libdw:../libelf
42 endif
43
44 if TESTS_RPATH
45 AM_LDFLAGS += -Wl,-rpath,$(BUILD_RPATH)
46 tests_rpath = yes
47 else
48 tests_rpath = no
49 endif
50
51 noinst_PROGRAMS = arextract arsymtest newfile saridx scnnames sectiondump \
52                   showptable update1 update2 update3 update4 test-nlist \
53                   show-die-info get-files get-lines get-pubnames \
54                   get-aranges allfcts line2addr addrscopes funcscopes \
55                   show-abbrev hash newscn ecp dwflmodtest \
56                   find-prologues funcretval allregs rdwrmmap \
57                   dwfl-bug-addr-overflow arls dwfl-bug-fd-leak \
58                   dwfl-addr-sect dwfl-bug-report early-offscn \
59                   dwfl-bug-getmodules dwarf-getmacros addrcfi \
60                   test-flag-nobits dwarf-getstring rerequest_tag \
61                   alldts md5-sha1-test
62 asm_TESTS = asm-tst1 asm-tst2 asm-tst3 asm-tst4 asm-tst5 \
63             asm-tst6 asm-tst7 asm-tst8 asm-tst9
64
65 TESTS = run-arextract.sh run-arsymtest.sh newfile test-nlist \
66         update1 update2 update3 update4 \
67         run-show-die-info.sh run-get-files.sh run-get-lines.sh \
68         run-get-pubnames.sh run-get-aranges.sh run-allfcts.sh \
69         run-show-abbrev.sh run-line2addr.sh hash \
70         newscn run-strip-test.sh run-strip-test2.sh \
71         run-strip-test3.sh run-strip-test4.sh run-strip-test5.sh \
72         run-strip-test6.sh run-strip-test7.sh run-strip-test8.sh \
73         run-strip-groups.sh run-strip-reloc.sh \
74         run-unstrip-test.sh run-unstrip-test2.sh \
75         run-ecp-test.sh run-ecp-test2.sh run-alldts.sh \
76         run-elflint-test.sh run-elflint-self.sh run-ranlib-test.sh \
77         run-ranlib-test2.sh run-ranlib-test3.sh run-ranlib-test4.sh \
78         run-addrscopes.sh run-strings-test.sh run-funcscopes.sh \
79         run-find-prologues.sh run-allregs.sh \
80         run-readelf-test1.sh run-readelf-test2.sh run-readelf-test3.sh \
81         run-readelf-test4.sh run-readelf-twofiles.sh \
82         run-native-test.sh run-bug1-test.sh \
83         dwfl-bug-addr-overflow run-addrname-test.sh \
84         dwfl-bug-fd-leak dwfl-bug-report \
85         run-dwfl-bug-offline-rel.sh run-dwfl-addr-sect.sh \
86         run-disasm-x86.sh run-disasm-x86-64.sh \
87         run-early-offscn.sh run-dwarf-getmacros.sh \
88         run-test-flag-nobits.sh run-prelink-addr-test.sh \
89         run-dwarf-getstring.sh run-rerequest_tag.sh
90 # run-show-ciefde.sh
91
92 if !STANDALONE
93 noinst_PROGRAMS += msg_tst md5-sha1-test
94 TESTS += msg_tst md5-sha1-test
95 endif
96
97 if HAVE_LIBASM
98 noinst_PROGRAMS += $(asm_TESTS)
99 TESTS += $(asm_TESTS)
100 endif
101
102
103 EXTRA_DIST = run-arextract.sh run-arsymtest.sh \
104              run-show-die-info.sh run-get-files.sh run-get-lines.sh \
105              run-get-pubnames.sh run-get-aranges.sh \
106              run-show-ciefde.sh run-show-abbrev.sh run-strip-test.sh \
107              run-strip-test2.sh run-ecp-test.sh run-ecp-test2.sh \
108              testfile.bz2 testfile2.bz2 testfile3.bz2 testfile4.bz2 \
109              testfile5.bz2 testfile6.bz2 testfile7.bz2 testfile8.bz2 \
110              testfile9.bz2 testfile10.bz2 testfile11.bz2 testfile12.bz2 \
111              testfile13.bz2 run-strip-test3.sh run-allfcts.sh \
112              run-line2addr.sh run-elflint-test.sh testfile14.bz2 \
113              run-strip-test4.sh run-strip-test5.sh run-strip-test6.sh \
114              run-strip-test7.sh run-strip-test8.sh run-strip-groups.sh \
115              run-strip-reloc.sh hello_i386.ko.bz2 hello_x86_64.ko.bz2 \
116              hello_ppc64.ko.bz2 hello_s390.ko.bz2 \
117              run-unstrip-test.sh run-unstrip-test2.sh \
118              run-elflint-self.sh run-ranlib-test.sh run-ranlib-test2.sh \
119              run-ranlib-test3.sh run-ranlib-test4.sh \
120              run-addrscopes.sh run-strings-test.sh run-funcscopes.sh \
121              run-find-prologues.sh run-allregs.sh run-native-test.sh \
122              run-addrname-test.sh run-dwfl-bug-offline-rel.sh \
123              run-dwfl-addr-sect.sh run-early-offscn.sh \
124              run-dwarf-getmacros.sh run-test-flag-nobits.sh \
125              run-dwarf-getstring.sh run-rerequest_tag.sh run-alldts.sh \
126              testfile15.bz2 testfile15.debug.bz2 \
127              testfile16.bz2 testfile16.debug.bz2 \
128              testfile17.bz2 testfile17.debug.bz2 \
129              testfile18.bz2 testfile19.bz2 testfile19.index.bz2 \
130              testfile20.bz2 testfile20.index.bz2 \
131              testfile21.bz2 testfile21.index.bz2 \
132              testfile22.bz2 testfile23.bz2 testfile24.bz2 testfile25.bz2 \
133              testfile26.bz2 testfile27.bz2 \
134              coverage.sh test-subr.sh test-wrapper.sh \
135              run-readelf-test1.sh run-readelf-test2.sh run-readelf-test3.sh \
136              run-readelf-test4.sh run-readelf-twofiles.sh \
137              run-bug1-test.sh testfile28.bz2 testfile28.rdwr.bz2 \
138              testfile29.bz2 testfile29.rdwr.bz2 \
139              testfile30.bz2 testfile31.bz2 testfile32.bz2 testfile33.bz2 \
140              testfile34.bz2 testfile35.bz2 testfile35.debug.bz2 \
141              testfile36.bz2 testfile36.debug.bz2 \
142              testfile37.bz2 testfile37.debug.bz2 \
143              testfile38.bz2 testfile39.bz2 testfile40.bz2 testfile40.debug.bz2 \
144              testfile41.bz2 testfile42.bz2 testfile43.bz2 \
145              testfile44.S.bz2 testfile44.expect.bz2 run-disasm-x86.sh \
146              testfile45.S.bz2 testfile45.expect.bz2 run-disasm-x86-64.sh \
147              testfile46.bz2 testfile47.bz2 testfile48.bz2 testfile48.debug.bz2 \
148              testfile49.bz2 testfile50.bz2 testfile51.bz2 \
149              run-prelink-addr-test.sh \
150              testfile52-32.so.bz2 testfile52-32.so.debug.bz2 \
151              testfile52-32.prelink.so.bz2 testfile52-32.noshdrs.so.bz2 \
152              testfile52-64.so.bz2 testfile52-64.so.debug.bz2 \
153              testfile52-64.prelink.so.bz2 testfile52-64.noshdrs.so.bz2 \
154              testfile53-32.bz2 testfile53-32.debug.bz2 \
155              testfile53-32.prelink.bz2 testfile53-64.bz2 \
156              testfile53-64.debug.bz2 testfile53-64.prelink.bz2 \
157              testfile54-32.so.bz2 testfile54-32.so.debug.bz2 \
158              testfile54-32.prelink.so.bz2 testfile54-32.noshdrs.so.bz2 \
159              testfile54-64.so.bz2 testfile54-64.so.debug.bz2 \
160              testfile54-64.prelink.so.bz2 testfile54-64.noshdrs.so.bz2 \
161              testfile55-32.bz2 testfile55-32.debug.bz2 \
162              testfile55-32.prelink.bz2 testfile55-64.bz2 \
163              testfile55-64.debug.bz2 testfile55-64.prelink.bz2 \
164              testfile56.bz2 testfile57.bz2 testfile58.bz2
165
166 installed_TESTS_ENVIRONMENT = libdir=$(DESTDIR)$(libdir) \
167                               bindir=$(DESTDIR)$(bindir) \
168                               $(srcdir)/test-wrapper.sh \
169                               installed $(tests_rpath) \
170                               $(program_transform_name)
171 if STANDALONE
172 TESTS_ENVIRONMENT = $(installed_TESTS_ENVIRONMENT)
173 else !STANDALONE
174 TESTS_ENVIRONMENT = $(srcdir)/test-wrapper.sh \
175                     ../libdw:../backends:../libelf:../libasm
176
177 installcheck-local:
178         $(MAKE) $(AM_MAKEFLAGS) \
179                 TESTS_ENVIRONMENT='$(installed_TESTS_ENVIRONMENT)' check-TESTS
180 endif !STANDALONE
181
182 if MUDFLAP
183 static_build = yes
184 endif
185
186 if STANDALONE
187 libdw = -ldw
188 libelf = -lelf
189 libasm = -lasm
190 libebl = -lebl
191 else !STANDALONE
192 if BUILD_STATIC
193 libdw = ../libdw/libdw.a $(zip_LIBS) $(libelf) $(libebl) -ldl
194 libelf = ../libelf/libelf.a
195 libasm = ../libasm/libasm.a
196 else
197 libdw = ../libdw/libdw.so
198 libelf = ../libelf/libelf.so
199 libasm = ../libasm/libasm.so
200 endif
201 libebl = ../libebl/libebl.a
202 libeu = ../lib/libeu.a
203 endif !STANDALONE
204
205 arextract_LDADD = $(libelf) $(libmudflap)
206 arsymtest_LDADD = $(libelf) $(libmudflap)
207 newfile_LDADD = $(libelf) $(libmudflap)
208 saridx_LDADD = $(libelf) $(libmudflap)
209 scnnames_LDADD = $(libelf) $(libmudflap)
210 sectiondump_LDADD = $(libelf) $(libmudflap)
211 showptable_LDADD = $(libelf) $(libmudflap)
212 hash_LDADD = $(libelf) $(libmudflap)
213 test_nlist_LDADD = $(libelf) $(libmudflap)
214 msg_tst_LDADD = $(libelf) $(libmudflap)
215 newscn_LDADD = $(libelf) $(libmudflap)
216 early_offscn_LDADD = $(libelf) $(libmudflap)
217 ecp_LDADD = $(libelf) $(libmudflap)
218 update1_LDADD = $(libelf) $(libmudflap)
219 update2_LDADD = $(libelf) $(libmudflap)
220 update3_LDADD = $(libebl) $(libelf) $(libmudflap)
221 update4_LDADD = $(libebl) $(libelf) $(libmudflap)
222 show_die_info_LDADD = $(libdw) $(libelf) $(libmudflap)
223 get_pubnames_LDADD = $(libdw) $(libelf) $(libmudflap)
224 show_abbrev_LDADD = $(libdw) $(libelf) $(libmudflap)
225 get_lines_LDADD = $(libdw) $(libelf) $(libmudflap)
226 get_files_LDADD = $(libdw) $(libelf) $(libmudflap)
227 get_aranges_LDADD = $(libdw) $(libelf) $(libmudflap)
228 allfcts_LDADD = $(libdw) $(libelf) $(libmudflap)
229 line2addr_no_Wformat = yes
230 line2addr_LDADD = $(libdw) $(libmudflap)
231 addrscopes_LDADD = $(libdw) $(libmudflap)
232 funcscopes_LDADD = $(libdw) $(libmudflap)
233 funcretval_LDADD = $(libdw) $(libmudflap)
234 allregs_LDADD = $(libdw) $(libmudflap)
235 find_prologues_LDADD = $(libdw) $(libmudflap)
236 #show_ciefde_LDADD = ../libdwarf/libdwarf.so $(libelf) $(libmudflap)
237 asm_tst1_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) -ldl
238 asm_tst2_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) -ldl
239 asm_tst3_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) -ldl
240 asm_tst4_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) -ldl
241 asm_tst5_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) -ldl
242 asm_tst6_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) -ldl
243 asm_tst7_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) -ldl
244 asm_tst8_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) -ldl
245 asm_tst9_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) -ldl
246 dwflmodtest_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
247 rdwrmmap_LDADD = $(libelf) $(libmudflap)
248 dwfl_bug_addr_overflow_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
249 arls_LDADD = $(libelf) $(libmudflap)
250 dwfl_bug_fd_leak_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
251 dwfl_bug_report_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
252 dwfl_bug_getmodules_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
253 dwfl_addr_sect_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
254 dwarf_getmacros_LDADD = $(libdw) $(libmudflap)
255 dwarf_getstring_LDADD = $(libdw) $(libmudflap)
256 addrcfi_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
257 test_flag_nobits_LDADD = $(libelf) $(libmudflap)
258 rerequest_tag_LDADD = $(libdw) $(libmudflap)
259 alldts_LDADD = $(libebl) $(libelf) $(libmudflap)
260 md5_sha1_test_LDADD = $(libeu)
261
262 if GCOV
263 check: check-am coverage
264 .PHONY: coverage
265 coverage:
266         -$(srcdir)/coverage.sh
267 endif