summaryrefslogtreecommitdiff
path: root/libpthread
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2005-11-17 22:56:02 +0000
committerPeter S. Mazinger <ps.m@gmx.net>2005-11-17 22:56:02 +0000
commit0a7b9d5d57021e616dc5e4b5dfaa3b93131381af (patch)
treec8f59bd3d11749d7512393e5e34e17a7270c5bc6 /libpthread
parentc24e561a344c12f829ffffbf1b5b7b179409b0da (diff)
Include all lib*/Makefile.in in top_srcdir/Makefile.in, allows adding foreign objects to a lib
Diffstat (limited to 'libpthread')
-rw-r--r--libpthread/Makefile.in54
-rw-r--r--libpthread/linuxthreads.old/Makefile.in95
-rw-r--r--libpthread/linuxthreads.old/sysdeps/sh64/Makefile.arch20
-rw-r--r--libpthread/linuxthreads.old_db/Makefile.in63
4 files changed, 119 insertions, 113 deletions
diff --git a/libpthread/Makefile.in b/libpthread/Makefile.in
index 1ce452c1b..4772cba32 100644
--- a/libpthread/Makefile.in
+++ b/libpthread/Makefile.in
@@ -5,57 +5,5 @@
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-ifeq ($(UCLIBC_HAS_THREADS),y)
-ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
-DIRS:= $(PTNAME) $(PTNAME)_db
-libs: subdirs
-else
-# both do not work at once
include $(PTDIR)/Makefile.in
-#include $(PTDIR)_db/Makefile.in
-endif
-
-headers-y+=threads_headers
-
-# NPTL does not have a generic pthreadtypes.h
-# and each arch has to have both semaphore.h/pthreadtypes.h ?
-threads_headers:
- $(LN) -sf $(PTDIR)/sysdeps/pthread/pthread.h $(top_builddir)include/
- $(LN) -sf $(PTDIR)/semaphore.h $(top_builddir)include/
-ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
- $(LN) -sf $(PTDIR)_db/thread_db.h $(top_builddir)include/
-endif
-ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
- $(LN) -sf ../$(PTDIR)/sysdeps/unix/sysv/linux/$(TARGET_ARCH)/bits/semaphore.h $(top_builddir)include/bits/
- $(LN) -sf ../$(PTDIR)/sysdeps/unix/sysv/linux/$(TARGET_ARCH)/bits/pthreadtypes.h $(top_builddir)include/bits/
- $(LN) -sf ../$(PTDIR)/sysdeps/pthread/bits/libc-lock.h $(top_builddir)include/bits/
- $(LN) -sf ../$(PTDIR)/sysdeps/pthread/bits/stdio-lock.h $(top_builddir)include/bits/
-else
- $(LN) -sf ../$(PTDIR)/sysdeps/pthread/bits/pthreadtypes.h $(top_builddir)include/bits/
-endif
-
-endif
-
-headers_clean-y+=threads_headers_clean
-
-threads_headers_clean:
- $(RM) $(top_builddir)include/pthread.h $(top_builddir)include/semaphore.h \
- $(top_builddir)include/thread_db.h \
- $(top_builddir)include/bits/pthreadtypes.h $(top_builddir)include/bits/semaphore.h \
- $(top_builddir)include/bits/libc-lock.h $(top_builddir)include/bits/stdio-lock
-# note to sjhill: the clean target shouldn't depend on PTNAME/PTDIR
-ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
- $(RM) $(PTNAME)/version.h $(PTDIR)/banner.h \
- $(PTDIR)/sysdeps/unix/sysv/linux/rtld-libc-lowlevellock.c
-endif
-
-objclean-y+=libpthread_gen_clean
-
-libpthread_gen_clean:
- $(RM) $(top_builddir)libpthread/*/*.{o,os,a}
-
-ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
-subdirs: $(patsubst %, _dir_%, $(DIRS))
-$(patsubst %, _dir_%, $(DIRS)):
- $(MAKE) -C $(patsubst _dir_%, %, $@)
-endif
+include $(PTDIR)_db/Makefile.in
diff --git a/libpthread/linuxthreads.old/Makefile.in b/libpthread/linuxthreads.old/Makefile.in
index ca3ded8f6..98ef6307b 100644
--- a/libpthread/linuxthreads.old/Makefile.in
+++ b/libpthread/linuxthreads.old/Makefile.in
@@ -6,57 +6,94 @@
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-CFLAGS+=$(SSP_ALL_CFLAGS)
+CFLAGS-linuxthreads.old := -DNOT_IN_libc $(SSP_ALL_CFLAGS)
-# This stuff will not compile without at least -O1
-CFLAGS:=$(CFLAGS:-O0=-O1)
-
-LDFLAGS:=$(LDFLAGS_NOSTRIP) -z defs
+CFLAGS-libpthread/linuxthreads.old/sysdeps/$(TARGET_ARCH)/ := $(CFLAGS-linuxthreads.old)
-ifeq ($(UCLIBC_CTOR_DTOR),y)
-SHARED_START_FILES:=$(top_builddir)lib/crti.o $(LIBGCC_DIR)crtbeginS.o
-SHARED_END_FILES:=$(LIBGCC_DIR)crtendS.o $(top_builddir)lib/crtn.o
-endif
+# This stuff will not compile without at least -O1
+# psm: can't handle this here, could maybe search for -O0 in CFLAGS
+# and append -O1 if found
+#CFLAGS:=$(CFLAGS:-O0=-O1)
ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
-STRIP_FLAGS:=-X --strip-debug -R .note -R .comment
+LDFLAGS-libpthread.so := $(LDFLAGS_NOSTRIP) -z defs
+else
+LDFLAGS-libpthread.so := $(LDFLAGS)
endif
-DOMULTI=n
+LIBS-libpthread.so := $(LIBS)
-LIB_NAME:=libpthread
+START_FILE-libpthread.so := $(SHARED_START_FILES)
+END_FILE-libpthread.so := $(SHARED_END_FILES)
-libpthread_DIR:=$(top_srcdir)libpthread/linuxthreads.old
-libpthread_OUT:=$(top_builddir)libpthread/linuxthreads.old
+libpthread_FULL_NAME := libpthread-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so
+
+libpthread_DIR := $(top_srcdir)libpthread/linuxthreads.old
+libpthread_OUT := $(top_builddir)libpthread/linuxthreads.old
-ARCH_CFLAGS:=$(CFLAGS)
-include $(libpthread_DIR)/sysdeps/$(TARGET_ARCH)/Makefile.arch
-CFLAGS:=$(ARCH_CFLAGS)
-libpthread_SRC:=$(wildcard $(libpthread_DIR)/*.c)
+libpthread_SRC := $(wildcard $(libpthread_DIR)/*.c)
ifneq ($(UCLIBC_HAS_XLOCALE),y)
-libpthread_SRC:=$(filter-out $(libpthread_DIR)/locale.c,$(libpthread_SRC))
+libpthread_SRC := $(filter-out $(libpthread_DIR)/locale.c,$(libpthread_SRC))
endif
ifneq ($(DOMULTI),n)
-libpthread_NO_MULTI:=manager.c pt-machine.c
-libpthread_SRC:=$(filter-out $(patsubst %.c,$(libpthread_DIR)/%.c,$(libpthread_NO_MULTI)),$(libpthread_SRC))
+libpthread_NO_MULTI := manager.c pt-machine.c
+libpthread_SRC := $(filter-out $(patsubst %.c,$(libpthread_DIR)/%.c,$(libpthread_NO_MULTI)),$(libpthread_SRC))
endif
# remove generic sources, if arch specific version is present
ifneq ($(strip $(libpthread_ARCH_SRC)),)
-libpthread_SRC:=$(filter-out $(patsubst %.c,$(libpthread_DIR)/%.c,$(notdir $(libpthread_ARCH_SRC))),$(libpthread_SRC))
+libpthread_SRC := $(filter-out $(patsubst %.c,$(libpthread_DIR)/%.c,$(notdir $(libpthread_ARCH_SRC))),$(libpthread_SRC))
+endif
+
+libpthread_OBJ := $(patsubst $(libpthread_DIR)/%.c,$(libpthread_OUT)/%.o,$(libpthread_SRC))
+
+libpthread-a-y += $(libpthread_OBJ)
+libpthread-so-y += $(libpthread_OBJ:.o=.os)
+
+libpthread-multi-y += $(libpthread_SRC)
+libpthread-nomulti-y += $(patsubst %.c,$(libpthread_OUT)/%.o,$(libpthread_NO_MULTI))
+
+lib-a-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.a
+lib-so-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.so
+objclean-y += libpthread_clean
+headers-$(UCLIBC_HAS_THREADS) += linuxthreads_headers
+headers_clean-y += linuxthreads_headers_clean
+
+$(top_builddir)lib/libpthread.so: $(libpthread_OUT)/libpthread_so.a libc-y
+ $(call link.so,$(libpthread_FULL_NAME),$(MAJOR_VERSION))
+
+$(libpthread_OUT)/libpthread_so.a: $(libpthread-so-y)
+ $(Q)$(RM) $@
+ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
+ $(do_strip:-x=-X --strip-debug)
+else
+ $(do_strip)
endif
+ $(do_ar)
-libpthread_OBJ:=$(patsubst $(libpthread_DIR)/%.c,$(libpthread_OUT)/%.o,$(libpthread_SRC))
+ifeq ($(DOPIC),y)
+$(top_builddir)lib/libpthread.a: $(libpthread-a-y:.o=.os)
+else
+$(top_builddir)lib/libpthread.a: $(libpthread-a-y)
+endif
+ $(Q)$(INSTALL) -d $(dir $@)
+ $(Q)$(RM) $@
+ $(do_strip)
+ $(do_ar)
-libpthread-a-$(UCLIBC_HAS_THREADS)+=$(libpthread_OBJ)
-libpthread-so-$(UCLIBC_HAS_THREADS)+=$(libpthread_OBJ:.o=.os)
+linuxthreads_headers:
+ $(LN) -sf ../$(PTDIR)/sysdeps/pthread/pthread.h $(top_builddir)include/
+ $(LN) -sf ../$(PTDIR)/semaphore.h $(top_builddir)include/
+ $(INSTALL) -d $(top_builddir)include/bits
+ $(LN) -sf ../../$(PTDIR)/sysdeps/pthread/bits/pthreadtypes.h $(top_builddir)include/bits/
-libpthread-multi-$(UCLIBC_HAS_THREADS)+=$(libpthread_SRC)
-libpthread-nomulti-$(UCLIBC_HAS_THREADS)+=$(patsubst %.c,$(libpthread_OUT)/%.o,$(libpthread_NO_MULTI))
-objclean-y+=libpthread_clean
+linuxthreads_headers_clean:
+ $(RM) $(top_builddir)include/pthread.h $(top_builddir)include/semaphore.h \
+ $(top_builddir)include/bits/pthreadtypes.h
-lib-a-$(UCLIBC_HAS_THREADS)+=$(top_builddir)lib/libpthread.a
-lib-so-$(UCLIBC_HAS_THREADS)+=$(top_builddir)lib/libpthread.so
+libpthread_clean:
+ $(RM) $(libpthread_OUT)/*.{o,os,a}
diff --git a/libpthread/linuxthreads.old/sysdeps/sh64/Makefile.arch b/libpthread/linuxthreads.old/sysdeps/sh64/Makefile.arch
index 38cd12db6..e4cb95b76 100644
--- a/libpthread/linuxthreads.old/sysdeps/sh64/Makefile.arch
+++ b/libpthread/linuxthreads.old/sysdeps/sh64/Makefile.arch
@@ -6,21 +6,25 @@
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-# We need to build as SHcompact for tas..
-ARCH_CFLAGS:=$(subst 32media,compact,$(ARCH_CFLAGS))
-
-libpthread_ARCH_DIR:=$(top_srcdir)libpthread/linuxthreads/sysdeps/sh64
-libpthread_ARCH_OUT:=$(top_builddir)libpthread/linuxthreads/sysdeps/sh64
+libpthread_ARCH_DIR:=$(top_srcdir)libpthread/linuxthreads.old/sysdeps/sh64
+libpthread_ARCH_OUT:=$(top_builddir)libpthread/linuxthreads.old/sysdeps/sh64
libpthread_ARCH_SRC:=$(wildcard $(libpthread_ARCH_DIR)/*.c)
libpthread_ARCH_OBJ:=$(patsubst $(libpthread_ARCH_DIR)/%.c,$(libpthread_ARCH_OUT)/%.o,$(libpthread_ARCH_SRC))
-libpthread-a-$(UCLIBC_HAS_THREADS)+=$(libpthread_ARCH_OBJ)
-libpthread-so-$(UCLIBC_HAS_THREADS)+=$(libpthread_ARCH_OBJ:.o=.os)
+libpthread-a-y+=$(libpthread_ARCH_OBJ)
+libpthread-so-y+=$(libpthread_ARCH_OBJ:.o=.os)
-libpthread-multi-$(UCLIBC_HAS_THREADS)+=$(libpthread_ARCH_SRC)
+libpthread-multi-y+=$(libpthread_ARCH_SRC)
objclean-y+=libpthread_arch_objclean
+# We need to build as SHcompact for tas..
+$(libpthread_ARCH_OBJ): %.o : %.c
+ $(compile.c:32media=compact)
+
+$(libpthread_ARCH_OBJ:.o=.os): %.os : %.c
+ $(compile.c:32media=compact)
+
libpthread_arch_objclean:
$(RM) $(libpthread_ARCH_OUT)/*.{o,os}
diff --git a/libpthread/linuxthreads.old_db/Makefile.in b/libpthread/linuxthreads.old_db/Makefile.in
index ec007e90a..af42ed312 100644
--- a/libpthread/linuxthreads.old_db/Makefile.in
+++ b/libpthread/linuxthreads.old_db/Makefile.in
@@ -5,39 +5,56 @@
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-#CFLAGS+=$(SSP_ALL_CFLAGS)
-
-PT_MAJOR_VERSION:=$(MAJOR_VERSION)
# Get the thread include dependencies and shared object name
-CFLAGS+=-DLIBPTHREAD_SO="\"libpthread.so.$(PT_MAJOR_VERSION)\""
+CFLAGS-linuxthreads_db.old := -DLIBPTHREAD_SO="\"libpthread.so.$(MAJOR_VERSION)\""
-# Remove any -z defs since this lib will have undefined symbols
-LDFLAGS:=$(LDFLAGS_NOSTRIP) -s --warn-unresolved-symbols
+LDFLAGS-libthread_db.so := $(LDFLAGS_NOSTRIP) -s --warn-unresolved-symbols
-ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
-STRIP_FLAGS:=-X --strip-debug -R .note -R .comment
-endif
+LIBS-libthread_db.so := $(LIBS)
+
+libthread_db_FULL_NAME := libthread_db-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so
-DOMULTI=n
+libthread_db_DIR := $(top_srcdir)libpthread/linuxthreads_db.old
+libthread_db_OUT := $(top_builddir)libpthread/linuxthreads_db.old
-LIB_NAME:=libthread_db
-libthread_db_FULL_NAME:=$(LIB_NAME)-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so
+libthread_db_SRC := $(wildcard $(libthread_db_DIR)/*.c)
-MAJOR_VERSION:=1
+libthread_db_OBJ := $(patsubst $(libthread_db_DIR)/%.c,$(libthread_db_OUT)/%.o,$(libthread_db_SRC))
-libthread_db_DIR:=$(top_srcdir)libpthread/linuxthreads.old_db
-libthread_db_OUT:=$(top_builddir)libpthread/linuxthreads.old_db
+libthread_db-a-y := $(libthread_db_OBJ)
+libthread_db-so-y := $(libthread_db_OBJ:.o=.os)
-libthread_db_SRC:=$(wildcard $(libthread_db_DIR)/*.c)
+libthread_db-multi-y := $(libthread_db_SRC)
-libthread_db_OBJ:=$(patsubst $(libthread_db_DIR)/%.c,$(libthread_db_OUT)/%.o,$(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) += linuxthreads_db_headers
+headers_clean-y += linuxthreads_db_headers_clean
-libthread_db-a-$(PTHREADS_DEBUG_SUPPORT)+=$(libthread_db_OBJ)
-libthread_db-so-$(PTHREADS_DEBUG_SUPPORT)+=$(libthread_db_OBJ:.o=.os)
+$(top_builddir)lib/libthread_db.so: $(libthread_db_OUT)/libthread_db_so.a libc-y
+ $(call link.so,$(libthread_db_FULL_NAME),1,,$(EXTRA_LINK_LIBS),,)
+
+$(libthread_db_OUT)/libthread_db_so.a: $(libthread_db-so-y)
+ $(Q)$(RM) $@
+ $(do_strip)
+ $(do_ar)
+
+ifeq ($(DOPIC),y)
+$(top_builddir)lib/libthread_db.a: $(libthread_db-a-y:.o=.os)
+else
+$(top_builddir)lib/libthread_db.a: $(libpthread_db-a-y)
+endif
+ $(Q)$(INSTALL) -d $(dir $@)
+ $(Q)$(RM) $@
+ $(do_strip)
+ $(do_ar)
-libthread_db-multi-$(PTHREADS_DEBUG_SUPPORT)+=$(libthread_db_SRC)
+linuxthreads_db_headers:
+ $(LN) -sf ../$(PTDIR)_db/thread_db.h $(top_builddir)include/
-objclean-y+=libthread_db_clean
+linuxthreads_db_headers_clean:
+ $(RM) $(top_builddir)include/thread_db.h
-lib-a-$(PTHREADS_DEBUG_SUPPORT)+=$(top_builddir)lib/libthread_db.a
-lib-so-$(PTHREADS_DEBUG_SUPPORT)+=$(top_builddir)lib/libthread_db.so
+libthread_db_clean:
+ $(RM) $(libthread_db_OUT)/*.{o,os,a}