blob: 8741eab7c7b4b600364a924fb9db8e2cc86751e2 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001# 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
8subdirs += libpthread/linuxthreads.old_db
9
10# Get the thread include dependencies and shared object name
11CFLAGS-linuxthreads.old_db := -DNOT_IN_libc -DLIBPTHREAD_SO="\"libpthread.so.$(ABI_VERSION)\""
12
13LDFLAGS-libthread_db.so := $(LDFLAGS_NOSTRIP) $(if $(call check_ld,--warn-unresolved-symbols),-Wl$(comma)--warn-unresolved-symbols)
14ifeq ($(DOSTRIP),y)
15LDFLAGS-libthread_db.so += -Wl,-s
16endif
17
18LIBS-libthread_db.so := $(LIBS)
19
20libthread_db_FULL_NAME := libthread_db-$(VERSION).so
21
22libthread_db_DIR := $(top_srcdir)libpthread/linuxthreads.old_db
23libthread_db_OUT := $(top_builddir)libpthread/linuxthreads.old_db
24
25libthread_db_SRC := $(wildcard $(libthread_db_DIR)/*.c)
26
27libthread_db_OBJ := $(patsubst $(libthread_db_DIR)/%.c,$(libthread_db_OUT)/%.o,$(libthread_db_SRC))
28
29libthread_db-so-y := $(libthread_db_OBJ:.o=.os)
30ifeq ($(DOPIC),y)
31libthread_db-a-y := $(libthread_db-so-y)
32else
33libthread_db-a-y := $(libthread_db_OBJ)
34endif
35
36lib-a-$(PTHREADS_DEBUG_SUPPORT) += $(top_builddir)lib/libthread_db.a
37lib-so-$(PTHREADS_DEBUG_SUPPORT) += $(top_builddir)lib/libthread_db.so
38
39#ifeq ($(DOMULTI),n)
40ifeq ($(DOPIC),y)
41$(top_builddir)lib/libthread_db.so: $(top_builddir)lib/libthread_db.a $(libc.depend)
42else
43$(top_builddir)lib/libthread_db.so: $(libthread_db_OUT)/libthread_db_so.a $(libc.depend)
44endif
45 $(call link.so,$(libthread_db_FULL_NAME),1)
46#else
47#$(top_builddir)lib/libthread_db.so: $(libthread_db_OUT)/libthread_db.oS | $(libc.depend)
48# $(call linkm.so,$(libthread_db_FULL_NAME),1)
49#endif
50
51$(libthread_db_OUT)/libthread_db_so.a: $(libthread_db-so-y)
52 $(Q)$(RM) $@
53 $(do_ar)
54
55$(libthread_db_OUT)/libthread_db.oS: $(libthread_db_SRC)
56 $(Q)$(RM) $@
57 $(compile-m)
58
59$(top_builddir)lib/libthread_db.a: $(libthread_db-a-y)
60 $(Q)$(INSTALL) -d $(dir $@)
61 $(Q)$(RM) $@
62 $(do_ar)
63
64$(top_builddir)include/thread_db.h:
65 $(do_ln) $(call rel_srcdir)$(PTDIR)_db/$(@F) $@
66
67linuxthreads_db_headers := $(top_builddir)include/thread_db.h
68$(linuxthreads_db_headers): $(wildcard $(addprefix $(top_builddir)include/config/linuxthreads/,old.h new.h))
69headers-$(PTHREADS_DEBUG_SUPPORT) += $(linuxthreads_db_headers)
70
71objclean-y += CLEAN_libpthread/linuxthreads.old_db
72headers_clean-y += HEADERCLEAN_libpthread/linuxthreads.old_db
73
74HEADERCLEAN_libpthread/linuxthreads.old_db:
75 $(do_rm) $(linuxthreads_db_headers)
76
77CLEAN_libpthread/linuxthreads.old_db:
78 $(do_rm) $(addprefix $(libthread_db_OUT)/*., o os oS a)