Makefile.in 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. libubacktrace_DIR := $(top_srcdir)libubacktrace
  10. libubacktrace_OUT := $(top_builddir)libubacktrace
  11. libubacktrace_ARCH_DIR:=$(libubacktrace_DIR)/$(TARGET_ARCH)
  12. libubacktrace_ARCH_OUT:=$(libubacktrace_OUT)/$(TARGET_ARCH)
  13. -include $(libubacktrace_ARCH_DIR)/Makefile.arch
  14. libubacktrace_SRC-y :=
  15. libubacktrace_SRC-$(UCLIBC_HAS_BACKTRACE) := backtracesyms.c backtracesymsfd.c
  16. libubacktrace_SRC_SHARED-$(UCLIBC_HAS_BACKTRACE) := backtrace.c
  17. # remove generic sources, if arch specific version is present
  18. ifneq ($(strip $(libubacktrace_ARCH_SRC-y)),)
  19. libubacktrace_SRC-y := $(filter-out $(notdir $(libubacktrace_ARCH_SRC-y)),$(libubacktrace_SRC-y))
  20. libubacktrace_SRC_SHARED-y := $(filter-out $(notdir $(libubacktrace_ARCH_SRC-y)),$(libubacktrace_SRC_SHARED-y))
  21. endif
  22. # -fasynchronous-unwind-tables is required for backtrace to work using dwarf2
  23. CFLAGS-backtrace.c := -fasynchronous-unwind-tables
  24. libubacktrace_SRCS := $(patsubst %.c,$(libubacktrace_DIR)/%.c,$(libubacktrace_SRC-y))
  25. libubacktrace_OBJS := $(patsubst $(libubacktrace_DIR)/%.c,$(libubacktrace_OUT)/%.o,$(libubacktrace_SRCS))
  26. libubacktrace_SHARED_SRCS := $(patsubst %.c,$(libubacktrace_DIR)/%.c,$(libubacktrace_SRC_SHARED-y))
  27. libubacktrace_SHARED_OBJS := $(patsubst $(libubacktrace_DIR)/%.c,$(libubacktrace_OUT)/%.o,$(libubacktrace_SHARED_SRCS))
  28. libubacktrace-shared-y := $(libubacktrace_SHARED_OBJS:.o=.oS)
  29. libubacktrace-static-y := $(libubacktrace_SHARED_OBJS)
  30. ifeq ($(DOPIC),y)
  31. libubacktrace-a-y += $(libubacktrace_OBJS:.o=.os) $(libubacktrace-static-y:.o=.os)
  32. else
  33. libubacktrace-a-y += $(libubacktrace_OBJS) $(libubacktrace-static-y)
  34. endif
  35. libubacktrace-so-y += $(libubacktrace_OBJS:.o=.os) $(libubacktrace-shared-y)
  36. objclean-y += CLEAN_libubacktrace
  37. $(libubacktrace_OUT)/libubacktrace.oS: $(libubacktrace_SRCS) $(libubacktrace_ARCH_SRCS) $(libubacktrace_SHARED_SRCS)
  38. $(Q)$(RM) $@
  39. $(compile-m)
  40. CLEAN_libubacktrace:
  41. $(do_rm) $(addprefix $(libubacktrace_OUT)/*., o os oS a)