Makefile.in 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. $(top_builddir)lib/libubacktrace.so: $(libubacktrace_OUT)/libubacktrace_so.a $(libdl.depend)
  43. $(call link.so,$(libubacktrace_FULL_NAME),$(ABI_VERSION))
  44. # link for backward compatibility
  45. $(call link.so,$(libubacktrace_FULL_NAME),0)
  46. $(libubacktrace_OUT)/libubacktrace_so.a: $(libubacktrace-so-y)
  47. $(Q)$(RM) $@
  48. $(do_ar)
  49. $(libubacktrace_OUT)/libubacktrace.oS: $(libubacktrace_SRCS) $(libubacktrace_ARCH_SRCS) $(libubacktrace_SHARED_SRCS)
  50. $(Q)$(RM) $@
  51. $(compile-m)
  52. $(top_builddir)lib/libubacktrace.a: $(libubacktrace-a-y)
  53. $(Q)$(INSTALL) -d $(dir $@)
  54. $(Q)$(RM) $@
  55. $(do_ar)
  56. CLEAN_libubacktrace:
  57. $(do_rm) $(addprefix $(libubacktrace_OUT)/*., o os oS a)