OSDN Git Service

Peter Kjellerstedt writes:
[uclinux-h8/uClibc.git] / libpthread / linuxthreads / 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 # Makefile for uClibc
19
20 TOPDIR=../../
21 include $(TOPDIR)Rules.mak
22
23 #Adjust the soname version to avoid namespace collisions with glibc's libpthread
24 LIBPTHREAD:=../libpthread.a
25 ifeq ($(strip $(TARGET_ARCH)),sparc)
26 SYSDEPS_DIR:=$(TARGET_ARCH)/sparc32
27 else
28 SYSDEPS_DIR:=$(TARGET_ARCH)
29 endif
30 #This stuff will not compile without at least -O1
31 CFLAGS :=$(CFLAGS:-O0=-O1)
32
33
34 # set up system dependencies include dirs (NOTE: order matters!)
35 PTDIR = $(TOPDIR)libpthread/linuxthreads/
36 SYSDEPINC = -I$(PTDIR)sysdeps/unix/sysv/linux \
37             -I$(PTDIR)sysdeps/pthread \
38             -I$(PTDIR)sysdeps/unix/sysv \
39             -I$(PTDIR)sysdeps/unix/unix \
40             -I$(PTDIR)sysdeps/$(TARGET_ARCH) \
41             -I$(PTDIR)sysdeps \
42             -I$(TOPDIR)libc/sysdeps/linux/$(TARGET_ARCH)
43 CFLAGS += $(SYSDEPINC)
44
45 CSRC=attr.c cancel.c condvar.c errno.c events.c join.c lockfile.c manager.c \
46         mutex.c oldsemaphore.c pt-machine.c ptfork.c pthread.c \
47         ptlongjmp.c rwlock.c semaphore.c signals.c specific.c spinlock.c \
48         wrapsyscall.c #weaks.c
49
50 ifeq ($(UCLIBC_HAS_XLOCALE),y)
51         CSRC += locale.c
52 endif
53
54 COBJS=$(patsubst %.c,%.o, $(CSRC))
55 OBJS=$(COBJS)
56
57 all: $(OBJS) $(LIBPTHREAD)
58
59 $(LIBPTHREAD): ar-target
60
61 ar-target: $(OBJS)
62         $(AR) $(ARFLAGS) $(LIBPTHREAD) $(OBJS)
63
64 $(COBJS): %.o : %.c
65         $(CC) $(CFLAGS) -c $< -o $@
66 ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y)
67         $(STRIPTOOL) -X --strip-debug -R .note -R .comment $*.o
68 else
69         $(STRIPTOOL) -x -R .note -R .comment $*.o
70 endif
71
72 clean:
73         $(RM) *.[oa] *~ core
74
75