2 BUILD_ID_SUFFIX
=d98cdd87f7fe64c13b6daad553987eafd40cbb
3 BUILD_ID
=$(BUILD_ID_PREFIX
)$(BUILD_ID_SUFFIX
)
7 OBJS
=$(BUILD_DIR
)/dwarf_full
/libhello_so \
8 $(BUILD_DIR
)/elf_only
/libhello_so \
9 $(BUILD_DIR
)/build_id
/libhello_so \
10 $(BUILD_DIR
)/debug_link
/libhello_so
15 $(CC
) -gdwarf
-fdebug-prefix-map
=$(CURDIR
)=.
-fPIC
-c
-I.
-o
$@
$<
17 # Master copy: ELF with DWARF and build-id
18 $(BUILD_DIR
)/dwarf_full
/libhello_so
: tp.o libhello.o
20 $(CC
) -shared
-gdwarf
-llttng-ust
-ldl
-Wl
,-soname
,libhello.so
-Wl
,--build-id
=0x
$(BUILD_ID
) -o
$@
$^
22 # ELF only, no debug symbols, no build-d
23 $(BUILD_DIR
)/elf_only
/libhello_so
: $(BUILD_DIR
)/dwarf_full
/libhello_so
26 objcopy
--remove-section
=.note.gnu.build-id
$@.tmp
29 # ELF with external build-id DWARF
30 $(BUILD_DIR
)/build_id
/libhello_so
: $(BUILD_DIR
)/dwarf_full
/libhello_so
31 mkdir
-p
$(@D
)/.build-id
/$(BUILD_ID_PREFIX
)
32 objcopy
--only-keep-debug
$< $(@D
)/.build-id
/$(BUILD_ID_PREFIX
)/$(BUILD_ID_SUFFIX
).debug
35 # ELF with external debug link DWARF
36 $(BUILD_DIR
)/debug_link
/libhello_so
: $(BUILD_DIR
)/dwarf_full
/libhello_so
38 objcopy
--remove-section
=.note.gnu.build-id
$< $@.tmp
39 objcopy
--only-keep-debug
$@.tmp
$(@D
)/libhello_so.debug
41 cd
$(@D
) && objcopy
--add-gnu-debuglink
=libhello_so.debug
$(@F
).tmp
50 .PHONY
: all clean dist-clean