Makefile.in 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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/libpthread.so \
  14. $(CC_FLAG_ASNEEDED) $(top_builddir)lib/libdl.so $(CC_FLAG_NO_ASNEEDED)
  15. endif
  16. librt_FULL_NAME := librt-$(VERSION).so
  17. librt_DIR := $(top_srcdir)librt
  18. librt_OUT := $(top_builddir)librt
  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. # these should really be guarded by ADVANCED_REALTIME, we use them in mq_send.c/mq_receive.c
  25. librt_SSRC := $(wildcard $(librt_DIR)/*.S)
  26. else
  27. librt_filter_SRC += clock_nanosleep.c clock_getcpuclockid.c clock_gettime.c
  28. librt_SSRC :=
  29. endif
  30. librt_filter_SRC += $(if $(UCLIBC_HAS_ADVANCED_REALTIME),, \
  31. spawn.c \
  32. spawn_faction_addclose.c \
  33. spawn_faction_adddup2.c \
  34. spawn_faction_addopen.c \
  35. spawn_faction_init.c)
  36. librt_filter_SRC += $(if $(UCLIBC_HAS_STUBS),,rt_stubs.c)
  37. librt_filter_SRC += $(if $(HAS_NO_THREADS),dso_handle.c)
  38. librt_SRC := $(filter-out $(librt_filter_SRC),$(librt_SRC))
  39. librt_OBJ := $(patsubst %.c,$(librt_OUT)/%.o,$(librt_SRC))
  40. librt_OBJ += $(patsubst $(librt_DIR)/%.S,$(librt_OUT)/%.o,$(librt_SSRC))
  41. ASFLAGS-mq_timedreceive.S = -D_LIBC_REENTRANT
  42. ASFLAGS-mq_timedsend.S = -D_LIBC_REENTRANT
  43. ifeq ($(DOPIC),y)
  44. librt-a-y += $(librt_OBJ:.o=.os)
  45. else
  46. librt-a-y += $(librt_OBJ)
  47. endif
  48. librt-so-y += $(librt_OBJ:.o=.oS)
  49. ifeq ($(UCLIBC_HAS_REALTIME),y)
  50. lib-a-y += $(top_builddir)lib/librt.a
  51. lib-so-y += $(top_builddir)lib/librt.so
  52. endif
  53. librt-dep-y := $(libc.depend)
  54. librt-dep-$(UCLIBC_HAS_THREADS_NATIVE) += $(libpthread.depend) $(libdl.depend)
  55. # for NPTL we need SHARED regardless of DOPIC
  56. ifeq ($(if $(UCLIBC_HAS_THREADS_NATIVE),,$(DOPIC)),y)
  57. $(top_builddir)lib/librt.so: $(top_builddir)lib/librt.a $(librt-dep-y)
  58. else
  59. $(top_builddir)lib/librt.so: $(librt_OUT)/librt_so.a $(librt-dep-y)
  60. endif
  61. $(call link.so,$(librt_FULL_NAME),$(ABI_VERSION))
  62. $(librt_OUT)/librt_so.a: $(librt-so-y)
  63. $(Q)$(RM) $@
  64. $(do_ar)
  65. $(top_builddir)lib/librt.a: $(librt-a-y)
  66. $(Q)$(RM) $@
  67. $(do_ar)
  68. objclean-y += CLEAN_librt
  69. CLEAN_librt:
  70. $(do_rm) $(addprefix $(librt_OUT)/*., o os oS a)