Makefile.in 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. # pass common flags to arch dirs
  28. ifneq ($(strip $(libubacktrace_ARCH_OBJS)),)
  29. CFLAGS-libubacktrace/$(TARGET_ARCH)/ := $(CFLAGS-libubacktrace)
  30. endif
  31. libubacktrace_SRCS := $(patsubst %.c,$(libubacktrace_DIR)/%.c,$(libubacktrace_SRC-y))
  32. libubacktrace_OBJS := $(patsubst $(libubacktrace_DIR)/%.c,$(libubacktrace_OUT)/%.o,$(libubacktrace_SRCS))
  33. libubacktrace_SHARED_SRCS := $(patsubst %.c,$(libubacktrace_DIR)/%.c,$(libubacktrace_SRC_SHARED-y))
  34. libubacktrace_SHARED_OBJS := $(patsubst $(libubacktrace_DIR)/%.c,$(libubacktrace_OUT)/%.o,$(libubacktrace_SHARED_SRCS))
  35. libubacktrace-shared-y := $(libubacktrace_SHARED_OBJS:.o=.oS)
  36. libubacktrace-static-y := $(libubacktrace_SHARED_OBJS)
  37. ifeq ($(DOPIC),y)
  38. libubacktrace-a-y += $(libubacktrace_OBJS:.o=.os) $(libubacktrace-static-y:.o=.os)
  39. else
  40. libubacktrace-a-y += $(libubacktrace_OBJS) $(libubacktrace-static-y)
  41. endif
  42. libubacktrace-so-y += $(libubacktrace_OBJS:.o=.os) $(libubacktrace-shared-y)
  43. lib-a-$(UCLIBC_HAS_BACKTRACE) += $(top_builddir)lib/libubacktrace.a
  44. lib-so-$(UCLIBC_HAS_BACKTRACE) += $(top_builddir)lib/libubacktrace.so
  45. objclean-y += CLEAN_libubacktrace
  46. ifeq ($(DOMULTI),n)
  47. $(top_builddir)lib/libubacktrace.so: $(libubacktrace_OUT)/libubacktrace_so.a $(libdl.depend)
  48. $(call link.so,$(libubacktrace_FULL_NAME),$(ABI_VERSION))
  49. else
  50. $(top_builddir)lib/libubacktrace.so: $(libubacktrace_OUT)/libubacktrace.oS | $(libdl.depend)
  51. $(call linkm.so,$(libubacktrace_FULL_NAME),$(ABI_VERSION))
  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)