1AM_CPPFLAGS = -I$(top_srcdir)/include
2
3EXTRA_DIST =	run-ia64-test-dyn1 run-ptrace-mapper run-ptrace-misc	\
4		run-check-namespace run-coredump-unwind \
5		run-coredump-unwind-mdi check-namespace.sh.in \
6		Gtest-nomalloc.c
7
8MAINTAINERCLEANFILES = Makefile.in
9
10noinst_PROGRAMS_common =
11check_PROGRAMS_common = test-proc-info test-static-link \
12			test-strerror
13check_SCRIPTS_common =	run-check-namespace
14
15if REMOTE_ONLY
16 check_SCRIPTS_cdep =
17 check_PROGRAMS_cdep =
18 noinst_PROGRAMS_cdep = $(noinst_PROGRAMS_common)
19
20perf:
21
22else
23 LIBUNWIND_local = $(top_builddir)/src/libunwind.la
24if ARCH_IA64
25 noinst_PROGRAMS_arch = ia64-test-dyn1
26 check_SCRIPTS_arch =	run-ia64-test-dyn1
27 check_PROGRAMS_arch =	Gia64-test-stack Lia64-test-stack		\
28			Gia64-test-nat Lia64-test-nat			\
29			Gia64-test-rbs Lia64-test-rbs			\
30			Gia64-test-readonly Lia64-test-readonly		\
31			ia64-test-setjmp ia64-test-sig
32else #!ARCH_IA64
33if ARCH_PPC64
34if USE_ALTIVEC
35 noinst_PROGRAMS_arch = ppc64-test-altivec
36endif #USE_ALTIVEC
37endif #ARCH_PPC64
38endif #!ARCH_IA64
39 check_SCRIPTS_cdep =
40 check_PROGRAMS_cdep =	Gtest-bt Ltest-bt Gtest-exc Ltest-exc		 \
41			Gtest-init Ltest-init				 \
42			Gtest-concurrent Ltest-concurrent		 \
43			Gtest-resume-sig Ltest-resume-sig		 \
44			Gtest-resume-sig-rt Ltest-resume-sig-rt		 \
45			Gtest-dyn1 Ltest-dyn1				 \
46			Gtest-trace Ltest-trace				 \
47			test-async-sig test-flush-cache test-init-remote \
48			test-mem Ltest-varargs Ltest-nomalloc	 \
49			Ltest-nocalloc Lrs-race
50 noinst_PROGRAMS_cdep = forker Gperf-simple Lperf-simple \
51			Gperf-trace Lperf-trace
52
53if BUILD_PTRACE
54 check_SCRIPTS_cdep += run-ptrace-mapper run-ptrace-misc
55 check_PROGRAMS_cdep += test-ptrace
56 noinst_PROGRAMS_cdep += mapper test-ptrace-misc
57endif
58
59if BUILD_SETJMP
60 check_PROGRAMS_cdep += test-setjmp
61endif
62
63if SUPPORT_CXX_EXCEPTIONS
64 check_PROGRAMS_cdep += Ltest-cxx-exceptions
65endif
66
67if OS_LINUX
68if BUILD_COREDUMP
69 check_SCRIPTS_cdep += run-coredump-unwind
70 noinst_PROGRAMS_cdep += crasher test-coredump-unwind
71
72if HAVE_LZMA
73 check_SCRIPTS_cdep += run-coredump-unwind-mdi
74endif # HAVE_LZMA
75endif # BUILD_COREDUMP
76endif # OS_LINUX
77
78perf: perf-startup Gperf-simple Lperf-simple Lperf-trace
79	@echo "########## Basic performance of generic libunwind:"
80	@./Gperf-simple
81	@echo "########## Basic performance of local-only libunwind:"
82	@./Lperf-simple
83	@echo "########## Performance of fast unwind:"
84	@./Lperf-trace
85	@echo "########## Startup overhead:"
86	@$(srcdir)/perf-startup @arch@
87
88endif
89
90check_PROGRAMS = $(check_PROGRAMS_common) $(check_PROGRAMS_cdep) \
91		 $(check_PROGRAMS_arch)
92check_SCRIPTS =	$(check_SCRIPTS_common) $(check_SCRIPTS_cdep) \
93		$(check_SCRIPTS_arch)
94
95
96TESTS = $(check_PROGRAMS) $(check_SCRIPTS)
97
98if !ARCH_IA64
99XFAIL_TESTS = Gtest-dyn1 Ltest-dyn1
100endif
101
102noinst_PROGRAMS = $(noinst_PROGRAMS_common) $(noinst_PROGRAMS_cdep) \
103	$(noinst_PROGRAMS_arch)
104
105Lia64_test_readonly_SOURCES = Lia64-test-readonly.c ia64-test-readonly-asm.S
106Gia64_test_readonly_SOURCES = Gia64-test-readonly.c ia64-test-readonly-asm.S
107Lia64_test_stack_SOURCES = Lia64-test-stack.c ia64-test-stack-asm.S \
108				ia64-test-stack.h
109Gia64_test_stack_SOURCES = Gia64-test-stack.c ia64-test-stack-asm.S \
110				ia64-test-stack.h
111Lia64_test_rbs_SOURCES = Lia64-test-rbs.c ia64-test-rbs-asm.S ia64-test-rbs.h
112Gia64_test_rbs_SOURCES = Gia64-test-rbs.c ia64-test-rbs-asm.S ia64-test-rbs.h
113Lia64_test_nat_SOURCES = Lia64-test-nat.c ia64-test-nat-asm.S
114Gia64_test_nat_SOURCES = Gia64-test-nat.c ia64-test-nat-asm.S
115ia64_test_dyn1_SOURCES = ia64-test-dyn1.c ia64-dyn-asm.S flush-cache.S \
116				flush-cache.h
117ppc64_test_altivec_SOURCES = ppc64-test-altivec.c  ppc64-test-altivec-utils.c
118Gtest_init_SOURCES = Gtest-init.cxx
119Ltest_init_SOURCES = Ltest-init.cxx
120Ltest_cxx_exceptions_SOURCES = Ltest-cxx-exceptions.cxx
121
122Gtest_dyn1_SOURCES = Gtest-dyn1.c flush-cache.S flush-cache.h
123Ltest_dyn1_SOURCES = Ltest-dyn1.c flush-cache.S flush-cache.h
124test_static_link_SOURCES = test-static-link-loc.c test-static-link-gen.c
125test_static_link_LDFLAGS = -static
126forker_LDFLAGS = -static
127Gtest_bt_SOURCES = Gtest-bt.c ident.c
128Ltest_bt_SOURCES = Ltest-bt.c ident.c
129test_ptrace_misc_SOURCES = test-ptrace-misc.c ident.c
130Ltest_nomalloc_SOURCES = Ltest-nomalloc.c
131Ltest_nocalloc_SOURCES = Ltest-nocalloc.c
132Gtest_trace_SOURCES = Gtest-trace.c ident.c
133Ltest_trace_SOURCES = Ltest-trace.c ident.c
134
135LIBUNWIND = $(top_builddir)/src/libunwind-$(arch).la
136LIBUNWIND_ptrace = $(top_builddir)/src/libunwind-ptrace.la
137LIBUNWIND_coredump = $(top_builddir)/src/libunwind-coredump.la
138
139if USE_ELF32
140LIBUNWIND_ELF = $(top_builddir)/src/libunwind-elf32.la
141endif
142if USE_ELF64
143LIBUNWIND_ELF = $(top_builddir)/src/libunwind-elf64.la
144endif
145if USE_ELFXX
146LIBUNWIND_ELF = $(top_builddir)/src/libunwind-elfxx.la
147endif
148
149LIBUNWIND_setjmp = $(top_builddir)/src/libunwind-setjmp.la	\
150		   $(LIBUNWIND_ELF) $(LIBUNWIND)
151
152test_async_sig_LDADD = $(LIBUNWIND_local) -lpthread
153test_flush_cache_LDADD = $(LIBUNWIND_local)
154test_init_remote_LDADD = $(LIBUNWIND) $(LIBUNWIND_local)
155test_mem_LDADD = $(LIBUNWIND) $(LIBUNWIND_local)
156test_ptrace_LDADD = $(LIBUNWIND_ptrace) $(LIBUNWIND)
157test_proc_info_LDADD = $(LIBUNWIND)
158test_static_link_LDADD = $(LIBUNWIND)
159test_strerror_LDADD = $(LIBUNWIND)
160Lrs_race_LDADD = $(LIBUNWIND_local) -lpthread
161Ltest_varargs_LDADD = $(LIBUNWIND_local)
162
163Gtest_bt_LDADD = $(LIBUNWIND) $(LIBUNWIND_local)
164Gtest_concurrent_LDADD = $(LIBUNWIND) $(LIBUNWIND_local) -lpthread
165Gtest_dyn1_LDADD = $(LIBUNWIND) $(LIBUNWIND_local)
166Gtest_exc_LDADD = $(LIBUNWIND) $(LIBUNWIND_local)
167Gtest_init_LDADD = $(LIBUNWIND) $(LIBUNWIND_local)
168Gtest_resume_sig_LDADD = $(LIBUNWIND) $(LIBUNWIND_local)
169Gtest_resume_sig_rt_LDADD = $(LIBUNWIND) $(LIBUNWIND_local)
170Gperf_simple_LDADD = $(LIBUNWIND) $(LIBUNWIND_local)
171Gtest_trace_LDADD=$(LIBUNWIND) $(LIBUNWIND_local)
172Gperf_trace_LDADD = $(LIBUNWIND) $(LIBUNWIND_local)
173
174Ltest_bt_LDADD = $(LIBUNWIND_local)
175Ltest_concurrent_LDADD = $(LIBUNWIND_local) -lpthread
176Ltest_dyn1_LDADD = $(LIBUNWIND_local)
177Ltest_exc_LDADD = $(LIBUNWIND_local)
178Ltest_init_LDADD = $(LIBUNWIND_local)
179Ltest_nomalloc_LDADD = $(LIBUNWIND_local) @DLLIB@
180Ltest_nocalloc_LDADD = $(LIBUNWIND_local) @DLLIB@ -lpthread
181Ltest_resume_sig_LDADD = $(LIBUNWIND_local)
182Ltest_resume_sig_rt_LDADD = $(LIBUNWIND_local)
183Lperf_simple_LDADD = $(LIBUNWIND_local)
184Ltest_trace_LDADD = $(LIBUNWIND_local)
185Lperf_trace_LDADD = $(LIBUNWIND_local)
186
187test_setjmp_LDADD = $(LIBUNWIND_setjmp)
188ia64_test_setjmp_LDADD = $(LIBUNWIND_setjmp)
189
190if BUILD_COREDUMP
191test_coredump_unwind_LDADD = $(LIBUNWIND_coredump) $(LIBUNWIND)
192endif
193
194Gia64_test_nat_LDADD = $(LIBUNWIND) $(LIBUNWIND_local)
195Gia64_test_stack_LDADD = $(LIBUNWIND) $(LIBUNWIND_local)
196Gia64_test_rbs_LDADD = $(LIBUNWIND) $(LIBUNWIND_local)
197Gia64_test_readonly_LDADD = $(LIBUNWIND) $(LIBUNWIND_local)
198Lia64_test_nat_LDADD = $(LIBUNWIND_local)
199Lia64_test_stack_LDADD = $(LIBUNWIND_local)
200Lia64_test_rbs_LDADD = $(LIBUNWIND_local)
201Lia64_test_readonly_LDADD = $(LIBUNWIND_local)
202ia64_test_dyn1_LDADD = $(LIBUNWIND)
203ia64_test_sig_LDADD = $(LIBUNWIND)
204