123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- # Makefile for uClibc
- #
- # Copyright (C) 2000-2008 Erik Andersen <andersen@uclibc.org>
- #
- # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
- #
- subdirs += librt
- CFLAGS-librt := -DNOT_IN_libc -DIS_IN_librt $(SSP_ALL_CFLAGS)
- LDFLAGS-$(UCLIBC_FORMAT_DSBT_ELF)-librt.so := -Wl,--dsbt-index=9
- LDFLAGS-librt.so := $(LDFLAGS)
- LIBS-librt.so := $(LIBS)
- ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
- LIBS-librt.so += $(top_builddir)lib/libpthread.so \
- $(CC_FLAG_ASNEEDED) $(top_builddir)lib/libdl.so $(CC_FLAG_NO_ASNEEDED)
- endif
- librt_FULL_NAME := librt-$(VERSION).so
- librt_DIR := $(top_srcdir)librt
- librt_OUT := $(top_builddir)librt
- librt_SRC := $(notdir $(wildcard $(librt_DIR)/*.c))
- librt_filter_SRC :=
- ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
- librt_filter_SRC += mq_notify.c timer_create.c timer_delete.c \
- timer_getoverr.c timer_gettime.c timer_settime.c
- # these should really be guarded by ADVANCED_REALTIME, we use them in mq_send.c/mq_receive.c
- librt_SSRC := $(wildcard $(librt_DIR)/*.S)
- else
- librt_filter_SRC += clock_nanosleep.c clock_getcpuclockid.c clock_gettime.c
- librt_SSRC :=
- endif
- librt_filter_SRC += $(if $(UCLIBC_HAS_ADVANCED_REALTIME),, \
- spawn.c \
- spawn_faction_addclose.c \
- spawn_faction_adddup2.c \
- spawn_faction_addopen.c \
- spawn_faction_init.c)
- librt_filter_SRC += $(if $(UCLIBC_HAS_STUBS),,rt_stubs.c)
- librt_filter_SRC += $(if $(HAS_NO_THREADS),dso_handle.c)
- librt_SRC := $(filter-out $(librt_filter_SRC),$(librt_SRC))
- librt_OBJ := $(patsubst %.c,$(librt_OUT)/%.o,$(librt_SRC))
- librt_OBJ += $(patsubst $(librt_DIR)/%.S,$(librt_OUT)/%.o,$(librt_SSRC))
- ASFLAGS-mq_timedreceive.S = -D_LIBC_REENTRANT
- ASFLAGS-mq_timedsend.S = -D_LIBC_REENTRANT
- ifeq ($(DOPIC),y)
- librt-a-y += $(librt_OBJ:.o=.os)
- else
- librt-a-y += $(librt_OBJ)
- endif
- librt-so-y += $(librt_OBJ:.o=.oS)
- ifeq ($(UCLIBC_HAS_REALTIME),y)
- lib-a-y += $(top_builddir)lib/librt.a
- lib-so-y += $(top_builddir)lib/librt.so
- endif
- librt-dep-y := $(libc.depend)
- librt-dep-$(UCLIBC_HAS_THREADS_NATIVE) += $(libpthread.depend) $(libdl.depend)
- # for NPTL we need SHARED regardless of DOPIC
- ifeq ($(if $(UCLIBC_HAS_THREADS_NATIVE),,$(DOPIC)),y)
- $(top_builddir)lib/librt.so: $(top_builddir)lib/librt.a $(librt-dep-y)
- else
- $(top_builddir)lib/librt.so: $(librt_OUT)/librt_so.a $(librt-dep-y)
- endif
- $(call link.so,$(librt_FULL_NAME),$(ABI_VERSION))
- # link for backward compatibility
- $(call link.so,$(librt_FULL_NAME),0)
- $(librt_OUT)/librt_so.a: $(librt-so-y)
- $(Q)$(RM) $@
- $(do_ar)
- $(top_builddir)lib/librt.a: $(librt-a-y)
- $(Q)$(RM) $@
- $(do_ar)
- objclean-y += CLEAN_librt
- CLEAN_librt:
- $(do_rm) $(addprefix $(librt_OUT)/*., o os oS a)
|