Makefile.in 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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) := backtrace.c backtracesyms.c backtracesymsfd.c
  19. # remove generic sources, if arch specific version is present
  20. ifneq ($(strip $(libubacktrace_ARCH_SRC-y)),)
  21. libubacktrace_SRC-y := $(filter-out $(notdir $(libubacktrace_ARCH_SRC-y)),$(libubacktrace_SRC-y))
  22. endif
  23. # -fasynchronous-unwind-tables is required for backtrace to work using dwarf2
  24. CFLAGS-backtrace.c := -fasynchronous-unwind-tables
  25. # pass common flags to arch dirs
  26. ifneq ($(strip $(libubacktrace_ARCH_OBJS)),)
  27. CFLAGS-libubacktrace/$(TARGET_ARCH)/ := $(CFLAGS-libubacktrace)
  28. endif
  29. libubacktrace_SRCS := $(patsubst %.c,$(libubacktrace_DIR)/%.c,$(libubacktrace_SRC-y))
  30. libubacktrace_OBJS := $(patsubst $(libubacktrace_DIR)/%.c,$(libubacktrace_OUT)/%.o,$(libubacktrace_SRCS))
  31. ifeq ($(DOPIC),y)
  32. libubacktrace-a-y += $(libubacktrace_OBJS:.o=.os)
  33. else
  34. libubacktrace-a-y += $(libubacktrace_OBJS)
  35. endif
  36. libubacktrace-so-y += $(libubacktrace_OBJS:.o=.os)
  37. lib-a-$(UCLIBC_HAS_BACKTRACE) += $(top_builddir)lib/libubacktrace.a
  38. lib-so-$(UCLIBC_HAS_BACKTRACE) += $(top_builddir)lib/libubacktrace.so
  39. objclean-y += CLEAN_libubacktrace
  40. ifeq ($(DOMULTI),n)
  41. ifeq ($(DOPIC),y)
  42. $(top_builddir)lib/libubacktrace.so: $(top_builddir)lib/libubacktrace.a $(libdl.depend)
  43. else
  44. $(top_builddir)lib/libubacktrace.so: $(libubacktrace_OUT)/libubacktrace_so.a $(libdl.depend)
  45. endif
  46. $(call link.so,$(libubacktrace_FULL_NAME),$(ABI_VERSION))
  47. else
  48. $(top_builddir)lib/libubacktrace.so: $(libubacktrace_OUT)/libubacktrace.oS | $(libdl.depend)
  49. $(call linkm.so,$(libubacktrace_FULL_NAME),$(ABI_VERSION))
  50. endif
  51. $(libubacktrace_OUT)/libubacktrace_so.a: $(libubacktrace-so-y)
  52. $(Q)$(RM) $@
  53. $(do_ar)
  54. $(libubacktrace_OUT)/libubacktrace.oS: $(libubacktrace_SRCS) $(libubacktrace_ARCH_SRCS)
  55. $(Q)$(RM) $@
  56. $(compile-m)
  57. $(top_builddir)lib/libubacktrace.a: $(libubacktrace-a-y)
  58. $(Q)$(INSTALL) -d $(dir $@)
  59. $(Q)$(RM) $@
  60. $(do_ar)
  61. CLEAN_libubacktrace:
  62. $(do_rm) $(addprefix $(libubacktrace_OUT)/*., o os oS a)