summaryrefslogtreecommitdiff
path: root/libubacktrace/Makefile.in
diff options
context:
space:
mode:
Diffstat (limited to 'libubacktrace/Makefile.in')
-rw-r--r--libubacktrace/Makefile.in26
1 files changed, 20 insertions, 6 deletions
diff --git a/libubacktrace/Makefile.in b/libubacktrace/Makefile.in
index b18e3e675..f675bf579 100644
--- a/libubacktrace/Makefile.in
+++ b/libubacktrace/Makefile.in
@@ -6,7 +6,7 @@
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-subdirs += libubacktrace
+subdirs += libubacktrace libubacktrace/$(TARGET_ARCH)
CFLAGS-libubacktrace := -DNOT_IN_libc -DIS_IN_libubacktrace $(SSP_ALL_CFLAGS)
@@ -23,22 +23,36 @@ libubacktrace_FULL_NAME := libubacktrace-$(VERSION).so
libubacktrace_DIR := $(top_srcdir)libubacktrace
libubacktrace_OUT := $(top_builddir)libubacktrace
+libubacktrace_ARCH_DIR:=$(libubacktrace_DIR)/$(TARGET_ARCH)
+libubacktrace_ARCH_OUT:=$(libubacktrace_OUT)/$(TARGET_ARCH)
+
+-include $(libubacktrace_ARCH_DIR)/Makefile.arch
+
libubacktrace_SRC-y :=
libubacktrace_SRC-$(UCLIBC_HAS_BACKTRACE) := backtrace.c backtracesyms.c backtracesymsfd.c
+# remove generic sources, if arch specific version is present
+ifneq ($(strip $(libubacktrace_ARCH_SRC-y)),)
+libubacktrace_SRC-y := $(filter-out $(notdir $(libubacktrace_ARCH_SRC-y)),$(libubacktrace_SRC-y))
+endif
+
# -fasynchronous-unwind-tables is required for backtrace to work using dwarf2
CFLAGS-backtrace.c := -fasynchronous-unwind-tables
+# pass common flags to arch dirs
+ifneq ($(strip $(libubacktrace_ARCH_OBJS)),)
+CFLAGS-libubacktrace/$(TARGET_ARCH)/ := $(CFLAGS-libubacktrace)
+endif
-libubacktrace_SRCS := $(addprefix $(libubacktrace_DIR)/,$(libubacktrace_SRC-y))
+libubacktrace_SRCS := $(patsubst %.c,$(libubacktrace_DIR)/%.c,$(libubacktrace_SRC-y))
libubacktrace_OBJS := $(patsubst $(libubacktrace_DIR)/%.c,$(libubacktrace_OUT)/%.o,$(libubacktrace_SRCS))
ifeq ($(DOPIC),y)
-libubacktrace-a-y := $(libubacktrace_OBJS:.o=.os)
+libubacktrace-a-y += $(libubacktrace_OBJS:.o=.os)
else
-libubacktrace-a-y := $(libubacktrace_OBJS)
+libubacktrace-a-y += $(libubacktrace_OBJS)
endif
-libubacktrace-so-y := $(libubacktrace_OBJS:.o=.os)
+libubacktrace-so-y += $(libubacktrace_OBJS:.o=.os)
lib-a-$(UCLIBC_HAS_BACKTRACE) += $(top_builddir)lib/libubacktrace.a
lib-so-$(UCLIBC_HAS_BACKTRACE) += $(top_builddir)lib/libubacktrace.so
@@ -61,7 +75,7 @@ $(libubacktrace_OUT)/libubacktrace_so.a: $(libubacktrace-so-y)
$(Q)$(RM) $@
$(do_ar)
-$(libubacktrace_OUT)/libubacktrace.oS: $(libubacktrace_SRCS)
+$(libubacktrace_OUT)/libubacktrace.oS: $(libubacktrace_SRCS) $(libubacktrace_ARCH_SRCS)
$(Q)$(RM) $@
$(compile-m)