Makefile.in 2.9 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
  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)/sysdeps/$(TARGET_ARCH)
  15. libubacktrace_ARCH_OUT := $(libubacktrace_OUT)/sysdeps/$(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. CFLAGS-libubacktrace/sysdeps/$(TARGET_ARCH)/ := $(CFLAGS-libubacktrace)
  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_ARCH_SRC := $(addprefix $(libubacktrace_ARCH_DIR)/,$(libubacktrace_ARCH_SRC-y))
  24. libubacktrace_ARCH_OBJ := $(patsubst $(libubacktrace_ARCH_DIR)/%.c,$(libubacktrace_ARCH_OUT)/%.o,$(libubacktrace_ARCH_SRC))
  25. endif
  26. libubacktrace_SRC := $(addprefix $(libubacktrace_DIR)/,$(libubacktrace_SRC-y))
  27. libubacktrace_OBJ := $(patsubst $(libubacktrace_DIR)/%.c,$(libubacktrace_OUT)/%.o,$(libubacktrace_SRC))
  28. libubacktrace_SRCS := $(libubacktrace_SRC) $(libubacktrace_ARCH_SRC)
  29. libubacktrace_OBJS := $(libubacktrace_OBJ) $(libubacktrace_ARCH_OBJ)
  30. ifeq ($(DOPIC),y)
  31. libubacktrace-a-y := $(libubacktrace_OBJS:.o=.os)
  32. else
  33. libubacktrace-a-y := $(libubacktrace_OBJS)
  34. endif
  35. libubacktrace-so-y := $(libubacktrace_OBJS:.o=.os)
  36. lib-a-$(UCLIBC_HAS_BACKTRACE) += $(top_builddir)lib/libubacktrace.a
  37. lib-so-$(UCLIBC_HAS_BACKTRACE) += $(top_builddir)lib/libubacktrace.so
  38. objclean-y += CLEAN_libubacktrace
  39. ifeq ($(DOMULTI),n)
  40. ifeq ($(DOPIC),y)
  41. $(top_builddir)lib/libubacktrace.so: $(top_builddir)lib/libubacktrace.a $(libdl.depend)
  42. else
  43. $(top_builddir)lib/libubacktrace.so: $(libubacktrace_OUT)/libubacktrace_so.a $(libdl.depend)
  44. endif
  45. $(call link.so,$(libubacktrace_FULL_NAME),$(ABI_VERSION))
  46. else
  47. $(top_builddir)lib/libubacktrace.so: $(libubacktrace_OUT)/libubacktrace.oS | $(libdl.depend)
  48. $(call linkm.so,$(libubacktrace_FULL_NAME),$(ABI_VERSION))
  49. endif
  50. $(libubacktrace_OUT)/libubacktrace_so.a: $(libubacktrace-so-y)
  51. $(Q)$(RM) $@
  52. $(do_ar)
  53. $(libubacktrace_OUT)/libubacktrace.oS: $(libubacktrace_SRCS)
  54. $(Q)$(RM) $@
  55. $(compile-m)
  56. $(top_builddir)lib/libubacktrace.a: $(libubacktrace-a-y)
  57. $(Q)$(INSTALL) -d $(dir $@)
  58. $(Q)$(RM) $@
  59. $(do_ar)
  60. CLEAN_libubacktrace:
  61. $(do_rm) $(addprefix $(libubacktrace_OUT)/*., o os oS a) \
  62. $(addprefix $(libubacktrace_ARCH_OUT)/*., o os oS a)