X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=libpthread%2FMakefile;h=60ad7563d6f09044f67887df7091d4bc7dd135be;hb=f70602be19ff8042c369ea33b29f90b8c0f5d02e;hp=f844ee82adcfc158876f7fbc4d4c7fd153613bb3;hpb=4643b181bdf1d9121f9d6d4214e991e7b9f52d30;p=uclinux-h8%2Fuclibc-ng.git diff --git a/libpthread/Makefile b/libpthread/Makefile index f844ee82a..60ad7563d 100644 --- a/libpthread/Makefile +++ b/libpthread/Makefile @@ -1,7 +1,6 @@ -# Makefile for uClibc +# Makefile for uClibc's pthread library # -# Copyright (C) 2000 by by Lineo, inc. and Erik Andersen -# Copyright (C) 2000, 2001 by Erik Andersen +# Copyright (C) 2002 Erik Andersen # # 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 @@ -16,46 +15,55 @@ # You should have received a copy of the GNU Library General Public License # along with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# Derived in part from the Linux-8086 C library, the GNU C Library, and several -# other sundry sources. Files within this library are copyright by their -# respective copyright holders. TOPDIR=../ include $(TOPDIR)Rules.mak -LIBPTHREAD=libpthread.a -LIBPTHREAD_SHARED=libpthread.so -LIBPTHREAD_SHARED_FULLNAME=libpthread-$(MAJOR_VERSION).$(MINOR_VERSION).so +ALL_SUBDIRS = linuxthreads linuxthreads_db -CSRC = pthread.c -OBJS=$(patsubst %.c,%.o, $(CSRC)) +DIRS=linuxthreads +ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y) + DIRS+=linuxthreads_db +endif -all: $(OBJS) $(LIBPTHREAD) +all: subdirs -$(LIBPTHREAD): ar-target +headers: +ifeq ($(strip $(UCLIBC_HAS_THREADS_NATIVE)),y) + $(LN) -sf $(TOPDIR)libpthread/nptl/sysdeps/pthread/pthread.h $(TOPDIR)include/ + $(LN) -sf $(TOPDIR)libpthread/nptl/semaphore.h $(TOPDIR)include/ + $(LN) -sf ../$(TOPDIR)libpthread/nptl/sysdeps/unix/sysv/linux/$(TARGET_ARCH)/bits/semaphore.h $(TOPDIR)include/bits/ + $(LN) -sf ../$(TOPDIR)libpthread/nptl/sysdeps/unix/sysv/linux/$(TARGET_ARCH)/bits/pthreadtypes.h $(TOPDIR)include/bits/ + $(LN) -sf ../$(TOPDIR)libpthread/nptl/sysdeps/pthread/bits/libc-lock.h $(TOPDIR)include/bits/ + $(LN) -sf ../$(TOPDIR)libpthread/nptl/sysdeps/pthread/bits/stdio-lock.h $(TOPDIR)include/bits/ +ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y) + $(LN) -sf $(TOPDIR)libpthread/nptl_db/thread_db.h $(TOPDIR)include/ +endif +else + $(LN) -sf $(TOPDIR)libpthread/linuxthreads/sysdeps/pthread/pthread.h $(TOPDIR)include/ + $(LN) -sf $(TOPDIR)libpthread/linuxthreads/semaphore.h $(TOPDIR)include/ + $(LN) -sf ../$(TOPDIR)libpthread/linuxthreads/sysdeps/pthread/bits/pthreadtypes.h $(TOPDIR)include/bits/ +ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y) + $(LN) -sf $(TOPDIR)libpthread/linuxthreads_db/thread_db.h $(TOPDIR)include/ +endif +endif -ar-target: $(OBJS) - $(AR) $(ARFLAGS) $(LIBPTHREAD) $(OBJS) - install -d $(TOPDIR)lib - rm -f $(TOPDIR)lib/$(LIBPTHREAD) - install -m 644 $(LIBPTHREAD) $(TOPDIR)lib +tags: + ctags -R -$(OBJS): %.o : %.c - $(TARGET_CC) $(TARGET_CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o +subdirs: $(patsubst %, _dir_%, $(DIRS)) +subdirs_clean: $(patsubst %, _dirclean_%, $(ALL_SUBDIRS)) -$(OBJ): Makefile +$(patsubst %, _dir_%, $(DIRS)) : dummy + $(MAKE) -C $(patsubst _dir_%, %, $@) -shared: all - $(TARGET_CC) $(TARGET_LDFLAGS) -nostdlib -shared -o $(LIBPTHREAD_SHARED_FULLNAME) \ - -Wl,-soname,$(LIBPTHREAD_SHARED).$(MAJOR_VERSION) -Wl,--whole-archive $(LIBPTHREAD) -lc - install -d $(TOPDIR)lib - rm -f $(TOPDIR)lib/$(LIBPTHREAD_SHARED_FULLNAME) $(TOPDIR)lib/$(LIBPTHREAD_SHARED).$(MAJOR_VERSION) - install -m 644 $(LIBPTHREAD_SHARED_FULLNAME) $(TOPDIR)lib; - (cd $(TOPDIR)lib && ln -sf $(LIBPTHREAD_SHARED_FULLNAME) $(LIBPTHREAD_SHARED)); - (cd $(TOPDIR)lib && ln -sf $(LIBPTHREAD_SHARED_FULLNAME) $(LIBPTHREAD_SHARED).$(MAJOR_VERSION)); +$(patsubst %, _dirclean_%, $(ALL_SUBDIRS)) : dummy + $(MAKE) -C $(patsubst _dirclean_%, %, $@) clean -clean: - rm -f *.[oa] *~ core $(LIBPTHREAD_SHARED)* $(LIBPTHREAD_SHARED_FULLNAME)* +clean: subdirs_clean + $(RM) $(TOPDIR)include/pthread.h $(TOPDIR)include/semaphore.h \ + $(TOPDIR)include/thread_db.h \ + $(TOPDIR)include/bits/pthreadtypes.h $(TOPDIR)include/bits/semaphore.h \ + $(TOPDIR)include/bits/libc-lock.h $(TOPDIR)include/bits/stdio-lock +.PHONY: dummy