Makefile.in 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. # Makefile for uClibc
  2. #
  3. # Copyright (C) 2000-2008 Erik Andersen <andersen@uclibc.org>
  4. #
  5. # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  6. #
  7. subdirs += librt
  8. CFLAGS-librt := -DNOT_IN_libc -DIS_IN_librt $(SSP_ALL_CFLAGS)
  9. LDFLAGS-$(UCLIBC_FORMAT_DSBT_ELF)-librt.so := -Wl,--dsbt-index=9
  10. LDFLAGS-librt.so := $(LDFLAGS)
  11. LIBS-librt.so := $(LIBS)
  12. ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
  13. LIBS-librt.so += $(top_builddir)lib/libdl.so $(top_builddir)lib/libpthread.so
  14. endif
  15. librt_FULL_NAME := librt-$(VERSION).so
  16. librt_DIR := $(top_srcdir)librt
  17. librt_OUT := $(top_builddir)librt
  18. ifeq ($(UCLIBC_HAS_REALTIME),y)
  19. librt_SRC := $(notdir $(wildcard $(librt_DIR)/*.c))
  20. librt_filter_SRC :=
  21. ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
  22. librt_filter_SRC += mq_notify.c timer_create.c timer_delete.c \
  23. timer_getoverr.c timer_gettime.c timer_settime.c
  24. librt_SSRC := $(wildcard $(librt_DIR)/*.S)
  25. else
  26. librt_filter_SRC += clock_nanosleep.c clock_getcpuclockid.c clock_gettime.c
  27. librt_SSRC :=
  28. endif
  29. librt_filter_SRC += $(if $(UCLIBC_HAS_ADVANCED_REALTIME),, \
  30. spawn.c \
  31. spawn_faction_addclose.c \
  32. spawn_faction_adddup2.c \
  33. spawn_faction_addopen.c \
  34. spawn_faction_init.c)
  35. librt_SRC := $(filter-out $(librt_filter_SRC),$(librt_SRC))
  36. librt_OBJ := $(patsubst %.c,$(librt_OUT)/%.o,$(librt_SRC))
  37. librt_OBJ += $(patsubst $(librt_DIR)/%.S,$(librt_OUT)/%.o,$(librt_SSRC))
  38. ASFLAGS-mq_timedreceive.S = -D_LIBC_REENTRANT
  39. ASFLAGS-mq_timedsend.S = -D_LIBC_REENTRANT
  40. ifeq ($(DOPIC),y)
  41. librt-a-y += $(librt_OBJ:.o=.os)
  42. else
  43. librt-a-y += $(librt_OBJ)
  44. endif
  45. librt-so-y += $(librt_OBJ:.o=.oS)
  46. lib-a-y += $(top_builddir)lib/librt.a
  47. lib-so-y += $(top_builddir)lib/librt.so
  48. endif
  49. ifeq ($(DOPIC)$(UCLIBC_HAS_THREADS_NATIVE),yn)
  50. $(top_builddir)lib/librt.so: $(top_builddir)lib/librt.a $(libc.depend)
  51. else
  52. $(top_builddir)lib/librt.so: $(librt_OUT)/librt_so.a $(libc.depend) $(libpthread.depend) $(libdl.depend)
  53. endif
  54. $(call link.so,$(librt_FULL_NAME),$(ABI_VERSION))
  55. $(librt_OUT)/librt_so.a: $(librt-so-y)
  56. $(Q)$(RM) $@
  57. $(do_ar)
  58. $(top_builddir)lib/librt.a: $(librt-a-y) | $(top_builddir)lib
  59. $(Q)$(RM) $@
  60. $(do_ar)
  61. objclean-y += CLEAN_librt
  62. CLEAN_librt:
  63. $(do_rm) $(addprefix $(librt_OUT)/*., o os oS a)