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. START_FILE-librt.so := $(SHARED_START_FILES)
  16. END_FILE-librt.so := $(SHARED_END_FILES)
  17. librt_FULL_NAME := librt-$(VERSION).so
  18. librt_DIR := $(top_srcdir)librt
  19. librt_OUT := $(top_builddir)librt
  20. ifeq ($(UCLIBC_HAS_REALTIME),y)
  21. librt_SRC := $(notdir $(wildcard $(librt_DIR)/*.c))
  22. librt_filter_SRC :=
  23. ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
  24. librt_filter_SRC += mq_notify.c timer_create.c timer_delete.c \
  25. timer_getoverr.c timer_gettime.c timer_settime.c
  26. # these should really be guarded by ADVANCED_REALTIME, we use them in mq_send.c/mq_receive.c
  27. librt_SSRC := $(wildcard $(librt_DIR)/*.S)
  28. else
  29. librt_filter_SRC += clock_nanosleep.c clock_getcpuclockid.c clock_gettime.c
  30. librt_SSRC :=
  31. endif
  32. librt_filter_SRC += $(if $(UCLIBC_HAS_ADVANCED_REALTIME),, \
  33. spawn.c \
  34. spawn_faction_addclose.c \
  35. spawn_faction_adddup2.c \
  36. spawn_faction_addopen.c \
  37. spawn_faction_init.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. lib-a-y += $(top_builddir)lib/librt.a
  50. lib-so-y += $(top_builddir)lib/librt.so
  51. endif
  52. ifeq ($(DOPIC)$(UCLIBC_HAS_THREADS_NATIVE),yn)
  53. $(top_builddir)lib/librt.so: $(top_builddir)lib/librt.a $(libc.depend)
  54. else
  55. $(top_builddir)lib/librt.so: $(librt_OUT)/librt_so.a $(libc.depend) $(libpthread.depend) $(libdl.depend)
  56. endif
  57. $(call link.so,$(librt_FULL_NAME),$(ABI_VERSION))
  58. $(librt_OUT)/librt_so.a: $(librt-so-y)
  59. $(Q)$(RM) $@
  60. $(do_ar)
  61. $(top_builddir)lib/librt.a: $(librt-a-y) | $(top_builddir)lib
  62. $(Q)$(RM) $@
  63. $(do_ar)
  64. objclean-y += CLEAN_librt
  65. CLEAN_librt:
  66. $(do_rm) $(addprefix $(librt_OUT)/*., o os oS a)