Makefile.in 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. ifeq ($(DOPIC)$(UCLIBC_HAS_THREADS_NATIVE),yn)
  51. $(top_builddir)lib/librt.so: $(top_builddir)lib/librt.a $(libc.depend)
  52. else
  53. $(top_builddir)lib/librt.so: $(librt_OUT)/librt_so.a $(libc.depend) $(libpthread.depend) $(libdl.depend)
  54. endif
  55. $(call link.so,$(librt_FULL_NAME),$(ABI_VERSION))
  56. $(librt_OUT)/librt_so.a: $(librt-so-y)
  57. $(Q)$(RM) $@
  58. $(do_ar)
  59. $(top_builddir)lib/librt.a: $(librt-a-y) | $(top_builddir)lib
  60. $(Q)$(RM) $@
  61. $(do_ar)
  62. objclean-y += CLEAN_librt
  63. CLEAN_librt:
  64. $(do_rm) $(addprefix $(librt_OUT)/*., o os oS a)