Makefile.in 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. # Makefile for uClibc (libubacktrace)
  2. #
  3. # Copyright (C) 2010 STMicroelectronics Ltd
  4. # Author: Carmelo Amoroso <carmelo.amoroso@st.com>
  5. # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  6. #
  7. subdirs += libubacktrace libubacktrace/$(TARGET_ARCH)
  8. CFLAGS-libubacktrace := -DNOT_IN_libc -DIS_IN_libubacktrace $(SSP_ALL_CFLAGS)
  9. LDFLAGS-libubacktrace.so := $(LDFLAGS) $(top_builddir)lib/libdl-$(VERSION).so
  10. LIBS-libubacktrace.so := $(LIBS)
  11. libubacktrace_FULL_NAME := libubacktrace-$(VERSION).so
  12. libubacktrace_DIR := $(top_srcdir)libubacktrace
  13. libubacktrace_OUT := $(top_builddir)libubacktrace
  14. libubacktrace_ARCH_DIR:=$(libubacktrace_DIR)/$(TARGET_ARCH)
  15. libubacktrace_ARCH_OUT:=$(libubacktrace_OUT)/$(TARGET_ARCH)
  16. -include $(libubacktrace_ARCH_DIR)/Makefile.arch
  17. libubacktrace_SRC-y :=
  18. libubacktrace_SRC-$(UCLIBC_HAS_BACKTRACE) := backtracesyms.c backtracesymsfd.c
  19. libubacktrace_SRC_SHARED-$(UCLIBC_HAS_BACKTRACE) := backtrace.c
  20. # remove generic sources, if arch specific version is present
  21. ifneq ($(strip $(libubacktrace_ARCH_SRC-y)),)
  22. libubacktrace_SRC-y := $(filter-out $(notdir $(libubacktrace_ARCH_SRC-y)),$(libubacktrace_SRC-y))
  23. libubacktrace_SRC_SHARED-y := $(filter-out $(notdir $(libubacktrace_ARCH_SRC-y)),$(libubacktrace_SRC_SHARED-y))
  24. endif
  25. # -fasynchronous-unwind-tables is required for backtrace to work using dwarf2
  26. CFLAGS-backtrace.c := -fasynchronous-unwind-tables
  27. libubacktrace_SRCS := $(patsubst %.c,$(libubacktrace_DIR)/%.c,$(libubacktrace_SRC-y))
  28. libubacktrace_OBJS := $(patsubst $(libubacktrace_DIR)/%.c,$(libubacktrace_OUT)/%.o,$(libubacktrace_SRCS))
  29. libubacktrace_SHARED_SRCS := $(patsubst %.c,$(libubacktrace_DIR)/%.c,$(libubacktrace_SRC_SHARED-y))
  30. libubacktrace_SHARED_OBJS := $(patsubst $(libubacktrace_DIR)/%.c,$(libubacktrace_OUT)/%.o,$(libubacktrace_SHARED_SRCS))
  31. libubacktrace-shared-y := $(libubacktrace_SHARED_OBJS:.o=.oS)
  32. libubacktrace-static-y := $(libubacktrace_SHARED_OBJS)
  33. ifeq ($(DOPIC),y)
  34. libubacktrace-a-y += $(libubacktrace_OBJS:.o=.os) $(libubacktrace-static-y:.o=.os)
  35. else
  36. libubacktrace-a-y += $(libubacktrace_OBJS) $(libubacktrace-static-y)
  37. endif
  38. libubacktrace-so-y += $(libubacktrace_OBJS:.o=.os) $(libubacktrace-shared-y)
  39. lib-a-$(UCLIBC_HAS_BACKTRACE) += $(top_builddir)lib/libubacktrace.a
  40. lib-so-$(UCLIBC_HAS_BACKTRACE) += $(top_builddir)lib/libubacktrace.so
  41. objclean-y += CLEAN_libubacktrace
  42. ifeq ($(DOMULTI),n)
  43. $(top_builddir)lib/libubacktrace.so: $(libubacktrace_OUT)/libubacktrace_so.a $(libdl.depend)
  44. $(call link.so,$(libubacktrace_FULL_NAME),$(ABI_VERSION))
  45. # link for backward compatibility
  46. $(call link.so,$(libubacktrace_FULL_NAME),0)
  47. else
  48. $(top_builddir)lib/libubacktrace.so: $(libubacktrace_OUT)/libubacktrace.oS | $(libdl.depend)
  49. $(call linkm.so,$(libubacktrace_FULL_NAME),$(ABI_VERSION))
  50. # link for backward compatibility
  51. $(call linkm.so,$(libubacktrace_FULL_NAME),0)
  52. endif
  53. $(libubacktrace_OUT)/libubacktrace_so.a: $(libubacktrace-so-y)
  54. $(Q)$(RM) $@
  55. $(do_ar)
  56. $(libubacktrace_OUT)/libubacktrace.oS: $(libubacktrace_SRCS) $(libubacktrace_ARCH_SRCS) $(libubacktrace_SHARED_SRCS)
  57. $(Q)$(RM) $@
  58. $(compile-m)
  59. $(top_builddir)lib/libubacktrace.a: $(libubacktrace-a-y)
  60. $(Q)$(INSTALL) -d $(dir $@)
  61. $(Q)$(RM) $@
  62. $(do_ar)
  63. CLEAN_libubacktrace:
  64. $(do_rm) $(addprefix $(libubacktrace_OUT)/*., o os oS a)