Merge remote-tracking branch 'origin/upstream'
[uclibc-ng.git] / libubacktrace / Makefile.in
blob1cd5f838582eabd0b8c0e78f58758f26e1115c3f
1 # Makefile for uClibc (libubacktrace)
3 # Copyright (C) 2010 STMicroelectronics Ltd
4 # Author: Carmelo Amoroso <carmelo.amoroso@st.com>
6 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
9 subdirs += libubacktrace libubacktrace/$(TARGET_ARCH)
11 CFLAGS-libubacktrace := -DNOT_IN_libc -DIS_IN_libubacktrace $(SSP_ALL_CFLAGS)
13 LDFLAGS-libubacktrace.so := $(LDFLAGS) $(top_builddir)lib/libdl-$(VERSION).so
15 LIBS-libubacktrace.so := $(LIBS)
17 libubacktrace_FULL_NAME := libubacktrace-$(VERSION).so
19 libubacktrace_DIR := $(top_srcdir)libubacktrace
20 libubacktrace_OUT := $(top_builddir)libubacktrace
22 libubacktrace_ARCH_DIR:=$(libubacktrace_DIR)/$(TARGET_ARCH)
23 libubacktrace_ARCH_OUT:=$(libubacktrace_OUT)/$(TARGET_ARCH)
25 -include $(libubacktrace_ARCH_DIR)/Makefile.arch
27 libubacktrace_SRC-y :=
28 libubacktrace_SRC-$(UCLIBC_HAS_BACKTRACE) := backtracesyms.c backtracesymsfd.c
29 libubacktrace_SRC_SHARED-$(UCLIBC_HAS_BACKTRACE) := backtrace.c
31 # remove generic sources, if arch specific version is present
32 ifneq ($(strip $(libubacktrace_ARCH_SRC-y)),)
33 libubacktrace_SRC-y := $(filter-out $(notdir $(libubacktrace_ARCH_SRC-y)),$(libubacktrace_SRC-y))
34 libubacktrace_SRC_SHARED-y := $(filter-out $(notdir $(libubacktrace_ARCH_SRC-y)),$(libubacktrace_SRC_SHARED-y))
35 endif
37 # -fasynchronous-unwind-tables is required for backtrace to work using dwarf2
38 CFLAGS-backtrace.c := -fasynchronous-unwind-tables
40 # pass common flags to arch dirs
41 ifneq ($(strip $(libubacktrace_ARCH_OBJS)),)
42 CFLAGS-libubacktrace/$(TARGET_ARCH)/ := $(CFLAGS-libubacktrace)
43 endif
45 libubacktrace_SRCS := $(patsubst %.c,$(libubacktrace_DIR)/%.c,$(libubacktrace_SRC-y))
46 libubacktrace_OBJS := $(patsubst $(libubacktrace_DIR)/%.c,$(libubacktrace_OUT)/%.o,$(libubacktrace_SRCS))
48 libubacktrace_SHARED_SRCS := $(patsubst %.c,$(libubacktrace_DIR)/%.c,$(libubacktrace_SRC_SHARED-y))
49 libubacktrace_SHARED_OBJS := $(patsubst $(libubacktrace_DIR)/%.c,$(libubacktrace_OUT)/%.o,$(libubacktrace_SHARED_SRCS))
51 libubacktrace-shared-y := $(libubacktrace_SHARED_OBJS:.o=.oS)
52 libubacktrace-static-y := $(libubacktrace_SHARED_OBJS)
54 ifeq ($(DOPIC),y)
55 libubacktrace-a-y += $(libubacktrace_OBJS:.o=.os) $(libubacktrace-static-y:.o=.os)
56 else
57 libubacktrace-a-y += $(libubacktrace_OBJS) $(libubacktrace-static-y)
58 endif
59 libubacktrace-so-y += $(libubacktrace_OBJS:.o=.os) $(libubacktrace-shared-y)
62 lib-a-$(UCLIBC_HAS_BACKTRACE) += $(top_builddir)lib/libubacktrace.a
63 lib-so-$(UCLIBC_HAS_BACKTRACE) += $(top_builddir)lib/libubacktrace.so
65 objclean-y += CLEAN_libubacktrace
67 ifeq ($(DOMULTI),n)
68 $(top_builddir)lib/libubacktrace.so: $(libubacktrace_OUT)/libubacktrace_so.a $(libdl.depend)
69 $(call link.so,$(libubacktrace_FULL_NAME),$(ABI_VERSION))
70 else
71 $(top_builddir)lib/libubacktrace.so: $(libubacktrace_OUT)/libubacktrace.oS | $(libdl.depend)
72 $(call linkm.so,$(libubacktrace_FULL_NAME),$(ABI_VERSION))
73 endif
75 $(libubacktrace_OUT)/libubacktrace_so.a: $(libubacktrace-so-y)
76 $(Q)$(RM) $@
77 $(do_ar)
79 $(libubacktrace_OUT)/libubacktrace.oS: $(libubacktrace_SRCS) $(libubacktrace_ARCH_SRCS) $(libubacktrace_SHARED_SRCS)
80 $(Q)$(RM) $@
81 $(compile-m)
83 $(top_builddir)lib/libubacktrace.a: $(libubacktrace-a-y)
84 $(Q)$(INSTALL) -d $(dir $@)
85 $(Q)$(RM) $@
86 $(do_ar)
88 CLEAN_libubacktrace:
89 $(do_rm) $(addprefix $(libubacktrace_OUT)/*., o os oS a)