OSDN Git Service

60ad7563d6f09044f67887df7091d4bc7dd135be
[uclinux-h8/uclibc-ng.git] / libpthread / Makefile
1 # Makefile for uClibc's pthread library
2 #
3 # Copyright (C) 2002 Erik Andersen <andersen@uclibc.org>
4 #
5 # This program is free software; you can redistribute it and/or modify it under
6 # the terms of the GNU Library General Public License as published by the Free
7 # Software Foundation; either version 2 of the License, or (at your option) any
8 # later version.
9 #
10 # This program is distributed in the hope that it will be useful, but WITHOUT
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 # FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
13 # details.
14 #
15 # You should have received a copy of the GNU Library General Public License
16 # along with this program; if not, write to the Free Software Foundation, Inc.,
17 # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
19 TOPDIR=../
20 include $(TOPDIR)Rules.mak
21
22 ALL_SUBDIRS = linuxthreads linuxthreads_db
23
24 DIRS=linuxthreads
25 ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y)
26         DIRS+=linuxthreads_db
27 endif
28
29 all: subdirs
30
31 headers:
32 ifeq ($(strip $(UCLIBC_HAS_THREADS_NATIVE)),y)
33         $(LN) -sf $(TOPDIR)libpthread/nptl/sysdeps/pthread/pthread.h $(TOPDIR)include/
34         $(LN) -sf $(TOPDIR)libpthread/nptl/semaphore.h $(TOPDIR)include/
35         $(LN) -sf ../$(TOPDIR)libpthread/nptl/sysdeps/unix/sysv/linux/$(TARGET_ARCH)/bits/semaphore.h $(TOPDIR)include/bits/
36         $(LN) -sf ../$(TOPDIR)libpthread/nptl/sysdeps/unix/sysv/linux/$(TARGET_ARCH)/bits/pthreadtypes.h $(TOPDIR)include/bits/
37         $(LN) -sf ../$(TOPDIR)libpthread/nptl/sysdeps/pthread/bits/libc-lock.h $(TOPDIR)include/bits/
38         $(LN) -sf ../$(TOPDIR)libpthread/nptl/sysdeps/pthread/bits/stdio-lock.h $(TOPDIR)include/bits/
39 ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y)
40         $(LN) -sf $(TOPDIR)libpthread/nptl_db/thread_db.h $(TOPDIR)include/
41 endif
42 else
43         $(LN) -sf $(TOPDIR)libpthread/linuxthreads/sysdeps/pthread/pthread.h $(TOPDIR)include/
44         $(LN) -sf $(TOPDIR)libpthread/linuxthreads/semaphore.h $(TOPDIR)include/
45         $(LN) -sf ../$(TOPDIR)libpthread/linuxthreads/sysdeps/pthread/bits/pthreadtypes.h $(TOPDIR)include/bits/
46 ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y)
47         $(LN) -sf $(TOPDIR)libpthread/linuxthreads_db/thread_db.h $(TOPDIR)include/
48 endif
49 endif
50
51 tags:
52         ctags -R
53
54 subdirs: $(patsubst %, _dir_%, $(DIRS))
55 subdirs_clean: $(patsubst %, _dirclean_%, $(ALL_SUBDIRS))
56
57 $(patsubst %, _dir_%, $(DIRS)) : dummy
58         $(MAKE) -C $(patsubst _dir_%, %, $@)
59
60 $(patsubst %, _dirclean_%, $(ALL_SUBDIRS)) : dummy
61         $(MAKE) -C $(patsubst _dirclean_%, %, $@) clean
62
63 clean: subdirs_clean
64         $(RM)   $(TOPDIR)include/pthread.h $(TOPDIR)include/semaphore.h \
65                 $(TOPDIR)include/thread_db.h \
66                 $(TOPDIR)include/bits/pthreadtypes.h $(TOPDIR)include/bits/semaphore.h \
67                 $(TOPDIR)include/bits/libc-lock.h $(TOPDIR)include/bits/stdio-lock
68
69 .PHONY: dummy