OSDN Git Service

pt-allocrtsig.c is irrelevant for now, remove related too, add libc_hidden_proto...
[uclinux-h8/uClibc.git] / libpthread / linuxthreads / Makefile.in
1 # Makefile for uClibc
2 #
3 # Copyright (C) 2003 Paul Mundt <lethal@linux-sh.org>
4 # Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
5 #
6 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
7 #
8
9 CFLAGS-linuxthreads := -DNOT_IN_libc -DIS_IN_libpthread $(SSP_ALL_CFLAGS)
10
11 CFLAGS-libpthread/linuxthreads/sysdeps/$(TARGET_ARCH)/ := $(CFLAGS-linuxthreads)
12 CFLAGS-libpthread/linuxthreads/sysdeps/unix/sysv/linux/ := $(CFLAGS-linuxthreads)
13 CFLAGS-libpthread/linuxthreads/sysdeps/pthread/         := $(CFLAGS-linuxthreads)
14
15 # This stuff will not compile without at least -O1
16 # psm: can't handle this here, could maybe search for -O0 in CFLAGS
17 # and append -O1 if found
18 #CFLAGS:=$(CFLAGS:-O0=-O1)
19
20 ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
21 LDFLAGS-libpthread.so := $(LDFLAGS_NOSTRIP) -z defs
22 else
23 LDFLAGS-libpthread.so := $(LDFLAGS)
24 endif
25
26 LIBS-libpthread.so := $(LIBS) $(ldso)
27
28 START_FILE-libpthread.so := $(SHARED_START_FILES)
29 END_FILE-libpthread.so := $(SHARED_END_FILES)
30
31 libpthread_FULL_NAME := libpthread-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so
32
33 libpthread_DIR := $(top_srcdir)libpthread/linuxthreads
34 libpthread_OUT := $(top_builddir)libpthread/linuxthreads
35
36 -include $(libpthread_DIR)/sysdeps/$(TARGET_ARCH)/Makefile.arch
37
38 pthread_arch_SRC   := pspinlock
39 pthread_arch_SRC   := $(patsubst %,$(libpthread_DIR)/sysdeps/$(TARGET_ARCH)/%.c,$(pthread_arch_SRC))
40 pthread_linux_SRC  := fork pt-sigsuspend register-atfork unregister-atfork
41 pthread_linux_SRC  := $(patsubst %,$(libpthread_DIR)/sysdeps/unix/sysv/linux/%.c,$(pthread_linux_SRC))
42 pthread_sysdep_SRC := errno-loc herrno-loc ptlongjmp
43 pthread_sysdep_SRC := $(patsubst %,$(libpthread_DIR)/sysdeps/pthread/%.c,$(pthread_sysdep_SRC))
44 pthread_SRC := \
45         attr barrier cancel condvar errno events join pthread \
46         lockfile manager mutex pt-machine ptcleanup \
47         ptclock_gettime ptclock_settime ptfork pthandles \
48         pthread_setegid pthread_seteuid pthread_setgid pthread_setregid \
49         pthread_setresgid pthread_setresuid pthread_setreuid pthread_setuid \
50         rwlock semaphore sighandler signals specific spinlock
51 pthread_SRC := $(patsubst %,$(libpthread_DIR)/%.c,$(pthread_SRC))
52
53 libpthread_static_SRC := pthread_atfork
54 libpthread_SRC := $(pthread_arch_SRC) $(pthread_linux_SRC) $(pthread_sysdep_SRC) $(pthread_SRC)
55 libpthread_OBJ := $(patsubst $(libpthread_DIR)/%.c,$(libpthread_OUT)/%.o,$(libpthread_SRC))
56
57 #
58 # Stuff that goes into libc.so, not libpthread.so
59 #
60 #CFLAGS-alloca_cutoff.c := -DIS_IN_libc
61 CFLAGS-forward.c := -DIS_IN_libc
62 CFLAGS-libc-cancellation.c := -DIS_IN_libc
63 CFLAGS-libc_pthread_init.c := -DIS_IN_libc
64 libpthread_libc_CSRC := \
65         forward.c libc-cancellation.c libc_pthread_init.c # alloca_cutoff.c
66 libpthread_libc_OBJ  := $(patsubst %.c, $(libpthread_OUT)/%.o,$(libpthread_libc_CSRC))
67 libc-static-y += $(libpthread_OUT)/libc_pthread_init.o
68 libc-shared-y += $(libpthread_libc_OBJ:.o=.oS)
69
70 libpthread-static-y += $(patsubst %,$(libpthread_OUT)/%.o,$(libpthread_static_SRC))
71
72 ifeq ($(DOPIC),y)
73 libpthread-a-y  += $(libpthread_OBJ:.o=.os) $(libpthread-static-y:.o=.os)
74 else
75 libpthread-a-y  += $(libpthread_OBJ) $(libpthread-static-y)
76 endif
77 libpthread-so-y += $(libpthread_OBJ:.o=.os)
78
79 lib-a-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.a
80 lib-so-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.so
81 objclean-y += libpthread_clean
82 headers-$(UCLIBC_HAS_THREADS) += linuxthreads_headers
83 headers_clean-y += linuxthreads_headers_clean
84
85 ifeq ($(DOMULTI),n)
86 $(top_builddir)lib/libpthread.so: $(libpthread_OUT)/libpthread_so.a $(libc)
87         $(call link.so,$(libpthread_FULL_NAME),$(MAJOR_VERSION))
88 else
89 $(top_builddir)lib/libpthread.so: $(libpthread_OUT)/libpthread.oS $(libc)
90         $(call linkm.so,$(libpthread_FULL_NAME),$(MAJOR_VERSION))
91 endif
92
93 $(libpthread_OUT)/libpthread_so.a: $(libpthread-so-y)
94         $(Q)$(RM) $@
95 ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
96         $(do_strip:-x=-X --strip-debug)
97 else
98         $(do_strip)
99 endif
100         $(do_ar)
101
102 $(libpthread_OUT)/libpthread.oS: $(libpthread_SRC)
103         $(Q)$(RM) $@
104         $(compile-m)
105 ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
106         $(do_t_strip:-x=-X --strip-debug)
107 else
108         $(do_t_strip)
109 endif
110
111 $(top_builddir)lib/libpthread.a: $(libpthread-a-y)
112         $(Q)$(INSTALL) -d $(dir $@)
113         $(Q)$(RM) $@
114 ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
115         $(do_strip:-x=-X --strip-debug)
116 else
117         $(do_strip)
118 endif
119         $(do_ar)
120
121 linuxthreads_headers:
122         $(LN) -sf ../$(PTDIR)/sysdeps/pthread/pthread.h $(top_builddir)include/
123         $(LN) -sf ../$(PTDIR)/semaphore.h $(top_builddir)include/
124         $(INSTALL) -d $(top_builddir)include/bits
125         $(LN) -sf ../../$(PTDIR)/sysdeps/pthread/bits/pthreadtypes.h $(top_builddir)include/bits/
126
127 linuxthreads_headers_clean:
128         $(RM) $(top_builddir)include/pthread.h $(top_builddir)include/semaphore.h \
129                 $(top_builddir)include/bits/pthreadtypes.h
130
131 libpthread_clean:
132         $(RM) $(libpthread_OUT)/{,*/,*/*/,*/*/*/,*/*/*/*/}*.{o,os,oS,a}