Makefile.in 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. # 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_SRC := $(filter-out $(librt_filter_SRC),$(librt_SRC))
  37. librt_OBJ := $(patsubst %.c,$(librt_OUT)/%.o,$(librt_SRC))
  38. librt_OBJ += $(patsubst $(librt_DIR)/%.S,$(librt_OUT)/%.o,$(librt_SSRC))
  39. ASFLAGS-mq_timedreceive.S = -D_LIBC_REENTRANT
  40. ASFLAGS-mq_timedsend.S = -D_LIBC_REENTRANT
  41. ifeq ($(DOPIC),y)
  42. librt-a-y += $(librt_OBJ:.o=.os)
  43. else
  44. librt-a-y += $(librt_OBJ)
  45. endif
  46. librt-so-y += $(librt_OBJ:.o=.oS)
  47. lib-a-y += $(top_builddir)lib/librt.a
  48. lib-so-y += $(top_builddir)lib/librt.so
  49. endif
  50. librt-dep-y := $(libc.depend)
  51. librt-dep-$(UCLIBC_HAS_THREADS_NATIVE) += $(libpthread.depend) $(libdl.depend)
  52. # for NPTL we need SHARED regardless of DOPIC
  53. ifeq ($(if $(UCLIBC_HAS_THREADS_NATIVE),,$(DOPIC)),y)
  54. $(top_builddir)lib/librt.so: $(top_builddir)lib/librt.a $(librt-dep-y)
  55. else
  56. $(top_builddir)lib/librt.so: $(librt_OUT)/librt_so.a $(librt-dep-y)
  57. endif
  58. $(call link.so,$(librt_FULL_NAME),$(ABI_VERSION))
  59. $(librt_OUT)/librt_so.a: $(librt-so-y)
  60. $(Q)$(RM) $@
  61. $(do_ar)
  62. $(top_builddir)lib/librt.a: $(librt-a-y)
  63. $(Q)$(RM) $@
  64. $(do_ar)
  65. objclean-y += CLEAN_librt
  66. CLEAN_librt:
  67. $(do_rm) $(addprefix $(librt_OUT)/*., o os oS a)