Commit | Line | Data |
---|---|---|
9d16b343 MJ |
1 | # SPDX-License-Identifier: GPL-2.0-only |
2 | ||
65385a82 MJ |
3 | objcopy_verbose = $(objcopy_verbose_@AM_V@) |
4 | objcopy_verbose_ = $(objcopy_verbose_@AM_DEFAULT_V@) | |
5 | objcopy_verbose_0 = @echo OBJCOPY $@; | |
6 | ||
343af227 | 7 | AM_CPPFLAGS += -I$(srcdir) -g |
d4f53cc3 AB |
8 | |
9 | noinst_PROGRAMS = prog | |
10 | prog_SOURCES = prog.c tp.c tp.h | |
20dd2de1 | 11 | prog_LDADD = $(UST_LIBS) $(DL_LIBS) |
d4f53cc3 AB |
12 | |
13 | noinst_SCRIPTS = test_baddr-statedump test_baddr-statedump.py | |
14 | EXTRA_DIST = test_baddr-statedump test_baddr-statedump.py | |
15 | ||
65385a82 MJ |
16 | # Extract debug symbols |
17 | prog.debug: prog | |
18 | $(objcopy_verbose)$(OBJCOPY) --only-keep-debug prog prog.debug | |
19 | ||
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 | |
24 | ||
25 | all-local: prog.strip | |
d4f53cc3 AB |
26 | @if [ x"$(srcdir)" != x"$(builddir)" ]; then \ |
27 | for script in $(EXTRA_DIST); do \ | |
28 | cp -f $(srcdir)/$$script $(builddir); \ | |
29 | done; \ | |
30 | fi | |
d4f53cc3 AB |
31 | |
32 | clean-local: | |
33 | @if [ x"$(srcdir)" != x"$(builddir)" ]; then \ | |
34 | for script in $(EXTRA_DIST); do \ | |
35 | rm -f $(builddir)/$$script; \ | |
36 | done; \ | |
37 | fi | |
65385a82 MJ |
38 | |
39 | CLEANFILES = prog.debug prog.strip |