| 1 | if NO_SHARED |
| 2 | # Do not build this test if shared libraries support was |
| 3 | # explicitly disabled. |
| 4 | |
| 5 | CLEANFILES = libfoo.so libfoo.so.debug prog |
| 6 | |
| 7 | EXTRA_DIST = test_ust-dl test_ust-dl.py libfoo.c libfoo.h \ |
| 8 | prog.c |
| 9 | |
| 10 | else |
| 11 | |
| 12 | objcopy_verbose = $(objcopy_verbose_@AM_V@) |
| 13 | objcopy_verbose_ = $(objcopy_verbose_@AM_DEFAULT_V@) |
| 14 | objcopy_verbose_0 = @echo OBJCOPY $@; |
| 15 | |
| 16 | AM_CPPFLAGS = -I$(srcdir) -g |
| 17 | |
| 18 | noinst_PROGRAMS = prog |
| 19 | prog_SOURCES = prog.c |
| 20 | prog_LDADD = -ldl |
| 21 | |
| 22 | noinst_LTLIBRARIES = libfoo.la |
| 23 | libfoo_la_SOURCES = libfoo.c libfoo.h |
| 24 | libfoo_la_LDFLAGS = -module -shared -avoid-version \ |
| 25 | -rpath $(abs_builddir) |
| 26 | |
| 27 | CLEANFILES = libfoo.so libfoo.so.debug |
| 28 | |
| 29 | # Extract debug symbols |
| 30 | libfoo.so.debug: libfoo.la |
| 31 | $(objcopy_verbose)$(OBJCOPY) --only-keep-debug .libs/libfoo.so libfoo.so.debug |
| 32 | |
| 33 | # Strip and add debuglink |
| 34 | libfoo.so: libfoo.so.debug |
| 35 | @cp -f .libs/libfoo.so libfoo.so |
| 36 | $(objcopy_verbose)$(OBJCOPY) --strip-debug --add-gnu-debuglink=libfoo.so.debug libfoo.so |
| 37 | |
| 38 | noinst_SCRIPTS = test_ust-dl test_ust-dl.py |
| 39 | EXTRA_DIST = test_ust-dl test_ust-dl.py |
| 40 | |
| 41 | all-local: libfoo.so |
| 42 | @if [ x"$(srcdir)" != x"$(builddir)" ]; then \ |
| 43 | for script in $(EXTRA_DIST); do \ |
| 44 | cp -f $(srcdir)/$$script $(builddir); \ |
| 45 | done; \ |
| 46 | fi |
| 47 | |
| 48 | clean-local: |
| 49 | @if [ x"$(srcdir)" != x"$(builddir)" ]; then \ |
| 50 | for script in $(EXTRA_DIST); do \ |
| 51 | rm -f $(builddir)/$$script; \ |
| 52 | done; \ |
| 53 | fi |
| 54 | |
| 55 | endif |