Commit | Line | Data |
---|---|---|
cdbfb1b9 MD |
1 | if NO_SHARED |
2 | # Do not build this test if shared libraries support was | |
3 | # explicitly disabled. | |
4 | ||
818df80b JG |
5 | CLEANFILES = libbar.so libbar.so.debug libfoo.so libfoo.so.debug \ |
6 | libzzz.so libzzz.so.debug prog libtp.so | |
cdbfb1b9 | 7 | |
818df80b JG |
8 | EXTRA_DIST = test_ust-dl test_ust-dl.py libbar.c libbar.h libbar-tp.h \ |
9 | libbar-tp.c libfoo.c libfoo.h libfoo-tp.h libfoo-tp.c \ | |
10 | libzzz.c libzzz.h libzzz-tp.h libzzz-tp.c prog.c libtp.c | |
cdbfb1b9 MD |
11 | |
12 | else | |
13 | ||
65385a82 MJ |
14 | objcopy_verbose = $(objcopy_verbose_@AM_V@) |
15 | objcopy_verbose_ = $(objcopy_verbose_@AM_DEFAULT_V@) | |
16 | objcopy_verbose_0 = @echo OBJCOPY $@; | |
17 | ||
343af227 | 18 | AM_CPPFLAGS += -I$(srcdir) -g |
c70c42cc AB |
19 | |
20 | noinst_PROGRAMS = prog | |
21 | prog_SOURCES = prog.c | |
22 | prog_LDADD = -ldl | |
23 | ||
818df80b | 24 | noinst_LTLIBRARIES = libzzz.la libbar.la libfoo.la libtp.la |
d8ed06af MD |
25 | |
26 | libzzz_la_SOURCES = libzzz.c libzzz.h | |
27 | libzzz_la_LDFLAGS = -module -shared -avoid-version \ | |
28 | -rpath $(abs_builddir) | |
29 | ||
30 | libbar_la_SOURCES = libbar.c libbar.h | |
31 | libbar_la_LDFLAGS = -module -shared -avoid-version \ | |
32 | -rpath $(abs_builddir) | |
33 | libbar_la_LIBADD = libzzz.la | |
34 | ||
c70c42cc AB |
35 | libfoo_la_SOURCES = libfoo.c libfoo.h |
36 | libfoo_la_LDFLAGS = -module -shared -avoid-version \ | |
37 | -rpath $(abs_builddir) | |
d8ed06af | 38 | libfoo_la_LIBADD = libbar.la |
c70c42cc | 39 | |
d8ed06af | 40 | CLEANFILES = libfoo.so libfoo.so.debug libbar.so libbar.so.debug \ |
818df80b JG |
41 | libzzz.so libzzz.so.debug libtp.so |
42 | ||
43 | libtp_la_SOURCES = libbar-tp.h libbar-tp.c libfoo-tp.h libfoo-tp.c \ | |
44 | libzzz-tp.h libzzz-tp.c | |
45 | libtp_la_LDFLAGS = -module -shared -rpath $(abs_builddir) | |
c70c42cc | 46 | |
65385a82 MJ |
47 | # Extract debug symbols |
48 | libfoo.so.debug: libfoo.la | |
49 | $(objcopy_verbose)$(OBJCOPY) --only-keep-debug .libs/libfoo.so libfoo.so.debug | |
d8ed06af MD |
50 | libbar.so.debug: libbar.la |
51 | $(objcopy_verbose)$(OBJCOPY) --only-keep-debug .libs/libbar.so libbar.so.debug | |
52 | libzzz.so.debug: libzzz.la | |
53 | $(objcopy_verbose)$(OBJCOPY) --only-keep-debug .libs/libzzz.so libzzz.so.debug | |
65385a82 MJ |
54 | |
55 | # Strip and add debuglink | |
56 | libfoo.so: libfoo.so.debug | |
57 | @cp -f .libs/libfoo.so libfoo.so | |
58 | $(objcopy_verbose)$(OBJCOPY) --strip-debug --add-gnu-debuglink=libfoo.so.debug libfoo.so | |
d8ed06af MD |
59 | libbar.so: libbar.so.debug |
60 | @cp -f .libs/libbar.so libbar.so | |
61 | $(objcopy_verbose)$(OBJCOPY) --strip-debug --add-gnu-debuglink=libbar.so.debug libbar.so | |
62 | libzzz.so: libzzz.so.debug | |
63 | @cp -f .libs/libzzz.so libzzz.so | |
64 | $(objcopy_verbose)$(OBJCOPY) --strip-debug --add-gnu-debuglink=libzzz.so.debug libzzz.so | |
65385a82 | 65 | |
818df80b JG |
66 | libtp.so: libtp.la |
67 | @cp -f .libs/libtp.so libtp.so | |
68 | ||
cdbfb1b9 MD |
69 | noinst_SCRIPTS = test_ust-dl test_ust-dl.py |
70 | EXTRA_DIST = test_ust-dl test_ust-dl.py | |
71 | ||
818df80b | 72 | all-local: libfoo.so libbar.so libzzz.so libtp.so |
c70c42cc AB |
73 | @if [ x"$(srcdir)" != x"$(builddir)" ]; then \ |
74 | for script in $(EXTRA_DIST); do \ | |
75 | cp -f $(srcdir)/$$script $(builddir); \ | |
76 | done; \ | |
77 | fi | |
c70c42cc AB |
78 | |
79 | clean-local: | |
80 | @if [ x"$(srcdir)" != x"$(builddir)" ]; then \ | |
81 | for script in $(EXTRA_DIST); do \ | |
82 | rm -f $(builddir)/$$script; \ | |
83 | done; \ | |
84 | fi | |
65385a82 | 85 | |
cdbfb1b9 | 86 | endif |