1 # SPDX-License-Identifier: GPL-2.0-only
3 objcopy_verbose = $(objcopy_verbose_@AM_V@)
4 objcopy_verbose_ = $(objcopy_verbose_@AM_DEFAULT_V@)
5 objcopy_verbose_0 = @echo OBJCOPY $@;
7 AM_CPPFLAGS += -I$(srcdir) -g
10 prog_SOURCES = prog.c tp.c tp.h
11 prog_LDADD = $(UST_LIBS) $(DL_LIBS)
13 noinst_SCRIPTS = test_baddr-statedump test_baddr-statedump.py
14 EXTRA_DIST = test_baddr-statedump test_baddr-statedump.py
16 # Extract debug symbols
18 $(objcopy_verbose)$(OBJCOPY) --only-keep-debug prog prog.debug
20 # Strip and add debuglink
21 prog.strip: prog.debug
22 @cp -f prog prog.strip
23 $(objcopy_verbose)$(OBJCOPY) --strip-debug --add-gnu-debuglink=prog.debug prog.strip
26 @if [ x"$(srcdir)" != x"$(builddir)" ]; then \
27 for script in $(EXTRA_DIST); do \
28 cp -f $(srcdir)/$$script $(builddir); \
33 @if [ x"$(srcdir)" != x"$(builddir)" ]; then \
34 for script in $(EXTRA_DIST); do \
35 rm -f $(builddir)/$$script; \
39 CLEANFILES = prog.debug prog.strip