aboutsummaryrefslogtreecommitdiff
path: root/librt/Makefile.in
blob: 6eb508cb2718e02b52ee093cb03c0c8698b76359 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# 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-librt.so := $(LDFLAGS)
LIBS-librt.so := $(LIBS)
ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
LIBS-librt.so += $(top_builddir)lib/libdl.so $(top_builddir)lib/libpthread.so
endif

librt_FULL_NAME := librt-$(VERSION).so

librt_DIR := $(top_srcdir)librt
librt_OUT := $(top_builddir)librt

ifeq ($(UCLIBC_HAS_REALTIME),y)
ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
librt_CSRC := $(filter-out mq_notify.c timer_create.c timer_delete.c	\
		timer_getoverr.c timer_gettime.c timer_settime.c,	\
		$(notdir $(wildcard $(librt_DIR)/*.c)))
librt_SSRC := $(wildcard $(librt_DIR)/*.S)
librt_OBJ := $(patsubst %.c,$(librt_OUT)/%.o,$(librt_CSRC))
librt_OBJ += $(patsubst $(librt_DIR)/%.S,$(librt_OUT)/%.o,$(librt_SSRC))
else
librt_SRC := $(filter-out clock_nanosleep.c clock_getcpuclockid.c clock_gettime.c,	\
		$(notdir $(wildcard $(librt_DIR)/*.c)))
librt_OBJ := $(patsubst %.c,$(librt_OUT)/%.o,$(librt_SRC))
endif

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)

lib-a-y += $(top_builddir)lib/librt.a
lib-so-y += $(top_builddir)lib/librt.so
endif


ifeq ($(DOPIC)$(UCLIBC_HAS_THREADS_NATIVE),yn)
$(top_builddir)lib/librt.so: $(top_builddir)lib/librt.a $(libc.depend)
else
$(top_builddir)lib/librt.so: $(librt_OUT)/librt_so.a $(libc.depend) $(libpthread.depend) $(libdl.depend)
endif
	$(call link.so,$(librt_FULL_NAME),$(ABI_VERSION))

$(librt_OUT)/librt_so.a: $(librt-so-y)
	$(Q)$(RM) $@
	$(do_ar)

$(top_builddir)lib/librt.a: $(librt-a-y) | $(top_builddir)lib
	$(Q)$(RM) $@
	$(do_ar)

objclean-y += CLEAN_librt

CLEAN_librt:
	$(do_rm) $(addprefix $(librt_OUT)/*., o os oS a)