summaryrefslogtreecommitdiff
path: root/libpthread/linuxthreads/Makefile
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2003-12-05 20:39:51 +0000
committerEric Andersen <andersen@codepoet.org>2003-12-05 20:39:51 +0000
commit337011435791b543f52786b085c3c5c298490acd (patch)
tree0602b88984ccfabc14260878ff2ec10c949bb549 /libpthread/linuxthreads/Makefile
parent91a32cb9815ca525726168750566d9acdb099a73 (diff)
Paul Mundt <lethal@linux-sh.org> writes:
This patch adds the libpthread backend bits for sh64. As noted previously, we can't inline things like the testandset() in pt-machine.h as we need to use a completely different ISA / CFLAGS in order for this to work. As a result, this patch is somewhat of a RFC as well to see what people think of the libpthread/linuxthreads/sysdeps Makefile approach, etc. The approach I've taken currently has been to provide a sysdeps/Makefile with a note that TARGET_ARCHs that want build rules can simply add themselves into the list of matching architectures to add to the subdir rule for. This probably isn't the cleanest solution, but it's quite transparent and works quite well.
Diffstat (limited to 'libpthread/linuxthreads/Makefile')
-rw-r--r--libpthread/linuxthreads/Makefile17
1 files changed, 15 insertions, 2 deletions
diff --git a/libpthread/linuxthreads/Makefile b/libpthread/linuxthreads/Makefile
index 7d62879eb..e43f05ea5 100644
--- a/libpthread/linuxthreads/Makefile
+++ b/libpthread/linuxthreads/Makefile
@@ -1,6 +1,7 @@
# Makefile for uClibc's pthread library
#
# Copyright (C) 2002 Erik Andersen <andersen@uclibc.org>
+# Copyright (C) 2003 Paul Mundt <lethal@linux-sh.org>
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU Library General Public License as published by the Free
@@ -20,6 +21,8 @@
TOPDIR=../../
include $(TOPDIR)Rules.mak
+DIRS = sysdeps
+
#Adjust the soname version to avoid namespace collisions with glibc's libpthread
LIBPTHREAD:=../libpthread.a
ifeq ($(strip $(TARGET_ARCH)),sparc)
@@ -56,7 +59,7 @@ OBJS=$(COBJS)
all: $(OBJS) $(LIBPTHREAD)
-$(LIBPTHREAD): ar-target
+$(LIBPTHREAD): ar-target subdirs
ar-target: $(OBJS)
$(AR) $(ARFLAGS) $(LIBPTHREAD) $(OBJS)
@@ -69,7 +72,17 @@ else
$(STRIPTOOL) -x -R .note -R .comment $*.o
endif
-clean:
+clean: subdirs_clean
$(RM) *.[oa] *~ core
+subdirs: $(patsubst %, _dir_%, $(DIRS))
+subdirs_clean: $(patsubst %, _dirclean_%, $(DIRS))
+
+$(patsubst %, _dir_%, $(DIRS)) : dummy
+ $(MAKE) -C $(patsubst _dir_%, %, $@)
+
+$(patsubst %, _dirclean_%, $(DIRS)) : dummy
+ $(MAKE) -C $(patsubst _dirclean_%, %, $@) clean
+
+.PHONY: dummy subdirs