summaryrefslogtreecommitdiff
path: root/libpthread/nptl_db/Makefile.in
blob: 56f1b78c68d8b649adbd4118ed10b9c76afe8334 (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
71
# Makefile for uClibc
#
# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
#
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#

subdirs += libpthread/nptl/nptl_db

# Get the thread include dependencies and shared object name
CFLAGS-nptl_db := -DLIBPTHREAD_SO="\"libpthread.so.$(ABI_VERSION)\""
CFLAGS-nptl_db += -I$(top_srcdir)libpthread/nptl -D_GNU_SOURCE
CFLAGS-nptl_db += -DIS_IN_libthread_db=1 -DNOT_IN_libc -std=gnu99 -I$(top_srcdir)ldso/include

LDFLAGS-libthread_db.so := $(LDFLAGS_NOSTRIP) -s --warn-unresolved-symbols

LIBS-libthread_db.so := $(LIBS)

libthread_db_FULL_NAME := libthread_db-$(VERSION).so

libthread_db_DIR := $(top_srcdir)libpthread/nptl_db
libthread_db_OUT := $(top_builddir)libpthread/nptl_db

libthread_db_SRC := $(wildcard $(libthread_db_DIR)/td_*.c)	\
		    $(libthread_db_DIR)/fetch-value.c

libthread_db_OBJ := $(patsubst $(libthread_db_DIR)/%.c,$(libthread_db_OUT)/%.o,$(libthread_db_SRC))

libthread_db-so-y := $(libthread_db_OBJ:.o=.oS)
ifeq ($(DOPIC),y)
libthread_db-a-y := $(libthread_db-so-y)
else
libthread_db-a-y := $(libthread_db_OBJ)
endif

libthread_db-multi-y := $(libthread_db_SRC)

lib-a-$(PTHREADS_DEBUG_SUPPORT) += $(top_builddir)lib/libthread_db.a
lib-so-$(PTHREADS_DEBUG_SUPPORT) += $(top_builddir)lib/libthread_db.so
objclean-y += libthread_db_clean
headers-$(PTHREADS_DEBUG_SUPPORT) += $(nptl_db_headers)
headers_clean-y += nptl_db_headers_clean

ifeq ($(DOPIC),y)
$(top_builddir)lib/libthread_db.so: $(top_builddir)lib/libthread_db.a $(libc)
else
$(top_builddir)lib/libthread_db.so: $(libthread_db_OUT)/libthread_db_so.a $(libc)
endif
	$(call link.so,$(libthread_db_FULL_NAME),1)

$(libthread_db_OUT)/libthread_db_so.a: $(libthread_db-so-y)
	$(Q)$(RM) $@
	$(do_strip)
	$(do_ar)

$(top_builddir)lib/libthread_db.a: $(libthread_db-a-y)
	$(Q)$(INSTALL) -d $(dir $@)
	$(Q)$(RM) $@
	$(do_strip)
	$(do_ar)

$(top_builddir)include/thread_db.h:
	$(do_ln) $(call rel_srcdir)$(PTDIR)_db/$(@F) $@

nptl_db_headers:= $(top_builddir)include/thread_db.h

nptl_db_headers_clean:
	$(do_rm) $(nptl_db_headers)

libthread_db_clean:
	$(do_rm) $(addprefix $(libthread_db_OUT)/*., o oS a)